@shoplix-ai/sdui-schema 1.0.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/LICENSE +21 -0
- package/dist/action.d.ts +26 -0
- package/dist/action.d.ts.map +1 -0
- package/dist/action.js +27 -0
- package/dist/action.js.map +1 -0
- package/dist/assets.d.ts +80 -0
- package/dist/assets.d.ts.map +1 -0
- package/dist/assets.js +101 -0
- package/dist/assets.js.map +1 -0
- package/dist/binding.d.ts +144 -0
- package/dist/binding.d.ts.map +1 -0
- package/dist/binding.js +80 -0
- package/dist/binding.js.map +1 -0
- package/dist/block-definition.d.ts +1639 -0
- package/dist/block-definition.d.ts.map +1 -0
- package/dist/block-definition.js +527 -0
- package/dist/block-definition.js.map +1 -0
- package/dist/block-type-id.d.ts +15 -0
- package/dist/block-type-id.d.ts.map +1 -0
- package/dist/block-type-id.js +43 -0
- package/dist/block-type-id.js.map +1 -0
- package/dist/block-type.d.ts +21 -0
- package/dist/block-type.d.ts.map +1 -0
- package/dist/block-type.js +24 -0
- package/dist/block-type.js.map +1 -0
- package/dist/blocks.d.ts +922 -0
- package/dist/blocks.d.ts.map +1 -0
- package/dist/blocks.js +353 -0
- package/dist/blocks.js.map +1 -0
- package/dist/definition-validator.d.ts +47 -0
- package/dist/definition-validator.d.ts.map +1 -0
- package/dist/definition-validator.js +340 -0
- package/dist/definition-validator.js.map +1 -0
- package/dist/display.d.ts +139 -0
- package/dist/display.d.ts.map +1 -0
- package/dist/display.js +118 -0
- package/dist/display.js.map +1 -0
- package/dist/envelope.d.ts +2721 -0
- package/dist/envelope.d.ts.map +1 -0
- package/dist/envelope.js +116 -0
- package/dist/envelope.js.map +1 -0
- package/dist/icons.d.ts +10 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +49 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/locale.d.ts +11 -0
- package/dist/locale.d.ts.map +1 -0
- package/dist/locale.js +15 -0
- package/dist/locale.js.map +1 -0
- package/dist/manifest.d.ts +28 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +242 -0
- package/dist/manifest.js.map +1 -0
- package/dist/parse.d.ts +33 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +61 -0
- package/dist/parse.js.map +1 -0
- package/dist/path.d.ts +3 -0
- package/dist/path.d.ts.map +1 -0
- package/dist/path.js +14 -0
- package/dist/path.js.map +1 -0
- package/dist/primitives.d.ts +1206 -0
- package/dist/primitives.d.ts.map +1 -0
- package/dist/primitives.js +631 -0
- package/dist/primitives.js.map +1 -0
- package/dist/props.d.ts +9 -0
- package/dist/props.d.ts.map +1 -0
- package/dist/props.js +12 -0
- package/dist/props.js.map +1 -0
- package/dist/screen.d.ts +57 -0
- package/dist/screen.d.ts.map +1 -0
- package/dist/screen.js +76 -0
- package/dist/screen.js.map +1 -0
- package/dist/starters/electronics.d.ts +3 -0
- package/dist/starters/electronics.d.ts.map +1 -0
- package/dist/starters/electronics.js +235 -0
- package/dist/starters/electronics.js.map +1 -0
- package/dist/starters/fashion.d.ts +3 -0
- package/dist/starters/fashion.d.ts.map +1 -0
- package/dist/starters/fashion.js +232 -0
- package/dist/starters/fashion.js.map +1 -0
- package/dist/starters/index.d.ts +5 -0
- package/dist/starters/index.d.ts.map +1 -0
- package/dist/starters/index.js +10 -0
- package/dist/starters/index.js.map +1 -0
- package/dist/starters/minimal.d.ts +3 -0
- package/dist/starters/minimal.d.ts.map +1 -0
- package/dist/starters/minimal.js +232 -0
- package/dist/starters/minimal.js.map +1 -0
- package/dist/starters/starter-seed.d.ts +17 -0
- package/dist/starters/starter-seed.d.ts.map +1 -0
- package/dist/starters/starter-seed.js +2 -0
- package/dist/starters/starter-seed.js.map +1 -0
- package/dist/theme.d.ts +54 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +68 -0
- package/dist/theme.js.map +1 -0
- package/dist/tokens.d.ts +115 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +349 -0
- package/dist/tokens.js.map +1 -0
- package/dist/version.d.ts +11 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +10 -0
- package/dist/version.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { ROW_FIELD_TYPES, SETTING_TYPES, } from './block-definition.js';
|
|
2
|
+
import { parseBlockDefinition } from './parse.js';
|
|
3
|
+
import { definitionPathOf } from './path.js';
|
|
4
|
+
import { composedBodyConditions, composedBodyItemUses, composedBodyReferences, composedBodyRepeaters, composedBodyShape, enumSlotValues, isTokenRole, nodeAtBodyPath, unknownPrimitivesOf, } from './primitives.js';
|
|
5
|
+
import { SEMANTIC_TOKENS } from './tokens.js';
|
|
6
|
+
/**
|
|
7
|
+
* What a pushed Block Definition is held to, wherever it is held: the api
|
|
8
|
+
* refuses with these, and a developer's own machine refuses the same way
|
|
9
|
+
* before anything leaves it.
|
|
10
|
+
*/
|
|
11
|
+
export const DEFINITION_LIMITS = {
|
|
12
|
+
maxDefinitionNodes: 200,
|
|
13
|
+
maxDefinitionDepth: 6,
|
|
14
|
+
maxDefinitionSettings: 40,
|
|
15
|
+
maxSettingRows: 20,
|
|
16
|
+
maxDefinitionBytes: 200_000,
|
|
17
|
+
};
|
|
18
|
+
export const DEFINITION_ISSUE = {
|
|
19
|
+
parse: 'SDUI_DEFINITION_PARSE',
|
|
20
|
+
unknownPrimitive: 'SDUI_DEFINITION_UNKNOWN_PRIMITIVE',
|
|
21
|
+
unknownSettingType: 'SDUI_DEFINITION_UNKNOWN_SETTING_TYPE',
|
|
22
|
+
unresolvedSetting: 'SDUI_DEFINITION_UNRESOLVED_SETTING',
|
|
23
|
+
unresolvedToken: 'SDUI_DEFINITION_UNRESOLVED_TOKEN',
|
|
24
|
+
unresolvedCondition: 'SDUI_DEFINITION_UNRESOLVED_CONDITION',
|
|
25
|
+
itemOutsideRepeater: 'SDUI_DEFINITION_ITEM_OUTSIDE_REPEATER',
|
|
26
|
+
repeaterWithoutBinding: 'SDUI_DEFINITION_REPEATER_WITHOUT_BINDING',
|
|
27
|
+
nestedRepeater: 'SDUI_DEFINITION_NESTED_REPEATER',
|
|
28
|
+
limitNodes: 'SDUI_LIMIT_DEFINITION_NODES',
|
|
29
|
+
limitDepth: 'SDUI_LIMIT_DEFINITION_DEPTH',
|
|
30
|
+
limitSettings: 'SDUI_LIMIT_DEFINITION_SETTINGS',
|
|
31
|
+
limitSettingRows: 'SDUI_LIMIT_SETTING_ROWS',
|
|
32
|
+
limitBytes: 'SDUI_LIMIT_DEFINITION_BYTES',
|
|
33
|
+
};
|
|
34
|
+
const ROOT = 'definition';
|
|
35
|
+
const SETTING_TYPE_SET = new Set(SETTING_TYPES);
|
|
36
|
+
const ROW_FIELD_TYPE_SET = new Set(ROW_FIELD_TYPES);
|
|
37
|
+
/** Which setting types feed which value slots. */
|
|
38
|
+
const FEEDS = {
|
|
39
|
+
text: ['text'],
|
|
40
|
+
boolean: ['toggle'],
|
|
41
|
+
enum: ['select'],
|
|
42
|
+
dimension: ['number'],
|
|
43
|
+
number: ['number'],
|
|
44
|
+
count: ['number'],
|
|
45
|
+
color: ['color'],
|
|
46
|
+
asset: ['image'],
|
|
47
|
+
action: ['action'],
|
|
48
|
+
};
|
|
49
|
+
const TOKEN_TYPE_OF_SLOT = {
|
|
50
|
+
color: 'color',
|
|
51
|
+
dimension: 'dimension',
|
|
52
|
+
};
|
|
53
|
+
/** A number setting feeding a sized slot must stay inside what the slot's literal accepts. */
|
|
54
|
+
const NUMBER_SLOT_BOUNDS = {
|
|
55
|
+
dimension: { min: 0, max: 1000 },
|
|
56
|
+
number: { min: 0, max: 100 },
|
|
57
|
+
count: { min: 1, max: 24 },
|
|
58
|
+
};
|
|
59
|
+
function definitionPath(segments) {
|
|
60
|
+
return definitionPathOf([ROOT, ...segments]);
|
|
61
|
+
}
|
|
62
|
+
function outOfSlotBounds(setting, slot) {
|
|
63
|
+
const bounds = NUMBER_SLOT_BOUNDS[slot];
|
|
64
|
+
if (bounds === undefined)
|
|
65
|
+
return null;
|
|
66
|
+
if (setting.min === undefined || setting.max === undefined) {
|
|
67
|
+
return `needs both min and max, between ${bounds.min} and ${bounds.max}`;
|
|
68
|
+
}
|
|
69
|
+
if (setting.min < bounds.min || setting.max > bounds.max) {
|
|
70
|
+
return `must stay between ${bounds.min} and ${bounds.max}`;
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
function unknownTypeIssue(type, path, accepted) {
|
|
75
|
+
return {
|
|
76
|
+
code: DEFINITION_ISSUE.unknownSettingType,
|
|
77
|
+
path: definitionPath(path),
|
|
78
|
+
message: `unknown setting type "${type}": expected one of ${accepted.join(', ')}`,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/** A type outside the closed set, at the top level or one level down inside a row. */
|
|
82
|
+
function unknownSettingTypeIssues(raw) {
|
|
83
|
+
const settings = raw?.settings;
|
|
84
|
+
if (!Array.isArray(settings))
|
|
85
|
+
return [];
|
|
86
|
+
const issues = [];
|
|
87
|
+
settings.forEach((setting, index) => {
|
|
88
|
+
const type = setting?.type;
|
|
89
|
+
if (typeof type !== 'string')
|
|
90
|
+
return;
|
|
91
|
+
if (!SETTING_TYPE_SET.has(type)) {
|
|
92
|
+
issues.push(unknownTypeIssue(type, ['settings', index, 'type'], SETTING_TYPES));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (type !== 'rows')
|
|
96
|
+
return;
|
|
97
|
+
const fields = setting.fields;
|
|
98
|
+
if (!Array.isArray(fields))
|
|
99
|
+
return;
|
|
100
|
+
fields.forEach((field, fieldIndex) => {
|
|
101
|
+
const fieldType = field?.type;
|
|
102
|
+
if (typeof fieldType !== 'string' || ROW_FIELD_TYPE_SET.has(fieldType))
|
|
103
|
+
return;
|
|
104
|
+
issues.push(unknownTypeIssue(fieldType, ['settings', index, 'fields', fieldIndex, 'type'], ROW_FIELD_TYPES));
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
return issues;
|
|
108
|
+
}
|
|
109
|
+
function settingReferenceIssue(definition, reference, key, settingsByKey) {
|
|
110
|
+
const path = definitionPath(['body', ...reference.path]);
|
|
111
|
+
const setting = settingsByKey.get(key);
|
|
112
|
+
if (setting === undefined) {
|
|
113
|
+
return {
|
|
114
|
+
code: DEFINITION_ISSUE.unresolvedSetting,
|
|
115
|
+
path,
|
|
116
|
+
message: `setting "${key}" is not declared`,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
if (!FEEDS[reference.slot].includes(setting.type)) {
|
|
120
|
+
return {
|
|
121
|
+
code: DEFINITION_ISSUE.unresolvedSetting,
|
|
122
|
+
path,
|
|
123
|
+
message: `setting "${key}" is a ${setting.type} setting and cannot feed a ${reference.slot} value`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
if (setting.type === 'number') {
|
|
127
|
+
const problem = outOfSlotBounds(setting, reference.slot);
|
|
128
|
+
if (problem !== null) {
|
|
129
|
+
return {
|
|
130
|
+
code: DEFINITION_ISSUE.unresolvedSetting,
|
|
131
|
+
path,
|
|
132
|
+
message: `setting "${key}" feeds a ${reference.slot} value and ${problem}`,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (setting.type === 'select') {
|
|
137
|
+
const node = nodeAtBodyPath(definition.body, reference.path);
|
|
138
|
+
const attribute = reference.path[reference.path.length - 1];
|
|
139
|
+
const accepted = node && typeof attribute === 'string' ? enumSlotValues(node, attribute) : null;
|
|
140
|
+
const stray = accepted
|
|
141
|
+
? setting.options.filter((option) => !accepted.includes(option.value))
|
|
142
|
+
: [];
|
|
143
|
+
if (stray.length > 0) {
|
|
144
|
+
return {
|
|
145
|
+
code: DEFINITION_ISSUE.unresolvedSetting,
|
|
146
|
+
path,
|
|
147
|
+
message: `setting "${key}" offers ${stray.map((o) => `"${o.value}"`).join(', ')} which this value does not accept; expected ${accepted.map((v) => `"${v}"`).join(', ')}`,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
function tokenReferenceIssue(reference, role) {
|
|
154
|
+
const path = definitionPath(['body', ...reference.path]);
|
|
155
|
+
if (!isTokenRole(role)) {
|
|
156
|
+
return {
|
|
157
|
+
code: DEFINITION_ISSUE.unresolvedToken,
|
|
158
|
+
path,
|
|
159
|
+
message: `token role "${role}" does not exist; expected one of ${Object.keys(SEMANTIC_TOKENS).join(', ')}`,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
const spec = SEMANTIC_TOKENS[role];
|
|
163
|
+
const wanted = TOKEN_TYPE_OF_SLOT[reference.slot];
|
|
164
|
+
if (wanted === undefined || spec.type !== wanted) {
|
|
165
|
+
return {
|
|
166
|
+
code: DEFINITION_ISSUE.unresolvedToken,
|
|
167
|
+
path,
|
|
168
|
+
message: `token role "${role}" is a ${spec.type} token and cannot feed a ${reference.slot} value`,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
function referenceIssues(definition) {
|
|
174
|
+
const settingsByKey = new Map(definition.settings.map((setting) => [setting.key, setting]));
|
|
175
|
+
const issues = [];
|
|
176
|
+
for (const reference of composedBodyReferences(definition.body)) {
|
|
177
|
+
const issue = 'setting' in reference.reference
|
|
178
|
+
? settingReferenceIssue(definition, reference, reference.reference.setting, settingsByKey)
|
|
179
|
+
: tokenReferenceIssue(reference, reference.reference.token);
|
|
180
|
+
if (issue)
|
|
181
|
+
issues.push(issue);
|
|
182
|
+
}
|
|
183
|
+
return issues;
|
|
184
|
+
}
|
|
185
|
+
/** "show when" reads a setting the way a value does; only a toggle answers "is it on". */
|
|
186
|
+
function conditionIssues(definition) {
|
|
187
|
+
const settingsByKey = new Map(definition.settings.map((setting) => [setting.key, setting]));
|
|
188
|
+
const issues = [];
|
|
189
|
+
for (const found of composedBodyConditions(definition.body)) {
|
|
190
|
+
if (found.condition.condition !== 'setting_on')
|
|
191
|
+
continue;
|
|
192
|
+
const key = found.condition.setting;
|
|
193
|
+
const setting = settingsByKey.get(key);
|
|
194
|
+
const path = definitionPath(['body', ...found.path]);
|
|
195
|
+
if (setting === undefined) {
|
|
196
|
+
issues.push({
|
|
197
|
+
code: DEFINITION_ISSUE.unresolvedCondition,
|
|
198
|
+
path,
|
|
199
|
+
message: `"show when" names setting "${key}", which is not declared`,
|
|
200
|
+
});
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
if (setting.type !== 'toggle') {
|
|
204
|
+
issues.push({
|
|
205
|
+
code: DEFINITION_ISSUE.unresolvedCondition,
|
|
206
|
+
path,
|
|
207
|
+
message: `"show when" names setting "${key}", which is a ${setting.type} setting and not a toggle`,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return issues;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* The current item exists only inside a repeater, a repeater only where a
|
|
215
|
+
* Binding is declared, and never inside another: that would be a nested
|
|
216
|
+
* Binding.
|
|
217
|
+
*/
|
|
218
|
+
function repeaterIssues(definition) {
|
|
219
|
+
const issues = [];
|
|
220
|
+
for (const repeater of composedBodyRepeaters(definition.body)) {
|
|
221
|
+
const path = definitionPath(['body', ...repeater.path]);
|
|
222
|
+
if (definition.binding.kind === 'none') {
|
|
223
|
+
issues.push({
|
|
224
|
+
code: DEFINITION_ISSUE.repeaterWithoutBinding,
|
|
225
|
+
path,
|
|
226
|
+
message: 'a repeater needs a Binding to repeat over; this definition declares none',
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
if (repeater.nested) {
|
|
230
|
+
issues.push({
|
|
231
|
+
code: DEFINITION_ISSUE.nestedRepeater,
|
|
232
|
+
path,
|
|
233
|
+
message: 'a repeater cannot stand inside another repeater',
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
for (const use of composedBodyItemUses(definition.body)) {
|
|
238
|
+
if (use.inRepeater)
|
|
239
|
+
continue;
|
|
240
|
+
issues.push({
|
|
241
|
+
code: DEFINITION_ISSUE.itemOutsideRepeater,
|
|
242
|
+
path: definitionPath(['body', ...use.path]),
|
|
243
|
+
message: `${use.use} reads the current item, which only a repeater sets`,
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
return issues;
|
|
247
|
+
}
|
|
248
|
+
function utf8Length(text) {
|
|
249
|
+
let bytes = 0;
|
|
250
|
+
for (const character of text) {
|
|
251
|
+
const point = character.codePointAt(0);
|
|
252
|
+
bytes += point < 0x80 ? 1 : point < 0x800 ? 2 : point < 0x10000 ? 3 : 4;
|
|
253
|
+
}
|
|
254
|
+
return bytes;
|
|
255
|
+
}
|
|
256
|
+
function limitIssues(definition) {
|
|
257
|
+
const issues = [];
|
|
258
|
+
definition.settings.forEach((setting, index) => {
|
|
259
|
+
if (setting.type !== 'rows' || setting.max <= DEFINITION_LIMITS.maxSettingRows)
|
|
260
|
+
return;
|
|
261
|
+
issues.push({
|
|
262
|
+
code: DEFINITION_ISSUE.limitSettingRows,
|
|
263
|
+
path: definitionPath(['settings', index, 'max']),
|
|
264
|
+
message: `a repeatable setting holds at most ${DEFINITION_LIMITS.maxSettingRows} rows`,
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
if (definition.settings.length > DEFINITION_LIMITS.maxDefinitionSettings) {
|
|
268
|
+
issues.push({
|
|
269
|
+
code: DEFINITION_ISSUE.limitSettings,
|
|
270
|
+
path: definitionPath(['settings']),
|
|
271
|
+
message: `a Block Definition holds at most ${DEFINITION_LIMITS.maxDefinitionSettings} settings`,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
if (definition.kind === 'composed') {
|
|
275
|
+
const shape = composedBodyShape(definition.body);
|
|
276
|
+
if (shape.nodes > DEFINITION_LIMITS.maxDefinitionNodes) {
|
|
277
|
+
issues.push({
|
|
278
|
+
code: DEFINITION_ISSUE.limitNodes,
|
|
279
|
+
path: definitionPath(['body']),
|
|
280
|
+
message: `a composed body holds at most ${DEFINITION_LIMITS.maxDefinitionNodes} nodes`,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
if (shape.depth > DEFINITION_LIMITS.maxDefinitionDepth) {
|
|
284
|
+
issues.push({
|
|
285
|
+
code: DEFINITION_ISSUE.limitDepth,
|
|
286
|
+
path: definitionPath(['body']),
|
|
287
|
+
message: `a composed body nests at most ${DEFINITION_LIMITS.maxDefinitionDepth} levels deep`,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (utf8Length(JSON.stringify(definition)) > DEFINITION_LIMITS.maxDefinitionBytes) {
|
|
292
|
+
issues.push({
|
|
293
|
+
code: DEFINITION_ISSUE.limitBytes,
|
|
294
|
+
path: ROOT,
|
|
295
|
+
message: `a Block Definition stays under ${DEFINITION_LIMITS.maxDefinitionBytes} bytes`,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
return issues;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* The one validator a Block Definition meets, on the developer's machine and
|
|
302
|
+
* at the api's door alike. Each step runs only once the one before it found
|
|
303
|
+
* nothing, so a refusal names one cause.
|
|
304
|
+
*/
|
|
305
|
+
export function definitionIssues(raw) {
|
|
306
|
+
const body = raw?.body;
|
|
307
|
+
const named = [
|
|
308
|
+
...unknownPrimitivesOf(body).map((found) => ({
|
|
309
|
+
code: DEFINITION_ISSUE.unknownPrimitive,
|
|
310
|
+
path: definitionPath(['body', ...found.path, 'primitive']),
|
|
311
|
+
message: `unknown Primitive "${found.primitive}"`,
|
|
312
|
+
})),
|
|
313
|
+
...unknownSettingTypeIssues(raw),
|
|
314
|
+
];
|
|
315
|
+
if (named.length > 0)
|
|
316
|
+
return { issues: named };
|
|
317
|
+
const parsed = parseBlockDefinition(raw);
|
|
318
|
+
if (!parsed.ok) {
|
|
319
|
+
return {
|
|
320
|
+
issues: parsed.issues.map((issue) => ({
|
|
321
|
+
code: DEFINITION_ISSUE.parse,
|
|
322
|
+
path: issue.path === '(root)' ? ROOT : `${ROOT}.${issue.path}`,
|
|
323
|
+
message: issue.message,
|
|
324
|
+
})),
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
const definition = parsed.value;
|
|
328
|
+
if (definition.kind === 'composed') {
|
|
329
|
+
for (const step of [referenceIssues, conditionIssues, repeaterIssues]) {
|
|
330
|
+
const issues = step(definition);
|
|
331
|
+
if (issues.length > 0)
|
|
332
|
+
return { issues };
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
const limits = limitIssues(definition);
|
|
336
|
+
if (limits.length > 0)
|
|
337
|
+
return { issues: limits };
|
|
338
|
+
return { issues: [], definition };
|
|
339
|
+
}
|
|
340
|
+
//# sourceMappingURL=definition-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition-validator.js","sourceRoot":"","sources":["../src/definition-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,aAAa,GAKd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,cAAc,EACd,mBAAmB,GAGpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,kBAAkB,EAAE,GAAG;IACvB,kBAAkB,EAAE,CAAC;IACrB,qBAAqB,EAAE,EAAE;IACzB,cAAc,EAAE,EAAE;IAClB,kBAAkB,EAAE,OAAO;CACn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AAE,gBAAgB,CAAC,KAAK;gBAC5B,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;gBAC9D,OAAO,EAAE,KAAK,CAAC,OAAO;aACvB,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC;IAChC,IAAI,UAAU,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACnC,KAAK,MAAM,IAAI,IAAI,CAAC,eAAe,EAAE,eAAe,EAAE,cAAc,CAAC,EAAE,CAAC;YACtE,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;YAChC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;gBAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAC3C,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IACvC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjD,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Display-only money: a ready-to-render string plus its currency code.
|
|
4
|
+
* Strict by construction — there is no numeric amount to compute with, and
|
|
5
|
+
* the charged price always comes from Shopify checkout.
|
|
6
|
+
*/
|
|
7
|
+
export declare const displayMoneySchema: z.ZodObject<{
|
|
8
|
+
formatted: z.ZodString;
|
|
9
|
+
currencyCode: z.ZodString;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
export declare const displayImageSchema: z.ZodObject<{
|
|
12
|
+
url: z.ZodURL;
|
|
13
|
+
altText: z.ZodOptional<z.ZodString>;
|
|
14
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
/** One choice a buyer makes on a product, and what it offers. */
|
|
18
|
+
export declare const productOptionSchema: z.ZodObject<{
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
values: z.ZodArray<z.ZodString>;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
/**
|
|
23
|
+
* One purchasable variant of a product: the id a cart line names, the values
|
|
24
|
+
* that select it, and whether it can be bought right now.
|
|
25
|
+
*/
|
|
26
|
+
export declare const productVariantSchema: z.ZodObject<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
title: z.ZodString;
|
|
29
|
+
selectedOptions: z.ZodArray<z.ZodObject<{
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
value: z.ZodString;
|
|
32
|
+
}, z.core.$strict>>;
|
|
33
|
+
available: z.ZodBoolean;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
/**
|
|
36
|
+
* The flat shapes renderers consume and every Provider must produce.
|
|
37
|
+
* Renderers never see raw Storefront responses. The detail fields below the
|
|
38
|
+
* card set are optional: a Provider fills them only where a whole product is
|
|
39
|
+
* asked for, so a grid of twenty-four cards stays as light as it was.
|
|
40
|
+
*/
|
|
41
|
+
export declare const productDisplaySchema: z.ZodObject<{
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
title: z.ZodString;
|
|
44
|
+
handle: z.ZodString;
|
|
45
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
url: z.ZodURL;
|
|
47
|
+
altText: z.ZodOptional<z.ZodString>;
|
|
48
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
}, z.core.$strict>>;
|
|
51
|
+
price: z.ZodObject<{
|
|
52
|
+
formatted: z.ZodString;
|
|
53
|
+
currencyCode: z.ZodString;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
compareAtPrice: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
formatted: z.ZodString;
|
|
57
|
+
currencyCode: z.ZodString;
|
|
58
|
+
}, z.core.$strict>>;
|
|
59
|
+
available: z.ZodBoolean;
|
|
60
|
+
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
61
|
+
url: z.ZodURL;
|
|
62
|
+
altText: z.ZodOptional<z.ZodString>;
|
|
63
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
}, z.core.$strict>>>;
|
|
66
|
+
description: z.ZodOptional<z.ZodString>;
|
|
67
|
+
vendor: z.ZodOptional<z.ZodString>;
|
|
68
|
+
productType: z.ZodOptional<z.ZodString>;
|
|
69
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
70
|
+
name: z.ZodString;
|
|
71
|
+
values: z.ZodArray<z.ZodString>;
|
|
72
|
+
}, z.core.$strict>>>;
|
|
73
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
title: z.ZodString;
|
|
76
|
+
selectedOptions: z.ZodArray<z.ZodObject<{
|
|
77
|
+
name: z.ZodString;
|
|
78
|
+
value: z.ZodString;
|
|
79
|
+
}, z.core.$strict>>;
|
|
80
|
+
available: z.ZodBoolean;
|
|
81
|
+
}, z.core.$strict>>>;
|
|
82
|
+
}, z.core.$strict>;
|
|
83
|
+
export declare const collectionDisplaySchema: z.ZodObject<{
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
title: z.ZodString;
|
|
86
|
+
handle: z.ZodString;
|
|
87
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
url: z.ZodURL;
|
|
89
|
+
altText: z.ZodOptional<z.ZodString>;
|
|
90
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
}, z.core.$strict>;
|
|
94
|
+
export type DisplayMoney = z.infer<typeof displayMoneySchema>;
|
|
95
|
+
export type DisplayImage = z.infer<typeof displayImageSchema>;
|
|
96
|
+
export type ProductOption = z.infer<typeof productOptionSchema>;
|
|
97
|
+
export type ProductVariantDisplay = z.infer<typeof productVariantSchema>;
|
|
98
|
+
export type ProductDisplay = z.infer<typeof productDisplaySchema>;
|
|
99
|
+
export type CollectionDisplay = z.infer<typeof collectionDisplaySchema>;
|
|
100
|
+
/**
|
|
101
|
+
* What one Binding resolves to, by kind. A missing entity is an empty shape,
|
|
102
|
+
* null or an empty list, so a renderer collapses the block instead of erroring.
|
|
103
|
+
*/
|
|
104
|
+
export type BindingData = {
|
|
105
|
+
readonly kind: 'product';
|
|
106
|
+
readonly product: ProductDisplay | null;
|
|
107
|
+
} | {
|
|
108
|
+
readonly kind: 'products';
|
|
109
|
+
readonly products: readonly ProductDisplay[];
|
|
110
|
+
} | {
|
|
111
|
+
readonly kind: 'collection';
|
|
112
|
+
readonly collection: CollectionDisplay | null;
|
|
113
|
+
} | {
|
|
114
|
+
readonly kind: 'collections';
|
|
115
|
+
readonly collections: readonly CollectionDisplay[];
|
|
116
|
+
};
|
|
117
|
+
/** One entry of what a Binding resolved to: what a repeater draws once per item. */
|
|
118
|
+
export type BoundItem = ProductDisplay | CollectionDisplay;
|
|
119
|
+
/**
|
|
120
|
+
* The Binding's items in order, whatever its kind. A single-entity Binding
|
|
121
|
+
* that resolved to nothing is an empty list, the same as an empty one, so a
|
|
122
|
+
* repeater has one rule to follow.
|
|
123
|
+
*/
|
|
124
|
+
export declare function bindingItems(data: BindingData | null | undefined): readonly BoundItem[];
|
|
125
|
+
/**
|
|
126
|
+
* One text field off the current item, already in the buyer's language. A
|
|
127
|
+
* field the item does not carry — a collection has no vendor — reads as
|
|
128
|
+
* nothing, and the node that asked for it draws nothing.
|
|
129
|
+
*/
|
|
130
|
+
export declare function itemText(item: BoundItem, field: string): string | undefined;
|
|
131
|
+
export declare function itemImage(item: BoundItem): DisplayImage | undefined;
|
|
132
|
+
/** Whether the current item can be bought; undefined for an item that is not a product. */
|
|
133
|
+
export declare function itemAvailable(item: BoundItem): boolean | undefined;
|
|
134
|
+
/** The current item's price as the Provider formatted it; undefined for a collection. */
|
|
135
|
+
export declare function itemPrice(item: BoundItem): {
|
|
136
|
+
price: DisplayMoney;
|
|
137
|
+
compareAtPrice?: DisplayMoney;
|
|
138
|
+
} | undefined;
|
|
139
|
+
//# sourceMappingURL=display.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../src/display.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;kBAG7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;kBAK7B,CAAC;AAEH,iEAAiE;AACjE,eAAO,MAAM,mBAAmB;;;kBAG9B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;kBAK/B,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAc/B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;kBAKlC,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACzE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,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MpE"}
|
package/dist/display.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Display-only money: a ready-to-render string plus its currency code.
|
|
4
|
+
* Strict by construction — there is no numeric amount to compute with, and
|
|
5
|
+
* the charged price always comes from Shopify checkout.
|
|
6
|
+
*/
|
|
7
|
+
export const displayMoneySchema = z.strictObject({
|
|
8
|
+
formatted: z.string().min(1),
|
|
9
|
+
currencyCode: z.string().regex(/^[A-Z]{3}$/, 'expected an ISO 4217 currency code'),
|
|
10
|
+
});
|
|
11
|
+
export const displayImageSchema = z.strictObject({
|
|
12
|
+
url: z.url(),
|
|
13
|
+
altText: z.string().optional(),
|
|
14
|
+
width: z.number().int().positive().optional(),
|
|
15
|
+
height: z.number().int().positive().optional(),
|
|
16
|
+
});
|
|
17
|
+
/** One choice a buyer makes on a product, and what it offers. */
|
|
18
|
+
export const productOptionSchema = z.strictObject({
|
|
19
|
+
name: z.string().min(1),
|
|
20
|
+
values: z.array(z.string().min(1)).min(1),
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* One purchasable variant of a product: the id a cart line names, the values
|
|
24
|
+
* that select it, and whether it can be bought right now.
|
|
25
|
+
*/
|
|
26
|
+
export const productVariantSchema = z.strictObject({
|
|
27
|
+
id: z.string().min(1),
|
|
28
|
+
title: z.string(),
|
|
29
|
+
selectedOptions: z.array(z.strictObject({ name: z.string().min(1), value: z.string().min(1) })),
|
|
30
|
+
available: z.boolean(),
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* The flat shapes renderers consume and every Provider must produce.
|
|
34
|
+
* Renderers never see raw Storefront responses. The detail fields below the
|
|
35
|
+
* card set are optional: a Provider fills them only where a whole product is
|
|
36
|
+
* asked for, so a grid of twenty-four cards stays as light as it was.
|
|
37
|
+
*/
|
|
38
|
+
export const productDisplaySchema = z.strictObject({
|
|
39
|
+
id: z.string().min(1),
|
|
40
|
+
title: z.string(),
|
|
41
|
+
handle: z.string().min(1),
|
|
42
|
+
image: displayImageSchema.optional(),
|
|
43
|
+
price: displayMoneySchema,
|
|
44
|
+
compareAtPrice: displayMoneySchema.optional(),
|
|
45
|
+
available: z.boolean(),
|
|
46
|
+
images: z.array(displayImageSchema).optional(),
|
|
47
|
+
description: z.string().optional(),
|
|
48
|
+
vendor: z.string().optional(),
|
|
49
|
+
productType: z.string().optional(),
|
|
50
|
+
options: z.array(productOptionSchema).optional(),
|
|
51
|
+
variants: z.array(productVariantSchema).optional(),
|
|
52
|
+
});
|
|
53
|
+
export const collectionDisplaySchema = z.strictObject({
|
|
54
|
+
id: z.string().min(1),
|
|
55
|
+
title: z.string(),
|
|
56
|
+
handle: z.string().min(1),
|
|
57
|
+
image: displayImageSchema.optional(),
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* The Binding's items in order, whatever its kind. A single-entity Binding
|
|
61
|
+
* that resolved to nothing is an empty list, the same as an empty one, so a
|
|
62
|
+
* repeater has one rule to follow.
|
|
63
|
+
*/
|
|
64
|
+
export function bindingItems(data) {
|
|
65
|
+
if (data === null || data === undefined)
|
|
66
|
+
return [];
|
|
67
|
+
switch (data.kind) {
|
|
68
|
+
case 'product':
|
|
69
|
+
return data.product === null ? [] : [data.product];
|
|
70
|
+
case 'products':
|
|
71
|
+
return data.products;
|
|
72
|
+
case 'collection':
|
|
73
|
+
return data.collection === null ? [] : [data.collection];
|
|
74
|
+
case 'collections':
|
|
75
|
+
return data.collections;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function asProduct(item) {
|
|
79
|
+
return 'price' in item ? item : undefined;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* One text field off the current item, already in the buyer's language. A
|
|
83
|
+
* field the item does not carry — a collection has no vendor — reads as
|
|
84
|
+
* nothing, and the node that asked for it draws nothing.
|
|
85
|
+
*/
|
|
86
|
+
export function itemText(item, field) {
|
|
87
|
+
switch (field) {
|
|
88
|
+
case 'title':
|
|
89
|
+
return item.title;
|
|
90
|
+
case 'handle':
|
|
91
|
+
return item.handle;
|
|
92
|
+
case 'vendor':
|
|
93
|
+
return asProduct(item)?.vendor;
|
|
94
|
+
case 'product_type':
|
|
95
|
+
return asProduct(item)?.productType;
|
|
96
|
+
case 'description':
|
|
97
|
+
return asProduct(item)?.description;
|
|
98
|
+
default:
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export function itemImage(item) {
|
|
103
|
+
return item.image;
|
|
104
|
+
}
|
|
105
|
+
/** Whether the current item can be bought; undefined for an item that is not a product. */
|
|
106
|
+
export function itemAvailable(item) {
|
|
107
|
+
return asProduct(item)?.available;
|
|
108
|
+
}
|
|
109
|
+
/** The current item's price as the Provider formatted it; undefined for a collection. */
|
|
110
|
+
export function itemPrice(item) {
|
|
111
|
+
const product = asProduct(item);
|
|
112
|
+
if (product === undefined)
|
|
113
|
+
return undefined;
|
|
114
|
+
return product.compareAtPrice === undefined
|
|
115
|
+
? { price: product.price }
|
|
116
|
+
: { price: product.price, compareAtPrice: product.compareAtPrice };
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=display.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display.js","sourceRoot":"","sources":["../src/display.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC/C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE,oCAAoC,CAAC;CACnF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC/C,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE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