@formicoidea/labre-framework-wardley 0.61.0 → 1.1.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.
@@ -2,7 +2,7 @@ import { neutralPalettes, paletteColorAction, shapeToolbarConfig, } from '@formi
2
2
  import { WardleyNodeElementModel, } from '@formicoidea/labre-core/model';
3
3
  import { ToolbarModuleExtension, } from '@formicoidea/labre-core/shared/services';
4
4
  import { BlockFlavourIdentifier } from '@formicoidea/labre-core/std';
5
- import { AREA_FILL, INERTIA_COLOR, METHOD_FILL, WARDLEY_RED, } from '../node/consts.js';
5
+ import { AREA_FILL, WARDLEY_PALETTES } from '../node/consts.js';
6
6
  /** The two hex digits `AREA_FILL` carries — the zone's ~25 % opacity. */
7
7
  const AREA_ALPHA = AREA_FILL.slice(-2);
8
8
  /** A plain 6-digit hex, the only shape a swatch value takes. */
@@ -29,119 +29,6 @@ export function wardleyFillColor(model, value) {
29
29
  return value;
30
30
  return `${value}${AREA_ALPHA}`;
31
31
  }
32
- /**
33
- * The nine Wardley swatches' own names, resolved by `resolvePaletteLabel`
34
- * (`@labre/affine-components/color-picker`) through each swatch's own
35
- * {@link NamedPalette.labelWording} — the framework-agnostic mechanism a
36
- * gfx module uses to name a palette without touching `Palette`
37
- * (`packages/affine/model`, RED ZONE) or importing another framework.
38
- *
39
- * Exported so `../translations.ts` can list them in the manifest under
40
- * source `chrome`, the same treatment `WARDLEY_TOOLBAR_WORDINGS` already
41
- * gets — a swatch's name is toolbar chrome, re-rendered on every locale
42
- * switch, never seeded into a document.
43
- */
44
- export const WARDLEY_PALETTE_WORDING_WONDER = [
45
- 'com.labre.wardley.palette.wonder',
46
- 'Wonder',
47
- ];
48
- export const WARDLEY_PALETTE_WORDING_PEACE = [
49
- 'com.labre.wardley.palette.peace',
50
- 'Peace',
51
- ];
52
- export const WARDLEY_PALETTE_WORDING_WAR = [
53
- 'com.labre.wardley.palette.war',
54
- 'War',
55
- ];
56
- export const WARDLEY_PALETTE_WORDING_WONDER_LIGHT = [
57
- 'com.labre.wardley.palette.wonder-light',
58
- 'Wonder light',
59
- ];
60
- export const WARDLEY_PALETTE_WORDING_PEACE_LIGHT = [
61
- 'com.labre.wardley.palette.peace-light',
62
- 'Peace light',
63
- ];
64
- export const WARDLEY_PALETTE_WORDING_WAR_LIGHT = [
65
- 'com.labre.wardley.palette.war-light',
66
- 'War light',
67
- ];
68
- export const WARDLEY_PALETTE_WORDING_RED = [
69
- 'com.labre.wardley.palette.wardley-red',
70
- 'Wardley red',
71
- ];
72
- export const WARDLEY_PALETTE_WORDING_INERTIA = [
73
- 'com.labre.wardley.palette.inertia',
74
- 'Inertia',
75
- ];
76
- export const WARDLEY_PALETTE_WORDING_METHOD_GREY = [
77
- 'com.labre.wardley.palette.method-grey',
78
- 'Method grey',
79
- ];
80
- export const WARDLEY_PALETTE_WORDINGS = [
81
- WARDLEY_PALETTE_WORDING_WONDER,
82
- WARDLEY_PALETTE_WORDING_PEACE,
83
- WARDLEY_PALETTE_WORDING_WAR,
84
- WARDLEY_PALETTE_WORDING_WONDER_LIGHT,
85
- WARDLEY_PALETTE_WORDING_PEACE_LIGHT,
86
- WARDLEY_PALETTE_WORDING_WAR_LIGHT,
87
- WARDLEY_PALETTE_WORDING_RED,
88
- WARDLEY_PALETTE_WORDING_INERTIA,
89
- WARDLEY_PALETTE_WORDING_METHOD_GREY,
90
- ];
91
- /**
92
- * The Wardley **evolution cycle**, surfaced as ready-made swatches in the node
93
- * colour picker: Wonder / Peace / War, the three climatic phases a component
94
- * travels through in Simon Wardley's pattern — saturated first, then the light
95
- * shades for a fill under a label — followed by the three colours the notation
96
- * itself already uses (the evolution arrow's red, the inertia bar, a method's
97
- * neutral fill).
98
- *
99
- * They are SHORTCUTS, never constraints: nothing in the map reads a colour, so
100
- * an author is free to ignore them, and the custom picker stays one click away.
101
- */
102
- const WARDLEY_PALETTES = [
103
- {
104
- key: 'Wonder',
105
- value: '#3ec9f2',
106
- labelWording: WARDLEY_PALETTE_WORDING_WONDER,
107
- },
108
- {
109
- key: 'Peace',
110
- value: '#5b9cf6',
111
- labelWording: WARDLEY_PALETTE_WORDING_PEACE,
112
- },
113
- { key: 'War', value: '#9d6df0', labelWording: WARDLEY_PALETTE_WORDING_WAR },
114
- {
115
- key: 'Wonder light',
116
- value: '#b9e9fa',
117
- labelWording: WARDLEY_PALETTE_WORDING_WONDER_LIGHT,
118
- },
119
- {
120
- key: 'Peace light',
121
- value: '#c6dbfc',
122
- labelWording: WARDLEY_PALETTE_WORDING_PEACE_LIGHT,
123
- },
124
- {
125
- key: 'War light',
126
- value: '#d9c9fa',
127
- labelWording: WARDLEY_PALETTE_WORDING_WAR_LIGHT,
128
- },
129
- {
130
- key: 'Wardley red',
131
- value: WARDLEY_RED,
132
- labelWording: WARDLEY_PALETTE_WORDING_RED,
133
- },
134
- {
135
- key: 'Inertia',
136
- value: INERTIA_COLOR,
137
- labelWording: WARDLEY_PALETTE_WORDING_INERTIA,
138
- },
139
- {
140
- key: 'Method grey',
141
- value: METHOD_FILL,
142
- labelWording: WARDLEY_PALETTE_WORDING_METHOD_GREY,
143
- },
144
- ];
145
32
  /**
146
33
  * From the default editor palette we keep ONLY the neutrals — the historical
147
34
  * colours are dropped in favour of the Wardley swatches above.
@@ -11,13 +11,14 @@ import { WARDLEY_NUDGES } from './nudges.js';
11
11
  import { WARDLEY_NODE_LABEL, wardleyNodeLabelKey } from './presets.js';
12
12
  import { WARDLEY_PROFILES } from './profiles.js';
13
13
  import { WARDLEY_READING } from './reading.js';
14
+ import { WARDLEY_JSON_IMPORT_REMARKS } from './renderer-json-import.js';
14
15
  import { WARDLEY_ROLES } from './roles.js';
15
16
  import { WARDLEY_RULES } from './rules.js';
16
17
  import { WARDLEY_SVG_IMPORT_REMARKS } from './svg-remarks.js';
17
18
  import { KODAK_INERTIA_SEED, TEA_SHOP_SEED, WARDLEY_TEMPLATE_NAME_KODAK_INERTIA, WARDLEY_TEMPLATE_NAME_TEA_SHOP, } from './templates/maps.js';
18
19
  import { WARDLEY_TEMPLATE_NAME_AREA_POLYGON, WARDLEY_TEMPLATE_NAME_EVOLUTION_ARROW, WARDLEY_TEMPLATE_NAME_LINK, } from './templates/index.js';
19
20
  import { WARDLEY_TOOLBAR_WORDINGS } from './toolbar/config.js';
20
- import { WARDLEY_PALETTE_WORDINGS } from './toolbar/node-config.js';
21
+ import { WARDLEY_PALETTE_WORDINGS } from './node/consts.js';
21
22
  /**
22
23
  * The prompt every labelled artefact is created NEXT TO — the fallback IS
23
24
  * `WARDLEY_NODE_LABEL[kind]`, never restated, mirroring BPMN's `seedEntries`.
@@ -69,12 +70,14 @@ const templateNameEntries = () => [
69
70
  ].map(([key, fallback]) => ({ key, fallback, source: 'chrome' }));
70
71
  /**
71
72
  * The fixed-wording import remarks: the OWM reader's
72
- * ({@link WARDLEY_OWM_IMPORT_REMARKS}) and the SVG reader's
73
- * ({@link WARDLEY_SVG_IMPORT_REMARKS}).
73
+ * ({@link WARDLEY_OWM_IMPORT_REMARKS}), the SVG reader's
74
+ * ({@link WARDLEY_SVG_IMPORT_REMARKS}) and the renderer JSON reader's
75
+ * ({@link WARDLEY_JSON_IMPORT_REMARKS}).
74
76
  */
75
77
  const importRemarkEntries = () => [
76
78
  ...Object.values(WARDLEY_OWM_IMPORT_REMARKS),
77
79
  ...Object.values(WARDLEY_SVG_IMPORT_REMARKS),
80
+ ...Object.values(WARDLEY_JSON_IMPORT_REMARKS),
78
81
  ].map(([key, english]) => ({
79
82
  key,
80
83
  fallback: english,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formicoidea/labre-framework-wardley",
3
3
  "description": "Labre wardley framework for @formicoidea/labre-core.",
4
- "version": "0.61.0",
4
+ "version": "1.1.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "author": "lajola",
@@ -35,7 +35,7 @@
35
35
  "dist"
36
36
  ],
37
37
  "dependencies": {
38
- "@formicoidea/labre-core": "0.61.0",
38
+ "@formicoidea/labre-core": "1.1.0",
39
39
  "lit": "^3.2.0"
40
40
  }
41
41
  }