@operato/board 10.29.9 → 10.29.11

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": "10.29.9",
3
+ "version": "10.29.11",
4
4
  "description": "Webcomponent for board following open-wc recommendations",
5
5
  "author": "heartyoh",
6
6
  "type": "module",
@@ -120,17 +120,17 @@
120
120
  "dependencies": {
121
121
  "@material/web": "^2.0.0",
122
122
  "@open-wc/scoped-elements": "^2.1.3",
123
- "@operato/app": "^10.29.9",
123
+ "@operato/app": "^10.29.11",
124
124
  "@operato/data-grist": "^10.29.9",
125
- "@operato/font": "^10.29.9",
125
+ "@operato/font": "^10.29.11",
126
126
  "@operato/graphql": "^10.29.5",
127
127
  "@operato/i18n": "^10.29.1",
128
128
  "@operato/input": "^10.29.9",
129
129
  "@operato/layout": "^10.29.9",
130
130
  "@operato/markdown": "^10.29.9",
131
131
  "@operato/popup": "^10.29.9",
132
- "@operato/property-editor": "^10.29.9",
133
- "@operato/property-panel": "^10.29.9",
132
+ "@operato/property-editor": "^10.29.11",
133
+ "@operato/property-panel": "^10.29.11",
134
134
  "@operato/styles": "^10.29.9",
135
135
  "@operato/utils": "^10.29.1",
136
136
  "@types/file-saver": "^2.0.4",
@@ -180,5 +180,5 @@
180
180
  "prettier --write"
181
181
  ]
182
182
  },
183
- "gitHead": "24e4809ab0168eef48792291f72b11f75d8179ad"
183
+ "gitHead": "55be77be55c0aaba85dd0d8878acb0ab3d1baef3"
184
184
  }
@@ -0,0 +1,69 @@
1
+ import { expect, fixture, html } from '@open-wc/testing'
2
+
3
+ import { ComponentMenu } from '../src/modeller/component-toolbar/component-menu.js'
4
+
5
+ /**
6
+ * A tray template that cannot be placed here (ADR-0114 P7): shown dimmed with its mark, its reason on hover, and
7
+ * nothing happens when it is picked -- no add mode, no image drag.
8
+ */
9
+ customElements.get('test-component-menu') || customElements.define('test-component-menu', class extends ComponentMenu {})
10
+
11
+ const group = {
12
+ name: 'figure',
13
+ templates: [
14
+ { type: 'hatiolab.com/ok', description: 'OK figure', icon: '', group: 'figure', model: { type: 'hatiolab.com/ok' } },
15
+ {
16
+ type: 'hatiolab.com/future',
17
+ description: 'Future figure',
18
+ icon: '',
19
+ group: 'figure',
20
+ model: { type: 'hatiolab.com/future' },
21
+ unavailableReason: 'this server cannot read figure-asset-9',
22
+ unavailableLabel: 'format unsupported'
23
+ }
24
+ ]
25
+ }
26
+
27
+ async function menuWith(added: unknown[]) {
28
+ const scene = { rootContainer: { trigger: () => {} }, startAddMode: (model: unknown) => added.push(model) }
29
+ const menu = (await fixture(html`<test-component-menu .groups=${[group]} .scene=${scene as never}></test-component-menu>`)) as ComponentMenu
30
+ menu.group = 'figure'
31
+ await menu.updateComplete
32
+ return menu
33
+ }
34
+
35
+ const itemOf = (menu: ComponentMenu, type: string) => menu.renderRoot.querySelector(`[data-type="${type}"]`) as HTMLElement
36
+
37
+ describe('트레이 — 놓을 수 없는 템플릿', () => {
38
+ it('흐리게 · 표 · 사유를 가진다, 아이콘은 끌리지 않는다', async () => {
39
+ const menu = await menuWith([])
40
+ const item = itemOf(menu, 'hatiolab.com/future')
41
+ expect(item.hasAttribute('unavailable')).to.equal(true)
42
+ expect(item.getAttribute('aria-disabled')).to.equal('true')
43
+ expect(item.getAttribute('title')).to.equal('this server cannot read figure-asset-9')
44
+ expect(item.querySelector('[mark]')!.textContent).to.equal('format unsupported')
45
+ expect(item.querySelector('[reason]')!.textContent).to.equal('this server cannot read figure-asset-9')
46
+ expect(item.querySelector('img')!.getAttribute('draggable')).to.equal('false')
47
+ expect(getComputedStyle(item).opacity).to.equal('0.5')
48
+ })
49
+
50
+ it('★ 고르면 아무 일도 없다 — 놓을 수 있는 것은 추가 모드에 들어간다', async () => {
51
+ const added: unknown[] = []
52
+ const menu = await menuWith(added)
53
+
54
+ itemOf(menu, 'hatiolab.com/future').click()
55
+ expect(added).to.deep.equal([])
56
+
57
+ menu.group = 'figure'
58
+ await menu.updateComplete
59
+ itemOf(menu, 'hatiolab.com/ok').click()
60
+ expect(added).to.deep.equal([{ type: 'hatiolab.com/ok' }])
61
+ })
62
+
63
+ it('놓을 수 있는 템플릿에는 표 · 사유가 없다', async () => {
64
+ const menu = await menuWith([])
65
+ const item = itemOf(menu, 'hatiolab.com/ok')
66
+ expect(item.hasAttribute('unavailable')).to.equal(false)
67
+ expect(item.querySelector('[mark]')).to.equal(null)
68
+ })
69
+ })
@@ -40,11 +40,17 @@ const figureAssetOf = (type: string) => ({
40
40
  { id: 'a0', unit: 'deg', value: 0 }
41
41
  ],
42
42
  nodes: [
43
- { id: 'body.shape', op: 'box-shape@1', args: ['w', 'w', 'w'], outputs: { shape: 'body.s' }, params: { frame: 'body.local' } },
43
+ {
44
+ id: 'body.shape',
45
+ op: 'extrude@1',
46
+ args: ['zero', 'w', 'w', 'w'],
47
+ outputs: { shape: 'body.s' },
48
+ params: { frame: 'body.local', axis: 'y', section: 'rectangle' }
49
+ },
44
50
  {
45
51
  id: 'body.pose',
46
52
  op: 'rigid@1',
47
- args: ['zero', 'half', 'zero', 'a0', 'a0', 'a0'],
53
+ args: ['zero', 'zero', 'zero', 'a0', 'a0', 'a0'],
48
54
  outputs: { pose: 'body.p' },
49
55
  params: { from: 'body.local', to: 'asset' }
50
56
  },