@operato/board 1.0.0-beta.9 → 1.0.2

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +388 -0
  2. package/demo/index-modeller.html +1 -1
  3. package/demo/index-player.html +1 -1
  4. package/demo/index-viewer.html +1 -1
  5. package/demo/index.html +1 -1
  6. package/dist/src/data-storage/data-storage.d.ts +8 -0
  7. package/dist/src/data-storage/data-storage.js +28 -0
  8. package/dist/src/data-storage/data-storage.js.map +1 -0
  9. package/dist/src/graphql/data-subscription.d.ts +1 -3
  10. package/dist/src/index.d.ts +7 -6
  11. package/dist/src/index.js +7 -6
  12. package/dist/src/index.js.map +1 -1
  13. package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.d.ts +1 -0
  14. package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.js +40 -7
  15. package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.js.map +1 -1
  16. package/dist/src/modeller/property-sidebar/data-binding/data-binding.js +7 -0
  17. package/dist/src/modeller/property-sidebar/data-binding/data-binding.js.map +1 -1
  18. package/dist/src/modeller/property-sidebar/effects/effects-shared-style.js +4 -0
  19. package/dist/src/modeller/property-sidebar/effects/effects-shared-style.js.map +1 -1
  20. package/dist/src/modeller/property-sidebar/inspector/inspector.d.ts +1 -1
  21. package/dist/src/modeller/property-sidebar/inspector/inspector.js +6 -4
  22. package/dist/src/modeller/property-sidebar/inspector/inspector.js.map +1 -1
  23. package/dist/src/modeller/property-sidebar/property-shared-style.js +4 -0
  24. package/dist/src/modeller/property-sidebar/property-shared-style.js.map +1 -1
  25. package/dist/src/modeller/property-sidebar/property-sidebar.js +2 -0
  26. package/dist/src/modeller/property-sidebar/property-sidebar.js.map +1 -1
  27. package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.js +15 -11
  28. package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.js.map +1 -1
  29. package/dist/src/modeller/property-sidebar/styles/styles.d.ts +1 -0
  30. package/dist/src/modeller/property-sidebar/styles/styles.js +4 -3
  31. package/dist/src/modeller/property-sidebar/styles/styles.js.map +1 -1
  32. package/dist/src/modeller/scene-viewer/ox-scene-player.js +2 -2
  33. package/dist/src/modeller/scene-viewer/ox-scene-player.js.map +1 -1
  34. package/dist/src/modeller/scene-viewer/ox-scene-viewer.d.ts +1 -1
  35. package/dist/src/modeller/scene-viewer/ox-scene-viewer.js +3 -3
  36. package/dist/src/modeller/scene-viewer/ox-scene-viewer.js.map +1 -1
  37. package/dist/src/ox-board-list.js +1 -1
  38. package/dist/src/ox-board-list.js.map +1 -1
  39. package/dist/src/ox-board-viewer.d.ts +1 -0
  40. package/dist/src/ox-board-viewer.js +13 -7
  41. package/dist/src/ox-board-viewer.js.map +1 -1
  42. package/dist/src/player/ox-board-wrapper.js +2 -2
  43. package/dist/src/player/ox-board-wrapper.js.map +1 -1
  44. package/dist/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +20 -19
  46. package/src/data-storage/data-storage.ts +47 -0
  47. package/src/index.ts +7 -6
  48. package/src/modeller/property-sidebar/data-binding/data-binding-mapper.ts +44 -10
  49. package/src/modeller/property-sidebar/data-binding/data-binding.ts +10 -2
  50. package/src/modeller/property-sidebar/effects/effects-shared-style.ts +4 -0
  51. package/src/modeller/property-sidebar/inspector/inspector.ts +7 -4
  52. package/src/modeller/property-sidebar/property-shared-style.ts +4 -0
  53. package/src/modeller/property-sidebar/property-sidebar.ts +2 -0
  54. package/src/modeller/property-sidebar/specifics/specific-properties-builder.ts +17 -12
  55. package/src/modeller/property-sidebar/styles/styles.ts +5 -4
  56. package/src/modeller/scene-viewer/ox-scene-player.ts +2 -2
  57. package/src/modeller/scene-viewer/ox-scene-viewer.ts +4 -3
  58. package/src/ox-board-list.ts +1 -1
  59. package/src/ox-board-viewer.ts +13 -7
  60. package/src/player/ox-board-wrapper.ts +2 -2
  61. package/yarn-error.log +0 -18355
@@ -5,6 +5,7 @@ import { __decorate } from "tslib";
5
5
  import '@polymer/paper-dropdown-menu/paper-dropdown-menu';
6
6
  import '@operato/help/ox-title-with-help.js';
7
7
  import '@operato/input/ox-input-color.js';
8
+ import '@operato/input/ox-input-range.js';
8
9
  import '@operato/app/input/ox-input-fill-style.js';
9
10
  import '@operato/font/ox-font-selector.js';
10
11
  import '@operato/i18n/ox-i18n.js';
@@ -23,13 +24,13 @@ let PropertyStyles = class PropertyStyles extends AbstractProperty {
23
24
  this.renderRoot.addEventListener('change', this._onValueChange.bind(this));
24
25
  }
25
26
  render() {
26
- var { alpha, fontFamily, fontSize, lineHeight, fontColor, bold, italic, fillStyle, lineWidth, strokeStyle, lineDash, lineCap, lineJoin, begin, beginSize, end, endSize } = this.value;
27
+ var { alpha = 1, fontFamily, fontSize, lineHeight, fontColor, bold, italic, fillStyle, lineWidth, strokeStyle, lineDash, lineCap, lineJoin, begin, beginSize, end, endSize } = this.value || {};
27
28
  return html `
28
29
  <fieldset>
29
30
  <legend>
30
31
  <ox-title-with-help topic="board-modeller/styles/opacity" msgid="label.opacity">opacity</ox-title-with-help>
31
32
  </legend>
32
- <paper-slider min="0" max="1" step="0.1" value-key="alpha" .value=${alpha || 1} editable> </paper-slider>
33
+ <ox-input-range min="0" max="1" step="0.1" value-key="alpha" .value=${alpha} editable> </ox-input-range>
33
34
  </fieldset>
34
35
 
35
36
  <fieldset>
@@ -243,7 +244,7 @@ let PropertyStyles = class PropertyStyles extends AbstractProperty {
243
244
  PropertyStyles.styles = [
244
245
  PropertySharedStyle,
245
246
  css `
246
- paper-slider {
247
+ ox-input-range {
247
248
  width: 100%;
248
249
  }
249
250
 
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/styles/styles.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,kDAAkD,CAAA;AACzD,OAAO,qCAAqC,CAAA;AAC5C,OAAO,kCAAkC,CAAA;AACzC,OAAO,2CAA2C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8SF;CACF,CAAA;AAC2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAgB;AAChB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;gDAA2B;AAC1B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;6CAAkB;AArTxC,cAAc;IADnB,aAAa,CAAC,gBAAgB,CAAC;GAC1B,cAAc,CA4iBnB","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@polymer/paper-dropdown-menu/paper-dropdown-menu'\nimport '@operato/help/ox-title-with-help.js'\nimport '@operato/input/ox-input-color.js'\nimport '@operato/app/input/ox-input-fill-style.js'\nimport '@operato/font/ox-font-selector.js'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { AbstractProperty } from '../abstract-property'\nimport { Component } from '@hatiolab/things-scene'\nimport { PropertySharedStyle } from '../property-shared-style'\n\n@customElement('property-style')\nclass PropertyStyles extends AbstractProperty {\n static styles = [\n PropertySharedStyle,\n css`\n paper-slider {\n width: 100%;\n }\n\n .btn-group {\n height: 24px;\n }\n\n .btn-group paper-button {\n width: 30px;\n height: 24px;\n min-width: initial;\n margin: 0 4px 0 0;\n padding: 0;\n border-radius: 0;\n display: inline-block;\n border-bottom: 2px solid #fff;\n\n background: var(--url-icon-properties) no-repeat;\n background-size: 70%;\n }\n\n .btn-group paper-button.tbold {\n background-position: 50% -170px;\n }\n\n .btn-group paper-button.titalic {\n background-position: 50% -205px;\n }\n\n .btn-group paper-button.tunderline {\n background-position: 50% -240px;\n }\n\n .btn-group paper-button.tstrikethrough {\n background-position: 50% -415px;\n }\n\n .btn-group paper-button[active] {\n border-color: #f2471c;\n }\n\n .line-type paper-listbox {\n overflow: hidden;\n max-width: 100px;\n }\n .line-type paper-item {\n background: var(--url-icon-properties-line-type) 50% 0 no-repeat;\n min-height: 25px;\n padding: 3px 9px;\n width: 80px;\n }\n\n .line-type paper-item.solid {\n background-position: 50% 10px;\n }\n .line-type paper-item.round-dot {\n background-position: 50% -40px;\n }\n .line-type paper-item.square-dot {\n background-position: 50% -90px;\n }\n .line-type paper-item.dash {\n background-position: 50% -140px;\n }\n .line-type paper-item.dash-dot {\n background-position: 50% -190px;\n }\n .line-type paper-item.long-dash {\n background-position: 50% -240px;\n }\n .line-type paper-item.long-dash-dot {\n background-position: 50% -290px;\n }\n .line-type paper-item.long-dash-dot-dot {\n background-position: 50% -340px;\n }\n\n .line-type .paper-input-container input {\n background: var(--url-icon-properties-line-type) 50% 0 no-repeat !important;\n }\n .line-type.solid .paper-input-container input {\n background-position: 50% 5px !important;\n }\n .line-type.round-dot .paper-input-container input {\n background-position: 50% -45px !important;\n }\n .line-type.square-dot .paper-input-container input {\n background-position: 50% -85px !important;\n }\n .line-type.dash .paper-input-container input {\n background-position: 50% -145px !important;\n }\n .line-type.dash-dot .paper-input-container input {\n background-position: 50% -185px !important;\n }\n .line-type.long-dash .paper-input-container input {\n background-position: 50% -245px !important;\n }\n .line-type.long-dash-dot .paper-input-container input {\n background-position: 50% -285px !important;\n }\n .line-type.long-dash-dot-dot .paper-input-container input {\n background-position: 50% -345px !important;\n }\n\n .arrow-type paper-menu {\n overflow: hidden;\n max-width: 140px;\n }\n .arrow-type paper-item {\n background: var(--url-icon-properties-arrow-type) 50% 0 no-repeat;\n min-height: 30px;\n padding: 3px 7px;\n width: 30px;\n float: left;\n }\n .arrow-type paper-item.begin-no {\n background-position: 50% 16px;\n }\n .arrow-type paper-item.begin-arrow {\n background-position: 50% -39px;\n }\n .arrow-type paper-item.begin-open-arrow {\n background-position: 50% -89px;\n }\n .arrow-type paper-item.begin-stealth-arrow {\n background-position: 50% -139px;\n }\n .arrow-type paper-item.begin-diamond-arrow {\n background-position: 50% -190px;\n }\n .arrow-type paper-item.begin-oval-arrow {\n background-position: 50% -238px;\n }\n .arrow-type paper-item.begin-size1 {\n background-position: 50% -286px;\n }\n .arrow-type paper-item.begin-size2 {\n background-position: 50% -336px;\n }\n .arrow-type paper-item.begin-size3 {\n background-position: 50% -386px;\n }\n .arrow-type paper-item.begin-size4 {\n background-position: 50% -436px;\n }\n .arrow-type paper-item.begin-size5 {\n background-position: 50% -486px;\n }\n .arrow-type paper-item.begin-size6 {\n background-position: 50% -536px;\n }\n .arrow-type paper-item.begin-size7 {\n background-position: 50% -589px;\n }\n .arrow-type paper-item.begin-size8 {\n background-position: 50% -639px;\n }\n .arrow-type paper-item.begin-size9 {\n background-position: 50% -689px;\n }\n .arrow-type paper-item.end-no {\n background-position: 50% 16px;\n }\n .arrow-type paper-item.end-arrow {\n background-position: 50% -739px;\n }\n .arrow-type paper-item.end-open-arrow {\n background-position: 50% -789px;\n }\n .arrow-type paper-item.end-stealth-arrow {\n background-position: 50% -839px;\n }\n .arrow-type paper-item.end-diamond-arrow {\n background-position: 50% -890px;\n }\n .arrow-type paper-item.end-oval-arrow {\n background-position: 50% -938px;\n }\n .arrow-type paper-item.end-size1 {\n background-position: 50% -986px;\n }\n .arrow-type paper-item.end-size2 {\n background-position: 50% -1036px;\n }\n .arrow-type paper-item.end-size3 {\n background-position: 50% -1086px;\n }\n .arrow-type paper-item.end-size4 {\n background-position: 50% -1136px;\n }\n .arrow-type paper-item.end-size5 {\n background-position: 50% -1186px;\n }\n .arrow-type paper-item.end-size6 {\n background-position: 50% -1236px;\n }\n .arrow-type paper-item.end-size7 {\n background-position: 50% -1289px;\n }\n .arrow-type paper-item.end-size8 {\n background-position: 50% -1339px;\n }\n .arrow-type paper-item.end-size9 {\n background-position: 50% -1389px;\n }\n\n .arrow-type .paper-input-container input {\n background: var(--url-icon-properties-arrow-type) 110% 0 no-repeat !important;\n }\n .arrow-type.begin-no .paper-input-container input {\n background-position: 110% 5px !important;\n }\n .arrow-type.begin-arrow .paper-input-container input {\n background-position: 110% -50px !important;\n }\n .arrow-type.begin-open-arrow .paper-input-container input {\n background-position: 110% -100px !important;\n }\n .arrow-type.begin-stealth-arrow .paper-input-container input {\n background-position: 110% -150px !important;\n }\n .arrow-type.begin-diamond-arrow .paper-input-container input {\n background-position: 110% -200px !important;\n }\n .arrow-type.begin-oval-arrow .paper-input-container input {\n background-position: 110% -250px !important;\n }\n .arrow-type.begin-size1 .paper-input-container input {\n background-position: 110% -298px !important;\n }\n .arrow-type.begin-size2 .paper-input-container input {\n background-position: 110% -348px !important;\n }\n .arrow-type.begin-size3 .paper-input-container input {\n background-position: 110% -398px !important;\n }\n .arrow-type.begin-size4 .paper-input-container input {\n background-position: 110% -448px !important;\n }\n .arrow-type.begin-size5 .paper-input-container input {\n background-position: 110% -498px !important;\n }\n .arrow-type.begin-size6 .paper-input-container input {\n background-position: 110% -548px !important;\n }\n .arrow-type.begin-size7 .paper-input-container input {\n background-position: 110% -600px !important;\n }\n .arrow-type.begin-size8 .paper-input-container input {\n background-position: 110% -650px !important;\n }\n .arrow-type.begin-size9 .paper-input-container input {\n background-position: 110% -700px !important;\n }\n .arrow-type.end-no .paper-input-container input {\n background-position: 110% 5px !important;\n }\n .arrow-type.end-arrow .paper-input-container input {\n background-position: 110% -750px !important;\n }\n .arrow-type.end-open-arrow .paper-input-container input {\n background-position: 110% -800px !important;\n }\n .arrow-type.end-stealth-arrow .paper-input-container input {\n background-position: 110% -850px !important;\n }\n .arrow-type.end-diamond-arrow .paper-input-container input {\n background-position: 110% -900px !important;\n }\n .arrow-type.end-oval-arrow .paper-input-container input {\n background-position: 110% -950px !important;\n }\n .arrow-type.end-size1 .paper-input-container input {\n background-position: 110% -998px !important;\n }\n .arrow-type.end-size2 .paper-input-container input {\n background-position: 110% -1048px !important;\n }\n .arrow-type.end-size3 .paper-input-container input {\n background-position: 110% -1098px !important;\n }\n .arrow-type.end-size4 .paper-input-container input {\n background-position: 110% -1148px !important;\n }\n .arrow-type.end-size5 .paper-input-container input {\n background-position: 110% -1198px !important;\n }\n .arrow-type.end-size6 .paper-input-container input {\n background-position: 110% -1248px !important;\n }\n .arrow-type.end-size7 .paper-input-container input {\n background-position: 110% -1300px !important;\n }\n .arrow-type.end-size8 .paper-input-container input {\n background-position: 110% -1350px !important;\n }\n .arrow-type.end-size9 .paper-input-container input {\n background-position: 110% -1400px !important;\n }\n `\n ]\n @property({ type: Object }) value: any = {}\n @property({ type: Array }) selected: Component[] = []\n @property({ type: Array }) fonts: any[] = []\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onValueChange.bind(this))\n }\n\n render() {\n var {\n alpha,\n fontFamily,\n fontSize,\n lineHeight,\n fontColor,\n bold,\n italic,\n fillStyle,\n lineWidth,\n strokeStyle,\n lineDash,\n lineCap,\n lineJoin,\n begin,\n beginSize,\n end,\n endSize\n } = this.value\n\n return html`\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/styles/opacity\" msgid=\"label.opacity\">opacity</ox-title-with-help>\n </legend>\n <paper-slider min=\"0\" max=\"1\" step=\"0.1\" value-key=\"alpha\" .value=${alpha || 1} editable> </paper-slider>\n </fieldset>\n\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/styles/text-style\" msgid=\"label.text-style\"\n >text style</ox-title-with-help\n >\n </legend>\n\n <div class=\"property-grid\">\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.font-family\">Font Family</ox-i18n>\n </label>\n\n <ox-font-selector\n value-key=\"fontFamily\"\n .value=${fontFamily}\n class=\"property-full-input\"\n custom-editor\n ></ox-font-selector>\n\n <label class=\"property-half-label icon-only-label font-size\"></label>\n <input type=\"number\" value-key=\"fontSize\" .value=${fontSize} class=\"property-half-input\" />\n\n <label class=\"property-half-label icon-only-label lineHeight\"></label>\n <input type=\"number\" value-key=\"lineHeight\" .value=${lineHeight} class=\"property-half-input\" />\n\n <label class=\"property-half-label icon-only-label color\"></label>\n <ox-input-color value-key=\"fontColor\" .value=${fontColor} class=\"property-half-input\"> </ox-input-color>\n\n <label class=\"property-half-label\"></label>\n <div class=\"property-half-input btn-group\">\n <paper-button toggles value-key=\"bold\" ?active=${bold} class=\"tbold\"> </paper-button>\n <paper-button toggles value-key=\"italic\" ?active=${italic} class=\"titalic\"> </paper-button>\n </div>\n </div>\n </fieldset>\n\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/styles/fill-style\" msgid=\"label.fill-style\"\n >fill style</ox-title-with-help\n >\n </legend>\n\n <ox-input-fill-style value-key=\"fillStyle\" .value=${fillStyle}> </ox-input-fill-style>\n </fieldset>\n\n <fieldset>\n <legend>\n <ox-title-with-help msgid=\"label.line-style\" topic=\"board-modeller/styles/line-style\"></ox-title-with-help>\n </legend>\n\n <div class=\"property-grid\">\n <label class=\"property-half-label icon-only-label linewidth\"></label>\n <input type=\"number\" value-key=\"lineWidth\" .value=${lineWidth} class=\"property-half-input\" />\n\n <label class=\"property-half-label icon-only-label color\"></label>\n <ox-input-color value-key=\"strokeStyle\" .value=${strokeStyle} class=\"property-half-input\"> </ox-input-color>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.line-type\">line type</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input line-type solid\">\n <!-- solid는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"lineDash\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${lineDash}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"solid\" name=\"solid\"></paper-item>\n <paper-item class=\"round-dot\" name=\"round-dot\"></paper-item>\n <paper-item class=\"square-dot\" name=\"square-dot\"></paper-item>\n <paper-item class=\"dash\" name=\"dash\"></paper-item>\n <paper-item class=\"dash-dot\" name=\"dash-dot\"></paper-item>\n <paper-item class=\"long-dash\" name=\"long-dash\"></paper-item>\n <paper-item class=\"long-dash-dot\" name=\"long-dash-dot\"></paper-item>\n <paper-item class=\"long-dash-dot-dot\" name=\"long-dash-dot-dot\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.cap-type\">cap type</ox-i18n>\n </label>\n <select class=\"property-full-input select-content\" value-key=\"lineCap\" .value=${lineCap}>\n <option value=\"butt\"><ox-i18n msgid=\"label.square\">square</ox-i18n></option>\n <option value=\"round\"><ox-i18n msgid=\"label.round\">round</ox-i18n></option>\n </select>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.join-type\">join type</ox-i18n>\n </label>\n <select class=\"property-full-input select-content\" value-key=\"lineJoin\" .value=${lineJoin}>\n <option value=\"miter\"><ox-i18n msgid=\"label.miter\">miter</ox-i18n></option>\n <option value=\"round\"><ox-i18n msgid=\"label.round\">round</ox-i18n></option>\n <option value=\"bevel\"><ox-i18n msgid=\"label.bevel\">bevel</ox-i18n></option>\n </select>\n\n ${this._isLine(this.selected)\n ? html`\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.begin-type\">begin type</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type begin-no\">\n <!-- begin-no는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"begin\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${begin}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"begin-no\" name=\"none\"></paper-item>\n <paper-item class=\"begin-arrow\" name=\"arrow\"></paper-item>\n <paper-item class=\"begin-open-arrow\" name=\"open-arrow\"></paper-item>\n <paper-item class=\"begin-stealth-arrow\" name=\"sharp-arrow\"></paper-item>\n <paper-item class=\"begin-diamond-arrow\" name=\"diamond\"></paper-item>\n <paper-item class=\"begin-oval-arrow\" name=\"oval\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.begin-size\">begin size</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type begin-size1\">\n <!-- begin-size1는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"beginSize\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${beginSize}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"begin-size1\" name=\"size1\"></paper-item>\n <paper-item class=\"begin-size2\" name=\"size2\"></paper-item>\n <paper-item class=\"begin-size3\" name=\"size3\"></paper-item>\n <paper-item class=\"begin-size4\" name=\"size4\"></paper-item>\n <paper-item class=\"begin-size5\" name=\"size5\"></paper-item>\n <paper-item class=\"begin-size6\" name=\"size6\"></paper-item>\n <paper-item class=\"begin-size7\" name=\"size7\"></paper-item>\n <paper-item class=\"begin-size8\" name=\"size8\"></paper-item>\n <paper-item class=\"begin-size9\" name=\"size9\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.end-type\">end type</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type end-no\">\n <!-- end-no는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"end\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${end}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"end-no\" name=\"none\"></paper-item>\n <paper-item class=\"end-arrow\" name=\"arrow\"></paper-item>\n <paper-item class=\"end-open-arrow\" name=\"open-arrow\"></paper-item>\n <paper-item class=\"end-stealth-arrow\" name=\"sharp-arrow\"></paper-item>\n <paper-item class=\"end-diamond-arrow\" name=\"diamond\"></paper-item>\n <paper-item class=\"end-oval-arrow\" name=\"oval\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.end-size\">end size</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type end-size1\">\n <!-- end-size1는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"endSize\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${endSize}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"end-size1\" name=\"size1\"></paper-item>\n <paper-item class=\"end-size2\" name=\"size2\"></paper-item>\n <paper-item class=\"end-size3\" name=\"size3\"></paper-item>\n <paper-item class=\"end-size4\" name=\"size4\"></paper-item>\n <paper-item class=\"end-size5\" name=\"size5\"></paper-item>\n <paper-item class=\"end-size6\" name=\"size6\"></paper-item>\n <paper-item class=\"end-size7\" name=\"size7\"></paper-item>\n <paper-item class=\"end-size8\" name=\"size8\"></paper-item>\n <paper-item class=\"end-size9\" name=\"size9\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n `\n : html``}\n </div>\n </fieldset>\n `\n }\n\n _isLine(selected: Component[]) {\n var isLine = false\n\n for (var i = 0; i < selected.length; i++) {\n var comp = selected[i]\n\n if (!comp.isLine || !comp.isLine()) {\n isLine = false\n return isLine\n }\n\n isLine = true\n }\n\n return isLine\n }\n}\n"]}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/styles/styles.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,kDAAkD,CAAA;AACzD,OAAO,qCAAqC,CAAA;AAC5C,OAAO,kCAAkC,CAAA;AACzC,OAAO,kCAAkC,CAAA;AACzC,OAAO,2CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8SF;CACF,CAAA;AAC2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAgB;AAChB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;gDAA2B;AAC1B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;6CAAkB;AArTxC,cAAc;IADnB,aAAa,CAAC,gBAAgB,CAAC;GAC1B,cAAc,CA4iBnB","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@polymer/paper-dropdown-menu/paper-dropdown-menu'\nimport '@operato/help/ox-title-with-help.js'\nimport '@operato/input/ox-input-color.js'\nimport '@operato/input/ox-input-range.js'\nimport '@operato/app/input/ox-input-fill-style.js'\nimport '@operato/font/ox-font-selector.js'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { AbstractProperty } from '../abstract-property'\nimport { Component } from '@hatiolab/things-scene'\nimport { PropertySharedStyle } from '../property-shared-style'\n\n@customElement('property-style')\nclass PropertyStyles extends AbstractProperty {\n static styles = [\n PropertySharedStyle,\n css`\n ox-input-range {\n width: 100%;\n }\n\n .btn-group {\n height: 24px;\n }\n\n .btn-group paper-button {\n width: 30px;\n height: 24px;\n min-width: initial;\n margin: 0 4px 0 0;\n padding: 0;\n border-radius: 0;\n display: inline-block;\n border-bottom: 2px solid #fff;\n\n background: var(--url-icon-properties) no-repeat;\n background-size: 70%;\n }\n\n .btn-group paper-button.tbold {\n background-position: 50% -170px;\n }\n\n .btn-group paper-button.titalic {\n background-position: 50% -205px;\n }\n\n .btn-group paper-button.tunderline {\n background-position: 50% -240px;\n }\n\n .btn-group paper-button.tstrikethrough {\n background-position: 50% -415px;\n }\n\n .btn-group paper-button[active] {\n border-color: #f2471c;\n }\n\n .line-type paper-listbox {\n overflow: hidden;\n max-width: 100px;\n }\n .line-type paper-item {\n background: var(--url-icon-properties-line-type) 50% 0 no-repeat;\n min-height: 25px;\n padding: 3px 9px;\n width: 80px;\n }\n\n .line-type paper-item.solid {\n background-position: 50% 10px;\n }\n .line-type paper-item.round-dot {\n background-position: 50% -40px;\n }\n .line-type paper-item.square-dot {\n background-position: 50% -90px;\n }\n .line-type paper-item.dash {\n background-position: 50% -140px;\n }\n .line-type paper-item.dash-dot {\n background-position: 50% -190px;\n }\n .line-type paper-item.long-dash {\n background-position: 50% -240px;\n }\n .line-type paper-item.long-dash-dot {\n background-position: 50% -290px;\n }\n .line-type paper-item.long-dash-dot-dot {\n background-position: 50% -340px;\n }\n\n .line-type .paper-input-container input {\n background: var(--url-icon-properties-line-type) 50% 0 no-repeat !important;\n }\n .line-type.solid .paper-input-container input {\n background-position: 50% 5px !important;\n }\n .line-type.round-dot .paper-input-container input {\n background-position: 50% -45px !important;\n }\n .line-type.square-dot .paper-input-container input {\n background-position: 50% -85px !important;\n }\n .line-type.dash .paper-input-container input {\n background-position: 50% -145px !important;\n }\n .line-type.dash-dot .paper-input-container input {\n background-position: 50% -185px !important;\n }\n .line-type.long-dash .paper-input-container input {\n background-position: 50% -245px !important;\n }\n .line-type.long-dash-dot .paper-input-container input {\n background-position: 50% -285px !important;\n }\n .line-type.long-dash-dot-dot .paper-input-container input {\n background-position: 50% -345px !important;\n }\n\n .arrow-type paper-menu {\n overflow: hidden;\n max-width: 140px;\n }\n .arrow-type paper-item {\n background: var(--url-icon-properties-arrow-type) 50% 0 no-repeat;\n min-height: 30px;\n padding: 3px 7px;\n width: 30px;\n float: left;\n }\n .arrow-type paper-item.begin-no {\n background-position: 50% 16px;\n }\n .arrow-type paper-item.begin-arrow {\n background-position: 50% -39px;\n }\n .arrow-type paper-item.begin-open-arrow {\n background-position: 50% -89px;\n }\n .arrow-type paper-item.begin-stealth-arrow {\n background-position: 50% -139px;\n }\n .arrow-type paper-item.begin-diamond-arrow {\n background-position: 50% -190px;\n }\n .arrow-type paper-item.begin-oval-arrow {\n background-position: 50% -238px;\n }\n .arrow-type paper-item.begin-size1 {\n background-position: 50% -286px;\n }\n .arrow-type paper-item.begin-size2 {\n background-position: 50% -336px;\n }\n .arrow-type paper-item.begin-size3 {\n background-position: 50% -386px;\n }\n .arrow-type paper-item.begin-size4 {\n background-position: 50% -436px;\n }\n .arrow-type paper-item.begin-size5 {\n background-position: 50% -486px;\n }\n .arrow-type paper-item.begin-size6 {\n background-position: 50% -536px;\n }\n .arrow-type paper-item.begin-size7 {\n background-position: 50% -589px;\n }\n .arrow-type paper-item.begin-size8 {\n background-position: 50% -639px;\n }\n .arrow-type paper-item.begin-size9 {\n background-position: 50% -689px;\n }\n .arrow-type paper-item.end-no {\n background-position: 50% 16px;\n }\n .arrow-type paper-item.end-arrow {\n background-position: 50% -739px;\n }\n .arrow-type paper-item.end-open-arrow {\n background-position: 50% -789px;\n }\n .arrow-type paper-item.end-stealth-arrow {\n background-position: 50% -839px;\n }\n .arrow-type paper-item.end-diamond-arrow {\n background-position: 50% -890px;\n }\n .arrow-type paper-item.end-oval-arrow {\n background-position: 50% -938px;\n }\n .arrow-type paper-item.end-size1 {\n background-position: 50% -986px;\n }\n .arrow-type paper-item.end-size2 {\n background-position: 50% -1036px;\n }\n .arrow-type paper-item.end-size3 {\n background-position: 50% -1086px;\n }\n .arrow-type paper-item.end-size4 {\n background-position: 50% -1136px;\n }\n .arrow-type paper-item.end-size5 {\n background-position: 50% -1186px;\n }\n .arrow-type paper-item.end-size6 {\n background-position: 50% -1236px;\n }\n .arrow-type paper-item.end-size7 {\n background-position: 50% -1289px;\n }\n .arrow-type paper-item.end-size8 {\n background-position: 50% -1339px;\n }\n .arrow-type paper-item.end-size9 {\n background-position: 50% -1389px;\n }\n\n .arrow-type .paper-input-container input {\n background: var(--url-icon-properties-arrow-type) 110% 0 no-repeat !important;\n }\n .arrow-type.begin-no .paper-input-container input {\n background-position: 110% 5px !important;\n }\n .arrow-type.begin-arrow .paper-input-container input {\n background-position: 110% -50px !important;\n }\n .arrow-type.begin-open-arrow .paper-input-container input {\n background-position: 110% -100px !important;\n }\n .arrow-type.begin-stealth-arrow .paper-input-container input {\n background-position: 110% -150px !important;\n }\n .arrow-type.begin-diamond-arrow .paper-input-container input {\n background-position: 110% -200px !important;\n }\n .arrow-type.begin-oval-arrow .paper-input-container input {\n background-position: 110% -250px !important;\n }\n .arrow-type.begin-size1 .paper-input-container input {\n background-position: 110% -298px !important;\n }\n .arrow-type.begin-size2 .paper-input-container input {\n background-position: 110% -348px !important;\n }\n .arrow-type.begin-size3 .paper-input-container input {\n background-position: 110% -398px !important;\n }\n .arrow-type.begin-size4 .paper-input-container input {\n background-position: 110% -448px !important;\n }\n .arrow-type.begin-size5 .paper-input-container input {\n background-position: 110% -498px !important;\n }\n .arrow-type.begin-size6 .paper-input-container input {\n background-position: 110% -548px !important;\n }\n .arrow-type.begin-size7 .paper-input-container input {\n background-position: 110% -600px !important;\n }\n .arrow-type.begin-size8 .paper-input-container input {\n background-position: 110% -650px !important;\n }\n .arrow-type.begin-size9 .paper-input-container input {\n background-position: 110% -700px !important;\n }\n .arrow-type.end-no .paper-input-container input {\n background-position: 110% 5px !important;\n }\n .arrow-type.end-arrow .paper-input-container input {\n background-position: 110% -750px !important;\n }\n .arrow-type.end-open-arrow .paper-input-container input {\n background-position: 110% -800px !important;\n }\n .arrow-type.end-stealth-arrow .paper-input-container input {\n background-position: 110% -850px !important;\n }\n .arrow-type.end-diamond-arrow .paper-input-container input {\n background-position: 110% -900px !important;\n }\n .arrow-type.end-oval-arrow .paper-input-container input {\n background-position: 110% -950px !important;\n }\n .arrow-type.end-size1 .paper-input-container input {\n background-position: 110% -998px !important;\n }\n .arrow-type.end-size2 .paper-input-container input {\n background-position: 110% -1048px !important;\n }\n .arrow-type.end-size3 .paper-input-container input {\n background-position: 110% -1098px !important;\n }\n .arrow-type.end-size4 .paper-input-container input {\n background-position: 110% -1148px !important;\n }\n .arrow-type.end-size5 .paper-input-container input {\n background-position: 110% -1198px !important;\n }\n .arrow-type.end-size6 .paper-input-container input {\n background-position: 110% -1248px !important;\n }\n .arrow-type.end-size7 .paper-input-container input {\n background-position: 110% -1300px !important;\n }\n .arrow-type.end-size8 .paper-input-container input {\n background-position: 110% -1350px !important;\n }\n .arrow-type.end-size9 .paper-input-container input {\n background-position: 110% -1400px !important;\n }\n `\n ]\n @property({ type: Object }) value: any = {}\n @property({ type: Array }) selected: Component[] = []\n @property({ type: Array }) fonts: any[] = []\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onValueChange.bind(this))\n }\n\n render() {\n var {\n alpha = 1,\n fontFamily,\n fontSize,\n lineHeight,\n fontColor,\n bold,\n italic,\n fillStyle,\n lineWidth,\n strokeStyle,\n lineDash,\n lineCap,\n lineJoin,\n begin,\n beginSize,\n end,\n endSize\n } = this.value || {}\n\n return html`\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/styles/opacity\" msgid=\"label.opacity\">opacity</ox-title-with-help>\n </legend>\n <ox-input-range min=\"0\" max=\"1\" step=\"0.1\" value-key=\"alpha\" .value=${alpha} editable> </ox-input-range>\n </fieldset>\n\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/styles/text-style\" msgid=\"label.text-style\"\n >text style</ox-title-with-help\n >\n </legend>\n\n <div class=\"property-grid\">\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.font-family\">Font Family</ox-i18n>\n </label>\n\n <ox-font-selector\n value-key=\"fontFamily\"\n .value=${fontFamily}\n class=\"property-full-input\"\n custom-editor\n ></ox-font-selector>\n\n <label class=\"property-half-label icon-only-label font-size\"></label>\n <input type=\"number\" value-key=\"fontSize\" .value=${fontSize} class=\"property-half-input\" />\n\n <label class=\"property-half-label icon-only-label lineHeight\"></label>\n <input type=\"number\" value-key=\"lineHeight\" .value=${lineHeight} class=\"property-half-input\" />\n\n <label class=\"property-half-label icon-only-label color\"></label>\n <ox-input-color value-key=\"fontColor\" .value=${fontColor} class=\"property-half-input\"> </ox-input-color>\n\n <label class=\"property-half-label\"></label>\n <div class=\"property-half-input btn-group\">\n <paper-button toggles value-key=\"bold\" ?active=${bold} class=\"tbold\"> </paper-button>\n <paper-button toggles value-key=\"italic\" ?active=${italic} class=\"titalic\"> </paper-button>\n </div>\n </div>\n </fieldset>\n\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/styles/fill-style\" msgid=\"label.fill-style\"\n >fill style</ox-title-with-help\n >\n </legend>\n\n <ox-input-fill-style value-key=\"fillStyle\" .value=${fillStyle}> </ox-input-fill-style>\n </fieldset>\n\n <fieldset>\n <legend>\n <ox-title-with-help msgid=\"label.line-style\" topic=\"board-modeller/styles/line-style\"></ox-title-with-help>\n </legend>\n\n <div class=\"property-grid\">\n <label class=\"property-half-label icon-only-label linewidth\"></label>\n <input type=\"number\" value-key=\"lineWidth\" .value=${lineWidth} class=\"property-half-input\" />\n\n <label class=\"property-half-label icon-only-label color\"></label>\n <ox-input-color value-key=\"strokeStyle\" .value=${strokeStyle} class=\"property-half-input\"> </ox-input-color>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.line-type\">line type</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input line-type solid\">\n <!-- solid는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"lineDash\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${lineDash}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"solid\" name=\"solid\"></paper-item>\n <paper-item class=\"round-dot\" name=\"round-dot\"></paper-item>\n <paper-item class=\"square-dot\" name=\"square-dot\"></paper-item>\n <paper-item class=\"dash\" name=\"dash\"></paper-item>\n <paper-item class=\"dash-dot\" name=\"dash-dot\"></paper-item>\n <paper-item class=\"long-dash\" name=\"long-dash\"></paper-item>\n <paper-item class=\"long-dash-dot\" name=\"long-dash-dot\"></paper-item>\n <paper-item class=\"long-dash-dot-dot\" name=\"long-dash-dot-dot\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.cap-type\">cap type</ox-i18n>\n </label>\n <select class=\"property-full-input select-content\" value-key=\"lineCap\" .value=${lineCap}>\n <option value=\"butt\"><ox-i18n msgid=\"label.square\">square</ox-i18n></option>\n <option value=\"round\"><ox-i18n msgid=\"label.round\">round</ox-i18n></option>\n </select>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.join-type\">join type</ox-i18n>\n </label>\n <select class=\"property-full-input select-content\" value-key=\"lineJoin\" .value=${lineJoin}>\n <option value=\"miter\"><ox-i18n msgid=\"label.miter\">miter</ox-i18n></option>\n <option value=\"round\"><ox-i18n msgid=\"label.round\">round</ox-i18n></option>\n <option value=\"bevel\"><ox-i18n msgid=\"label.bevel\">bevel</ox-i18n></option>\n </select>\n\n ${this._isLine(this.selected)\n ? html`\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.begin-type\">begin type</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type begin-no\">\n <!-- begin-no는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"begin\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${begin}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"begin-no\" name=\"none\"></paper-item>\n <paper-item class=\"begin-arrow\" name=\"arrow\"></paper-item>\n <paper-item class=\"begin-open-arrow\" name=\"open-arrow\"></paper-item>\n <paper-item class=\"begin-stealth-arrow\" name=\"sharp-arrow\"></paper-item>\n <paper-item class=\"begin-diamond-arrow\" name=\"diamond\"></paper-item>\n <paper-item class=\"begin-oval-arrow\" name=\"oval\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.begin-size\">begin size</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type begin-size1\">\n <!-- begin-size1는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"beginSize\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${beginSize}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"begin-size1\" name=\"size1\"></paper-item>\n <paper-item class=\"begin-size2\" name=\"size2\"></paper-item>\n <paper-item class=\"begin-size3\" name=\"size3\"></paper-item>\n <paper-item class=\"begin-size4\" name=\"size4\"></paper-item>\n <paper-item class=\"begin-size5\" name=\"size5\"></paper-item>\n <paper-item class=\"begin-size6\" name=\"size6\"></paper-item>\n <paper-item class=\"begin-size7\" name=\"size7\"></paper-item>\n <paper-item class=\"begin-size8\" name=\"size8\"></paper-item>\n <paper-item class=\"begin-size9\" name=\"size9\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.end-type\">end type</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type end-no\">\n <!-- end-no는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"end\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${end}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"end-no\" name=\"none\"></paper-item>\n <paper-item class=\"end-arrow\" name=\"arrow\"></paper-item>\n <paper-item class=\"end-open-arrow\" name=\"open-arrow\"></paper-item>\n <paper-item class=\"end-stealth-arrow\" name=\"sharp-arrow\"></paper-item>\n <paper-item class=\"end-diamond-arrow\" name=\"diamond\"></paper-item>\n <paper-item class=\"end-oval-arrow\" name=\"oval\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.end-size\">end size</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type end-size1\">\n <!-- end-size1는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"endSize\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${endSize}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"end-size1\" name=\"size1\"></paper-item>\n <paper-item class=\"end-size2\" name=\"size2\"></paper-item>\n <paper-item class=\"end-size3\" name=\"size3\"></paper-item>\n <paper-item class=\"end-size4\" name=\"size4\"></paper-item>\n <paper-item class=\"end-size5\" name=\"size5\"></paper-item>\n <paper-item class=\"end-size6\" name=\"size6\"></paper-item>\n <paper-item class=\"end-size7\" name=\"size7\"></paper-item>\n <paper-item class=\"end-size8\" name=\"size8\"></paper-item>\n <paper-item class=\"end-size9\" name=\"size9\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n `\n : html``}\n </div>\n </fieldset>\n `\n }\n\n _isLine(selected: Component[]) {\n var isLine = false\n\n for (var i = 0; i < selected.length; i++) {\n var comp = selected[i]\n\n if (!comp.isLine || !comp.isLine()) {\n isLine = false\n return isLine\n }\n\n isLine = true\n }\n\n return isLine\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { LitElement, css, html } from 'lit';
2
+ import { css, html, LitElement } from 'lit';
3
3
  import { customElement, property } from 'lit/decorators.js';
4
4
  let OxScenePlayer = class OxScenePlayer extends LitElement {
5
5
  constructor() {
@@ -45,7 +45,7 @@ let OxScenePlayer = class OxScenePlayer extends LitElement {
45
45
  _releaseRef() {
46
46
  if (this.scene) {
47
47
  this.scene.target = null;
48
- this.scene.release();
48
+ this.scene.release && this.scene.release();
49
49
  delete this.scene;
50
50
  }
51
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ox-scene-player.js","sourceRoot":"","sources":["../../../../src/modeller/scene-viewer/ox-scene-player.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAK3D,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAe8B,YAAO,GAAW,EAAE,CAAA;QAChD;;;;;;;;;;;WAWG;QACyB,QAAG,GAA8D,OAAO,CAAA;IAqEtG,CAAC;IAhEC,MAAM;QACJ,OAAO,IAAI,CAAA,yBAAyB,CAAA;IACtC,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAA;QAEzB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE;YACrC,qBAAqB,CAAC,GAAG,EAAE;gBACzB,IAAI,IAAI,CAAC,KAAK,EAAE;oBACd,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAA;oBAEnB,IAAI,IAAI,CAAC,WAAW,EAAE;wBACpB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;qBACzB;iBACF;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,oBAAoB;QAClB,KAAK,CAAC,oBAAoB,EAAE,CAAA;QAE5B,IAAI,CAAC,WAAW,EAAE,CAAA;IACpB,CAAC;IAED,OAAO,CAAC,MAA4B;QAClC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,IAA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Aa;IADlB,aAAa,CAAC,qBAAqB,CAAC;GAC/B,aAAa,CAiGlB","sourcesContent":["import { LitElement, PropertyValues, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { Scene } from '@hatiolab/things-scene'\n\n@customElement('things-scene-player')\nclass OxScenePlayer extends LitElement {\n static styles = [\n css`\n :host {\n display: block;\n width: 100%;\n }\n\n #root {\n width: 100%;\n height: 100%;\n }\n `\n ]\n\n @property({ type: String }) sceneId: string = ''\n /*\n * 캔바스에 모델을 어떻게 적절하게 보여줄 것인지를 설정한다.\n *\n * @none 가로, 세로 스케일을 1로 고정하고, {0, 0}좌표로 translate시킨다.\n * @both 캔바스에 모델을 꼭 채우도록 가로, 세로 스케일을 조정하고, {0, 0}좌표로 translate시킨다.\n * @width 캔바스의 폭에 모델의 폭을 일치하도록 가로, 세로 스케일을 동일하게 조정하고, {0, 0}좌표로 translate시킨다.\n * @height 캔바스의 높이에 모델의 높이를 일치하도록 가로, 세로 스케일을 동일하게 조정하고, {0, 0}좌표로 translate시킨다.\n * @center 가로, 세로 스케일을 1로 고정하고 모델이 화면의 중앙에 위치하도록 translate시킨다.\n * @ratio 모델의 모든 부분이 캔바스에 최대 크기로 표현될 수 있도록 가로, 세로 동일한 스케일로 조정하고, {0, 0}좌표로 translate시킨다.\n *\n * @todo things-real 에서는 enumeration type 이며, FitMode.RATIO | FitMode.BOTH 중 하나로 정의한다.\n */\n @property({ type: String }) fit: 'none' | 'both' | 'width' | 'height' | 'center' | 'ratio' = 'ratio'\n @property({ type: Object }) provider: any\n\n private scene?: Scene\n\n render() {\n return html` <div id=\"root\"></div> `\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n window.addEventListener('resize', () => {\n requestAnimationFrame(() => {\n if (this.scene) {\n this.scene.resize()\n\n if (this.offsetWidth) {\n this.scene.fit(this.fit)\n }\n }\n })\n })\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this._releaseRef()\n }\n\n updated(change: PropertyValues<this>) {\n change.has('sceneId') && this._onSceneIdChanged()\n }\n\n _releaseRef() {\n if (this.scene) {\n this.scene.target = null\n this.scene.release()\n delete this.scene\n }\n }\n\n _onSceneIdChanged() {\n if (!this.provider) return\n\n this._releaseRef()\n\n if (!this.sceneId) return\n\n this.provider.get(this.sceneId, true).then(\n (scene: Scene) => {\n this.scene = scene\n\n if (!this.scene) {\n return\n }\n\n this.scene.target = this.renderRoot.querySelector('#root')\n\n /* 이 컴포넌트의 폭이 값을 가지고 있으면 - 화면상에 자리를 잡고 보여지고 있음을 의미한다.\n * 이 때는 정상적으로 그려주고,\n * 그렇지 않으면, 다음 Resize Handling시에 처리하도록 한다.\n */\n if (this.scene.target?.offsetWidth) this.scene.fit(this.fit)\n },\n (e: any) => {}\n )\n }\n}\n"]}
1
+ {"version":3,"file":"ox-scene-player.js","sourceRoot":"","sources":["../../../../src/modeller/scene-viewer/ox-scene-player.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAK3D,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAe8B,YAAO,GAAW,EAAE,CAAA;QAChD;;;;;;;;;;;WAWG;QACyB,QAAG,GAA8D,OAAO,CAAA;IAqEtG,CAAC;IAhEC,MAAM;QACJ,OAAO,IAAI,CAAA,yBAAyB,CAAA;IACtC,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAA;QAEzB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE;YACrC,qBAAqB,CAAC,GAAG,EAAE;gBACzB,IAAI,IAAI,CAAC,KAAK,EAAE;oBACd,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAA;oBAEnB,IAAI,IAAI,CAAC,WAAW,EAAE;wBACpB,IAAI,CAAC,KA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AE,GAAE,CAAC,CACf,CAAA;IACH,CAAC;CACF,CAAA;AAhGQ,oBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;KAUF;CACF,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAqB;AAapB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAyE;AACxE;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAc;AA7BrC,aAAa;IADlB,aAAa,CAAC,qBAAqB,CAAC;GAC/B,aAAa,CAiGlB","sourcesContent":["import { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { Scene } from '@hatiolab/things-scene'\n\n@customElement('things-scene-player')\nclass OxScenePlayer extends LitElement {\n static styles = [\n css`\n :host {\n display: block;\n width: 100%;\n }\n\n #root {\n width: 100%;\n height: 100%;\n }\n `\n ]\n\n @property({ type: String }) sceneId: string = ''\n /*\n * 캔바스에 모델을 어떻게 적절하게 보여줄 것인지를 설정한다.\n *\n * @none 가로, 세로 스케일을 1로 고정하고, {0, 0}좌표로 translate시킨다.\n * @both 캔바스에 모델을 꼭 채우도록 가로, 세로 스케일을 조정하고, {0, 0}좌표로 translate시킨다.\n * @width 캔바스의 폭에 모델의 폭을 일치하도록 가로, 세로 스케일을 동일하게 조정하고, {0, 0}좌표로 translate시킨다.\n * @height 캔바스의 높이에 모델의 높이를 일치하도록 가로, 세로 스케일을 동일하게 조정하고, {0, 0}좌표로 translate시킨다.\n * @center 가로, 세로 스케일을 1로 고정하고 모델이 화면의 중앙에 위치하도록 translate시킨다.\n * @ratio 모델의 모든 부분이 캔바스에 최대 크기로 표현될 수 있도록 가로, 세로 동일한 스케일로 조정하고, {0, 0}좌표로 translate시킨다.\n *\n * @todo things-real 에서는 enumeration type 이며, FitMode.RATIO | FitMode.BOTH 중 하나로 정의한다.\n */\n @property({ type: String }) fit: 'none' | 'both' | 'width' | 'height' | 'center' | 'ratio' = 'ratio'\n @property({ type: Object }) provider: any\n\n private scene?: Scene\n\n render() {\n return html` <div id=\"root\"></div> `\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n window.addEventListener('resize', () => {\n requestAnimationFrame(() => {\n if (this.scene) {\n this.scene.resize()\n\n if (this.offsetWidth) {\n this.scene.fit(this.fit)\n }\n }\n })\n })\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this._releaseRef()\n }\n\n updated(change: PropertyValues<this>) {\n change.has('sceneId') && this._onSceneIdChanged()\n }\n\n _releaseRef() {\n if (this.scene) {\n this.scene.target = null\n this.scene.release && this.scene.release()\n delete this.scene\n }\n }\n\n _onSceneIdChanged() {\n if (!this.provider) return\n\n this._releaseRef()\n\n if (!this.sceneId) return\n\n this.provider.get(this.sceneId, true).then(\n (scene: Scene) => {\n this.scene = scene\n\n if (!this.scene) {\n return\n }\n\n this.scene.target = this.renderRoot.querySelector('#root')\n\n /* 이 컴포넌트의 폭이 값을 가지고 있으면 - 화면상에 자리를 잡고 보여지고 있음을 의미한다.\n * 이 때는 정상적으로 그려주고,\n * 그렇지 않으면, 다음 Resize Handling시에 처리하도록 한다.\n */\n if (this.scene.target?.offsetWidth) this.scene.fit(this.fit)\n },\n (e: any) => {}\n )\n }\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  import './confidential-overlay';
2
2
  import './ox-scene-layer';
3
3
  import './ox-scene-handler';
4
- import { Component, FITMODE, Model, Properties, SCENE_MODE, Scene } from '@hatiolab/things-scene';
5
4
  import { LitElement, PropertyValues } from 'lit';
5
+ import { Component, FITMODE, Model, Properties, Scene, SCENE_MODE } from '@hatiolab/things-scene';
6
6
  export default class OxSceneViewer extends LitElement {
7
7
  static styles: import("lit").CSSResult;
8
8
  scene: Scene | null;
@@ -2,9 +2,9 @@ import { __decorate } from "tslib";
2
2
  import './confidential-overlay';
3
3
  import './ox-scene-layer';
4
4
  import './ox-scene-handler';
5
- import { SCENE_MODE, create as createScene } from '@hatiolab/things-scene';
6
- import { LitElement, css, html } from 'lit';
5
+ import { css, html, LitElement } from 'lit';
7
6
  import { customElement, property } from 'lit/decorators.js';
7
+ import { create as createScene, SCENE_MODE } from '@hatiolab/things-scene';
8
8
  let OxSceneViewer = class OxSceneViewer extends LitElement {
9
9
  constructor() {
10
10
  super(...arguments);
@@ -84,7 +84,7 @@ let OxSceneViewer = class OxSceneViewer extends LitElement {
84
84
  this.scene.off('selected', this._onSelectedChanged, this);
85
85
  this.scene.off('mode', this._onSceneModeChanged, this);
86
86
  if (this.provider) {
87
- this.scene.release();
87
+ this.scene.release && this.scene.release();
88
88
  }
89
89
  else {
90
90
  this.scene.dispose();
@@ -1 +1 @@
1
- {"version":3,"file":"ox-scene-viewer.js","sourceRoot":"","sources":["../../../../src/modeller/scene-viewer/ox-scene-viewer.ts"],"names":[],"mappings":";AAAA,OAAO,wBAAwB,CAAA;AAC/B,OAAO,kBAAkB,CAAA;AACzB,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAyC,UAAU,EAAS,MAAM,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACxH,OAAO,EAAE,UAAU,EAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAK3D,IAAqB,aAAa,GAAlC,MAAqB,aAAc,SAAQ,UAAU;IAArD;;QAO8B,UAAK,GAAiB,IAAI,CAAA;QAEtD,8EAA8E;QAClD,SAAI,GAAe,UAAU,CAAC,IAAI,CAAA;QAClC,eAAU,GAAW,IAAI,CAAA;QACzB,cAAS,GAAe,EAAE,CAAA;QAEtD;;;;;;;;;WASG;QACyB,QAAG,GAAY,MAAM,CAAA;QACtB,aAAQ,GAAgB,EAAE,CAAA;QACxB,wBAAmB,GAAY,KAAK,CAAA;QACrC,YAAO,GAAW,EAAE,CAAA;QAEpB,SAAI,GAAW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AC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAA2B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAU;AAWT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAsB;AACtB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAA2B;AACxB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0DAAqC;AACrC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAqB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAwB;AACtB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sDAAgC;AAC/B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDAA+B;AA/BxC,aAAa;IADjC,aAAa,CAAC,iBAAiB,CAAC;GACZ,aAAa,CA8OjC;eA9OoB,aAAa","sourcesContent":["import './confidential-overlay'\nimport './ox-scene-layer'\nimport './ox-scene-handler'\n\nimport { Component, FITMODE, Model, Properties, SCENE_MODE, Scene, create as createScene } from '@hatiolab/things-scene'\nimport { LitElement, PropertyValues, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport OxSceneLayer from './ox-scene-layer'\n\n@customElement('ox-scene-viewer')\nexport default class OxSceneViewer extends LitElement {\n static styles = css`\n :host {\n outline: none;\n }\n `\n\n @property({ type: Object }) scene: Scene | null = null\n @property({ type: Object }) model?: Model\n /* Scene Mode - mode 0 : view mode, mode 1 : edit mode, mode 2 : shift mode */\n @property({ type: Number }) mode: SCENE_MODE = SCENE_MODE.VIEW\n @property({ type: Number }) screenSize: number = 13.3\n @property({ type: Object }) variables: Properties = {}\n @property({ type: Object }) data: any\n /*\n * 캔바스에 모델을 어떻게 적절하게 보여줄 것인지를 설정한다.\n *\n * @none 가로, 세로 스케일을 1로 고정하고, {0, 0}좌표로 translate시킨다.\n * @both 캔바스에 모델을 꼭 채우도록 가로, 세로 스케일을 조정하고, {0, 0}좌표로 translate시킨다.\n * @width 캔바스의 폭에 모델의 폭을 일치하도록 가로, 세로 스케일을 동일하게 조정하고, {0, 0}좌표로 translate시킨다.\n * @height 캔바스의 높이에 모델의 높이를 일치하도록 가로, 세로 스케일을 동일하게 조정하고, {0, 0}좌표로 translate시킨다.\n * @center 가로, 세로 스케일을 1로 고정하고 모델이 화면의 중앙에 위치하도록 translate시킨다.\n * @ratio 모델의 모든 부분이 캔바스에 최대 크기로 표현될 수 있도록 가로, 세로 동일한 스케일로 조정하고, {0, 0}좌표로 translate시킨다.\n */\n @property({ type: String }) fit: FITMODE = 'none'\n @property({ type: Array }) selected: Component[] = []\n @property({ type: Boolean }) disposeWhenDetached: boolean = false\n @property({ type: String }) baseUrl: string = ''\n @property({ type: Object }) provider: any\n @property({ type: String }) name: string = 'noname'\n @property({ type: Boolean }) enableInspector: boolean = true\n @property({ type: Boolean }) showInspector: boolean = false\n\n private lastOffsetWidth?: number\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n if (this.scene && this.disposeWhenDetached) {\n this._disposeScene()\n }\n }\n\n render() {\n return html` <slot></slot> `\n }\n\n updated(change: PropertyValues<this>) {\n change.has('model') && this._onModelChanged(this.model)\n change.has('mode') && this._onModeChanged(this.mode)\n change.has('screenSize') && this._onDisplayChanged(this.screenSize)\n change.has('data') && this._onDataChanged(this.data)\n change.has('baseUrl') && this._onBaseUrlChanged(this.baseUrl)\n }\n\n _setScene(scene: Scene | null) {\n this.scene = scene\n this.dispatchEvent(\n new CustomEvent('scene-changed', {\n bubbles: true,\n composed: true,\n detail: { value: scene }\n })\n )\n }\n\n _setMode(mode: SCENE_MODE) {\n this.mode = mode\n this.dispatchEvent(\n new CustomEvent('mode-changed', {\n bubbles: true,\n composed: true,\n detail: { value: mode }\n })\n )\n }\n\n _setVariables(variables: Properties) {\n this.variables = variables\n this.dispatchEvent(\n new CustomEvent('variables-changed', {\n bubbles: true,\n composed: true,\n detail: { value: variables }\n })\n )\n }\n\n _setSelected(selected: Component[]) {\n this.selected = selected\n this.dispatchEvent(\n new CustomEvent('selected-changed', {\n bubbles: true,\n composed: true,\n detail: { value: selected }\n })\n )\n }\n\n _disposeScene() {\n if (this.scene) {\n this.scene.off('selected', this._onSelectedChanged, this)\n this.scene.off('mode', this._onSceneModeChanged, this)\n\n if (this.provider) {\n this.scene.release()\n } else {\n this.scene.dispose()\n }\n\n this._setScene(null)\n this._setSelected([])\n }\n }\n\n resize(force: boolean) {\n if (typeof this.scene == 'object') {\n if (force || this.fit === 'both' || Math.abs(this.offsetWidth - (this.lastOffsetWidth || 0)) >= 1) {\n requestAnimationFrame(() => {\n if (this.scene) {\n this.scene.resize()\n this.scene.fit(this.fit)\n }\n })\n }\n\n this.lastOffsetWidth = this.offsetWidth\n }\n }\n\n _onModelChanged(model?: Model) {\n this._disposeScene()\n\n if (!model) {\n return\n }\n\n const layers = Array.from(this.querySelectorAll('ox-scene-layer')).map(layer => (layer as OxSceneLayer).getModel())\n\n const handlers = Array.from(this.querySelectorAll('ox-scene-handler')).map(handler => handler.getAttribute('type'))\n\n this._setScene(\n createScene({\n target: this,\n model: JSON.parse(JSON.stringify(model)),\n layers,\n handlers,\n mode: this.mode,\n refProvider: this.provider\n })\n )\n\n if (this.provider) {\n this.provider.add(this.name, this.scene)\n }\n\n this.scene!.screen = this.screenSize\n\n /* 이 컴포넌트의 폭이 값을 가지고 있으면 - 화면상에 자리를 잡고 보여지고 있음을 의미한다.\n * 이 때는 정상적으로 그려주고,\n * 그렇지 않으면, 다음 Resize Handling시에 처리하도록 한다.\n */\n this.resize(true)\n\n this._setVariables(model.variables || this.scene!.variables)\n\n this.scene!.on('selected', this._onSelectedChanged, this)\n this.scene!.on('mode', this._onSceneModeChanged, this)\n\n this._onModeChanged(this.mode)\n this._onDisplayChanged(this.screenSize)\n this._onBaseUrlChanged(this.baseUrl)\n }\n\n _onDisplayChanged(screenSize: string | number) {\n if (!this.scene) {\n return\n }\n\n if (screenSize) {\n this.scene.screen = parseFloat(String(screenSize))\n }\n }\n\n _onModeChanged(mode: SCENE_MODE) {\n if (!this.scene) {\n return\n }\n this.scene.mode = Number(mode)\n }\n\n _onDataChanged(data: any) {\n if (!this.scene || !data) {\n return\n }\n\n this.scene.data = data\n }\n\n _onSelectedChanged(after: Component[]) {\n /*\n scene 컴포넌트의 속성을 속성 에디터(input box등)에서 변경하다가,\n scene의 다른 컴포넌트를 클릭해서 포커스(선택) 컴포넌트를 변경하게되면,\n 속성 에디터(input box등)의 value change 이벤트의 처리와 충돌(레이스)하게된다.\n \n 기대하는 순서는 먼저 속성 에디터의 value change 이벤트를 처리한 후에,\n selected 이벤트를 처리할 수 있도록 requestAnimationFrame으로 한 프레임을 지연하도록 하였다.\n */\n requestAnimationFrame(() => {\n this._setSelected(after)\n })\n }\n\n _onSceneModeChanged(after: SCENE_MODE) {\n if (!this.scene) {\n return\n }\n\n if (this.mode !== after) {\n this._setMode(after)\n }\n\n if (after === 2) {\n this.style.cursor = 'all-scroll'\n } else if (after === 3) {\n this.style.cursor = 'crosshair'\n } else {\n this.style.cursor = 'default'\n }\n }\n\n _onBaseUrlChanged(after: string) {\n if (!this.scene) {\n return\n }\n\n this.scene.baseUrl = after\n }\n}\n"]}
1
+ {"version":3,"file":"ox-scene-viewer.js","sourceRoot":"","sources":["../../../../src/modeller/scene-viewer/ox-scene-viewer.ts"],"names":[],"mappings":";AAAA,OAAO,wBAAwB,CAAA;AAC/B,OAAO,kBAAkB,CAAA;AACzB,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,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AAa;IADjC,aAAa,CAAC,iBAAiB,CAAC;GACZ,aAAa,CA8OjC;eA9OoB,aAAa","sourcesContent":["import './confidential-overlay'\nimport './ox-scene-layer'\nimport './ox-scene-handler'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { Component, create as createScene, FITMODE, Model, Properties, Scene, SCENE_MODE } from '@hatiolab/things-scene'\n\nimport OxSceneLayer from './ox-scene-layer'\n\n@customElement('ox-scene-viewer')\nexport default class OxSceneViewer extends LitElement {\n static styles = css`\n :host {\n outline: none;\n }\n `\n\n @property({ type: Object }) scene: Scene | null = null\n @property({ type: Object }) model?: Model\n /* Scene Mode - mode 0 : view mode, mode 1 : edit mode, mode 2 : shift mode */\n @property({ type: Number }) mode: SCENE_MODE = SCENE_MODE.VIEW\n @property({ type: Number }) screenSize: number = 13.3\n @property({ type: Object }) variables: Properties = {}\n @property({ type: Object }) data: any\n /*\n * 캔바스에 모델을 어떻게 적절하게 보여줄 것인지를 설정한다.\n *\n * @none 가로, 세로 스케일을 1로 고정하고, {0, 0}좌표로 translate시킨다.\n * @both 캔바스에 모델을 꼭 채우도록 가로, 세로 스케일을 조정하고, {0, 0}좌표로 translate시킨다.\n * @width 캔바스의 폭에 모델의 폭을 일치하도록 가로, 세로 스케일을 동일하게 조정하고, {0, 0}좌표로 translate시킨다.\n * @height 캔바스의 높이에 모델의 높이를 일치하도록 가로, 세로 스케일을 동일하게 조정하고, {0, 0}좌표로 translate시킨다.\n * @center 가로, 세로 스케일을 1로 고정하고 모델이 화면의 중앙에 위치하도록 translate시킨다.\n * @ratio 모델의 모든 부분이 캔바스에 최대 크기로 표현될 수 있도록 가로, 세로 동일한 스케일로 조정하고, {0, 0}좌표로 translate시킨다.\n */\n @property({ type: String }) fit: FITMODE = 'none'\n @property({ type: Array }) selected: Component[] = []\n @property({ type: Boolean }) disposeWhenDetached: boolean = false\n @property({ type: String }) baseUrl: string = ''\n @property({ type: Object }) provider: any\n @property({ type: String }) name: string = 'noname'\n @property({ type: Boolean }) enableInspector: boolean = true\n @property({ type: Boolean }) showInspector: boolean = false\n\n private lastOffsetWidth?: number\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n if (this.scene && this.disposeWhenDetached) {\n this._disposeScene()\n }\n }\n\n render() {\n return html` <slot></slot> `\n }\n\n updated(change: PropertyValues<this>) {\n change.has('model') && this._onModelChanged(this.model)\n change.has('mode') && this._onModeChanged(this.mode)\n change.has('screenSize') && this._onDisplayChanged(this.screenSize)\n change.has('data') && this._onDataChanged(this.data)\n change.has('baseUrl') && this._onBaseUrlChanged(this.baseUrl)\n }\n\n _setScene(scene: Scene | null) {\n this.scene = scene\n this.dispatchEvent(\n new CustomEvent('scene-changed', {\n bubbles: true,\n composed: true,\n detail: { value: scene }\n })\n )\n }\n\n _setMode(mode: SCENE_MODE) {\n this.mode = mode\n this.dispatchEvent(\n new CustomEvent('mode-changed', {\n bubbles: true,\n composed: true,\n detail: { value: mode }\n })\n )\n }\n\n _setVariables(variables: Properties) {\n this.variables = variables\n this.dispatchEvent(\n new CustomEvent('variables-changed', {\n bubbles: true,\n composed: true,\n detail: { value: variables }\n })\n )\n }\n\n _setSelected(selected: Component[]) {\n this.selected = selected\n this.dispatchEvent(\n new CustomEvent('selected-changed', {\n bubbles: true,\n composed: true,\n detail: { value: selected }\n })\n )\n }\n\n _disposeScene() {\n if (this.scene) {\n this.scene.off('selected', this._onSelectedChanged, this)\n this.scene.off('mode', this._onSceneModeChanged, this)\n\n if (this.provider) {\n this.scene.release && this.scene.release()\n } else {\n this.scene.dispose()\n }\n\n this._setScene(null)\n this._setSelected([])\n }\n }\n\n resize(force: boolean) {\n if (typeof this.scene == 'object') {\n if (force || this.fit === 'both' || Math.abs(this.offsetWidth - (this.lastOffsetWidth || 0)) >= 1) {\n requestAnimationFrame(() => {\n if (this.scene) {\n this.scene.resize()\n this.scene.fit(this.fit)\n }\n })\n }\n\n this.lastOffsetWidth = this.offsetWidth\n }\n }\n\n _onModelChanged(model?: Model) {\n this._disposeScene()\n\n if (!model) {\n return\n }\n\n const layers = Array.from(this.querySelectorAll('ox-scene-layer')).map(layer => (layer as OxSceneLayer).getModel())\n\n const handlers = Array.from(this.querySelectorAll('ox-scene-handler')).map(handler => handler.getAttribute('type'))\n\n this._setScene(\n createScene({\n target: this,\n model: JSON.parse(JSON.stringify(model)),\n layers,\n handlers,\n mode: this.mode,\n refProvider: this.provider\n })\n )\n\n if (this.provider) {\n this.provider.add(this.name, this.scene)\n }\n\n this.scene!.screen = this.screenSize\n\n /* 이 컴포넌트의 폭이 값을 가지고 있으면 - 화면상에 자리를 잡고 보여지고 있음을 의미한다.\n * 이 때는 정상적으로 그려주고,\n * 그렇지 않으면, 다음 Resize Handling시에 처리하도록 한다.\n */\n this.resize(true)\n\n this._setVariables(model.variables || this.scene!.variables)\n\n this.scene!.on('selected', this._onSelectedChanged, this)\n this.scene!.on('mode', this._onSceneModeChanged, this)\n\n this._onModeChanged(this.mode)\n this._onDisplayChanged(this.screenSize)\n this._onBaseUrlChanged(this.baseUrl)\n }\n\n _onDisplayChanged(screenSize: string | number) {\n if (!this.scene) {\n return\n }\n\n if (screenSize) {\n this.scene.screen = parseFloat(String(screenSize))\n }\n }\n\n _onModeChanged(mode: SCENE_MODE) {\n if (!this.scene) {\n return\n }\n this.scene.mode = Number(mode)\n }\n\n _onDataChanged(data: any) {\n if (!this.scene || !data) {\n return\n }\n\n this.scene.data = data\n }\n\n _onSelectedChanged(after: Component[]) {\n /*\n scene 컴포넌트의 속성을 속성 에디터(input box등)에서 변경하다가,\n scene의 다른 컴포넌트를 클릭해서 포커스(선택) 컴포넌트를 변경하게되면,\n 속성 에디터(input box등)의 value change 이벤트의 처리와 충돌(레이스)하게된다.\n \n 기대하는 순서는 먼저 속성 에디터의 value change 이벤트를 처리한 후에,\n selected 이벤트를 처리할 수 있도록 requestAnimationFrame으로 한 프레임을 지연하도록 하였다.\n */\n requestAnimationFrame(() => {\n this._setSelected(after)\n })\n }\n\n _onSceneModeChanged(after: SCENE_MODE) {\n if (!this.scene) {\n return\n }\n\n if (this.mode !== after) {\n this._setMode(after)\n }\n\n if (after === 2) {\n this.style.cursor = 'all-scroll'\n } else if (after === 3) {\n this.style.cursor = 'crosshair'\n } else {\n this.style.cursor = 'default'\n }\n }\n\n _onBaseUrlChanged(after: string) {\n if (!this.scene) {\n return\n }\n\n this.scene.baseUrl = after\n }\n}\n"]}
@@ -194,7 +194,7 @@ let BoardList = class BoardList extends LitElement {
194
194
  filters: this.groupId
195
195
  ? [
196
196
  {
197
- name: 'group_id',
197
+ name: 'groupId',
198
198
  operator: 'eq',
199
199
  value: this.groupId
200
200
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ox-board-list.js","sourceRoot":"","sources":["../../src/ox-board-list.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGzE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIhD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QAwH+B,cAAS,GAAY,KAAK,CAAA;QAG3B,SAAI,GAA6B,MAAM,CAAA;QAExC,WAAM,GAAU,EAAE,CAAA;QAClB,cAAS,GAAU,EAAE,CAAA;QAEvC,iBAAY,GAAY,KAAK,CAAA;IA2TxC,CAAC;IAvTC,MAAM;QACJ,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI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Y,EAAE,EAAU;QAC/D,QAAQ,CAAC,aAAa,CACpB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,MAAM,EAAE;gBACN,KAAK;gBACL,OAAO;gBACP,EAAE;aACH;SACF,CAAC,CACH,CAAA;IACH,CAAC;CACF,CAAA;AA1bQ,gBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqHlB,CAAA;AAE4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CAA2B;AAC3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAU;AACT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAwC;AACvC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAiB;AACjB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;yCAAmB;AAClB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;4CAAsB;AAEvC;IAAR,KAAK,EAAE;+CAA8B;AAEnB;IAAlB,KAAK,CAAC,UAAU,CAAC;wCAAkB;AAlIhC,SAAS;IADd,aAAa,CAAC,eAAe,CAAC;GACzB,SAAS,CA2bd","sourcesContent":["import '@operato/popup/ox-popup.js'\nimport '@operato/data-grist'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { ColumnConfig, DataGrist, GristData, GristRecord, SortersConfig } from '@operato/data-grist'\nimport { OxPopup } from '@operato/popup'\n\nimport { createBoard, fetchBoardList } from './graphql/board'\nimport { fetchFavoriteBoardList } from './graphql/favorite-board'\nimport { fetchGroupList } from './graphql/group'\nimport { Board } from './types'\n\n@customElement('ox-board-list')\nclass BoardList extends LitElement {\n static styles = css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n ox-grist {\n flex: 1;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n #headroom {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: var(--padding-default) var(--padding-wide);\n border-top: 2px solid rgba(0, 0, 0, 0.2);\n background-color: var(--theme-white-color);\n box-shadow: var(--box-shadow);\n }\n\n #filters {\n flex: 1;\n --mdc-icon-size: 20px;\n }\n #mode {\n width: 100px;\n }\n #add {\n width: 50px;\n text-align: right;\n }\n\n #modes > * {\n padding: var(--padding-narrow);\n font-size: 1em;\n opacity: 0.5;\n color: var(--primary-text-color);\n cursor: pointer;\n }\n\n #modes > mwc-icon[active] {\n border-radius: 9px;\n background-color: rgba(var(--primary-color-rgb), 0.05);\n opacity: 1;\n color: var(--secondary-text-color);\n cursor: default;\n }\n #modes > mwc-icon:hover {\n opacity: 1;\n color: var(--secondary-text-color);\n }\n\n #add button {\n background-color: var(--status-success-color);\n border: 0;\n border-radius: 50%;\n padding: 5px;\n width: 36px;\n height: 36px;\n cursor: pointer;\n }\n #add button:hover {\n background-color: var(--focus-background-color);\n box-shadow: var(--box-shadow);\n }\n #add button mwc-icon {\n font-size: 2em;\n color: var(--theme-white-color);\n }\n\n #filters {\n position: relative;\n }\n #filters [type='text'] {\n background-color: transparent;\n border: 0;\n border-bottom: var(--border-dark-color);\n padding: var(--padding-narrow) var(--padding-narrow) 7px 25px;\n font-size: var(--fontsize-large);\n }\n #filters [type='text']:focus {\n outline: none;\n }\n #filters mwc-icon {\n position: absolute;\n top: 3px;\n color: var(--secondary-color);\n }\n #filters * {\n margin-right: var(--margin-default);\n }\n\n oops-spinner {\n display: none;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n }\n\n oops-spinner[show] {\n display: block;\n }\n\n @media only screen and (max-width: 460px) {\n #modes {\n display: none;\n }\n }\n `\n\n @property({ type: Boolean }) creatable: boolean = false\n @property({ type: Object }) config: any\n @property({ type: Object }) data: any\n @property({ type: String }) mode: 'GRID' | 'LIST' | 'CARD' = 'CARD'\n @property({ type: String }) groupId?: string\n @property({ type: Array }) groups: any[] = []\n @property({ type: Array }) favorites: any[] = []\n\n @state() _showSpinner: boolean = false\n\n @query('ox-grist') grist!: DataGrist\n\n render() {\n const mode = this.mode || 'CARD'\n\n return html`\n <ox-grist .config=${this.config} .mode=${mode} auto-fetch .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" id=\"headroom\">\n <div id=\"filters\">\n <mwc-icon>search</mwc-icon>\n <input type=\"text\" />\n\n <select\n @change=${(e: Event) => {\n this.groupId = (e.currentTarget as HTMLInputElement).value\n this.requestUpdate()\n }}\n >\n <option value=\"\">*</option>\n ${this.groups.map(\n group =>\n html` <option value=${group.id} ?selected=${group.id === this.groupId}>${group.description}</option> `\n )}\n </select>\n </div>\n\n <div id=\"modes\">\n <mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</mwc-icon>\n <mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</mwc-icon>\n <mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>\n </div>\n\n ${this.creatable\n ? html`\n <div id=\"add\">\n <button><mwc-icon @click=${() => this.onCreateBoard()}>add</mwc-icon></button>\n </div>\n `\n : undefined}\n </div>\n </ox-grist>\n\n <oops-spinner ?show=${this._showSpinner}></oops-spinner>\n `\n }\n\n async fetchHandler({ page, limit, sorters = [] }: { page: number; limit: number; sorters: SortersConfig }) {\n this._showSpinner = true\n\n const { items: records, total } = await this.getBoards({ page, limit, sorters })\n\n this._showSpinner = false\n\n return {\n total,\n records\n }\n }\n\n get gristConfig() {\n return {\n list: {\n thumbnail: function (record: GristRecord, rowIndex: number) {\n return html` <img src=${record.thumbnail} style=\"width: 100%; height: 100%;\" /> `\n },\n fields: ['name', 'description'],\n details: ['updatedAt']\n },\n columns: [\n {\n type: 'gutter',\n gutterName: 'dirty'\n },\n {\n type: 'gutter',\n gutterName: 'sequence'\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'star_border',\n handlers: {\n click: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number\n ): void => {}\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'drive_file_rename_outline',\n handlers: {\n click: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number\n ): void => {}\n }\n },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n header: 'name',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200,\n sortable: true\n },\n {\n type: 'string',\n name: 'description',\n header: 'description',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200,\n handlers: {\n dblclick: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number\n ): void => {\n alert(`${column.name} ${record[column.name]}, row : ${rowIndex}`)\n }\n }\n },\n {\n type: 'boolean',\n name: 'active',\n header: 'active',\n record: {\n editable: true\n },\n sortable: true,\n width: 60\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: 'updated at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n },\n {\n type: 'datetime',\n name: 'createdAt',\n header: 'created at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n },\n handlers: {},\n classifier: function (\n record: GristRecord,\n rowIndex: number\n ): { emphasized?: boolean | string | string[]; [key: string]: any } | void {}\n },\n sorters: [\n {\n name: 'name',\n desc: false\n }\n ],\n pagination: {\n pages: [20, 30, 50, 100, 200]\n }\n }\n }\n\n async refresh() {\n this.groups = (await fetchGroupList()).groups.items\n\n if (this.groups) {\n await this.refreshBoards()\n }\n }\n\n async getBoards({\n page = 1,\n limit = 30,\n sorters = []\n }: { page?: number; limit?: number; sorters?: SortersConfig } = {}) {\n if (this.groupId && this.groupId == 'favor')\n return await this.getFavoriteBoards({\n page,\n limit\n })\n\n var listParam = {\n filters: this.groupId\n ? [\n {\n name: 'group_id',\n operator: 'eq',\n value: this.groupId\n }\n ]\n : [],\n sortings: sorters,\n pagination: {\n page,\n limit\n }\n }\n\n return (await fetchBoardList(listParam)).boards\n }\n\n async getFavoriteBoards({ page = 1, limit = 30 } = {}) {\n var listParam = {\n pagination: {\n page,\n limit\n }\n }\n\n return (await fetchFavoriteBoardList(listParam)).favoriteBoards\n }\n\n async refreshBoards() {\n if (!this.groups) {\n await this.refresh()\n return\n }\n\n this.grist.fetch()\n }\n\n async onCreateBoard() {\n /*\n * 기존 설정된 이미지가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.\n * 주의. value는 object일 수도 있고, string일 수도 있다.\n * string인 경우에는 해당 보드의 id로 해석한다.\n */\n var template = html`\n <process-creation-popup\n .defaultGroup=${this.groupId}\n .groups=${this.groups}\n @create-process=${async (e: CustomEvent) => {\n try {\n var { name, description, groupId } = e.detail\n var board: Board = {\n name,\n description,\n groupId,\n model: {\n width: 1200,\n height: 800\n }\n }\n\n const { createBoard: created } = await createBoard(board)\n\n // this.popup && this.popup.close()\n\n // await sleep(100)\n\n this.notify('info', 'new process created')\n } catch (ex: Error | any) {\n console.error(ex)\n this.notify('error', ex, ex)\n }\n }}\n ></process-creation-popup>\n `\n\n OxPopup.open({\n template,\n parent: this.renderRoot as Element\n })\n\n requestAnimationFrame(() => {\n dispatchEvent(new Event('resize'))\n })\n }\n\n notify(level: 'warn' | 'error' | 'info', message: any, ex?: Error) {\n document.dispatchEvent(\n new Custom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QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CAA2B;AAC3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAU;AACT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAwC;AACvC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAiB;AACjB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;yCAAmB;AAClB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;4CAAsB;AAEvC;IAAR,KAAK,EAAE;+CAA8B;AAEnB;IAAlB,KAAK,CAAC,UAAU,CAAC;wCAAkB;AAlIhC,SAAS;IADd,aAAa,CAAC,eAAe,CAAC;GACzB,SAAS,CA2bd","sourcesContent":["import '@operato/popup/ox-popup.js'\nimport '@operato/data-grist'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { ColumnConfig, DataGrist, GristData, GristRecord, SortersConfig } from '@operato/data-grist'\nimport { OxPopup } from '@operato/popup'\n\nimport { createBoard, fetchBoardList } from './graphql/board'\nimport { fetchFavoriteBoardList } from './graphql/favorite-board'\nimport { fetchGroupList } from './graphql/group'\nimport { Board } from './types'\n\n@customElement('ox-board-list')\nclass BoardList extends LitElement {\n static styles = css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n ox-grist {\n flex: 1;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n #headroom {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: var(--padding-default) var(--padding-wide);\n border-top: 2px solid rgba(0, 0, 0, 0.2);\n background-color: var(--theme-white-color);\n box-shadow: var(--box-shadow);\n }\n\n #filters {\n flex: 1;\n --mdc-icon-size: 20px;\n }\n #mode {\n width: 100px;\n }\n #add {\n width: 50px;\n text-align: right;\n }\n\n #modes > * {\n padding: var(--padding-narrow);\n font-size: 1em;\n opacity: 0.5;\n color: var(--primary-text-color);\n cursor: pointer;\n }\n\n #modes > mwc-icon[active] {\n border-radius: 9px;\n background-color: rgba(var(--primary-color-rgb), 0.05);\n opacity: 1;\n color: var(--secondary-text-color);\n cursor: default;\n }\n #modes > mwc-icon:hover {\n opacity: 1;\n color: var(--secondary-text-color);\n }\n\n #add button {\n background-color: var(--status-success-color);\n border: 0;\n border-radius: 50%;\n padding: 5px;\n width: 36px;\n height: 36px;\n cursor: pointer;\n }\n #add button:hover {\n background-color: var(--focus-background-color);\n box-shadow: var(--box-shadow);\n }\n #add button mwc-icon {\n font-size: 2em;\n color: var(--theme-white-color);\n }\n\n #filters {\n position: relative;\n }\n #filters [type='text'] {\n background-color: transparent;\n border: 0;\n border-bottom: var(--border-dark-color);\n padding: var(--padding-narrow) var(--padding-narrow) 7px 25px;\n font-size: var(--fontsize-large);\n }\n #filters [type='text']:focus {\n outline: none;\n }\n #filters mwc-icon {\n position: absolute;\n top: 3px;\n color: var(--secondary-color);\n }\n #filters * {\n margin-right: var(--margin-default);\n }\n\n oops-spinner {\n display: none;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n }\n\n oops-spinner[show] {\n display: block;\n }\n\n @media only screen and (max-width: 460px) {\n #modes {\n display: none;\n }\n }\n `\n\n @property({ type: Boolean }) creatable: boolean = false\n @property({ type: Object }) config: any\n @property({ type: Object }) data: any\n @property({ type: String }) mode: 'GRID' | 'LIST' | 'CARD' = 'CARD'\n @property({ type: String }) groupId?: string\n @property({ type: Array }) groups: any[] = []\n @property({ type: Array }) favorites: any[] = []\n\n @state() _showSpinner: boolean = false\n\n @query('ox-grist') grist!: DataGrist\n\n render() {\n const mode = this.mode || 'CARD'\n\n return html`\n <ox-grist .config=${this.config} .mode=${mode} auto-fetch .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" id=\"headroom\">\n <div id=\"filters\">\n <mwc-icon>search</mwc-icon>\n <input type=\"text\" />\n\n <select\n @change=${(e: Event) => {\n this.groupId = (e.currentTarget as HTMLInputElement).value\n this.requestUpdate()\n }}\n >\n <option value=\"\">*</option>\n ${this.groups.map(\n group =>\n html` <option value=${group.id} ?selected=${group.id === this.groupId}>${group.description}</option> `\n )}\n </select>\n </div>\n\n <div id=\"modes\">\n <mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</mwc-icon>\n <mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</mwc-icon>\n <mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>\n </div>\n\n ${this.creatable\n ? html`\n <div id=\"add\">\n <button><mwc-icon @click=${() => this.onCreateBoard()}>add</mwc-icon></button>\n </div>\n `\n : undefined}\n </div>\n </ox-grist>\n\n <oops-spinner ?show=${this._showSpinner}></oops-spinner>\n `\n }\n\n async fetchHandler({ page, limit, sorters = [] }: { page: number; limit: number; sorters: SortersConfig }) {\n this._showSpinner = true\n\n const { items: records, total } = await this.getBoards({ page, limit, sorters })\n\n this._showSpinner = false\n\n return {\n total,\n records\n }\n }\n\n get gristConfig() {\n return {\n list: {\n thumbnail: function (record: GristRecord, rowIndex: number) {\n return html` <img src=${record.thumbnail} style=\"width: 100%; height: 100%;\" /> `\n },\n fields: ['name', 'description'],\n details: ['updatedAt']\n },\n columns: [\n {\n type: 'gutter',\n gutterName: 'dirty'\n },\n {\n type: 'gutter',\n gutterName: 'sequence'\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'star_border',\n handlers: {\n click: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number\n ): void => {}\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'drive_file_rename_outline',\n handlers: {\n click: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number\n ): void => {}\n }\n },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n header: 'name',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200,\n sortable: true\n },\n {\n type: 'string',\n name: 'description',\n header: 'description',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200,\n handlers: {\n dblclick: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number\n ): void => {\n alert(`${column.name} ${record[column.name]}, row : ${rowIndex}`)\n }\n }\n },\n {\n type: 'boolean',\n name: 'active',\n header: 'active',\n record: {\n editable: true\n },\n sortable: true,\n width: 60\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: 'updated at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n },\n {\n type: 'datetime',\n name: 'createdAt',\n header: 'created at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n },\n handlers: {},\n classifier: function (\n record: GristRecord,\n rowIndex: number\n ): { emphasized?: boolean | string | string[]; [key: string]: any } | void {}\n },\n sorters: [\n {\n name: 'name',\n desc: false\n }\n ],\n pagination: {\n pages: [20, 30, 50, 100, 200]\n }\n }\n }\n\n async refresh() {\n this.groups = (await fetchGroupList()).groups.items\n\n if (this.groups) {\n await this.refreshBoards()\n }\n }\n\n async getBoards({\n page = 1,\n limit = 30,\n sorters = []\n }: { page?: number; limit?: number; sorters?: SortersConfig } = {}) {\n if (this.groupId && this.groupId == 'favor')\n return await this.getFavoriteBoards({\n page,\n limit\n })\n\n var listParam = {\n filters: this.groupId\n ? [\n {\n name: 'groupId',\n operator: 'eq',\n value: this.groupId\n }\n ]\n : [],\n sortings: sorters,\n pagination: {\n page,\n limit\n }\n }\n\n return (await fetchBoardList(listParam)).boards\n }\n\n async getFavoriteBoards({ page = 1, limit = 30 } = {}) {\n var listParam = {\n pagination: {\n page,\n limit\n }\n }\n\n return (await fetchFavoriteBoardList(listParam)).favoriteBoards\n }\n\n async refreshBoards() {\n if (!this.groups) {\n await this.refresh()\n return\n }\n\n this.grist.fetch()\n }\n\n async onCreateBoard() {\n /*\n * 기존 설정된 이미지가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.\n * 주의. value는 object일 수도 있고, string일 수도 있다.\n * string인 경우에는 해당 보드의 id로 해석한다.\n */\n var template = html`\n <process-creation-popup\n .defaultGroup=${this.groupId}\n .groups=${this.groups}\n @create-process=${async (e: CustomEvent) => {\n try {\n var { name, description, groupId } = e.detail\n var board: Board = {\n name,\n description,\n groupId,\n model: {\n width: 1200,\n height: 800\n }\n }\n\n const { createBoard: created } = await createBoard(board)\n\n // this.popup && this.popup.close()\n\n // await sleep(100)\n\n this.notify('info', 'new process created')\n } catch (ex: Error | any) {\n console.error(ex)\n this.notify('error', ex, ex)\n }\n }}\n ></process-creation-popup>\n `\n\n OxPopup.open({\n template,\n parent: this.renderRoot as Element\n })\n\n requestAnimationFrame(() => {\n dispatchEvent(new Event('resize'))\n })\n }\n\n notify(level: 'warn' | 'error' | 'info', message: any, ex?: Error) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level,\n message,\n ex\n }\n })\n )\n }\n}\n"]}
@@ -41,6 +41,7 @@ export declare class BoardViewer extends LitElement {
41
41
  onRoutePage(page: string): void;
42
42
  onStartScenario(scenario: string, value: string | number | object, component: Component): Promise<void>;
43
43
  onRunScenario(scenario: string, value: string | number | object, component: Component): Promise<void>;
44
+ getSceneData(): any;
44
45
  getSceneImageData(base64?: boolean): Promise<{
45
46
  width: any;
46
47
  height: any;
@@ -5,8 +5,9 @@ import { css, html, LitElement } from 'lit';
5
5
  import { customElement, property, query, state } from 'lit/decorators.js';
6
6
  import { create, SCENE_MODE } from '@hatiolab/things-scene';
7
7
  import { isIOS, togglefullscreen } from '@operato/utils';
8
- import { DataSubscriptionProviderImpl } from './graphql/data-subscription';
9
- import { runScenario, startScenario } from './graphql/scenario';
8
+ import { DataStorage } from './data-storage/data-storage.js';
9
+ import { DataSubscriptionProviderImpl } from './graphql/data-subscription.js';
10
+ import { runScenario, startScenario } from './graphql/scenario.js';
10
11
  let BoardViewer = class BoardViewer extends LitElement {
11
12
  constructor() {
12
13
  super(...arguments);
@@ -113,6 +114,7 @@ let BoardViewer = class BoardViewer extends LitElement {
113
114
  },
114
115
  mode: SCENE_MODE.VIEW,
115
116
  refProvider: this.provider,
117
+ dataStorage: this.board.id !== 'preview' ? new DataStorage(this.board.id) : undefined,
116
118
  dataSubscriptionProvider: new DataSubscriptionProviderImpl()
117
119
  });
118
120
  if (this.baseUrl) {
@@ -125,13 +127,13 @@ let BoardViewer = class BoardViewer extends LitElement {
125
127
  if (this._scene) {
126
128
  this.unbindSceneEvents(this._scene);
127
129
  this._scene.target = null;
128
- this._scene.release();
130
+ this._scene.release && this._scene.release();
129
131
  this._scene = null;
130
132
  }
131
133
  // delete queued scenes
132
- this._forward.forEach(scene => scene.release());
134
+ this._forward.forEach(scene => scene.release && scene.release());
133
135
  this._forward = [];
134
- this._backward.forEach(scene => scene.release());
136
+ this._backward.forEach(scene => scene.release && scene.release());
135
137
  this._backward = [];
136
138
  }
137
139
  releaseScene() {
@@ -156,7 +158,7 @@ let BoardViewer = class BoardViewer extends LitElement {
156
158
  try {
157
159
  var scene = await this.provider.get(boardId, true);
158
160
  if (scene === this._scene) {
159
- scene.release();
161
+ scene.release && scene.release();
160
162
  return;
161
163
  }
162
164
  if (this._scene) {
@@ -167,7 +169,7 @@ let BoardViewer = class BoardViewer extends LitElement {
167
169
  this._backward.push(this._scene);
168
170
  }
169
171
  this._scene = scene;
170
- this._forward.forEach(scene => scene.release());
172
+ this._forward.forEach(scene => scene.release && scene.release());
171
173
  /* forward를 비운다. */
172
174
  this._forward = [];
173
175
  this.setupScene(scene);
@@ -306,6 +308,10 @@ let BoardViewer = class BoardViewer extends LitElement {
306
308
  console.error(e);
307
309
  }
308
310
  }
311
+ getSceneData() {
312
+ var _a;
313
+ return (_a = this._scene) === null || _a === void 0 ? void 0 : _a.data;
314
+ }
309
315
  async getSceneImageData(base64 = false) {
310
316
  if (!this._scene) {
311
317
  return;