@formicoidea/labre-framework-ddd-core-domain 0.42.0 → 0.45.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.
@@ -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. */
@@ -364,6 +369,53 @@ const CORE_DOMAIN_AXES = [
364
369
  ],
365
370
  },
366
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;
367
419
  export const CORE_DOMAIN_BACKGROUND = {
368
420
  type: 'coreDomain',
369
421
  // The chart is a first-class role: validation rules position artefacts
@@ -371,14 +423,14 @@ export const CORE_DOMAIN_BACKGROUND = {
371
423
  role: CORE_DOMAIN_ROLE.chart,
372
424
  variantProp: 'variant',
373
425
  geometry: {
374
- width: 900,
375
- height: 820,
426
+ width: BIRTH_WIDTH,
427
+ height: BIRTH_HEIGHT,
376
428
  lockAspectRatio: true,
377
429
  // The chart has always offered its handles (`resizeEnabled` defaults to
378
430
  // true on the model); the declaration says so, and the toolbar toggle takes
379
431
  // over from there.
380
432
  resizable: true,
381
- margin: { top: 24, right: 54, bottom: 50, left: 60 },
433
+ margin: CORE_DOMAIN_MARGIN,
382
434
  },
383
435
  chrome: {
384
436
  fontFamily: FONT_FAMILY,
@@ -10,6 +10,6 @@ import type { CoreDomainChartElementModel } from '@formicoidea/labre-core/model'
10
10
  * constants the deleted imperative renderer drew from.
11
11
  */
12
12
  export declare const coreDomain: ElementRenderer<CoreDomainChartElementModel>;
13
- export declare const CoreDomainRendererExtension: import("@formicoidea/labre-core/store").ExtensionType & {
13
+ export declare const CoreDomainRendererExtension: import("@formicoidea/labre-core/_pkgs/store").ExtensionType & {
14
14
  identifier: import("@formicoidea/labre-core/_pkgs/global/di").ServiceIdentifier<ElementRenderer<CoreDomainChartElementModel>>;
15
15
  };
@@ -22,4 +22,4 @@ export declare class CoreDomainView extends DeclaredBackgroundView<CoreDomainCha
22
22
  * such prop falls back to `geometry.resizable` — the same behaviour the
23
23
  * hand-written extension had, minus the hand.
24
24
  */
25
- export declare const CoreDomainInteraction: import("@formicoidea/labre-core/store").ExtensionType;
25
+ export declare const CoreDomainInteraction: import("@formicoidea/labre-core/_pkgs/store").ExtensionType;
package/dist/reading.d.ts CHANGED
@@ -21,14 +21,18 @@ import type { ReadingProfile } from '@formicoidea/labre-core/blocks/surface';
21
21
  *
22
22
  * The chart itself is the FRAME and is not read.
23
23
  *
24
- * ## No nature, no phase
24
+ * ## No nature; a zone, not a phase
25
25
  *
26
26
  * The framework ships no type-3 tag pack: the five dot presets ARE roles, and
27
27
  * the panel says them on the type line with the chain above them ("Platform
28
- * sub-domain › Sub-domain"). And the chart's two axes are a plane, not a set of
29
- * declared zones with ids — reading a phase off it would be an invented fact, so
30
- * the section is absent rather than empty. A follow-up ticket covers the
31
- * variant-scoped 2D zones the engine would need.
28
+ * sub-domain › Sub-domain").
29
+ *
30
+ * The chart's two axes are a PLANE, so a dot is read in two dimensions (no
31
+ * `axis`): it is in the quadrant whose rectangle holds its centre, among the
32
+ * quadrants of the reading the chart is turned to (`variant` — classic or
33
+ * migration), and named the way the chart names it, the user's renamed label
34
+ * included. A dot in a strip no quadrant covers is in none, and the panel says
35
+ * so rather than picking the nearest.
32
36
  */
33
37
  /**
34
38
  * The dots: the five presets, and the two bounded-context positions.
package/dist/reading.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { CORE_DOMAIN_BACKGROUND } from './core-domain/background.js';
1
2
  import { CORE_DOMAIN_ROLE, CORE_DOMAIN_ROLES } from './roles.js';
2
3
  /**
3
4
  * What a Core Domain Chart lets the tool read (MF3, the reversed reading).
@@ -21,14 +22,18 @@ import { CORE_DOMAIN_ROLE, CORE_DOMAIN_ROLES } from './roles.js';
21
22
  *
22
23
  * The chart itself is the FRAME and is not read.
23
24
  *
24
- * ## No nature, no phase
25
+ * ## No nature; a zone, not a phase
25
26
  *
26
27
  * The framework ships no type-3 tag pack: the five dot presets ARE roles, and
27
28
  * the panel says them on the type line with the chain above them ("Platform
28
- * sub-domain › Sub-domain"). And the chart's two axes are a plane, not a set of
29
- * declared zones with ids — reading a phase off it would be an invented fact, so
30
- * the section is absent rather than empty. A follow-up ticket covers the
31
- * variant-scoped 2D zones the engine would need.
29
+ * sub-domain › Sub-domain").
30
+ *
31
+ * The chart's two axes are a PLANE, so a dot is read in two dimensions (no
32
+ * `axis`): it is in the quadrant whose rectangle holds its centre, among the
33
+ * quadrants of the reading the chart is turned to (`variant` — classic or
34
+ * migration), and named the way the chart names it, the user's renamed label
35
+ * included. A dot in a strip no quadrant covers is in none, and the panel says
36
+ * so rather than picking the nearest.
32
37
  */
33
38
  /**
34
39
  * The dots: the five presets, and the two bounded-context positions.
@@ -56,6 +61,18 @@ export const CORE_DOMAIN_READING = {
56
61
  },
57
62
  },
58
63
  },
64
+ frame: {
65
+ backgroundRole: CORE_DOMAIN_ROLE.chart,
66
+ background: CORE_DOMAIN_BACKGROUND,
67
+ label: {
68
+ labelKey: 'com.labre.core-domain.reading.field.zone',
69
+ labelFallback: 'Zone',
70
+ },
71
+ none: {
72
+ labelKey: 'com.labre.core-domain.reading.zone.none',
73
+ labelFallback: 'Not in a zone of a Core Domain Chart.',
74
+ },
75
+ },
59
76
  };
60
77
  /**
61
78
  * The Team Topologies markers.
@@ -1,2 +1,2 @@
1
1
  /** Independent senior tool — Core Domain Chart. */
2
- export declare const coreDomainSeniorTool: import("@formicoidea/labre-core/store").ExtensionType;
2
+ export declare const coreDomainSeniorTool: import("@formicoidea/labre-core/_pkgs/store").ExtensionType;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formicoidea/labre-framework-ddd-core-domain",
3
3
  "description": "Labre ddd-core-domain framework for @formicoidea/labre-core.",
4
- "version": "0.42.0",
4
+ "version": "0.45.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "author": "lajola",
@@ -31,8 +31,8 @@
31
31
  "dist"
32
32
  ],
33
33
  "dependencies": {
34
- "@formicoidea/labre-core": "0.42.0",
35
- "@formicoidea/labre-ddd-shared": "0.42.0",
34
+ "@formicoidea/labre-core": "0.45.0",
35
+ "@formicoidea/labre-ddd-shared": "0.45.0",
36
36
  "lit": "^3.2.0"
37
37
  }
38
38
  }