@magmonium/cli 0.8.25 → 0.8.26
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/codegen/index.js +209 -29
- package/package.json +1 -1
package/codegen/index.js
CHANGED
|
@@ -414,6 +414,8 @@ __export(index_exports, {
|
|
|
414
414
|
bindingPathText: () => bindingPathText,
|
|
415
415
|
bindingShapeId: () => bindingShapeId,
|
|
416
416
|
bindingsNeedTranslate: () => bindingsNeedTranslate,
|
|
417
|
+
boundSlotMismatch: () => boundSlotMismatch,
|
|
418
|
+
boundSlotType: () => boundSlotType,
|
|
417
419
|
buildDesignSource: () => buildDesignSource,
|
|
418
420
|
buildFormShape: () => buildFormShape,
|
|
419
421
|
buildOutputOpenValue: () => buildOutputOpenValue,
|
|
@@ -916,6 +918,7 @@ __export(index_exports, {
|
|
|
916
918
|
isKeyedRepeat: () => isKeyedRepeat,
|
|
917
919
|
isKnownVariantId: () => isKnownVariantId,
|
|
918
920
|
isLegalNavTail: () => isLegalNavTail,
|
|
921
|
+
isLimitDrawn: () => isLimitDrawn,
|
|
919
922
|
isLinkedFormModel: () => isLinkedFormModel,
|
|
920
923
|
isLinkedKeySource: () => isLinkedKeySource,
|
|
921
924
|
isLinkedVariable: () => isLinkedVariable,
|
|
@@ -1032,6 +1035,9 @@ __export(index_exports, {
|
|
|
1032
1035
|
liftToList: () => liftToList,
|
|
1033
1036
|
liftToListInTemplate: () => liftToListInTemplate,
|
|
1034
1037
|
liftsToList: () => liftsToList,
|
|
1038
|
+
limitSourceFor: () => limitSourceFor,
|
|
1039
|
+
limitSourceOf: () => limitSourceOf,
|
|
1040
|
+
limitSources: () => limitSources,
|
|
1035
1041
|
linkDrift: () => linkDrift,
|
|
1036
1042
|
linkTargetKind: () => linkTargetKind,
|
|
1037
1043
|
linkedVariableReaders: () => linkedVariableReaders,
|
|
@@ -7426,6 +7432,12 @@ function controlMapStateRootIds(map) {
|
|
|
7426
7432
|
transformStateRootIds(binding.transform).forEach((id) => ids.add(id));
|
|
7427
7433
|
})
|
|
7428
7434
|
);
|
|
7435
|
+
Object.values(map).forEach(
|
|
7436
|
+
(control) => (control.checks ?? []).forEach((check) => {
|
|
7437
|
+
if (check.limitSource === "state" && check.limitRef)
|
|
7438
|
+
ids.add(check.limitRef);
|
|
7439
|
+
})
|
|
7440
|
+
);
|
|
7429
7441
|
return [...ids];
|
|
7430
7442
|
}
|
|
7431
7443
|
function controlMapReadsState(map) {
|
|
@@ -8961,6 +8973,25 @@ var emittedDataType = (binding, scope) => {
|
|
|
8961
8973
|
functions: scope.functions
|
|
8962
8974
|
});
|
|
8963
8975
|
};
|
|
8976
|
+
var BOUND_SLOT_TYPES = {
|
|
8977
|
+
["section_pagination" /* SECTION_PAGINATION */]: { [BINDING_SLOT.total]: "number" },
|
|
8978
|
+
["section_filter" /* SECTION_FILTER */]: {
|
|
8979
|
+
[BINDING_SLOT.min]: "number",
|
|
8980
|
+
[BINDING_SLOT.max]: "number"
|
|
8981
|
+
},
|
|
8982
|
+
["heat_swatch" /* HEAT_SWATCH */]: { [BINDING_SLOT.value]: "number" },
|
|
8983
|
+
["score_set_item" /* SCORE_SET_ITEM */]: { [BINDING_SLOT.value]: "number" },
|
|
8984
|
+
["scale_mark" /* SCALE_MARK */]: { [BINDING_SLOT.value]: "number" },
|
|
8985
|
+
["score_set" /* SCORE_SET */]: { [BINDING_SLOT.scoreDate]: "string" },
|
|
8986
|
+
["img" /* IMG */]: { [BINDING_SLOT.src]: "string" }
|
|
8987
|
+
};
|
|
8988
|
+
var boundSlotType = (type, slot) => type ? BOUND_SLOT_TYPES[type]?.[slot] : void 0;
|
|
8989
|
+
var boundSlotMismatch = (type, slot, binding, scope) => {
|
|
8990
|
+
const expected = boundSlotType(type, slot);
|
|
8991
|
+
if (!expected || !binding) return void 0;
|
|
8992
|
+
const actual = emittedDataType(binding, scope)?.type;
|
|
8993
|
+
return actual && actual !== expected ? { expected, actual } : void 0;
|
|
8994
|
+
};
|
|
8964
8995
|
var textBindingExpression = (binding, scope, translated = false) => {
|
|
8965
8996
|
const expr = bindingExpression(binding, scope);
|
|
8966
8997
|
if (!expr) return void 0;
|
|
@@ -19921,8 +19952,83 @@ function countIconReferences(controlMap, name3) {
|
|
|
19921
19952
|
var fieldChecks = (control) => control?.checks ?? [];
|
|
19922
19953
|
var checkKind = (check) => check.kind ?? "function";
|
|
19923
19954
|
var takesLimit = (kind) => LIMIT_CHECK_KINDS.includes(kind);
|
|
19955
|
+
var limitSourceOf = (check) => check.limitSource ?? "fixed";
|
|
19956
|
+
var isNumberScalar = (dataType, cardinality) => dataType?.type === "number" && (cardinality ?? "one") === "one";
|
|
19957
|
+
function limitSources(scope) {
|
|
19958
|
+
const map = {};
|
|
19959
|
+
const add = (entry2) => {
|
|
19960
|
+
map[entry2.id] = entry2;
|
|
19961
|
+
};
|
|
19962
|
+
const functions = scope.functions ?? {};
|
|
19963
|
+
const storeProp = (id) => {
|
|
19964
|
+
const prop = scope.storePropOf?.(id);
|
|
19965
|
+
return prop ? { storeProp: prop } : {};
|
|
19966
|
+
};
|
|
19967
|
+
Object.values(scope.inputs ?? {}).forEach((input) => {
|
|
19968
|
+
if (isNumberScalar(input.dataType, input.cardinality))
|
|
19969
|
+
add({ id: input.id, name: input.name, source: "screen", read: "signal" });
|
|
19970
|
+
});
|
|
19971
|
+
Object.values(scope.constants ?? {}).forEach((constant) => {
|
|
19972
|
+
if (constant.dataType === "number")
|
|
19973
|
+
add({
|
|
19974
|
+
id: constant.id,
|
|
19975
|
+
name: constant.name,
|
|
19976
|
+
source: "screen",
|
|
19977
|
+
read: "plain"
|
|
19978
|
+
});
|
|
19979
|
+
});
|
|
19980
|
+
Object.values(scope.variables ?? {}).forEach((variable) => {
|
|
19981
|
+
if (variable.dataType === "number" && variable.cardinality === "one")
|
|
19982
|
+
add({
|
|
19983
|
+
id: variable.id,
|
|
19984
|
+
name: variable.name,
|
|
19985
|
+
source: "screen",
|
|
19986
|
+
read: "signal"
|
|
19987
|
+
});
|
|
19988
|
+
});
|
|
19989
|
+
Object.values(scope.screenComputeds ?? {}).forEach((computed) => {
|
|
19990
|
+
const fn = computed.functionId ? functions[computed.functionId] : void 0;
|
|
19991
|
+
const held = fn ? { dataType: fn.returnType, cardinality: returnCardinalityOf(fn) } : computed.returns;
|
|
19992
|
+
if (held && isNumberScalar(held.dataType, held.cardinality))
|
|
19993
|
+
add({
|
|
19994
|
+
id: computed.id,
|
|
19995
|
+
name: computed.name,
|
|
19996
|
+
source: "screen",
|
|
19997
|
+
read: "signal"
|
|
19998
|
+
});
|
|
19999
|
+
});
|
|
20000
|
+
Object.values(scope.properties ?? {}).forEach((property) => {
|
|
20001
|
+
if (isNumberScalar(property.dataType, property.cardinality))
|
|
20002
|
+
add({
|
|
20003
|
+
id: property.id,
|
|
20004
|
+
name: property.name,
|
|
20005
|
+
source: "state",
|
|
20006
|
+
read: "signal",
|
|
20007
|
+
...storeProp(property.id)
|
|
20008
|
+
});
|
|
20009
|
+
});
|
|
20010
|
+
Object.values(scope.computeds ?? {}).forEach((computed) => {
|
|
20011
|
+
const fn = functions[computed.functionId];
|
|
20012
|
+
if (fn && isNumberScalar(fn.returnType, returnCardinalityOf(fn)))
|
|
20013
|
+
add({
|
|
20014
|
+
id: computed.id,
|
|
20015
|
+
name: computed.name,
|
|
20016
|
+
source: "state",
|
|
20017
|
+
read: "signal",
|
|
20018
|
+
...storeProp(computed.id)
|
|
20019
|
+
});
|
|
20020
|
+
});
|
|
20021
|
+
return map;
|
|
20022
|
+
}
|
|
20023
|
+
var limitSourceFor = (check, sources) => {
|
|
20024
|
+
const source = limitSourceOf(check);
|
|
20025
|
+
if (source === "fixed" || !check.limitRef) return void 0;
|
|
20026
|
+
const entry2 = sources[check.limitRef];
|
|
20027
|
+
return entry2?.source === source ? entry2 : void 0;
|
|
20028
|
+
};
|
|
20029
|
+
var isLimitDrawn = (check, sources = {}) => limitSourceOf(check) === "fixed" ? typeof check.limit === "number" && Number.isFinite(check.limit) : !!limitSourceFor(check, sources);
|
|
19924
20030
|
var isBooleanStateProperty = (property) => property?.dataType.type === "boolean" && property.cardinality === "one";
|
|
19925
|
-
var isCheckComplete = (check, functions, controlMap = {}, properties = {}) => {
|
|
20031
|
+
var isCheckComplete = (check, functions, controlMap = {}, properties = {}, sources = {}) => {
|
|
19926
20032
|
const kind = checkKind(check);
|
|
19927
20033
|
if (kind === "function") {
|
|
19928
20034
|
const fn = functions[check.functionId];
|
|
@@ -19935,9 +20041,7 @@ var isCheckComplete = (check, functions, controlMap = {}, properties = {}) => {
|
|
|
19935
20041
|
return !!bound && controlMap[bound]?.type === "field" /* FIELD */;
|
|
19936
20042
|
});
|
|
19937
20043
|
}
|
|
19938
|
-
if (takesLimit(kind))
|
|
19939
|
-
return typeof check.limit === "number" && Number.isFinite(check.limit);
|
|
19940
|
-
}
|
|
20044
|
+
if (takesLimit(kind)) return isLimitDrawn(check, sources);
|
|
19941
20045
|
if (kind === "matchField") {
|
|
19942
20046
|
const target = check.matchFieldId ? controlMap[check.matchFieldId] : void 0;
|
|
19943
20047
|
return target?.type === "field" /* FIELD */;
|
|
@@ -20046,13 +20150,14 @@ var STOCK_VALIDATOR = {
|
|
|
20046
20150
|
minAge: "minAgeValidation",
|
|
20047
20151
|
matchField: "matchFieldValidation"
|
|
20048
20152
|
};
|
|
20049
|
-
function stockStatement(kind, check, fieldName, controlMap) {
|
|
20153
|
+
function stockStatement(kind, check, fieldName, controlMap, limitRead) {
|
|
20050
20154
|
const call = STOCK_VALIDATOR[kind];
|
|
20155
|
+
const limit = limitRead ? `state.${limitRead.name}` : `${check.limit}`;
|
|
20051
20156
|
if (kind === "email" || kind === "url") {
|
|
20052
20157
|
return ` ${call}(tree['${fieldName}'] as SchemaPath<string>);`;
|
|
20053
20158
|
}
|
|
20054
20159
|
if (kind === "minAge") {
|
|
20055
|
-
return ` ${call}(tree['${fieldName}'] as SchemaPath<string>, ${
|
|
20160
|
+
return ` ${call}(tree['${fieldName}'] as SchemaPath<string>, ${limit});`;
|
|
20056
20161
|
}
|
|
20057
20162
|
if (kind === "matchField") {
|
|
20058
20163
|
const target = check.matchFieldId ? controlMap[check.matchFieldId] : void 0;
|
|
@@ -20071,14 +20176,15 @@ function stockStatement(kind, check, fieldName, controlMap) {
|
|
|
20071
20176
|
` );`
|
|
20072
20177
|
].join("\n");
|
|
20073
20178
|
}
|
|
20074
|
-
return ` ${call}(tree, ['${fieldName}'], ${
|
|
20179
|
+
return ` ${call}(tree, ['${fieldName}'], ${limit});`;
|
|
20075
20180
|
}
|
|
20076
|
-
function generateFormValidation(controlMap, formId, functions, properties = {}) {
|
|
20181
|
+
function generateFormValidation(controlMap, formId, functions, properties = {}, sources = {}) {
|
|
20077
20182
|
const shape = buildFormShape(controlMap, formId);
|
|
20078
20183
|
if (!shape) return void 0;
|
|
20079
20184
|
const used = /* @__PURE__ */ new Map();
|
|
20080
20185
|
const stock = /* @__PURE__ */ new Set();
|
|
20081
20186
|
const statePropertyNames = /* @__PURE__ */ new Set();
|
|
20187
|
+
const limitReads = /* @__PURE__ */ new Map();
|
|
20082
20188
|
const stateChecks = [];
|
|
20083
20189
|
const blocks = [];
|
|
20084
20190
|
let usesForm = false;
|
|
@@ -20088,7 +20194,8 @@ function generateFormValidation(controlMap, formId, functions, properties = {})
|
|
|
20088
20194
|
const field = controlMap[fieldId];
|
|
20089
20195
|
const name3 = resolveFieldName({ id: fieldId, configs: field.configs });
|
|
20090
20196
|
fieldChecks(field).forEach((check) => {
|
|
20091
|
-
if (!isCheckComplete(check, functions, controlMap, properties))
|
|
20197
|
+
if (!isCheckComplete(check, functions, controlMap, properties, sources))
|
|
20198
|
+
return;
|
|
20092
20199
|
const kind = checkKind(check);
|
|
20093
20200
|
if (kind === "stateTrue" || kind === "stateFalse") {
|
|
20094
20201
|
const property = check.statePropertyId ? properties[check.statePropertyId] : void 0;
|
|
@@ -20117,8 +20224,16 @@ function generateFormValidation(controlMap, formId, functions, properties = {})
|
|
|
20117
20224
|
return;
|
|
20118
20225
|
}
|
|
20119
20226
|
if (kind !== "function") {
|
|
20120
|
-
const
|
|
20227
|
+
const limitRead = takesLimit(kind) ? limitSourceFor(check, sources) : void 0;
|
|
20228
|
+
const statement = stockStatement(
|
|
20229
|
+
kind,
|
|
20230
|
+
check,
|
|
20231
|
+
name3,
|
|
20232
|
+
controlMap,
|
|
20233
|
+
limitRead
|
|
20234
|
+
);
|
|
20121
20235
|
if (!statement) return;
|
|
20236
|
+
if (limitRead) limitReads.set(limitRead.name, limitRead);
|
|
20122
20237
|
stock.add(STOCK_VALIDATOR[kind]);
|
|
20123
20238
|
if (!takesLimit(kind) || kind === "minAge") usesSchemaPath = true;
|
|
20124
20239
|
blocks.push(statement);
|
|
@@ -20172,6 +20287,9 @@ function generateFormValidation(controlMap, formId, functions, properties = {})
|
|
|
20172
20287
|
functions: [...used.values()].sort((a, b) => a.name.localeCompare(b.name)),
|
|
20173
20288
|
stockValidators: [...stock].sort(),
|
|
20174
20289
|
statePropertyNames: [...statePropertyNames].sort(),
|
|
20290
|
+
limitReads: [...limitReads.values()].sort(
|
|
20291
|
+
(a, b) => a.name.localeCompare(b.name)
|
|
20292
|
+
),
|
|
20175
20293
|
fields: shape.keys,
|
|
20176
20294
|
stateChecks,
|
|
20177
20295
|
usesValidate,
|
|
@@ -20218,11 +20336,14 @@ function generateFormValidationFile(emission) {
|
|
|
20218
20336
|
] : [],
|
|
20219
20337
|
...functionImports ? [functionImports] : [],
|
|
20220
20338
|
``,
|
|
20221
|
-
...emission.statePropertyNames.length ? [
|
|
20339
|
+
...emission.statePropertyNames.length || emission.limitReads.length ? [
|
|
20222
20340
|
`export const ${emission.memberName} = (state: {`,
|
|
20223
20341
|
...emission.statePropertyNames.map(
|
|
20224
20342
|
(name3) => ` ${name3}: () => boolean | undefined;`
|
|
20225
20343
|
),
|
|
20344
|
+
...emission.limitReads.map(
|
|
20345
|
+
(read) => ` ${read.name}: () => number | undefined;`
|
|
20346
|
+
),
|
|
20226
20347
|
`}): SchemaOrSchemaFn<Record<string, unknown>> => (path) => {`
|
|
20227
20348
|
] : [
|
|
20228
20349
|
`export const ${emission.memberName}: SchemaOrSchemaFn<`,
|
|
@@ -20240,41 +20361,74 @@ function generateFormValidationFile(emission) {
|
|
|
20240
20361
|
``
|
|
20241
20362
|
].join("\n");
|
|
20242
20363
|
}
|
|
20243
|
-
function formValidationBlock(controlMap, functions, properties = {}, stateAccessor = "") {
|
|
20364
|
+
function formValidationBlock(controlMap, functions, properties = {}, stateAccessor = "", sources = {}) {
|
|
20244
20365
|
const emissions = Object.keys(controlMap).filter((id) => controlMap[id].type === "form" /* FORM */).map((id) => ({
|
|
20245
20366
|
id,
|
|
20246
|
-
emission: generateFormValidation(
|
|
20367
|
+
emission: generateFormValidation(
|
|
20368
|
+
controlMap,
|
|
20369
|
+
id,
|
|
20370
|
+
functions,
|
|
20371
|
+
properties,
|
|
20372
|
+
sources
|
|
20373
|
+
)
|
|
20247
20374
|
})).filter(
|
|
20248
20375
|
(entry2) => !!entry2.emission
|
|
20249
20376
|
).map((entry2) => entry2.emission).sort((a, b) => a.memberName.localeCompare(b.memberName));
|
|
20250
20377
|
if (!emissions.length) return { body: "", emissions: [] };
|
|
20251
20378
|
const body = emissions.map((emission) => {
|
|
20252
|
-
const
|
|
20379
|
+
const entries = [
|
|
20380
|
+
...emission.statePropertyNames.map(
|
|
20381
|
+
(name3) => `${name3}: ${stateAccessor}.${name3}`
|
|
20382
|
+
),
|
|
20383
|
+
...emission.limitReads.map((read) => {
|
|
20384
|
+
const receiver = read.source !== "state" ? "this" : read.storeProp ? `this.${read.storeProp}` : stateAccessor;
|
|
20385
|
+
const call = read.read === "signal" ? "()" : "";
|
|
20386
|
+
return `${read.name}: () => ${receiver}.${read.name}${call}`;
|
|
20387
|
+
})
|
|
20388
|
+
];
|
|
20389
|
+
const state = entries.length ? `({ ${entries.join(", ")} })` : "";
|
|
20253
20390
|
return ` protected readonly ${emission.memberName} = ${emission.memberName}${state};`;
|
|
20254
20391
|
}).join("\n");
|
|
20255
20392
|
return { body: `
|
|
20256
20393
|
${body}
|
|
20257
20394
|
`, emissions };
|
|
20258
20395
|
}
|
|
20259
|
-
function formValidationFiles(controlMap, functions, properties = {}) {
|
|
20260
|
-
return formValidationEmissions(
|
|
20396
|
+
function formValidationFiles(controlMap, functions, properties = {}, sources = {}) {
|
|
20397
|
+
return formValidationEmissions(
|
|
20398
|
+
controlMap,
|
|
20399
|
+
functions,
|
|
20400
|
+
properties,
|
|
20401
|
+
sources
|
|
20402
|
+
).map(
|
|
20261
20403
|
({ fileName, emission }) => ({
|
|
20262
20404
|
fileName,
|
|
20263
20405
|
contents: generateFormValidationFile(emission)
|
|
20264
20406
|
})
|
|
20265
20407
|
);
|
|
20266
20408
|
}
|
|
20267
|
-
function formValidationEmissions(controlMap, functions, properties = {}) {
|
|
20268
|
-
return formValidationBlock(
|
|
20409
|
+
function formValidationEmissions(controlMap, functions, properties = {}, sources = {}) {
|
|
20410
|
+
return formValidationBlock(
|
|
20411
|
+
controlMap,
|
|
20412
|
+
functions,
|
|
20413
|
+
properties,
|
|
20414
|
+
"",
|
|
20415
|
+
sources
|
|
20416
|
+
).emissions.map(
|
|
20269
20417
|
(emission) => ({
|
|
20270
20418
|
fileName: validationFileName(emission.formName),
|
|
20271
20419
|
emission
|
|
20272
20420
|
})
|
|
20273
20421
|
);
|
|
20274
20422
|
}
|
|
20275
|
-
function validationBindings(controlMap, functions, properties = {}) {
|
|
20423
|
+
function validationBindings(controlMap, functions, properties = {}, sources = {}) {
|
|
20276
20424
|
const bindings = {};
|
|
20277
|
-
formValidationBlock(
|
|
20425
|
+
formValidationBlock(
|
|
20426
|
+
controlMap,
|
|
20427
|
+
functions,
|
|
20428
|
+
properties,
|
|
20429
|
+
"",
|
|
20430
|
+
sources
|
|
20431
|
+
).emissions.forEach(
|
|
20278
20432
|
(emission) => {
|
|
20279
20433
|
bindings[emission.formId] = emission.memberName;
|
|
20280
20434
|
}
|
|
@@ -21859,10 +22013,21 @@ var validationMemberFor = (node, ctx) => {
|
|
|
21859
22013
|
const bindings = validationBindings(
|
|
21860
22014
|
controlMap,
|
|
21861
22015
|
ctx.functions ?? {},
|
|
21862
|
-
ctx.properties ?? {}
|
|
22016
|
+
ctx.properties ?? {},
|
|
22017
|
+
checkLimitSources(ctx)
|
|
21863
22018
|
);
|
|
21864
22019
|
return bindings[node.id];
|
|
21865
22020
|
};
|
|
22021
|
+
var checkLimitSources = (ctx) => limitSources({
|
|
22022
|
+
inputs: ctx.inputs,
|
|
22023
|
+
constants: ctx.constants,
|
|
22024
|
+
variables: ctx.variables,
|
|
22025
|
+
screenComputeds: ctx.screenComputeds,
|
|
22026
|
+
properties: ctx.properties,
|
|
22027
|
+
computeds: ctx.computeds,
|
|
22028
|
+
functions: ctx.functions,
|
|
22029
|
+
storePropOf: ctx.storePropOf
|
|
22030
|
+
});
|
|
21866
22031
|
var bindingScope = (ctx, storeProp) => ({
|
|
21867
22032
|
properties: ctx.properties,
|
|
21868
22033
|
shapes: ctx.shapes,
|
|
@@ -26049,7 +26214,8 @@ function generateTs(tree, naming, featureName, variants = {}, methods = {}, oper
|
|
|
26049
26214
|
ctx.controlMap ?? {},
|
|
26050
26215
|
ctx.functions ?? {},
|
|
26051
26216
|
ctx.properties ?? {},
|
|
26052
|
-
`this.${storeProp}
|
|
26217
|
+
`this.${storeProp}`,
|
|
26218
|
+
checkLimitSources(ctx)
|
|
26053
26219
|
);
|
|
26054
26220
|
const checksBody = checks.body;
|
|
26055
26221
|
const tables = sectionTableEmissions(ctx.controlMap ?? {});
|
|
@@ -26063,7 +26229,9 @@ ${tables.map(
|
|
|
26063
26229
|
).join("\n")}
|
|
26064
26230
|
` : "";
|
|
26065
26231
|
const checksReadState = checks.emissions.some(
|
|
26066
|
-
(emission) => emission.statePropertyNames.length > 0
|
|
26232
|
+
(emission) => emission.statePropertyNames.length > 0 || emission.limitReads.some(
|
|
26233
|
+
(read) => read.source === "state" && !read.storeProp
|
|
26234
|
+
)
|
|
26067
26235
|
);
|
|
26068
26236
|
const validationImports = checks.emissions.map(
|
|
26069
26237
|
(emission) => `import { ${emission.memberName} } from '../lib/${validationFileBase(
|
|
@@ -26779,12 +26947,14 @@ function generateCode(tree, featureName, screenName, properties = {}, variants =
|
|
|
26779
26947
|
validationFiles: formValidationFiles(
|
|
26780
26948
|
ctx.controlMap ?? {},
|
|
26781
26949
|
ctx.functions ?? {},
|
|
26782
|
-
properties
|
|
26950
|
+
properties,
|
|
26951
|
+
checkLimitSources(codegenCtx)
|
|
26783
26952
|
),
|
|
26784
26953
|
validationEmissions: formValidationEmissions(
|
|
26785
26954
|
ctx.controlMap ?? {},
|
|
26786
26955
|
ctx.functions ?? {},
|
|
26787
|
-
properties
|
|
26956
|
+
properties,
|
|
26957
|
+
checkLimitSources(codegenCtx)
|
|
26788
26958
|
),
|
|
26789
26959
|
sectionTableFiles: sectionTableFiles(
|
|
26790
26960
|
sectionTableEmissions(ctx.controlMap ?? {}),
|
|
@@ -26961,7 +27131,7 @@ __export(package_exports, {
|
|
|
26961
27131
|
version: () => version
|
|
26962
27132
|
});
|
|
26963
27133
|
var name = "@magmonium/one";
|
|
26964
|
-
var version = "0.4.
|
|
27134
|
+
var version = "0.4.96";
|
|
26965
27135
|
var description = "Magmonium One \u2014 Angular design-system primitives for mm Apps";
|
|
26966
27136
|
var author = "magmonium";
|
|
26967
27137
|
var license = "MIT";
|
|
@@ -27029,7 +27199,7 @@ __export(package_exports2, {
|
|
|
27029
27199
|
version: () => version2
|
|
27030
27200
|
});
|
|
27031
27201
|
var name2 = "@magmonium/cli";
|
|
27032
|
-
var version2 = "0.8.
|
|
27202
|
+
var version2 = "0.8.26";
|
|
27033
27203
|
var description2 = "A powerful and extensible asset compilation tool that can be shared across multiple projects";
|
|
27034
27204
|
var bin = {
|
|
27035
27205
|
"mag-cli": "bin/cli.js"
|
|
@@ -34554,9 +34724,13 @@ var blankLiteral = (dataType, cardinality) => {
|
|
|
34554
34724
|
};
|
|
34555
34725
|
var modelLiteral = (fields, value) => fields.length ? `{ ${fields.map((field) => `${key(field.name)}: ${value(field)}`).join(", ")} }` : "{}";
|
|
34556
34726
|
var validationTest = (path, emission, shapes = {}) => {
|
|
34557
|
-
const { memberName: memberName2, fields, stateChecks, statePropertyNames } = emission;
|
|
34727
|
+
const { memberName: memberName2, fields, stateChecks, statePropertyNames, limitReads } = emission;
|
|
34558
34728
|
const takesState = statePropertyNames.length > 0;
|
|
34559
|
-
const
|
|
34729
|
+
const factoryArgs = [
|
|
34730
|
+
...statePropertyNames.map((name3) => `${key(name3)}: () => holds`),
|
|
34731
|
+
...limitReads.map((read) => `${key(read.name)}: () => undefined`)
|
|
34732
|
+
];
|
|
34733
|
+
const schema = factoryArgs.length ? `${memberName2}({ ${factoryArgs.join(", ")} })` : memberName2;
|
|
34560
34734
|
const runs = takesState ? ["true", "false"] : [""];
|
|
34561
34735
|
const readAll = (model) => runs.map(
|
|
34562
34736
|
(holds) => `expect(Object.keys(errorsOf(${[model, holds].filter(Boolean).join(", ")}))).toEqual(Object.keys(${model}));`
|
|
@@ -35848,6 +36022,8 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
35848
36022
|
bindingPathText,
|
|
35849
36023
|
bindingShapeId,
|
|
35850
36024
|
bindingsNeedTranslate,
|
|
36025
|
+
boundSlotMismatch,
|
|
36026
|
+
boundSlotType,
|
|
35851
36027
|
buildDesignSource,
|
|
35852
36028
|
buildFormShape,
|
|
35853
36029
|
buildOutputOpenValue,
|
|
@@ -36350,6 +36526,7 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
36350
36526
|
isKeyedRepeat,
|
|
36351
36527
|
isKnownVariantId,
|
|
36352
36528
|
isLegalNavTail,
|
|
36529
|
+
isLimitDrawn,
|
|
36353
36530
|
isLinkedFormModel,
|
|
36354
36531
|
isLinkedKeySource,
|
|
36355
36532
|
isLinkedVariable,
|
|
@@ -36466,6 +36643,9 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
36466
36643
|
liftToList,
|
|
36467
36644
|
liftToListInTemplate,
|
|
36468
36645
|
liftsToList,
|
|
36646
|
+
limitSourceFor,
|
|
36647
|
+
limitSourceOf,
|
|
36648
|
+
limitSources,
|
|
36469
36649
|
linkDrift,
|
|
36470
36650
|
linkTargetKind,
|
|
36471
36651
|
linkedVariableReaders,
|