@formicoidea/labre-framework-edgy 0.32.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.
@@ -1,15 +1,29 @@
1
- import { commandTranslationEntries, } from '@formicoidea/labre-core/std';
1
+ import { collectTranslationKeys, commandTranslationEntries, mergeTranslationEntries, } from '@formicoidea/labre-core/std';
2
2
  import { edgyCommands } from './commands.js';
3
+ import { EDGY_NUDGES } from './nudges.js';
4
+ import { EDGY_PROFILES } from './profiles.js';
5
+ import { EDGY_ROLES } from './roles.js';
6
+ import { EDGY_RULES } from './rules.js';
3
7
  /**
4
- * THIS framework's contribution to the translation-key manifest.
8
+ * THIS framework's contribution to the translation-key manifest — every
9
+ * `com.labre.*` key EDGY can hand to `TranslationProvider.t`, derived from the
10
+ * very declarations the editor registers.
5
11
  *
6
12
  * Its command labels and descriptions are built from a TEMPLATE, so the
7
- * concrete keys exist nowhere but in the declarations themselves and the
8
- * core manifest could not restate them even if it wanted to. The
9
- * contribution therefore ships WITH the framework: in the bundled
13
+ * concrete keys exist nowhere but in the declarations themselves and the core
14
+ * manifest could not restate them even if it wanted to. The same now holds for
15
+ * the roles: one key per canonical verb, derived from the metamodel, so a
16
+ * relation added there contributes its keys without anybody editing this file.
17
+ *
18
+ * That derivation is why the hand-drawn relation tool needed no line here: its
19
+ * `com.labre.commands.edgy.addRelation` and the `.description` key that carries
20
+ * its gesture sentence — the first DESCRIPTION any EDGY command has declared —
21
+ * are collected off `edgyCommands` with their English fallbacks, like every
22
+ * label before them.
23
+ *
24
+ * The contribution therefore ships WITH the framework: in the bundled
10
25
  * distribution `@formicoidea/labre-framework-edgy` carries it, and a host
11
- * composes it into its catalogue exactly as it already composes
12
- * `edgyCommands` into the command registry. See
13
- * `packages/affine/all/src/translations.ts`.
26
+ * composes it into its catalogue exactly as it already composes `edgyCommands`
27
+ * into the command registry. See `packages/affine/all/src/translations.ts`.
14
28
  */
15
- export const edgyTranslationEntries = commandTranslationEntries(edgyCommands);
29
+ export const edgyTranslationEntries = mergeTranslationEntries(commandTranslationEntries(edgyCommands), collectTranslationKeys('role', EDGY_ROLES), collectTranslationKeys('rule', EDGY_RULES), collectTranslationKeys('nudge', EDGY_NUDGES), collectTranslationKeys('profile', EDGY_PROFILES));
package/dist/view.d.ts CHANGED
@@ -11,8 +11,11 @@ export declare class EdgyRenderViewExtension extends ViewExtensionProvider {
11
11
  setup(context: ViewExtensionContext): void;
12
12
  }
13
13
  /**
14
- * EDGY creation tooling — flag-gated (`edgy`): the senior toolbar button and
15
- * its templates category.
14
+ * EDGY creation tooling — flag-gated (`edgy`): the senior toolbar button, its
15
+ * templates category, and the validation rules, profiles and quality checklist.
16
+ * All of it is tooling: a board drawn while the flag was on keeps rendering when
17
+ * it goes off, it just stops being checked — and the profile it was put on stays
18
+ * written, unread, until the flag comes back (`docs/adr/0009`).
16
19
  */
17
20
  export declare class EdgyViewExtension extends ViewExtensionProvider {
18
21
  name: string;
package/dist/view.js CHANGED
@@ -1,9 +1,16 @@
1
- import { SpotlightHostExtension } from '@formicoidea/labre-core/blocks/surface';
1
+ import { QualityNudgeExtension, SpotlightHostExtension, ValidationProfileExtension, ValidationRuleExtension, validationToolbarConfig, } from '@formicoidea/labre-core/blocks/surface';
2
+ import { ToolbarModuleExtension } from '@formicoidea/labre-core/shared/services';
2
3
  import { ViewExtensionProvider, } from '@formicoidea/labre-core/ext-loader';
3
4
  import { extendTemplateCategory } from '@formicoidea/labre-core/gfx/template';
4
- import { CommandExtension } from '@formicoidea/labre-core/std';
5
+ import { BlockFlavourIdentifier, CommandExtension } from '@formicoidea/labre-core/std';
6
+ import { RoleVocabularyExtension } from '@formicoidea/labre-core/std/gfx';
5
7
  import { edgyCommandIcons, edgyCommands } from './commands.js';
6
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';
7
14
  import { edgyTemplateCategory } from './templates/index.js';
8
15
  import { EdgyBoardRendererExtension } from './board-renderer.js';
9
16
  import { EdgyBoardInteraction, EdgyBoardView } from './board-view.js';
@@ -34,6 +41,13 @@ export class EdgyRenderViewExtension extends ViewExtensionProvider {
34
41
  context.register(EdgyBoardRendererExtension);
35
42
  context.register(EdgyNodeView);
36
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));
37
51
  if (this.isEdgeless(context.scope)) {
38
52
  context.register(EdgyInteraction);
39
53
  context.register(EdgyBoardInteraction);
@@ -47,8 +61,11 @@ export class EdgyRenderViewExtension extends ViewExtensionProvider {
47
61
  }
48
62
  }
49
63
  /**
50
- * EDGY creation tooling — flag-gated (`edgy`): the senior toolbar button and
51
- * its templates category.
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`).
52
69
  */
53
70
  export class EdgyViewExtension extends ViewExtensionProvider {
54
71
  constructor() {
@@ -64,8 +81,40 @@ export class EdgyViewExtension extends ViewExtensionProvider {
64
81
  setup(context) {
65
82
  super.setup(context);
66
83
  if (this.isEdgeless(context.scope)) {
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);
67
116
  context.register(edgySeniorTool);
68
- // The seven EDGY commands: the sub-menu renders them, Settings ›
117
+ // The eight EDGY commands: the sub-menu renders them, Settings ›
69
118
  // Shortcuts finally lists them, and a host override on an id binds.
70
119
  context.register(CommandExtension(edgyCommands, edgyCommandIcons));
71
120
  }
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.32.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.32.0",
31
- "lit": "^3.2.0"
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
  }