@operato/board 1.4.42 → 1.4.44

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@operato/board",
3
- "version": "1.4.42",
3
+ "version": "1.4.44",
4
4
  "description": "Webcomponent for board following open-wc recommendations",
5
5
  "author": "heartyoh",
6
6
  "main": "dist/src/index.js",
@@ -148,5 +148,5 @@
148
148
  "prettier --write"
149
149
  ]
150
150
  },
151
- "gitHead": "3e8f072f9711f2a72892a757bfdd13e4057f1c69"
151
+ "gitHead": "57862126c9605a0d5369304db2eaee34ce036c6f"
152
152
  }
@@ -72,16 +72,6 @@ export class EditToolbar extends LitElement {
72
72
  .addEventListener('tap', this.onTapFontDecrease.bind(this) as EventListener)
73
73
  this.renderRoot.querySelector('#group')!.addEventListener('tap', this.onTapGroup.bind(this) as EventListener)
74
74
  this.renderRoot.querySelector('#ungroup')!.addEventListener('tap', this.onTapUngroup.bind(this) as EventListener)
75
- this.renderRoot
76
- .querySelector('#symmetry-x')!
77
- .addEventListener('tap', this.onTapSymmetryX.bind(this) as EventListener)
78
- this.renderRoot
79
- .querySelector('#symmetry-y')!
80
- .addEventListener('tap', this.onTapSymmetryY.bind(this) as EventListener)
81
- this.renderRoot.querySelector('#rotate-cw')!.addEventListener('tap', this.onTapRotateCW.bind(this) as EventListener)
82
- this.renderRoot
83
- .querySelector('#rotate-ccw')!
84
- .addEventListener('tap', this.onTapRotateCCW.bind(this) as EventListener)
85
75
  this.renderRoot
86
76
  .querySelector('#toggle-property')!
87
77
  .addEventListener('tap', this.onTapToggle.bind(this) as EventListener)
@@ -194,14 +184,6 @@ export class EditToolbar extends LitElement {
194
184
 
195
185
  <span class="vline"></span>
196
186
 
197
- <span button id="symmetry-x" title="symmetry-x (${this.getShortcutString('alt', 'shift', 'x')})"> </span>
198
- <span button id="symmetry-y" title="symmetry-y (${this.getShortcutString('alt', 'shift', 'y')})"> </span>
199
- <span button id="rotate-cw" title="rotate clockwise (${this.getShortcutString('alt', 'shift', 'e')})"> </span>
200
- <span button id="rotate-ccw" title="rotate counter clockwise (${this.getShortcutString('alt', 'shift', 'w')})">
201
- </span>
202
-
203
- <span class="vline"></span>
204
-
205
187
  <span button id="group" title="group (${this.getShortcutString('cmd', 'g')})"> </span>
206
188
  <span button id="ungroup" title="ungroup (${this.getShortcutString('cmd', 'shift', 'g')})"> </span>
207
189
 
@@ -292,7 +274,6 @@ export class EditToolbar extends LitElement {
292
274
  break
293
275
  case 'KeyY':
294
276
  if (ctrlKey && !shiftKey) this.onTapRedo()
295
- else if (altKey && shiftKey) this.onTapSymmetryY()
296
277
  break
297
278
  case 'KeyC':
298
279
  if (ctrlKey && !shiftKey) this.onTapCopy()
@@ -300,7 +281,6 @@ export class EditToolbar extends LitElement {
300
281
  break
301
282
  case 'KeyX':
302
283
  if (ctrlKey && !shiftKey) this.onTapCut()
303
- else if (altKey && shiftKey) this.onTapSymmetryX()
304
284
  break
305
285
  case 'KeyV':
306
286
  if (ctrlKey && !shiftKey) {
@@ -361,9 +341,6 @@ export class EditToolbar extends LitElement {
361
341
  case 'KeyT':
362
342
  if (altKey && shiftKey) this.onTapAlign('top')
363
343
  break
364
- case 'KeyY':
365
- if (altKey && shiftKey) this.onTapSymmetryY()
366
- break
367
344
  case 'KeyD':
368
345
  if (ctrlKey) {
369
346
  this.onTapFitScene()
@@ -371,11 +348,7 @@ export class EditToolbar extends LitElement {
371
348
  }
372
349
  break
373
350
  case 'KeyE':
374
- if (altKey && shiftKey) this.onTapRotateCW()
375
- else if (ctrlKey && shiftKey) this.onTapDownloadModel()
376
- break
377
- case 'KeyW':
378
- if (altKey && shiftKey) this.onTapRotateCCW()
351
+ if (ctrlKey && shiftKey) this.onTapDownloadModel()
379
352
  break
380
353
  case 'Digit1':
381
354
  if (ctrlKey) {
@@ -550,48 +523,6 @@ export class EditToolbar extends LitElement {
550
523
  zorder && this.scene.zorder(zorder)
551
524
  }
552
525
 
553
- onTapSymmetryX() {
554
- this.scene && this.scene.symmetryX()
555
- }
556
-
557
- onTapSymmetryY() {
558
- this.scene && this.scene.symmetryY()
559
- }
560
-
561
- onTapRotateCW() {
562
- if (!this.scene) return
563
-
564
- var selected = this.scene.selected
565
- if (selected.length && selected[0].isRootModel()) return
566
-
567
- this.scene.undoableChange(function () {
568
- selected.forEach(function (component) {
569
- var rotation = component.get('rotation')
570
-
571
- if (!rotation) rotation = 0
572
-
573
- component.set('rotation', (rotation + Math.PI / 2) % (Math.PI * 2))
574
- })
575
- })
576
- }
577
-
578
- onTapRotateCCW() {
579
- if (!this.scene) return
580
-
581
- var selected = this.scene.selected
582
- if (selected.length && selected[0].isRootModel()) return
583
-
584
- this.scene.undoableChange(function () {
585
- selected.forEach(function (component) {
586
- var rotation = component.get('rotation')
587
-
588
- if (!rotation) rotation = 0
589
-
590
- component.set('rotation', (rotation - Math.PI / 2) % (Math.PI * 2))
591
- })
592
- })
593
- }
594
-
595
526
  onTapGroup() {
596
527
  this.scene && this.scene.group()
597
528
  }
@@ -253,7 +253,7 @@ export class SceneInspector extends LitElement {
253
253
  this.toggleExtended(component)
254
254
  }
255
255
 
256
- this.selectComponent(component)
256
+ this.selectComponent(component, e.shiftKey)
257
257
  } else {
258
258
  if (classList.contains('inspector')) {
259
259
  this.show = !this.show
@@ -325,8 +325,20 @@ export class SceneInspector extends LitElement {
325
325
  this.requestUpdate()
326
326
  }
327
327
 
328
- selectComponent(component: Component) {
329
- this.scene!.selected = [component]
328
+ selectComponent(component: Component, append: boolean = false) {
329
+ const selected = this.scene!.selected
330
+
331
+ if (append) {
332
+ const idx = selected.findIndex(s => s === component)
333
+ if (idx != -1) {
334
+ selected.splice(idx, 1)
335
+ this.scene!.selected = [...selected]
336
+ } else {
337
+ this.scene!.selected = [...selected, component]
338
+ }
339
+ } else {
340
+ this.scene!.selected = [component]
341
+ }
330
342
 
331
343
  component.trigger('reactionreset')
332
344
  component.trigger('reaction')