@azx-pbc/axiom-builder 0.0.0-stage → 0.0.6
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/README.md +648 -2
- package/dist/cards/selectors.d.ts +70 -0
- package/dist/cards/selectors.d.ts.map +1 -0
- package/dist/cards/selectors.js +194 -0
- package/dist/cards/selectors.js.map +1 -0
- package/dist/definition.d.ts +36 -0
- package/dist/definition.d.ts.map +1 -0
- package/dist/definition.js +48 -0
- package/dist/definition.js.map +1 -0
- package/dist/evidence/cases.d.ts +44 -0
- package/dist/evidence/cases.d.ts.map +1 -0
- package/dist/evidence/cases.js +578 -0
- package/dist/evidence/cases.js.map +1 -0
- package/dist/evidence/repairs.d.ts +99 -0
- package/dist/evidence/repairs.d.ts.map +1 -0
- package/dist/evidence/repairs.js +181 -0
- package/dist/evidence/repairs.js.map +1 -0
- package/dist/evidence/summary.d.ts +35 -0
- package/dist/evidence/summary.d.ts.map +1 -0
- package/dist/evidence/summary.js +38 -0
- package/dist/evidence/summary.js.map +1 -0
- package/dist/i18n/gaps.d.ts +3 -0
- package/dist/i18n/gaps.d.ts.map +1 -0
- package/dist/i18n/gaps.js +2 -0
- package/dist/i18n/gaps.js.map +1 -0
- package/dist/i18n/message-slots.d.ts +19 -0
- package/dist/i18n/message-slots.d.ts.map +1 -0
- package/dist/i18n/message-slots.js +101 -0
- package/dist/i18n/message-slots.js.map +1 -0
- package/dist/i18n/text-locale.d.ts +13 -0
- package/dist/i18n/text-locale.d.ts.map +1 -0
- package/dist/i18n/text-locale.js +14 -0
- package/dist/i18n/text-locale.js.map +1 -0
- package/dist/i18n/translations.d.ts +56 -0
- package/dist/i18n/translations.d.ts.map +1 -0
- package/dist/i18n/translations.js +103 -0
- package/dist/i18n/translations.js.map +1 -0
- package/dist/impact/references.d.ts +143 -0
- package/dist/impact/references.d.ts.map +1 -0
- package/dist/impact/references.js +429 -0
- package/dist/impact/references.js.map +1 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/preview/compile-preview.d.ts +67 -0
- package/dist/preview/compile-preview.d.ts.map +1 -0
- package/dist/preview/compile-preview.js +286 -0
- package/dist/preview/compile-preview.js.map +1 -0
- package/dist/preview/handle.d.ts +119 -0
- package/dist/preview/handle.d.ts.map +1 -0
- package/dist/preview/handle.js +2 -0
- package/dist/preview/handle.js.map +1 -0
- package/dist/preview/held.d.ts +39 -0
- package/dist/preview/held.d.ts.map +1 -0
- package/dist/preview/held.js +15 -0
- package/dist/preview/held.js.map +1 -0
- package/dist/preview/measurement.d.ts +5 -0
- package/dist/preview/measurement.d.ts.map +1 -0
- package/dist/preview/measurement.js +18 -0
- package/dist/preview/measurement.js.map +1 -0
- package/dist/publish/build.d.ts +33 -0
- package/dist/publish/build.d.ts.map +1 -0
- package/dist/publish/build.js +15 -0
- package/dist/publish/build.js.map +1 -0
- package/dist/publish/diff.d.ts +208 -0
- package/dist/publish/diff.d.ts.map +1 -0
- package/dist/publish/diff.js +227 -0
- package/dist/publish/diff.js.map +1 -0
- package/dist/publish/review.d.ts +41 -0
- package/dist/publish/review.d.ts.map +1 -0
- package/dist/publish/review.js +22 -0
- package/dist/publish/review.js.map +1 -0
- package/dist/schema/dataset-input.d.ts +30 -0
- package/dist/schema/dataset-input.d.ts.map +1 -0
- package/dist/schema/dataset-input.js +58 -0
- package/dist/schema/dataset-input.js.map +1 -0
- package/dist/schema/dataset.d.ts +166 -0
- package/dist/schema/dataset.d.ts.map +1 -0
- package/dist/schema/dataset.js +281 -0
- package/dist/schema/dataset.js.map +1 -0
- package/dist/schema/declarations.d.ts +15 -0
- package/dist/schema/declarations.d.ts.map +1 -0
- package/dist/schema/declarations.js +47 -0
- package/dist/schema/declarations.js.map +1 -0
- package/dist/schema/document.d.ts +504 -0
- package/dist/schema/document.d.ts.map +1 -0
- package/dist/schema/document.js +337 -0
- package/dist/schema/document.js.map +1 -0
- package/dist/schema/error.d.ts +15 -0
- package/dist/schema/error.d.ts.map +1 -0
- package/dist/schema/error.js +18 -0
- package/dist/schema/error.js.map +1 -0
- package/dist/schema/field-id.d.ts +8 -0
- package/dist/schema/field-id.d.ts.map +1 -0
- package/dist/schema/field-id.js +47 -0
- package/dist/schema/field-id.js.map +1 -0
- package/dist/schema/layout.d.ts +118 -0
- package/dist/schema/layout.d.ts.map +1 -0
- package/dist/schema/layout.js +101 -0
- package/dist/schema/layout.js.map +1 -0
- package/dist/schema/palette.d.ts +103 -0
- package/dist/schema/palette.d.ts.map +1 -0
- package/dist/schema/palette.js +140 -0
- package/dist/schema/palette.js.map +1 -0
- package/dist/schema/read.d.ts +49 -0
- package/dist/schema/read.d.ts.map +1 -0
- package/dist/schema/read.js +942 -0
- package/dist/schema/read.js.map +1 -0
- package/dist/store/apply-dataset.d.ts +14 -0
- package/dist/store/apply-dataset.d.ts.map +1 -0
- package/dist/store/apply-dataset.js +513 -0
- package/dist/store/apply-dataset.js.map +1 -0
- package/dist/store/apply.d.ts +37 -0
- package/dist/store/apply.d.ts.map +1 -0
- package/dist/store/apply.js +2269 -0
- package/dist/store/apply.js.map +1 -0
- package/dist/store/candidate.d.ts +37 -0
- package/dist/store/candidate.d.ts.map +1 -0
- package/dist/store/candidate.js +178 -0
- package/dist/store/candidate.js.map +1 -0
- package/dist/store/commands/coverage.d.ts +58 -0
- package/dist/store/commands/coverage.d.ts.map +1 -0
- package/dist/store/commands/coverage.js +354 -0
- package/dist/store/commands/coverage.js.map +1 -0
- package/dist/store/commands/dataset.d.ts +26 -0
- package/dist/store/commands/dataset.d.ts.map +1 -0
- package/dist/store/commands/dataset.js +368 -0
- package/dist/store/commands/dataset.js.map +1 -0
- package/dist/store/commands/document.d.ts +21 -0
- package/dist/store/commands/document.d.ts.map +1 -0
- package/dist/store/commands/document.js +160 -0
- package/dist/store/commands/document.js.map +1 -0
- package/dist/store/commands/field.d.ts +32 -0
- package/dist/store/commands/field.d.ts.map +1 -0
- package/dist/store/commands/field.js +572 -0
- package/dist/store/commands/field.js.map +1 -0
- package/dist/store/commands/layout.d.ts +16 -0
- package/dist/store/commands/layout.d.ts.map +1 -0
- package/dist/store/commands/layout.js +70 -0
- package/dist/store/commands/layout.js.map +1 -0
- package/dist/store/commands/parse.d.ts +19 -0
- package/dist/store/commands/parse.d.ts.map +1 -0
- package/dist/store/commands/parse.js +328 -0
- package/dist/store/commands/parse.js.map +1 -0
- package/dist/store/commands/readers.d.ts +198 -0
- package/dist/store/commands/readers.d.ts.map +1 -0
- package/dist/store/commands/readers.js +711 -0
- package/dist/store/commands/readers.js.map +1 -0
- package/dist/store/commands/rule.d.ts +24 -0
- package/dist/store/commands/rule.d.ts.map +1 -0
- package/dist/store/commands/rule.js +379 -0
- package/dist/store/commands/rule.js.map +1 -0
- package/dist/store/commands/shapes.d.ts +900 -0
- package/dist/store/commands/shapes.d.ts.map +1 -0
- package/dist/store/commands/shapes.js +166 -0
- package/dist/store/commands/shapes.js.map +1 -0
- package/dist/store/commands/suggestions.d.ts +37 -0
- package/dist/store/commands/suggestions.d.ts.map +1 -0
- package/dist/store/commands/suggestions.js +177 -0
- package/dist/store/commands/suggestions.js.map +1 -0
- package/dist/store/commands.d.ts +16 -0
- package/dist/store/commands.d.ts.map +1 -0
- package/dist/store/commands.js +13 -0
- package/dist/store/commands.js.map +1 -0
- package/dist/store/dataset-candidate.d.ts +33 -0
- package/dist/store/dataset-candidate.d.ts.map +1 -0
- package/dist/store/dataset-candidate.js +31 -0
- package/dist/store/dataset-candidate.js.map +1 -0
- package/dist/store/dataset-pin.d.ts +93 -0
- package/dist/store/dataset-pin.d.ts.map +1 -0
- package/dist/store/dataset-pin.js +86 -0
- package/dist/store/dataset-pin.js.map +1 -0
- package/dist/store/dataset-store.d.ts +96 -0
- package/dist/store/dataset-store.d.ts.map +1 -0
- package/dist/store/dataset-store.js +112 -0
- package/dist/store/dataset-store.js.map +1 -0
- package/dist/store/history.d.ts +149 -0
- package/dist/store/history.d.ts.map +1 -0
- package/dist/store/history.js +173 -0
- package/dist/store/history.js.map +1 -0
- package/dist/store/measurement.d.ts +5 -0
- package/dist/store/measurement.d.ts.map +1 -0
- package/dist/store/measurement.js +20 -0
- package/dist/store/measurement.js.map +1 -0
- package/dist/store/notify.d.ts +11 -0
- package/dist/store/notify.d.ts.map +1 -0
- package/dist/store/notify.js +26 -0
- package/dist/store/notify.js.map +1 -0
- package/dist/store/published.d.ts +50 -0
- package/dist/store/published.d.ts.map +1 -0
- package/dist/store/published.js +27 -0
- package/dist/store/published.js.map +1 -0
- package/dist/store/refusals.d.ts +175 -0
- package/dist/store/refusals.d.ts.map +1 -0
- package/dist/store/refusals.js +160 -0
- package/dist/store/refusals.js.map +1 -0
- package/dist/store/steps.d.ts +14 -0
- package/dist/store/steps.d.ts.map +1 -0
- package/dist/store/steps.js +124 -0
- package/dist/store/steps.js.map +1 -0
- package/dist/store/store.d.ts +142 -0
- package/dist/store/store.d.ts.map +1 -0
- package/dist/store/store.js +136 -0
- package/dist/store/store.js.map +1 -0
- package/dist/store/unchanged.d.ts +12 -0
- package/dist/store/unchanged.d.ts.map +1 -0
- package/dist/store/unchanged.js +35 -0
- package/dist/store/unchanged.js.map +1 -0
- package/dist/visual/emit.d.ts +21 -0
- package/dist/visual/emit.d.ts.map +1 -0
- package/dist/visual/emit.js +133 -0
- package/dist/visual/emit.js.map +1 -0
- package/dist/visual/parse.d.ts +32 -0
- package/dist/visual/parse.d.ts.map +1 -0
- package/dist/visual/parse.js +330 -0
- package/dist/visual/parse.js.map +1 -0
- package/dist/visual/project.d.ts +40 -0
- package/dist/visual/project.d.ts.map +1 -0
- package/dist/visual/project.js +349 -0
- package/dist/visual/project.js.map +1 -0
- package/dist/visual/represent.d.ts +50 -0
- package/dist/visual/represent.d.ts.map +1 -0
- package/dist/visual/represent.js +66 -0
- package/dist/visual/represent.js.map +1 -0
- package/dist/visual/vocabulary.d.ts +121 -0
- package/dist/visual/vocabulary.d.ts.map +1 -0
- package/dist/visual/vocabulary.js +32 -0
- package/dist/visual/vocabulary.js.map +1 -0
- package/package.json +52 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shapes.d.ts","sourceRoot":"","sources":["../../../src/store/commands/shapes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,YAAY,EACZ,aAAa,EACb,UAAU,EACV,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,SAAS,EACT,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,4BAA4B,EAC5B,iBAAiB,EACjB,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGjE;;;;;;;;;;;;GAYG;AAEH,uFAAuF;AACvF,MAAM,MAAM,UAAU,GAAG,SAAS,MAAM,EAAE,CAAC;AAE3C,4FAA4F;AAC5F,MAAM,MAAM,iBAAiB,GACzB,UAAU,GACV,SAAS,GACT,UAAU,GACV,SAAS,GACT,SAAS,GACT,gBAAgB,GAChB,MAAM,GACN,QAAQ,CAAC;AAEb,qFAAqF;AACrF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,4BAA4B,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAA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SAAS,gBAAgB,CAAC,MAAM,CAAC,EAwC5D,CAAC;AAEF,0FAA0F;AAC1F,eAAO,MAAM,qBAAqB,EAAE,SAAS,cAAc,CAAC,MAAM,CAAC,EASlE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CASnF,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { assertNever } from '@azx-pbc/axiom-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* The coalescing identity of a dataset command, or `undefined` when it never coalesces.
|
|
4
|
+
*
|
|
5
|
+
* Typing into one grid cell is one edit however many values the field reports while the author
|
|
6
|
+
* types, so consecutive `setDatasetCell` commands for the same `(tableId, rowId, columnId)` merge
|
|
7
|
+
* into one undo step. Nothing else merges: a row replacement is a discrete decision, not a
|
|
8
|
+
* keystroke.
|
|
9
|
+
*/
|
|
10
|
+
export function datasetCoalesceKeyOf(command) {
|
|
11
|
+
switch (command.kind) {
|
|
12
|
+
case 'setDatasetCell':
|
|
13
|
+
return `datasetCell\u0000${command.tableId}\u0000${command.rowId}\u0000${command.columnId}`;
|
|
14
|
+
case 'addDatasetRow':
|
|
15
|
+
case 'replaceDatasetRow':
|
|
16
|
+
case 'removeDatasetRow':
|
|
17
|
+
case 'setDatasetColumns':
|
|
18
|
+
case 'setDatasetValues':
|
|
19
|
+
case 'setDatasetHitPolicy':
|
|
20
|
+
case 'setDatasetEffectiveRange':
|
|
21
|
+
return undefined;
|
|
22
|
+
default:
|
|
23
|
+
return assertNever(command);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The coalescing identity of a command, or `undefined` when it never coalesces.
|
|
28
|
+
*
|
|
29
|
+
* Typing into one field's text produces one undo entry however many keystrokes arrive: the store
|
|
30
|
+
* merges consecutive `setMessageText` for the same `(messageKey, locale)` because each keystroke
|
|
31
|
+
* is a revision of one edit. Nothing else merges, and there is no clock — the key is the whole
|
|
32
|
+
* identity, so a replayed sequence coalesces the same way it did live.
|
|
33
|
+
*/
|
|
34
|
+
export function coalesceKeyOf(command) {
|
|
35
|
+
switch (command.kind) {
|
|
36
|
+
case 'setMessageText':
|
|
37
|
+
return `message\u0000${command.messageKey}\u0000${command.locale}`;
|
|
38
|
+
case 'setRuleExpr':
|
|
39
|
+
// Typing source is one edit, like typing a message; choosing a visual form is a discrete
|
|
40
|
+
// change of shape, so consecutive visual edits stay separate undo steps.
|
|
41
|
+
return command.expression.mode === 'advanced'
|
|
42
|
+
? `ruleExpr\u0000${command.ruleId}\u0000advanced`
|
|
43
|
+
: undefined;
|
|
44
|
+
case 'setRuleNote':
|
|
45
|
+
// A note is typed text too, so consecutive edits of one rule's note are one undo step.
|
|
46
|
+
return `ruleNote\u0000${command.ruleId}`;
|
|
47
|
+
case 'setRuleSuggests':
|
|
48
|
+
// An alternative list is a discrete editorial decision rather than typed text, so two
|
|
49
|
+
// lists in a row are two undo steps.
|
|
50
|
+
return undefined;
|
|
51
|
+
case 'editRule':
|
|
52
|
+
// The rule panel types source through `editRule`; one keystroke is a revision of the same
|
|
53
|
+
// edit, so the same key `setRuleExpr` uses keeps the undo chain one step.
|
|
54
|
+
return command.rule.expression?.mode === 'advanced'
|
|
55
|
+
? `ruleExpr\u0000${command.ruleId}\u0000advanced`
|
|
56
|
+
: undefined;
|
|
57
|
+
case 'addField':
|
|
58
|
+
case 'addOption':
|
|
59
|
+
case 'editField':
|
|
60
|
+
case 'setFieldDeclaration':
|
|
61
|
+
case 'deprecateOption':
|
|
62
|
+
case 'moveOption':
|
|
63
|
+
case 'setOptionAvailability':
|
|
64
|
+
case 'addRule':
|
|
65
|
+
case 'addRuleTestCase':
|
|
66
|
+
case 'removeRule':
|
|
67
|
+
case 'deprecateField':
|
|
68
|
+
case 'removeField':
|
|
69
|
+
case 'setFieldPrimitive':
|
|
70
|
+
case 'addLayoutNode':
|
|
71
|
+
case 'editLayoutNode':
|
|
72
|
+
case 'removeLayoutNode':
|
|
73
|
+
case 'setGroupColumns':
|
|
74
|
+
case 'placeField':
|
|
75
|
+
case 'moveLayoutNode':
|
|
76
|
+
case 'addRecordArray':
|
|
77
|
+
case 'addRowMember':
|
|
78
|
+
case 'addRecordMember':
|
|
79
|
+
case 'setRowKey':
|
|
80
|
+
case 'setLocales':
|
|
81
|
+
case 'setSchemaVersion':
|
|
82
|
+
case 'importTranslations':
|
|
83
|
+
case 'setPrimary':
|
|
84
|
+
case 'pinDataset':
|
|
85
|
+
case 'unpinDataset':
|
|
86
|
+
case 'setContextRoot':
|
|
87
|
+
case 'removeContextRoot':
|
|
88
|
+
case 'setOnHide':
|
|
89
|
+
case 'setDocumentTitle':
|
|
90
|
+
case 'setSignatureCovers':
|
|
91
|
+
return undefined;
|
|
92
|
+
default:
|
|
93
|
+
return assertNever(command);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/** Every command kind, as the vocabulary a refusal and the coverage gate read. */
|
|
97
|
+
export const COMMAND_KINDS = [
|
|
98
|
+
'addField',
|
|
99
|
+
'addOption',
|
|
100
|
+
'editField',
|
|
101
|
+
'setFieldDeclaration',
|
|
102
|
+
'deprecateOption',
|
|
103
|
+
'moveOption',
|
|
104
|
+
'setOptionAvailability',
|
|
105
|
+
'addRule',
|
|
106
|
+
'addRuleTestCase',
|
|
107
|
+
'setRuleExpr',
|
|
108
|
+
'setRuleNote',
|
|
109
|
+
'setRuleSuggests',
|
|
110
|
+
'editRule',
|
|
111
|
+
'removeRule',
|
|
112
|
+
'setMessageText',
|
|
113
|
+
'deprecateField',
|
|
114
|
+
'removeField',
|
|
115
|
+
'setFieldPrimitive',
|
|
116
|
+
'addLayoutNode',
|
|
117
|
+
'editLayoutNode',
|
|
118
|
+
'removeLayoutNode',
|
|
119
|
+
'setGroupColumns',
|
|
120
|
+
'placeField',
|
|
121
|
+
'moveLayoutNode',
|
|
122
|
+
'addRecordArray',
|
|
123
|
+
'addRowMember',
|
|
124
|
+
'addRecordMember',
|
|
125
|
+
'setRowKey',
|
|
126
|
+
'setLocales',
|
|
127
|
+
'setSchemaVersion',
|
|
128
|
+
'importTranslations',
|
|
129
|
+
'setPrimary',
|
|
130
|
+
'pinDataset',
|
|
131
|
+
'unpinDataset',
|
|
132
|
+
'setContextRoot',
|
|
133
|
+
'removeContextRoot',
|
|
134
|
+
'setOnHide',
|
|
135
|
+
'setDocumentTitle',
|
|
136
|
+
'setSignatureCovers',
|
|
137
|
+
];
|
|
138
|
+
/** Every dataset command kind, as the vocabulary a refusal and the coverage gate read. */
|
|
139
|
+
export const DATASET_COMMAND_KINDS = [
|
|
140
|
+
'addDatasetRow',
|
|
141
|
+
'replaceDatasetRow',
|
|
142
|
+
'removeDatasetRow',
|
|
143
|
+
'setDatasetCell',
|
|
144
|
+
'setDatasetColumns',
|
|
145
|
+
'setDatasetValues',
|
|
146
|
+
'setDatasetHitPolicy',
|
|
147
|
+
'setDatasetEffectiveRange',
|
|
148
|
+
];
|
|
149
|
+
/**
|
|
150
|
+
* The dataset vocabulary as a total map.
|
|
151
|
+
*
|
|
152
|
+
* A new member of `DatasetCommand` is a missing key here, which is a typecheck failure, so the
|
|
153
|
+
* refusal text and the test that counts kinds cannot drift from the union. An extra key is an
|
|
154
|
+
* excess-property error, so the map cannot claim a command the union does not declare.
|
|
155
|
+
*/
|
|
156
|
+
export const DATASET_COMMAND_KIND_SET = {
|
|
157
|
+
addDatasetRow: true,
|
|
158
|
+
replaceDatasetRow: true,
|
|
159
|
+
removeDatasetRow: true,
|
|
160
|
+
setDatasetCell: true,
|
|
161
|
+
setDatasetColumns: true,
|
|
162
|
+
setDatasetValues: true,
|
|
163
|
+
setDatasetHitPolicy: true,
|
|
164
|
+
setDatasetEffectiveRange: true,
|
|
165
|
+
};
|
|
166
|
+
//# sourceMappingURL=shapes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shapes.js","sourceRoot":"","sources":["../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,iBAAiB;IACjB,UAAU;IACV,YAAY;IACZ,gBAAgB;IAChB,gBAAgB;IAChB,aAAa;IACb,mBAAmB;IACnB,eAAe;IACf,gBAAgB;IAChB,kBAAkB;IAClB,iBAAiB;IACjB,YAAY;IACZ,gBAAgB;IAChB,gBAAgB;IAChB,cAAc;IACd,iBAAiB;IACjB,WAAW;IACX,YAAY;IACZ,kBAAkB;IAClB,oBAAoB;IACpB,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,gBAAgB;IAChB,mBAAmB;IACnB,WAAW;IACX,kBAAkB;IAClB,oBAAoB;CACrB,CAAC;AAEF,0FAA0F;AAC1F,MAAM,CAAC,MAAM,qBAAqB,GAAsC;IACtE,eAAe;IACf,mBAAmB;IACnB,kBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;IACnB,kBAAkB;IAClB,qBAAqB;IACrB,0BAA0B;CAC3B,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAmD;IACtF,aAAa,EAAE,IAAI;IACnB,iBAAiB,EAAE,IAAI;IACvB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;IACpB,iBAAiB,EAAE,IAAI;IACvB,gBAAgB,EAAE,IAAI;IACtB,mBAAmB,EAAE,IAAI;IACzB,wBAAwB,EAAE,IAAI;CAC/B,CAAC","sourcesContent":["import type {\n Control,\n DatasetColumn,\n DurationUnit,\n ItemPrimitive,\n MoneyValue,\n OnHidePolicy,\n QuantityValue,\n OptionSource,\n Outcome,\n Primitive,\n ScalarWireValue,\n} from '@azx-pbc/axiom-runtime';\nimport type {\n AuthoringAnnotations,\n AuthoringItem,\n AuthoringLayoutNode,\n AuthoringRowKey,\n AuthoringSuggestionOperation,\n AuthoringTestCase,\n ScalarPrimitive,\n} from '../../schema/document.js';\nimport type { AuthoredHitPolicy } from '../../schema/dataset.js';\nimport type { TranslationEntry } from '../../i18n/translations.js';\nimport type { RuleExpression } from '../../visual/vocabulary.js';\nimport { assertNever } from '@azx-pbc/axiom-runtime';\n\n/**\n * The shape of every authoring intent, and the union a store dispatches.\n *\n * A command states one author's intent. It is deliberately narrower than the wire contract in\n * the values it accepts, and deliberately as wide as the document the compiler admits: a member\n * `spec/metaschema/schema.v1.json` requires has a command that writes it, and `coverage.ts`\n * fails the gate when the metaschema grows one this file does not.\n *\n * Every command carries validated values. `parseCommand` is the only constructor of one, and it\n * narrows untrusted input — a form state, a stored draft, a JSON round trip — into this union or\n * a `MALFORMED_COMMAND` refusal. The union is what keeps a host's switch over intents\n * exhaustive.\n */\n\n/** A path into the document's `layout` tree: the index of each child from the root. */\nexport type LayoutPath = readonly number[];\n\n/** The rule kinds a command authors: every kind the metaschema's `rule.kind` enumerates. */\nexport type AuthoringRuleKind =\n | 'validate'\n | 'visible'\n | 'required'\n | 'enabled'\n | 'compute'\n | 'defaultCompute'\n | 'gate'\n | 'screen';\n\n/** One option a field declares at the moment it is added, with its literal label. */\nexport interface AddOptionSpec {\n readonly code: string | number;\n readonly label: string;\n}\n\n/**\n * One write an alternative performs, as the author states it.\n *\n * The authored document and the command state one shape, so this names it rather than restating the\n * members: an operation names a binding (`ref`), a row template or a row key, and every expression\n * is the Expr v1 source an author writes. The compiler's parser is the one authority on meaning.\n */\nexport type SuggestionOperationSpec = AuthoringSuggestionOperation;\n\n/**\n * One alternative a rule or an option offers, as the author states it.\n *\n * The label is the literal text a reader sees; the store mints the message key it is filed under\n * from that text, exactly as it mints a field's label or an option's.\n */\nexport interface SuggestionSpec {\n readonly label: string;\n readonly operations: readonly SuggestionOperationSpec[];\n}\n\n/**\n * The availability one declared option states, `schema.v1.json` `option`.\n *\n * The condition, its reason and the alternatives it offers are edited as one fact, so replacing\n * or clearing availability cannot leave a reason or an alternative attached to an old condition.\n * A reason is optional where the host supplies the fallback sentence.\n */\nexport interface OptionAvailabilitySpec {\n /** The condition under which the option may be chosen, as Expr v1 source. */\n readonly availableWhen: string;\n /** The literal sentence a reader sees when the option is unavailable. */\n readonly reason?: string;\n /** The reason's message arguments, each an expression. */\n readonly params?: Readonly<Record<string, string>>;\n /** The alternatives the option offers while its held code is unavailable. */\n readonly suggests?: readonly SuggestionSpec[];\n}\n\n/**\n * States, replaces or clears one declared option's availability.\n *\n * A `null` availability clears every member the specification states, so an option can go back to\n * being always available without being removed and re-added, which would lose its identity and\n * every record that names its code. The option's own label and code are not editable here: they\n * are the option's identity.\n */\nexport interface SetOptionAvailabilityCommand {\n readonly kind: 'setOptionAvailability';\n readonly fieldId: string;\n readonly code: string | number;\n readonly availability: OptionAvailabilitySpec | null;\n}\n\n/**\n * Replaces one validate rule's alternatives, or clears them.\n *\n * This is the suggestion-list edit on its own, for a host that offers the alternative editor\n * without the rest of the rule payload. `editRule` states the same member; both reach the one\n * document member, and the store refuses either on a rule whose kind states no verdict.\n */\nexport interface SetRuleSuggestsCommand {\n readonly kind: 'setRuleSuggests';\n readonly ruleId: string;\n readonly suggests: readonly SuggestionSpec[] | null;\n}\n\n/** The field a new declaration adds and the placement it gets. */\nexport interface AddFieldSpec {\n readonly fieldId: string;\n /** The literal label, written into `defaultLocale` under the minted `labelKey`. */\n readonly label: string;\n readonly primitive: ScalarPrimitive | 'array' | 'record';\n readonly control?: Control;\n /** Required on a scalar or attachment array; refused on a scalar field. */\n readonly items?: ItemPrimitive;\n readonly currency?: string;\n readonly scale?: number;\n /**\n * A `quantity` field's unit domain, `MODEL-2.1.21`, or a `quantity` item's.\n *\n * It travels to the item declaration where the quantity is the array's element, the way\n * `currency` and `scale` travel to a money item: the domain belongs to the declaration that\n * holds the measured value.\n */\n readonly units?: readonly string[];\n /** A `duration` field's unit, `MODEL-2.1.24`, or a `duration` item's. Defaults to `minutes`. */\n readonly unit?: DurationUnit;\n /**\n * A number control's increment, `MODEL-2.1.16`: a positive safe integer on an `integer` field\n * and positive canonical decimal text on a `decimal` one. Presentation only.\n */\n readonly step?: number | string;\n /**\n * A value bound and the literal sentence it raises, `MODEL-2.1.16`.\n *\n * The store mints `field.<trail>.minimum`/`.maximum`, exactly as it mints a label from `label`,\n * so a caller states the author's words rather than a key derived from an id it may not know.\n * The two members are a pair: a bound without its sentence is a declaration the compiler\n * refuses, and `readFieldSpec` refuses it here with the repair.\n */\n readonly minimum?: number | string;\n readonly maximum?: number | string;\n readonly minimumMessage?: string;\n readonly maximumMessage?: string;\n /**\n * A record's members: at least one, `minItems: 1`.\n *\n * A `record` is the one container `addField` authors, because a top-level record is a document\n * declaration like any other and `FIELD_PALETTE` offers it. Refused on every other primitive,\n * and a member's own placement is its container's, so a member spec states neither `parent`\n * nor `colSpan`.\n */\n readonly members?: readonly MemberSpec[];\n /**\n * A scalar array's closed option domain, with a literal label per option.\n *\n * An array states either this or `rowKey`, never both and never neither: the metaschema makes\n * an option-bearing array identified by its values and a freeform one identified by a row key.\n * Options written here are minted exactly as `addOption` mints them.\n */\n readonly options?: readonly AddOptionSpec[];\n /**\n * Where the option domain comes from when the field declares no `options`, `schema.v1.json`\n * `optionSource`. The two are two authorities for one domain, so a field states at most one.\n */\n readonly optionSource?: OptionSource;\n /**\n * A `signature_ref`'s bound targets: the `fieldId` of every value its signature signs, in\n * binding order (`field.covers`, `CANON-4.1.1`).\n *\n * Mandatory on a `signature_capture` declaration, because a signature only binds what its\n * coverage declares. Every target has to be declared before it is named, so a host adds the\n * signed fields first; `setSignatureCovers` edits the list until the field is published.\n */\n readonly covers?: readonly string[];\n /** How an array's rows are identified; required on a freeform array, refused elsewhere. */\n readonly rowKey?: AuthoringRowKey;\n /**\n * Whether the declaration gets a layout leaf now.\n *\n * `append` (the default) places it at the top level or under `parent`. `none` declares the\n * field without a placement, which is the draft state a later `placeField` completes: a\n * declared field is not yet a presented one, and forcing a placement on every add would make\n * the store invent a layout the author had not designed.\n */\n readonly placement?: 'append' | 'none';\n readonly colSpan?: number;\n readonly parent?: LayoutPath;\n /**\n * The position among `parent`'s children, with append when absent.\n *\n * A duplicate is placed immediately after its source and an \"insert after this row\" is the\n * same fact; appending would make the author move the thing they just asked to place.\n */\n readonly index?: number;\n readonly annotations?: AuthoringAnnotations;\n}\n\n/** A member field has no top-level placement; its container owns the layout leaf. */\nexport type MemberFieldSpec = Omit<AddFieldSpec, 'colSpan' | 'parent' | 'placement'>;\n\n/** One member a container command adds: a field, or a nested record with its own members. */\nexport type MemberSpec =\n | { readonly kind: 'field'; readonly field: MemberFieldSpec }\n | {\n readonly kind: 'record';\n readonly recordId: string;\n readonly members: readonly [MemberSpec, ...MemberSpec[]];\n };\n\n/** A repeating structure's declaration: its row key and the members one row holds. */\nexport interface AddRecordArraySpec {\n readonly fieldId: string;\n /**\n * The literal label of the table itself, written into `defaultLocale` under the minted\n * `labelKey`.\n *\n * A table is a declaration a reader sees as a region with a title, so it names itself the way\n * every other authored field does. A host that authors a table for a person supplies one; the\n * builder palette always does. Omitted, the declaration states no label key and a renderer has\n * no text but the field id.\n */\n readonly label?: string;\n readonly rowKey: AuthoringRowKey;\n /** At least one row member: the metaschema's `fields` states `minItems: 1`. */\n readonly members: readonly [MemberSpec, ...MemberSpec[]];\n /** `append` (the default) places the array now; `none` leaves it for `placeField`. */\n readonly placement?: 'append' | 'none';\n readonly colSpan?: number;\n readonly parent?: LayoutPath;\n}\n\n/**\n * One declared field's editable metadata.\n *\n * An absent member is left as it is and a `null` removes it, so one command expresses \"change the\n * control\", \"give the field help text\" and \"drop its placeholder\" without three shapes. Nothing an\n * edit can state is part of a field's value domain: its `primitive`, `items`, `rowKey` and `options`\n * are what a device reads a value against, so they are declaration decisions rather than edits\n * (`setFieldPrimitive` is the one that changes a domain, and it keeps the field's identity).\n */\nexport interface EditFieldSpec {\n /** The semantic hint the field offers; the control matrix is the authority on the pairing. */\n readonly control?: Control | null;\n /** The message key a renderer shows as the field's help text. */\n readonly descriptionKey?: string | null;\n /** The message key a renderer shows as the field's empty-input placeholder. */\n readonly placeholderKey?: string | null;\n /** This declaration's own hiding policy, overriding the document's. */\n readonly onHide?: OnHidePolicy | null;\n /** The governed per-field annotations, replaced as one value. */\n readonly annotations?: AuthoringAnnotations | null;\n}\n\n/**\n * The field members that compile into a rule, as one edit states them.\n *\n * An absent member is left alone and a `null` removes it, so this is the same three-state edit\n * `EditFieldSpec` states. A bound and the key of the sentence it raises are separate members\n * because the metaschema states them separately; a caller changing one changes both, and the\n * closed shape refuses a bound whose message key is missing. The expressions are Expr v1 source\n * text, the spelling an authored document stores, so the compiler's parser is the authority on\n * what they mean.\n */\nexport interface FieldDeclarationSpec {\n /** Whether the field must hold a value; compiles to a `required` rule. */\n readonly required?: boolean | null;\n /** The message key the required rule raises. */\n readonly requiredMessageKey?: string | null;\n /** The condition that requires the field; compiles to a `required` rule with that condition. */\n readonly requiredWhen?: string | null;\n /** The condition that reveals the field; compiles to a `visible` rule. */\n readonly visibleWhen?: string | null;\n /** The smallest and largest number of code points a string may hold. */\n readonly minLength?: number | null;\n readonly maxLength?: number | null;\n readonly minLengthMessageKey?: string | null;\n readonly maxLengthMessageKey?: string | null;\n /** The smallest and largest number of entries an array may hold. */\n readonly minItems?: number | null;\n readonly maxItems?: number | null;\n /**\n * The largest number of fractional digits a `decimal` value may carry, `MODEL-2.1.27`, with\n * the sentence an over-scale value states. A declared fact, not a rule, so it carries no\n * evidence member.\n */\n readonly maxScale?: number | null;\n readonly maxScaleMessageKey?: string | null;\n /** An inclusive value bound: a number, or a `date`/`instant` written as canonical text. */\n readonly minimum?: number | string | null;\n readonly maximum?: number | string | null;\n readonly minimumMessageKey?: string | null;\n readonly maximumMessageKey?: string | null;\n /**\n * The increment a number control steps by, `MODEL-2.1.16`: a positive safe integer on an\n * `integer` field, positive canonical decimal text on a `decimal` one.\n */\n readonly step?: number | string | null;\n /**\n * The media types a capture declaration admits, `MODEL-2.1.20`. The compiler canonicalises\n * the lower-case spelling on the artifact and refuses an empty, malformed or duplicate entry.\n */\n readonly accept?: readonly string[] | null;\n /** The smallest and largest `byteSize` a captured `media_ref` may carry, `MODEL-2.1.20`. */\n readonly minBytes?: number | null;\n readonly maxBytes?: number | null;\n /**\n * The Expr v1 integer source whose value is an array's expected row count, `MODEL-2.1.22`.\n * The compiler compiles it and carries the text beside the AST; a non-integer, a negative\n * literal and a count derived from the rows it sizes are refused by that pass.\n */\n readonly rowsFrom?: string | null;\n /**\n * The evidence for the rule each declaration compiles to, `RULES-3.1.1`.\n *\n * A case list sits beside the member it evidences; `null` clears the list, an absent member\n * keeps it, and a stated list replaces it. The compiler copies the cases onto the synthesized\n * rule, so the author never addresses `r_<fieldId>_…`.\n */\n readonly requiredTestCases?: readonly TestCaseSpec[] | null;\n readonly visibleWhenTestCases?: readonly TestCaseSpec[] | null;\n readonly minimumTestCases?: readonly TestCaseSpec[] | null;\n readonly maximumTestCases?: readonly TestCaseSpec[] | null;\n readonly minLengthTestCases?: readonly TestCaseSpec[] | null;\n readonly maxLengthTestCases?: readonly TestCaseSpec[] | null;\n}\n\n/** Edits one declared field's members that compile into a rule. */\nexport interface SetFieldDeclarationCommand {\n readonly kind: 'setFieldDeclaration';\n readonly fieldId: string;\n readonly declaration: FieldDeclarationSpec;\n}\n\n/** One item a gate states: its identity, its condition and the text it raises (`gateItem`). */\nexport interface GateItemSpec {\n readonly itemId: string;\n readonly expression: RuleExpression;\n /** The literal message text, written into `defaultLocale` under the minted `messageKey`. */\n readonly message: string;\n /** The item's own message arguments, each an expression source. */\n readonly params?: Readonly<Record<string, string>>;\n}\n\n/** A gate rule's own payload, `schema.v1.json` `rule.gate`. */\nexport interface GateSpec {\n /** At least one item: the metaschema states `minItems: 1` on `gate.items`. */\n readonly items: readonly [GateItemSpec, ...GateItemSpec[]];\n readonly hard: boolean;\n /** The condition that takes the gate out of force (`RULES-2.1.14`). */\n readonly activeWhen?: RuleExpression;\n /** A non-hard gate's policy for a read-only diagnostic; absent means `block`. */\n readonly onReadOnlyError?: 'defer' | 'warn' | 'block';\n}\n\n/** One reason a screen states, `schema.v1.json` `screenReasonDeclaration`. */\nexport interface ScreenReasonSpec {\n /** The stable problem the reason states; `diagnosticCode`'s upper-case grammar. */\n readonly code: string;\n readonly when: RuleExpression;\n /** The literal message text, written into `defaultLocale` under the minted `messageKey`. */\n readonly message: string;\n /** The reason's own message arguments, each an expression source. */\n readonly params?: Readonly<Record<string, string>>;\n}\n\n/**\n * One embedded vector, as the metaschema's `testCase` states it.\n *\n * The authored shape is exactly `AuthoringTestCase`: a draft stores the case, and the compiler\n * reads the same members. Reusing it rather than restating it is what keeps a command's evidence\n * and the artifact's evidence one shape.\n */\nexport type TestCaseSpec = AuthoringTestCase;\n\n/** One rule a command adds. */\nexport interface AddRuleSpec {\n readonly ruleId: string;\n readonly kind: AuthoringRuleKind;\n readonly scope: 'field' | 'record' | 'array' | 'item';\n /**\n * The rule's expression, as the editor holds it.\n *\n * A visual expression is stored as the printer's canonical source and a source expression is\n * stored unchanged, so a rule created in the visual editor and one typed as source reach the\n * document through this one member.\n */\n readonly expression: RuleExpression;\n /**\n * Why the rule exists, as author-facing documentation.\n *\n * Plain text of 1 to 500 characters after trimming; a blank note is refused at the member.\n * It is never rendered and never translated, so it has no message key and no locale; it\n * travels into the compiled artifact and is excluded from `behaviorHash`.\n */\n readonly note?: string;\n readonly evaluateOn?: 'client' | 'server';\n /**\n * The verdict a failing `validate` rule states.\n *\n * A `validate` rule defaults to `block`, the value the closed metaschema requires it to state\n * and the one a validation is for; every other kind states the severity it means, because a\n * `visible` or `compute` rule has no verdict of its own.\n */\n readonly severity?: 'block' | 'warn' | 'info';\n readonly fieldId?: string;\n /**\n * The fields a `visible` or `enabled` rule decides, for a rule that names more than one.\n * `schema.v1.json` admits it only there, only at `record` scope, and never with `fieldId`.\n */\n readonly fieldIds?: readonly string[];\n readonly targetFieldId?: string;\n /**\n * The literal message text, written into `defaultLocale` under `rule.<ruleId>`.\n *\n * Required wherever the metaschema requires a `messageKey`: a `validate`, `gate` or `screen`\n * rule. The store mints the key from this text, so a rule that needs a message and states none\n * is refused at the member rather than by a compile that cannot name the repair.\n */\n readonly message?: string;\n readonly params?: Readonly<Record<string, string>>;\n /** A screen rule's referral condition, `schema.v1.json` `rule.referWhen`. */\n readonly referWhen?: RuleExpression;\n /** A screen's declared reasons, in the order the report lists them. */\n readonly reasons?: readonly ScreenReasonSpec[];\n /** A `defaultCompute` rule's companion override field, `schema.v1.json` `overrideFieldId`. */\n readonly overrideFieldId?: string;\n /** A gate rule's own items and policy. */\n readonly gate?: GateSpec;\n /**\n * The alternatives this rule offers when it decides `FAIL`, `RULES-6.1.1`.\n *\n * Admitted on `kind: validate` only, because every other kind states a branch rather than a\n * verdict and an alternative to one names nothing. The store refuses the pair at the member, so\n * an author reads the repair rather than a compile that has to name the same fact.\n */\n readonly suggests?: readonly SuggestionSpec[];\n /** The vectors embedded on the rule, executed by `verifyPublishReadiness`. */\n readonly testCases?: readonly TestCaseSpec[];\n}\n\n/**\n * One declaration's new value domain.\n *\n * Changing a primitive is not a metadata edit: a device reads a value through `primitive`,\n * `items`, `currency`, `scale` and the option or row identity, so all of them move together and\n * the new declaration has to state the whole domain. The field's identity, its copy (label, help\n * text, placeholder), its annotations and its layout placement stay. Declaration members that\n * compile into rules — `required`, bounds and their evidence — belong to the old domain and are\n * cleared, because a bound on a string is not a bound on an integer.\n *\n * A `record` is refused here: its members are its declaration, so a record is added and its old\n * declaration removed rather than retyped underneath the members that depend on it.\n */\nexport interface FieldPrimitiveSpec {\n readonly primitive: ScalarPrimitive | 'array';\n readonly control?: Control;\n readonly items?: ItemPrimitive;\n readonly currency?: string;\n readonly scale?: number;\n /** A `quantity` declaration's unit domain, as `addField` states it. */\n readonly units?: readonly string[];\n /** A `duration` declaration's unit, as `addField` states it. */\n readonly unit?: DurationUnit;\n /** An option-bearing array's closed domain; a scalar field's options are stated here too. */\n readonly options?: readonly AddOptionSpec[];\n /** How an array's rows are identified; required on a freeform array. */\n readonly rowKey?: AuthoringRowKey;\n /** A `signature_ref`'s bound targets, as `addField` states them. */\n readonly covers?: readonly string[];\n}\n\n/**\n * One rule's new payload, as an edit states it.\n *\n * The rule's `ruleId`, `kind` and `scope` are its identity (`RULES-1.1.2`): an edit keeps all\n * three, so a case, a gate override or a layout step that names the rule keeps naming it. A rule\n * whose kind has to change is a second rule with its own id.\n *\n * An absent member is left alone and a `null` removes it, matching `EditFieldSpec`. `gate`,\n * `reasons` and `testCases` replace the whole list they state: a gate item or a screen reason is\n * identified by its own id, and reusing the id the rule already stated keeps its message key and\n * its translations.\n */\nexport interface EditRuleSpec {\n /** The expression the editor now holds; the printer stores a visual form as canonical source. */\n readonly expression?: RuleExpression;\n readonly evaluateOn?: 'client' | 'server';\n readonly severity?: 'block' | 'warn' | 'info' | null;\n readonly fieldId?: string | null;\n readonly fieldIds?: readonly string[] | null;\n readonly targetFieldId?: string | null;\n /** The literal text under `rule.<ruleId>`; `null` removes the key. */\n readonly message?: string | null;\n readonly params?: Readonly<Record<string, string>> | null;\n readonly referWhen?: RuleExpression | null;\n /** A screen's reasons, replacing the list; a reason whose code it already stated keeps its text. */\n readonly reasons?: readonly ScreenReasonSpec[] | null;\n readonly overrideFieldId?: string | null;\n /** A gate's items and policy, replacing the payload; a gate keeps its own message key. */\n readonly gate?: GateEditSpec | null;\n /** The alternatives the rule offers on `FAIL`, replacing the list; `null` removes it. */\n readonly suggests?: readonly SuggestionSpec[] | null;\n /** The vectors embedded on the rule, replacing the list; `null` removes it. */\n readonly testCases?: readonly TestCaseSpec[] | null;\n}\n\n/** A gate payload as an edit states it. */\nexport interface GateEditSpec {\n readonly items: readonly [GateItemSpec, ...GateItemSpec[]];\n readonly hard: boolean;\n readonly activeWhen?: RuleExpression | null;\n readonly onReadOnlyError?: 'defer' | 'warn' | 'block' | null;\n}\n\n/** One read-only evaluation root, `schema.v1.json` `contextRoot`. */\nexport interface ContextRootSpec {\n readonly path: string;\n readonly primitive: Primitive;\n readonly nullability?: 'required' | 'optional';\n /** A scalar or attachment array root's item domain, as a field declares one. */\n readonly items?: AuthoringItem;\n /**\n * The value domain a `money`, `quantity` or `duration` root declares, spelled as a field spells\n * it: a currency and scale, a unit domain and scale, or a duration unit. A host fact is read\n * against this domain, so a number where the root declares `money<AUD, 2>` is a host bug the\n * engine names rather than a value it coerces.\n */\n readonly currency?: string;\n readonly scale?: number;\n readonly units?: readonly string[];\n readonly unit?: 'minutes' | 'hours' | 'seconds';\n}\n\n/** One table a document names, with the version it was compiled against. */\nexport interface DatasetPinSpec {\n readonly tableId: string;\n readonly tableVersion: number;\n}\n\ninterface AddFieldCommand {\n readonly kind: 'addField';\n readonly field: AddFieldSpec;\n}\n\ninterface AddOptionCommand {\n readonly kind: 'addOption';\n readonly fieldId: string;\n readonly code: string | number;\n readonly label: string;\n}\n\n/** Edits one declared field's metadata. */\nexport interface EditFieldCommand {\n readonly kind: 'editField';\n readonly fieldId: string;\n readonly field: EditFieldSpec;\n}\n\n/**\n * Retires one option of a field's domain.\n *\n * A code is an identity: existing records and signatures name it, so an option is retired rather\n * than deleted, and a renderer keeps showing it as retired.\n */\nexport interface DeprecateOptionCommand {\n readonly kind: 'deprecateOption';\n readonly fieldId: string;\n readonly code: string | number;\n}\n\n/**\n * Moves one declared option to a position in its field's domain.\n *\n * The code is the option's identity and never changes: a record, a signature or a rule names it,\n * so reordering is presentation and the domain's members move while their values stay. A code the\n * field does not declare is refused; an index is clamped to the domain, exactly as a layout move\n * clamps its destination.\n */\ninterface MoveOptionCommand {\n readonly kind: 'moveOption';\n readonly fieldId: string;\n readonly code: string | number;\n readonly index: number;\n}\n\nexport interface AddRuleCommand {\n readonly kind: 'addRule';\n readonly rule: AddRuleSpec;\n}\n\n/** Appends one embedded vector to a declared rule. */\nexport interface AddRuleTestCaseCommand {\n readonly kind: 'addRuleTestCase';\n readonly ruleId: string;\n readonly testCase: TestCaseSpec;\n}\n\n/** Replaces one declared rule's expression: the visual or source form the editor now holds. */\nexport interface SetRuleExprCommand {\n readonly kind: 'setRuleExpr';\n readonly ruleId: string;\n readonly expression: RuleExpression;\n}\n\n/**\n * Replaces one declared rule's author-facing note.\n *\n * The note documents why the rule exists; it is never rendered, never translated and is not a\n * message key. A blank note is refused at the member (`MALFORMED_COMMAND`), so this command\n * cannot empty the documentation it exists to write.\n */\nexport interface SetRuleNoteCommand {\n readonly kind: 'setRuleNote';\n readonly ruleId: string;\n readonly note: string;\n}\n\n/**\n * Replaces one declared rule's payload, keeping its id, kind and scope.\n *\n * This is the command that makes a gate item's condition, a gate's `hard` flag, a screen's reasons\n * and a rule's severity editable after `addRule`. The store refuses an edit whose result would\n * still be two rules with one id, and a rule the caller's published baseline names is edited here\n * on purpose: moving behaviour is what a new edition is for, and the publish diff refuses the\n * same version. Removing a published rule is refused instead (`removeRule`).\n */\nexport interface EditRuleCommand {\n readonly kind: 'editRule';\n readonly ruleId: string;\n readonly rule: EditRuleSpec;\n}\n\n/** Removes one declared rule; a published rule id is permanent and is refused. */\nexport interface RemoveRuleCommand {\n readonly kind: 'removeRule';\n readonly ruleId: string;\n}\n\ninterface SetMessageTextCommand {\n readonly kind: 'setMessageText';\n readonly messageKey: string;\n readonly locale: string;\n readonly text: string;\n}\n\ninterface DeprecateFieldCommand {\n readonly kind: 'deprecateField';\n readonly fieldId: string;\n}\n\n/**\n * Removes one unpublished declaration and every layout reference to it.\n *\n * `EVOL-3.1.2` forbids deleting a declaration the published revision states, so a field the\n * baseline names is refused: a published field is retired with `deprecateField`, which keeps the\n * declaration and the values recorded under it readable. For a draft's own field removal is safe\n * only while nothing else names it, so a rule read or target, a signature's coverage, another\n * field's option source or row key, and an unreadable expression slot are all refused first.\n */\nexport interface RemoveFieldCommand {\n readonly kind: 'removeField';\n readonly fieldId: string;\n}\n\n/** Changes one unpublished declaration's value domain, keeping its id and copy. */\nexport interface SetFieldPrimitiveCommand {\n readonly kind: 'setFieldPrimitive';\n readonly fieldId: string;\n readonly field: FieldPrimitiveSpec;\n}\n\ninterface AddLayoutNodeCommand {\n readonly kind: 'addLayoutNode';\n /** The node as the layout grammar spells it; the compiler's walk is the authority on it. */\n readonly node: AuthoringLayoutNode;\n readonly parent?: LayoutPath;\n}\n\ninterface SetGroupColumnsCommand {\n readonly kind: 'setGroupColumns';\n readonly group: LayoutPath;\n readonly columns: number;\n}\n\n/**\n * Edits the members of the layout node at a path.\n *\n * The node's members are merged over the node that is there, so a caller states what it changed:\n * an absent member is left as it is and a `null` removes it, which is how an author clears a\n * conditional or a label they set earlier. Three members are not editable here because each has a\n * command that owns it: `kind` is the node's identity, `children` is the tree below it\n * (`addLayoutNode`, `removeLayoutNode`), and a group's `columns` narrows its children and reports\n * what it narrowed (`setGroupColumns`).\n */\nexport interface EditLayoutNodeCommand {\n readonly kind: 'editLayoutNode';\n readonly target: LayoutPath;\n readonly node: AuthoringLayoutNode;\n}\n\n/** Removes the layout node at a path, and everything below it. */\nexport interface RemoveLayoutNodeCommand {\n readonly kind: 'removeLayoutNode';\n readonly target: LayoutPath;\n}\n\n/** Places a declared field that has no layout leaf yet. */\nexport interface PlaceFieldCommand {\n readonly kind: 'placeField';\n readonly fieldId: string;\n readonly parent?: LayoutPath;\n readonly colSpan?: number;\n}\n\n/** Removes the node at `target` and places it under `parent` at `index` (append when absent). */\nexport interface MoveLayoutNodeCommand {\n readonly kind: 'moveLayoutNode';\n readonly target: LayoutPath;\n readonly parent?: LayoutPath;\n /** The position among the destination's children after the node has been removed. */\n readonly index?: number;\n}\n\n/**\n * Replaces the document's locale policy: the set every catalogue entry is complete in, and the one\n * a renderer shows by default.\n *\n * The two members are one fact — the default has to be one of the set — so one command states both\n * and no intermediate state can declare a default the set does not carry. Adding a language, moving\n * the default and dropping a language are the same edit with different arguments.\n */\nexport interface SetLocalesCommand {\n readonly kind: 'setLocales';\n readonly locales: readonly string[];\n readonly defaultLocale: string;\n}\n\nexport interface AddRecordArrayCommand {\n readonly kind: 'addRecordArray';\n readonly array: AddRecordArraySpec;\n}\n\ninterface AddRowMemberCommand {\n readonly kind: 'addRowMember';\n readonly arrayFieldId: string;\n readonly member: MemberSpec;\n}\n\ninterface AddRecordMemberCommand {\n readonly kind: 'addRecordMember';\n readonly parentFieldId: string;\n readonly member: MemberSpec;\n}\n\ninterface SetRowKeyCommand {\n readonly kind: 'setRowKey';\n readonly fieldId: string;\n readonly rowKey: AuthoringRowKey;\n}\n\ninterface SetSchemaVersionCommand {\n readonly kind: 'setSchemaVersion';\n /** The edition the draft now states; it must advance past the version it holds. */\n readonly schemaVersion: number;\n}\n\ninterface ImportTranslationsCommand {\n readonly kind: 'importTranslations';\n readonly translations: readonly TranslationEntry[];\n}\n\n/** Declares or repoints a section's primary designation. */\nexport interface SetPrimaryCommand {\n readonly kind: 'setPrimary';\n readonly ruleKind: 'gate' | 'screen';\n readonly ruleId: string;\n}\n\n/** Declares a table version this document resolves against (`schema.v1.json` `datasetRef`). */\nexport interface PinDatasetCommand {\n readonly kind: 'pinDataset';\n readonly tableId: string;\n readonly tableVersion: number;\n}\n\n/** Removes a dataset pin by table id. */\nexport interface UnpinDatasetCommand {\n readonly kind: 'unpinDataset';\n readonly tableId: string;\n}\n\n/** Declares or replaces one read-only evaluation root. */\nexport interface SetContextRootCommand {\n readonly kind: 'setContextRoot';\n readonly root: ContextRootSpec;\n}\n\n/** Removes a declared context root by path. */\nexport interface RemoveContextRootCommand {\n readonly kind: 'removeContextRoot';\n readonly path: string;\n}\n\n/** Replaces the document-level hiding policy, or clears it when `null`. */\nexport interface SetOnHideCommand {\n readonly kind: 'setOnHide';\n readonly onHide: OnHidePolicy | null;\n}\n\n/** Sets the document's title, minted under the `title` message key. */\nexport interface SetDocumentTitleCommand {\n readonly kind: 'setDocumentTitle';\n readonly text: string;\n}\n\n/** Binds a `signature_ref` declaration to the field ids it signs (`field.covers`). */\nexport interface SetSignatureCoversCommand {\n readonly kind: 'setSignatureCovers';\n readonly fieldId: string;\n readonly covers: readonly string[];\n}\n\n/** Every intent the store accepts. */\nexport type AuthoringCommand =\n | AddFieldCommand\n | AddOptionCommand\n | EditFieldCommand\n | SetFieldDeclarationCommand\n | DeprecateOptionCommand\n | MoveOptionCommand\n | SetOptionAvailabilityCommand\n | AddRuleCommand\n | AddRuleTestCaseCommand\n | SetRuleExprCommand\n | SetRuleNoteCommand\n | SetRuleSuggestsCommand\n | EditRuleCommand\n | RemoveRuleCommand\n | SetMessageTextCommand\n | DeprecateFieldCommand\n | RemoveFieldCommand\n | SetFieldPrimitiveCommand\n | AddLayoutNodeCommand\n | EditLayoutNodeCommand\n | RemoveLayoutNodeCommand\n | SetGroupColumnsCommand\n | PlaceFieldCommand\n | MoveLayoutNodeCommand\n | AddRecordArrayCommand\n | AddRowMemberCommand\n | AddRecordMemberCommand\n | SetRowKeyCommand\n | SetLocalesCommand\n | SetSchemaVersionCommand\n | ImportTranslationsCommand\n | SetPrimaryCommand\n | PinDatasetCommand\n | UnpinDatasetCommand\n | SetContextRootCommand\n | RemoveContextRootCommand\n | SetOnHideCommand\n | SetDocumentTitleCommand\n | SetSignatureCoversCommand;\n\n/* ------------------------------------------------------------------------------------ *\n * Dataset authoring.\n *\n * A dataset document is a second closed document, so it is a second command family rather than\n * members on the schema's: `dispatch` over a schema draft never sees one of these, and the dataset\n * store never sees a field edit. `tableId` travels on every command because a Studio holds several\n * tables, and a command dispatched to the wrong one is refused (`UNKNOWN_TABLE`) rather than\n * rewriting the table the store was handed.\n * ------------------------------------------------------------------------------------ */\n\n/**\n * One typed cell a command writes.\n *\n * The `kind` is the declared column's primitive, so the command states the type it means and the\n * store compares it with the column rather than coercing text into whatever the column holds. A\n * value is the canonical wire spelling of that primitive; `parseDatasetCommand` is the only\n * constructor of one, so a half-typed grid cell is refused at the member before it reaches a table.\n */\nexport type DatasetCellInput =\n | { readonly kind: 'string'; readonly value: string }\n | { readonly kind: 'boolean'; readonly value: boolean }\n | { readonly kind: 'integer'; readonly value: number }\n | { readonly kind: 'decimal'; readonly value: string }\n | { readonly kind: 'money'; readonly value: MoneyValue }\n /**\n * A measured quantity, `MODEL-2.1.21`.\n *\n * A quantity is a dataset scalar (`dataset.v1.json` `$defs.scalarPrimitive`) and a column may\n * declare one, so the cell kind is the same vocabulary the column states. The required\n * `unit` is the value's own; the column's declared unit domain and scale are checked against\n * this pair where the cell is read, not left to the compile.\n */\n | { readonly kind: 'quantity'; readonly value: QuantityValue }\n | { readonly kind: 'date'; readonly value: string }\n | { readonly kind: 'instant'; readonly value: string };\n\n/**\n * One row a command adds or replaces.\n *\n * Every member the metaschema's `row` states is here: the identity, the composite key and — when\n * the table kind states them — the verdict and the output. Which of `outcome`/`output` the table\n * requires is the table's answer, so the store decides it against the table it holds and refuses\n * with `INVALID_ROW` rather than parsing the same rule twice.\n */\nexport interface DatasetRowSpec {\n readonly rowId: string;\n /** One cell per key column, in declaration order (`DATA-1.2.3`). */\n readonly key: readonly DatasetCellInput[];\n /** A decision row's verdict; absent on a lookup row. */\n readonly outcome?: Outcome;\n /** The output record's cells, keyed by each output column's `columnId`. */\n readonly output?: Readonly<Record<string, DatasetCellInput>>;\n}\n\n/** Appends one row to a keyed table. */\nexport interface AddDatasetRowCommand {\n readonly kind: 'addDatasetRow';\n readonly tableId: string;\n readonly row: DatasetRowSpec;\n}\n\n/** Replaces one row's key, verdict and output, addressed by its `rowId`. */\nexport interface ReplaceDatasetRowCommand {\n readonly kind: 'replaceDatasetRow';\n readonly tableId: string;\n readonly rowId: string;\n readonly row: DatasetRowSpec;\n}\n\n/** Removes one row, addressed by its `rowId`. */\nexport interface RemoveDatasetRowCommand {\n readonly kind: 'removeDatasetRow';\n readonly tableId: string;\n readonly rowId: string;\n}\n\n/** Writes one cell of one row, with the typed value its column's primitive requires. */\nexport interface SetDatasetCellCommand {\n readonly kind: 'setDatasetCell';\n readonly tableId: string;\n readonly rowId: string;\n readonly columnId: string;\n readonly input: DatasetCellInput;\n}\n\n/** Declares a keyed table's columns, and with them its composite key (`DATA-1.2.2`). */\nexport interface SetDatasetColumnsCommand {\n readonly kind: 'setDatasetColumns';\n readonly tableId: string;\n readonly columns: readonly DatasetColumn[];\n}\n\n/** Replaces a set table's closed membership domain. */\nexport interface SetDatasetValuesCommand {\n readonly kind: 'setDatasetValues';\n readonly tableId: string;\n readonly values: readonly ScalarWireValue[];\n}\n\n/** States a keyed table's hit policy and, for `COLLECT`, its cap (`DATA-3.1.5`). */\nexport interface SetDatasetHitPolicyCommand {\n readonly kind: 'setDatasetHitPolicy';\n readonly tableId: string;\n readonly policy: AuthoredHitPolicy;\n}\n\n/** States a `data` table's half-open effective range (`DATA-2.1.3`). */\nexport interface SetDatasetEffectiveRangeCommand {\n readonly kind: 'setDatasetEffectiveRange';\n readonly tableId: string;\n readonly effectiveFrom: string;\n readonly effectiveTo: string;\n}\n\n/** Every intent a dataset store accepts. */\nexport type DatasetCommand =\n | AddDatasetRowCommand\n | ReplaceDatasetRowCommand\n | RemoveDatasetRowCommand\n | SetDatasetCellCommand\n | SetDatasetColumnsCommand\n | SetDatasetValuesCommand\n | SetDatasetHitPolicyCommand\n | SetDatasetEffectiveRangeCommand;\n\n/**\n * The coalescing identity of a dataset command, or `undefined` when it never coalesces.\n *\n * Typing into one grid cell is one edit however many values the field reports while the author\n * types, so consecutive `setDatasetCell` commands for the same `(tableId, rowId, columnId)` merge\n * into one undo step. Nothing else merges: a row replacement is a discrete decision, not a\n * keystroke.\n */\nexport function datasetCoalesceKeyOf(command: DatasetCommand): string | undefined {\n switch (command.kind) {\n case 'setDatasetCell':\n return `datasetCell\\u0000${command.tableId}\\u0000${command.rowId}\\u0000${command.columnId}`;\n case 'addDatasetRow':\n case 'replaceDatasetRow':\n case 'removeDatasetRow':\n case 'setDatasetColumns':\n case 'setDatasetValues':\n case 'setDatasetHitPolicy':\n case 'setDatasetEffectiveRange':\n return undefined;\n default:\n return assertNever(command);\n }\n}\n\n/**\n * The coalescing identity of a command, or `undefined` when it never coalesces.\n *\n * Typing into one field's text produces one undo entry however many keystrokes arrive: the store\n * merges consecutive `setMessageText` for the same `(messageKey, locale)` because each keystroke\n * is a revision of one edit. Nothing else merges, and there is no clock — the key is the whole\n * identity, so a replayed sequence coalesces the same way it did live.\n */\nexport function coalesceKeyOf(command: AuthoringCommand): string | undefined {\n switch (command.kind) {\n case 'setMessageText':\n return `message\\u0000${command.messageKey}\\u0000${command.locale}`;\n case 'setRuleExpr':\n // Typing source is one edit, like typing a message; choosing a visual form is a discrete\n // change of shape, so consecutive visual edits stay separate undo steps.\n return command.expression.mode === 'advanced'\n ? `ruleExpr\\u0000${command.ruleId}\\u0000advanced`\n : undefined;\n case 'setRuleNote':\n // A note is typed text too, so consecutive edits of one rule's note are one undo step.\n return `ruleNote\\u0000${command.ruleId}`;\n case 'setRuleSuggests':\n // An alternative list is a discrete editorial decision rather than typed text, so two\n // lists in a row are two undo steps.\n return undefined;\n case 'editRule':\n // The rule panel types source through `editRule`; one keystroke is a revision of the same\n // edit, so the same key `setRuleExpr` uses keeps the undo chain one step.\n return command.rule.expression?.mode === 'advanced'\n ? `ruleExpr\\u0000${command.ruleId}\\u0000advanced`\n : undefined;\n case 'addField':\n case 'addOption':\n case 'editField':\n case 'setFieldDeclaration':\n case 'deprecateOption':\n case 'moveOption':\n case 'setOptionAvailability':\n case 'addRule':\n case 'addRuleTestCase':\n case 'removeRule':\n case 'deprecateField':\n case 'removeField':\n case 'setFieldPrimitive':\n case 'addLayoutNode':\n case 'editLayoutNode':\n case 'removeLayoutNode':\n case 'setGroupColumns':\n case 'placeField':\n case 'moveLayoutNode':\n case 'addRecordArray':\n case 'addRowMember':\n case 'addRecordMember':\n case 'setRowKey':\n case 'setLocales':\n case 'setSchemaVersion':\n case 'importTranslations':\n case 'setPrimary':\n case 'pinDataset':\n case 'unpinDataset':\n case 'setContextRoot':\n case 'removeContextRoot':\n case 'setOnHide':\n case 'setDocumentTitle':\n case 'setSignatureCovers':\n return undefined;\n default:\n return assertNever(command);\n }\n}\n\n/** Every command kind, as the vocabulary a refusal and the coverage gate read. */\nexport const COMMAND_KINDS: readonly AuthoringCommand['kind'][] = [\n 'addField',\n 'addOption',\n 'editField',\n 'setFieldDeclaration',\n 'deprecateOption',\n 'moveOption',\n 'setOptionAvailability',\n 'addRule',\n 'addRuleTestCase',\n 'setRuleExpr',\n 'setRuleNote',\n 'setRuleSuggests',\n 'editRule',\n 'removeRule',\n 'setMessageText',\n 'deprecateField',\n 'removeField',\n 'setFieldPrimitive',\n 'addLayoutNode',\n 'editLayoutNode',\n 'removeLayoutNode',\n 'setGroupColumns',\n 'placeField',\n 'moveLayoutNode',\n 'addRecordArray',\n 'addRowMember',\n 'addRecordMember',\n 'setRowKey',\n 'setLocales',\n 'setSchemaVersion',\n 'importTranslations',\n 'setPrimary',\n 'pinDataset',\n 'unpinDataset',\n 'setContextRoot',\n 'removeContextRoot',\n 'setOnHide',\n 'setDocumentTitle',\n 'setSignatureCovers',\n];\n\n/** Every dataset command kind, as the vocabulary a refusal and the coverage gate read. */\nexport const DATASET_COMMAND_KINDS: readonly DatasetCommand['kind'][] = [\n 'addDatasetRow',\n 'replaceDatasetRow',\n 'removeDatasetRow',\n 'setDatasetCell',\n 'setDatasetColumns',\n 'setDatasetValues',\n 'setDatasetHitPolicy',\n 'setDatasetEffectiveRange',\n];\n\n/**\n * The dataset vocabulary as a total map.\n *\n * A new member of `DatasetCommand` is a missing key here, which is a typecheck failure, so the\n * refusal text and the test that counts kinds cannot drift from the union. An extra key is an\n * excess-property error, so the map cannot claim a command the union does not declare.\n */\nexport const DATASET_COMMAND_KIND_SET: Readonly<Record<DatasetCommand['kind'], true>> = {\n addDatasetRow: true,\n replaceDatasetRow: true,\n removeDatasetRow: true,\n setDatasetCell: true,\n setDatasetColumns: true,\n setDatasetValues: true,\n setDatasetHitPolicy: true,\n setDatasetEffectiveRange: true,\n};\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { OptionAvailabilitySpec, SuggestionSpec } from './shapes.js';
|
|
2
|
+
import type { ParseDraft } from './readers.js';
|
|
3
|
+
/**
|
|
4
|
+
* The readers for the configurator surface's two authored shapes: an alternative and an option's
|
|
5
|
+
* availability.
|
|
6
|
+
*
|
|
7
|
+
* The shapes are the metaschema's, narrowed exactly: an alternative states a label and at least one
|
|
8
|
+
* operation, and each operation states the members its kind requires and no others. What the store
|
|
9
|
+
* adds is the spelling an author works in — literal text for the label, Expr v1 source for every
|
|
10
|
+
* expression — because the compiler's parser is the one authority on what an expression means.
|
|
11
|
+
* The store preserves an unfinished expression as draft source rather than reinterpreting it.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* The operation kinds the closed metaschema enumerates, in the order the contract lists them.
|
|
15
|
+
*
|
|
16
|
+
* The metaschema is the authority and this list is the reader's copy of it; the coverage suite
|
|
17
|
+
* reads `$defs.suggestionOperation`'s five `oneOf` consts and fails when the two disagree, which
|
|
18
|
+
* keeps this reader equal to the contract. The compiler's own operation-kind guard is separate and
|
|
19
|
+
* is not reached by that pin.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SUGGESTION_OPERATION_KINDS: readonly ['value', 'null', 'remove', 'append', 'removeRow'];
|
|
22
|
+
/**
|
|
23
|
+
* The alternatives stated at one member, or `undefined` when the record states none.
|
|
24
|
+
*
|
|
25
|
+
* An empty list is refused rather than read as "none": an author who emptied the list means to
|
|
26
|
+
* remove it, which the command spells `null`, and a document stating `[]` is one the closed
|
|
27
|
+
* metaschema's `minItems` refuses.
|
|
28
|
+
*/
|
|
29
|
+
export declare function readSuggestionList(draftIn: ParseDraft, record: Readonly<Record<string, unknown>>, member: string, path: string): readonly SuggestionSpec[] | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* One declared option's availability, `schema.v1.json` `option`.
|
|
32
|
+
*
|
|
33
|
+
* The condition is required: an availability that states no condition limits nothing, and the
|
|
34
|
+
* reason and the alternatives it may carry are only meaningful beside the condition they answer.
|
|
35
|
+
*/
|
|
36
|
+
export declare function readOptionAvailability(draftIn: ParseDraft, value: unknown, path: string): OptionAvailabilitySpec | undefined;
|
|
37
|
+
//# sourceMappingURL=suggestions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestions.d.ts","sourceRoot":"","sources":["../../../src/store/commands/suggestions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAA2B,cAAc,EAAE,MAAM,aAAa,CAAC;AACnG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAc/C;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,YACrC,OAAO,EACP,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,WAAW,CACH,CAAC;AA8GX;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,SAAS,cAAc,EAAE,GAAG,SAAS,CAwBvC;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,GACX,sBAAsB,GAAG,SAAS,CA+BpC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { assertNever } from '@azx-pbc/axiom-runtime';
|
|
2
|
+
import { describe, fail, onlyMembers, readChoice, readExpressionSource, readIdentifier, readLiteral, readParams, readRecord, readRowKeyValue, } from './readers.js';
|
|
3
|
+
/**
|
|
4
|
+
* The readers for the configurator surface's two authored shapes: an alternative and an option's
|
|
5
|
+
* availability.
|
|
6
|
+
*
|
|
7
|
+
* The shapes are the metaschema's, narrowed exactly: an alternative states a label and at least one
|
|
8
|
+
* operation, and each operation states the members its kind requires and no others. What the store
|
|
9
|
+
* adds is the spelling an author works in — literal text for the label, Expr v1 source for every
|
|
10
|
+
* expression — because the compiler's parser is the one authority on what an expression means.
|
|
11
|
+
* The store preserves an unfinished expression as draft source rather than reinterpreting it.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* The operation kinds the closed metaschema enumerates, in the order the contract lists them.
|
|
15
|
+
*
|
|
16
|
+
* The metaschema is the authority and this list is the reader's copy of it; the coverage suite
|
|
17
|
+
* reads `$defs.suggestionOperation`'s five `oneOf` consts and fails when the two disagree, which
|
|
18
|
+
* keeps this reader equal to the contract. The compiler's own operation-kind guard is separate and
|
|
19
|
+
* is not reached by that pin.
|
|
20
|
+
*/
|
|
21
|
+
export const SUGGESTION_OPERATION_KINDS = [
|
|
22
|
+
'value',
|
|
23
|
+
'null',
|
|
24
|
+
'remove',
|
|
25
|
+
'append',
|
|
26
|
+
'removeRow',
|
|
27
|
+
];
|
|
28
|
+
function readSuggestedRef(draftIn, value, path) {
|
|
29
|
+
const record = readRecord(draftIn, value, path, 'a suggested reference');
|
|
30
|
+
if (record === undefined)
|
|
31
|
+
return undefined;
|
|
32
|
+
onlyMembers(draftIn, record, ['fieldId', 'rowKey'], path);
|
|
33
|
+
const fieldId = readIdentifier(draftIn, record, 'fieldId', path);
|
|
34
|
+
const rowKey = record['rowKey'];
|
|
35
|
+
const key = rowKey === undefined ? undefined : readRowKeyValue(draftIn, rowKey, `${path}.rowKey`);
|
|
36
|
+
if (fieldId === undefined || draftIn.refusal !== undefined)
|
|
37
|
+
return undefined;
|
|
38
|
+
return key === undefined ? { fieldId } : { fieldId, rowKey: key };
|
|
39
|
+
}
|
|
40
|
+
/** The row template an `append` states: one expression per member of the row being added. */
|
|
41
|
+
function readRowTemplate(draftIn, value, path) {
|
|
42
|
+
const template = readRecord(draftIn, value, path, 'a row template');
|
|
43
|
+
if (template === undefined)
|
|
44
|
+
return undefined;
|
|
45
|
+
if (Object.keys(template).length === 0) {
|
|
46
|
+
return fail(draftIn, path, 'a row template states at least one member; an appended row with no members adds nothing');
|
|
47
|
+
}
|
|
48
|
+
const narrowed = [];
|
|
49
|
+
for (const [member, source] of Object.entries(template)) {
|
|
50
|
+
const read = readExpressionSource(draftIn, source, `${path}.${member}`, member);
|
|
51
|
+
if (read === undefined)
|
|
52
|
+
return undefined;
|
|
53
|
+
narrowed.push([member, read]);
|
|
54
|
+
}
|
|
55
|
+
return Object.fromEntries(narrowed);
|
|
56
|
+
}
|
|
57
|
+
function readOperation(draftIn, value, path) {
|
|
58
|
+
const record = readRecord(draftIn, value, path, 'a suggestion operation');
|
|
59
|
+
if (record === undefined)
|
|
60
|
+
return undefined;
|
|
61
|
+
const kind = readChoice(draftIn, record, 'kind', path, SUGGESTION_OPERATION_KINDS);
|
|
62
|
+
if (kind === undefined)
|
|
63
|
+
return undefined;
|
|
64
|
+
switch (kind) {
|
|
65
|
+
case 'value': {
|
|
66
|
+
onlyMembers(draftIn, record, ['kind', 'ref', 'value'], path);
|
|
67
|
+
const ref = readSuggestedRef(draftIn, record['ref'], `${path}.ref`);
|
|
68
|
+
const expression = readExpressionSource(draftIn, record['value'], `${path}.value`, 'value');
|
|
69
|
+
if (ref === undefined || expression === undefined)
|
|
70
|
+
return undefined;
|
|
71
|
+
return { kind, ref, value: expression };
|
|
72
|
+
}
|
|
73
|
+
case 'null':
|
|
74
|
+
case 'remove': {
|
|
75
|
+
onlyMembers(draftIn, record, ['kind', 'ref'], path);
|
|
76
|
+
const ref = readSuggestedRef(draftIn, record['ref'], `${path}.ref`);
|
|
77
|
+
return ref === undefined ? undefined : { kind, ref };
|
|
78
|
+
}
|
|
79
|
+
case 'append': {
|
|
80
|
+
onlyMembers(draftIn, record, ['kind', 'fieldId', 'row'], path);
|
|
81
|
+
const fieldId = readIdentifier(draftIn, record, 'fieldId', path);
|
|
82
|
+
const row = readRowTemplate(draftIn, record['row'], `${path}.row`);
|
|
83
|
+
if (fieldId === undefined || row === undefined)
|
|
84
|
+
return undefined;
|
|
85
|
+
return { kind, fieldId, row };
|
|
86
|
+
}
|
|
87
|
+
case 'removeRow': {
|
|
88
|
+
onlyMembers(draftIn, record, ['kind', 'fieldId', 'rowKey'], path);
|
|
89
|
+
const fieldId = readIdentifier(draftIn, record, 'fieldId', path);
|
|
90
|
+
const rowKey = readRowKeyValue(draftIn, record['rowKey'], `${path}.rowKey`);
|
|
91
|
+
if (fieldId === undefined || rowKey === undefined)
|
|
92
|
+
return undefined;
|
|
93
|
+
return { kind, fieldId, rowKey };
|
|
94
|
+
}
|
|
95
|
+
default:
|
|
96
|
+
return assertNever(kind);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function readSuggestion(draftIn, value, path) {
|
|
100
|
+
const record = readRecord(draftIn, value, path, 'an alternative');
|
|
101
|
+
if (record === undefined)
|
|
102
|
+
return undefined;
|
|
103
|
+
onlyMembers(draftIn, record, ['label', 'operations'], path);
|
|
104
|
+
const label = readLiteral(draftIn, record, 'label', path);
|
|
105
|
+
if (label === undefined)
|
|
106
|
+
return undefined;
|
|
107
|
+
const raw = record['operations'];
|
|
108
|
+
if (!Array.isArray(raw) || raw.length === 0) {
|
|
109
|
+
return fail(draftIn, `${path}.operations`, 'an alternative states at least one operation; the metaschema states `minItems: 1`, because an alternative that writes nothing offers nothing');
|
|
110
|
+
}
|
|
111
|
+
const operations = [];
|
|
112
|
+
for (const [index, entry] of raw.entries()) {
|
|
113
|
+
const operation = readOperation(draftIn, entry, `${path}.operations[${String(index)}]`);
|
|
114
|
+
if (operation === undefined)
|
|
115
|
+
return undefined;
|
|
116
|
+
operations.push(operation);
|
|
117
|
+
}
|
|
118
|
+
return { label, operations };
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The alternatives stated at one member, or `undefined` when the record states none.
|
|
122
|
+
*
|
|
123
|
+
* An empty list is refused rather than read as "none": an author who emptied the list means to
|
|
124
|
+
* remove it, which the command spells `null`, and a document stating `[]` is one the closed
|
|
125
|
+
* metaschema's `minItems` refuses.
|
|
126
|
+
*/
|
|
127
|
+
export function readSuggestionList(draftIn, record, member, path) {
|
|
128
|
+
if (!Object.hasOwn(record, member))
|
|
129
|
+
return undefined;
|
|
130
|
+
const value = record[member];
|
|
131
|
+
if (!Array.isArray(value)) {
|
|
132
|
+
return fail(draftIn, `${path}.${member}`, `\`${member}\` is a list of alternatives; received ${describe(value)}`);
|
|
133
|
+
}
|
|
134
|
+
if (value.length === 0) {
|
|
135
|
+
return fail(draftIn, `${path}.${member}`, `\`${member}\` states at least one alternative; the metaschema states \`minItems: 1\``);
|
|
136
|
+
}
|
|
137
|
+
const suggestions = [];
|
|
138
|
+
for (const [index, entry] of value.entries()) {
|
|
139
|
+
const suggestion = readSuggestion(draftIn, entry, `${path}.${member}[${String(index)}]`);
|
|
140
|
+
if (suggestion === undefined)
|
|
141
|
+
return undefined;
|
|
142
|
+
suggestions.push(suggestion);
|
|
143
|
+
}
|
|
144
|
+
return suggestions;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* One declared option's availability, `schema.v1.json` `option`.
|
|
148
|
+
*
|
|
149
|
+
* The condition is required: an availability that states no condition limits nothing, and the
|
|
150
|
+
* reason and the alternatives it may carry are only meaningful beside the condition they answer.
|
|
151
|
+
*/
|
|
152
|
+
export function readOptionAvailability(draftIn, value, path) {
|
|
153
|
+
const record = readRecord(draftIn, value, path, 'an option availability');
|
|
154
|
+
if (record === undefined)
|
|
155
|
+
return undefined;
|
|
156
|
+
onlyMembers(draftIn, record, ['availableWhen', 'reason', 'params', 'suggests'], path);
|
|
157
|
+
const availableWhen = readExpressionSource(draftIn, record['availableWhen'], `${path}.availableWhen`, 'availableWhen');
|
|
158
|
+
const reason = Object.hasOwn(record, 'reason')
|
|
159
|
+
? readLiteral(draftIn, record, 'reason', path)
|
|
160
|
+
: undefined;
|
|
161
|
+
const params = readParams(draftIn, record, path);
|
|
162
|
+
// Arguments fill one sentence, so an availability that states them states the sentence too. The
|
|
163
|
+
// refusal is at the authored member, beside the text it is missing.
|
|
164
|
+
if (params !== undefined && reason === undefined) {
|
|
165
|
+
return fail(draftIn, path, '`params` states arguments for the sentence an unavailable option shows, so the availability also states `reason`: the text those arguments fill');
|
|
166
|
+
}
|
|
167
|
+
const suggests = readSuggestionList(draftIn, record, 'suggests', path);
|
|
168
|
+
if (availableWhen === undefined || draftIn.refusal !== undefined)
|
|
169
|
+
return undefined;
|
|
170
|
+
return {
|
|
171
|
+
availableWhen,
|
|
172
|
+
...(reason === undefined ? {} : { reason }),
|
|
173
|
+
...(params === undefined ? {} : { params }),
|
|
174
|
+
...(suggests === undefined ? {} : { suggests }),
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=suggestions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestions.js","sourceRoot":"","sources":["../../../src/store/commands/suggestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,UAAU,EACV,UAAU,EACV,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,OAAO;IACP,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,WAAW;CACH,CAAC;AAEX,SAAS,gBAAgB,CACvB,OAAmB,EACnB,KAAc,EACd,IAAY;IAEZ,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,uBAAuB,CAAC,CAAC;IACzE,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC3C,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACjE,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAChC,MAAM,GAAG,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,CAA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C,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC;QAC9C,CAAC,CAAC,SAAS,CAAC;IACd,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACjD,gGAAgG;IAChG,oEAAoE;IACpE,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACjD,OAAO,IAAI,CACT,OAAO,EACP,IAAI,EACJ,iJAAiJ,CAClJ,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IACvE,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACnF,OAAO;QACL,aAAa;QACb,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3C,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3C,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC;KAChD,CAAC;AACJ,CAAC","sourcesContent":["import { assertNever } from '@azx-pbc/axiom-runtime';\nimport type { AuthoringSuggestedRef } from '../../schema/document.js';\nimport type { OptionAvailabilitySpec, SuggestionOperationSpec, SuggestionSpec } from './shapes.js';\nimport type { ParseDraft } from './readers.js';\nimport {\n describe,\n fail,\n onlyMembers,\n readChoice,\n readExpressionSource,\n readIdentifier,\n readLiteral,\n readParams,\n readRecord,\n readRowKeyValue,\n} from './readers.js';\n\n/**\n * The readers for the configurator surface's two authored shapes: an alternative and an option's\n * availability.\n *\n * The shapes are the metaschema's, narrowed exactly: an alternative states a label and at least one\n * operation, and each operation states the members its kind requires and no others. What the store\n * adds is the spelling an author works in — literal text for the label, Expr v1 source for every\n * expression — because the compiler's parser is the one authority on what an expression means.\n * The store preserves an unfinished expression as draft source rather than reinterpreting it.\n */\n\n/**\n * The operation kinds the closed metaschema enumerates, in the order the contract lists them.\n *\n * The metaschema is the authority and this list is the reader's copy of it; the coverage suite\n * reads `$defs.suggestionOperation`'s five `oneOf` consts and fails when the two disagree, which\n * keeps this reader equal to the contract. The compiler's own operation-kind guard is separate and\n * is not reached by that pin.\n */\nexport const SUGGESTION_OPERATION_KINDS = [\n 'value',\n 'null',\n 'remove',\n 'append',\n 'removeRow',\n] as const;\n\nfunction readSuggestedRef(\n draftIn: ParseDraft,\n value: unknown,\n path: string,\n): AuthoringSuggestedRef | undefined {\n const record = readRecord(draftIn, value, path, 'a suggested reference');\n if (record === undefined) return undefined;\n onlyMembers(draftIn, record, ['fieldId', 'rowKey'], path);\n const fieldId = readIdentifier(draftIn, record, 'fieldId', path);\n const rowKey = record['rowKey'];\n const key = rowKey === undefined ? undefined : readRowKeyValue(draftIn, rowKey, `${path}.rowKey`);\n if (fieldId === undefined || draftIn.refusal !== undefined) return undefined;\n return key === undefined ? { fieldId } : { fieldId, rowKey: key };\n}\n\n/** The row template an `append` states: one expression per member of the row being added. */\nfunction readRowTemplate(\n draftIn: ParseDraft,\n value: unknown,\n path: string,\n): Readonly<Record<string, string>> | undefined {\n const template = readRecord(draftIn, value, path, 'a row template');\n if (template === undefined) return undefined;\n if (Object.keys(template).length === 0) {\n return fail(\n draftIn,\n path,\n 'a row template states at least one member; an appended row with no members adds nothing',\n );\n }\n const narrowed: [string, string][] = [];\n for (const [member, source] of Object.entries(template)) {\n const read = readExpressionSource(draftIn, source, `${path}.${member}`, member);\n if (read === undefined) return undefined;\n narrowed.push([member, read]);\n }\n return Object.fromEntries(narrowed);\n}\n\nfunction readOperation(\n draftIn: ParseDraft,\n value: unknown,\n path: string,\n): SuggestionOperationSpec | undefined {\n const record = readRecord(draftIn, value, path, 'a suggestion operation');\n if (record === undefined) return undefined;\n const kind = readChoice(draftIn, record, 'kind', path, SUGGESTION_OPERATION_KINDS);\n if (kind === undefined) return undefined;\n switch (kind) {\n case 'value': {\n onlyMembers(draftIn, record, ['kind', 'ref', 'value'], path);\n const ref = readSuggestedRef(draftIn, record['ref'], `${path}.ref`);\n const expression = readExpressionSource(draftIn, record['value'], `${path}.value`, 'value');\n if (ref === undefined || expression === undefined) return undefined;\n return { kind, ref, value: expression };\n }\n case 'null':\n case 'remove': {\n onlyMembers(draftIn, record, ['kind', 'ref'], path);\n const ref = readSuggestedRef(draftIn, record['ref'], `${path}.ref`);\n return ref === undefined ? undefined : { kind, ref };\n }\n case 'append': {\n onlyMembers(draftIn, record, ['kind', 'fieldId', 'row'], path);\n const fieldId = readIdentifier(draftIn, record, 'fieldId', path);\n const row = readRowTemplate(draftIn, record['row'], `${path}.row`);\n if (fieldId === undefined || row === undefined) return undefined;\n return { kind, fieldId, row };\n }\n case 'removeRow': {\n onlyMembers(draftIn, record, ['kind', 'fieldId', 'rowKey'], path);\n const fieldId = readIdentifier(draftIn, record, 'fieldId', path);\n const rowKey = readRowKeyValue(draftIn, record['rowKey'], `${path}.rowKey`);\n if (fieldId === undefined || rowKey === undefined) return undefined;\n return { kind, fieldId, rowKey };\n }\n default:\n return assertNever(kind);\n }\n}\n\nfunction readSuggestion(\n draftIn: ParseDraft,\n value: unknown,\n path: string,\n): SuggestionSpec | undefined {\n const record = readRecord(draftIn, value, path, 'an alternative');\n if (record === undefined) return undefined;\n onlyMembers(draftIn, record, ['label', 'operations'], path);\n const label = readLiteral(draftIn, record, 'label', path);\n if (label === undefined) return undefined;\n const raw = record['operations'];\n if (!Array.isArray(raw) || raw.length === 0) {\n return fail(\n draftIn,\n `${path}.operations`,\n 'an alternative states at least one operation; the metaschema states `minItems: 1`, because an alternative that writes nothing offers nothing',\n );\n }\n const operations: SuggestionOperationSpec[] = [];\n for (const [index, entry] of raw.entries()) {\n const operation = readOperation(draftIn, entry, `${path}.operations[${String(index)}]`);\n if (operation === undefined) return undefined;\n operations.push(operation);\n }\n return { label, operations };\n}\n\n/**\n * The alternatives stated at one member, or `undefined` when the record states none.\n *\n * An empty list is refused rather than read as \"none\": an author who emptied the list means to\n * remove it, which the command spells `null`, and a document stating `[]` is one the closed\n * metaschema's `minItems` refuses.\n */\nexport function readSuggestionList(\n draftIn: ParseDraft,\n record: Readonly<Record<string, unknown>>,\n member: string,\n path: string,\n): readonly SuggestionSpec[] | undefined {\n if (!Object.hasOwn(record, member)) return undefined;\n const value = record[member];\n if (!Array.isArray(value)) {\n return fail(\n draftIn,\n `${path}.${member}`,\n `\\`${member}\\` is a list of alternatives; received ${describe(value)}`,\n );\n }\n if (value.length === 0) {\n return fail(\n draftIn,\n `${path}.${member}`,\n `\\`${member}\\` states at least one alternative; the metaschema states \\`minItems: 1\\``,\n );\n }\n const suggestions: SuggestionSpec[] = [];\n for (const [index, entry] of value.entries()) {\n const suggestion = readSuggestion(draftIn, entry, `${path}.${member}[${String(index)}]`);\n if (suggestion === undefined) return undefined;\n suggestions.push(suggestion);\n }\n return suggestions;\n}\n\n/**\n * One declared option's availability, `schema.v1.json` `option`.\n *\n * The condition is required: an availability that states no condition limits nothing, and the\n * reason and the alternatives it may carry are only meaningful beside the condition they answer.\n */\nexport function readOptionAvailability(\n draftIn: ParseDraft,\n value: unknown,\n path: string,\n): OptionAvailabilitySpec | undefined {\n const record = readRecord(draftIn, value, path, 'an option availability');\n if (record === undefined) return undefined;\n onlyMembers(draftIn, record, ['availableWhen', 'reason', 'params', 'suggests'], path);\n const availableWhen = readExpressionSource(\n draftIn,\n record['availableWhen'],\n `${path}.availableWhen`,\n 'availableWhen',\n );\n const reason = Object.hasOwn(record, 'reason')\n ? readLiteral(draftIn, record, 'reason', path)\n : undefined;\n const params = readParams(draftIn, record, path);\n // Arguments fill one sentence, so an availability that states them states the sentence too. The\n // refusal is at the authored member, beside the text it is missing.\n if (params !== undefined && reason === undefined) {\n return fail(\n draftIn,\n path,\n '`params` states arguments for the sentence an unavailable option shows, so the availability also states `reason`: the text those arguments fill',\n );\n }\n const suggests = readSuggestionList(draftIn, record, 'suggests', path);\n if (availableWhen === undefined || draftIn.refusal !== undefined) return undefined;\n return {\n availableWhen,\n ...(reason === undefined ? {} : { reason }),\n ...(params === undefined ? {} : { params }),\n ...(suggests === undefined ? {} : { suggests }),\n };\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The command surface of the authoring store, kept as one public entry.
|
|
3
|
+
*
|
|
4
|
+
* The union and its specs live in `commands/shapes.ts`, the narrowing in `commands/parse.ts` and
|
|
5
|
+
* one reader per family beside it. A caller imports from this module exactly as before: a split
|
|
6
|
+
* for readability is not a second door, and nothing here re-validates what `parseCommand`
|
|
7
|
+
* narrowed.
|
|
8
|
+
*/
|
|
9
|
+
export { COMMAND_KINDS, DATASET_COMMAND_KINDS, DATASET_COMMAND_KIND_SET, coalesceKeyOf, datasetCoalesceKeyOf, } from './commands/shapes.js';
|
|
10
|
+
export type { AddDatasetRowCommand, AddFieldSpec, AddOptionSpec, AddRecordArrayCommand, AddRecordArraySpec, AddRuleCommand, AddRuleSpec, AddRuleTestCaseCommand, AuthoringCommand, AuthoringRuleKind, ContextRootSpec, DatasetCellInput, DatasetCommand, DatasetPinSpec, DatasetRowSpec, DeprecateOptionCommand, EditFieldCommand, EditFieldSpec, EditLayoutNodeCommand, EditRuleCommand, EditRuleSpec, FieldDeclarationSpec, FieldPrimitiveSpec, GateEditSpec, GateItemSpec, GateSpec, LayoutPath, MemberFieldSpec, MemberSpec, MoveLayoutNodeCommand, OptionAvailabilitySpec, PinDatasetCommand, PlaceFieldCommand, RemoveContextRootCommand, RemoveDatasetRowCommand, RemoveFieldCommand, RemoveLayoutNodeCommand, RemoveRuleCommand, ReplaceDatasetRowCommand, ScreenReasonSpec, SetContextRootCommand, SetDatasetCellCommand, SetDatasetColumnsCommand, SetDatasetEffectiveRangeCommand, SetDatasetHitPolicyCommand, SetDatasetValuesCommand, SetDocumentTitleCommand, SetFieldDeclarationCommand, SetFieldPrimitiveCommand, SetLocalesCommand, SetOnHideCommand, SetOptionAvailabilityCommand, SetPrimaryCommand, SetRuleExprCommand, SetRuleNoteCommand, SetRuleSuggestsCommand, SetSignatureCoversCommand, SuggestionOperationSpec, SuggestionSpec, TestCaseSpec, UnpinDatasetCommand, } from './commands/shapes.js';
|
|
11
|
+
export { parseCommand } from './commands/parse.js';
|
|
12
|
+
export type { CommandParse } from './commands/parse.js';
|
|
13
|
+
export { parseDatasetCommand } from './commands/dataset.js';
|
|
14
|
+
export type { DatasetCommandParse } from './commands/dataset.js';
|
|
15
|
+
export { MAX_MEMBER_NESTING } from './commands/readers.js';
|
|
16
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/store/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,wBAAwB,EACxB,aAAa,EACb,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EACjB,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,+BAA+B,EAC/B,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,4BAA4B,EAC5B,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The command surface of the authoring store, kept as one public entry.
|
|
3
|
+
*
|
|
4
|
+
* The union and its specs live in `commands/shapes.ts`, the narrowing in `commands/parse.ts` and
|
|
5
|
+
* one reader per family beside it. A caller imports from this module exactly as before: a split
|
|
6
|
+
* for readability is not a second door, and nothing here re-validates what `parseCommand`
|
|
7
|
+
* narrowed.
|
|
8
|
+
*/
|
|
9
|
+
export { COMMAND_KINDS, DATASET_COMMAND_KINDS, DATASET_COMMAND_KIND_SET, coalesceKeyOf, datasetCoalesceKeyOf, } from './commands/shapes.js';
|
|
10
|
+
export { parseCommand } from './commands/parse.js';
|
|
11
|
+
export { parseDatasetCommand } from './commands/dataset.js';
|
|
12
|
+
export { MAX_MEMBER_NESTING } from './commands/readers.js';
|
|
13
|
+
//# sourceMappingURL=commands.js.map
|