@operato/board 10.29.47 → 10.29.49

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.47",
3
+ "version": "10.29.49",
4
4
  "description": "Webcomponent for board following open-wc recommendations",
5
5
  "author": "heartyoh",
6
6
  "type": "module",
@@ -39,6 +39,8 @@
39
39
  "./bulk-create.js": "./dist/src/modeller/bulk-create.js",
40
40
  "./bulk-create-dialog.js": "./dist/src/modeller/bulk-create-dialog.js",
41
41
  "./board-provider.js": "./dist/src/board-provider.js",
42
+ "./figure-provider.js": "./dist/src/figure-provider.js",
43
+ "./new-board-model.js": "./dist/src/new-board-model.js",
42
44
  "./board-placement-palette.js": "./dist/src/board-placement-palette.js"
43
45
  },
44
46
  "typesVersions": {
@@ -100,6 +102,12 @@
100
102
  "board-provider.js": [
101
103
  "dist/src/board-provider.d.ts"
102
104
  ],
105
+ "figure-provider.js": [
106
+ "dist/src/figure-provider.d.ts"
107
+ ],
108
+ "new-board-model.js": [
109
+ "dist/src/new-board-model.d.ts"
110
+ ],
103
111
  "board-placement-palette.js": [
104
112
  "dist/src/board-placement-palette.d.ts"
105
113
  ]
@@ -120,19 +128,19 @@
120
128
  "dependencies": {
121
129
  "@material/web": "^2.0.0",
122
130
  "@open-wc/scoped-elements": "^2.1.3",
123
- "@operato/app": "^10.29.47",
124
- "@operato/data-grist": "^10.29.47",
125
- "@operato/font": "^10.29.47",
126
- "@operato/graphql": "^10.29.44",
131
+ "@operato/app": "^10.29.49",
132
+ "@operato/data-grist": "^10.29.49",
133
+ "@operato/font": "^10.29.49",
134
+ "@operato/graphql": "^10.29.49",
127
135
  "@operato/i18n": "^10.29.27",
128
- "@operato/input": "^10.29.44",
129
- "@operato/layout": "^10.29.46",
136
+ "@operato/input": "^10.29.49",
137
+ "@operato/layout": "^10.29.49",
130
138
  "@operato/markdown": "^10.29.30",
131
- "@operato/popup": "^10.29.44",
132
- "@operato/property-editor": "^10.29.47",
133
- "@operato/property-panel": "^10.29.47",
139
+ "@operato/popup": "^10.29.49",
140
+ "@operato/property-editor": "^10.29.49",
141
+ "@operato/property-panel": "^10.29.49",
134
142
  "@operato/styles": "^10.29.30",
135
- "@operato/utils": "^10.29.44",
143
+ "@operato/utils": "^10.29.49",
136
144
  "@types/file-saver": "^2.0.4",
137
145
  "@types/sortablejs": "^1.10.7",
138
146
  "dexie": "^3.2.2",
@@ -144,7 +152,7 @@
144
152
  "devDependencies": {
145
153
  "@custom-elements-manifest/analyzer": "^0.10.0",
146
154
  "@hatiolab/prettier-config": "^1.0.0",
147
- "@hatiolab/things-scene": "^10.1.74",
155
+ "@hatiolab/things-scene": "^10.1.99",
148
156
  "@open-wc/eslint-config": "^12.0.3",
149
157
  "@open-wc/testing": "^4.0.0",
150
158
  "@rollup/plugin-image": "^3.0.3",
@@ -180,5 +188,5 @@
180
188
  "prettier --write"
181
189
  ]
182
190
  },
183
- "gitHead": "e87ad8932190922da8d24fd5cb6f6cd9c8219ab9"
191
+ "gitHead": "38fba85b1fa1bc1438086973dfe9ec9f6ec53879"
184
192
  }
@@ -0,0 +1,23 @@
1
+ import { expect } from '@open-wc/testing'
2
+
3
+ import { newBoardModel } from '../src/new-board-model.js'
4
+
5
+ /**
6
+ * A blank board is one coordinate to one real cm, shown in cm (ADR-0144 2.3), in every app that makes one: operato-board
7
+ * and fmsim call this. An app chooses the board's size and look; it cannot choose another scale.
8
+ */
9
+ describe('a blank board', () => {
10
+ it('is 800 × 600, one coordinate one cm, shown in cm', () => {
11
+ expect(newBoardModel()).to.deep.equal({ width: 800, height: 600, mmPerUnit: 10, displayUnit: 'cm' })
12
+ })
13
+
14
+ it('takes the size and look an app gives it, and keeps the scale', () => {
15
+ expect(newBoardModel({ width: 1600, height: 1200, fillStyle: 'white', mmPerUnit: 1, displayUnit: 'mm' })).to.deep.equal({
16
+ width: 1600,
17
+ height: 1200,
18
+ fillStyle: 'white',
19
+ mmPerUnit: 10,
20
+ displayUnit: 'cm'
21
+ })
22
+ })
23
+ })
@@ -4,7 +4,7 @@ import { executeServerCommand } from '@web/test-runner-commands'
4
4
 
5
5
  import { registerTypeResolver, resetFigures } from '@hatiolab/things-scene'
6
6
 
7
- import { createResolvedScene } from '../src/resolved-scene.js'
7
+ import { createResolvedScene, useItemTypes } from '../src/resolved-scene.js'
8
8
  import '../src/ox-board-preview.js'
9
9
 
10
10
  /**
@@ -112,3 +112,27 @@ describe('기다리는 동안 화면이 바뀌면 늦게 온 씬은 들어서지
112
112
  expect(element._scene!.root.components.length).to.equal(2)
113
113
  })
114
114
  })
115
+
116
+ describe('아이템 타입 표를 쓰는 앱의 씬은 열 때 표를 받는다 (ADR-0155)', () => {
117
+ afterEach(() => useItemTypes(null))
118
+
119
+ it('앱이 준 공급자가 답한 표를 씬의 루트가 갖는다. 열 때마다 묻는다', async () => {
120
+ let asked = 0
121
+ useItemTypes(async () => {
122
+ asked++
123
+ return { types: [{ code: 'REEL', size: { width: 760, length: 840, height: 840 } }] }
124
+ })
125
+ const first = await createResolvedScene({ model: KNOWN_MODEL })
126
+ const second = await createResolvedScene({ model: KNOWN_MODEL })
127
+ expect((first as any).rootContainer.itemTypes.types.has('REEL')).to.equal(true)
128
+ expect(asked).to.equal(2)
129
+ first?.dispose()
130
+ second?.dispose()
131
+ })
132
+
133
+ it('공급자를 주지 않은 앱의 씬은 표가 없다', async () => {
134
+ const scene = await createResolvedScene({ model: KNOWN_MODEL })
135
+ expect((scene as any).rootContainer.itemTypes).to.equal(undefined)
136
+ scene?.dispose()
137
+ })
138
+ })