@operato/board 1.0.25 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/src/modeller/edit-toolbar.js +5 -5
- package/dist/src/modeller/edit-toolbar.js.map +1 -1
- package/dist/src/modeller/property-sidebar/inspector/inspector.d.ts +6 -1
- package/dist/src/modeller/property-sidebar/inspector/inspector.js +66 -36
- package/dist/src/modeller/property-sidebar/inspector/inspector.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/modeller/edit-toolbar.ts +5 -5
- package/src/modeller/property-sidebar/inspector/inspector.ts +77 -45
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [1.0.27](https://github.com/hatiolab/operato/compare/v1.0.26...v1.0.27) (2022-10-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* board inspector ([e2872cf](https://github.com/hatiolab/operato/commit/e2872cfa3a8dd123cd843b407811290fdc6cafb0))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### [1.0.26](https://github.com/hatiolab/operato/compare/v1.0.25...v1.0.26) (2022-10-12)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### :bug: Bug Fix
|
|
19
|
+
|
|
20
|
+
* board inspector ([71c224b](https://github.com/hatiolab/operato/commit/71c224b78ff28f7a45dd68ebb10fb4e03cd31bd6))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
### [1.0.25](https://github.com/hatiolab/operato/compare/v1.0.24...v1.0.25) (2022-10-10)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -393,11 +393,11 @@ export class EditToolbar extends LitElement {
|
|
|
393
393
|
!redoable ? this.redo.setAttribute('disabled', '') : this.redo.removeAttribute('disabled');
|
|
394
394
|
}
|
|
395
395
|
onSceneChanged(after, before) {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
396
|
+
if (before) {
|
|
397
|
+
before.off('execute', this.onExecute, this);
|
|
398
|
+
before.off('undo', this.onUndo, this);
|
|
399
|
+
before.off('redo', this.onRedo, this);
|
|
400
|
+
}
|
|
401
401
|
if (after) {
|
|
402
402
|
after.on('execute', this.onExecute, this);
|
|
403
403
|
after.on('undo', this.onUndo, this);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-toolbar.js","sourceRoot":"","sources":["../../../src/modeller/edit-toolbar.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG7D,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAEzD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE5C,MAAM,KAAK,GAAG,OAAO,EAAE,CAAA;AAEvB,MAAM,OAAO,WAAY,SAAQ,UAAU;IAA3C;;QAI6B,aAAQ,GAAU,EAAE,CAAA;QAClB,iBAAY,GAAY,KAAK,CAAA;IA6mB5D,CAAC;IAvlBC,YAAY;QACV,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAkB,EAAE,KAAK,CAAC,CAAA;QAEzF,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAQ,EAAE,EAAE;;YAC5C,IAAI,CAAC,MAAM,GAAG,MAAC,CAAoB,CAAC,aAAa,0CAAE,OAAO,CAAC,YAAY,CAAC,CAAA;QAC1E,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A3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAc;AACd;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;6CAAqB;AAClB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDAA8B;AAI1C;IAAf,KAAK,CAAC,OAAO,CAAC;yCAA2B;AAC1B;IAAf,KAAK,CAAC,OAAO,CAAC;yCAA2B;AAEpB;IAArB,KAAK,CAAC,aAAa,CAAC;+CAAiC;AACvC;IAAd,KAAK,CAAC,MAAM,CAAC;wCAA0B;AACxB;IAAf,KAAK,CAAC,OAAO,CAAC;yCAA2B;AACzB;IAAhB,KAAK,CAAC,QAAQ,CAAC;0CAA4B;AAC1B;IAAjB,KAAK,CAAC,SAAS,CAAC;2CAA6B;AAE3B;IAAlB,KAAK,CAAC,UAAU,CAAC;4CAA8B;AAC5B;IAAnB,KAAK,CAAC,WAAW,CAAC;6CAA+B;AACjC;IAAhB,KAAK,CAAC,QAAQ,CAAC;0CAA4B;AAC5B;IAAf,KAAK,CAAC,OAAO,CAAC;yCAA2B;AAEhB;IAAzB,QAAQ,CAAC,cAAc,CAAC;6CAA+C;AAC7C;IAA1B,QAAQ,CAAC,eAAe,CAAC;4CAA8C;AACzC;IAA9B,QAAQ,CAAC,mBAAmB,CAAC;gDAAkD","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { html, LitElement, PropertyValues } from 'lit'\nimport { property, query, queryAll } from 'lit/decorators.js'\n\nimport { Component, Scene } from '@hatiolab/things-scene'\nimport { copyToClipboard, isMacOS } from '@operato/utils'\n\nimport { style } from './edit-toolbar-style'\n\nconst MACOS = isMacOS()\n\nexport class EditToolbar extends LitElement {\n static styles = [style]\n\n @property({ type: Object }) scene?: Scene\n @property({ type: Array }) selected: any[] = []\n @property({ type: Boolean }) hideProperty: boolean = false\n\n private cliped?: string\n\n @query('#redo') private redo!: HTMLElement\n @query('#undo') private undo!: HTMLElement\n\n @query('#fullscreen') private fullscreen!: HTMLElement\n @query('#cut') private cut!: HTMLElement\n @query('#copy') private copy!: HTMLElement\n @query('#paste') private paste!: HTMLElement\n @query('#delete') private delete!: HTMLElement\n\n @query('#forward') private forward!: HTMLElement\n @query('#backward') private backward!: HTMLElement\n @query('#front') private front!: HTMLElement\n @query('#back') private back!: HTMLElement\n\n @queryAll('[data-align]') private aligners!: NodeListOf<HTMLSpanElement>\n @queryAll('[data-zorder]') private zorders!: NodeListOf<HTMLSpanElement>\n @queryAll('[data-distribute]') private distributes!: NodeListOf<HTMLSpanElement>\n\n firstUpdated() {\n this.addEventListener('mousewheel', this.onWheelEvent.bind(this) as EventListener, false)\n\n window.addEventListener('paste', (e: Event) => {\n this.cliped = (e as ClipboardEvent).clipboardData?.getData('text/plain')\n })\n\n this.aligners.forEach(aligner => aligner.addEventListener('tap', this.onTapAlign.bind(this) as EventListener))\n this.zorders.forEach(zorder => zorder.addEventListener('tap', this.onTapZorder.bind(this) as EventListener))\n this.distributes.forEach(distribute =>\n distribute.addEventListener('tap', this.onTapDistribute.bind(this) as EventListener)\n )\n\n this.undo.addEventListener('tap', this.onTapUndo.bind(this) as EventListener)\n this.redo.addEventListener('tap', this.onTapRedo.bind(this) as EventListener)\n this.fullscreen.addEventListener('tap', this.onTapFullscreen.bind(this) as EventListener)\n this.cut.addEventListener('tap', this.onTapCut.bind(this) as EventListener)\n this.copy.addEventListener('tap', this.onTapCopy.bind(this) as EventListener)\n this.paste.addEventListener('tap', this.onTapPaste.bind(this) as EventListener)\n this.delete.addEventListener('tap', this.onTapDelete.bind(this) as EventListener)\n\n this.renderRoot\n .querySelector('#font-increase')!\n .addEventListener('tap', this.onTapFontIncrease.bind(this) as EventListener)\n this.renderRoot\n .querySelector('#font-decrease')!\n .addEventListener('tap', this.onTapFontDecrease.bind(this) as EventListener)\n this.renderRoot.querySelector('#group')!.addEventListener('tap', this.onTapGroup.bind(this) as EventListener)\n this.renderRoot.querySelector('#ungroup')!.addEventListener('tap', this.onTapUngroup.bind(this) as EventListener)\n this.renderRoot\n .querySelector('#symmetry-x')!\n .addEventListener('tap', this.onTapSymmetryX.bind(this) as EventListener)\n this.renderRoot\n .querySelector('#symmetry-y')!\n .addEventListener('tap', this.onTapSymmetryY.bind(this) as EventListener)\n this.renderRoot.querySelector('#rotate-cw')!.addEventListener('tap', this.onTapRotateCW.bind(this) as EventListener)\n this.renderRoot\n .querySelector('#rotate-ccw')!\n .addEventListener('tap', this.onTapRotateCCW.bind(this) as EventListener)\n this.renderRoot\n .querySelector('#toggle-property')!\n .addEventListener('tap', this.onTapToggle.bind(this) as EventListener)\n this.renderRoot.querySelector('#fit-scene')!.addEventListener('tap', this.onTapFitScene.bind(this) as EventListener)\n this.renderRoot.querySelector('#preview')!.addEventListener('tap', this.onTapPreview.bind(this) as EventListener)\n }\n\n updated(changes: PropertyValues<this>) {\n changes.has('scene') && this.onSceneChanged(this.scene, changes.get('scene') as Scene)\n changes.has('selected') && this.onSelectedChanged(this.selected, changes.get('selected') as Component[])\n }\n\n render() {\n return html`\n <div tools>\n <span><slot></slot></span>\n\n <span button id=\"undo\" title=\"undo (${this.getShortcutString('cmd', 'z')})\"> </span>\n <span button id=\"redo\" title=\"redo (${this.getShortcutString('cmd', 'shift', 'z')})\"> </span>\n\n <span class=\"vline\"></span>\n\n <span button id=\"cut\" title=\"cut (${this.getShortcutString('cmd', 'x')})\"> </span>\n <span button id=\"copy\" title=\"copy (${this.getShortcutString('cmd', 'c')})\"> </span>\n <span button id=\"paste\" title=\"paste (${this.getShortcutString('cmd', 'v')})\"> </span>\n <span\n button\n id=\"delete\"\n title=\"delete (${this.getShortcutString('backspace')}, ${this.getShortcutString('delete')})\"\n >\n </span>\n\n <span class=\"vline\"></span>\n\n <!-- TODO Implement style-copy\n <span button id=\"style-copy\" title=\"format painter\"></span>\n <span class=\"vline\"></span>\n -->\n\n <span\n button\n data-align=\"left\"\n id=\"align-left\"\n title=\"align left (${this.getShortcutString('alt', 'shift', 'l')})\"\n >\n </span>\n <span\n button\n data-align=\"center\"\n id=\"align-center\"\n title=\"align center (${this.getShortcutString('alt', 'shift', 'c')})\"\n >\n </span>\n <span\n button\n data-align=\"right\"\n id=\"align-right\"\n title=\"align right (${this.getShortcutString('alt', 'shift', 'r')})\"\n >\n </span>\n\n <span button data-align=\"top\" id=\"align-top\" title=\"align top (${this.getShortcutString('alt', 'shift', 't')})\">\n </span>\n <span\n button\n data-align=\"middle\"\n id=\"align-middle\"\n title=\"align middle (${this.getShortcutString('alt', 'shift', 'm')})\"\n >\n </span>\n <span\n button\n data-align=\"bottom\"\n id=\"align-bottom\"\n title=\"align bottom (${this.getShortcutString('alt', 'shift', 'b')})\"\n >\n </span>\n\n <span\n button\n data-distribute=\"HORIZONTAL\"\n id=\"distribute-horizontal\"\n title=\"distribute horizontally (${this.getShortcutString('alt', 'shift', 'h')})\"\n >\n </span>\n\n <span\n button\n data-distribute=\"VERTICAL\"\n id=\"distribute-vertical\"\n title=\"distribute vertically (${this.getShortcutString('alt', 'shift', 'v')})\"\n >\n </span>\n\n <span class=\"vline\"></span>\n\n <span\n button\n id=\"front\"\n data-zorder=\"front\"\n title=\"bring to front (${this.getShortcutString('cmd', 'shift', 'f')})\"\n >\n </span>\n <span button id=\"back\" data-zorder=\"back\" title=\"send to back (${this.getShortcutString('cmd', 'shift', 'b')})\">\n </span>\n <span button id=\"forward\" data-zorder=\"forward\" title=\"bring forward (${this.getShortcutString('cmd', 'f')})\">\n </span>\n <span button id=\"backward\" data-zorder=\"backward\" title=\"send backward (${this.getShortcutString('cmd', 'b')})\">\n </span>\n\n <span class=\"vline\"></span>\n\n <span button id=\"symmetry-x\" title=\"symmetry-x (${this.getShortcutString('alt', 'shift', 'x')})\"> </span>\n <span button id=\"symmetry-y\" title=\"symmetry-y (${this.getShortcutString('alt', 'shift', 'y')})\"> </span>\n <span button id=\"rotate-cw\" title=\"rotate clockwise (${this.getShortcutString('alt', 'shift', 'e')})\"> </span>\n <span button id=\"rotate-ccw\" title=\"rotate counter clockwise (${this.getShortcutString('alt', 'shift', 'w')})\">\n </span>\n\n <span class=\"vline\"></span>\n\n <span button id=\"group\" title=\"group (${this.getShortcutString('cmd', 'g')})\"> </span>\n <span button id=\"ungroup\" title=\"ungroup (${this.getShortcutString('cmd', 'shift', 'g')})\"> </span>\n\n <span class=\"vline\"></span>\n\n <span button id=\"font-increase\" title=\"increase font size\"></span>\n <span button id=\"font-decrease\" title=\"decrease font size\"></span>\n\n <span class=\"vline\"></span>\n <span padding></span>\n\n <span button id=\"fit-scene\" title=\"fit scene (${this.getShortcutString('cmd', 'd')})\"> </span>\n\n <span class=\"vline\"></span>\n\n <span button id=\"preview\" title=\"preview (${this.getShortcutString('ctrl', 'p')})\"> </span>\n\n <span button id=\"fullscreen\" title=\"fullscreen (${this.getShortcutString('f11')})\"> </span>\n\n <span\n button\n id=\"toggle-property\"\n title=\"toggle property panel (${this.getShortcutString('cmd', 'h')})\"\n toggles=\"true\"\n >\n </span>\n </div>\n `\n }\n\n onWheelEvent(e: Event) {\n var delta = Math.max(-1, Math.min(1, (e as WheelEvent).deltaY || -(e as WheelEvent).detail))\n this.scrollLeft -= delta * 40\n\n e.preventDefault()\n }\n\n getSymbol(key: string) {\n var symbol\n switch (key) {\n case 'cmd':\n case 'ctrl':\n symbol = MACOS ? '⌘' : 'Ctrl'\n break\n case 'shift':\n symbol = MACOS ? '⇧' : 'Shift'\n break\n case 'alt':\n case 'option':\n symbol = MACOS ? '⌥' : 'Alt'\n break\n case 'backspace':\n symbol = MACOS ? '⌫' : 'BackSpace'\n break\n case 'delete':\n symbol = MACOS ? '⌦' : 'Del'\n break\n default:\n symbol = key.toUpperCase()\n break\n }\n\n return symbol\n }\n\n private getShortcutString(...keys: string[]) {\n var symbols = []\n for (var i = 0; i < arguments.length; i++) {\n symbols.push(this.getSymbol(arguments[i]))\n }\n\n return symbols.join(MACOS ? '' : '+')\n }\n\n onShortcut(e: KeyboardEvent) {\n if (MACOS) var ctrlKey = e.metaKey\n else var ctrlKey = e.ctrlKey\n\n var altKey = e.altKey\n var shiftKey = e.shiftKey\n\n var defaultPrevent = ctrlKey || altKey\n\n switch (e.code) {\n case 'KeyZ':\n if (ctrlKey && !shiftKey) this.onTapUndo()\n else if (ctrlKey && shiftKey) this.onTapRedo()\n break\n case 'KeyY':\n if (ctrlKey && !shiftKey) this.onTapRedo()\n else if (altKey && shiftKey) this.onTapSymmetryY()\n break\n case 'KeyC':\n if (ctrlKey && !shiftKey) this.onTapCopy()\n else if (altKey && shiftKey) this.onTapAlign('center')\n break\n case 'KeyX':\n if (ctrlKey && !shiftKey) this.onTapCut()\n else if (altKey && shiftKey) this.onTapSymmetryX()\n break\n case 'KeyV':\n if (ctrlKey && !shiftKey) {\n this.onTapPaste()\n defaultPrevent = false\n } else if (altKey && shiftKey) this.onTapDistribute('VERTICAL')\n break\n case 'Delete':\n case 'Backspace':\n this.onTapDelete()\n defaultPrevent = true\n break\n case 'KeyG':\n if (ctrlKey && !shiftKey) this.onTapGroup()\n else if (ctrlKey && shiftKey) this.onTapUngroup()\n break\n case 'KeyF':\n if (ctrlKey && !shiftKey) this.scene?.zorder('forward')\n else if (ctrlKey && shiftKey) this.scene?.zorder('front')\n break\n case 'KeyB':\n if (ctrlKey && !shiftKey) this.scene?.zorder('backward')\n else if (ctrlKey && shiftKey) this.scene?.zorder('back')\n else if (altKey && shiftKey) this.onTapAlign('bottom')\n break\n // case 'Equal':\n // if (ctrlKey) this.onTapZoom(zoomin)\n // break\n // case 'Minus':\n // if (ctrlKey) this.onTapZoom(zoomout)\n // break\n case 'KeyH':\n if (ctrlKey && !shiftKey) this.onTapToggle()\n else if (altKey && shiftKey) this.onTapDistribute('HORIZONTAL')\n break\n case 'F11':\n this.onTapFullscreen()\n defaultPrevent = true\n break\n case 'KeyP':\n if (ctrlKey) {\n this.onTapPreview()\n defaultPrevent = true\n }\n break\n case 'KeyA':\n if (ctrlKey) this.onTapSelectAll()\n break\n case 'KeyL':\n if (altKey && shiftKey) this.onTapAlign('left')\n break\n case 'KeyR':\n if (altKey && shiftKey) this.onTapAlign('right')\n break\n case 'KeyM':\n if (altKey && shiftKey) this.onTapAlign('middle')\n break\n case 'KeyT':\n if (altKey && shiftKey) this.onTapAlign('top')\n break\n case 'KeyY':\n if (altKey && shiftKey) this.onTapSymmetryY()\n break\n case 'KeyD':\n if (ctrlKey) {\n this.onTapFitScene()\n defaultPrevent = true\n }\n break\n case 'KeyE':\n if (altKey && shiftKey) this.onTapRotateCW()\n else if (ctrlKey && shiftKey) this.onTapDownloadModel()\n break\n case 'KeyW':\n if (altKey && shiftKey) this.onTapRotateCCW()\n break\n case 'Digit1':\n if (ctrlKey) {\n console.log('MODEL', this.scene && this.scene.model)\n defaultPrevent = true\n }\n break\n case 'Digit2':\n if (ctrlKey) {\n console.log('SELECTED', this.scene && this.scene.selected)\n defaultPrevent = true\n }\n break\n\n default:\n return false\n }\n\n if (defaultPrevent) e.preventDefault()\n return true\n }\n\n onExecute(command: string, undoable: boolean, redoable: boolean) {\n !undoable ? this.undo.setAttribute('disabled', '') : this.undo.removeAttribute('disabled')\n !redoable ? this.redo.setAttribute('disabled', '') : this.redo.removeAttribute('disabled')\n }\n\n onUndo(undoable: boolean, redoable: boolean) {\n !undoable ? this.undo.setAttribute('disabled', '') : this.undo.removeAttribute('disabled')\n !redoable ? this.redo.setAttribute('disabled', '') : this.redo.removeAttribute('disabled')\n }\n\n onRedo(undoable: boolean, redoable: boolean) {\n !undoable ? this.undo.setAttribute('disabled', '') : this.undo.removeAttribute('disabled')\n !redoable ? this.redo.setAttribute('disabled', '') : this.redo.removeAttribute('disabled')\n }\n\n onSceneChanged(after?: Scene, before?: Scene) {\n // if (before) {\n // before.off('execute', this.onExecute, this)\n // before.off('undo', this.onUndo, this)\n // before.off('redo', this.onRedo, this)\n // }\n\n if (after) {\n after.on('execute', this.onExecute, this)\n after.on('undo', this.onUndo, this)\n after.on('redo', this.onRedo, this)\n }\n }\n\n // @query('#align-left') private alignLeft!: HTMLElement\n // @query('#align-center') private alignCenter!: HTMLElement\n // @query('#align-right') private alignRight!: HTMLElement\n // @query('#align-top') private alignTop!: HTMLElement\n // @query('#align-middle') private alignMiddle!: HTMLElement\n // @query('#align-bottom') private alignBottom!: HTMLElement\n\n onSelectedChanged(after: Component[], before: Component[]) {\n var alignable = after.length > 1\n\n this.aligners.forEach(aligner =>\n alignable ? aligner.removeAttribute('disabled') : aligner.setAttribute('disabled', '')\n )\n\n var movable = after.length === 1\n\n /* forward, backward 이동은 한 컴포넌트만 가능하다. */\n !movable ? this.forward.setAttribute('disabled', '') : this.forward.removeAttribute('disabled')\n !movable ? this.backward.setAttribute('disabled', '') : this.backward.removeAttribute('disabled')\n\n /* 여러 컴포넌트는 front, back 이동이 가능하다. */\n !(alignable || movable) ? this.front.setAttribute('disabled', '') : this.front.removeAttribute('disabled')\n !(alignable || movable) ? this.back.setAttribute('disabled', '') : this.back.removeAttribute('disabled')\n }\n\n onTapUndo() {\n this.scene?.undo()\n }\n\n onTapRedo() {\n this.scene?.redo()\n }\n\n onTapCut() {\n this.scene?.cut()\n }\n\n async onTapCopy() {\n var copied = this.scene?.copy()\n\n if (!copied) return\n\n await copyToClipboard(copied)\n this.cliped = copied\n }\n\n onTapPaste() {\n setTimeout(() => {\n this.cliped && this.scene?.paste(this.cliped)\n }, 100)\n }\n\n onTapDelete() {\n this.scene?.remove()\n }\n\n onTapSelectAll() {\n this.scene?.select('(child)')\n }\n\n onTapFontIncrease(e: TouchEvent) {\n var selected = this.scene?.selected\n if (!selected || !selected.length) {\n return\n }\n\n this.scene?.undoableChange(function () {\n selected!.forEach(function (component) {\n var fontSize = component.get('fontSize')\n\n if (!fontSize) fontSize = '15'\n\n if (fontSize) {\n var size = parseInt(fontSize)\n component.set('fontSize', size + 1)\n }\n })\n })\n }\n\n onTapFontDecrease(e: TouchEvent) {\n var selected = this.scene?.selected\n\n if (!selected || !selected.length) {\n return\n }\n\n this.scene?.undoableChange(function () {\n selected!.forEach(function (component) {\n var fontSize = component.get('fontSize')\n\n if (!fontSize) fontSize = '15'\n\n if (fontSize) {\n var size = parseInt(fontSize)\n if (size > 1) component.set('fontSize', size - 1)\n }\n })\n })\n }\n\n onTapAlign(e: TouchEvent | string) {\n if (!this.scene) return\n\n var selected = this.scene.selected\n if (selected.length <= 1) return\n\n var align = typeof e === 'string' ? e : (e.target as HTMLElement).getAttribute('data-align')\n\n align && this.scene.align(align)\n }\n\n onTapZorder(e: TouchEvent | string) {\n if (!this.scene) return\n\n var selected = this.scene.selected\n if (selected.length < 1) return\n\n var zorder = typeof e === 'string' ? e : (e.target as HTMLElement).getAttribute('data-zorder')\n\n zorder && this.scene.zorder(zorder)\n }\n\n onTapSymmetryX() {\n this.scene && this.scene.symmetryX()\n }\n\n onTapSymmetryY() {\n this.scene && this.scene.symmetryY()\n }\n\n onTapRotateCW() {\n if (!this.scene) return\n\n var selected = this.scene.selected\n if (selected.length && selected[0].isRootModel()) return\n\n this.scene.undoableChange(function () {\n selected.forEach(function (component) {\n var rotation = component.get('rotation')\n\n if (!rotation) rotation = 0\n\n component.set('rotation', (rotation + Math.PI / 2) % (Math.PI * 2))\n })\n })\n }\n\n onTapRotateCCW() {\n if (!this.scene) return\n\n var selected = this.scene.selected\n if (selected.length && selected[0].isRootModel()) return\n\n this.scene.undoableChange(function () {\n selected.forEach(function (component) {\n var rotation = component.get('rotation')\n\n if (!rotation) rotation = 0\n\n component.set('rotation', (rotation - Math.PI / 2) % (Math.PI * 2))\n })\n })\n }\n\n onTapGroup() {\n this.scene && this.scene.group()\n }\n\n onTapUngroup() {\n this.scene && this.scene.ungroup()\n }\n\n onTapFullscreen() {\n this.dispatchEvent(new CustomEvent('modeller-fullscreen'))\n }\n\n onTapToggle() {\n this.hideProperty = !this.hideProperty\n this.dispatchEvent(\n new CustomEvent('hide-property-changed', {\n bubbles: true,\n composed: true,\n detail: { value: this.hideProperty }\n })\n )\n }\n\n onTapFitScene() {\n if (this.scene) {\n this.scene.resize()\n this.scene.fit('ratio')\n }\n }\n\n onTapPreview() {\n this.dispatchEvent(new CustomEvent('open-preview'))\n }\n\n onTapDownloadModel() {\n this.dispatchEvent(new CustomEvent('download-model'))\n }\n\n onTapDistribute(e: TouchEvent | string) {\n if (!this.scene) return\n\n var selected = this.scene.selected\n if (selected.length <= 1) {\n return\n }\n\n var distribute = typeof e === 'string' ? e : (e.target as HTMLElement)!.getAttribute('data-distribute')\n\n distribute && this.scene.distribute(distribute)\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"edit-toolbar.js","sourceRoot":"","sources":["../../../src/modeller/edit-toolbar.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG7D,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAEzD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE5C,MAAM,KAAK,GAAG,OAAO,EAAE,CAAA;AAEvB,MAAM,OAAO,WAAY,SAAQ,UAAU;IAA3C;;QAI6B,aAAQ,GAAU,EAAE,CAAA;QAClB,iBAAY,GAAY,KAAK,CAAA;IA6mB5D,CAAC;IAvlBC,YAAY;QACV,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAkB,EAAE,KAAK,CAAC,CAAA;QAEzF,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAQ,EAAE,EAAE;;YAC5C,IAAI,CAAC,MAAM,GAAG,MAAC,CAAoB,CAAC,aAAa,0CAAE,OAAO,CAAC,YAAY,CAAC,CAAA;QAC1E,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,C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AEvG,UAAU,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;IACjD,CAAC;;AAhnBM,kBAAM,GAAG,CAAC,KAAK,CAAC,CAAA;AAEK;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAc;AACd;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;6CAAqB;AAClB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDAA8B;AAI1C;IAAf,KAAK,CAAC,OAAO,CAAC;yCAA2B;AAC1B;IAAf,KAAK,CAAC,OAAO,CAAC;yCAA2B;AAEpB;IAArB,KAAK,CAAC,aAAa,CAAC;+CAAiC;AACvC;IAAd,KAAK,CAAC,MAAM,CAAC;wCAA0B;AACxB;IAAf,KAAK,CAAC,OAAO,CAAC;yCAA2B;AACzB;IAAhB,KAAK,CAAC,QAAQ,CAAC;0CAA4B;AAC1B;IAAjB,KAAK,CAAC,SAAS,CAAC;2CAA6B;AAE3B;IAAlB,KAAK,CAAC,UAAU,CAAC;4CAA8B;AAC5B;IAAnB,KAAK,CAAC,WAAW,CAAC;6CAA+B;AACjC;IAAhB,KAAK,CAAC,QAAQ,CAAC;0CAA4B;AAC5B;IAAf,KAAK,CAAC,OAAO,CAAC;yCAA2B;AAEhB;IAAzB,QAAQ,CAAC,cAAc,CAAC;6CAA+C;AAC7C;IAA1B,QAAQ,CAAC,eAAe,CAAC;4CAA8C;AACzC;IAA9B,QAAQ,CAAC,mBAAmB,CAAC;gDAAkD","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { html, LitElement, PropertyValues } from 'lit'\nimport { property, query, queryAll } from 'lit/decorators.js'\n\nimport { Component, Scene } from '@hatiolab/things-scene'\nimport { copyToClipboard, isMacOS } from '@operato/utils'\n\nimport { style } from './edit-toolbar-style'\n\nconst MACOS = isMacOS()\n\nexport class EditToolbar extends LitElement {\n static styles = [style]\n\n @property({ type: Object }) scene?: Scene\n @property({ type: Array }) selected: any[] = []\n @property({ type: Boolean }) hideProperty: boolean = false\n\n private cliped?: string\n\n @query('#redo') private redo!: HTMLElement\n @query('#undo') private undo!: HTMLElement\n\n @query('#fullscreen') private fullscreen!: HTMLElement\n @query('#cut') private cut!: HTMLElement\n @query('#copy') private copy!: HTMLElement\n @query('#paste') private paste!: HTMLElement\n @query('#delete') private delete!: HTMLElement\n\n @query('#forward') private forward!: HTMLElement\n @query('#backward') private backward!: HTMLElement\n @query('#front') private front!: HTMLElement\n @query('#back') private back!: HTMLElement\n\n @queryAll('[data-align]') private aligners!: NodeListOf<HTMLSpanElement>\n @queryAll('[data-zorder]') private zorders!: NodeListOf<HTMLSpanElement>\n @queryAll('[data-distribute]') private distributes!: NodeListOf<HTMLSpanElement>\n\n firstUpdated() {\n this.addEventListener('mousewheel', this.onWheelEvent.bind(this) as EventListener, false)\n\n window.addEventListener('paste', (e: Event) => {\n this.cliped = (e as ClipboardEvent).clipboardData?.getData('text/plain')\n })\n\n this.aligners.forEach(aligner => aligner.addEventListener('tap', this.onTapAlign.bind(this) as EventListener))\n this.zorders.forEach(zorder => zorder.addEventListener('tap', this.onTapZorder.bind(this) as EventListener))\n this.distributes.forEach(distribute =>\n distribute.addEventListener('tap', this.onTapDistribute.bind(this) as EventListener)\n )\n\n this.undo.addEventListener('tap', this.onTapUndo.bind(this) as EventListener)\n this.redo.addEventListener('tap', this.onTapRedo.bind(this) as EventListener)\n this.fullscreen.addEventListener('tap', this.onTapFullscreen.bind(this) as EventListener)\n this.cut.addEventListener('tap', this.onTapCut.bind(this) as EventListener)\n this.copy.addEventListener('tap', this.onTapCopy.bind(this) as EventListener)\n this.paste.addEventListener('tap', this.onTapPaste.bind(this) as EventListener)\n this.delete.addEventListener('tap', this.onTapDelete.bind(this) as EventListener)\n\n this.renderRoot\n .querySelector('#font-increase')!\n .addEventListener('tap', this.onTapFontIncrease.bind(this) as EventListener)\n this.renderRoot\n .querySelector('#font-decrease')!\n .addEventListener('tap', this.onTapFontDecrease.bind(this) as EventListener)\n this.renderRoot.querySelector('#group')!.addEventListener('tap', this.onTapGroup.bind(this) as EventListener)\n this.renderRoot.querySelector('#ungroup')!.addEventListener('tap', this.onTapUngroup.bind(this) as EventListener)\n this.renderRoot\n .querySelector('#symmetry-x')!\n .addEventListener('tap', this.onTapSymmetryX.bind(this) as EventListener)\n this.renderRoot\n .querySelector('#symmetry-y')!\n .addEventListener('tap', this.onTapSymmetryY.bind(this) as EventListener)\n this.renderRoot.querySelector('#rotate-cw')!.addEventListener('tap', this.onTapRotateCW.bind(this) as EventListener)\n this.renderRoot\n .querySelector('#rotate-ccw')!\n .addEventListener('tap', this.onTapRotateCCW.bind(this) as EventListener)\n this.renderRoot\n .querySelector('#toggle-property')!\n .addEventListener('tap', this.onTapToggle.bind(this) as EventListener)\n this.renderRoot.querySelector('#fit-scene')!.addEventListener('tap', this.onTapFitScene.bind(this) as EventListener)\n this.renderRoot.querySelector('#preview')!.addEventListener('tap', this.onTapPreview.bind(this) as EventListener)\n }\n\n updated(changes: PropertyValues<this>) {\n changes.has('scene') && this.onSceneChanged(this.scene, changes.get('scene') as Scene)\n changes.has('selected') && this.onSelectedChanged(this.selected, changes.get('selected') as Component[])\n }\n\n render() {\n return html`\n <div tools>\n <span><slot></slot></span>\n\n <span button id=\"undo\" title=\"undo (${this.getShortcutString('cmd', 'z')})\"> </span>\n <span button id=\"redo\" title=\"redo (${this.getShortcutString('cmd', 'shift', 'z')})\"> </span>\n\n <span class=\"vline\"></span>\n\n <span button id=\"cut\" title=\"cut (${this.getShortcutString('cmd', 'x')})\"> </span>\n <span button id=\"copy\" title=\"copy (${this.getShortcutString('cmd', 'c')})\"> </span>\n <span button id=\"paste\" title=\"paste (${this.getShortcutString('cmd', 'v')})\"> </span>\n <span\n button\n id=\"delete\"\n title=\"delete (${this.getShortcutString('backspace')}, ${this.getShortcutString('delete')})\"\n >\n </span>\n\n <span class=\"vline\"></span>\n\n <!-- TODO Implement style-copy\n <span button id=\"style-copy\" title=\"format painter\"></span>\n <span class=\"vline\"></span>\n -->\n\n <span\n button\n data-align=\"left\"\n id=\"align-left\"\n title=\"align left (${this.getShortcutString('alt', 'shift', 'l')})\"\n >\n </span>\n <span\n button\n data-align=\"center\"\n id=\"align-center\"\n title=\"align center (${this.getShortcutString('alt', 'shift', 'c')})\"\n >\n </span>\n <span\n button\n data-align=\"right\"\n id=\"align-right\"\n title=\"align right (${this.getShortcutString('alt', 'shift', 'r')})\"\n >\n </span>\n\n <span button data-align=\"top\" id=\"align-top\" title=\"align top (${this.getShortcutString('alt', 'shift', 't')})\">\n </span>\n <span\n button\n data-align=\"middle\"\n id=\"align-middle\"\n title=\"align middle (${this.getShortcutString('alt', 'shift', 'm')})\"\n >\n </span>\n <span\n button\n data-align=\"bottom\"\n id=\"align-bottom\"\n title=\"align bottom (${this.getShortcutString('alt', 'shift', 'b')})\"\n >\n </span>\n\n <span\n button\n data-distribute=\"HORIZONTAL\"\n id=\"distribute-horizontal\"\n title=\"distribute horizontally (${this.getShortcutString('alt', 'shift', 'h')})\"\n >\n </span>\n\n <span\n button\n data-distribute=\"VERTICAL\"\n id=\"distribute-vertical\"\n title=\"distribute vertically (${this.getShortcutString('alt', 'shift', 'v')})\"\n >\n </span>\n\n <span class=\"vline\"></span>\n\n <span\n button\n id=\"front\"\n data-zorder=\"front\"\n title=\"bring to front (${this.getShortcutString('cmd', 'shift', 'f')})\"\n >\n </span>\n <span button id=\"back\" data-zorder=\"back\" title=\"send to back (${this.getShortcutString('cmd', 'shift', 'b')})\">\n </span>\n <span button id=\"forward\" data-zorder=\"forward\" title=\"bring forward (${this.getShortcutString('cmd', 'f')})\">\n </span>\n <span button id=\"backward\" data-zorder=\"backward\" title=\"send backward (${this.getShortcutString('cmd', 'b')})\">\n </span>\n\n <span class=\"vline\"></span>\n\n <span button id=\"symmetry-x\" title=\"symmetry-x (${this.getShortcutString('alt', 'shift', 'x')})\"> </span>\n <span button id=\"symmetry-y\" title=\"symmetry-y (${this.getShortcutString('alt', 'shift', 'y')})\"> </span>\n <span button id=\"rotate-cw\" title=\"rotate clockwise (${this.getShortcutString('alt', 'shift', 'e')})\"> </span>\n <span button id=\"rotate-ccw\" title=\"rotate counter clockwise (${this.getShortcutString('alt', 'shift', 'w')})\">\n </span>\n\n <span class=\"vline\"></span>\n\n <span button id=\"group\" title=\"group (${this.getShortcutString('cmd', 'g')})\"> </span>\n <span button id=\"ungroup\" title=\"ungroup (${this.getShortcutString('cmd', 'shift', 'g')})\"> </span>\n\n <span class=\"vline\"></span>\n\n <span button id=\"font-increase\" title=\"increase font size\"></span>\n <span button id=\"font-decrease\" title=\"decrease font size\"></span>\n\n <span class=\"vline\"></span>\n <span padding></span>\n\n <span button id=\"fit-scene\" title=\"fit scene (${this.getShortcutString('cmd', 'd')})\"> </span>\n\n <span class=\"vline\"></span>\n\n <span button id=\"preview\" title=\"preview (${this.getShortcutString('ctrl', 'p')})\"> </span>\n\n <span button id=\"fullscreen\" title=\"fullscreen (${this.getShortcutString('f11')})\"> </span>\n\n <span\n button\n id=\"toggle-property\"\n title=\"toggle property panel (${this.getShortcutString('cmd', 'h')})\"\n toggles=\"true\"\n >\n </span>\n </div>\n `\n }\n\n onWheelEvent(e: Event) {\n var delta = Math.max(-1, Math.min(1, (e as WheelEvent).deltaY || -(e as WheelEvent).detail))\n this.scrollLeft -= delta * 40\n\n e.preventDefault()\n }\n\n getSymbol(key: string) {\n var symbol\n switch (key) {\n case 'cmd':\n case 'ctrl':\n symbol = MACOS ? '⌘' : 'Ctrl'\n break\n case 'shift':\n symbol = MACOS ? '⇧' : 'Shift'\n break\n case 'alt':\n case 'option':\n symbol = MACOS ? '⌥' : 'Alt'\n break\n case 'backspace':\n symbol = MACOS ? '⌫' : 'BackSpace'\n break\n case 'delete':\n symbol = MACOS ? '⌦' : 'Del'\n break\n default:\n symbol = key.toUpperCase()\n break\n }\n\n return symbol\n }\n\n private getShortcutString(...keys: string[]) {\n var symbols = []\n for (var i = 0; i < arguments.length; i++) {\n symbols.push(this.getSymbol(arguments[i]))\n }\n\n return symbols.join(MACOS ? '' : '+')\n }\n\n onShortcut(e: KeyboardEvent) {\n if (MACOS) var ctrlKey = e.metaKey\n else var ctrlKey = e.ctrlKey\n\n var altKey = e.altKey\n var shiftKey = e.shiftKey\n\n var defaultPrevent = ctrlKey || altKey\n\n switch (e.code) {\n case 'KeyZ':\n if (ctrlKey && !shiftKey) this.onTapUndo()\n else if (ctrlKey && shiftKey) this.onTapRedo()\n break\n case 'KeyY':\n if (ctrlKey && !shiftKey) this.onTapRedo()\n else if (altKey && shiftKey) this.onTapSymmetryY()\n break\n case 'KeyC':\n if (ctrlKey && !shiftKey) this.onTapCopy()\n else if (altKey && shiftKey) this.onTapAlign('center')\n break\n case 'KeyX':\n if (ctrlKey && !shiftKey) this.onTapCut()\n else if (altKey && shiftKey) this.onTapSymmetryX()\n break\n case 'KeyV':\n if (ctrlKey && !shiftKey) {\n this.onTapPaste()\n defaultPrevent = false\n } else if (altKey && shiftKey) this.onTapDistribute('VERTICAL')\n break\n case 'Delete':\n case 'Backspace':\n this.onTapDelete()\n defaultPrevent = true\n break\n case 'KeyG':\n if (ctrlKey && !shiftKey) this.onTapGroup()\n else if (ctrlKey && shiftKey) this.onTapUngroup()\n break\n case 'KeyF':\n if (ctrlKey && !shiftKey) this.scene?.zorder('forward')\n else if (ctrlKey && shiftKey) this.scene?.zorder('front')\n break\n case 'KeyB':\n if (ctrlKey && !shiftKey) this.scene?.zorder('backward')\n else if (ctrlKey && shiftKey) this.scene?.zorder('back')\n else if (altKey && shiftKey) this.onTapAlign('bottom')\n break\n // case 'Equal':\n // if (ctrlKey) this.onTapZoom(zoomin)\n // break\n // case 'Minus':\n // if (ctrlKey) this.onTapZoom(zoomout)\n // break\n case 'KeyH':\n if (ctrlKey && !shiftKey) this.onTapToggle()\n else if (altKey && shiftKey) this.onTapDistribute('HORIZONTAL')\n break\n case 'F11':\n this.onTapFullscreen()\n defaultPrevent = true\n break\n case 'KeyP':\n if (ctrlKey) {\n this.onTapPreview()\n defaultPrevent = true\n }\n break\n case 'KeyA':\n if (ctrlKey) this.onTapSelectAll()\n break\n case 'KeyL':\n if (altKey && shiftKey) this.onTapAlign('left')\n break\n case 'KeyR':\n if (altKey && shiftKey) this.onTapAlign('right')\n break\n case 'KeyM':\n if (altKey && shiftKey) this.onTapAlign('middle')\n break\n case 'KeyT':\n if (altKey && shiftKey) this.onTapAlign('top')\n break\n case 'KeyY':\n if (altKey && shiftKey) this.onTapSymmetryY()\n break\n case 'KeyD':\n if (ctrlKey) {\n this.onTapFitScene()\n defaultPrevent = true\n }\n break\n case 'KeyE':\n if (altKey && shiftKey) this.onTapRotateCW()\n else if (ctrlKey && shiftKey) this.onTapDownloadModel()\n break\n case 'KeyW':\n if (altKey && shiftKey) this.onTapRotateCCW()\n break\n case 'Digit1':\n if (ctrlKey) {\n console.log('MODEL', this.scene && this.scene.model)\n defaultPrevent = true\n }\n break\n case 'Digit2':\n if (ctrlKey) {\n console.log('SELECTED', this.scene && this.scene.selected)\n defaultPrevent = true\n }\n break\n\n default:\n return false\n }\n\n if (defaultPrevent) e.preventDefault()\n return true\n }\n\n onExecute(command: string, undoable: boolean, redoable: boolean) {\n !undoable ? this.undo.setAttribute('disabled', '') : this.undo.removeAttribute('disabled')\n !redoable ? this.redo.setAttribute('disabled', '') : this.redo.removeAttribute('disabled')\n }\n\n onUndo(undoable: boolean, redoable: boolean) {\n !undoable ? this.undo.setAttribute('disabled', '') : this.undo.removeAttribute('disabled')\n !redoable ? this.redo.setAttribute('disabled', '') : this.redo.removeAttribute('disabled')\n }\n\n onRedo(undoable: boolean, redoable: boolean) {\n !undoable ? this.undo.setAttribute('disabled', '') : this.undo.removeAttribute('disabled')\n !redoable ? this.redo.setAttribute('disabled', '') : this.redo.removeAttribute('disabled')\n }\n\n onSceneChanged(after?: Scene, before?: Scene) {\n if (before) {\n before.off('execute', this.onExecute, this)\n before.off('undo', this.onUndo, this)\n before.off('redo', this.onRedo, this)\n }\n\n if (after) {\n after.on('execute', this.onExecute, this)\n after.on('undo', this.onUndo, this)\n after.on('redo', this.onRedo, this)\n }\n }\n\n // @query('#align-left') private alignLeft!: HTMLElement\n // @query('#align-center') private alignCenter!: HTMLElement\n // @query('#align-right') private alignRight!: HTMLElement\n // @query('#align-top') private alignTop!: HTMLElement\n // @query('#align-middle') private alignMiddle!: HTMLElement\n // @query('#align-bottom') private alignBottom!: HTMLElement\n\n onSelectedChanged(after: Component[], before: Component[]) {\n var alignable = after.length > 1\n\n this.aligners.forEach(aligner =>\n alignable ? aligner.removeAttribute('disabled') : aligner.setAttribute('disabled', '')\n )\n\n var movable = after.length === 1\n\n /* forward, backward 이동은 한 컴포넌트만 가능하다. */\n !movable ? this.forward.setAttribute('disabled', '') : this.forward.removeAttribute('disabled')\n !movable ? this.backward.setAttribute('disabled', '') : this.backward.removeAttribute('disabled')\n\n /* 여러 컴포넌트는 front, back 이동이 가능하다. */\n !(alignable || movable) ? this.front.setAttribute('disabled', '') : this.front.removeAttribute('disabled')\n !(alignable || movable) ? this.back.setAttribute('disabled', '') : this.back.removeAttribute('disabled')\n }\n\n onTapUndo() {\n this.scene?.undo()\n }\n\n onTapRedo() {\n this.scene?.redo()\n }\n\n onTapCut() {\n this.scene?.cut()\n }\n\n async onTapCopy() {\n var copied = this.scene?.copy()\n\n if (!copied) return\n\n await copyToClipboard(copied)\n this.cliped = copied\n }\n\n onTapPaste() {\n setTimeout(() => {\n this.cliped && this.scene?.paste(this.cliped)\n }, 100)\n }\n\n onTapDelete() {\n this.scene?.remove()\n }\n\n onTapSelectAll() {\n this.scene?.select('(child)')\n }\n\n onTapFontIncrease(e: TouchEvent) {\n var selected = this.scene?.selected\n if (!selected || !selected.length) {\n return\n }\n\n this.scene?.undoableChange(function () {\n selected!.forEach(function (component) {\n var fontSize = component.get('fontSize')\n\n if (!fontSize) fontSize = '15'\n\n if (fontSize) {\n var size = parseInt(fontSize)\n component.set('fontSize', size + 1)\n }\n })\n })\n }\n\n onTapFontDecrease(e: TouchEvent) {\n var selected = this.scene?.selected\n\n if (!selected || !selected.length) {\n return\n }\n\n this.scene?.undoableChange(function () {\n selected!.forEach(function (component) {\n var fontSize = component.get('fontSize')\n\n if (!fontSize) fontSize = '15'\n\n if (fontSize) {\n var size = parseInt(fontSize)\n if (size > 1) component.set('fontSize', size - 1)\n }\n })\n })\n }\n\n onTapAlign(e: TouchEvent | string) {\n if (!this.scene) return\n\n var selected = this.scene.selected\n if (selected.length <= 1) return\n\n var align = typeof e === 'string' ? e : (e.target as HTMLElement).getAttribute('data-align')\n\n align && this.scene.align(align)\n }\n\n onTapZorder(e: TouchEvent | string) {\n if (!this.scene) return\n\n var selected = this.scene.selected\n if (selected.length < 1) return\n\n var zorder = typeof e === 'string' ? e : (e.target as HTMLElement).getAttribute('data-zorder')\n\n zorder && this.scene.zorder(zorder)\n }\n\n onTapSymmetryX() {\n this.scene && this.scene.symmetryX()\n }\n\n onTapSymmetryY() {\n this.scene && this.scene.symmetryY()\n }\n\n onTapRotateCW() {\n if (!this.scene) return\n\n var selected = this.scene.selected\n if (selected.length && selected[0].isRootModel()) return\n\n this.scene.undoableChange(function () {\n selected.forEach(function (component) {\n var rotation = component.get('rotation')\n\n if (!rotation) rotation = 0\n\n component.set('rotation', (rotation + Math.PI / 2) % (Math.PI * 2))\n })\n })\n }\n\n onTapRotateCCW() {\n if (!this.scene) return\n\n var selected = this.scene.selected\n if (selected.length && selected[0].isRootModel()) return\n\n this.scene.undoableChange(function () {\n selected.forEach(function (component) {\n var rotation = component.get('rotation')\n\n if (!rotation) rotation = 0\n\n component.set('rotation', (rotation - Math.PI / 2) % (Math.PI * 2))\n })\n })\n }\n\n onTapGroup() {\n this.scene && this.scene.group()\n }\n\n onTapUngroup() {\n this.scene && this.scene.ungroup()\n }\n\n onTapFullscreen() {\n this.dispatchEvent(new CustomEvent('modeller-fullscreen'))\n }\n\n onTapToggle() {\n this.hideProperty = !this.hideProperty\n this.dispatchEvent(\n new CustomEvent('hide-property-changed', {\n bubbles: true,\n composed: true,\n detail: { value: this.hideProperty }\n })\n )\n }\n\n onTapFitScene() {\n if (this.scene) {\n this.scene.resize()\n this.scene.fit('ratio')\n }\n }\n\n onTapPreview() {\n this.dispatchEvent(new CustomEvent('open-preview'))\n }\n\n onTapDownloadModel() {\n this.dispatchEvent(new CustomEvent('download-model'))\n }\n\n onTapDistribute(e: TouchEvent | string) {\n if (!this.scene) return\n\n var selected = this.scene.selected\n if (selected.length <= 1) {\n return\n }\n\n var distribute = typeof e === 'string' ? e : (e.target as HTMLElement)!.getAttribute('data-distribute')\n\n distribute && this.scene.distribute(distribute)\n }\n}\n"]}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
import '@operato/input/ox-input-search.js';
|
|
1
2
|
import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
2
3
|
import Sortable from 'sortablejs';
|
|
3
4
|
import { Component, Scene } from '@hatiolab/things-scene';
|
|
4
5
|
export declare class SceneInspector extends LitElement {
|
|
5
6
|
static styles: import("lit").CSSResult[];
|
|
6
7
|
scene?: Scene;
|
|
8
|
+
private searchText;
|
|
7
9
|
private _extendedMap;
|
|
8
10
|
private show;
|
|
11
|
+
disconnectScene(scene?: Scene): void;
|
|
12
|
+
disconnectedCallback(): void;
|
|
9
13
|
render(): TemplateResult<1>;
|
|
10
14
|
firstUpdated(): void;
|
|
15
|
+
refresh(): void;
|
|
11
16
|
updated(change: PropertyValues<this>): void;
|
|
12
17
|
sortableConfig: Sortable.Options;
|
|
13
18
|
onSort(e: Sortable.SortableEvent): void;
|
|
14
|
-
disconnectedCallback(): void;
|
|
15
19
|
_onclick(e: MouseEvent): void;
|
|
16
20
|
_ondblclick(e: MouseEvent): void;
|
|
17
21
|
get extendedMap(): any;
|
|
@@ -20,5 +24,6 @@ export declare class SceneInspector extends LitElement {
|
|
|
20
24
|
toggleExtended(component: Component): void;
|
|
21
25
|
toggleHidden(component: Component): void;
|
|
22
26
|
selectComponent(component: Component): void;
|
|
27
|
+
shouldBeShown(component: Component): boolean;
|
|
23
28
|
renderComponent(component: Component, depth: number): TemplateResult;
|
|
24
29
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
+
import '@operato/input/ox-input-search.js';
|
|
2
3
|
import { css, html, LitElement } from 'lit';
|
|
3
|
-
import { property } from 'lit/decorators.js';
|
|
4
|
+
import { property, state } from 'lit/decorators.js';
|
|
4
5
|
import Sortable from 'sortablejs';
|
|
5
6
|
export class SceneInspector extends LitElement {
|
|
6
7
|
constructor() {
|
|
7
8
|
super(...arguments);
|
|
9
|
+
this.searchText = '';
|
|
8
10
|
this.show = false;
|
|
9
11
|
this.sortableConfig = {
|
|
10
12
|
group: 'inspector',
|
|
@@ -14,49 +16,58 @@ export class SceneInspector extends LitElement {
|
|
|
14
16
|
onSort: this.onSort.bind(this)
|
|
15
17
|
};
|
|
16
18
|
}
|
|
19
|
+
disconnectScene(scene) {
|
|
20
|
+
if (scene) {
|
|
21
|
+
scene.off('selected', undefined, this);
|
|
22
|
+
scene.off('execute', undefined, this);
|
|
23
|
+
scene.off('undo', undefined, this);
|
|
24
|
+
scene.off('redo', undefined, this);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
disconnectedCallback() {
|
|
28
|
+
super.disconnectedCallback();
|
|
29
|
+
this.disconnectScene(this.scene);
|
|
30
|
+
delete this._extendedMap;
|
|
31
|
+
}
|
|
17
32
|
render() {
|
|
18
|
-
return html `
|
|
33
|
+
return html `
|
|
34
|
+
<ox-input-search
|
|
35
|
+
@change=${(e) => (this.searchText = e.target.value)}
|
|
36
|
+
></ox-input-search>
|
|
37
|
+
|
|
38
|
+
<div result>${!this.scene ? html `` : this.renderComponent(this.scene.root, 0)}</div>
|
|
39
|
+
`;
|
|
19
40
|
}
|
|
20
41
|
firstUpdated() {
|
|
21
42
|
dispatchEvent(new Event('resize'));
|
|
22
43
|
this.renderRoot.addEventListener('click', this._onclick.bind(this));
|
|
23
44
|
this.renderRoot.addEventListener('dblclick', this._ondblclick.bind(this));
|
|
24
45
|
}
|
|
46
|
+
refresh() {
|
|
47
|
+
var _a;
|
|
48
|
+
let selected = ((_a = this.scene) === null || _a === void 0 ? void 0 : _a.selected) || [];
|
|
49
|
+
selected.forEach(component => {
|
|
50
|
+
let parent = component.parent;
|
|
51
|
+
while (parent && !this.extendedMap.get(parent)) {
|
|
52
|
+
this.extendedMap.set(parent, true);
|
|
53
|
+
parent = parent.parent;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
this.requestUpdate();
|
|
57
|
+
}
|
|
25
58
|
updated(change) {
|
|
26
59
|
if (change.has('scene')) {
|
|
27
60
|
let oldScene = change.get('scene');
|
|
28
61
|
if (oldScene) {
|
|
29
|
-
|
|
30
|
-
oldScene.off('execute');
|
|
31
|
-
oldScene.off('undo');
|
|
32
|
-
oldScene.off('redo');
|
|
62
|
+
this.disconnectScene(oldScene);
|
|
33
63
|
delete this._extendedMap;
|
|
34
64
|
}
|
|
35
65
|
if (this.scene && this.scene.root) {
|
|
36
|
-
|
|
37
|
-
this.
|
|
38
|
-
this.scene.on('
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
let parent = component.parent;
|
|
42
|
-
while (parent && !this.extendedMap.get(parent)) {
|
|
43
|
-
this.extendedMap.set(parent, true);
|
|
44
|
-
parent = parent.parent;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
this.requestUpdate();
|
|
48
|
-
});
|
|
49
|
-
this.scene.on('execute', () => {
|
|
50
|
-
this.requestUpdate();
|
|
51
|
-
});
|
|
52
|
-
this.scene.on('undo', () => {
|
|
53
|
-
this.extendedMap.set(this.scene.root, true);
|
|
54
|
-
this.requestUpdate();
|
|
55
|
-
});
|
|
56
|
-
this.scene.on('redo', () => {
|
|
57
|
-
this.extendedMap.set(this.scene.root, true);
|
|
58
|
-
this.requestUpdate();
|
|
59
|
-
});
|
|
66
|
+
this.scene.on('selected', this.refresh, this);
|
|
67
|
+
this.scene.on('execute', this.refresh, this);
|
|
68
|
+
this.scene.on('undo', this.refresh, this);
|
|
69
|
+
this.scene.on('redo', this.refresh, this);
|
|
70
|
+
this.refresh();
|
|
60
71
|
}
|
|
61
72
|
}
|
|
62
73
|
this.updateComplete.then(() => {
|
|
@@ -77,11 +88,6 @@ export class SceneInspector extends LitElement {
|
|
|
77
88
|
this.show = true;
|
|
78
89
|
});
|
|
79
90
|
}
|
|
80
|
-
disconnectedCallback() {
|
|
81
|
-
super.disconnectedCallback();
|
|
82
|
-
delete this.scene;
|
|
83
|
-
delete this._extendedMap;
|
|
84
|
-
}
|
|
85
91
|
_onclick(e) {
|
|
86
92
|
e.stopPropagation();
|
|
87
93
|
var targetElement = e.target;
|
|
@@ -164,13 +170,22 @@ export class SceneInspector extends LitElement {
|
|
|
164
170
|
this.scene.selected = [component];
|
|
165
171
|
this.requestUpdate();
|
|
166
172
|
}
|
|
173
|
+
shouldBeShown(component) {
|
|
174
|
+
const { type, name, id, tag } = component.state;
|
|
175
|
+
return !!(!this.searchText ||
|
|
176
|
+
`${type} ${name || ''} ${id || ''} ${tag || ''}`.search(this.searchText) > -1 ||
|
|
177
|
+
(component.components || []).find((child) => this.shouldBeShown(child)));
|
|
178
|
+
}
|
|
167
179
|
renderComponent(component, depth) {
|
|
168
180
|
var _a;
|
|
169
181
|
if (!component) {
|
|
170
182
|
return html ``;
|
|
171
183
|
}
|
|
184
|
+
if (!this.shouldBeShown(component)) {
|
|
185
|
+
return html ``;
|
|
186
|
+
}
|
|
172
187
|
const children = (component.isContainer() && component.components) || [];
|
|
173
|
-
const extended = this.isExtended(component) ? children : [];
|
|
188
|
+
const extended = this.isExtended(component) ? children.filter(child => this.shouldBeShown(child)) : [];
|
|
174
189
|
const { type, id, tag, class: clazz } = component.state;
|
|
175
190
|
const name = (id ? `#${id}` : '') + (tag ? `@${tag}` : '') + (clazz ? `.(${clazz})` : '');
|
|
176
191
|
return html `
|
|
@@ -203,9 +218,21 @@ export class SceneInspector extends LitElement {
|
|
|
203
218
|
SceneInspector.styles = [
|
|
204
219
|
css `
|
|
205
220
|
:host {
|
|
221
|
+
display: flex;
|
|
222
|
+
flex-direction: column;
|
|
223
|
+
|
|
206
224
|
color: var(--scene-inspector-color);
|
|
207
225
|
}
|
|
208
226
|
|
|
227
|
+
div[result] {
|
|
228
|
+
flex: 1;
|
|
229
|
+
|
|
230
|
+
display: flex;
|
|
231
|
+
flex-direction: column;
|
|
232
|
+
|
|
233
|
+
overflow-y: auto;
|
|
234
|
+
}
|
|
235
|
+
|
|
209
236
|
.component {
|
|
210
237
|
display: block;
|
|
211
238
|
overflow: hidden;
|
|
@@ -285,4 +312,7 @@ SceneInspector.styles = [
|
|
|
285
312
|
__decorate([
|
|
286
313
|
property({ type: Object })
|
|
287
314
|
], SceneInspector.prototype, "scene", void 0);
|
|
315
|
+
__decorate([
|
|
316
|
+
state()
|
|
317
|
+
], SceneInspector.prototype, "searchText", void 0);
|
|
288
318
|
//# sourceMappingURL=inspector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/inspector/inspector.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkC,MAAM,KAAK,CAAA;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,QAAQ,MAAM,YAAY,CAAA;AAIjC,MAAM,OAAO,cAAe,SAAQ,UAAU;IAA9C;;QAuFU,SAAI,GAAY,KAAK,CAAA;QAkE7B,mBAAc,GAAqB;YACjC,KAAK,EAAE,WAAW;YAClB,SAAS,EAAE,GAAG;YACd,SAAS,EAAE,YAAY;YACvB,aAAa,EAAE,CAAC;YAChB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAA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C,IAAI,CAAA,uBAAuB,IAAI,UAAU;YAC3C,CAAC,CAAC,IAAI,CAAA,EAAE;;;UAGV,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;;KAElE,CAAA;IACH,CAAC;;AAhUM,qBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+EF;CACF,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAc","sourcesContent":["import { css, html, LitElement, PropertyValues, TemplateResult } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport Sortable from 'sortablejs'\n\nimport { Component, Container, Scene } from '@hatiolab/things-scene'\n\nexport class SceneInspector extends LitElement {\n static styles = [\n css`\n :host {\n color: var(--scene-inspector-color);\n }\n\n .component {\n display: block;\n overflow: hidden;\n border-bottom: 1px solid rgba(0, 0, 0, 0.05);\n font-size: 14px;\n }\n\n .component[selected] {\n background-color: var(--scene-inspector-selected-background-color);\n border-top: var(--scene-inspector-selected-border);\n border-bottom: var(--scene-inspector-selected-border);\n }\n [selected] .type {\n font-weight: bold;\n }\n\n span,\n i {\n display: inline-block;\n }\n\n span.type {\n text-overflow: ellipses;\n }\n\n span.name {\n background-color: var(--scene-inspector-name-background-color);\n border-radius: var(--border-radius);\n padding: 0 4px;\n color: #fff;\n font-size: 0.8em;\n }\n\n .eye {\n margin: 0 0 0 5px;\n vertical-align: middle;\n opacity: 0.7;\n font-size: 1.1em;\n color: var(--scene-inspector-eye-icon-color);\n }\n\n .collapsed::before,\n .extended::before,\n .collapsespace::before {\n background: var(--url-icon-shell-inspector) no-repeat;\n width: 16px;\n height: 18px;\n display: inline-block;\n content: '';\n opacity: 0.6;\n }\n\n .collapsed::before {\n background-position: 100% -195px;\n }\n\n .extended::before {\n background-position: 100% -295px;\n }\n\n .collapsespace::before {\n background-position: 100% -395px;\n opacity: 0.9;\n width: 16px;\n }\n .collapsed,\n .extended,\n .collapsespace {\n border-left: 1px dotted rgba(0, 0, 0, 0.1);\n }\n\n pre {\n display: inline;\n }\n `\n ]\n\n @property({ type: Object }) scene?: Scene\n\n private _extendedMap: any\n private show: boolean = false\n\n render() {\n return html` ${!this.scene ? html`` : this.renderComponent(this.scene.root, 0)} `\n }\n\n firstUpdated() {\n dispatchEvent(new Event('resize'))\n this.renderRoot.addEventListener('click', this._onclick.bind(this) as EventListener)\n this.renderRoot.addEventListener('dblclick', this._ondblclick.bind(this) as EventListener)\n }\n\n updated(change: PropertyValues<this>) {\n if (change.has('scene')) {\n let oldScene = change.get('scene') as Scene\n\n if (oldScene) {\n oldScene.off('selected')\n oldScene.off('execute')\n oldScene.off('undo')\n oldScene.off('redo')\n\n delete this._extendedMap\n }\n\n if (this.scene && this.scene.root) {\n // root 는 기본상태가 extended 되도록 하기위해서임.\n this.extendedMap.set(this.scene.root, true)\n\n this.scene.on('selected', (after: Component[], before: Component[]) => {\n let selected = after\n\n selected.forEach(component => {\n let parent = component.parent\n while (parent && !this.extendedMap.get(parent)) {\n this.extendedMap.set(parent, true)\n parent = parent.parent\n }\n })\n\n this.requestUpdate()\n })\n\n this.scene.on('execute', () => {\n this.requestUpdate()\n })\n\n this.scene.on('undo', () => {\n this.extendedMap.set(this.scene!.root, true)\n this.requestUpdate()\n })\n\n this.scene.on('redo', () => {\n this.extendedMap.set(this.scene!.root, true)\n this.requestUpdate()\n })\n }\n }\n\n this.updateComplete.then(() => {\n this.renderRoot.querySelectorAll('[sortable]').forEach(sortable => {\n new Sortable(sortable as HTMLElement, this.sortableConfig)\n })\n })\n }\n\n sortableConfig: Sortable.Options = {\n group: 'inspector',\n animation: 150,\n draggable: '.component',\n swapThreshold: 1,\n onSort: this.onSort.bind(this)\n }\n\n onSort(e: Sortable.SortableEvent) {\n if (!this.scene) return\n\n var component = (e.item as HTMLElement & { component: Component }).component\n var to_container = (e.to as HTMLElement & { component: Component }).component as Container\n var to_index = e.newIndex! - 1\n\n this.scene.move(component, to_container, to_index)\n\n this.show = false\n this.updateComplete.then(() => {\n this.show = true\n })\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n delete this.scene\n delete this._extendedMap\n }\n\n _onclick(e: MouseEvent) {\n e.stopPropagation()\n\n var targetElement = e.target as HTMLElement & { component: Component }\n var classList = targetElement.classList\n var component\n\n while (!component && targetElement) {\n component = targetElement.component\n\n if (component) break\n\n targetElement = targetElement.parentNode as HTMLElement & { component: Component }\n\n if (!targetElement || targetElement === this.renderRoot) break\n }\n\n if (component) {\n if (classList.contains('eye')) {\n this.toggleHidden(component)\n } else if (classList.contains('extended') || classList.contains('collapsed')) {\n this.toggleExtended(component)\n }\n\n this.selectComponent(component)\n } else {\n if (classList.contains('inspector')) {\n this.show = !this.show\n this.style.height = this.show ? '100%' : ''\n }\n }\n\n this.requestUpdate()\n }\n\n _ondblclick(e: MouseEvent) {\n e.stopPropagation()\n\n var targetElement = e.target as HTMLElement & { component: Component }\n var component\n\n while (!component && targetElement) {\n component = targetElement.component\n\n if (component) break\n\n targetElement = targetElement.parentNode as HTMLElement & { component: Component }\n\n if (!targetElement || targetElement === this.renderRoot) break\n }\n\n if (component && component.isContainer()) {\n this.toggleExtended(component)\n }\n\n this.requestUpdate()\n }\n\n get extendedMap() {\n if (!this._extendedMap) {\n this._extendedMap = new WeakMap()\n }\n\n return this._extendedMap\n }\n\n getNodeHandleClass(component: Component) {\n if (component.isContainer() && (component as Container).components.length > 0) {\n return !!this.extendedMap.get(component) ? 'extended' : 'collapsed'\n } else {\n return 'collapsespace'\n }\n }\n\n isExtended(component: Component) {\n return !!this.extendedMap.get(component)\n }\n\n toggleExtended(component: Component) {\n var extended = this.isExtended(component)\n\n if (extended) {\n this.extendedMap.delete(component)\n } else {\n this.extendedMap.set(component, !extended)\n }\n\n this.requestUpdate()\n }\n\n toggleHidden(component: Component) {\n component.set('hidden', !component.hidden)\n\n this.requestUpdate()\n }\n\n selectComponent(component: Component) {\n this.scene!.selected = [component]\n\n this.requestUpdate()\n }\n\n renderComponent(component: Component, depth: number): TemplateResult {\n if (!component) {\n return html``\n }\n\n const children = (component.isContainer() && (component as Container).components) || []\n const extended = this.isExtended(component) ? children : []\n const { type, id, tag, class: clazz } = component.state\n\n const name = (id ? `#${id}` : '') + (tag ? `@${tag}` : '') + (clazz ? `.(${clazz})` : '')\n\n return html`\n <div\n class=\"component\"\n ?selected=${(this.scene?.selected || []).indexOf(component) > -1}\n .component=${component}\n ?sortable=${component.isContainer()}\n >\n <span>\n ${depth > 0\n ? html`\n <mwc-icon class=\"eye\">${component.get('hidden') ? 'visibility_off' : 'visibility'}</mwc-icon>\n <pre>${' '.repeat(depth)}</pre>\n `\n : html` <pre>${' '.repeat(depth + 2)}</pre> `}\n\n <span class=${this.getNodeHandleClass(component)}> </span>\n\n <span class=\"type\">${depth == 0 ? 'ROOT' : type}</span> ${name\n ? html` <span class=\"name\">${name}</span> `\n : html``}\n </span>\n\n ${extended.map(child => this.renderComponent(child, depth + 1))}\n </div>\n `\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"inspector.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/inspector/inspector.ts"],"names":[],"mappings":";AAAA,OAAO,mCAAmC,CAAA;AAE1C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkC,MAAM,KAAK,CAAA;AAC3E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,QAAQ,MAAM,YAAY,CAAA;AAIjC,MAAM,OAAO,cAAe,SAAQ,UAAU;IAA9C;;QAkGmB,eAAU,GAAW,EAAE,CAAA;QAGhC,SAAI,GAAY,KAAK,CAAA;QA2E7B,mBAAc,GAAqB;YACjC,KAAK,EAAE,WAAW;YAClB,SAAS,EAAE,GAAG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MAAM,EAAE,CAAC;6CAAc;AAEhC;IAAR,KAAK,EAAE;kDAAgC","sourcesContent":["import '@operato/input/ox-input-search.js'\n\nimport { css, html, LitElement, PropertyValues, TemplateResult } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport Sortable from 'sortablejs'\n\nimport { Component, Container, Scene } from '@hatiolab/things-scene'\n\nexport class SceneInspector extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n color: var(--scene-inspector-color);\n }\n\n div[result] {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n\n overflow-y: auto;\n }\n\n .component {\n display: block;\n overflow: hidden;\n border-bottom: 1px solid rgba(0, 0, 0, 0.05);\n font-size: 14px;\n }\n\n .component[selected] {\n background-color: var(--scene-inspector-selected-background-color);\n border-top: var(--scene-inspector-selected-border);\n border-bottom: var(--scene-inspector-selected-border);\n }\n [selected] .type {\n font-weight: bold;\n }\n\n span,\n i {\n display: inline-block;\n }\n\n span.type {\n text-overflow: ellipses;\n }\n\n span.name {\n background-color: var(--scene-inspector-name-background-color);\n border-radius: var(--border-radius);\n padding: 0 4px;\n color: #fff;\n font-size: 0.8em;\n }\n\n .eye {\n margin: 0 0 0 5px;\n vertical-align: middle;\n opacity: 0.7;\n font-size: 1.1em;\n color: var(--scene-inspector-eye-icon-color);\n }\n\n .collapsed::before,\n .extended::before,\n .collapsespace::before {\n background: var(--url-icon-shell-inspector) no-repeat;\n width: 16px;\n height: 18px;\n display: inline-block;\n content: '';\n opacity: 0.6;\n }\n\n .collapsed::before {\n background-position: 100% -195px;\n }\n\n .extended::before {\n background-position: 100% -295px;\n }\n\n .collapsespace::before {\n background-position: 100% -395px;\n opacity: 0.9;\n width: 16px;\n }\n .collapsed,\n .extended,\n .collapsespace {\n border-left: 1px dotted rgba(0, 0, 0, 0.1);\n }\n\n pre {\n display: inline;\n }\n `\n ]\n\n @property({ type: Object }) scene?: Scene\n\n @state() private searchText: string = ''\n\n private _extendedMap: any\n private show: boolean = false\n\n disconnectScene(scene?: Scene) {\n if (scene) {\n scene.off('selected', undefined, this)\n scene.off('execute', undefined, this)\n scene.off('undo', undefined, this)\n scene.off('redo', undefined, this)\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.disconnectScene(this.scene)\n delete this._extendedMap\n }\n\n render() {\n return html`\n <ox-input-search\n @change=${(e: Event) => (this.searchText = (e.target as HTMLInputElement).value)}\n ></ox-input-search>\n\n <div result>${!this.scene ? html`` : this.renderComponent(this.scene.root, 0)}</div>\n `\n }\n\n firstUpdated() {\n dispatchEvent(new Event('resize'))\n\n this.renderRoot.addEventListener('click', this._onclick.bind(this) as EventListener)\n this.renderRoot.addEventListener('dblclick', this._ondblclick.bind(this) as EventListener)\n }\n\n refresh() {\n let selected = this.scene?.selected || []\n\n selected.forEach(component => {\n let parent = component.parent\n while (parent && !this.extendedMap.get(parent)) {\n this.extendedMap.set(parent, true)\n parent = parent.parent\n }\n })\n\n this.requestUpdate()\n }\n\n updated(change: PropertyValues<this>) {\n if (change.has('scene')) {\n let oldScene = change.get('scene') as Scene\n\n if (oldScene) {\n this.disconnectScene(oldScene)\n delete this._extendedMap\n }\n\n if (this.scene && this.scene.root) {\n this.scene.on('selected', this.refresh, this)\n this.scene.on('execute', this.refresh, this)\n this.scene.on('undo', this.refresh, this)\n this.scene.on('redo', this.refresh, this)\n\n this.refresh()\n }\n }\n\n this.updateComplete.then(() => {\n this.renderRoot.querySelectorAll('[sortable]').forEach(sortable => {\n new Sortable(sortable as HTMLElement, this.sortableConfig)\n })\n })\n }\n\n sortableConfig: Sortable.Options = {\n group: 'inspector',\n animation: 150,\n draggable: '.component',\n swapThreshold: 1,\n onSort: this.onSort.bind(this)\n }\n\n onSort(e: Sortable.SortableEvent) {\n if (!this.scene) return\n\n var component = (e.item as HTMLElement & { component: Component }).component\n var to_container = (e.to as HTMLElement & { component: Component }).component as Container\n var to_index = e.newIndex! - 1\n\n this.scene.move(component, to_container, to_index)\n\n this.show = false\n this.updateComplete.then(() => {\n this.show = true\n })\n }\n\n _onclick(e: MouseEvent) {\n e.stopPropagation()\n\n var targetElement = e.target as HTMLElement & { component: Component }\n var classList = targetElement.classList\n var component\n\n while (!component && targetElement) {\n component = targetElement.component\n\n if (component) break\n\n targetElement = targetElement.parentNode as HTMLElement & { component: Component }\n\n if (!targetElement || targetElement === this.renderRoot) break\n }\n\n if (component) {\n if (classList.contains('eye')) {\n this.toggleHidden(component)\n } else if (classList.contains('extended') || classList.contains('collapsed')) {\n this.toggleExtended(component)\n }\n\n this.selectComponent(component)\n } else {\n if (classList.contains('inspector')) {\n this.show = !this.show\n this.style.height = this.show ? '100%' : ''\n }\n }\n\n this.requestUpdate()\n }\n\n _ondblclick(e: MouseEvent) {\n e.stopPropagation()\n\n var targetElement = e.target as HTMLElement & { component: Component }\n var component\n\n while (!component && targetElement) {\n component = targetElement.component\n\n if (component) break\n\n targetElement = targetElement.parentNode as HTMLElement & { component: Component }\n\n if (!targetElement || targetElement === this.renderRoot) break\n }\n\n if (component && component.isContainer()) {\n this.toggleExtended(component)\n }\n\n this.requestUpdate()\n }\n\n get extendedMap() {\n if (!this._extendedMap) {\n this._extendedMap = new WeakMap()\n }\n\n return this._extendedMap\n }\n\n getNodeHandleClass(component: Component) {\n if (component.isContainer() && (component as Container).components.length > 0) {\n return !!this.extendedMap.get(component) ? 'extended' : 'collapsed'\n } else {\n return 'collapsespace'\n }\n }\n\n isExtended(component: Component) {\n return !!this.extendedMap.get(component)\n }\n\n toggleExtended(component: Component) {\n var extended = this.isExtended(component)\n\n if (extended) {\n this.extendedMap.delete(component)\n } else {\n this.extendedMap.set(component, !extended)\n }\n\n this.requestUpdate()\n }\n\n toggleHidden(component: Component) {\n component.set('hidden', !component.hidden)\n\n this.requestUpdate()\n }\n\n selectComponent(component: Component) {\n this.scene!.selected = [component]\n\n this.requestUpdate()\n }\n\n shouldBeShown(component: Component): boolean {\n const { type, name, id, tag } = component.state\n\n return !!(\n !this.searchText ||\n `${type} ${name || ''} ${id || ''} ${tag || ''}`.search(this.searchText) > -1 ||\n ((component as Container).components || []).find((child: Component) => this.shouldBeShown(child))\n )\n }\n\n renderComponent(component: Component, depth: number): TemplateResult {\n if (!component) {\n return html``\n }\n\n if (!this.shouldBeShown(component)) {\n return html``\n }\n\n const children = (component.isContainer() && (component as Container).components) || []\n const extended = this.isExtended(component) ? children.filter(child => this.shouldBeShown(child)) : []\n const { type, id, tag, class: clazz } = component.state\n\n const name = (id ? `#${id}` : '') + (tag ? `@${tag}` : '') + (clazz ? `.(${clazz})` : '')\n\n return html`\n <div\n class=\"component\"\n ?selected=${(this.scene?.selected || []).indexOf(component) > -1}\n .component=${component}\n ?sortable=${component.isContainer()}\n >\n <span>\n ${depth > 0\n ? html`\n <mwc-icon class=\"eye\">${component.get('hidden') ? 'visibility_off' : 'visibility'}</mwc-icon>\n <pre>${' '.repeat(depth)}</pre>\n `\n : html` <pre>${' '.repeat(depth + 2)}</pre> `}\n\n <span class=${this.getNodeHandleClass(component)}> </span>\n\n <span class=\"type\">${depth == 0 ? 'ROOT' : type}</span> ${name\n ? html` <span class=\"name\">${name}</span> `\n : html``}\n </span>\n\n ${extended.map(child => this.renderComponent(child, depth + 1))}\n </div>\n `\n }\n}\n"]}
|