@operato/board 10.29.9 → 10.29.10
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 +9 -0
- package/coverage/lcov-report/index.html +55 -10
- package/coverage/lcov.info +4284 -335
- package/dist/src/modeller/component-toolbar/component-menu.js +62 -11
- package/dist/src/modeller/component-toolbar/component-menu.js.map +1 -1
- package/dist/src/types.d.ts +8 -0
- package/dist/src/types.js.map +1 -1
- package/dist/test/component-menu.test.d.ts +1 -0
- package/dist/test/component-menu.test.js +61 -0
- package/dist/test/component-menu.test.js.map +1 -0
- package/dist/test/figure-provider.test.js +8 -2
- package/dist/test/figure-provider.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/test/component-menu.test.ts +69 -0
- package/test/figure-provider.test.ts +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operato/board",
|
|
3
|
-
"version": "10.29.
|
|
3
|
+
"version": "10.29.10",
|
|
4
4
|
"description": "Webcomponent for board following open-wc recommendations",
|
|
5
5
|
"author": "heartyoh",
|
|
6
6
|
"type": "module",
|
|
@@ -180,5 +180,5 @@
|
|
|
180
180
|
"prettier --write"
|
|
181
181
|
]
|
|
182
182
|
},
|
|
183
|
-
"gitHead": "
|
|
183
|
+
"gitHead": "d9e090a2bbdaa75eff2e8864f1557fbfbc814733"
|
|
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
|
-
{
|
|
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', '
|
|
53
|
+
args: ['zero', 'zero', 'zero', 'a0', 'a0', 'a0'],
|
|
48
54
|
outputs: { pose: 'body.p' },
|
|
49
55
|
params: { from: 'body.local', to: 'asset' }
|
|
50
56
|
},
|