@operato/board 10.29.90 → 10.29.93

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.
@@ -4,6 +4,7 @@ export interface FigureBlueprintsAnswer {
4
4
  type: string;
5
5
  ref: string;
6
6
  asset: unknown;
7
+ jointsChecked?: boolean;
7
8
  }[];
8
9
  refused: {
9
10
  type: string;
@@ -27,9 +28,13 @@ export declare const fetchFigureBlueprints: BlueprintsFetch;
27
28
  * `fetch` is a seam for tests — the default one talks to the server.
28
29
  */
29
30
  export declare function createFigureResolver(fetch?: BlueprintsFetch): (types: readonly string[]) => Promise<Refusals | undefined>;
30
- /** Registers one figure under the name the board asked. Anything but a figure asset is refused by name. */
31
+ /**
32
+ * Registers one figure under the name the board asked. Anything but a figure asset is refused by name. The server's word
33
+ * that its joints were checked goes with it, so the scene does not write them all again (figure-model ADR-0215).
34
+ */
31
35
  export declare function registerFigurePayload(type: string, payload: {
32
36
  asset?: unknown;
37
+ jointsChecked?: boolean;
33
38
  }): void;
34
39
  /**
35
40
  * Takes the seat. The package entry (`index.ts`) calls this, so an app that has `@operato/board`
@@ -55,12 +55,15 @@ export function createFigureResolver(fetch = fetchFigureBlueprints) {
55
55
  return { refused };
56
56
  };
57
57
  }
58
- /** Registers one figure under the name the board asked. Anything but a figure asset is refused by name. */
58
+ /**
59
+ * Registers one figure under the name the board asked. Anything but a figure asset is refused by name. The server's word
60
+ * that its joints were checked goes with it, so the scene does not write them all again (figure-model ADR-0215).
61
+ */
59
62
  export function registerFigurePayload(type, payload) {
60
63
  if (!(payload === null || payload === void 0 ? void 0 : payload.asset) || typeof payload.asset !== 'object') {
61
64
  throw new Error(`not a figure asset: ${type}`);
62
65
  }
63
- registerFigure(type, payload.asset);
66
+ registerFigure(type, payload.asset, { jointsChecked: payload.jointsChecked === true });
64
67
  }
65
68
  /**
66
69
  * Takes the seat. The package entry (`index.ts`) calls this, so an app that has `@operato/board`
package/dist/src/index.js CHANGED
@@ -26,8 +26,8 @@ import { installFigureResolver } from './figure-provider.js';
26
26
  export const uninstallFigureResolver = installFigureResolver();
27
27
  import { installScenePresenters } from './scene-presenters.js';
28
28
  /*
29
- The same declaration for how a scene asks and lists actions: the framework's prompt and popup menu instead of the
30
- browser's confirm and the scene's plain list.
29
+ The same declaration for how a scene asks before an action that cannot be undone: the framework's prompt instead of
30
+ the browser's confirm. The actions menu is the scene's own.
31
31
  */
32
32
  export const uninstallScenePresenters = installScenePresenters();
33
33
  //# sourceMappingURL=index.js.map
@@ -1,17 +1,12 @@
1
- import { type SceneActionConfirm, type SceneMenuPresenter } from '@hatiolab/things-scene';
2
- /**
3
- * A scene's actions menu (ADR-0209 amendment 1, decision 8): the actions a component's capabilities list, at the point
4
- * pressed, in the user's language. It is drawn as the scene's own popups are (`ox-scene-action-menu`, the summary's dark
5
- * card) -- the application's drop-down looked foreign over a board. Picking one runs it; its confirm asks first.
6
- */
7
- export declare const popupMenuPresenter: SceneMenuPresenter;
1
+ import { type SceneActionConfirm } from '@hatiolab/things-scene';
8
2
  /**
9
3
  * The question an action that cannot be undone asks before it runs (ADR-0209 decision 3), as the framework's prompt
10
- * rather than the browser's confirm. Its words are the action's own; yes runs it.
4
+ * rather than the browser's confirm. Its words are the action's own; yes runs it. The actions menu is the scene's own
5
+ * card (things-scene `sceneMenu`), in the page's language, so this package does not draw one.
11
6
  */
12
7
  export declare const promptConfirm: SceneActionConfirm;
13
8
  /**
14
- * Takes the scene's seats for asking and for the actions menu. Having this package is the declaration, as for the
15
- * figure resolver; the returned function gives both seats back.
9
+ * Takes the scene's seat for asking. Having this package is the declaration, as for the figure resolver; the returned
10
+ * function gives the seat back.
16
11
  */
17
12
  export declare function installScenePresenters(): () => void;
@@ -1,21 +1,10 @@
1
- import { sceneText, setSceneActionConfirm, setSceneMenuPresenter } from '@hatiolab/things-scene';
1
+ import { setSceneActionConfirm } from '@hatiolab/things-scene';
2
2
  import { i18next } from '@operato/i18n';
3
3
  import { OxPrompt } from '@operato/popup';
4
- import { OxSceneActionMenu } from './ox-scene-action-menu.js';
5
- /**
6
- * A scene's actions menu (ADR-0209 amendment 1, decision 8): the actions a component's capabilities list, at the point
7
- * pressed, in the user's language. It is drawn as the scene's own popups are (`ox-scene-action-menu`, the summary's dark
8
- * card) -- the application's drop-down looked foreign over a board. Picking one runs it; its confirm asks first.
9
- */
10
- export const popupMenuPresenter = (items, { x, y }) => {
11
- if (!items.length)
12
- return;
13
- const lang = i18next.language;
14
- OxSceneActionMenu.open(items.map(item => ({ text: sceneText(item.label, lang) || item.text, action: item.action, run: () => item.run() })), x, y);
15
- };
16
4
  /**
17
5
  * The question an action that cannot be undone asks before it runs (ADR-0209 decision 3), as the framework's prompt
18
- * rather than the browser's confirm. Its words are the action's own; yes runs it.
6
+ * rather than the browser's confirm. Its words are the action's own; yes runs it. The actions menu is the scene's own
7
+ * card (things-scene `sceneMenu`), in the page's language, so this package does not draw one.
19
8
  */
20
9
  export const promptConfirm = async (message) => !!(await OxPrompt.open({
21
10
  type: 'warning',
@@ -24,14 +13,12 @@ export const promptConfirm = async (message) => !!(await OxPrompt.open({
24
13
  cancelButton: { text: i18next.t('button.cancel', { defaultValue: 'cancel' }) }
25
14
  }));
26
15
  /**
27
- * Takes the scene's seats for asking and for the actions menu. Having this package is the declaration, as for the
28
- * figure resolver; the returned function gives both seats back.
16
+ * Takes the scene's seat for asking. Having this package is the declaration, as for the figure resolver; the returned
17
+ * function gives the seat back.
29
18
  */
30
19
  export function installScenePresenters() {
31
- const beforeMenu = setSceneMenuPresenter(popupMenuPresenter);
32
20
  const beforeConfirm = setSceneActionConfirm(promptConfirm);
33
21
  return () => {
34
- setSceneMenuPresenter(beforeMenu);
35
22
  setSceneActionConfirm(beforeConfirm);
36
23
  };
37
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@operato/board",
3
- "version": "10.29.90",
3
+ "version": "10.29.93",
4
4
  "description": "Webcomponent for board following open-wc recommendations",
5
5
  "author": "heartyoh",
6
6
  "type": "module",
@@ -152,7 +152,7 @@
152
152
  "@operato/markdown": "^10.29.83",
153
153
  "@operato/popup": "^10.29.85",
154
154
  "@operato/property-editor": "^10.29.90",
155
- "@operato/property-panel": "^10.29.90",
155
+ "@operato/property-panel": "^10.29.92",
156
156
  "@operato/styles": "^10.29.83",
157
157
  "@operato/utils": "^10.29.85",
158
158
  "@types/file-saver": "^2.0.4",
@@ -165,6 +165,7 @@
165
165
  },
166
166
  "devDependencies": {
167
167
  "@custom-elements-manifest/analyzer": "^0.10.0",
168
+ "@hatiolab/figure-model": "^0.12.20",
168
169
  "@hatiolab/prettier-config": "^1.0.0",
169
170
  "@hatiolab/things-scene": "^10.1.123",
170
171
  "@open-wc/eslint-config": "^12.0.3",
@@ -202,5 +203,5 @@
202
203
  "prettier --write"
203
204
  ]
204
205
  },
205
- "gitHead": "354953417c0c6fefa2ed68da4fcfd276d95ba605"
206
+ "gitHead": "88ca21118763ca3b8cf42cd9eb9809bfc1c03051"
206
207
  }