@operato/board 1.4.70 → 1.4.72

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 CHANGED
@@ -3,6 +3,25 @@
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.4.72](https://github.com/hatiolab/operato/compare/v1.4.71...v1.4.72) (2023-09-15)
7
+
8
+
9
+ ### :bug: Bug Fix
10
+
11
+ * style copy, databind copy ([48d954d](https://github.com/hatiolab/operato/commit/48d954d7bc374d15483b2adaa898ad8499c37faa))
12
+
13
+
14
+
15
+ ### [1.4.71](https://github.com/hatiolab/operato/compare/v1.4.70...v1.4.71) (2023-09-14)
16
+
17
+
18
+ ### :bug: Bug Fix
19
+
20
+ * typo fetchPlayGroupByName ([a2898f7](https://github.com/hatiolab/operato/commit/a2898f7888d3ae93412f646e179f84a7cb3df19e))
21
+ * typo fetchPlayGroupByName ([b20c1bb](https://github.com/hatiolab/operato/commit/b20c1bb52e60edb392baebf0d0e42098935d0667))
22
+
23
+
24
+
6
25
  ### [1.4.70](https://github.com/hatiolab/operato/compare/v1.4.69...v1.4.70) (2023-09-14)
7
26
 
8
27
 
@@ -81,7 +81,7 @@ export async function fetchPlayGroup(groupId) {
81
81
  export async function fetchPlayGroupByName(name) {
82
82
  const response = await client.query({
83
83
  query: gql `
84
- query FetchPlayGroupByName($id: String!) {
84
+ query FetchPlayGroupByName($name: String!) {
85
85
  playGroupByName(name: $name) {
86
86
  id
87
87
  }
@@ -1 +1 @@
1
- {"version":3,"file":"play-group.js","sourceRoot":"","sources":["../../../src/graphql/play-group.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,MAAM,QAAQ,GAAG,MAAM,MAAM,CA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E,OAAO;YACX,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import { PlayGroup } from '../types'\nimport { client } from '@operato/graphql'\nimport gql from 'graphql-tag'\n\nexport async function playlists(): Promise<{ name: string; description: string }[]> {\n const response = await client.query({\n query: gql`\n {\n playGroups {\n items {\n id\n name\n description\n }\n total\n }\n }\n `\n })\n\n return response.data.playGroups.items\n}\n\nexport async function fetchPlayGroupList() {\n const response = await client.query({\n query: gql`\n {\n playGroups {\n items {\n id\n name\n description\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function fetchPlayGroup(groupId: string) {\n const response = await client.query({\n query: gql`\n query FetchPlayGroup($id: String!) {\n playGroup(id: $id) {\n id\n name\n description\n boards {\n id\n name\n description\n model\n thumbnail\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n }\n `,\n variables: {\n id: groupId\n }\n })\n\n return response.data\n}\n\nexport async function fetchPlayGroupByName(name: string) {\n const response = await client.query({\n query: gql`\n query FetchPlayGroupByName($id: String!) {\n playGroupByName(name: $name) {\n id\n }\n }\n `,\n variables: {\n name\n }\n })\n\n return response.data.playGroupByName\n}\n\nexport async function createPlayGroup(group: PlayGroup) {\n var { name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreatePlayGroup($playGroup: NewPlayGroup!) {\n createPlayGroup(playGroup: $playGroup) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n playGroup: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function updatePlayGroup(group: PlayGroup) {\n var { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdatePlayGroup($id: String!, $patch: PlayGroupPatch!) {\n updatePlayGroup(id: $id, patch: $patch) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function deletePlayGroup(id: string) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deletePlayGroup(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n return response.data\n}\n\nexport async function joinPlayGroup(boardId: string, group: PlayGroup) {\n var { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {\n joinPlayGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n\nexport async function leavePlayGroup(boardId: string, groupId: string) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $boardIds: [String]!) {\n leavePlayGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id: groupId,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n"]}
1
+ {"version":3,"file":"play-group.js","sourceRoot":"","sources":["../../../src/graphql/play-group.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;KAWT;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAA;AACvC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA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EAAE;YACF,KAAK,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;SAC7B;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,EAAU;IAC9C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;KAIZ;QACD,SAAS,EAAE;YACT,EAAE;SACH;KACF,CAAC,CAAA;IACF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAAe,EAAE,KAAgB;IACnE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IAErC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBZ;QACD,SAAS,EAAE;YACT,EAAE;YACF,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAe,EAAE,OAAe;IACnE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBZ;QACD,SAAS,EAAE;YACT,EAAE,EAAE,OAAO;YACX,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import { PlayGroup } from '../types'\nimport { client } from '@operato/graphql'\nimport gql from 'graphql-tag'\n\nexport async function playlists(): Promise<{ name: string; description: string }[]> {\n const response = await client.query({\n query: gql`\n {\n playGroups {\n items {\n id\n name\n description\n }\n total\n }\n }\n `\n })\n\n return response.data.playGroups.items\n}\n\nexport async function fetchPlayGroupList() {\n const response = await client.query({\n query: gql`\n {\n playGroups {\n items {\n id\n name\n description\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function fetchPlayGroup(groupId: string) {\n const response = await client.query({\n query: gql`\n query FetchPlayGroup($id: String!) {\n playGroup(id: $id) {\n id\n name\n description\n boards {\n id\n name\n description\n model\n thumbnail\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n }\n `,\n variables: {\n id: groupId\n }\n })\n\n return response.data\n}\n\nexport async function fetchPlayGroupByName(name: string) {\n const response = await client.query({\n query: gql`\n query FetchPlayGroupByName($name: String!) {\n playGroupByName(name: $name) {\n id\n }\n }\n `,\n variables: {\n name\n }\n })\n\n return response.data.playGroupByName\n}\n\nexport async function createPlayGroup(group: PlayGroup) {\n var { name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreatePlayGroup($playGroup: NewPlayGroup!) {\n createPlayGroup(playGroup: $playGroup) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n playGroup: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function updatePlayGroup(group: PlayGroup) {\n var { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdatePlayGroup($id: String!, $patch: PlayGroupPatch!) {\n updatePlayGroup(id: $id, patch: $patch) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function deletePlayGroup(id: string) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deletePlayGroup(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n return response.data\n}\n\nexport async function joinPlayGroup(boardId: string, group: PlayGroup) {\n var { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {\n joinPlayGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n\nexport async function leavePlayGroup(boardId: string, groupId: string) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $boardIds: [String]!) {\n leavePlayGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id: groupId,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n"]}
@@ -12,6 +12,8 @@ export declare class EditToolbar extends LitElement {
12
12
  private redo;
13
13
  private undo;
14
14
  private fullscreen;
15
+ private styleCopy;
16
+ private databindCopy;
15
17
  private cut;
16
18
  private copy;
17
19
  private paste;
@@ -37,6 +39,8 @@ export declare class EditToolbar extends LitElement {
37
39
  onSelectedChanged(after: Component[], before: Component[]): void;
38
40
  onTapUndo(): void;
39
41
  onTapRedo(): void;
42
+ onStartStylePasteMode(): void;
43
+ onStartDatabindPasteMode(): void;
40
44
  onTapCut(): void;
41
45
  onTapCopy(): Promise<void>;
42
46
  onTapPaste(): void;
@@ -30,6 +30,8 @@ export class EditToolbar extends LitElement {
30
30
  this.undo.addEventListener('tap', this.onTapUndo.bind(this));
31
31
  this.redo.addEventListener('tap', this.onTapRedo.bind(this));
32
32
  this.fullscreen.addEventListener('tap', this.onTapFullscreen.bind(this));
33
+ this.styleCopy.addEventListener('tap', this.onStartStylePasteMode.bind(this));
34
+ this.databindCopy.addEventListener('tap', this.onStartDatabindPasteMode.bind(this));
33
35
  this.cut.addEventListener('tap', this.onTapCut.bind(this));
34
36
  this.copy.addEventListener('tap', this.onTapCopy.bind(this));
35
37
  this.paste.addEventListener('tap', this.onTapPaste.bind(this));
@@ -62,6 +64,11 @@ export class EditToolbar extends LitElement {
62
64
 
63
65
  <span class="vline"></span>
64
66
 
67
+ <span button id="style-copy" title="style copy (${this.getShortcutString('cmd', '1')})"> </span>
68
+ <span button id="databind-copy" title="databind copy (${this.getShortcutString('cmd', '2')})"> </span>
69
+
70
+ <span class="vline"></span>
71
+
65
72
  <span button id="cut" title="cut (${this.getShortcutString('cmd', 'x')})"> </span>
66
73
  <span button id="copy" title="copy (${this.getShortcutString('cmd', 'c')})"> </span>
67
74
  <span button id="paste" title="paste (${this.getShortcutString('cmd', 'v')})"> </span>
@@ -74,11 +81,6 @@ export class EditToolbar extends LitElement {
74
81
 
75
82
  <span class="vline"></span>
76
83
 
77
- <!-- TODO Implement style-copy
78
- <span button id="style-copy" title="format painter"></span>
79
- <span class="vline"></span>
80
- -->
81
-
82
84
  <span
83
85
  button
84
86
  data-align="left"
@@ -239,6 +241,14 @@ export class EditToolbar extends LitElement {
239
241
  if (ctrlKey && !shiftKey)
240
242
  this.onTapRedo();
241
243
  break;
244
+ case 'Digit1':
245
+ if (altKey)
246
+ this.onStartStylePasteMode();
247
+ break;
248
+ case 'Digit2':
249
+ if (altKey)
250
+ this.onStartDatabindPasteMode();
251
+ break;
242
252
  case 'KeyC':
243
253
  if (ctrlKey && !shiftKey)
244
254
  this.onTapCopy();
@@ -282,12 +292,6 @@ export class EditToolbar extends LitElement {
282
292
  else if (altKey && shiftKey)
283
293
  this.onTapAlign('bottom');
284
294
  break;
285
- // case 'Equal':
286
- // if (ctrlKey) this.onTapZoom(zoomin)
287
- // break
288
- // case 'Minus':
289
- // if (ctrlKey) this.onTapZoom(zoomout)
290
- // break
291
295
  case 'KeyH':
292
296
  if (ctrlKey && !shiftKey)
293
297
  this.onTapToggle();
@@ -377,12 +381,6 @@ export class EditToolbar extends LitElement {
377
381
  after.on('redo', this.onRedo, this);
378
382
  }
379
383
  }
380
- // @query('#align-left') private alignLeft!: HTMLElement
381
- // @query('#align-center') private alignCenter!: HTMLElement
382
- // @query('#align-right') private alignRight!: HTMLElement
383
- // @query('#align-top') private alignTop!: HTMLElement
384
- // @query('#align-middle') private alignMiddle!: HTMLElement
385
- // @query('#align-bottom') private alignBottom!: HTMLElement
386
384
  onSelectedChanged(after, before) {
387
385
  var alignable = after.length > 1;
388
386
  this.aligners.forEach(aligner => alignable ? aligner.removeAttribute('disabled') : aligner.setAttribute('disabled', ''));
@@ -402,6 +400,14 @@ export class EditToolbar extends LitElement {
402
400
  var _a;
403
401
  (_a = this.scene) === null || _a === void 0 ? void 0 : _a.redo();
404
402
  }
403
+ onStartStylePasteMode() {
404
+ var _a;
405
+ (_a = this.scene) === null || _a === void 0 ? void 0 : _a.startStylePasteMode();
406
+ }
407
+ onStartDatabindPasteMode() {
408
+ var _a;
409
+ (_a = this.scene) === null || _a === void 0 ? void 0 : _a.startDatabindPasteMode();
410
+ }
405
411
  onTapCut() {
406
412
  var _a;
407
413
  (_a = this.scene) === null || _a === void 0 ? void 0 : _a.cut();
@@ -548,6 +554,12 @@ __decorate([
548
554
  __decorate([
549
555
  query('#fullscreen')
550
556
  ], EditToolbar.prototype, "fullscreen", void 0);
557
+ __decorate([
558
+ query('#style-copy')
559
+ ], EditToolbar.prototype, "styleCopy", void 0);
560
+ __decorate([
561
+ query('#databind-copy')
562
+ ], EditToolbar.prototype, "databindCopy", void 0);
551
563
  __decorate([
552
564
  query('#cut')
553
565
  ], EditToolbar.prototype, "cut", void 0);
@@ -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;AAE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AC;0CAA4B;AACpB;IAAvB,KAAK,CAAC,OAAO,CAAC;yCAA2B;AAER;IAAjC,QAAQ,CAAC,cAAc,CAAC;6CAA+C;AACrC;IAAlC,QAAQ,CAAC,eAAe,CAAC;4CAA8C;AACjC;IAAtC,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 try {\n this.cliped = (e as ClipboardEvent).clipboardData?.getData('text/plain')\n } catch (e) {\n console.error('model paste failed', e)\n }\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('#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=\"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 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 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 'KeyD':\n if (ctrlKey) {\n this.onTapFitScene()\n defaultPrevent = true\n }\n break\n case 'KeyE':\n if (ctrlKey && shiftKey) this.onTapDownloadModel()\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\n var align = typeof e === 'string' ? e : (e.target as HTMLElement).getAttribute('data-align')\n if (!align) {\n return\n }\n\n if (selected.length <= 1) {\n this.scene.place(align)\n } else {\n this.scene.align(align)\n }\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 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,OA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AAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;6CAAqB;AAClB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDAA8B;AAIlC;IAAvB,KAAK,CAAC,OAAO,CAAC;yCAA2B;AAClB;IAAvB,KAAK,CAAC,OAAO,CAAC;yCAA2B;AAEZ;IAA7B,KAAK,CAAC,aAAa,CAAC;+CAAiC;AACxB;IAA7B,KAAK,CAAC,aAAa,CAAC;8CAAgC;AACpB;IAAhC,KAAK,CAAC,gBAAgB,CAAC;iDAAmC;AACpC;IAAtB,KAAK,CAAC,MAAM,CAAC;wCAA0B;AAChB;IAAvB,KAAK,CAAC,OAAO,CAAC;yCAA2B;AACjB;IAAxB,KAAK,CAAC,QAAQ,CAAC;0CAA4B;AAClB;IAAzB,KAAK,CAAC,SAAS,CAAC;2CAA6B;AAEnB;IAA1B,KAAK,CAAC,UAAU,CAAC;4CAA8B;AACpB;IAA3B,KAAK,CAAC,WAAW,CAAC;6CAA+B;AACzB;IAAxB,KAAK,CAAC,QAAQ,CAAC;0CAA4B;AACpB;IAAvB,KAAK,CAAC,OAAO,CAAC;yCAA2B;AAER;IAAjC,QAAQ,CAAC,cAAc,CAAC;6CAA+C;AACrC;IAAlC,QAAQ,CAAC,eAAe,CAAC;4CAA8C;AACjC;IAAtC,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('#style-copy') private styleCopy!: HTMLElement\n @query('#databind-copy') private databindCopy!: 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 try {\n this.cliped = (e as ClipboardEvent).clipboardData?.getData('text/plain')\n } catch (e) {\n console.error('model paste failed', e)\n }\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.styleCopy.addEventListener('tap', this.onStartStylePasteMode.bind(this) as EventListener)\n this.databindCopy.addEventListener('tap', this.onStartDatabindPasteMode.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('#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=\"style-copy\" title=\"style copy (${this.getShortcutString('cmd', '1')})\"> </span>\n <span button id=\"databind-copy\" title=\"databind copy (${this.getShortcutString('cmd', '2')})\"> </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 <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=\"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 break\n case 'Digit1':\n if (altKey) this.onStartStylePasteMode()\n break\n case 'Digit2':\n if (altKey) this.onStartDatabindPasteMode()\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 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 '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 'KeyD':\n if (ctrlKey) {\n this.onTapFitScene()\n defaultPrevent = true\n }\n break\n case 'KeyE':\n if (ctrlKey && shiftKey) this.onTapDownloadModel()\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 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 onStartStylePasteMode() {\n this.scene?.startStylePasteMode()\n }\n\n onStartDatabindPasteMode() {\n this.scene?.startDatabindPasteMode()\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\n var align = typeof e === 'string' ? e : (e.target as HTMLElement).getAttribute('data-align')\n if (!align) {\n return\n }\n\n if (selected.length <= 1) {\n this.scene.place(align)\n } else {\n this.scene.align(align)\n }\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 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"]}
@@ -5,7 +5,7 @@ import './modeller/scene-viewer/ox-scene-layer.js';
5
5
  import './modeller/scene-viewer/ox-scene-property.js';
6
6
  import './modeller/scene-viewer/ox-scene-viewer.js';
7
7
  import './ox-board-viewer';
8
- import { LitElement } from 'lit';
8
+ import { LitElement, PropertyValues } from 'lit';
9
9
  import { Scene, SCENE_MODE } from '@hatiolab/things-scene';
10
10
  import { ComponentToolbar } from './modeller/component-toolbar/component-toolbar';
11
11
  import { EditToolbar } from './modeller/edit-toolbar';
@@ -31,6 +31,7 @@ export declare class BoardModeller extends BoardModeller_base {
31
31
  fonts: any[];
32
32
  propertyEditor: any[];
33
33
  private editToolbar;
34
+ private viewer;
34
35
  private group;
35
36
  private shortcutHandler?;
36
37
  constructor();
@@ -42,6 +43,7 @@ export declare class BoardModeller extends BoardModeller_base {
42
43
  render(): import("lit-html").TemplateResult<1>;
43
44
  connectedCallback(): void;
44
45
  disconnectedCallback(): void;
46
+ updated(changes: PropertyValues<this>): void;
45
47
  close(): void;
46
48
  onShortcut(e: KeyboardEvent): void;
47
49
  preview(): void;
@@ -172,6 +172,7 @@ let BoardModeller = class BoardModeller extends ScopedElementsMixin(LitElement)
172
172
  <ox-scene-layer type="decotag-layer"></ox-scene-layer>
173
173
  <ox-scene-handler type="text-editor"></ox-scene-handler>
174
174
  <ox-scene-handler type="move-handler"></ox-scene-handler>
175
+ <ox-scene-handler type="paste-handler"></ox-scene-handler>
175
176
  </ox-scene-viewer>
176
177
 
177
178
  <mwc-fab icon="save" @click=${() => this.onTapSave()} title="save"> </mwc-fab>
@@ -196,6 +197,33 @@ let BoardModeller = class BoardModeller extends ScopedElementsMixin(LitElement)
196
197
  super.disconnectedCallback();
197
198
  this.unbindShortcutEvent();
198
199
  }
200
+ updated(changes) {
201
+ var _a, _b, _c, _d;
202
+ if (changes.has('scene')) {
203
+ const old = changes.get('scene');
204
+ if (old) {
205
+ old.off('stylepastestart');
206
+ old.off('stylepastestop');
207
+ old.off('databindpastestart');
208
+ old.off('databindpastestop');
209
+ }
210
+ const scene = this.scene;
211
+ if (scene) {
212
+ (_a = this.scene) === null || _a === void 0 ? void 0 : _a.on('stylepastestart', () => {
213
+ this.viewer.style.cursor = 'cell';
214
+ });
215
+ (_b = this.scene) === null || _b === void 0 ? void 0 : _b.on('stylepastestop', () => {
216
+ this.viewer.style.cursor = 'default';
217
+ });
218
+ (_c = this.scene) === null || _c === void 0 ? void 0 : _c.on('databindpastestart', () => {
219
+ this.viewer.style.cursor = 'context-menu';
220
+ });
221
+ (_d = this.scene) === null || _d === void 0 ? void 0 : _d.on('databindpastestop', () => {
222
+ this.viewer.style.cursor = 'default';
223
+ });
224
+ }
225
+ }
226
+ }
199
227
  close() {
200
228
  this.model = null;
201
229
  this.requestUpdate();
@@ -375,6 +403,9 @@ __decorate([
375
403
  __decorate([
376
404
  query('edit-toolbar')
377
405
  ], BoardModeller.prototype, "editToolbar", void 0);
406
+ __decorate([
407
+ query('ox-scene-viewer')
408
+ ], BoardModeller.prototype, "viewer", void 0);
378
409
  BoardModeller = __decorate([
379
410
  customElement('ox-board-modeller')
380
411
  ], BoardModeller);
@@ -1 +1 @@
1
- {"version":3,"file":"ox-board-modeller.js","sourceRoot":"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EF;CACF,AAvEY,CAuEZ;AAoC2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAuB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAkB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAqB;AACrB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAAqB;AACnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAmC;AAClC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAqB;AACnB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAA8B;AAC9B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAqB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAc;AACd;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;yDAA+B;AAC9B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;4CAAkB;AACjB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAA2B;AAEtB;IAA9B,KAAK,CAAC,cAAc,CAAC;kDAAkC;AAzH7C,aAAa;IADzB,aAAa,CAAC,mBAAmB,CAAC;GACtB,aAAa,CAkVzB","sourcesContent":["import '@material/mwc-fab'\nimport '@hatiolab/things-scene'\nimport './modeller/scene-viewer/ox-scene-handler.js'\nimport './modeller/scene-viewer/ox-scene-layer.js'\nimport './modeller/scene-viewer/ox-scene-property.js'\nimport './modeller/scene-viewer/ox-scene-viewer.js'\nimport './ox-board-viewer'\n\nimport { saveAs } from 'file-saver'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { Scene, SCENE_MODE } from '@hatiolab/things-scene'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { OxPopup } from '@operato/popup'\nimport { isMacOS, togglefullscreen } from '@operato/utils'\n\nimport { ComponentToolbar } from './modeller/component-toolbar/component-toolbar'\nimport { EditToolbar } from './modeller/edit-toolbar'\nimport { PropertySidebar } from './modeller/property-sidebar/property-sidebar'\nimport { ComponentGroup, ComponentTemplate } from './types'\n\nconst MACOS = isMacOS()\n\nconst ICON_PROPERTIES = new URL('../../icons/icon-properties.png', import.meta.url).href\nconst ICON_PROPERTIES_LINE_TYPE = new URL('../../icons/icon-properties-line-type.png', import.meta.url).href\nconst ICON_PROPERTIES_ARROW_TYPE = new URL('../../icons/icon-properties-arrow-type.png', import.meta.url).href\nconst ICON_PROPERTIES_LABEL = new URL('../../icons/icon-properties-label.png', import.meta.url).href\nconst ICON_PROPERTIES_PADDING = new URL('../../icons/icon-properties-padding.png', import.meta.url).href\n\nconst ICON_HTOOLBAR = new URL('../../icons/icon-htoolbar.png', import.meta.url).href\nconst ICON_FULLSCREEN = new URL('../../icons/icon-fullscreen.png', import.meta.url).href\nconst ICON_COLLAPSE = new URL('../../icons/icon-collapse.png', import.meta.url).href\nconst ICON_COLLAPSE_ACTIVE = new URL('../../icons/icon-collapse-active.png', import.meta.url).href\n\nconst ICON_SHELL_INSPECTOR = new URL('../../icons/icon-shell-inspector.png', import.meta.url).href\n\nvar Registry: ComponentGroup[] = []\n\n@customElement('ox-board-modeller')\nexport class BoardModeller extends ScopedElementsMixin(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n height: 100%;\n overflow: hidden;\n }\n\n edit-toolbar {\n flex: 45px;\n max-height: 45px;\n }\n\n div[content] {\n flex: 1;\n max-height: calc(100% - 45px);\n\n display: flex;\n flex-direction: row;\n }\n\n component-toolbar {\n max-height: 100%;\n }\n\n property-sidebar {\n overflow: hidden;\n }\n\n #scene-wrap {\n position: relative;\n\n flex: 1;\n display: flex;\n flex-direction: row;\n }\n\n ox-scene-viewer {\n flex: 1;\n width: 100%;\n height: 100%;\n }\n\n mwc-fab {\n position: absolute;\n right: 15px;\n bottom: 15px;\n }\n\n ox-popup {\n width: 90%;\n height: 90%;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n background: var(--secondary-color, black);\n\n display: flex;\n justify-content: center;\n flex-direction: column;\n }\n\n ox-board-viewer {\n width: 98%;\n height: 98%;\n margin: auto;\n padding: 0;\n }\n `\n ]\n\n static registerGroup(group: ComponentGroup) {\n var found = Registry.find(inRegisterGroup => inRegisterGroup.name == group.name)\n\n if (found) {\n found = {\n ...found,\n ...group\n }\n } else {\n Registry.push(group)\n }\n }\n\n static registerTemplate(templates: ComponentTemplate[]): void {\n templates &&\n templates.forEach(template => {\n var groups: string[] = typeof template.group == 'string' ? [template.group] : template.group\n\n Registry.filter(group => groups.includes(group.name)).forEach(group => {\n if (!group.templates.find(inGroupTemplate => inGroupTemplate.type == template.type)) {\n group.templates.push(template)\n }\n })\n })\n }\n\n static get groups(): ComponentGroup[] {\n return Registry\n }\n\n static getGroup(name: string) {\n return Registry.find(group => group.name === name)\n }\n\n @property({ type: String }) boardName: string = ''\n @property({ type: Object }) model: any = null\n @property({ type: String }) baseUrl: string = ''\n @property({ type: Array }) selected: any[] = []\n @property({ type: Number }) mode: SCENE_MODE = SCENE_MODE.EDIT\n @property({ type: Object }) provider: any = null\n @property({ type: Boolean }) hideProperty: boolean = false\n @property({ type: String }) overlay: string = ''\n @property({ type: Object }) scene?: Scene\n @property({ type: Array }) componentGroupList: any[] = []\n @property({ type: Array }) fonts: any[] = []\n @property({ type: Array }) propertyEditor: any[] = []\n\n @query('edit-toolbar') private editToolbar!: EditToolbar\n\n private group: string = ''\n private shortcutHandler?: (e: KeyboardEvent) => void\n\n constructor() {\n super()\n\n document.addEventListener('get-all-scene-component-ids', (e: Event) => {\n var { component, callback } = (e as CustomEvent).detail\n\n if (!this.scene) return\n\n var ids\n if (component) {\n ids = this.scene.findAll(component).map(c => c.model.id)\n } else {\n // @ts-ignore\n ids = this.scene.ids.map(({ key }) => key)\n }\n\n ids = ids.filter(Boolean).sort()\n callback(ids)\n })\n\n this.style.setProperty('--url-icon-properties', `url(${ICON_PROPERTIES})`)\n this.style.setProperty('--url-icon-properties-label', `url(${ICON_PROPERTIES_LABEL})`)\n this.style.setProperty('--url-icon-properties-padding', `url(${ICON_PROPERTIES_PADDING})`)\n this.style.setProperty('--url-icon-properties-line-type', `url(${ICON_PROPERTIES_LINE_TYPE})`)\n this.style.setProperty('--url-icon-properties-arrow-type', `url(${ICON_PROPERTIES_ARROW_TYPE})`)\n\n this.style.setProperty('--url-icon-htoolbar', `url(${ICON_HTOOLBAR})`)\n this.style.setProperty('--url-icon-fullscreen', `url(${ICON_FULLSCREEN})`)\n this.style.setProperty('--url-icon-collapse', `url(${ICON_COLLAPSE})`)\n this.style.setProperty('--url-icon-collapse-active', `url(${ICON_COLLAPSE_ACTIVE})`)\n\n this.style.setProperty('--url-icon-shell-inspector', `url(${ICON_SHELL_INSPECTOR})`)\n }\n\n static get scopedElements() {\n return {\n 'edit-toolbar': EditToolbar,\n 'property-sidebar': PropertySidebar,\n 'component-toolbar': ComponentToolbar\n }\n }\n\n render() {\n return html`\n <edit-toolbar\n .scene=${this.scene}\n .selected=${this.selected}\n @hide-property-changed=${(e: CustomEvent) => (this.hideProperty = e.detail.value)}\n @open-preview=${() => this.preview()}\n @download-model=${() => this.downloadModel()}\n @modeller-fullscreen=${() => togglefullscreen(this)}\n >\n ${this.renderBrandingZone()}\n </edit-toolbar>\n\n <div content>\n <component-toolbar\n .scene=${this.scene}\n .mode=${this.mode}\n @mode-changed=${(e: CustomEvent) => {\n this.mode = e.detail.value\n }}\n .componentGroupList=${this.componentGroupList}\n .group=${this.group}\n >\n </component-toolbar>\n\n <div id=\"scene-wrap\">\n <ox-scene-viewer\n id=\"scene\"\n .scene=${this.scene}\n @scene-changed=${(e: CustomEvent) => {\n this.scene = e.detail.value\n }}\n .model=${this.model}\n .selected=${this.selected}\n @selected-changed=${(e: CustomEvent) => {\n this.selected = e.detail.value\n }}\n .mode=${this.mode}\n @mode-changed=${(e: CustomEvent) => {\n this.mode = e.detail.value\n }}\n fit=\"ratio\"\n .baseUrl=${this.baseUrl}\n @contextmenu=${() => this.onContextMenu()}\n .provider=${this.provider}\n name=\"modeller\"\n >\n <ox-scene-layer type=\"selection-layer\"></ox-scene-layer>\n <ox-scene-layer type=\"modeling-layer\"></ox-scene-layer>\n <ox-scene-layer type=\"add-layer\"> </ox-scene-layer>\n <ox-scene-layer type=\"guide-layer\">\n <ox-scene-property name=\"ruler\" value=\"disabled\"></ox-scene-property>\n </ox-scene-layer>\n <ox-scene-layer type=\"shift-layer\">\n <ox-scene-property name=\"text\" value=\"${this.overlay}\"></ox-scene-property>\n <ox-scene-property name=\"alpha\" value=\"0.3\"></ox-scene-property>\n <ox-scene-property name=\"fontFamily\" value=\"arial\"></ox-scene-property>\n <ox-scene-property name=\"fontSize\" value=\"30\" type=\"number\"></ox-scene-property>\n <ox-scene-property name=\"fontColor\" value=\"navy\"></ox-scene-property>\n <ox-scene-property name=\"textBaseline\" value=\"top\"></ox-scene-property>\n <ox-scene-property name=\"textAlign\" value=\"left\"></ox-scene-property>\n <ox-scene-property name=\"paddingTop\" value=\"50\" type=\"number\"></ox-scene-property>\n <ox-scene-property name=\"paddingLeft\" value=\"50\" type=\"number\"></ox-scene-property>\n </ox-scene-layer>\n <ox-scene-layer type=\"decotag-layer\"></ox-scene-layer>\n <ox-scene-handler type=\"text-editor\"></ox-scene-handler>\n <ox-scene-handler type=\"move-handler\"></ox-scene-handler>\n </ox-scene-viewer>\n\n <mwc-fab icon=\"save\" @click=${() => this.onTapSave()} title=\"save\"> </mwc-fab>\n </div>\n\n <property-sidebar\n .scene=${this.scene}\n .selected=${this.selected}\n .collapsed=${this.hideProperty}\n .fonts=${this.fonts}\n .propertyEditor=${this.propertyEditor}\n >\n </property-sidebar>\n </div>\n `\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n this.bindShortcutEvent()\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n this.unbindShortcutEvent()\n }\n\n close() {\n this.model = null\n this.requestUpdate()\n }\n\n onShortcut(e: KeyboardEvent) {\n if (MACOS) var ctrlKey = e.metaKey\n else var ctrlKey = e.ctrlKey\n\n switch (e.code) {\n case 'KeyS':\n if (ctrlKey) {\n this.onTapSave()\n e.preventDefault()\n }\n break\n }\n }\n\n preview() {\n const board = {\n id: 'preview',\n model: this.scene?.model ? JSON.parse(JSON.stringify(this.scene.model)) : null\n }\n\n OxPopup.open({\n template: html` <ox-board-viewer .provider=${this.provider} .board=${board}></ox-board-viewer> `,\n parent: this.renderRoot as Element\n })\n\n requestAnimationFrame(() => {\n dispatchEvent(new Event('resize'))\n })\n }\n\n downloadModel() {\n if (!this.scene) return\n\n var model = JSON.stringify(this.model, null, 2)\n var filename = (this.boardName || 'NONAME') + '-' + Date.now() + '.json'\n saveAs(new Blob([model], { type: 'application/octet-stream' }), filename)\n }\n\n renderBrandingZone() {\n return html``\n }\n\n onTapSave() {\n this.dispatchEvent(new CustomEvent('save-model', { bubbles: true, composed: true, detail: { model: this.model } }))\n }\n\n bindShortcutEvent() {\n // TODO: Global Hotkey에 대한 정의를 edit-toolbar에서 가져올 수 있도록 수정해야 함.\n const GLOBAL_HOTKEYS = ['Digit1', 'Digit2', 'F11', 'KeyD', 'KeyP', 'KeyS']\n\n this.shortcutHandler = (e: KeyboardEvent) => {\n const target = e.composedPath()[0] as HTMLElement\n var tagName = target.tagName\n var isInput = target.isContentEditable || tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA'\n var isGlobalHotkey = GLOBAL_HOTKEYS.includes(e.code)\n\n if (!isGlobalHotkey && isInput) return\n if (!this.editToolbar.onShortcut(e)) this.onShortcut(e)\n }\n\n document.addEventListener('keydown', this.shortcutHandler)\n }\n\n unbindShortcutEvent() {\n if (this.shortcutHandler) {\n document.removeEventListener('keydown', this.shortcutHandler)\n delete this.shortcutHandler\n }\n }\n\n onContextMenu() {}\n}\n"]}
1
+ {"version":3,"file":"ox-board-modeller.js","sourceRoot":"","sources":["../../src/ox-board-modeller.ts"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,CAAA;AAC1B,OAAO,wBAAwB,CAAA;AAC/B,OAAO,6CAA6C,CAAA;AACpD,OAAO,2CAA2C,CAAA;AAClD,OAAO,8CAA8C,CAAA;AACrD,OAAO,4CAA4C,CAAA;AACnD,OAAO,mBAAmB,CAAA;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAS,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAA;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAA;AAI9E,MAAM,KAAK,GAAG,OAAO,EAAE,CAAA;AAEvB,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,iCAAiC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AACxF,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC,2CAA2C,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CA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er.js'\nimport './modeller/scene-viewer/ox-scene-property.js'\nimport './modeller/scene-viewer/ox-scene-viewer.js'\nimport './ox-board-viewer'\n\nimport { saveAs } from 'file-saver'\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { Scene, SCENE_MODE } from '@hatiolab/things-scene'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { OxPopup } from '@operato/popup'\nimport { isMacOS, togglefullscreen } from '@operato/utils'\n\nimport { ComponentToolbar } from './modeller/component-toolbar/component-toolbar'\nimport { EditToolbar } from './modeller/edit-toolbar'\nimport { PropertySidebar } from './modeller/property-sidebar/property-sidebar'\nimport { ComponentGroup, ComponentTemplate } from './types'\nimport OxSceneViewer from './modeller/scene-viewer/ox-scene-viewer.js'\n\nconst MACOS = isMacOS()\n\nconst ICON_PROPERTIES = new URL('../../icons/icon-properties.png', import.meta.url).href\nconst ICON_PROPERTIES_LINE_TYPE = new URL('../../icons/icon-properties-line-type.png', import.meta.url).href\nconst ICON_PROPERTIES_ARROW_TYPE = new URL('../../icons/icon-properties-arrow-type.png', import.meta.url).href\nconst ICON_PROPERTIES_LABEL = new URL('../../icons/icon-properties-label.png', import.meta.url).href\nconst ICON_PROPERTIES_PADDING = new URL('../../icons/icon-properties-padding.png', import.meta.url).href\n\nconst ICON_HTOOLBAR = new URL('../../icons/icon-htoolbar.png', import.meta.url).href\nconst ICON_FULLSCREEN = new URL('../../icons/icon-fullscreen.png', import.meta.url).href\nconst ICON_COLLAPSE = new URL('../../icons/icon-collapse.png', import.meta.url).href\nconst ICON_COLLAPSE_ACTIVE = new URL('../../icons/icon-collapse-active.png', import.meta.url).href\n\nconst ICON_SHELL_INSPECTOR = new URL('../../icons/icon-shell-inspector.png', import.meta.url).href\n\nvar Registry: ComponentGroup[] = []\n\n@customElement('ox-board-modeller')\nexport class BoardModeller extends ScopedElementsMixin(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n height: 100%;\n overflow: hidden;\n }\n\n edit-toolbar {\n flex: 45px;\n max-height: 45px;\n }\n\n div[content] {\n flex: 1;\n max-height: calc(100% - 45px);\n\n display: flex;\n flex-direction: row;\n }\n\n component-toolbar {\n max-height: 100%;\n }\n\n property-sidebar {\n overflow: hidden;\n }\n\n #scene-wrap {\n position: relative;\n\n flex: 1;\n display: flex;\n flex-direction: row;\n }\n\n ox-scene-viewer {\n flex: 1;\n width: 100%;\n height: 100%;\n }\n\n mwc-fab {\n position: absolute;\n right: 15px;\n bottom: 15px;\n }\n\n ox-popup {\n width: 90%;\n height: 90%;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n background: var(--secondary-color, black);\n\n display: flex;\n justify-content: center;\n flex-direction: column;\n }\n\n ox-board-viewer {\n width: 98%;\n height: 98%;\n margin: auto;\n padding: 0;\n }\n `\n ]\n\n static registerGroup(group: ComponentGroup) {\n var found = Registry.find(inRegisterGroup => inRegisterGroup.name == group.name)\n\n if (found) {\n found = {\n ...found,\n ...group\n }\n } else {\n Registry.push(group)\n }\n }\n\n static registerTemplate(templates: ComponentTemplate[]): void {\n templates &&\n templates.forEach(template => {\n var groups: string[] = typeof template.group == 'string' ? [template.group] : template.group\n\n Registry.filter(group => groups.includes(group.name)).forEach(group => {\n if (!group.templates.find(inGroupTemplate => inGroupTemplate.type == template.type)) {\n group.templates.push(template)\n }\n })\n })\n }\n\n static get groups(): ComponentGroup[] {\n return Registry\n }\n\n static getGroup(name: string) {\n return Registry.find(group => group.name === name)\n }\n\n @property({ type: String }) boardName: string = ''\n @property({ type: Object }) model: any = null\n @property({ type: String }) baseUrl: string = ''\n @property({ type: Array }) selected: any[] = []\n @property({ type: Number }) mode: SCENE_MODE = SCENE_MODE.EDIT\n @property({ type: Object }) provider: any = null\n @property({ type: Boolean }) hideProperty: boolean = false\n @property({ type: String }) overlay: string = ''\n @property({ type: Object }) scene?: Scene\n @property({ type: Array }) componentGroupList: any[] = []\n @property({ type: Array }) fonts: any[] = []\n @property({ type: Array }) propertyEditor: any[] = []\n\n @query('edit-toolbar') private editToolbar!: EditToolbar\n @query('ox-scene-viewer') private viewer!: OxSceneViewer\n\n private group: string = ''\n private shortcutHandler?: (e: KeyboardEvent) => void\n\n constructor() {\n super()\n\n document.addEventListener('get-all-scene-component-ids', (e: Event) => {\n var { component, callback } = (e as CustomEvent).detail\n\n if (!this.scene) return\n\n var ids\n if (component) {\n ids = this.scene.findAll(component).map(c => c.model.id)\n } else {\n // @ts-ignore\n ids = this.scene.ids.map(({ key }) => key)\n }\n\n ids = ids.filter(Boolean).sort()\n callback(ids)\n })\n\n this.style.setProperty('--url-icon-properties', `url(${ICON_PROPERTIES})`)\n this.style.setProperty('--url-icon-properties-label', `url(${ICON_PROPERTIES_LABEL})`)\n this.style.setProperty('--url-icon-properties-padding', `url(${ICON_PROPERTIES_PADDING})`)\n this.style.setProperty('--url-icon-properties-line-type', `url(${ICON_PROPERTIES_LINE_TYPE})`)\n this.style.setProperty('--url-icon-properties-arrow-type', `url(${ICON_PROPERTIES_ARROW_TYPE})`)\n\n this.style.setProperty('--url-icon-htoolbar', `url(${ICON_HTOOLBAR})`)\n this.style.setProperty('--url-icon-fullscreen', `url(${ICON_FULLSCREEN})`)\n this.style.setProperty('--url-icon-collapse', `url(${ICON_COLLAPSE})`)\n this.style.setProperty('--url-icon-collapse-active', `url(${ICON_COLLAPSE_ACTIVE})`)\n\n this.style.setProperty('--url-icon-shell-inspector', `url(${ICON_SHELL_INSPECTOR})`)\n }\n\n static get scopedElements() {\n return {\n 'edit-toolbar': EditToolbar,\n 'property-sidebar': PropertySidebar,\n 'component-toolbar': ComponentToolbar\n }\n }\n\n render() {\n return html`\n <edit-toolbar\n .scene=${this.scene}\n .selected=${this.selected}\n @hide-property-changed=${(e: CustomEvent) => (this.hideProperty = e.detail.value)}\n @open-preview=${() => this.preview()}\n @download-model=${() => this.downloadModel()}\n @modeller-fullscreen=${() => togglefullscreen(this)}\n >\n ${this.renderBrandingZone()}\n </edit-toolbar>\n\n <div content>\n <component-toolbar\n .scene=${this.scene}\n .mode=${this.mode}\n @mode-changed=${(e: CustomEvent) => {\n this.mode = e.detail.value\n }}\n .componentGroupList=${this.componentGroupList}\n .group=${this.group}\n >\n </component-toolbar>\n\n <div id=\"scene-wrap\">\n <ox-scene-viewer\n id=\"scene\"\n .scene=${this.scene}\n @scene-changed=${(e: CustomEvent) => {\n this.scene = e.detail.value\n }}\n .model=${this.model}\n .selected=${this.selected}\n @selected-changed=${(e: CustomEvent) => {\n this.selected = e.detail.value\n }}\n .mode=${this.mode}\n @mode-changed=${(e: CustomEvent) => {\n this.mode = e.detail.value\n }}\n fit=\"ratio\"\n .baseUrl=${this.baseUrl}\n @contextmenu=${() => this.onContextMenu()}\n .provider=${this.provider}\n name=\"modeller\"\n >\n <ox-scene-layer type=\"selection-layer\"></ox-scene-layer>\n <ox-scene-layer type=\"modeling-layer\"></ox-scene-layer>\n <ox-scene-layer type=\"add-layer\"> </ox-scene-layer>\n <ox-scene-layer type=\"guide-layer\">\n <ox-scene-property name=\"ruler\" value=\"disabled\"></ox-scene-property>\n </ox-scene-layer>\n <ox-scene-layer type=\"shift-layer\">\n <ox-scene-property name=\"text\" value=\"${this.overlay}\"></ox-scene-property>\n <ox-scene-property name=\"alpha\" value=\"0.3\"></ox-scene-property>\n <ox-scene-property name=\"fontFamily\" value=\"arial\"></ox-scene-property>\n <ox-scene-property name=\"fontSize\" value=\"30\" type=\"number\"></ox-scene-property>\n <ox-scene-property name=\"fontColor\" value=\"navy\"></ox-scene-property>\n <ox-scene-property name=\"textBaseline\" value=\"top\"></ox-scene-property>\n <ox-scene-property name=\"textAlign\" value=\"left\"></ox-scene-property>\n <ox-scene-property name=\"paddingTop\" value=\"50\" type=\"number\"></ox-scene-property>\n <ox-scene-property name=\"paddingLeft\" value=\"50\" type=\"number\"></ox-scene-property>\n </ox-scene-layer>\n <ox-scene-layer type=\"decotag-layer\"></ox-scene-layer>\n <ox-scene-handler type=\"text-editor\"></ox-scene-handler>\n <ox-scene-handler type=\"move-handler\"></ox-scene-handler>\n <ox-scene-handler type=\"paste-handler\"></ox-scene-handler>\n </ox-scene-viewer>\n\n <mwc-fab icon=\"save\" @click=${() => this.onTapSave()} title=\"save\"> </mwc-fab>\n </div>\n\n <property-sidebar\n .scene=${this.scene}\n .selected=${this.selected}\n .collapsed=${this.hideProperty}\n .fonts=${this.fonts}\n .propertyEditor=${this.propertyEditor}\n >\n </property-sidebar>\n </div>\n `\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n this.bindShortcutEvent()\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n this.unbindShortcutEvent()\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('scene')) {\n const old = changes.get('scene')\n\n if (old) {\n old.off('stylepastestart')\n old.off('stylepastestop')\n old.off('databindpastestart')\n old.off('databindpastestop')\n }\n\n const scene = this.scene\n if (scene) {\n this.scene?.on('stylepastestart', () => {\n this.viewer.style.cursor = 'cell'\n })\n this.scene?.on('stylepastestop', () => {\n this.viewer.style.cursor = 'default'\n })\n this.scene?.on('databindpastestart', () => {\n this.viewer.style.cursor = 'context-menu'\n })\n this.scene?.on('databindpastestop', () => {\n this.viewer.style.cursor = 'default'\n })\n }\n }\n }\n\n close() {\n this.model = null\n this.requestUpdate()\n }\n\n onShortcut(e: KeyboardEvent) {\n if (MACOS) var ctrlKey = e.metaKey\n else var ctrlKey = e.ctrlKey\n\n switch (e.code) {\n case 'KeyS':\n if (ctrlKey) {\n this.onTapSave()\n e.preventDefault()\n }\n break\n }\n }\n\n preview() {\n const board = {\n id: 'preview',\n model: this.scene?.model ? JSON.parse(JSON.stringify(this.scene.model)) : null\n }\n\n OxPopup.open({\n template: html` <ox-board-viewer .provider=${this.provider} .board=${board}></ox-board-viewer> `,\n parent: this.renderRoot as Element\n })\n\n requestAnimationFrame(() => {\n dispatchEvent(new Event('resize'))\n })\n }\n\n downloadModel() {\n if (!this.scene) return\n\n var model = JSON.stringify(this.model, null, 2)\n var filename = (this.boardName || 'NONAME') + '-' + Date.now() + '.json'\n saveAs(new Blob([model], { type: 'application/octet-stream' }), filename)\n }\n\n renderBrandingZone() {\n return html``\n }\n\n onTapSave() {\n this.dispatchEvent(new CustomEvent('save-model', { bubbles: true, composed: true, detail: { model: this.model } }))\n }\n\n bindShortcutEvent() {\n // TODO: Global Hotkey에 대한 정의를 edit-toolbar에서 가져올 수 있도록 수정해야 함.\n const GLOBAL_HOTKEYS = ['Digit1', 'Digit2', 'F11', 'KeyD', 'KeyP', 'KeyS']\n\n this.shortcutHandler = (e: KeyboardEvent) => {\n const target = e.composedPath()[0] as HTMLElement\n var tagName = target.tagName\n var isInput = target.isContentEditable || tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA'\n var isGlobalHotkey = GLOBAL_HOTKEYS.includes(e.code)\n\n if (!isGlobalHotkey && isInput) return\n if (!this.editToolbar.onShortcut(e)) this.onShortcut(e)\n }\n\n document.addEventListener('keydown', this.shortcutHandler)\n }\n\n unbindShortcutEvent() {\n if (this.shortcutHandler) {\n document.removeEventListener('keydown', this.shortcutHandler)\n delete this.shortcutHandler\n }\n }\n\n onContextMenu() {}\n}\n"]}
@@ -207,7 +207,7 @@ let BoardViewer = class BoardViewer extends LitElement {
207
207
  var _a;
208
208
  const id = (_a = (await fetchPlayGroupByName(playGroupName))) === null || _a === void 0 ? void 0 : _a.id;
209
209
  const queryString = bindingData ? new URLSearchParams(bindingData).toString() : '';
210
- history.pushState({}, '', `board-player?${queryString}`);
210
+ history.pushState({}, '', `board-player/${id}?${queryString}`);
211
211
  window.dispatchEvent(new Event('popstate'));
212
212
  }
213
213
  bindSceneEvents() {