@operato/board 1.0.0-beta.4 → 1.0.0-beta.7

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.0.0-beta.4",
3
+ "version": "1.0.0-beta.7",
4
4
  "description": "Webcomponent for board following open-wc recommendations",
5
5
  "author": "heartyoh",
6
6
  "license": "MIT",
@@ -49,17 +49,17 @@
49
49
  "storybook:build": "tsc && npm run analyze -- --exclude dist && build-storybook"
50
50
  },
51
51
  "dependencies": {
52
- "@operato/app": "^1.0.0-beta.4",
53
- "@operato/data-grist": "^1.0.0-beta.4",
54
- "@operato/font": "^1.0.0-beta.4",
55
- "@operato/graphql": "^1.0.0-beta.4",
56
- "@operato/i18n": "^1.0.0-beta.4",
57
- "@operato/input": "^1.0.0-beta.4",
58
- "@operato/markdown": "^1.0.0-beta.4",
59
- "@operato/popup": "^1.0.0-beta.4",
60
- "@operato/property-editor": "^1.0.0-beta.4",
61
- "@operato/styles": "^1.0.0-beta.4",
62
- "@operato/utils": "^1.0.0-beta.4",
52
+ "@operato/app": "^1.0.0-beta.7",
53
+ "@operato/data-grist": "^1.0.0-beta.7",
54
+ "@operato/font": "^1.0.0-beta.7",
55
+ "@operato/graphql": "^1.0.0-beta.7",
56
+ "@operato/i18n": "^1.0.0-beta.7",
57
+ "@operato/input": "^1.0.0-beta.7",
58
+ "@operato/markdown": "^1.0.0-beta.7",
59
+ "@operato/popup": "^1.0.0-beta.7",
60
+ "@operato/property-editor": "^1.0.0-beta.7",
61
+ "@operato/styles": "^1.0.0-beta.7",
62
+ "@operato/utils": "^1.0.0-beta.7",
63
63
  "@polymer/paper-dropdown-menu": "^3.2.0",
64
64
  "@types/file-saver": "^2.0.4",
65
65
  "@types/sortablejs": "^1.10.7",
@@ -71,7 +71,7 @@
71
71
  "devDependencies": {
72
72
  "@custom-elements-manifest/analyzer": "^0.4.17",
73
73
  "@hatiolab/prettier-config": "^1.0.0",
74
- "@hatiolab/things-scene": "^2.8.1",
74
+ "@hatiolab/things-scene": "^3.0.5",
75
75
  "@material/mwc-fab": "^0.25.3",
76
76
  "@material/mwc-icon": "^0.25.3",
77
77
  "@open-wc/eslint-config": "^4.3.0",
@@ -107,5 +107,5 @@
107
107
  "prettier --write"
108
108
  ]
109
109
  },
110
- "gitHead": "08201dc8c015c0d6ccceb846907dd9950363a553"
110
+ "gitHead": "feabccbb32d6d8487d761e5c9f1d21a22ab1c34a"
111
111
  }
@@ -4,14 +4,13 @@
4
4
 
5
5
  import './component-detail'
6
6
 
7
- import { css, html, LitElement, PropertyValues } from 'lit'
7
+ import { LitElement, PropertyValues, css, html } from 'lit'
8
+ import { Pallet, PalletItem } from '../../types'
8
9
  import { customElement, property, query, state } from 'lit/decorators.js'
9
10
 
10
11
  import { Scene } from '@hatiolab/things-scene'
11
12
  import { ScrollbarStyles } from '@operato/styles'
12
13
 
13
- import { Pallet, PalletItem } from '../../types'
14
-
15
14
  const noImage = new URL('../../../../icons/components/no-image.png', import.meta.url).href
16
15
 
17
16
  @customElement('component-menu')
@@ -177,7 +176,7 @@ class ComponentMenu extends LitElement {
177
176
 
178
177
  if (this.scene) {
179
178
  this.template = this.templates.find(template => template.type == type)
180
- this.template && this.scene.add(JSON.parse(JSON.stringify(this.template.model)), { cx: 200, cy: 200 })
179
+ this.template && this.scene.startAddMode(JSON.parse(JSON.stringify(this.template.model)))
181
180
  }
182
181
 
183
182
  this.group = null
@@ -98,7 +98,7 @@ class ComponentToolbar extends LitElement {
98
98
 
99
99
  render() {
100
100
  const componentList = this.componentGroupList || []
101
- const modeIcon = this.icons[this.mode === SCENE_MODE.EDIT ? 'mode-edit' : 'mode-shift']
101
+ const modeIcon = this.icons[this.mode === SCENE_MODE.SHIFT ? 'mode-shift' : 'mode-edit']
102
102
 
103
103
  return html`
104
104
  <img id="shift" .src=${modeIcon} @click=${(e: MouseEvent) => this._onClickShift(e)} />
@@ -6,7 +6,7 @@ import { html, LitElement, PropertyValues } from 'lit'
6
6
  import { customElement, property, query, queryAll } from 'lit/decorators.js'
7
7
 
8
8
  import { Component, Scene } from '@hatiolab/things-scene'
9
- import { isMacOS } from '@operato/utils'
9
+ import { copyToClipboard, isMacOS } from '@operato/utils'
10
10
 
11
11
  import { style } from './edit-toolbar-style'
12
12
 
@@ -461,12 +461,12 @@ export class EditToolbar extends LitElement {
461
461
  this.scene?.cut()
462
462
  }
463
463
 
464
- onTapCopy() {
464
+ async onTapCopy() {
465
465
  var copied = this.scene?.copy()
466
466
 
467
467
  if (!copied) return
468
468
 
469
- navigator.clipboard.writeText(copied)
469
+ await copyToClipboard(copied)
470
470
  this.cliped = copied
471
471
  }
472
472
 
@@ -233,6 +233,8 @@ export default class OxSceneViewer extends LitElement {
233
233
 
234
234
  if (after === 2) {
235
235
  this.style.cursor = 'all-scroll'
236
+ } else if (after === 3) {
237
+ this.style.cursor = 'crosshair'
236
238
  } else {
237
239
  this.style.cursor = 'default'
238
240
  }
@@ -241,6 +241,7 @@ export class BoardModeller extends LitElement {
241
241
  >
242
242
  <ox-scene-layer type="selection-layer"></ox-scene-layer>
243
243
  <ox-scene-layer type="modeling-layer"></ox-scene-layer>
244
+ <ox-scene-layer type="add-layer"> </ox-scene-layer>
244
245
  <ox-scene-layer type="guide-layer">
245
246
  <ox-scene-property name="ruler" value="disabled"></ox-scene-property>
246
247
  </ox-scene-layer>