mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-22 06:13:23 +08:00
Fix other interface classes naming convention
This commit is contained in:
@@ -2,10 +2,10 @@ import Configuration from "../Configuration"
|
||||
import html from "./html"
|
||||
import sanitizeText from "./sanitizeText"
|
||||
import SelectorElement from "../element/SelectorElement"
|
||||
import Template from "./Template"
|
||||
import ITemplate from "./ITemplate"
|
||||
|
||||
/** @typedef {import("../Blueprint").default} Blueprint */
|
||||
export default class BlueprintTemplate extends Template {
|
||||
export default class BlueprintTemplate extends ITemplate {
|
||||
header(element) {
|
||||
return html`
|
||||
<div class="ueb-viewport-header">
|
||||
|
||||
46
js/template/Template.js → js/template/ITemplate.js
Executable file → Normal file
46
js/template/Template.js → js/template/ITemplate.js
Executable file → Normal file
@@ -1,23 +1,23 @@
|
||||
/**
|
||||
* @typedef {import("../element/IElement").default} IElement
|
||||
*/
|
||||
export default class Template {
|
||||
|
||||
/**
|
||||
* Computes the html content of the target element.
|
||||
* @param {IElement} entity Element of the graph
|
||||
* @returns The result html
|
||||
*/
|
||||
render(entity) {
|
||||
return ""
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies the style to the element.
|
||||
* @param {IElement} element Element of the graph
|
||||
*/
|
||||
apply(element) {
|
||||
// TODO replace with the safer element.setHTML(...) when it will be available
|
||||
element.innerHTML = this.render(element)
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @typedef {import("../element/IElement").default} IElement
|
||||
*/
|
||||
export default class ITemplate {
|
||||
|
||||
/**
|
||||
* Computes the html content of the target element.
|
||||
* @param {IElement} entity Element of the graph
|
||||
* @returns The result html
|
||||
*/
|
||||
render(entity) {
|
||||
return ""
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies the style to the element.
|
||||
* @param {IElement} element Element of the graph
|
||||
*/
|
||||
apply(element) {
|
||||
// TODO replace with the safer element.setHTML(...) when it will be available
|
||||
element.innerHTML = this.render(element)
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
import LinkElement from "../element/LinkElement"
|
||||
import html from "./html"
|
||||
import Template from "./Template"
|
||||
import ITemplate from "./ITemplate"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/LinkMessageElement").default} LinkMessageElement
|
||||
*/
|
||||
export default class LinkMessageTemplate extends Template {
|
||||
export default class LinkMessageTemplate extends ITemplate {
|
||||
|
||||
/**
|
||||
* Computes the html content of the target element.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import html from "./html"
|
||||
import sanitizeText from "./sanitizeText"
|
||||
import Template from "./Template"
|
||||
import ITemplate from "./ITemplate"
|
||||
import Configuration from "../Configuration"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/LinkElement").default} LinkElement
|
||||
* @typedef {import("../element/LinkMessageElement").default} LinkMessageElement
|
||||
*/
|
||||
export default class LinkTemplate extends Template {
|
||||
export default class LinkTemplate extends ITemplate {
|
||||
|
||||
static pixelToUnit(pixels, pixelFullSize) {
|
||||
return pixels * 100 / pixelFullSize
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import Utility from "../Utility"
|
||||
import html from "./html"
|
||||
import sanitizeText from "./sanitizeText"
|
||||
import Template from "./Template"
|
||||
import ITemplate from "./ITemplate"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/PinElement").default} PinElement
|
||||
*/
|
||||
export default class PinTemplate extends Template {
|
||||
export default class PinTemplate extends ITemplate {
|
||||
|
||||
/**
|
||||
* Computes the html content of the pin.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import sanitizeText from "./sanitizeText"
|
||||
import Template from "./Template"
|
||||
import ITemplate from "./ITemplate"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/ISelectableDraggableElement").default} ISelectableDraggableElement
|
||||
*/
|
||||
export default class SelectableDraggableTemplate extends Template {
|
||||
export default class SelectableDraggableTemplate extends ITemplate {
|
||||
|
||||
/**
|
||||
* Returns the html elements rendered from this template.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import sanitizeText from "./sanitizeText"
|
||||
import Template from "./Template"
|
||||
import ITemplate from "./ITemplate"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/SelectorElement").default} SelectorElement
|
||||
*/
|
||||
export default class SelectorTemplate extends Template {
|
||||
export default class SelectorTemplate extends ITemplate {
|
||||
|
||||
/**
|
||||
* Applies the style to the element.
|
||||
|
||||
Reference in New Issue
Block a user