@formicoidea/labre-framework-edgy 0.41.0 → 0.43.1

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.
@@ -1,6 +1,5 @@
1
1
  import { collectTranslationKeys, commandCategoryTranslationEntries, commandTranslationEntries, mergeTranslationEntries, } from '@formicoidea/labre-core/std';
2
- import { edgyCommands } from './commands.js';
3
- import { EDGY_LEGEND_CHROME_WORDINGS } from './legend.js';
2
+ import { edgyCommands, EDGY_LEGEND_CHROME_WORDINGS } from './commands.js';
4
3
  import { EDGY_DYNAMIC_NODES, EDGY_DYNAMIC_VERBS, EDGY_ZONES, edgyElementLabel, edgyElementLabelKey, edgyVerbSeedKey, } from './metamodel.js';
5
4
  import { NODE_LABEL, nodeLabelKey } from './node/consts.js';
6
5
  import { EDGY_NUDGES } from './nudges.js';
package/dist/view.js CHANGED
@@ -1,8 +1,8 @@
1
- import { QualityNudgeExtension, ReadingProfileExtension, SpotlightHostExtension, ValidationProfileExtension, ValidationRuleExtension, validationToolbarConfig, } from '@formicoidea/labre-core/blocks/surface';
2
- import { ToolbarModuleExtension } from '@formicoidea/labre-core/shared/services';
1
+ import { QualityNudgeExtension, ReadingProfileExtension, SpotlightHostExtension, ValidationProfileExtension, ValidationRuleExtension, } from '@formicoidea/labre-core/blocks/surface';
2
+ import { FrameworkPaletteExtension } from '@formicoidea/labre-core/components/color-picker';
3
3
  import { ViewExtensionProvider, } from '@formicoidea/labre-core/ext-loader';
4
4
  import { TemplateCategoryExtension } from '@formicoidea/labre-core/gfx/template';
5
- import { BlockFlavourIdentifier, CommandExtension } from '@formicoidea/labre-core/std';
5
+ import { CommandExtension } from '@formicoidea/labre-core/std';
6
6
  import { RoleVocabularyExtension } from '@formicoidea/labre-core/std/gfx';
7
7
  import { edgyCommandIcons, edgyCommands } from './commands.js';
8
8
  import { effects } from './effects.js';
@@ -19,8 +19,8 @@ import { EdgyFacetsRendererExtension } from './element-renderer.js';
19
19
  import { EdgyInteraction, EdgyView } from './element-view.js';
20
20
  import { EdgyNodeRendererExtension } from './node/node-renderer.js';
21
21
  import { EdgyNodeView } from './node/node-view.js';
22
- import { edgyBoardToolbarExtension, edgyToolbarExtension, } from './toolbar/config.js';
23
- import { edgyNodeToolbarExtension } from './toolbar/node-config.js';
22
+ import { edgyBoardToolbarExtension, edgyBoardToolingToolbarExtension, edgyToolbarExtension, edgyToolingToolbarExtension, } from './toolbar/config.js';
23
+ import { EDGY_FRAMEWORK_PALETTE, edgyNodeToolbarExtension, } from './toolbar/node-config.js';
24
24
  import { edgySeniorTool } from './toolbar/senior-tool.js';
25
25
  /**
26
26
  * EDGY rendering — ALWAYS registered, independent of any flag. Disabling `edgy`
@@ -88,22 +88,17 @@ export class EdgyViewExtension extends ViewExtensionProvider {
88
88
  // including the two the PO deliberately kept out of `rules.ts` on
89
89
  // 26/08/2026 (see `./nudges.ts`).
90
90
  context.register(QualityNudgeExtension(EDGY_NUDGES));
91
- // The Validation dropdown on a selected background's contextual toolbar.
92
- // A SECOND module on the same element, through the `custom:` flavour slot
93
- // (the pattern `gfx/wardley` uses on its map): the rendering toolbars are
94
- // registered always-on because a stored board must keep its toggles,
95
- // while choosing how hard to check it is tooling and belongs here. The
96
- // config itself names no framework — it reads roles and profiles — so
97
- // BOTH EDGY frames register the very same object.
98
- for (const flavour of [
99
- 'custom:affine:surface:edgy',
100
- 'custom:affine:surface:edgyBoard',
101
- ]) {
102
- context.register(ToolbarModuleExtension({
103
- id: BlockFlavourIdentifier(flavour),
104
- config: validationToolbarConfig,
105
- }));
106
- }
91
+ // The LEGEND button and the Validation dropdown on a selected
92
+ // background's contextual toolbar. A SECOND module on the same element,
93
+ // through the `custom:` flavour slot (the pattern `gfx/wardley` uses on
94
+ // its map): the rendering toolbars are registered always-on because a
95
+ // stored board must keep its appearance toggles, while asking the
96
+ // framework what its notation means, and choosing how hard to check the
97
+ // board, are both tooling and belong here (`docs/adr/0026`). One module
98
+ // per frame and not one shared object, because the button has to know
99
+ // WHICH background it is documenting.
100
+ context.register(edgyToolingToolbarExtension);
101
+ context.register(edgyBoardToolingToolbarExtension);
107
102
  // The resolver that turns a hand-drawn `edgy:relation` into the verb the
108
103
  // metamodel gives its two ends. It belongs HERE and not in the always-on
109
104
  // extension above, and the test is the one `docs/adr/0009` asks: does it
@@ -122,6 +117,11 @@ export class EdgyViewExtension extends ViewExtensionProvider {
122
117
  // profile, so it goes with the flag without either side naming the other.
123
118
  context.register(ReadingProfileExtension(EDGY_READING));
124
119
  context.register(edgySeniorTool);
120
+ // EDGY's page of the colour pickers' carousel (`docs/adr/0027`). Here,
121
+ // beside the senior tool, because offering hues is TOOLING — the colours
122
+ // already painted on a stored board are content and do not move
123
+ // (`docs/adr/0009`).
124
+ context.register(FrameworkPaletteExtension(EDGY_FRAMEWORK_PALETTE));
125
125
  // The Templates-panel category — tooling, so it goes with the flag (#244).
126
126
  context.register(TemplateCategoryExtension(edgyTemplateCategory));
127
127
  // The eight EDGY commands: the sub-menu renders them, Settings ›
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.41.0",
4
+ "version": "0.43.1",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "author": "lajola",
@@ -31,8 +31,7 @@
31
31
  "dist"
32
32
  ],
33
33
  "dependencies": {
34
- "@formicoidea/labre-core": "0.41.0",
35
- "@formicoidea/labre-ddd-shared": "0.41.0",
34
+ "@formicoidea/labre-core": "0.43.1",
36
35
  "@preact/signals-core": "^1.8.0",
37
36
  "lit": "^3.2.0",
38
37
  "yjs": "^13.6.21"
package/dist/legend.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import { type AutoLegendSpec } from '@formicoidea/labre-ddd-shared';
2
- import { type ChromeWording } from '@formicoidea/labre-core/shared/services';
3
- /**
4
- * The two section titles above that are this framework's OWN word rather than
5
- * a role's — `titleKey` reuses a role's key where the section says a role's
6
- * name (the facets, the intersections), but "Base elements" and "Relations"
7
- * name a GROUPING of roles, so each mints a key of its own. For
8
- * `translations.ts`'s manifest.
9
- */
10
- export declare const EDGY_LEGEND_CHROME_WORDINGS: readonly ChromeWording[];
11
- export declare const EDGY_AUTO_LEGEND: AutoLegendSpec;
package/dist/legend.js DELETED
@@ -1,133 +0,0 @@
1
- import { roleLabel, } from '@formicoidea/labre-ddd-shared';
2
- import { BOARD_LEGEND_TITLE, } from '@formicoidea/labre-core/shared/services';
3
- import { EDGY_DYNAMIC_NODES, EDGY_ZONE_FILL, EDGY_ZONES, edgyElementLabel, edgyElementLabelKey, } from './metamodel.js';
4
- import { NODE_FILL, NODE_STROKE } from './node/consts.js';
5
- import { EDGY_ROLE, EDGY_ROLES } from './roles.js';
6
- /**
7
- * What an EDGY background's automatic legend can say — a TABLE, and nothing
8
- * else: the scan, the placement and the box are `createAutoLegend`'s job, the
9
- * same generic the three DDD backgrounds were given
10
- * (`@labre/affine-gfx-ddd-shared`, `shared/legend-auto.ts`). EDGY takes a
11
- * dependency on that package for the generic and the box prefab alone; moving
12
- * them to a neutral home would be the tidier answer and is not worth the churn
13
- * of this fix.
14
- *
15
- * Every row is DERIVED — from the metamodel (`./metamodel.ts`: which elements
16
- * exist, which zone each belongs to, what colour that zone is drawn in) and
17
- * from the role vocabulary's own labels (`./roles.ts`). Nothing here is
18
- * restated: a thirteenth element added to the metamodel gets its legend row the
19
- * same way it gets its role, with no edit to this file.
20
- *
21
- * ## The order
22
- *
23
- * By ZONE, and the order of the table carries it: the three facets first
24
- * (Identity, Architecture, Experience), then the three intersections in one
25
- * section, then the four base elements, then the relations — which is the
26
- * reading order of {@link EDGY_ZONES} and, before it, of the Venn itself.
27
- */
28
- /** One row per official element of `zone`, in the metamodel's own order. */
29
- function zoneEntries(zone) {
30
- return Object.entries(EDGY_DYNAMIC_NODES)
31
- .filter(([, node]) => node.zone === zone)
32
- .map(([name]) => ({
33
- role: EDGY_ROLE[name],
34
- row: {
35
- swatch: 'square',
36
- // The zone's fill, which IS what the diagram paints the element with.
37
- color: EDGY_ZONE_FILL[zone],
38
- label: roleLabel(EDGY_ROLES, EDGY_ROLE[name]),
39
- },
40
- }));
41
- }
42
- /**
43
- * A facet's section title says the facet's own name, so it reuses the key the
44
- * metamodel's seeds already carry (`edgyElementLabelKey`): the legend and the
45
- * facets diagram say "Identity" with one key, not two.
46
- */
47
- const FACET_SECTIONS = EDGY_ZONES.filter(zone => zone.group === 'facet').map(zone => ({
48
- title: edgyElementLabel(zone.id),
49
- titleKey: edgyElementLabelKey(zone.id),
50
- entries: zoneEntries(zone.id),
51
- }));
52
- /**
53
- * The three intersection elements in ONE section: Organisation, Product and
54
- * Brand are not three facets, they are the three lenses between them, and the
55
- * diagram says so by drawing them in the overlaps. Each keeps its own colour.
56
- */
57
- const INTERSECTIONS_SECTION = {
58
- title: 'Intersections',
59
- titleKey: 'com.labre.edgy.seed.intersections-title',
60
- entries: EDGY_ZONES.filter(zone => zone.group === 'intersection').flatMap(zone => zoneEntries(zone.id)),
61
- };
62
- /**
63
- * The four base elements, listed only when one is on the board BARE — an
64
- * element the user dropped from the toolbox and left as a People, an Outcome,
65
- * an Object or an Activity, without saying which of the twelve it is. White,
66
- * because that is the fill the palette gives them (`node/consts.ts`).
67
- *
68
- * `exact` is what makes "bare" true. Detection is otherwise an ancestor walk,
69
- * and the twelve official elements specialise these four — Content is an
70
- * object, Story an activity — so an "Object" row would appear on a board
71
- * carrying nothing but Contents, keyed to a white swatch that is drawn nowhere
72
- * on it. The relation entry below keeps the walk, because there the parent row
73
- * IS the fair summary: a board carrying `edgy:expresses` carries a relation.
74
- */
75
- const BASE_SECTION = {
76
- title: 'Base elements',
77
- titleKey: 'com.labre.edgy.legend.section.base-elements',
78
- entries: ['people', 'outcome', 'object', 'activity'].map(kind => ({
79
- role: EDGY_ROLE[kind],
80
- exact: true,
81
- row: {
82
- swatch: 'square',
83
- color: NODE_FILL,
84
- label: roleLabel(EDGY_ROLES, EDGY_ROLE[kind]),
85
- },
86
- })),
87
- };
88
- /**
89
- * ONE row for the whole relation family, keyed on the PARENT role: a board
90
- * carrying "content expresses purpose" carries `edgy:expresses`, which is a
91
- * relation, and that is all the legend has to say. Twenty-two rows naming the
92
- * verbs would restate the metamodel rather than document the drawing — and the
93
- * verb travels on the link itself, visible, where it belongs.
94
- */
95
- const RELATIONS_SECTION = {
96
- title: 'Relations',
97
- titleKey: 'com.labre.edgy.legend.section.relations',
98
- entries: [
99
- {
100
- role: EDGY_ROLE.relation,
101
- row: {
102
- swatch: 'line',
103
- // The stroke `activateEdgyRelation` arms the connector tool with.
104
- color: NODE_STROKE,
105
- label: roleLabel(EDGY_ROLES, EDGY_ROLE.relation),
106
- },
107
- },
108
- ],
109
- };
110
- /**
111
- * The two section titles above that are this framework's OWN word rather than
112
- * a role's — `titleKey` reuses a role's key where the section says a role's
113
- * name (the facets, the intersections), but "Base elements" and "Relations"
114
- * name a GROUPING of roles, so each mints a key of its own. For
115
- * `translations.ts`'s manifest.
116
- */
117
- export const EDGY_LEGEND_CHROME_WORDINGS = [
118
- ['com.labre.edgy.legend.section.base-elements', 'Base elements'],
119
- ['com.labre.edgy.legend.section.relations', 'Relations'],
120
- ];
121
- export const EDGY_AUTO_LEGEND = {
122
- // The shared DDD auto-legend box's own generic chrome, resolved through
123
- // the same key every board that has one reuses — see `AutoLegendSpec.title`.
124
- title: BOARD_LEGEND_TITLE[1],
125
- titleKey: BOARD_LEGEND_TITLE[0],
126
- roles: EDGY_ROLES,
127
- sections: [
128
- ...FACET_SECTIONS,
129
- INTERSECTIONS_SECTION,
130
- BASE_SECTION,
131
- RELATIONS_SECTION,
132
- ],
133
- };