@operato/board 10.29.90 → 10.29.92
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/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
|
|
30
|
-
browser's confirm
|
|
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
|
|
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
|
|
15
|
-
*
|
|
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 {
|
|
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
|
|
28
|
-
*
|
|
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.
|
|
3
|
+
"version": "10.29.92",
|
|
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.
|
|
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",
|
|
@@ -202,5 +202,5 @@
|
|
|
202
202
|
"prettier --write"
|
|
203
203
|
]
|
|
204
204
|
},
|
|
205
|
-
"gitHead": "
|
|
205
|
+
"gitHead": "70ab0f0b03aebb9e14c37e5216bd1116961786c8"
|
|
206
206
|
}
|