@skhema/embed 0.1.10 → 0.1.11

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.
@@ -0,0 +1,244 @@
1
+ /**
2
+ * Vendored from @skhema/types (src/schema/{elements,components,mapping}.ts).
3
+ *
4
+ * @skhema/types is a restricted npm package; @skhema/embed is public, so it
5
+ * must not depend on it at install time. This is the public method vocabulary
6
+ * (it renders verbatim in public embeds) — keep it in sync with @skhema/types
7
+ * when the method schema changes (same pattern as
8
+ * skhema-cli/src/lib/contribute/method-schema.ts).
9
+ */
10
+ export declare const ELEMENT_TYPES: {
11
+ readonly KEY_CHALLENGE: {
12
+ readonly value: "key_challenge";
13
+ readonly label: "Key Challenge";
14
+ readonly acronym: "CHL";
15
+ };
16
+ readonly SUPPORTING_FACT: {
17
+ readonly value: "supporting_fact";
18
+ readonly label: "Supporting Fact";
19
+ readonly acronym: "FCT";
20
+ };
21
+ readonly IMPACT: {
22
+ readonly value: "impact";
23
+ readonly label: "Impact";
24
+ readonly acronym: "IMP";
25
+ };
26
+ readonly GUIDING_POLICY: {
27
+ readonly value: "guiding_policy";
28
+ readonly label: "Guiding Policy";
29
+ readonly acronym: "POL";
30
+ };
31
+ readonly COMPETITOR_MOVE: {
32
+ readonly value: "competitor_move";
33
+ readonly label: "Competitor Move";
34
+ readonly acronym: "CMV";
35
+ };
36
+ readonly SCOPE: {
37
+ readonly value: "scope";
38
+ readonly label: "Scope";
39
+ readonly acronym: "SCP";
40
+ };
41
+ readonly CONSTRAINT: {
42
+ readonly value: "constraint";
43
+ readonly label: "Constraint";
44
+ readonly acronym: "CST";
45
+ };
46
+ readonly SOLUTION: {
47
+ readonly value: "solution";
48
+ readonly label: "Solution";
49
+ readonly acronym: "SOL";
50
+ };
51
+ readonly ASSUMPTION_HYPOTHESIS: {
52
+ readonly value: "assumption_hypothesis";
53
+ readonly label: "Assumption Hypothesis";
54
+ readonly acronym: "HYP";
55
+ };
56
+ readonly EXPERIMENT: {
57
+ readonly value: "experiment";
58
+ readonly label: "Experiment";
59
+ readonly acronym: "EXP";
60
+ };
61
+ readonly ACTION: {
62
+ readonly value: "action";
63
+ readonly label: "Action";
64
+ readonly acronym: "ACT";
65
+ };
66
+ readonly INVESTMENT: {
67
+ readonly value: "investment";
68
+ readonly label: "Investment";
69
+ readonly acronym: "INV";
70
+ };
71
+ readonly ESTIMATE: {
72
+ readonly value: "estimate";
73
+ readonly label: "Estimate";
74
+ readonly acronym: "EST";
75
+ };
76
+ readonly BASELINE: {
77
+ readonly value: "baseline";
78
+ readonly label: "Baseline";
79
+ readonly acronym: "BSL";
80
+ };
81
+ readonly OUTCOME: {
82
+ readonly value: "outcome";
83
+ readonly label: "Outcome";
84
+ readonly acronym: "OCM";
85
+ };
86
+ readonly PERFORMANCE_VARIABLE: {
87
+ readonly value: "performance_variable";
88
+ readonly label: "Performance Variable";
89
+ readonly acronym: "VAR";
90
+ };
91
+ readonly CAPABILITY: {
92
+ readonly value: "capability";
93
+ readonly label: "Capability";
94
+ readonly acronym: "CAP";
95
+ };
96
+ readonly SYSTEM: {
97
+ readonly value: "system";
98
+ readonly label: "System";
99
+ readonly acronym: "SYS";
100
+ };
101
+ readonly PRINCIPLE: {
102
+ readonly value: "principle";
103
+ readonly label: "Principle";
104
+ readonly acronym: "PRN";
105
+ };
106
+ };
107
+ export declare const COMPONENT_TYPES: {
108
+ readonly DIAGNOSIS: {
109
+ readonly value: "diagnosis";
110
+ readonly label: "Diagnosis";
111
+ readonly acronym: "BD";
112
+ };
113
+ readonly METHOD: {
114
+ readonly value: "method";
115
+ readonly label: "Method & Positioning";
116
+ readonly acronym: "MP";
117
+ };
118
+ readonly INITIATIVES: {
119
+ readonly value: "initiatives";
120
+ readonly label: "Portfolio of Initiatives";
121
+ readonly acronym: "PI";
122
+ };
123
+ readonly MEASURES: {
124
+ readonly value: "measures";
125
+ readonly label: "Measures";
126
+ readonly acronym: "M";
127
+ };
128
+ readonly SUPPORT: {
129
+ readonly value: "support";
130
+ readonly label: "Support Structures";
131
+ readonly acronym: "SS";
132
+ };
133
+ };
134
+ export declare const SKHEMA_MAPPING: {
135
+ readonly componentFlow: readonly [{
136
+ readonly value: "diagnosis";
137
+ readonly label: "Diagnosis";
138
+ readonly acronym: "BD";
139
+ }, {
140
+ readonly value: "method";
141
+ readonly label: "Method & Positioning";
142
+ readonly acronym: "MP";
143
+ }, {
144
+ readonly value: "initiatives";
145
+ readonly label: "Portfolio of Initiatives";
146
+ readonly acronym: "PI";
147
+ }, {
148
+ readonly value: "measures";
149
+ readonly label: "Measures";
150
+ readonly acronym: "M";
151
+ }, {
152
+ readonly value: "support";
153
+ readonly label: "Support Structures";
154
+ readonly acronym: "SS";
155
+ }];
156
+ readonly elementFlow: {
157
+ readonly diagnosis: readonly [{
158
+ readonly value: "key_challenge";
159
+ readonly label: "Key Challenge";
160
+ readonly acronym: "CHL";
161
+ }, {
162
+ readonly value: "supporting_fact";
163
+ readonly label: "Supporting Fact";
164
+ readonly acronym: "FCT";
165
+ }, {
166
+ readonly value: "impact";
167
+ readonly label: "Impact";
168
+ readonly acronym: "IMP";
169
+ }];
170
+ readonly method: readonly [{
171
+ readonly value: "guiding_policy";
172
+ readonly label: "Guiding Policy";
173
+ readonly acronym: "POL";
174
+ }, {
175
+ readonly value: "competitor_move";
176
+ readonly label: "Competitor Move";
177
+ readonly acronym: "CMV";
178
+ }, {
179
+ readonly value: "scope";
180
+ readonly label: "Scope";
181
+ readonly acronym: "SCP";
182
+ }, {
183
+ readonly value: "constraint";
184
+ readonly label: "Constraint";
185
+ readonly acronym: "CST";
186
+ }];
187
+ readonly initiatives: readonly [{
188
+ readonly value: "solution";
189
+ readonly label: "Solution";
190
+ readonly acronym: "SOL";
191
+ }, {
192
+ readonly value: "assumption_hypothesis";
193
+ readonly label: "Assumption Hypothesis";
194
+ readonly acronym: "HYP";
195
+ }, {
196
+ readonly value: "experiment";
197
+ readonly label: "Experiment";
198
+ readonly acronym: "EXP";
199
+ }, {
200
+ readonly value: "action";
201
+ readonly label: "Action";
202
+ readonly acronym: "ACT";
203
+ }, {
204
+ readonly value: "estimate";
205
+ readonly label: "Estimate";
206
+ readonly acronym: "EST";
207
+ }, {
208
+ readonly value: "investment";
209
+ readonly label: "Investment";
210
+ readonly acronym: "INV";
211
+ }];
212
+ readonly measures: readonly [{
213
+ readonly value: "baseline";
214
+ readonly label: "Baseline";
215
+ readonly acronym: "BSL";
216
+ }, {
217
+ readonly value: "outcome";
218
+ readonly label: "Outcome";
219
+ readonly acronym: "OCM";
220
+ }, {
221
+ readonly value: "performance_variable";
222
+ readonly label: "Performance Variable";
223
+ readonly acronym: "VAR";
224
+ }];
225
+ readonly support: readonly [{
226
+ readonly value: "capability";
227
+ readonly label: "Capability";
228
+ readonly acronym: "CAP";
229
+ }, {
230
+ readonly value: "system";
231
+ readonly label: "System";
232
+ readonly acronym: "SYS";
233
+ }, {
234
+ readonly value: "principle";
235
+ readonly label: "Principle";
236
+ readonly acronym: "PRN";
237
+ }];
238
+ };
239
+ };
240
+ export type ElementType = (typeof ELEMENT_TYPES)[keyof typeof ELEMENT_TYPES];
241
+ export type ElementValue = ElementType['value'];
242
+ export type ComponentType = (typeof COMPONENT_TYPES)[keyof typeof COMPONENT_TYPES];
243
+ export type ComponentValue = ComponentType['value'];
244
+ //# sourceMappingURL=method-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"method-schema.d.ts","sourceRoot":"","sources":["../src/method-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgGhB,CAAA;AAEV,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BlB,CAAA;AAEV,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCjB,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAA;AAC5E,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;AAC/C,MAAM,MAAM,aAAa,GACvB,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAA;AACxD,MAAM,MAAM,cAAc,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA"}
package/dist/render.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- require("./validation-DCw9rQeH.cjs");
4
- const render = require("./index-DBeyneZT.cjs");
3
+ require("./tokens-BxpYMhDq.cjs");
4
+ const render = require("./index-B8ZF3snD.cjs");
5
5
  exports.renderComponentCardHtml = render.renderComponentCardHtml;
6
6
  exports.renderElementCardHtml = render.renderElementCardHtml;
7
7
  //# sourceMappingURL=render.cjs.map
package/dist/render.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./validation-Dt4L_df8.js";
2
- import { r, a } from "./index-jwx5CXLB.js";
1
+ import "./tokens-BQf5zJ3j.js";
2
+ import { r, a } from "./index-nkGvTyQR.js";
3
3
  export {
4
4
  r as renderComponentCardHtml,
5
5
  a as renderElementCardHtml
@@ -1,4 +1,3 @@
1
- import { COMPONENT_TYPES, SKHEMA_MAPPING, ELEMENT_TYPES } from "@skhema/types";
2
1
  const COMPONENT_COLORS = {
3
2
  diagnosis: {
4
3
  bg: "oklch(0.65 0.06 25 / 0.15)",
@@ -77,6 +76,163 @@ const CARD_VARS = {
77
76
  }
78
77
  };
79
78
  const USER_ICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>`;
79
+ const ELEMENT_TYPES = {
80
+ KEY_CHALLENGE: {
81
+ value: "key_challenge",
82
+ label: "Key Challenge",
83
+ acronym: "CHL"
84
+ },
85
+ SUPPORTING_FACT: {
86
+ value: "supporting_fact",
87
+ label: "Supporting Fact",
88
+ acronym: "FCT"
89
+ },
90
+ IMPACT: {
91
+ value: "impact",
92
+ label: "Impact",
93
+ acronym: "IMP"
94
+ },
95
+ GUIDING_POLICY: {
96
+ value: "guiding_policy",
97
+ label: "Guiding Policy",
98
+ acronym: "POL"
99
+ },
100
+ COMPETITOR_MOVE: {
101
+ value: "competitor_move",
102
+ label: "Competitor Move",
103
+ acronym: "CMV"
104
+ },
105
+ SCOPE: {
106
+ value: "scope",
107
+ label: "Scope",
108
+ acronym: "SCP"
109
+ },
110
+ CONSTRAINT: {
111
+ value: "constraint",
112
+ label: "Constraint",
113
+ acronym: "CST"
114
+ },
115
+ SOLUTION: {
116
+ value: "solution",
117
+ label: "Solution",
118
+ acronym: "SOL"
119
+ },
120
+ ASSUMPTION_HYPOTHESIS: {
121
+ value: "assumption_hypothesis",
122
+ label: "Assumption Hypothesis",
123
+ acronym: "HYP"
124
+ },
125
+ EXPERIMENT: {
126
+ value: "experiment",
127
+ label: "Experiment",
128
+ acronym: "EXP"
129
+ },
130
+ ACTION: {
131
+ value: "action",
132
+ label: "Action",
133
+ acronym: "ACT"
134
+ },
135
+ INVESTMENT: {
136
+ value: "investment",
137
+ label: "Investment",
138
+ acronym: "INV"
139
+ },
140
+ ESTIMATE: {
141
+ value: "estimate",
142
+ label: "Estimate",
143
+ acronym: "EST"
144
+ },
145
+ BASELINE: {
146
+ value: "baseline",
147
+ label: "Baseline",
148
+ acronym: "BSL"
149
+ },
150
+ OUTCOME: {
151
+ value: "outcome",
152
+ label: "Outcome",
153
+ acronym: "OCM"
154
+ },
155
+ PERFORMANCE_VARIABLE: {
156
+ value: "performance_variable",
157
+ label: "Performance Variable",
158
+ acronym: "VAR"
159
+ },
160
+ CAPABILITY: {
161
+ value: "capability",
162
+ label: "Capability",
163
+ acronym: "CAP"
164
+ },
165
+ SYSTEM: {
166
+ value: "system",
167
+ label: "System",
168
+ acronym: "SYS"
169
+ },
170
+ PRINCIPLE: {
171
+ value: "principle",
172
+ label: "Principle",
173
+ acronym: "PRN"
174
+ }
175
+ };
176
+ const COMPONENT_TYPES = {
177
+ DIAGNOSIS: {
178
+ value: "diagnosis",
179
+ label: "Diagnosis",
180
+ acronym: "BD"
181
+ },
182
+ METHOD: {
183
+ value: "method",
184
+ label: "Method & Positioning",
185
+ acronym: "MP"
186
+ },
187
+ INITIATIVES: {
188
+ value: "initiatives",
189
+ label: "Portfolio of Initiatives",
190
+ acronym: "PI"
191
+ },
192
+ MEASURES: {
193
+ value: "measures",
194
+ label: "Measures",
195
+ acronym: "M"
196
+ },
197
+ SUPPORT: {
198
+ value: "support",
199
+ label: "Support Structures",
200
+ acronym: "SS"
201
+ }
202
+ };
203
+ const SKHEMA_MAPPING = {
204
+ elementFlow: {
205
+ [COMPONENT_TYPES.DIAGNOSIS.value]: [
206
+ ELEMENT_TYPES.KEY_CHALLENGE,
207
+ ELEMENT_TYPES.SUPPORTING_FACT,
208
+ ELEMENT_TYPES.IMPACT
209
+ ],
210
+ [COMPONENT_TYPES.METHOD.value]: [
211
+ ELEMENT_TYPES.GUIDING_POLICY,
212
+ ELEMENT_TYPES.COMPETITOR_MOVE,
213
+ ELEMENT_TYPES.SCOPE,
214
+ ELEMENT_TYPES.CONSTRAINT
215
+ ],
216
+ [COMPONENT_TYPES.INITIATIVES.value]: [
217
+ ELEMENT_TYPES.SOLUTION,
218
+ ELEMENT_TYPES.ASSUMPTION_HYPOTHESIS,
219
+ ELEMENT_TYPES.EXPERIMENT,
220
+ ELEMENT_TYPES.ACTION,
221
+ ELEMENT_TYPES.ESTIMATE,
222
+ ELEMENT_TYPES.INVESTMENT
223
+ ],
224
+ [COMPONENT_TYPES.MEASURES.value]: [
225
+ ELEMENT_TYPES.BASELINE,
226
+ ELEMENT_TYPES.OUTCOME,
227
+ ELEMENT_TYPES.PERFORMANCE_VARIABLE
228
+ ],
229
+ [COMPONENT_TYPES.SUPPORT.value]: [
230
+ ELEMENT_TYPES.CAPABILITY,
231
+ ELEMENT_TYPES.SYSTEM,
232
+ ELEMENT_TYPES.PRINCIPLE
233
+ ]
234
+ }
235
+ };
80
236
  function isValidComponentType(componentType) {
81
237
  const validTypes = Object.values(COMPONENT_TYPES).map((t) => t.value);
82
238
  return validTypes.includes(componentType);
@@ -151,27 +307,27 @@ function getElementTypeAcronym(elementType) {
151
307
  return type?.acronym || elementType.substring(0, 2).toUpperCase();
152
308
  }
153
309
  export {
154
- CARD_VARS as C,
310
+ CARD_PALETTE as C,
155
311
  FONT_STACK as F,
156
312
  MONO_STACK as M,
157
313
  PRIMARY_HEX as P,
158
314
  USER_ICON_SVG as U,
159
- COMPONENT_COLORS as a,
315
+ getComponentTypeAcronym as a,
160
316
  getComponentTypeLabel as b,
161
- getElementTypeAcronym as c,
162
- getElementTypeLabel as d,
163
- getElementTypesForComponent as e,
164
- isValidElementType as f,
165
- getComponentTypeAcronym as g,
166
- CARD_PALETTE as h,
317
+ COMPONENT_COLORS as c,
318
+ CARD_RADIUS as d,
319
+ CARD_SHADOW as e,
320
+ getElementTypesForComponent as f,
321
+ getElementTypeLabel as g,
322
+ CARD_SHADOW_LG as h,
167
323
  isValidComponentType as i,
168
- CARD_RADIUS as j,
169
- CARD_SHADOW as k,
170
- CARD_SHADOW_LG as l,
171
- PRIMARY_HOVER_HEX as m,
172
- PRIMARY_PRESSED_HEX as n,
173
- validateAttributes as o,
324
+ PRIMARY_HOVER_HEX as j,
325
+ PRIMARY_PRESSED_HEX as k,
326
+ validateAttributes as l,
327
+ getElementTypeAcronym as m,
328
+ isValidElementType as n,
329
+ CARD_VARS as o,
174
330
  resolveComponentType as r,
175
331
  validateElementBelongsToComponent as v
176
332
  };
177
- //# sourceMappingURL=validation-Dt4L_df8.js.map
333
+ //# sourceMappingURL=tokens-BQf5zJ3j.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens-BQf5zJ3j.js","sources":["../src/styles/design-tokens.ts","../src/method-schema.ts","../src/utils/component-validation.ts","../src/utils/validation.ts"],"sourcesContent":["/**\n * Hardcoded color tokens for component-type badge colors.\n * Embeds can't rely on host page CSS vars, so we use inline values.\n * Source: skhema-web/src/app/globals.css oklch tokens converted to HSL-ish for browser compat.\n */\n\nexport const COMPONENT_COLORS = {\n diagnosis: {\n bg: 'oklch(0.65 0.06 25 / 0.15)',\n text: 'oklch(0.65 0.06 25)',\n border: 'oklch(0.65 0.06 25 / 0.3)',\n },\n method: {\n bg: 'oklch(0.6 0.06 250 / 0.15)',\n text: 'oklch(0.6 0.06 250)',\n border: 'oklch(0.6 0.06 250 / 0.3)',\n },\n initiatives: {\n bg: 'oklch(0.6 0.06 155 / 0.15)',\n text: 'oklch(0.6 0.06 155)',\n border: 'oklch(0.6 0.06 155 / 0.3)',\n },\n measures: {\n bg: 'oklch(0.6 0.06 300 / 0.15)',\n text: 'oklch(0.6 0.06 300)',\n border: 'oklch(0.6 0.06 300 / 0.3)',\n },\n support: {\n bg: 'oklch(0.65 0.06 65 / 0.15)',\n text: 'oklch(0.65 0.06 65)',\n border: 'oklch(0.65 0.06 65 / 0.3)',\n },\n} as const\n\nexport type ComponentColorKey = keyof typeof COMPONENT_COLORS\n\n/**\n * Email-safe flat hex palette for the card surface, per theme. These mirror the\n * Tailwind slate values behind the `CARD_VARS` HSL tokens, pre-resolved to hex\n * because email clients ignore `<style>` / CSS vars. The card renderer\n * (`@skhema/embed/render`) inlines these so the live browser embed and email\n * share one colour system (see the \"converge on hex\" decision).\n */\nexport const CARD_PALETTE = {\n light: {\n cardBg: '#ffffff', // hsl(0 0% 100%)\n border: '#e2e8f0', // hsl(214.3 31.8% 91.4%) — slate-200\n text: '#020817', // hsl(222.2 84% 4.9%) — slate-950\n textMuted: '#64748b', // hsl(215.4 16.3% 46.9%) — slate-500\n },\n dark: {\n cardBg: '#020817', // hsl(222.2 84% 4.9%) — slate-950\n border: '#1e293b', // hsl(217.2 32.6% 17.5%) — slate-800\n text: '#f8fafc', // hsl(210 40% 98%) — slate-50\n textMuted: '#94a3b8', // hsl(215 20.2% 65.1%) — slate-400\n },\n} as const\n\nexport type CardTheme = keyof typeof CARD_PALETTE\n\n/** Save-button brand colours (hex) — match the `--skhema-primary*` HSL tokens. */\nexport const PRIMARY_HEX = '#cd476a' // hsl(344 57% 54%)\nexport const PRIMARY_HOVER_HEX = '#b53d5e' // hsl(344 50% 47%)\nexport const PRIMARY_PRESSED_HEX = '#9d3552' // hsl(343 50% 41%)\n\n/** Card geometry / typography shared by the renderer and the browser embed. */\nexport const CARD_RADIUS = '4px' // calc(0.1rem + 2px) ≈ 3.6px\nexport const CARD_SHADOW =\n '0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)'\nexport const CARD_SHADOW_LG =\n '0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)'\nexport const FONT_STACK =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Inter', sans-serif\"\nexport const MONO_STACK =\n \"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace\"\n\n/**\n * Shared base card CSS variables for light and dark modes.\n */\nexport const CARD_VARS = {\n light: {\n '--skhema-bg': 'hsl(0 0% 100%)',\n '--skhema-card': 'hsl(0 0% 100%)',\n '--skhema-border': 'hsl(214.3 31.8% 91.4%)',\n '--skhema-text': 'hsl(222.2 84% 4.9%)',\n '--skhema-text-muted': 'hsl(215.4 16.3% 46.9%)',\n '--skhema-accent': 'hsl(210 40% 96%)',\n '--skhema-surface-subtle': 'hsl(210 40% 97%)',\n },\n dark: {\n '--skhema-bg': 'hsl(222.2 84% 4.9%)',\n '--skhema-card': 'hsl(222.2 84% 4.9%)',\n '--skhema-border': 'hsl(217.2 32.6% 17.5%)',\n '--skhema-text': 'hsl(210 40% 98%)',\n '--skhema-text-muted': 'hsl(215 20.2% 65.1%)',\n '--skhema-accent': 'hsl(217.2 32.6% 17.5%)',\n '--skhema-surface-subtle': 'hsl(217.2 32.6% 12%)',\n },\n} as const\n\n/**\n * User SVG icon (inline, no external deps).\n */\nexport const USER_ICON_SVG = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\"/><circle cx=\"12\" cy=\"7\" r=\"4\"/></svg>`\n","/**\n * Vendored from @skhema/types (src/schema/{elements,components,mapping}.ts).\n *\n * @skhema/types is a restricted npm package; @skhema/embed is public, so it\n * must not depend on it at install time. This is the public method vocabulary\n * (it renders verbatim in public embeds) — keep it in sync with @skhema/types\n * when the method schema changes (same pattern as\n * skhema-cli/src/lib/contribute/method-schema.ts).\n */\n\nexport const ELEMENT_TYPES = {\n KEY_CHALLENGE: {\n value: 'key_challenge',\n label: 'Key Challenge',\n acronym: 'CHL',\n },\n SUPPORTING_FACT: {\n value: 'supporting_fact',\n label: 'Supporting Fact',\n acronym: 'FCT',\n },\n IMPACT: {\n value: 'impact',\n label: 'Impact',\n acronym: 'IMP',\n },\n GUIDING_POLICY: {\n value: 'guiding_policy',\n label: 'Guiding Policy',\n acronym: 'POL',\n },\n COMPETITOR_MOVE: {\n value: 'competitor_move',\n label: 'Competitor Move',\n acronym: 'CMV',\n },\n SCOPE: {\n value: 'scope',\n label: 'Scope',\n acronym: 'SCP',\n },\n CONSTRAINT: {\n value: 'constraint',\n label: 'Constraint',\n acronym: 'CST',\n },\n SOLUTION: {\n value: 'solution',\n label: 'Solution',\n acronym: 'SOL',\n },\n ASSUMPTION_HYPOTHESIS: {\n value: 'assumption_hypothesis',\n label: 'Assumption Hypothesis',\n acronym: 'HYP',\n },\n EXPERIMENT: {\n value: 'experiment',\n label: 'Experiment',\n acronym: 'EXP',\n },\n ACTION: {\n value: 'action',\n label: 'Action',\n acronym: 'ACT',\n },\n INVESTMENT: {\n value: 'investment',\n label: 'Investment',\n acronym: 'INV',\n },\n ESTIMATE: {\n value: 'estimate',\n label: 'Estimate',\n acronym: 'EST',\n },\n BASELINE: {\n value: 'baseline',\n label: 'Baseline',\n acronym: 'BSL',\n },\n OUTCOME: {\n value: 'outcome',\n label: 'Outcome',\n acronym: 'OCM',\n },\n PERFORMANCE_VARIABLE: {\n value: 'performance_variable',\n label: 'Performance Variable',\n acronym: 'VAR',\n },\n CAPABILITY: {\n value: 'capability',\n label: 'Capability',\n acronym: 'CAP',\n },\n SYSTEM: {\n value: 'system',\n label: 'System',\n acronym: 'SYS',\n },\n PRINCIPLE: {\n value: 'principle',\n label: 'Principle',\n acronym: 'PRN',\n },\n} as const\n\nexport const COMPONENT_TYPES = {\n DIAGNOSIS: {\n value: 'diagnosis',\n label: 'Diagnosis',\n acronym: 'BD',\n },\n METHOD: {\n value: 'method',\n label: 'Method & Positioning',\n acronym: 'MP',\n },\n INITIATIVES: {\n value: 'initiatives',\n label: 'Portfolio of Initiatives',\n acronym: 'PI',\n },\n MEASURES: {\n value: 'measures',\n label: 'Measures',\n acronym: 'M',\n },\n SUPPORT: {\n value: 'support',\n label: 'Support Structures',\n acronym: 'SS',\n },\n} as const\n\nexport const SKHEMA_MAPPING = {\n componentFlow: [\n COMPONENT_TYPES.DIAGNOSIS,\n COMPONENT_TYPES.METHOD,\n COMPONENT_TYPES.INITIATIVES,\n COMPONENT_TYPES.MEASURES,\n COMPONENT_TYPES.SUPPORT,\n ] as const,\n\n elementFlow: {\n [COMPONENT_TYPES.DIAGNOSIS.value]: [\n ELEMENT_TYPES.KEY_CHALLENGE,\n ELEMENT_TYPES.SUPPORTING_FACT,\n ELEMENT_TYPES.IMPACT,\n ],\n [COMPONENT_TYPES.METHOD.value]: [\n ELEMENT_TYPES.GUIDING_POLICY,\n ELEMENT_TYPES.COMPETITOR_MOVE,\n ELEMENT_TYPES.SCOPE,\n ELEMENT_TYPES.CONSTRAINT,\n ],\n [COMPONENT_TYPES.INITIATIVES.value]: [\n ELEMENT_TYPES.SOLUTION,\n ELEMENT_TYPES.ASSUMPTION_HYPOTHESIS,\n ELEMENT_TYPES.EXPERIMENT,\n ELEMENT_TYPES.ACTION,\n ELEMENT_TYPES.ESTIMATE,\n ELEMENT_TYPES.INVESTMENT,\n ],\n [COMPONENT_TYPES.MEASURES.value]: [\n ELEMENT_TYPES.BASELINE,\n ELEMENT_TYPES.OUTCOME,\n ELEMENT_TYPES.PERFORMANCE_VARIABLE,\n ],\n [COMPONENT_TYPES.SUPPORT.value]: [\n ELEMENT_TYPES.CAPABILITY,\n ELEMENT_TYPES.SYSTEM,\n ELEMENT_TYPES.PRINCIPLE,\n ],\n } as const,\n} as const\n\nexport type ElementType = (typeof ELEMENT_TYPES)[keyof typeof ELEMENT_TYPES]\nexport type ElementValue = ElementType['value']\nexport type ComponentType =\n (typeof COMPONENT_TYPES)[keyof typeof COMPONENT_TYPES]\nexport type ComponentValue = ComponentType['value']\n","import type { ComponentValue, ElementValue } from '../method-schema.js'\nimport { COMPONENT_TYPES, SKHEMA_MAPPING } from '../method-schema.js'\n\n/**\n * Validate that a string is a valid component type.\n */\nexport function isValidComponentType(\n componentType: string\n): componentType is ComponentValue {\n const validTypes = Object.values(COMPONENT_TYPES).map((t) => t.value)\n return validTypes.includes(componentType as ComponentValue)\n}\n\n/**\n * Validate that an element type belongs to the given component type.\n */\nexport function validateElementBelongsToComponent(\n elementType: string,\n componentType: string\n): boolean {\n if (!isValidComponentType(componentType)) return false\n\n const validElements =\n SKHEMA_MAPPING.elementFlow[\n componentType as keyof typeof SKHEMA_MAPPING.elementFlow\n ]\n if (!validElements) return false\n\n return validElements.some((e) => e.value === elementType)\n}\n\n/**\n * Get the human-readable label for a component type.\n */\nexport function getComponentTypeLabel(componentType: string): string {\n const type = Object.values(COMPONENT_TYPES).find(\n (t) => t.value === componentType\n )\n return type?.label || componentType\n}\n\n/**\n * Get the acronym for a component type (e.g., 'BD' for diagnosis).\n */\nexport function getComponentTypeAcronym(componentType: string): string {\n const type = Object.values(COMPONENT_TYPES).find(\n (t) => t.value === componentType\n )\n return type?.acronym || componentType.substring(0, 2).toUpperCase()\n}\n\n/**\n * Resolve which component type an element belongs to.\n * Returns the component value, or 'diagnosis' as fallback.\n */\nexport function resolveComponentType(elementType: string): ComponentValue {\n for (const [componentValue, elements] of Object.entries(\n SKHEMA_MAPPING.elementFlow\n )) {\n if (elements.some((e) => e.value === elementType)) {\n return componentValue as ComponentValue\n }\n }\n return 'diagnosis'\n}\n\n/**\n * Get all valid element types for a given component, ordered per the mapping.\n */\nexport function getElementTypesForComponent(\n componentType: string\n): ElementValue[] {\n if (!isValidComponentType(componentType)) return []\n const elements =\n SKHEMA_MAPPING.elementFlow[\n componentType as keyof typeof SKHEMA_MAPPING.elementFlow\n ]\n return elements?.map((e) => e.value) || []\n}\n","import type { ElementValue } from '../method-schema.js'\nimport { ELEMENT_TYPES } from '../method-schema.js'\n\nexport function isValidElementType(\n elementType: string\n): elementType is ElementValue {\n const validTypes = Object.values(ELEMENT_TYPES).map((type) => type.value)\n return validTypes.includes(elementType as ElementValue)\n}\n\nexport function validateAttributes(element: HTMLElement): {\n isValid: boolean\n errors: string[]\n elementType?: ElementValue\n contributorId?: string\n} {\n const errors: string[] = []\n\n const elementType = element.getAttribute('element-type')\n const contributorId = element.getAttribute('contributor-id')\n\n if (!elementType) {\n errors.push('Missing required attribute: element-type')\n } else if (!isValidElementType(elementType)) {\n const validTypes = Object.values(ELEMENT_TYPES)\n .map((t) => t.value)\n .join(', ')\n errors.push(\n `Invalid element-type \"${elementType}\". Valid types: ${validTypes}`\n )\n }\n\n if (!contributorId) {\n errors.push('Missing required attribute: contributor-id')\n } else if (contributorId.trim().length === 0) {\n errors.push('contributor-id cannot be empty')\n }\n\n return {\n isValid: errors.length === 0,\n errors,\n elementType: isValidElementType(elementType || '')\n ? (elementType as ElementValue)\n : undefined,\n contributorId: contributorId || undefined,\n }\n}\n\nexport function getElementTypeLabel(elementType: ElementValue): string {\n const type = Object.values(ELEMENT_TYPES).find((t) => t.value === elementType)\n return type?.label || elementType\n}\n\nexport function getElementTypeAcronym(elementType: ElementValue): string {\n const type = Object.values(ELEMENT_TYPES).find((t) => t.value === elementType)\n return type?.acronym || elementType.substring(0, 2).toUpperCase()\n}\n"],"names":[],"mappings":"AAMO,MAAM,mBAAmB;AAAA,EAC9B,WAAW;AAAA,IACT,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,EAAA;AAAA,EAEV,QAAQ;AAAA,IACN,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,EAAA;AAAA,EAEV,aAAa;AAAA,IACX,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,EAAA;AAAA,EAEV,UAAU;AAAA,IACR,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,EAAA;AAAA,EAEV,SAAS;AAAA,IACP,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,EAAA;AAEZ;AAWO,MAAM,eAAe;AAAA,EAC1B,OAAO;AAAA,IACL,QAAQ;AAAA;AAAA,IACR,QAAQ;AAAA;AAAA,IACR,MAAM;AAAA;AAAA,IACN,WAAW;AAAA;AAAA,EAAA;AAAA,EAEb,MAAM;AAAA,IACJ,QAAQ;AAAA;AAAA,IACR,QAAQ;AAAA;AAAA,IACR,MAAM;AAAA;AAAA,IACN,WAAW;AAAA;AAAA,EAAA;AAEf;AAKO,MAAM,cAAc;AACpB,MAAM,oBAAoB;AAC1B,MAAM,sBAAsB;AAG5B,MAAM,cAAc;AACpB,MAAM,cACX;AACK,MAAM,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