@formicoidea/labre-framework-edgy 0.39.1 → 0.40.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,6 +1,8 @@
1
1
  import { ElementRendererExtension, } from '@formicoidea/labre-core/blocks/surface';
2
- const BOARD_FILL = '#ffffff';
3
- const BOARD_BORDER = '#e0e0e0';
2
+ import { NOTATION_NEUTRALS } from '@formicoidea/labre-core/shared/consts';
3
+ /** The shared notation scale's card: painted at render time, so every board. */
4
+ const BOARD_FILL = NOTATION_NEUTRALS.cardFill;
5
+ const BOARD_BORDER = NOTATION_NEUTRALS.cardBorder;
4
6
  const BOARD_RADIUS = 16;
5
7
  const BOARD_BORDER_WIDTH = 2;
6
8
  /**
@@ -4,9 +4,19 @@ import type { EdgyNodeKind } from '@formicoidea/labre-core/model';
4
4
  * shape (ShapeElementModel-derived) so its stroke / fill / inner text are
5
5
  * editable via the shape toolbar; these are just the pre-formatted defaults at
6
6
  * creation.
7
+ *
8
+ * The fill is the shared notation scale's card. The stroke is NOT the scale's
9
+ * ink: it is the official EDGY stencil ink, sourced from the pictograms this
10
+ * package ships (`pictograms/Shape-Activity.svg`, `Shape-Object.svg`,
11
+ * `Shape-Outcome.svg`, every `Small-Shape-*.svg`, `Icon-People.svg`,
12
+ * `Tag-Black.svg` all draw `stroke:#262626` at `stroke-width:2`). A neutral a
13
+ * notation borrows from its official source is content of the notation, like
14
+ * the C4 stencil's `#444444`, and stays a literal.
7
15
  */
8
- export declare const NODE_FILL = "#ffffff";
16
+ export declare const NODE_FILL: string;
17
+ /** The EDGY stencil ink (`stroke:#262626` in the official pictograms). */
9
18
  export declare const NODE_STROKE = "#262626";
19
+ /** The EDGY stencil stroke weight (`stroke-width:2` in the pictograms). */
10
20
  export declare const NODE_STROKE_WIDTH = 2;
11
21
  /** Outcome corner radius (absolute px — a lightly rounded rectangle). */
12
22
  export declare const OUTCOME_RADIUS = 6;
@@ -1,11 +1,22 @@
1
+ import { NOTATION_NEUTRALS } from '@formicoidea/labre-core/shared/consts';
1
2
  /**
2
3
  * Visual constants for the four EDGY base-element nodes. Each node is a NATIVE
3
4
  * shape (ShapeElementModel-derived) so its stroke / fill / inner text are
4
5
  * editable via the shape toolbar; these are just the pre-formatted defaults at
5
6
  * creation.
7
+ *
8
+ * The fill is the shared notation scale's card. The stroke is NOT the scale's
9
+ * ink: it is the official EDGY stencil ink, sourced from the pictograms this
10
+ * package ships (`pictograms/Shape-Activity.svg`, `Shape-Object.svg`,
11
+ * `Shape-Outcome.svg`, every `Small-Shape-*.svg`, `Icon-People.svg`,
12
+ * `Tag-Black.svg` all draw `stroke:#262626` at `stroke-width:2`). A neutral a
13
+ * notation borrows from its official source is content of the notation, like
14
+ * the C4 stencil's `#444444`, and stays a literal.
6
15
  */
7
- export const NODE_FILL = '#ffffff';
16
+ export const NODE_FILL = NOTATION_NEUTRALS.cardFill;
17
+ /** The EDGY stencil ink (`stroke:#262626` in the official pictograms). */
8
18
  export const NODE_STROKE = '#262626';
19
+ /** The EDGY stencil stroke weight (`stroke-width:2` in the pictograms). */
9
20
  export const NODE_STROKE_WIDTH = 2;
10
21
  /** Outcome corner radius (absolute px — a lightly rounded rectangle). */
11
22
  export const OUTCOME_RADIUS = 6;
@@ -1,7 +1,8 @@
1
1
  import { makeTemplateSnapshot, surfaceText, surfaceYMap, templateFromCommand, } from '@formicoidea/labre-core/gfx/template';
2
2
  import { ConnectorMode, FontFamily, PointStyle, ShapeStyle, StrokeStyle, TextAlign, } from '@formicoidea/labre-core/model';
3
+ import { NOTATION_NEUTRALS } from '@formicoidea/labre-core/shared/consts';
3
4
  import { edgyCommands } from '../commands.js';
4
- import { NODE_STROKE, NODE_STROKE_WIDTH } from '../node/consts.js';
5
+ import { NODE_FILL, NODE_STROKE, NODE_STROKE_WIDTH } from '../node/consts.js';
5
6
  import { edgyNodeProps, edgyNodeTextProps } from '../presets.js';
6
7
  import { edgyDynamicTemplate } from './dynamic.js';
7
8
  /**
@@ -51,7 +52,7 @@ function rect(x, y, w, h, opts = {}) {
51
52
  type: 'shape',
52
53
  shapeType: 'rect',
53
54
  filled: true,
54
- fillColor: opts.fill ?? '#ffffff',
55
+ fillColor: opts.fill ?? NODE_FILL,
55
56
  strokeColor: opts.stroke ?? NODE_STROKE,
56
57
  strokeWidth: opts.sw ?? NODE_STROKE_WIDTH,
57
58
  shapeStyle: ShapeStyle.General,
@@ -230,7 +231,7 @@ function journey() {
230
231
  fontSize: 16,
231
232
  });
232
233
  return {
233
- cust: enode('people', 40, 120, 64, 64, { fill: '#ffffff' }),
234
+ cust: enode('people', 40, 120, 64, 64, { fill: NODE_FILL }),
234
235
  custL: label(20, 192, 104, 24, 'Customer', { fontSize: 14 }),
235
236
  // The person and its name travel together, as `createEdgyPeople` writes
236
237
  // them. A group is placed AFTER its members: the id middleware remaps
@@ -274,19 +275,28 @@ function journey() {
274
275
  t3: tk(786, 'C'),
275
276
  trav1: label(258, 350, 184, 20, 'traverses', {
276
277
  fontSize: 13,
277
- color: '#5f6368',
278
+ color: NOTATION_NEUTRALS.label,
278
279
  }),
279
280
  trav2: label(518, 350, 184, 20, 'traverses', {
280
281
  fontSize: 13,
281
- color: '#5f6368',
282
+ color: NOTATION_NEUTRALS.label,
282
283
  }),
283
284
  trav3: label(778, 350, 184, 20, 'traverses', {
284
285
  fontSize: 13,
285
- color: '#5f6368',
286
+ color: NOTATION_NEUTRALS.label,
287
+ }),
288
+ use1: label(258, 504, 184, 20, 'uses', {
289
+ fontSize: 13,
290
+ color: NOTATION_NEUTRALS.label,
291
+ }),
292
+ use2: label(518, 504, 184, 20, 'uses', {
293
+ fontSize: 13,
294
+ color: NOTATION_NEUTRALS.label,
295
+ }),
296
+ use3: label(778, 504, 184, 20, 'uses', {
297
+ fontSize: 13,
298
+ color: NOTATION_NEUTRALS.label,
286
299
  }),
287
- use1: label(258, 504, 184, 20, 'uses', { fontSize: 13, color: '#5f6368' }),
288
- use2: label(518, 504, 184, 20, 'uses', { fontSize: 13, color: '#5f6368' }),
289
- use3: label(778, 504, 184, 20, 'uses', { fontSize: 13, color: '#5f6368' }),
290
300
  l1: attach('s1', 'c1'),
291
301
  l2: attach('s2', 'c2'),
292
302
  l3: attach('s3', 'c3'),
@@ -402,15 +412,15 @@ export const edgyTemplateCategory = {
402
412
  tpl('Facets overview', `<svg ${ATTRS} fill="none"><rect x="6" y="20" width="18" height="46" rx="3" fill="#1ec873"/><rect x="46" y="20" width="18" height="46" rx="3" fill="#2f6ff0"/><rect x="86" y="20" width="18" height="46" rx="3" fill="#f5246e"/><rect x="26" y="30" width="18" height="40" rx="3" fill="#4fd0ea"/><rect x="66" y="30" width="18" height="40" rx="3" fill="#cf8cff"/><rect x="106" y="30" width="18" height="40" rx="3" fill="#eeba51"/></svg>`, facetsOverview()),
403
413
  tpl('Customer journey', `<svg ${ATTRS} fill="none"><path d="M20 24 H110 L122 40 L110 56 H20 Z" fill="#f3a3c0"/><rect x="26" y="30" width="22" height="20" fill="none" stroke="#fff"/><rect x="54" y="30" width="22" height="20" fill="none" stroke="#fff"/><rect x="82" y="30" width="22" height="20" fill="none" stroke="#fff"/></svg>`, journey()),
404
414
  tpl('Service blueprint', `<svg ${ATTRS} fill="none"><rect x="8" y="14" width="119" height="16" fill="#fbd5e0"/><rect x="8" y="32" width="119" height="34" fill="#d4e9f8"/><rect x="20" y="18" width="22" height="9" fill="#f5246e" opacity="0.5"/><rect x="20" y="40" width="22" height="9" fill="#2f6ff0" opacity="0.4"/><rect x="60" y="40" width="22" height="9" fill="#2f6ff0" opacity="0.4"/></svg>`, blueprint()),
405
- tpl('Organisation chart', `<svg ${ATTRS} fill="none"><rect x="52" y="12" width="32" height="14" rx="2" fill="#4fd0ea"/><rect x="14" y="38" width="32" height="14" rx="2" fill="#4fd0ea"/><rect x="52" y="38" width="32" height="14" rx="2" fill="#4fd0ea"/><rect x="90" y="38" width="32" height="14" rx="2" fill="#4fd0ea"/><path d="M68 26 V32 M30 32 H106 M30 32 V38 M68 32 V38 M106 32 V38" stroke="#262626"/></svg>`, orgChart()),
415
+ tpl('Organisation chart', `<svg ${ATTRS} fill="none"><rect x="52" y="12" width="32" height="14" rx="2" fill="#4fd0ea"/><rect x="14" y="38" width="32" height="14" rx="2" fill="#4fd0ea"/><rect x="52" y="38" width="32" height="14" rx="2" fill="#4fd0ea"/><rect x="90" y="38" width="32" height="14" rx="2" fill="#4fd0ea"/><path d="M68 26 V32 M30 32 H106 M30 32 V38 M68 32 V38 M106 32 V38" stroke="${NODE_STROKE}"/></svg>`, orgChart()),
406
416
  templateFromCommand(byId('edgy.addFacets'), `<svg ${ATTRS}><circle cx="55" cy="34" r="18" fill="#00ea4e" opacity="0.9"/><circle cx="80" cy="34" r="18" fill="#034cee" opacity="0.9"/><circle cx="67" cy="54" r="18" fill="#ff0056" opacity="0.9"/></svg>`, 'Facets diagram'),
407
417
  edgyDynamicTemplate,
408
418
  // The blank board had no template at all until the palette was derived —
409
419
  // the coverage test is what said so.
410
- templateFromCommand(byId('edgy.addBoard'), `<svg ${ATTRS} fill="none"><rect x="8" y="9" width="119" height="62" rx="8" fill="#ffffff" stroke="#e0e0e0" stroke-width="2"/><path d="M52 30 H84 M53 31 L66 58 M83 31 L70 58" stroke="#262626" stroke-width="1.4"/><rect x="48" y="26" width="9" height="9" fill="#00ea4e"/><circle cx="84" cy="30" r="4.5" fill="#034cee"/><path d="M61 54 h8 l4 4 -4 4 h-8 z" fill="#ff0056"/></svg>`, 'EDGY board'),
411
- templateFromCommand(byId('edgy.addPeople'), `<svg ${ATTRS} fill="#262626"><circle cx="67" cy="32" r="9" fill="none" stroke="#262626" stroke-width="2.4"/><path d="M50 60 a17 17 0 0 1 34 0" fill="none" stroke="#262626" stroke-width="2.4"/></svg>`),
412
- templateFromCommand(byId('edgy.addOutcome'), `<svg ${ATTRS} fill="none"><rect x="20" y="24" width="95" height="34" rx="6" stroke="#262626" stroke-width="2"/></svg>`),
413
- templateFromCommand(byId('edgy.addObject'), `<svg ${ATTRS} fill="none"><rect x="20" y="24" width="95" height="34" stroke="#262626" stroke-width="2"/></svg>`),
414
- templateFromCommand(byId('edgy.addActivity'), `<svg ${ATTRS} fill="none"><path d="M20 24 H98 L116 41 H116 L98 58 H20 Z" stroke="#262626" stroke-width="2" stroke-linejoin="round"/></svg>`),
420
+ templateFromCommand(byId('edgy.addBoard'), `<svg ${ATTRS} fill="none"><rect x="8" y="9" width="119" height="62" rx="8" fill="${NOTATION_NEUTRALS.cardFill}" stroke="${NOTATION_NEUTRALS.cardBorder}" stroke-width="2"/><path d="M52 30 H84 M53 31 L66 58 M83 31 L70 58" stroke="${NODE_STROKE}" stroke-width="1.4"/><rect x="48" y="26" width="9" height="9" fill="#00ea4e"/><circle cx="84" cy="30" r="4.5" fill="#034cee"/><path d="M61 54 h8 l4 4 -4 4 h-8 z" fill="#ff0056"/></svg>`, 'EDGY board'),
421
+ templateFromCommand(byId('edgy.addPeople'), `<svg ${ATTRS} fill="${NODE_STROKE}"><circle cx="67" cy="32" r="9" fill="none" stroke="${NODE_STROKE}" stroke-width="2.4"/><path d="M50 60 a17 17 0 0 1 34 0" fill="none" stroke="${NODE_STROKE}" stroke-width="2.4"/></svg>`),
422
+ templateFromCommand(byId('edgy.addOutcome'), `<svg ${ATTRS} fill="none"><rect x="20" y="24" width="95" height="34" rx="6" stroke="${NODE_STROKE}" stroke-width="2"/></svg>`),
423
+ templateFromCommand(byId('edgy.addObject'), `<svg ${ATTRS} fill="none"><rect x="20" y="24" width="95" height="34" stroke="${NODE_STROKE}" stroke-width="2"/></svg>`),
424
+ templateFromCommand(byId('edgy.addActivity'), `<svg ${ATTRS} fill="none"><path d="M20 24 H98 L116 41 H116 L98 58 H20 Z" stroke="${NODE_STROKE}" stroke-width="2" stroke-linejoin="round"/></svg>`),
415
425
  ],
416
426
  };
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.39.1",
4
+ "version": "0.40.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.39.1",
35
- "@formicoidea/labre-ddd-shared": "0.39.1",
34
+ "@formicoidea/labre-core": "0.40.0",
35
+ "@formicoidea/labre-ddd-shared": "0.40.0",
36
36
  "@preact/signals-core": "^1.8.0",
37
37
  "lit": "^3.2.0",
38
38
  "yjs": "^13.6.21"