@formicoidea/labre-framework-c4 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.
package/dist/actions.d.ts CHANGED
@@ -100,22 +100,6 @@ export declare function activateC4Relationship(std: BlockStdScope): void;
100
100
  * here rather than delegated to the caller.
101
101
  */
102
102
  export declare function c4BoardsSelected(std: BlockStdScope): C4BoardElementModel[];
103
- /**
104
- * Draw the legend of what is actually on the selected board, bottom-left of it.
105
- *
106
- * The FIRST selected board and no other: a legend is placed relative to one
107
- * background, and two of them would put two boxes on top of whatever sits in
108
- * that corner. Everything about the gesture — the scan, the placement, the box —
109
- * is `createBoardLegend`'s; C4 contributes nothing but the rows its own commands
110
- * subscribe (`commands.ts`, `docs/adr/0026`).
111
- *
112
- * The one action in this file with no command behind it: the legend is reached
113
- * from the selected board's contextual toolbar and from nowhere else (PO
114
- * arbitration, 27/08/2026 — see `toolbar/config.ts`). Kept here beside its
115
- * siblings all the same, because it is the same kind of thing — a gesture that
116
- * writes elements — and because a unit test can drive it without a toolbar.
117
- */
118
- export declare function createC4Legend(std: BlockStdScope): void;
119
103
  /**
120
104
  * The boards of the current selection, WITHOUT the read-only filter
121
105
  * {@link c4BoardsSelected} applies.
package/dist/actions.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createBoardLegend, DefaultTool } from '@formicoidea/labre-core/blocks/surface';
1
+ import { DefaultTool } from '@formicoidea/labre-core/blocks/surface';
2
2
  import { ConnectorTool } from '@formicoidea/labre-core/gfx/connector';
3
3
  import { C4BoardElementModel, ConnectorMode, FontFamily, FontStyle, FontWeight, PointStyle, StrokeStyle, TextAlign, } from '@formicoidea/labre-core/model';
4
4
  import { translateKey } from '@formicoidea/labre-core/shared/services';
@@ -287,27 +287,6 @@ export function c4BoardsSelected(std) {
287
287
  return [];
288
288
  return gfxOf(std).selection.selectedElements.filter((model) => model instanceof C4BoardElementModel);
289
289
  }
290
- /**
291
- * Draw the legend of what is actually on the selected board, bottom-left of it.
292
- *
293
- * The FIRST selected board and no other: a legend is placed relative to one
294
- * background, and two of them would put two boxes on top of whatever sits in
295
- * that corner. Everything about the gesture — the scan, the placement, the box —
296
- * is `createBoardLegend`'s; C4 contributes nothing but the rows its own commands
297
- * subscribe (`commands.ts`, `docs/adr/0026`).
298
- *
299
- * The one action in this file with no command behind it: the legend is reached
300
- * from the selected board's contextual toolbar and from nowhere else (PO
301
- * arbitration, 27/08/2026 — see `toolbar/config.ts`). Kept here beside its
302
- * siblings all the same, because it is the same kind of thing — a gesture that
303
- * writes elements — and because a unit test can drive it without a toolbar.
304
- */
305
- export function createC4Legend(std) {
306
- const board = c4BoardsSelected(std)[0];
307
- if (!board)
308
- return;
309
- createBoardLegend(std, board, 'c4');
310
- }
311
290
  /* ── Export (mermaid C4) ───────────────────────────────────────────────── */
312
291
  /**
313
292
  * The boards of the current selection, WITHOUT the read-only filter
@@ -9,10 +9,10 @@ import type { C4BoardElementModel, C4BoundaryElementModel } from '@formicoidea/l
9
9
  * fidelity suite drives them directly with a canvas stub.
10
10
  */
11
11
  export declare const c4Board: ElementRenderer<C4BoardElementModel>;
12
- export declare const C4BoardRendererExtension: import("@formicoidea/labre-core/store").ExtensionType & {
12
+ export declare const C4BoardRendererExtension: import("@formicoidea/labre-core/_pkgs/store").ExtensionType & {
13
13
  identifier: import("@formicoidea/labre-core/_pkgs/global/di").ServiceIdentifier<ElementRenderer<C4BoardElementModel>>;
14
14
  };
15
15
  export declare const c4Boundary: ElementRenderer<C4BoundaryElementModel>;
16
- export declare const C4BoundaryRendererExtension: import("@formicoidea/labre-core/store").ExtensionType & {
16
+ export declare const C4BoundaryRendererExtension: import("@formicoidea/labre-core/_pkgs/store").ExtensionType & {
17
17
  identifier: import("@formicoidea/labre-core/_pkgs/global/di").ServiceIdentifier<ElementRenderer<C4BoundaryElementModel>>;
18
18
  };
@@ -121,7 +121,7 @@ class C4FrameView extends GfxElementModelView {
121
121
  font: '14px Inter, sans-serif',
122
122
  color: 'var(--affine-text-primary-color, #1f2328)',
123
123
  background: 'var(--affine-background-overlay-panel-color, #ffffff)',
124
- border: '1px solid var(--affine-primary-color, #1e96eb)',
124
+ border: '1px solid var(--affine-primary-color)',
125
125
  borderRadius: '6px',
126
126
  boxShadow: 'var(--affine-shadow-2, 0 2px 8px rgba(0,0,0,0.18))',
127
127
  outline: 'none',
@@ -58,14 +58,9 @@ export declare const C4_MERMAID_FORMAT: InterchangeFormat;
58
58
  */
59
59
  export declare function c4BoardFrom(elements: readonly GfxPrimitiveElementModel[]): C4ExportBoard;
60
60
  /**
61
- * A name a file system will accept, minus the extension.
62
- *
63
- * The same transformations `bpmnSafeFilename` applies and for the same reasons
64
- * — reserved characters become `-`, whitespace runs collapse, the result is
65
- * capped, and the Windows tail of dots and spaces is trimmed AFTER the cap so
66
- * the extension is not the thing that gets eaten. Duplicated rather than
67
- * imported: a filename rule is not API, and coupling two frameworks to share
68
- * eight lines would be the worse trade.
61
+ * A name a file system will accept, minus the extension: the shared
62
+ * `safeFilename` with C4's fallback, `diagram`. Held to it by
63
+ * `safe-filename-parity.unit.spec.ts`.
69
64
  */
70
65
  export declare function c4SafeFilename(raw: string | undefined): string;
71
66
  /** `c4:mermaid:export` — C4's first capability. */
@@ -1,5 +1,6 @@
1
1
  import { interchangeCapabilityId } from '@formicoidea/labre-core/blocks/surface';
2
2
  import { C4BoardElementModel, C4BoundaryElementModel, C4NodeElementModel, ConnectorElementModel, GroupElementModel, TextElementModel, } from '@formicoidea/labre-core/model';
3
+ import { safeFilename } from '@formicoidea/labre-core/shared/utils';
3
4
  import { exportC4Mermaid } from './export.js';
4
5
  /**
5
6
  * C4's entries in the interchange registry (`docs/adr/0012`, P1).
@@ -86,24 +87,12 @@ export function c4BoardFrom(elements) {
86
87
  return { boards, nodes, boundaries, connectors, texts, groups };
87
88
  }
88
89
  /**
89
- * A name a file system will accept, minus the extension.
90
- *
91
- * The same transformations `bpmnSafeFilename` applies and for the same reasons
92
- * — reserved characters become `-`, whitespace runs collapse, the result is
93
- * capped, and the Windows tail of dots and spaces is trimmed AFTER the cap so
94
- * the extension is not the thing that gets eaten. Duplicated rather than
95
- * imported: a filename rule is not API, and coupling two frameworks to share
96
- * eight lines would be the worse trade.
90
+ * A name a file system will accept, minus the extension: the shared
91
+ * `safeFilename` with C4's fallback, `diagram`. Held to it by
92
+ * `safe-filename-parity.unit.spec.ts`.
97
93
  */
98
94
  export function c4SafeFilename(raw) {
99
- const safe = (raw ?? '')
100
- .trim()
101
- .replaceAll(/[\\/:*?"<>|]/g, '-')
102
- .replaceAll(/\s+/g, ' ')
103
- .trim()
104
- .slice(0, 120)
105
- .replace(/[. ]+$/, '');
106
- return safe || 'diagram';
95
+ return safeFilename(raw, 'diagram');
107
96
  }
108
97
  /* ── The capability ───────────────────────────────────────────────────── */
109
98
  /**
@@ -1,6 +1,6 @@
1
1
  import { type ElementRenderer } from '@formicoidea/labre-core/blocks/surface';
2
2
  import { type C4NodeElementModel } from '@formicoidea/labre-core/model';
3
3
  export declare const c4Node: ElementRenderer<C4NodeElementModel>;
4
- export declare const C4NodeRendererExtension: import("@formicoidea/labre-core/store").ExtensionType & {
4
+ export declare const C4NodeRendererExtension: import("@formicoidea/labre-core/_pkgs/store").ExtensionType & {
5
5
  identifier: import("@formicoidea/labre-core/_pkgs/global/di").ServiceIdentifier<ElementRenderer<C4NodeElementModel>>;
6
6
  };
@@ -70,7 +70,7 @@ export declare const c4BoardToolbarConfig: {
70
70
  }, import("@formicoidea/labre-core/shared/services").ToolbarActionGenerator];
71
71
  readonly when: (ctx: ToolbarContext) => boolean;
72
72
  };
73
- export declare const c4BoardToolbarExtension: import("@formicoidea/labre-core/store").ExtensionType;
73
+ export declare const c4BoardToolbarExtension: import("@formicoidea/labre-core/_pkgs/store").ExtensionType;
74
74
  /**
75
75
  * The legend button — the flag-gated half of the row (see the note above).
76
76
  *
@@ -113,7 +113,7 @@ export declare const c4LegendToolbarConfig: {
113
113
  * requirement, whatever order the modules were registered in.
114
114
  */
115
115
  export declare const c4BoardToolingToolbarConfig: ToolbarModuleConfig;
116
- export declare const c4BoardToolingToolbarExtension: import("@formicoidea/labre-core/store").ExtensionType;
116
+ export declare const c4BoardToolingToolbarExtension: import("@formicoidea/labre-core/_pkgs/store").ExtensionType;
117
117
  /**
118
118
  * The BOUNDARY claims no toolbar flavour at all, and that is a decision rather
119
119
  * than an omission.
@@ -1 +1 @@
1
- export declare const c4SeniorTool: import("@formicoidea/labre-core/store").ExtensionType;
1
+ export declare const c4SeniorTool: import("@formicoidea/labre-core/_pkgs/store").ExtensionType;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formicoidea/labre-framework-c4",
3
3
  "description": "Labre c4 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
  }