diff --git a/ShadowEditor.UI/rollup.config.js b/ShadowEditor.UI/rollup.config.js index 53cdd991..41b7b7ff 100644 --- a/ShadowEditor.UI/rollup.config.js +++ b/ShadowEditor.UI/rollup.config.js @@ -8,7 +8,7 @@ export default { indent: '\t', format: 'umd', name: 'Shadow', - file: 'ShadowEditor.UI/dist/ShadowUI.js' + file: 'ShadowEditor.UI/dist/ShadowEditor.UI.js' }, treeshake: true, external: [], diff --git a/ShadowEditor.UI/src/index.js b/ShadowEditor.UI/src/index.js index f588d97f..32f8c7f8 100644 --- a/ShadowEditor.UI/src/index.js +++ b/ShadowEditor.UI/src/index.js @@ -1,7 +1,12 @@ import '../assets/css/main.css'; -import UI from './UI'; +// root +import './root/HtmlDom'; -window.UI = UI; +// metadata +import './metadata/Link'; +import './metadata/Meta'; +import './metadata/Style'; +import './metadata/Title'; -export { default as UI } from './UI'; \ No newline at end of file +export { Control, UI } from './third_party'; \ No newline at end of file diff --git a/ShadowEditor.UI/src/metadata/Link.js b/ShadowEditor.UI/src/metadata/Link.js new file mode 100644 index 00000000..c4c725a8 --- /dev/null +++ b/ShadowEditor.UI/src/metadata/Link.js @@ -0,0 +1,21 @@ +import { Control, UI } from '../third_party'; + +/** + * Link + * @author tengge / https://github.com/tengge1 + * @param {*} options + */ +function Link(options = {}) { + Control.call(this, options); +} + +Link.prototype = Object.create(Control.prototype); +Link.prototype.constructor = Link; + +Link.prototype.render = function () { + this.renderDom(this.createElement('link')); +}; + +UI.addXType('link', Link); + +export default Link; \ No newline at end of file diff --git a/ShadowEditor.UI/src/metadata/Meta.js b/ShadowEditor.UI/src/metadata/Meta.js new file mode 100644 index 00000000..2adacde9 --- /dev/null +++ b/ShadowEditor.UI/src/metadata/Meta.js @@ -0,0 +1,21 @@ +import { Control, UI } from '../third_party'; + +/** + * Meta + * @author tengge / https://github.com/tengge1 + * @param {*} options + */ +function Meta(options = {}) { + Control.call(this, options); +} + +Meta.prototype = Object.create(Control.prototype); +Meta.prototype.constructor = Meta; + +Meta.prototype.render = function () { + this.renderDom(this.createElement('meta')); +}; + +UI.addXType('meta', Meta); + +export default Meta; \ No newline at end of file diff --git a/ShadowEditor.UI/src/metadata/Style.js b/ShadowEditor.UI/src/metadata/Style.js new file mode 100644 index 00000000..41a7f2ef --- /dev/null +++ b/ShadowEditor.UI/src/metadata/Style.js @@ -0,0 +1,21 @@ +import { Control, UI } from '../third_party'; + +/** + * Style + * @author tengge / https://github.com/tengge1 + * @param {*} options + */ +function Style(options = {}) { + Control.call(this, options); +} + +Style.prototype = Object.create(Control.prototype); +Style.prototype.constructor = Style; + +Style.prototype.render = function () { + this.renderDom(this.createElement('style')); +}; + +UI.addXType('style', Style); + +export default Style; \ No newline at end of file diff --git a/ShadowEditor.UI/src/metadata/Title.js b/ShadowEditor.UI/src/metadata/Title.js new file mode 100644 index 00000000..b1531360 --- /dev/null +++ b/ShadowEditor.UI/src/metadata/Title.js @@ -0,0 +1,21 @@ +import { Control, UI } from '../third_party'; + +/** + * Title + * @author tengge / https://github.com/tengge1 + * @param {*} options + */ +function Title(options = {}) { + Control.call(this, options); +} + +Title.prototype = Object.create(Control.prototype); +Title.prototype.constructor = Title; + +Title.prototype.render = function () { + this.renderDom(this.createElement('title')); +}; + +UI.addXType('title', Title); + +export default Title; \ No newline at end of file diff --git a/ShadowEditor.UI/src/Alert.js b/ShadowEditor.UI/src/old/Alert.js similarity index 100% rename from ShadowEditor.UI/src/Alert.js rename to ShadowEditor.UI/src/old/Alert.js diff --git a/ShadowEditor.UI/src/Boolean.js b/ShadowEditor.UI/src/old/Boolean.js similarity index 100% rename from ShadowEditor.UI/src/Boolean.js rename to ShadowEditor.UI/src/old/Boolean.js diff --git a/ShadowEditor.UI/src/Break.js b/ShadowEditor.UI/src/old/Break.js similarity index 100% rename from ShadowEditor.UI/src/Break.js rename to ShadowEditor.UI/src/old/Break.js diff --git a/ShadowEditor.UI/src/Button.js b/ShadowEditor.UI/src/old/Button.js similarity index 100% rename from ShadowEditor.UI/src/Button.js rename to ShadowEditor.UI/src/old/Button.js diff --git a/ShadowEditor.UI/src/Canvas.js b/ShadowEditor.UI/src/old/Canvas.js similarity index 100% rename from ShadowEditor.UI/src/Canvas.js rename to ShadowEditor.UI/src/old/Canvas.js diff --git a/ShadowEditor.UI/src/Checkbox.js b/ShadowEditor.UI/src/old/Checkbox.js similarity index 100% rename from ShadowEditor.UI/src/Checkbox.js rename to ShadowEditor.UI/src/old/Checkbox.js diff --git a/ShadowEditor.UI/src/CloseButton.js b/ShadowEditor.UI/src/old/CloseButton.js similarity index 100% rename from ShadowEditor.UI/src/CloseButton.js rename to ShadowEditor.UI/src/old/CloseButton.js diff --git a/ShadowEditor.UI/src/Color.js b/ShadowEditor.UI/src/old/Color.js similarity index 100% rename from ShadowEditor.UI/src/Color.js rename to ShadowEditor.UI/src/old/Color.js diff --git a/ShadowEditor.UI/src/Confirm.js b/ShadowEditor.UI/src/old/Confirm.js similarity index 100% rename from ShadowEditor.UI/src/Confirm.js rename to ShadowEditor.UI/src/old/Confirm.js diff --git a/ShadowEditor.UI/src/Container.js b/ShadowEditor.UI/src/old/Container.js similarity index 100% rename from ShadowEditor.UI/src/Container.js rename to ShadowEditor.UI/src/old/Container.js diff --git a/ShadowEditor.UI/src/Control.js b/ShadowEditor.UI/src/old/Control.js similarity index 100% rename from ShadowEditor.UI/src/Control.js rename to ShadowEditor.UI/src/old/Control.js diff --git a/ShadowEditor.UI/src/Div.js b/ShadowEditor.UI/src/old/Div.js similarity index 100% rename from ShadowEditor.UI/src/Div.js rename to ShadowEditor.UI/src/old/Div.js diff --git a/ShadowEditor.UI/src/HorizontalRule.js b/ShadowEditor.UI/src/old/HorizontalRule.js similarity index 100% rename from ShadowEditor.UI/src/HorizontalRule.js rename to ShadowEditor.UI/src/old/HorizontalRule.js diff --git a/ShadowEditor.UI/src/Html.js b/ShadowEditor.UI/src/old/Html.js similarity index 100% rename from ShadowEditor.UI/src/Html.js rename to ShadowEditor.UI/src/old/Html.js diff --git a/ShadowEditor.UI/src/IconButton.js b/ShadowEditor.UI/src/old/IconButton.js similarity index 100% rename from ShadowEditor.UI/src/IconButton.js rename to ShadowEditor.UI/src/old/IconButton.js diff --git a/ShadowEditor.UI/src/Image.js b/ShadowEditor.UI/src/old/Image.js similarity index 100% rename from ShadowEditor.UI/src/Image.js rename to ShadowEditor.UI/src/old/Image.js diff --git a/ShadowEditor.UI/src/ImageList.js b/ShadowEditor.UI/src/old/ImageList.js similarity index 100% rename from ShadowEditor.UI/src/ImageList.js rename to ShadowEditor.UI/src/old/ImageList.js diff --git a/ShadowEditor.UI/src/Input.js b/ShadowEditor.UI/src/old/Input.js similarity index 100% rename from ShadowEditor.UI/src/Input.js rename to ShadowEditor.UI/src/old/Input.js diff --git a/ShadowEditor.UI/src/Integer.js b/ShadowEditor.UI/src/old/Integer.js similarity index 100% rename from ShadowEditor.UI/src/Integer.js rename to ShadowEditor.UI/src/old/Integer.js diff --git a/ShadowEditor.UI/src/Label.js b/ShadowEditor.UI/src/old/Label.js similarity index 100% rename from ShadowEditor.UI/src/Label.js rename to ShadowEditor.UI/src/old/Label.js diff --git a/ShadowEditor.UI/src/LinkButton.js b/ShadowEditor.UI/src/old/LinkButton.js similarity index 100% rename from ShadowEditor.UI/src/LinkButton.js rename to ShadowEditor.UI/src/old/LinkButton.js diff --git a/ShadowEditor.UI/src/MessageBox.js b/ShadowEditor.UI/src/old/MessageBox.js similarity index 100% rename from ShadowEditor.UI/src/MessageBox.js rename to ShadowEditor.UI/src/old/MessageBox.js diff --git a/ShadowEditor.UI/src/Modal.js b/ShadowEditor.UI/src/old/Modal.js similarity index 100% rename from ShadowEditor.UI/src/Modal.js rename to ShadowEditor.UI/src/old/Modal.js diff --git a/ShadowEditor.UI/src/Number.js b/ShadowEditor.UI/src/old/Number.js similarity index 100% rename from ShadowEditor.UI/src/Number.js rename to ShadowEditor.UI/src/old/Number.js diff --git a/ShadowEditor.UI/src/Prompt.js b/ShadowEditor.UI/src/old/Prompt.js similarity index 100% rename from ShadowEditor.UI/src/Prompt.js rename to ShadowEditor.UI/src/old/Prompt.js diff --git a/ShadowEditor.UI/src/Row.js b/ShadowEditor.UI/src/old/Row.js similarity index 100% rename from ShadowEditor.UI/src/Row.js rename to ShadowEditor.UI/src/old/Row.js diff --git a/ShadowEditor.UI/src/SearchField.js b/ShadowEditor.UI/src/old/SearchField.js similarity index 100% rename from ShadowEditor.UI/src/SearchField.js rename to ShadowEditor.UI/src/old/SearchField.js diff --git a/ShadowEditor.UI/src/Select.js b/ShadowEditor.UI/src/old/Select.js similarity index 100% rename from ShadowEditor.UI/src/Select.js rename to ShadowEditor.UI/src/old/Select.js diff --git a/ShadowEditor.UI/src/Span.js b/ShadowEditor.UI/src/old/Span.js similarity index 100% rename from ShadowEditor.UI/src/Span.js rename to ShadowEditor.UI/src/old/Span.js diff --git a/ShadowEditor.UI/src/Table.js b/ShadowEditor.UI/src/old/Table.js similarity index 100% rename from ShadowEditor.UI/src/Table.js rename to ShadowEditor.UI/src/old/Table.js diff --git a/ShadowEditor.UI/src/TableBody.js b/ShadowEditor.UI/src/old/TableBody.js similarity index 100% rename from ShadowEditor.UI/src/TableBody.js rename to ShadowEditor.UI/src/old/TableBody.js diff --git a/ShadowEditor.UI/src/TableData.js b/ShadowEditor.UI/src/old/TableData.js similarity index 100% rename from ShadowEditor.UI/src/TableData.js rename to ShadowEditor.UI/src/old/TableData.js diff --git a/ShadowEditor.UI/src/TableHead.js b/ShadowEditor.UI/src/old/TableHead.js similarity index 100% rename from ShadowEditor.UI/src/TableHead.js rename to ShadowEditor.UI/src/old/TableHead.js diff --git a/ShadowEditor.UI/src/TableRow.js b/ShadowEditor.UI/src/old/TableRow.js similarity index 100% rename from ShadowEditor.UI/src/TableRow.js rename to ShadowEditor.UI/src/old/TableRow.js diff --git a/ShadowEditor.UI/src/Text.js b/ShadowEditor.UI/src/old/Text.js similarity index 100% rename from ShadowEditor.UI/src/Text.js rename to ShadowEditor.UI/src/old/Text.js diff --git a/ShadowEditor.UI/src/TextArea.js b/ShadowEditor.UI/src/old/TextArea.js similarity index 100% rename from ShadowEditor.UI/src/TextArea.js rename to ShadowEditor.UI/src/old/TextArea.js diff --git a/ShadowEditor.UI/src/Texture.js b/ShadowEditor.UI/src/old/Texture.js similarity index 100% rename from ShadowEditor.UI/src/Texture.js rename to ShadowEditor.UI/src/old/Texture.js diff --git a/ShadowEditor.UI/src/Timeline.js b/ShadowEditor.UI/src/old/Timeline.js similarity index 100% rename from ShadowEditor.UI/src/Timeline.js rename to ShadowEditor.UI/src/old/Timeline.js diff --git a/ShadowEditor.UI/src/ToolbarFiller.js b/ShadowEditor.UI/src/old/ToolbarFiller.js similarity index 100% rename from ShadowEditor.UI/src/ToolbarFiller.js rename to ShadowEditor.UI/src/old/ToolbarFiller.js diff --git a/ShadowEditor.UI/src/UI.js b/ShadowEditor.UI/src/old/UI.js similarity index 100% rename from ShadowEditor.UI/src/UI.js rename to ShadowEditor.UI/src/old/UI.js diff --git a/ShadowEditor.UI/src/Window.js b/ShadowEditor.UI/src/old/Window.js similarity index 100% rename from ShadowEditor.UI/src/Window.js rename to ShadowEditor.UI/src/old/Window.js diff --git a/ShadowEditor.UI/src/root/HtmlDom.js b/ShadowEditor.UI/src/root/HtmlDom.js new file mode 100644 index 00000000..78d73a2a --- /dev/null +++ b/ShadowEditor.UI/src/root/HtmlDom.js @@ -0,0 +1,21 @@ +import { Control, UI } from '../third_party'; + +/** + * HtmlDom + * @author tengge / https://github.com/tengge1 + * @param {*} options + */ +function HtmlDom(options = {}) { + Control.call(this, options); +} + +HtmlDom.prototype = Object.create(Control.prototype); +HtmlDom.prototype.constructor = HtmlDom; + +HtmlDom.prototype.render = function () { + this.renderDom(this.createElement('html')); +}; + +UI.addXType('dom', HtmlDom); + +export default HtmlDom; \ No newline at end of file diff --git a/ShadowEditor.UI/src/third_party.js b/ShadowEditor.UI/src/third_party.js new file mode 100644 index 00000000..c1a64724 --- /dev/null +++ b/ShadowEditor.UI/src/third_party.js @@ -0,0 +1,5 @@ +import { Control, Manager } from '@tengge1/xtype.js'; + +const UI = new Manager(); + +export { Control, UI }; \ No newline at end of file