@operato/board 1.4.72 → 1.4.74

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.72",
3
+ "version": "1.4.74",
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": "ee307b4f77ec06edeb64bba9bb31e5e7ef14f81b"
151
+ "gitHead": "efb08a7edf07c1a1a2a87135436168f1c9065cc0"
152
152
  }
@@ -171,6 +171,10 @@ export const style = css`
171
171
  background-position-y: -1142px;
172
172
  }
173
173
 
174
+ #databind-copy {
175
+ background-position-y: -692px;
176
+ }
177
+
174
178
  #context-menu {
175
179
  background-position-y: -692px;
176
180
  }
@@ -280,10 +280,10 @@ export class EditToolbar extends LitElement {
280
280
  if (ctrlKey && !shiftKey) this.onTapRedo()
281
281
  break
282
282
  case 'Digit1':
283
- if (altKey) this.onStartStylePasteMode()
283
+ if (ctrlKey) this.onStartStylePasteMode()
284
284
  break
285
285
  case 'Digit2':
286
- if (altKey) this.onStartDatabindPasteMode()
286
+ if (ctrlKey) this.onStartDatabindPasteMode()
287
287
  break
288
288
  case 'KeyC':
289
289
  if (ctrlKey && !shiftKey) this.onTapCopy()
@@ -234,12 +234,22 @@ export default class OxSceneViewer extends LitElement {
234
234
  this._setMode(after)
235
235
  }
236
236
 
237
- if (after === 2) {
238
- this.style.cursor = 'all-scroll'
239
- } else if (after === 3) {
240
- this.style.cursor = 'crosshair'
241
- } else {
242
- this.style.cursor = 'default'
237
+ switch (after) {
238
+ case 1:
239
+ this.style.cursor = 'default'
240
+ break
241
+ case 2:
242
+ this.style.cursor = 'all-scroll'
243
+ break
244
+ case 3:
245
+ this.style.cursor = 'crosshair'
246
+ break
247
+ case 4:
248
+ this.style.cursor = 'copy'
249
+ break
250
+ case 5:
251
+ this.style.cursor = 'context-menu'
252
+ break
243
253
  }
244
254
  }
245
255
 
@@ -299,6 +299,11 @@ export class BoardModeller extends ScopedElementsMixin(LitElement) {
299
299
  }
300
300
 
301
301
  disconnectedCallback(): void {
302
+ if (this.scene) {
303
+ this.scene.stopStylePasteMode()
304
+ this.scene.stopDatabindPasteMode()
305
+ }
306
+
302
307
  super.disconnectedCallback()
303
308
  this.unbindShortcutEvent()
304
309
  }
@@ -306,28 +311,9 @@ export class BoardModeller extends ScopedElementsMixin(LitElement) {
306
311
  updated(changes: PropertyValues<this>) {
307
312
  if (changes.has('scene')) {
308
313
  const old = changes.get('scene')
309
-
310
314
  if (old) {
311
- old.off('stylepastestart')
312
- old.off('stylepastestop')
313
- old.off('databindpastestart')
314
- old.off('databindpastestop')
315
- }
316
-
317
- const scene = this.scene
318
- if (scene) {
319
- this.scene?.on('stylepastestart', () => {
320
- this.viewer.style.cursor = 'cell'
321
- })
322
- this.scene?.on('stylepastestop', () => {
323
- this.viewer.style.cursor = 'default'
324
- })
325
- this.scene?.on('databindpastestart', () => {
326
- this.viewer.style.cursor = 'context-menu'
327
- })
328
- this.scene?.on('databindpastestop', () => {
329
- this.viewer.style.cursor = 'default'
330
- })
315
+ old.stopStylePasteMode()
316
+ old.stopDatabindPasteMode()
331
317
  }
332
318
  }
333
319
  }