@formicoidea/labre-framework-edgy 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 +39 -0
- package/dist/actions.js +193 -0
- package/dist/board-renderer.d.ts +12 -0
- package/dist/board-renderer.js +28 -0
- package/dist/board-view.d.ts +11 -0
- package/dist/board-view.js +20 -0
- package/dist/commands.d.ts +4 -0
- package/dist/commands.js +103 -0
- package/dist/consts.d.ts +35 -0
- package/dist/consts.js +46 -0
- package/dist/descriptor.d.ts +8 -3
- package/dist/descriptor.js +6 -3
- package/dist/element-renderer.js +24 -13
- package/dist/element-view.js +9 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/label-layout.js +8 -2
- package/dist/legend.d.ts +2 -0
- package/dist/legend.js +109 -0
- package/dist/metamodel.d.ts +96 -0
- package/dist/metamodel.js +128 -0
- package/dist/nudges.d.ts +26 -0
- package/dist/nudges.js +54 -0
- package/dist/profiles.d.ts +2 -0
- package/dist/profiles.js +66 -0
- package/dist/relation-resolver.d.ts +32 -0
- package/dist/relation-resolver.js +101 -0
- package/dist/relation.d.ts +142 -0
- package/dist/relation.js +188 -0
- package/dist/roles.d.ts +108 -0
- package/dist/roles.js +182 -0
- package/dist/rules.d.ts +43 -0
- package/dist/rules.js +153 -0
- package/dist/templates/index.d.ts +22 -1
- package/dist/templates/index.js +303 -52
- package/dist/toolbar/config.d.ts +33 -0
- package/dist/toolbar/config.js +82 -15
- package/dist/toolbar/edgy-menu.d.ts +7 -25
- package/dist/toolbar/edgy-menu.js +7 -186
- package/dist/toolbar/edgy-senior-button.js +8 -2
- package/dist/toolbar/icons.d.ts +12 -0
- package/dist/toolbar/icons.js +31 -0
- package/dist/toolbar/senior-tool.js +1 -0
- package/dist/translations.d.ts +24 -0
- package/dist/translations.js +29 -0
- package/dist/view.d.ts +18 -0
- package/dist/view.js +95 -8
- package/package.json +6 -3
package/dist/view.js
CHANGED
|
@@ -1,14 +1,72 @@
|
|
|
1
|
+
import { QualityNudgeExtension, SpotlightHostExtension, ValidationProfileExtension, ValidationRuleExtension, validationToolbarConfig, } from '@formicoidea/labre-core/blocks/surface';
|
|
2
|
+
import { ToolbarModuleExtension } from '@formicoidea/labre-core/shared/services';
|
|
1
3
|
import { ViewExtensionProvider, } from '@formicoidea/labre-core/ext-loader';
|
|
2
4
|
import { extendTemplateCategory } from '@formicoidea/labre-core/gfx/template';
|
|
5
|
+
import { BlockFlavourIdentifier, CommandExtension } from '@formicoidea/labre-core/std';
|
|
6
|
+
import { RoleVocabularyExtension } from '@formicoidea/labre-core/std/gfx';
|
|
7
|
+
import { edgyCommandIcons, edgyCommands } from './commands.js';
|
|
3
8
|
import { effects } from './effects.js';
|
|
9
|
+
import { EDGY_NUDGES } from './nudges.js';
|
|
10
|
+
import { EDGY_PROFILES } from './profiles.js';
|
|
11
|
+
import { EdgyRelationResolver } from './relation-resolver.js';
|
|
12
|
+
import { EDGY_ROLES } from './roles.js';
|
|
13
|
+
import { EDGY_RULES } from './rules.js';
|
|
4
14
|
import { edgyTemplateCategory } from './templates/index.js';
|
|
15
|
+
import { EdgyBoardRendererExtension } from './board-renderer.js';
|
|
16
|
+
import { EdgyBoardInteraction, EdgyBoardView } from './board-view.js';
|
|
5
17
|
import { EdgyFacetsRendererExtension } from './element-renderer.js';
|
|
6
18
|
import { EdgyInteraction, EdgyView } from './element-view.js';
|
|
7
19
|
import { EdgyNodeRendererExtension } from './node/node-renderer.js';
|
|
8
20
|
import { EdgyNodeView } from './node/node-view.js';
|
|
9
|
-
import { edgyToolbarExtension } from './toolbar/config.js';
|
|
21
|
+
import { edgyBoardToolbarExtension, edgyToolbarExtension, } from './toolbar/config.js';
|
|
10
22
|
import { edgyNodeToolbarExtension } from './toolbar/node-config.js';
|
|
11
23
|
import { edgySeniorTool } from './toolbar/senior-tool.js';
|
|
24
|
+
/**
|
|
25
|
+
* EDGY rendering — ALWAYS registered, independent of any flag. Disabling `edgy`
|
|
26
|
+
* hides only the creation tooling (see {@link EdgyViewExtension}); boards and
|
|
27
|
+
* facets already drawn must still paint, stay selectable, stay editable, keep
|
|
28
|
+
* their contextual toolbar and keep the dependency spotlight. See
|
|
29
|
+
* `docs/adr/0009`.
|
|
30
|
+
*/
|
|
31
|
+
export class EdgyRenderViewExtension extends ViewExtensionProvider {
|
|
32
|
+
constructor() {
|
|
33
|
+
super(...arguments);
|
|
34
|
+
this.name = 'affine-edgy-render-gfx';
|
|
35
|
+
}
|
|
36
|
+
setup(context) {
|
|
37
|
+
super.setup(context);
|
|
38
|
+
context.register(EdgyView);
|
|
39
|
+
context.register(EdgyFacetsRendererExtension);
|
|
40
|
+
context.register(EdgyBoardView);
|
|
41
|
+
context.register(EdgyBoardRendererExtension);
|
|
42
|
+
context.register(EdgyNodeView);
|
|
43
|
+
context.register(EdgyNodeRendererExtension);
|
|
44
|
+
// The role VOCABULARY, always on. A role is written in the document, not in
|
|
45
|
+
// the tooling: the direction reveal of a typed relation, the inversion
|
|
46
|
+
// command and the toolbar entry that must not lie about one all read this,
|
|
47
|
+
// and they have to keep working on a board drawn while the flag was on and
|
|
48
|
+
// opened while it is off (`docs/adr/0009`, `docs/adr/0010`). The rules that
|
|
49
|
+
// JUDGE those roles stay in the flag-gated extension below.
|
|
50
|
+
context.register(RoleVocabularyExtension(EDGY_ROLES));
|
|
51
|
+
if (this.isEdgeless(context.scope)) {
|
|
52
|
+
context.register(EdgyInteraction);
|
|
53
|
+
context.register(EdgyBoardInteraction);
|
|
54
|
+
context.register(edgyToolbarExtension);
|
|
55
|
+
context.register(edgyBoardToolbarExtension);
|
|
56
|
+
context.register(edgyNodeToolbarExtension);
|
|
57
|
+
// Both EDGY backgrounds grant the dependency spotlight on hover.
|
|
58
|
+
context.register(SpotlightHostExtension('edgy'));
|
|
59
|
+
context.register(SpotlightHostExtension('edgyBoard'));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* EDGY creation tooling — flag-gated (`edgy`): the senior toolbar button, its
|
|
65
|
+
* templates category, and the validation rules, profiles and quality checklist.
|
|
66
|
+
* All of it is tooling: a board drawn while the flag was on keeps rendering when
|
|
67
|
+
* it goes off, it just stops being checked — and the profile it was put on stays
|
|
68
|
+
* written, unread, until the flag comes back (`docs/adr/0009`).
|
|
69
|
+
*/
|
|
12
70
|
export class EdgyViewExtension extends ViewExtensionProvider {
|
|
13
71
|
constructor() {
|
|
14
72
|
super(...arguments);
|
|
@@ -16,20 +74,49 @@ export class EdgyViewExtension extends ViewExtensionProvider {
|
|
|
16
74
|
}
|
|
17
75
|
effect() {
|
|
18
76
|
super.effect();
|
|
77
|
+
// Defines the senior button and its menu — tooling-only custom elements.
|
|
19
78
|
effects();
|
|
20
79
|
extendTemplateCategory(edgyTemplateCategory);
|
|
21
80
|
}
|
|
22
81
|
setup(context) {
|
|
23
82
|
super.setup(context);
|
|
24
|
-
context.register(EdgyView);
|
|
25
|
-
context.register(EdgyFacetsRendererExtension);
|
|
26
|
-
context.register(EdgyNodeView);
|
|
27
|
-
context.register(EdgyNodeRendererExtension);
|
|
28
83
|
if (this.isEdgeless(context.scope)) {
|
|
29
|
-
context.register(
|
|
84
|
+
context.register(ValidationRuleExtension(EDGY_RULES));
|
|
85
|
+
context.register(ValidationProfileExtension(EDGY_PROFILES));
|
|
86
|
+
// Work quality (WS1): the four expectations no algorithm can decide —
|
|
87
|
+
// including the two the PO deliberately kept out of `rules.ts` on
|
|
88
|
+
// 26/08/2026 (see `./nudges.ts`).
|
|
89
|
+
context.register(QualityNudgeExtension(EDGY_NUDGES));
|
|
90
|
+
// The Validation dropdown on a selected background's contextual toolbar.
|
|
91
|
+
// A SECOND module on the same element, through the `custom:` flavour slot
|
|
92
|
+
// (the pattern `gfx/wardley` uses on its map): the rendering toolbars are
|
|
93
|
+
// registered always-on because a stored board must keep its toggles,
|
|
94
|
+
// while choosing how hard to check it is tooling and belongs here. The
|
|
95
|
+
// config itself names no framework — it reads roles and profiles — so
|
|
96
|
+
// BOTH EDGY frames register the very same object.
|
|
97
|
+
for (const flavour of [
|
|
98
|
+
'custom:affine:surface:edgy',
|
|
99
|
+
'custom:affine:surface:edgyBoard',
|
|
100
|
+
]) {
|
|
101
|
+
context.register(ToolbarModuleExtension({
|
|
102
|
+
id: BlockFlavourIdentifier(flavour),
|
|
103
|
+
config: validationToolbarConfig,
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
// The resolver that turns a hand-drawn `edgy:relation` into the verb the
|
|
107
|
+
// metamodel gives its two ends. It belongs HERE and not in the always-on
|
|
108
|
+
// extension above, and the test is the one `docs/adr/0009` asks: does it
|
|
109
|
+
// paint stored content, or does it author new content? It authors — it
|
|
110
|
+
// writes a role and a label into the document — and the only edges it
|
|
111
|
+
// ever sees are the ones the flag-gated tool below stamps. A board drawn
|
|
112
|
+
// while the flag was on keeps every verb it was given (the vocabulary and
|
|
113
|
+
// the renderers are always on); with the flag off nothing new is named
|
|
114
|
+
// because nothing new is being armed. See `./relation-resolver.ts`.
|
|
115
|
+
context.register(EdgyRelationResolver);
|
|
30
116
|
context.register(edgySeniorTool);
|
|
31
|
-
|
|
32
|
-
|
|
117
|
+
// The eight EDGY commands: the sub-menu renders them, Settings ›
|
|
118
|
+
// Shortcuts finally lists them, and a host override on an id binds.
|
|
119
|
+
context.register(CommandExtension(edgyCommands, edgyCommandIcons));
|
|
33
120
|
}
|
|
34
121
|
}
|
|
35
122
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formicoidea/labre-framework-edgy",
|
|
3
3
|
"description": "Labre edgy framework for @formicoidea/labre-core.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.33.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"author": "lajola",
|
|
@@ -27,7 +27,10 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@formicoidea/labre-core": "0.
|
|
31
|
-
"
|
|
30
|
+
"@formicoidea/labre-core": "0.33.0",
|
|
31
|
+
"@formicoidea/labre-ddd-shared": "0.33.0",
|
|
32
|
+
"@preact/signals-core": "^1.8.0",
|
|
33
|
+
"lit": "^3.2.0",
|
|
34
|
+
"yjs": "^13.6.21"
|
|
32
35
|
}
|
|
33
36
|
}
|