@formicoidea/labre-framework-cynefin 0.31.0 → 0.33.0
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/actions.d.ts +4 -0
- package/dist/actions.js +73 -0
- package/dist/commands.d.ts +4 -0
- package/dist/commands.js +46 -0
- package/dist/cynefin/consts.js +49 -13
- package/dist/cynefin/element-renderer.js +4 -1
- package/dist/cynefin/toolbar/config.js +49 -4
- package/dist/descriptor.d.ts +9 -4
- package/dist/descriptor.js +7 -4
- package/dist/estuarine/consts.d.ts +10 -3
- package/dist/estuarine/consts.js +41 -8
- package/dist/estuarine/element-renderer.d.ts +108 -2
- package/dist/estuarine/element-renderer.js +146 -43
- package/dist/estuarine/ghost-overlay.d.ts +134 -0
- package/dist/estuarine/ghost-overlay.js +277 -0
- package/dist/estuarine/nudges.d.ts +41 -0
- package/dist/estuarine/nudges.js +69 -0
- package/dist/estuarine/roles.d.ts +48 -0
- package/dist/estuarine/roles.js +28 -0
- package/dist/estuarine/toolbar/config.js +59 -5
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/templates/index.js +18 -2
- package/dist/toolbar/menu.d.ts +6 -12
- package/dist/toolbar/menu.js +6 -114
- package/dist/toolbar/senior-button.js +4 -1
- package/dist/toolbar/senior-tool.js +1 -0
- package/dist/translations.d.ts +19 -0
- package/dist/translations.js +22 -0
- package/dist/view.d.ts +15 -0
- package/dist/view.js +82 -8
- package/package.json +4 -3
package/dist/view.js
CHANGED
|
@@ -1,14 +1,67 @@
|
|
|
1
|
+
import { QualityNudgeExtension, ValidationFrameworkExtension, validationToolbarConfig, } from '@formicoidea/labre-core/blocks/surface';
|
|
1
2
|
import { ViewExtensionProvider, } from '@formicoidea/labre-core/ext-loader';
|
|
2
3
|
import { extendTemplateCategory } from '@formicoidea/labre-core/gfx/template';
|
|
4
|
+
import { ToolbarModuleExtension } from '@formicoidea/labre-core/shared/services';
|
|
5
|
+
import { BlockFlavourIdentifier, CommandExtension } from '@formicoidea/labre-core/std';
|
|
6
|
+
import { RoleVocabularyExtension } from '@formicoidea/labre-core/std/gfx';
|
|
7
|
+
import { cynefinEstuarineCommandIcons, cynefinEstuarineCommands, } from './commands.js';
|
|
3
8
|
import { CynefinRendererExtension } from './cynefin/element-renderer.js';
|
|
4
9
|
import { CynefinInteraction, CynefinView } from './cynefin/element-view.js';
|
|
5
10
|
import { cynefinToolbarExtension } from './cynefin/toolbar/config.js';
|
|
6
11
|
import { effects } from './effects.js';
|
|
7
12
|
import { EstuarineRendererExtension } from './estuarine/element-renderer.js';
|
|
8
13
|
import { EstuarineInteraction, EstuarineView } from './estuarine/element-view.js';
|
|
14
|
+
import { EstuarineGhostManager, EstuarineGhostOverlay, } from './estuarine/ghost-overlay.js';
|
|
15
|
+
import { ESTUARINE_NUDGES } from './estuarine/nudges.js';
|
|
16
|
+
import { ESTUARINE_ROLE, ESTUARINE_ROLES } from './estuarine/roles.js';
|
|
9
17
|
import { estuarineToolbarExtension } from './estuarine/toolbar/config.js';
|
|
10
18
|
import { cynefinTemplateCategory, estuarineTemplateCategory, } from './templates/index.js';
|
|
11
19
|
import { cynefinEstuarineSeniorTool } from './toolbar/senior-tool.js';
|
|
20
|
+
/**
|
|
21
|
+
* Cynefin / Estuarine rendering — ALWAYS registered, independent of any flag.
|
|
22
|
+
* Disabling `cynefin-estuarine` hides only the creation tooling (see
|
|
23
|
+
* {@link CynefinEstuarineViewExtension}); frames already drawn must still
|
|
24
|
+
* paint, stay selectable, stay editable and keep their contextual toolbar. See
|
|
25
|
+
* `docs/adr/0009`.
|
|
26
|
+
*/
|
|
27
|
+
export class CynefinEstuarineRenderViewExtension extends ViewExtensionProvider {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
this.name = 'affine-cynefin-estuarine-render-gfx';
|
|
31
|
+
}
|
|
32
|
+
setup(context) {
|
|
33
|
+
super.setup(context);
|
|
34
|
+
context.register(CynefinView);
|
|
35
|
+
context.register(CynefinRendererExtension);
|
|
36
|
+
context.register(EstuarineView);
|
|
37
|
+
context.register(EstuarineRendererExtension);
|
|
38
|
+
// The role VOCABULARY, always on. A role is written in the document, not in
|
|
39
|
+
// the tooling: a map drawn while the flag was on and opened while it is off
|
|
40
|
+
// still carries `estuarine:map`, and anything that READS a role — the
|
|
41
|
+
// qualification toolbar, a host panel — has to keep working
|
|
42
|
+
// (`docs/adr/0009`). What JUDGES those roles stays flag-gated below.
|
|
43
|
+
// Cynefin contributes nothing here and never will (`estuarine/roles.ts`).
|
|
44
|
+
context.register(RoleVocabularyExtension(ESTUARINE_ROLES));
|
|
45
|
+
if (this.isEdgeless(context.scope)) {
|
|
46
|
+
context.register(CynefinInteraction);
|
|
47
|
+
context.register(EstuarineInteraction);
|
|
48
|
+
context.register(cynefinToolbarExtension);
|
|
49
|
+
context.register(estuarineToolbarExtension);
|
|
50
|
+
// The reveal animation of a curve toggle. ALWAYS on, with the renderer
|
|
51
|
+
// it animates: the permanent ghost is how a shown curve looks now, so
|
|
52
|
+
// the ~600 ms that makes its arrival visible is part of painting the
|
|
53
|
+
// element, not part of the creation tooling. It writes nothing, and it
|
|
54
|
+
// costs one media query plus one map lookup on a board with no
|
|
55
|
+
// Estuarine map at all.
|
|
56
|
+
context.register(EstuarineGhostOverlay);
|
|
57
|
+
context.register(EstuarineGhostManager);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Cynefin / Estuarine creation tooling — flag-gated (`cynefin-estuarine`): the
|
|
63
|
+
* senior toolbar button and both templates categories.
|
|
64
|
+
*/
|
|
12
65
|
export class CynefinEstuarineViewExtension extends ViewExtensionProvider {
|
|
13
66
|
constructor() {
|
|
14
67
|
super(...arguments);
|
|
@@ -16,22 +69,43 @@ export class CynefinEstuarineViewExtension extends ViewExtensionProvider {
|
|
|
16
69
|
}
|
|
17
70
|
effect() {
|
|
18
71
|
super.effect();
|
|
72
|
+
// Defines the senior button and its menu — tooling-only custom elements.
|
|
19
73
|
effects();
|
|
20
74
|
extendTemplateCategory(cynefinTemplateCategory);
|
|
21
75
|
extendTemplateCategory(estuarineTemplateCategory);
|
|
22
76
|
}
|
|
23
77
|
setup(context) {
|
|
24
78
|
super.setup(context);
|
|
25
|
-
context.register(CynefinView);
|
|
26
|
-
context.register(CynefinRendererExtension);
|
|
27
|
-
context.register(EstuarineView);
|
|
28
|
-
context.register(EstuarineRendererExtension);
|
|
29
79
|
if (this.isEdgeless(context.scope)) {
|
|
30
|
-
|
|
31
|
-
|
|
80
|
+
// Estuarine's ROOT INSTANCE declaration (WS0.3). Every other framework
|
|
81
|
+
// derives "this element is my frame" from a rule naming the role as its
|
|
82
|
+
// background; Estuarine ships no rule at all — by arbitration, not by
|
|
83
|
+
// omission (see `estuarine/nudges.ts`) — so it says so explicitly rather
|
|
84
|
+
// than inventing a rule that fires on nothing just to open a gate.
|
|
85
|
+
context.register(ValidationFrameworkExtension([
|
|
86
|
+
{
|
|
87
|
+
framework: 'estuarine',
|
|
88
|
+
backgroundRole: ESTUARINE_ROLE.map,
|
|
89
|
+
roles: ESTUARINE_ROLES,
|
|
90
|
+
},
|
|
91
|
+
]));
|
|
92
|
+
// Map quality: the four expectations no algorithm can check. This is the
|
|
93
|
+
// whole of what validation offers on an Estuarine map — no rules, and
|
|
94
|
+
// therefore NO profiles: a severity dial over an empty rule set is a
|
|
95
|
+
// control that decides nothing.
|
|
96
|
+
context.register(QualityNudgeExtension(ESTUARINE_NUDGES));
|
|
97
|
+
// The Validation dropdown on a selected map's contextual toolbar — a
|
|
98
|
+
// SECOND module on the same element, through the free `custom:` flavour
|
|
99
|
+
// slot (`estuarineToolbarExtension` owns the plain one and is always-on,
|
|
100
|
+
// because a stored map must keep its curve toggles). The config names no
|
|
101
|
+
// framework: it reads roles, profiles and nudges, so here it renders the
|
|
102
|
+
// checklist entry and no profile picker.
|
|
103
|
+
context.register(ToolbarModuleExtension({
|
|
104
|
+
id: BlockFlavourIdentifier('custom:affine:surface:estuarine'),
|
|
105
|
+
config: validationToolbarConfig,
|
|
106
|
+
}));
|
|
32
107
|
context.register(cynefinEstuarineSeniorTool);
|
|
33
|
-
context.register(
|
|
34
|
-
context.register(estuarineToolbarExtension);
|
|
108
|
+
context.register(CommandExtension(cynefinEstuarineCommands, cynefinEstuarineCommandIcons));
|
|
35
109
|
}
|
|
36
110
|
}
|
|
37
111
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formicoidea/labre-framework-cynefin",
|
|
3
|
-
"description": "Labre cynefin framework for @formicoidea/labre-core.",
|
|
4
|
-
"version": "0.
|
|
3
|
+
"description": "Labre cynefin-estuarine framework for @formicoidea/labre-core.",
|
|
4
|
+
"version": "0.33.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"author": "lajola",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@formicoidea/labre-core": "0.
|
|
30
|
+
"@formicoidea/labre-core": "0.33.0",
|
|
31
|
+
"@preact/signals-core": "^1.8.0",
|
|
31
32
|
"lit": "^3.2.0"
|
|
32
33
|
}
|
|
33
34
|
}
|