@formicoidea/labre-framework-ddd-core-domain 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.
@@ -31,8 +31,13 @@ import { CORE_DOMAIN_ROLE } from '../roles.js';
31
31
  /**
32
32
  * The authoring reference space, kept as documentation of where every ratio
33
33
  * below comes from: the chart was drawn at 900 × 820 with its plot inset by the
34
- * margins declared in {@link CORE_DOMAIN_BACKGROUND}, so the plot is 786 × 746
35
- * and `(absolute - origin) / span` is the conversion.
34
+ * ORIGINAL margins `{ top: 24, right: 54, bottom: 50, left: 60 }`, so the plot
35
+ * is 786 × 746 and `(absolute - origin) / span` is the conversion.
36
+ *
37
+ * These numbers are the conversion and nothing else: they are NOT the margins
38
+ * the chart is drawn with any more (see {@link CORE_DOMAIN_MARGIN}). The ratios
39
+ * below therefore still describe the same picture — the picture simply fills a
40
+ * tighter frame.
36
41
  */
37
42
  const PLOT = { x0: 60, y0: 24, width: 786, height: 746 };
38
43
  /** An absolute X of the reference drawing, as a ratio of the plot. */
@@ -94,10 +99,20 @@ const MIGRATION_TEXT = {
94
99
  weight: 700,
95
100
  color: '@zoneLabelDark',
96
101
  };
97
- /** A centred zone name, gated by `showLabels` like every other word on the chart. */
98
- function zoneLabel(id, key, fallback, x, y, style) {
102
+ /**
103
+ * A centred zone name, gated by `showLabels` like every other word on the chart.
104
+ *
105
+ * `prop` is what makes it RENAMABLE (issue #355): the model prop the in-place
106
+ * editor writes to, which `backgroundLabelText` reads BEFORE the catalogue — so
107
+ * a chart the user has renamed keeps their words, and every other chart keeps
108
+ * the vocabulary in whatever language the host serves it. The id and the prop
109
+ * are deliberately two strings: the id names a piece of this declaration, the
110
+ * prop names a key in somebody's document, and only the first may ever change.
111
+ */
112
+ function zoneLabel(id, prop, key, fallback, x, y, style) {
99
113
  return {
100
114
  id,
115
+ prop,
101
116
  labelKey: `com.labre.core-domain.background.zone.${key}`,
102
117
  fallback,
103
118
  anchor: { x: rx(x), y: ry(y) },
@@ -127,7 +142,7 @@ const CLASSIC_ZONES = [
127
142
  rect: { x: rx(70), y: ry(30), w: rw(150), h: rh(720) },
128
143
  fill: '@zoneGeneric',
129
144
  fillVisibleProp: 'showZones',
130
- label: zoneLabel('generic', 'generic', 'Generic', 150, 474, ZONE_TEXT),
145
+ label: zoneLabel('generic', 'zoneGeneric', 'generic', 'Generic', 150, 474, ZONE_TEXT),
131
146
  },
132
147
  {
133
148
  id: 'supporting-low-diff',
@@ -135,7 +150,7 @@ const CLASSIC_ZONES = [
135
150
  rect: { x: rx(220), y: ry(30), w: rw(220), h: rh(720) },
136
151
  fill: '@zoneSupporting',
137
152
  fillVisibleProp: 'showZones',
138
- label: zoneLabel('supporting', 'supporting', 'Supporting', 340, 474, ZONE_TEXT),
153
+ label: zoneLabel('supporting', 'zoneSupporting', 'supporting', 'Supporting', 340, 474, ZONE_TEXT),
139
154
  },
140
155
  {
141
156
  id: 'core',
@@ -143,7 +158,7 @@ const CLASSIC_ZONES = [
143
158
  rect: { x: rx(440), y: ry(30), w: rw(400), h: rh(360) },
144
159
  fill: '@zoneCore',
145
160
  fillVisibleProp: 'showZones',
146
- label: zoneLabel('core', 'core', 'Core', 640, 214, CORE_TEXT),
161
+ label: zoneLabel('core', 'zoneCore', 'core', 'Core', 640, 214, CORE_TEXT),
147
162
  },
148
163
  {
149
164
  // The template tints this one and writes nothing on it, so neither does the
@@ -173,6 +188,7 @@ const MIGRATION_ZONES = [
173
188
  fillVisibleProp: 'showZones',
174
189
  label: {
175
190
  id: 'lastToothpaste',
191
+ prop: 'zoneLastToothpaste',
176
192
  labelKey: 'com.labre.core-domain.background.zone.last-toothpaste',
177
193
  fallback: 'Last toothpaste',
178
194
  anchor: { x: 0.25, y: 0.25 },
@@ -189,6 +205,7 @@ const MIGRATION_ZONES = [
189
205
  fillVisibleProp: 'showZones',
190
206
  label: {
191
207
  id: 'riskSeeking',
208
+ prop: 'zoneRiskSeeking',
192
209
  labelKey: 'com.labre.core-domain.background.zone.risk-seeking',
193
210
  fallback: 'Risk-seeking',
194
211
  anchor: { x: 0.75, y: 0.25 },
@@ -205,6 +222,7 @@ const MIGRATION_ZONES = [
205
222
  fillVisibleProp: 'showZones',
206
223
  label: {
207
224
  id: 'riskAverse',
225
+ prop: 'zoneRiskAverse',
208
226
  labelKey: 'com.labre.core-domain.background.zone.risk-averse',
209
227
  fallback: 'Risk-averse',
210
228
  anchor: { x: 0.25, y: 0.75 },
@@ -221,6 +239,7 @@ const MIGRATION_ZONES = [
221
239
  fillVisibleProp: 'showZones',
222
240
  label: {
223
241
  id: 'lowHangingFruit',
242
+ prop: 'zoneLowHangingFruit',
224
243
  labelKey: 'com.labre.core-domain.background.zone.lhf',
225
244
  fallback: 'Low-hanging fruit',
226
245
  anchor: { x: 0.75, y: 0.75 },
@@ -254,6 +273,7 @@ const CORE_DOMAIN_AXES = [
254
273
  stroke: { color: '@axis', width: 2 },
255
274
  title: {
256
275
  id: 'complexityTitle',
276
+ prop: 'complexityTitle',
257
277
  // The classic reading's vertical axis. The migration one relabels it —
258
278
  // see `MIGRATION_AXIS_TITLE` below, and why it rides in `endLabels`.
259
279
  variants: ['classic'],
@@ -267,6 +287,7 @@ const CORE_DOMAIN_AXES = [
267
287
  endLabels: [
268
288
  {
269
289
  id: 'complexityLow',
290
+ prop: 'complexityLow',
270
291
  labelKey: 'com.labre.core-domain.background.complexity.low',
271
292
  fallback: 'Low',
272
293
  anchor: { x: 0, y: ry(758), dx: -12 },
@@ -276,6 +297,7 @@ const CORE_DOMAIN_AXES = [
276
297
  },
277
298
  {
278
299
  id: 'complexityHigh',
300
+ prop: 'complexityHigh',
279
301
  labelKey: 'com.labre.core-domain.background.complexity.high',
280
302
  fallback: 'High',
281
303
  anchor: { x: 0, y: ry(44), dx: -22 },
@@ -295,6 +317,7 @@ const CORE_DOMAIN_AXES = [
295
317
  */
296
318
  {
297
319
  id: 'complexityTitleMigration',
320
+ prop: 'migrationCostTitle',
298
321
  variants: ['migration'],
299
322
  labelKey: 'com.labre.core-domain.background.axis.migration-cost',
300
323
  fallback: 'Cost of migration',
@@ -314,6 +337,7 @@ const CORE_DOMAIN_AXES = [
314
337
  stroke: { color: '@axis', width: 2 },
315
338
  title: {
316
339
  id: 'differentiationTitle',
340
+ prop: 'differentiationTitle',
317
341
  labelKey: 'com.labre.core-domain.background.axis.differentiation',
318
342
  fallback: 'Business differentiation',
319
343
  anchor: { x: rx(450), y: 1, dy: 30 },
@@ -324,6 +348,7 @@ const CORE_DOMAIN_AXES = [
324
348
  endLabels: [
325
349
  {
326
350
  id: 'differentiationLow',
351
+ prop: 'differentiationLow',
327
352
  labelKey: 'com.labre.core-domain.background.differentiation.low',
328
353
  fallback: 'Low',
329
354
  anchor: { x: rx(84), y: 1, dy: 22 },
@@ -333,6 +358,7 @@ const CORE_DOMAIN_AXES = [
333
358
  },
334
359
  {
335
360
  id: 'differentiationHigh',
361
+ prop: 'differentiationHigh',
336
362
  labelKey: 'com.labre.core-domain.background.differentiation.high',
337
363
  fallback: 'High',
338
364
  anchor: { x: rx(838), y: 1, dy: 22 },
@@ -343,6 +369,53 @@ const CORE_DOMAIN_AXES = [
343
369
  ],
344
370
  },
345
371
  ];
372
+ /**
373
+ * The margins, each one the ink it actually hosts — not a round number.
374
+ *
375
+ * The chart used to be inset by `{ top: 24, right: 54, bottom: 50, left: 60 }`,
376
+ * drawn when the frame was authored and never measured since. Measured on the
377
+ * canvas at the authoring size, the ink of a default chart stopped 24.1 units
378
+ * short of the top edge, 50.7 short of the right one, 20.1 short of the bottom
379
+ * and 17.2 short of the left: about a tenth of the element was empty on every
380
+ * side, which is exactly what makes a chart hard to grab — a background is
381
+ * caught by its border (`framework-background/hit-test.ts`), and that border
382
+ * was nowhere near the drawing.
383
+ *
384
+ * So each margin is now the reach of what it hosts, plus room to breathe:
385
+ *
386
+ * - `top` hosts the tip of the vertical arrowhead and nothing else — the tip IS
387
+ * the top of the plot — so 4 units of gutter is the whole of it;
388
+ * - `right` hosts the tip of the horizontal arrowhead — which, like the top
389
+ * one, IS the edge of the plot — and the right half of the "High" tick, which
390
+ * is centred 1.02 % of the plot inside that end and reaches 3.3 units past it
391
+ * in English. 8 covers the tick on a chart of the usual width; a locale whose
392
+ * word is half again as wide overruns the edge by a few units on a narrow
393
+ * chart, which paints fine (the surface clips nothing) and is the same thing
394
+ * the arrowheads already do;
395
+ * - `bottom` hosts the horizontal axis title, whose baseline is 30 below the
396
+ * axis (`dy: 30`), plus a descender the English wording happens not to have
397
+ * (≈ 3.4 at 14px) and a gutter;
398
+ * - `left` hosts the rotated vertical title, written 32 left of the axis
399
+ * (`dx: -32`); rotated, a word reaches into the margin by its ASCENT, not by
400
+ * its length — ≈ 10.8 at 14px, more for an accented capital — hence 48.
401
+ *
402
+ * Nothing about the drawing changed: every ratio above is untouched, so the
403
+ * chart is the same chart. What changed is that the frame now sits on it.
404
+ */
405
+ const CORE_DOMAIN_MARGIN = {
406
+ top: 4,
407
+ right: 8,
408
+ bottom: 37,
409
+ left: 48,
410
+ };
411
+ /**
412
+ * The birth size, chosen so that a NEW chart's plot is the 786 × 746 it has
413
+ * always been: the tighter margins take room off the element, not off the
414
+ * drawing. A chart created before this change keeps its `xywh` and sees its
415
+ * plot grow into the margins instead — the deliberate half of this fix.
416
+ */
417
+ const BIRTH_WIDTH = PLOT.width + CORE_DOMAIN_MARGIN.left + CORE_DOMAIN_MARGIN.right;
418
+ const BIRTH_HEIGHT = PLOT.height + CORE_DOMAIN_MARGIN.top + CORE_DOMAIN_MARGIN.bottom;
346
419
  export const CORE_DOMAIN_BACKGROUND = {
347
420
  type: 'coreDomain',
348
421
  // The chart is a first-class role: validation rules position artefacts
@@ -350,14 +423,14 @@ export const CORE_DOMAIN_BACKGROUND = {
350
423
  role: CORE_DOMAIN_ROLE.chart,
351
424
  variantProp: 'variant',
352
425
  geometry: {
353
- width: 900,
354
- height: 820,
426
+ width: BIRTH_WIDTH,
427
+ height: BIRTH_HEIGHT,
355
428
  lockAspectRatio: true,
356
429
  // The chart has always offered its handles (`resizeEnabled` defaults to
357
430
  // true on the model); the declaration says so, and the toolbar toggle takes
358
431
  // over from there.
359
432
  resizable: true,
360
- margin: { top: 24, right: 54, bottom: 50, left: 60 },
433
+ margin: CORE_DOMAIN_MARGIN,
361
434
  },
362
435
  chrome: {
363
436
  fontFamily: FONT_FAMILY,
@@ -1,11 +1,20 @@
1
+ import type { FrameworkBackgroundDef } from '@formicoidea/labre-core/blocks/surface';
2
+ import { DeclaredBackgroundView } from '@formicoidea/labre-core/blocks/surface';
1
3
  import type { CoreDomainChartElementModel } from '@formicoidea/labre-core/model';
2
- import { GfxElementModelView } from '@formicoidea/labre-core/std/gfx';
3
4
  /**
4
5
  * View for the Core Domain Chart background. Registering it ensures
5
6
  * `gfx.view.get(model)` returns a view (required so move / select work).
7
+ *
8
+ * Extends {@link DeclaredBackgroundView}, so every word the chart writes on
9
+ * itself — the two axis titles, the four Low/High ticks and the zone names of
10
+ * both readings — is renamed in place by a double-click, aimed by the very
11
+ * declaration the renderer paints (issue #355). The chart had no such gesture
12
+ * before, which is the whole of the bug: the labels were i18n keys and nothing
13
+ * else, so a team that calls its axis something else had nowhere to say so.
6
14
  */
7
- export declare class CoreDomainView extends GfxElementModelView<CoreDomainChartElementModel> {
15
+ export declare class CoreDomainView extends DeclaredBackgroundView<CoreDomainChartElementModel> {
8
16
  static type: string;
17
+ protected get def(): FrameworkBackgroundDef;
9
18
  }
10
19
  /**
11
20
  * Resize gating, driven by the declaration: the handles are offered while
@@ -1,12 +1,21 @@
1
- import { FrameworkBackgroundInteractionExtension } from '@formicoidea/labre-core/blocks/surface';
2
- import { GfxElementModelView } from '@formicoidea/labre-core/std/gfx';
1
+ import { DeclaredBackgroundView, FrameworkBackgroundInteractionExtension, } from '@formicoidea/labre-core/blocks/surface';
3
2
  import { CORE_DOMAIN_BACKGROUND } from './background.js';
4
3
  /**
5
4
  * View for the Core Domain Chart background. Registering it ensures
6
5
  * `gfx.view.get(model)` returns a view (required so move / select work).
6
+ *
7
+ * Extends {@link DeclaredBackgroundView}, so every word the chart writes on
8
+ * itself — the two axis titles, the four Low/High ticks and the zone names of
9
+ * both readings — is renamed in place by a double-click, aimed by the very
10
+ * declaration the renderer paints (issue #355). The chart had no such gesture
11
+ * before, which is the whole of the bug: the labels were i18n keys and nothing
12
+ * else, so a team that calls its axis something else had nowhere to say so.
7
13
  */
8
- export class CoreDomainView extends GfxElementModelView {
14
+ export class CoreDomainView extends DeclaredBackgroundView {
9
15
  static { this.type = 'coreDomain'; }
16
+ get def() {
17
+ return CORE_DOMAIN_BACKGROUND;
18
+ }
10
19
  }
11
20
  /**
12
21
  * Resize gating, driven by the declaration: the handles are offered while
@@ -1 +1,22 @@
1
- export declare const coreDomainToolbarExtension: import("@formicoidea/labre-core/store").ExtensionType;
1
+ import type { ToolbarModuleConfig } from '@formicoidea/labre-core/shared/services';
2
+ /**
3
+ * The selected chart's FLAG-GATED row, whole: the legend button and the
4
+ * Validation dropdown, in one module.
5
+ *
6
+ * They cannot be two, and that is a hard constraint rather than a preference:
7
+ * `ToolbarModuleExtension` binds by DI variant, so a second module claiming
8
+ * `custom:affine:surface:coreDomain` throws `DuplicateServiceDefinitionError`
9
+ * before the editor finishes setting up. The C4 board's own row was merged this
10
+ * way first (`c4BoardToolingToolbarConfig`).
11
+ *
12
+ * The chart has no always-on row left at all: the legend was its only entry, and
13
+ * generating one is a gesture the `ddd-core-domain` flag may take away
14
+ * (`docs/adr/0026`) — while what the gesture already WROTE is document content,
15
+ * painted by the always-on renderers whatever the flag says. A stored chart with
16
+ * the flag off keeps its elements, its handles and its legend boxes; it simply
17
+ * offers no button.
18
+ *
19
+ * The rows themselves are derived from `coreDomainCommands` — this module writes
20
+ * no table.
21
+ */
22
+ export declare const coreDomainChartToolingToolbarConfig: ToolbarModuleConfig;
@@ -1,39 +1,43 @@
1
- import { createAutoLegend, dddLegendIcon } from '@formicoidea/labre-ddd-shared';
1
+ import { legendToolbarAction, validationToolbarConfig, } from '@formicoidea/labre-core/blocks/surface';
2
2
  import { CoreDomainChartElementModel } from '@formicoidea/labre-core/model';
3
- import { BOARD_LEGEND_NOTATION, TelemetryProvider, ToolbarModuleExtension, } from '@formicoidea/labre-core/shared/services';
4
- import { BlockFlavourIdentifier } from '@formicoidea/labre-core/std';
5
- import { CORE_DOMAIN_AUTO_LEGEND } from './legend.js';
6
- /** Contextual toolbar for a selected Core Domain background: insert its legend. */
7
- const coreDomainToolbarConfig = {
3
+ /**
4
+ * The selected chart's FLAG-GATED row, whole: the legend button and the
5
+ * Validation dropdown, in one module.
6
+ *
7
+ * They cannot be two, and that is a hard constraint rather than a preference:
8
+ * `ToolbarModuleExtension` binds by DI variant, so a second module claiming
9
+ * `custom:affine:surface:coreDomain` throws `DuplicateServiceDefinitionError`
10
+ * before the editor finishes setting up. The C4 board's own row was merged this
11
+ * way first (`c4BoardToolingToolbarConfig`).
12
+ *
13
+ * The chart has no always-on row left at all: the legend was its only entry, and
14
+ * generating one is a gesture the `ddd-core-domain` flag may take away
15
+ * (`docs/adr/0026`) — while what the gesture already WROTE is document content,
16
+ * painted by the always-on renderers whatever the flag says. A stored chart with
17
+ * the flag off keeps its elements, its handles and its legend boxes; it simply
18
+ * offers no button.
19
+ *
20
+ * The rows themselves are derived from `coreDomainCommands` — this module writes
21
+ * no table.
22
+ */
23
+ export const coreDomainChartToolingToolbarConfig = {
8
24
  actions: [
9
- {
25
+ legendToolbarAction({
26
+ // FIRST in the row, as it has been since the chart's legend button
27
+ // shipped: the toolbar sorts lexicographically by id.
10
28
  id: 'a.legend',
11
- tooltipWording: BOARD_LEGEND_NOTATION,
12
- icon: dddLegendIcon,
13
- run(ctx) {
14
- const bg = ctx.getSurfaceModelsByType(CoreDomainChartElementModel)[0];
15
- if (!bg)
16
- return;
17
- createAutoLegend(ctx.std, bg, CORE_DOMAIN_AUTO_LEGEND);
18
- ctx.std
19
- .getOptional(TelemetryProvider)
20
- ?.track('FrameworkLegendCreated', {
21
- // The WIRE value, which is not the module id: the framework is
22
- // `ddd-core-domain` in code and `core-domain` in PostHog
23
- // (`frameworks.ts` `telemetryKey`). Unchanged by this rework — the
24
- // button is the same gesture, it just detects by role now.
25
- framework: 'core-domain',
26
- element: 'legend',
27
- page: 'whiteboard editor',
28
- segment: 'element toolbar',
29
- module: 'core-domain toolbar',
30
- });
31
- },
32
- },
29
+ Model: CoreDomainChartElementModel,
30
+ owner: 'ddd-core-domain',
31
+ // The WIRE value, which is not the module id: the framework is
32
+ // `ddd-core-domain` in code and `core-domain` in PostHog
33
+ // (`frameworks.ts` `telemetryKey`). Unchanged by the button becoming
34
+ // shared.
35
+ framework: 'core-domain',
36
+ }),
37
+ // The generic dropdown, not a Core Domain variant of it: the config names no
38
+ // framework — it reads the registered rules and profiles — so this is the
39
+ // very same object c4, wardley and bpmn register.
40
+ ...validationToolbarConfig.actions,
33
41
  ],
34
- when: ctx => ctx.getSurfaceModelsByType(CoreDomainChartElementModel).length > 0,
42
+ when: (ctx) => ctx.getSurfaceModelsByType(CoreDomainChartElementModel).length > 0,
35
43
  };
36
- export const coreDomainToolbarExtension = ToolbarModuleExtension({
37
- id: BlockFlavourIdentifier('affine:surface:coreDomain'),
38
- config: coreDomainToolbarConfig,
39
- });
@@ -0,0 +1,31 @@
1
+ import type { FrameworkPalette, NamedPalette } from '@formicoidea/labre-core/components/color-picker';
2
+ import type { ChromeWording } from '@formicoidea/labre-core/shared/services';
3
+ /**
4
+ * The Core Domain Chart swatches' own names, resolved by `resolvePaletteLabel`
5
+ * (`@labre/affine-components/color-picker`) through each swatch's own
6
+ * {@link NamedPalette.labelWording} — the mechanism `WARDLEY_PALETTE_WORDINGS`
7
+ * established, reused here without either package naming the other.
8
+ *
9
+ * Exported so `../translations.ts` can list them under source `chrome`: a
10
+ * swatch's name is toolbar chrome, never seeded into a document. The keys are
11
+ * this framework's own even though the colours come from `ddd-shared`, which
12
+ * declares no `com.labre.*` key of its own by design (see its header).
13
+ */
14
+ export declare const CORE_DOMAIN_PALETTE_WORDING_BIG_BET: ChromeWording;
15
+ export declare const CORE_DOMAIN_PALETTE_WORDING_PLATFORM: ChromeWording;
16
+ export declare const CORE_DOMAIN_PALETTE_WORDING_OUTSOURCED: ChromeWording;
17
+ export declare const CORE_DOMAIN_PALETTE_WORDING_BC_CURRENT: ChromeWording;
18
+ export declare const CORE_DOMAIN_PALETTE_WORDING_BC_FUTURE: ChromeWording;
19
+ export declare const CORE_DOMAIN_PALETTE_WORDINGS: readonly ChromeWording[];
20
+ /**
21
+ * From the default editor palette we keep ONLY the neutrals — the historical
22
+ * colours say nothing in this notation.
23
+ */
24
+ export declare const CORE_DOMAIN_PALETTE_LIST: NamedPalette[];
25
+ /**
26
+ * The Core Domain Chart's page of the colour pickers' carousel
27
+ * (`docs/adr/0027`). Registered from the FLAG-GATED view extension, because
28
+ * offering hues is TOOLING: a chart drawn while the flag was on keeps every
29
+ * colour it was painted with when the flag goes off (`docs/adr/0009`).
30
+ */
31
+ export declare const CORE_DOMAIN_FRAMEWORK_PALETTE: FrameworkPalette;
@@ -0,0 +1,104 @@
1
+ import { CD_SUBDOMAINS } from '@formicoidea/labre-ddd-shared';
2
+ import { neutralPalettes } from '@formicoidea/labre-core/gfx/shape';
3
+ /**
4
+ * The Core Domain Chart swatches' own names, resolved by `resolvePaletteLabel`
5
+ * (`@labre/affine-components/color-picker`) through each swatch's own
6
+ * {@link NamedPalette.labelWording} — the mechanism `WARDLEY_PALETTE_WORDINGS`
7
+ * established, reused here without either package naming the other.
8
+ *
9
+ * Exported so `../translations.ts` can list them under source `chrome`: a
10
+ * swatch's name is toolbar chrome, never seeded into a document. The keys are
11
+ * this framework's own even though the colours come from `ddd-shared`, which
12
+ * declares no `com.labre.*` key of its own by design (see its header).
13
+ */
14
+ export const CORE_DOMAIN_PALETTE_WORDING_BIG_BET = [
15
+ 'com.labre.ddd-core-domain.palette.big-bet-purple',
16
+ 'Big-bet purple',
17
+ ];
18
+ export const CORE_DOMAIN_PALETTE_WORDING_PLATFORM = [
19
+ 'com.labre.ddd-core-domain.palette.platform-blue',
20
+ 'Platform blue',
21
+ ];
22
+ export const CORE_DOMAIN_PALETTE_WORDING_OUTSOURCED = [
23
+ 'com.labre.ddd-core-domain.palette.outsourced-green',
24
+ 'Outsourced green',
25
+ ];
26
+ export const CORE_DOMAIN_PALETTE_WORDING_BC_CURRENT = [
27
+ 'com.labre.ddd-core-domain.palette.bounded-context-red',
28
+ 'Bounded context red',
29
+ ];
30
+ export const CORE_DOMAIN_PALETTE_WORDING_BC_FUTURE = [
31
+ 'com.labre.ddd-core-domain.palette.future-position-grey',
32
+ 'Future position grey',
33
+ ];
34
+ export const CORE_DOMAIN_PALETTE_WORDINGS = [
35
+ CORE_DOMAIN_PALETTE_WORDING_BIG_BET,
36
+ CORE_DOMAIN_PALETTE_WORDING_PLATFORM,
37
+ CORE_DOMAIN_PALETTE_WORDING_OUTSOURCED,
38
+ CORE_DOMAIN_PALETTE_WORDING_BC_CURRENT,
39
+ CORE_DOMAIN_PALETTE_WORDING_BC_FUTURE,
40
+ ];
41
+ /**
42
+ * The sub-domain / bounded-context dot fills, by kind — derived from
43
+ * {@link CD_SUBDOMAINS} rather than restated.
44
+ */
45
+ const CD_FILL = Object.fromEntries(CD_SUBDOMAINS.map(subdomain => [subdomain.kind, subdomain.fill]));
46
+ /**
47
+ * The Core Domain Chart's own five hues: the three sub-domain classes
48
+ * (big-bet, platform, outsourced), the bounded context as it stands today, and
49
+ * the grey it is plotted in where it is meant to go next.
50
+ *
51
+ * The movement arrow between those last two is drawn in `MOVEMENT_COLOR`,
52
+ * which IS the current bounded context's red — one statement in one colour —
53
+ * so it contributes no sixth swatch. `__tests__/palette.unit.spec.ts` pins the
54
+ * two together, so the day they part the shelf gains its swatch.
55
+ *
56
+ * They are SHORTCUTS, never constraints: a dot's class is written in its role,
57
+ * not read off its fill.
58
+ */
59
+ const CORE_DOMAIN_PALETTES = [
60
+ {
61
+ key: 'Big-bet purple',
62
+ value: CD_FILL.bigBet,
63
+ labelWording: CORE_DOMAIN_PALETTE_WORDING_BIG_BET,
64
+ },
65
+ {
66
+ key: 'Platform blue',
67
+ value: CD_FILL.platform,
68
+ labelWording: CORE_DOMAIN_PALETTE_WORDING_PLATFORM,
69
+ },
70
+ {
71
+ key: 'Outsourced green',
72
+ value: CD_FILL.outsourced,
73
+ labelWording: CORE_DOMAIN_PALETTE_WORDING_OUTSOURCED,
74
+ },
75
+ {
76
+ key: 'Bounded context red',
77
+ value: CD_FILL.bcCurrent,
78
+ labelWording: CORE_DOMAIN_PALETTE_WORDING_BC_CURRENT,
79
+ },
80
+ {
81
+ key: 'Future position grey',
82
+ value: CD_FILL.bcFuture,
83
+ labelWording: CORE_DOMAIN_PALETTE_WORDING_BC_FUTURE,
84
+ },
85
+ ];
86
+ /**
87
+ * From the default editor palette we keep ONLY the neutrals — the historical
88
+ * colours say nothing in this notation.
89
+ */
90
+ export const CORE_DOMAIN_PALETTE_LIST = [
91
+ ...CORE_DOMAIN_PALETTES,
92
+ ...neutralPalettes(),
93
+ ];
94
+ /**
95
+ * The Core Domain Chart's page of the colour pickers' carousel
96
+ * (`docs/adr/0027`). Registered from the FLAG-GATED view extension, because
97
+ * offering hues is TOOLING: a chart drawn while the flag was on keeps every
98
+ * colour it was painted with when the flag goes off (`docs/adr/0009`).
99
+ */
100
+ export const CORE_DOMAIN_FRAMEWORK_PALETTE = {
101
+ framework: 'ddd-core-domain',
102
+ labelWording: ['com.labre.framework.ddd-core-domain', 'Core Domain Chart'],
103
+ palettes: CORE_DOMAIN_PALETTE_LIST,
104
+ };
@@ -4,4 +4,5 @@ export declare class EdgelessDddCoreDomainSeniorButton extends DddSeniorButtonBa
4
4
  protected label: string;
5
5
  protected labelKey: string;
6
6
  protected icon: import("lit-html").TemplateResult<2>;
7
+ protected owner: "ddd-core-domain";
7
8
  }
@@ -6,5 +6,6 @@ export class EdgelessDddCoreDomainSeniorButton extends DddSeniorButtonBase {
6
6
  this.label = 'Core Domain Chart';
7
7
  this.labelKey = 'com.labre.framework.ddd-core-domain';
8
8
  this.icon = coreDomainToolbarIcon;
9
+ this.owner = 'ddd-core-domain';
9
10
  }
10
11
  }
@@ -1,15 +1,4 @@
1
- import type { ChromeWording } from '@formicoidea/labre-core/shared/services';
2
1
  import { type TranslationKeyManifestEntry } from '@formicoidea/labre-core/std';
3
- /**
4
- * The automatic legend's own section titles (`core-domain/legend.ts`) — text
5
- * stamped onto the chart the moment the legend is built
6
- * (`createAutoLegend`), like any other seed. The box title itself is NOT
7
- * here: it says the shared word "Legend", so it reuses `BOARD_LEGEND_TITLE`
8
- * (`@labre/affine-shared/services`) instead of a key of its own.
9
- */
10
- export declare const CORE_DOMAIN_SEED_LEGEND_SUBDOMAINS: ChromeWording;
11
- export declare const CORE_DOMAIN_SEED_LEGEND_TEAM_MODES: ChromeWording;
12
- export declare const CORE_DOMAIN_SEED_LEGEND_MOVEMENT: ChromeWording;
13
2
  /**
14
3
  * THIS framework's contribution to the translation-key manifest — every
15
4
  * `com.labre.*` key the Core Domain Chart can hand to `TranslationProvider.t`,
@@ -1,31 +1,13 @@
1
1
  import { dddSharedTranslationEntries } from '@formicoidea/labre-ddd-shared';
2
2
  import { collectTranslationKeys, commandCategoryTranslationEntries, commandTranslationEntries, mergeTranslationEntries, } from '@formicoidea/labre-core/std';
3
- import { coreDomainCommands } from './commands.js';
3
+ import { CORE_DOMAIN_SEED_LEGEND_MOVEMENT, CORE_DOMAIN_SEED_LEGEND_SUBDOMAINS, CORE_DOMAIN_SEED_LEGEND_TEAM_MODES, coreDomainCommands, } from './commands.js';
4
4
  import { CORE_DOMAIN_BACKGROUND } from './core-domain/background.js';
5
5
  import { CORE_DOMAIN_NUDGES } from './nudges.js';
6
6
  import { CORE_DOMAIN_PROFILES } from './profiles.js';
7
7
  import { CORE_DOMAIN_READINGS } from './reading.js';
8
8
  import { CORE_DOMAIN_ROLES } from './roles.js';
9
9
  import { CORE_DOMAIN_RULES } from './rules.js';
10
- /**
11
- * The automatic legend's own section titles (`core-domain/legend.ts`) — text
12
- * stamped onto the chart the moment the legend is built
13
- * (`createAutoLegend`), like any other seed. The box title itself is NOT
14
- * here: it says the shared word "Legend", so it reuses `BOARD_LEGEND_TITLE`
15
- * (`@labre/affine-shared/services`) instead of a key of its own.
16
- */
17
- export const CORE_DOMAIN_SEED_LEGEND_SUBDOMAINS = [
18
- 'com.labre.ddd-core-domain.seed.legend-subdomains',
19
- 'Sub-domains',
20
- ];
21
- export const CORE_DOMAIN_SEED_LEGEND_TEAM_MODES = [
22
- 'com.labre.ddd-core-domain.seed.legend-team-modes',
23
- 'Team interaction modes',
24
- ];
25
- export const CORE_DOMAIN_SEED_LEGEND_MOVEMENT = [
26
- 'com.labre.ddd-core-domain.seed.legend-movement',
27
- 'Movement',
28
- ];
10
+ import { CORE_DOMAIN_PALETTE_WORDINGS } from './toolbar/palette.js';
29
11
  /**
30
12
  * THIS framework's contribution to the translation-key manifest — every
31
13
  * `com.labre.*` key the Core Domain Chart can hand to `TranslationProvider.t`,
@@ -58,4 +40,12 @@ dddSharedTranslationEntries, [
58
40
  CORE_DOMAIN_SEED_LEGEND_SUBDOMAINS,
59
41
  CORE_DOMAIN_SEED_LEGEND_TEAM_MODES,
60
42
  CORE_DOMAIN_SEED_LEGEND_MOVEMENT,
61
- ].map(([key, fallback]) => ({ key, fallback, source: 'seed' })));
43
+ ].map(([key, fallback]) => ({ key, fallback, source: 'seed' })),
44
+ // The carousel swatches' own names (`toolbar/palette.ts`) — chrome,
45
+ // re-rendered by the colour picker on every locale switch, never seeded
46
+ // into a document. Same treatment as Wardley's and EDGY's.
47
+ CORE_DOMAIN_PALETTE_WORDINGS.map(([key, fallback]) => ({
48
+ key,
49
+ fallback,
50
+ source: 'chrome',
51
+ })));
package/dist/view.d.ts CHANGED
@@ -1,10 +1,13 @@
1
1
  import { type ViewExtensionContext, ViewExtensionProvider } from '@formicoidea/labre-core/ext-loader';
2
2
  /**
3
3
  * Core Domain Chart rendering — ALWAYS registered, independent of any flag.
4
- * Disabling `ddd-core-domain` hides only the senior toolbar button (see
4
+ * Disabling `ddd-core-domain` hides only the tooling (see
5
5
  * {@link DddCoreDomainViewExtension}); placed `coreDomain` elements must still
6
- * paint, stay selectable, and keep their contextual toolbar, and Templates-
7
- * panel insertion must still render them.
6
+ * paint, stay selectable and stay movable, and Templates-panel insertion must
7
+ * still render them.
8
+ *
9
+ * The chart claims no always-on toolbar module: the legend button was its only
10
+ * contextual entry and it moved to the gated half (`docs/adr/0026`).
8
11
  */
9
12
  export declare class DddCoreDomainRenderViewExtension extends ViewExtensionProvider {
10
13
  name: string;