@cosmicdrift/kumiko-framework 0.417.0 → 0.419.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/api/framework-engine.md +1 -0
- package/agents/api/framework-ui-types.md +14 -5
- package/agents/api/renderer-web.md +4 -0
- package/agents/api/types.md +29 -4
- package/agents/api.md +2 -2
- package/agents/boot-rules.md +20 -0
- package/agents/examples/crypto-shredding-hr.md +2 -2
- package/agents/examples/list-table-options.md +275 -7
- package/agents/examples/pdf-letterhead.md +473 -0
- package/agents/examples.md +1 -0
- package/agents/features.md +12 -1
- package/agents/widgets.md +1 -0
- package/dist/api/server-boot-checks.d.ts +1 -0
- package/dist/api/server-boot-checks.js +25 -0
- package/dist/api/server-rate-limit-wiring.js +2 -1
- package/dist/engine/boot-validator/action-form-preview-rules.d.ts +22 -0
- package/dist/engine/boot-validator/action-form-preview-rules.js +22 -0
- package/dist/engine/boot-validator/action-form-preview.d.ts +2 -0
- package/dist/engine/boot-validator/action-form-preview.js +54 -0
- package/dist/engine/boot-validator/boot-rules.d.ts +76 -0
- package/dist/engine/boot-validator/boot-rules.js +2 -0
- package/dist/engine/boot-validator/config-key-rules.d.ts +5 -0
- package/dist/engine/boot-validator/config-key-rules.js +5 -0
- package/dist/engine/boot-validator/date-only-after-days.d.ts +4 -0
- package/dist/engine/boot-validator/date-only-after-days.js +32 -0
- package/dist/engine/boot-validator/entity-handler.d.ts +1 -0
- package/dist/engine/boot-validator/entity-handler.js +1 -1
- package/dist/engine/boot-validator/list-bulk-actions-rules.d.ts +40 -0
- package/dist/engine/boot-validator/list-bulk-actions-rules.js +40 -0
- package/dist/engine/boot-validator/list-bulk-actions.d.ts +2 -1
- package/dist/engine/boot-validator/list-bulk-actions.js +79 -9
- package/dist/engine/boot-validator/query-output-columns.js +25 -2
- package/dist/engine/boot-validator/query-refs.js +3 -0
- package/dist/engine/boot-validator/screens-actions.d.ts +6 -1
- package/dist/engine/boot-validator/screens-actions.js +2 -2
- package/dist/engine/boot-validator/screens-forms.js +2 -0
- package/dist/engine/boot-validator/screens-kind-entity-list.js +2 -2
- package/dist/engine/boot-validator/screens-kind-projection-list.js +1 -1
- package/dist/engine/boot-validator/screens-kind-shared.d.ts +1 -1
- package/dist/engine/boot-validator/screens-kind-shared.js +3 -1
- package/dist/engine/boot-validator/screens-lists-rules.d.ts +10 -0
- package/dist/engine/boot-validator/screens-lists-rules.js +10 -0
- package/dist/engine/boot-validator/screens-lists.js +13 -1
- package/dist/engine/boot-validator/url-prefill-fields.js +8 -1
- package/dist/engine/boot-validator/zod-shape.d.ts +1 -0
- package/dist/engine/boot-validator/zod-shape.js +7 -0
- package/dist/engine/build-config-feature-schema.js +5 -1
- package/dist/engine/registry-ingest.js +11 -0
- package/dist/engine/types/screen.d.ts +1 -1
- package/dist/engine/types/screen.js +1 -1
- package/dist/i18n/required-surface-keys.js +47 -13
- package/dist/ui-types/index.d.ts +1 -1
- package/package.json +3 -3
- package/src/changes.json +36 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { bootRuleError } from "./boot-rule.js";
|
|
2
|
+
import { entityColumnType, validateDateOnlyAfterDays } from "./date-only-after-days.js";
|
|
2
3
|
import { FORM_LAYOUT_RULES } from "./screens-forms-layout-rules.js";
|
|
3
4
|
import { SCREEN_KIND_RULES } from "./screens-kind-rules.js";
|
|
4
5
|
import { qualifyEntityName } from "../qualified-name.js";
|
|
@@ -66,9 +67,10 @@ export function rejectEmptyColumns(featureName, screenId, kind, columnCount) {
|
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
|
-
export function validateListColumnRendering(ctx, screenId, kind, column) {
|
|
70
|
+
export function validateListColumnRendering(ctx, screenId, kind, column, entity) {
|
|
70
71
|
const featureName = ctx.feature.name;
|
|
71
72
|
validateColumnRendererForm(featureName, screenId, column);
|
|
73
|
+
validateDateOnlyAfterDays(`[Feature ${featureName}] Screen "${screenId}" (${kind})`, column, entity === undefined ? undefined : entityColumnType(entity, column.field));
|
|
72
74
|
rejectInertColumnSortable(featureName, screenId, kind, column);
|
|
73
75
|
if (column.refEntity !== undefined) {
|
|
74
76
|
assertRefTargetRegistered(`[Feature ${featureName}] Screen "${screenId}" (${kind})`, `column "${column.field}" (refEntity)`, column.refEntity, featureName, ctx.featureMap);
|
|
@@ -29,6 +29,16 @@ export declare const LIST_SCREEN_RULES: {
|
|
|
29
29
|
readonly summary: "relatedList toolbarActions use visible instead of visibleWhen.";
|
|
30
30
|
readonly fix: "Use visible, a condition on the enclosing record.";
|
|
31
31
|
};
|
|
32
|
+
readonly dateOnlyAfterDaysInvalid: {
|
|
33
|
+
readonly id: "list/date-only-after-days-invalid";
|
|
34
|
+
readonly summary: "A column's dateOnlyAfterDays is a non-negative whole number of days.";
|
|
35
|
+
readonly fix: "Set dateOnlyAfterDays to 0 or a positive integer.";
|
|
36
|
+
};
|
|
37
|
+
readonly dateOnlyAfterDaysWrongType: {
|
|
38
|
+
readonly id: "list/date-only-after-days-wrong-type";
|
|
39
|
+
readonly summary: "dateOnlyAfterDays sits on a timestamp, locatedTimestamp or date column or a relativeTime column.";
|
|
40
|
+
readonly fix: "Remove dateOnlyAfterDays from the column or point it at a timestamp, locatedTimestamp or date field.";
|
|
41
|
+
};
|
|
32
42
|
readonly columnSortableInert: {
|
|
33
43
|
readonly id: "list/column-sortable-inert";
|
|
34
44
|
readonly summary: "A column only sets sortable where the screen type honors it.";
|
|
@@ -29,6 +29,16 @@ export const LIST_SCREEN_RULES = {
|
|
|
29
29
|
summary: "relatedList toolbarActions use visible instead of visibleWhen.",
|
|
30
30
|
fix: "Use visible, a condition on the enclosing record.",
|
|
31
31
|
},
|
|
32
|
+
dateOnlyAfterDaysInvalid: {
|
|
33
|
+
id: "list/date-only-after-days-invalid",
|
|
34
|
+
summary: "A column's dateOnlyAfterDays is a non-negative whole number of days.",
|
|
35
|
+
fix: "Set dateOnlyAfterDays to 0 or a positive integer.",
|
|
36
|
+
},
|
|
37
|
+
dateOnlyAfterDaysWrongType: {
|
|
38
|
+
id: "list/date-only-after-days-wrong-type",
|
|
39
|
+
summary: "dateOnlyAfterDays sits on a timestamp, locatedTimestamp or date column or a relativeTime column.",
|
|
40
|
+
fix: "Remove dateOnlyAfterDays from the column or point it at a timestamp, locatedTimestamp or date field.",
|
|
41
|
+
},
|
|
32
42
|
columnSortableInert: {
|
|
33
43
|
id: "list/column-sortable-inert",
|
|
34
44
|
summary: "A column only sets sortable where the screen type honors it.",
|
|
@@ -5,6 +5,7 @@ import { parseRefTarget } from "../parse-ref-target.js";
|
|
|
5
5
|
import { qualifyEntityName } from "../qualified-name.js";
|
|
6
6
|
import { explicitListScreenId, normalizeListColumn, resolveNavParentScreen, screenShortId, } from "../screen-helpers.js";
|
|
7
7
|
import { bootRuleError } from "./boot-rule.js";
|
|
8
|
+
import { entityColumnType, validateDateOnlyAfterDays } from "./date-only-after-days.js";
|
|
8
9
|
import { ENTITY_LIST_RULES } from "./entity-list-screens-rules.js";
|
|
9
10
|
import { validateListBulkActions } from "./list-bulk-actions.js";
|
|
10
11
|
import { validateListRowGuidance, validatePhotoGrid } from "./list-row-guidance.js";
|
|
@@ -99,7 +100,7 @@ function validateRelatedListTableAndBulk(args) {
|
|
|
99
100
|
validateListTableOptions(`[Feature ${featureName}] ${where}`, section.table, section.columns);
|
|
100
101
|
if (section.rowActions !== undefined)
|
|
101
102
|
validateRelatedListRowActions(args, section.rowActions);
|
|
102
|
-
validateListBulkActions(`[Feature ${featureName}] ${where}`, section.bulkActions, section.rowActions);
|
|
103
|
+
validateListBulkActions(`[Feature ${featureName}] ${where}`, section.bulkActions, section.rowActions, featureName, args);
|
|
103
104
|
}
|
|
104
105
|
function assertReadOnlyHasNoRowInteraction(args) {
|
|
105
106
|
const { section } = args;
|
|
@@ -110,6 +111,13 @@ function assertReadOnlyHasNoRowInteraction(args) {
|
|
|
110
111
|
});
|
|
111
112
|
}
|
|
112
113
|
}
|
|
114
|
+
function resolveSectionEntity(args) {
|
|
115
|
+
const { section, featureName, featureMap } = args;
|
|
116
|
+
if (section.entity === undefined)
|
|
117
|
+
return undefined;
|
|
118
|
+
const target = parseRefTarget(section.entity, featureName);
|
|
119
|
+
return featureMap.get(target.featureName)?.entities?.[target.entityName];
|
|
120
|
+
}
|
|
113
121
|
export function validateRelatedListSection(args) {
|
|
114
122
|
const { featureName, featureMap, where, section } = args;
|
|
115
123
|
if (!section.query || typeof section.query !== "string") {
|
|
@@ -122,10 +130,14 @@ export function validateRelatedListSection(args) {
|
|
|
122
130
|
assertRefTargetRegistered(`[Feature ${featureName}] ${where}`, "entity", section.entity, featureName, featureMap);
|
|
123
131
|
}
|
|
124
132
|
validateListRowGuidance(featureName, args.screenId, "relatedList", section, undefined, where);
|
|
133
|
+
const sectionEntity = resolveSectionEntity(args);
|
|
125
134
|
for (const col of section.columns) {
|
|
126
135
|
const normalizedCol = normalizeListColumn(col);
|
|
127
136
|
validateColumnRendererForm(featureName, args.screenId, normalizedCol);
|
|
128
137
|
validateEnumOptionTones(`[Feature ${featureName}] ${where}`, normalizedCol);
|
|
138
|
+
validateDateOnlyAfterDays(`[Feature ${featureName}] ${where}`, normalizedCol, sectionEntity === undefined
|
|
139
|
+
? undefined
|
|
140
|
+
: entityColumnType(sectionEntity, normalizedCol.field));
|
|
129
141
|
if (normalizedCol.refEntity !== undefined) {
|
|
130
142
|
assertRefTargetRegistered(`[Feature ${featureName}] ${where}`, `column "${normalizedCol.field}" (refEntity)`, normalizedCol.refEntity, featureName, featureMap);
|
|
131
143
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { qualifyEntityName } from "../qualified-name.js";
|
|
1
|
+
import { isValidQn, parseQn, qualifyEntityName } from "../qualified-name.js";
|
|
2
2
|
import { isFieldsEditSection, normalizeEditField, sectionFieldSpecs } from "../screen-helpers.js";
|
|
3
3
|
import { bootRuleError } from "./boot-rule.js";
|
|
4
4
|
import { collectScreensByShortId, readsNavigateParamsAsFormPrefill, rowFieldExtractorKeys, validateDrawerPrefillKeys, } from "./screens.js";
|
|
@@ -131,6 +131,13 @@ function resolveTarget(source, screensByShortId, detailForByEntity) {
|
|
|
131
131
|
return detailForByEntity.get(source.entity);
|
|
132
132
|
if (source.screen === undefined)
|
|
133
133
|
return undefined;
|
|
134
|
+
if (isValidQn(source.screen)) {
|
|
135
|
+
const { scope, type, name } = parseQn(source.screen);
|
|
136
|
+
if (type !== "screen")
|
|
137
|
+
return undefined;
|
|
138
|
+
const match = screensByShortId.get(name)?.find((entry) => entry.featureName === scope);
|
|
139
|
+
return match === undefined ? undefined : { ...match, shortId: name };
|
|
140
|
+
}
|
|
134
141
|
const match = screensByShortId.get(source.screen)?.[0];
|
|
135
142
|
return match === undefined ? undefined : { ...match, shortId: source.screen };
|
|
136
143
|
}
|
|
@@ -4,3 +4,4 @@ export declare function getZodStringLiterals(schema: ZodType | undefined): reado
|
|
|
4
4
|
export declare function getZodObjectShape(schema: ZodType | undefined): Record<string, ZodType> | undefined;
|
|
5
5
|
export declare function getZodRowShape(schema: ZodType | undefined): Record<string, ZodType> | undefined;
|
|
6
6
|
export declare function collectZodObjectKeys(schema: $ZodType | undefined): ReadonlySet<string>;
|
|
7
|
+
export declare function getZodArrayFieldElementShape(schema: ZodType | undefined, field: string): Record<string, ZodType> | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
1
2
|
import { ZodArray, ZodCatch, ZodDefault, ZodEnum, ZodIntersection, ZodLazy, ZodLiteral, ZodMap, ZodNever, ZodNonOptional, ZodNullable, ZodObject, ZodOptional, ZodPipe, ZodPrefault, ZodPromise, ZodReadonly, ZodRecord, ZodSet, ZodTuple, ZodType, ZodUnion, ZodXor, } from "zod";
|
|
2
3
|
import { bootRuleError } from "./boot-rule.js";
|
|
3
4
|
import { HANDLER_FIELD_REFERENCE_RULES } from "./handler-field-references-rules.js";
|
|
@@ -145,3 +146,9 @@ export function collectZodObjectKeys(schema) {
|
|
|
145
146
|
}
|
|
146
147
|
return keys;
|
|
147
148
|
}
|
|
149
|
+
// The element shape of an array field of an object schema, e.g. `tasks` in `{ count, tasks: T[] }`.
|
|
150
|
+
// Reuses the `{ rows: T[] }` walk instead of reading `.element` (core-vs-wrapper type gap).
|
|
151
|
+
export function getZodArrayFieldElementShape(schema, field) {
|
|
152
|
+
const arrayField = getZodObjectShape(schema)?.[field];
|
|
153
|
+
return arrayField === undefined ? undefined : getZodRowShape(z.object({ rows: arrayField }));
|
|
154
|
+
}
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
// refs (buildNavRegistrySliceForApp qualifies them itself).
|
|
17
17
|
import { isOptionsQueryFieldRef } from "@cosmicdrift/kumiko-types/fields";
|
|
18
18
|
import { CONFIG_EDIT_ENTITY, fieldLabelKey } from "../i18n/required-surface-keys.js";
|
|
19
|
+
import { bootRuleError } from "./boot-validator/boot-rule.js";
|
|
20
|
+
import { CONFIG_KEY_RULES } from "./boot-validator/config-key-rules.js";
|
|
19
21
|
import { rolesToAccess, unionAccessRules } from "./config-access-rules.js";
|
|
20
22
|
import { isEncryptedAtRest } from "./config-helpers.js";
|
|
21
23
|
import { EXTENSION_SELECTOR_HINT_KEY, isSelectableInSettings, settingsSelectablePluginIds, } from "./extension-selector-plugins.js";
|
|
@@ -833,7 +835,9 @@ function collectMaskedKeys(registry) {
|
|
|
833
835
|
throw new Error(`[Feature ${ownerFeature}] config key "${qn.slice(sep + ":config:".length)}" has invalid group "${def.group}" — must be kebab-case.`);
|
|
834
836
|
}
|
|
835
837
|
if (def.mask?.readOnly === true && def.required === true) {
|
|
836
|
-
throw
|
|
838
|
+
throw bootRuleError(CONFIG_KEY_RULES.maskReadOnlyRequired, {
|
|
839
|
+
message: `[Feature ${ownerFeature}] config key "${qn.slice(sep + ":config:".length)}" is mask.readOnly and required — nobody could fill it.`,
|
|
840
|
+
});
|
|
837
841
|
}
|
|
838
842
|
// computed keys derive their value — there is no row to set, so a
|
|
839
843
|
// configEdit screen could not write them. Skip even when masked.
|
|
@@ -103,6 +103,17 @@ const RESERVED_TEMPLATE_VARIABLE_NAMES = new Set([
|
|
|
103
103
|
"signature",
|
|
104
104
|
"imprint",
|
|
105
105
|
"unsubscribeUrl",
|
|
106
|
+
// Mirrors COMPANY_PLACEHOLDERS: the renderer fills them from the tenant's company data.
|
|
107
|
+
"companyAddress",
|
|
108
|
+
"companyPhone",
|
|
109
|
+
"companyEmail",
|
|
110
|
+
"companyWebsite",
|
|
111
|
+
"companyRegister",
|
|
112
|
+
"companyVatId",
|
|
113
|
+
"companyManagement",
|
|
114
|
+
"companyBank",
|
|
115
|
+
"companyIban",
|
|
116
|
+
"companyBic",
|
|
106
117
|
// Handlebars helpers of the mail renderer win over context values of the
|
|
107
118
|
// same name, so a variable called like a helper would never render.
|
|
108
119
|
"link",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type * from "@cosmicdrift/kumiko-types/screen";
|
|
2
|
-
export { DEFAULT_EXPORT_MAX_ROWS, LIST_BULK_ACTION_KEYS, LIST_COLUMN_PINS, LIST_TABLE_DENSITIES, LIST_TABLE_DENSITY_KEYS, LIST_TABLE_EXPORT_KEYS, LIST_TABLE_FRAMES, LIST_TABLE_GROUPING_KEYS, LIST_TABLE_OPTION_KEYS, LIST_TABLE_SUMMARY_ROW_KEYS, LIST_TABLE_TOTAL_KEYS, MAX_BULK_SELECTION, MAX_EXPORT_MAX_ROWS, relatedListGroupHeaderLabel, relatedListGroupKey, } from "@cosmicdrift/kumiko-types/screen";
|
|
2
|
+
export { DEFAULT_EXPORT_MAX_ROWS, LIST_BULK_ACTION_KEYS, LIST_BULK_FORM_ACTION_KEYS, LIST_COLUMN_PINS, LIST_TABLE_DENSITIES, LIST_TABLE_DENSITY_KEYS, LIST_TABLE_EXPORT_KEYS, LIST_TABLE_FRAMES, LIST_TABLE_GROUPING_KEYS, LIST_TABLE_OPTION_KEYS, LIST_TABLE_SUMMARY_ROW_KEYS, LIST_TABLE_TOTAL_KEYS, MAX_BULK_SELECTION, MAX_EXPORT_MAX_ROWS, relatedListGroupHeaderLabel, relatedListGroupKey, } from "@cosmicdrift/kumiko-types/screen";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DEFAULT_EXPORT_MAX_ROWS, LIST_BULK_ACTION_KEYS, LIST_COLUMN_PINS, LIST_TABLE_DENSITIES, LIST_TABLE_DENSITY_KEYS, LIST_TABLE_EXPORT_KEYS, LIST_TABLE_FRAMES, LIST_TABLE_GROUPING_KEYS, LIST_TABLE_OPTION_KEYS, LIST_TABLE_SUMMARY_ROW_KEYS, LIST_TABLE_TOTAL_KEYS, MAX_BULK_SELECTION, MAX_EXPORT_MAX_ROWS, relatedListGroupHeaderLabel, relatedListGroupKey, } from "@cosmicdrift/kumiko-types/screen";
|
|
1
|
+
export { DEFAULT_EXPORT_MAX_ROWS, LIST_BULK_ACTION_KEYS, LIST_BULK_FORM_ACTION_KEYS, LIST_COLUMN_PINS, LIST_TABLE_DENSITIES, LIST_TABLE_DENSITY_KEYS, LIST_TABLE_EXPORT_KEYS, LIST_TABLE_FRAMES, LIST_TABLE_GROUPING_KEYS, LIST_TABLE_OPTION_KEYS, LIST_TABLE_SUMMARY_ROW_KEYS, LIST_TABLE_TOTAL_KEYS, MAX_BULK_SELECTION, MAX_EXPORT_MAX_ROWS, relatedListGroupHeaderLabel, relatedListGroupKey, } from "@cosmicdrift/kumiko-types/screen";
|
|
@@ -58,6 +58,12 @@ function pushKey(out, value, treatAsKey = false) {
|
|
|
58
58
|
if (value !== undefined && (treatAsKey || isI18nKey(value)))
|
|
59
59
|
out.add(value);
|
|
60
60
|
}
|
|
61
|
+
function pushBulkActionKeys(out, bulk) {
|
|
62
|
+
if ("screen" in bulk)
|
|
63
|
+
pushKey(out, bulk.label);
|
|
64
|
+
else
|
|
65
|
+
pushKey(out, bulk.confirm);
|
|
66
|
+
}
|
|
61
67
|
function editFieldName(f) {
|
|
62
68
|
return typeof f === "string" ? f : f.field;
|
|
63
69
|
}
|
|
@@ -279,7 +285,7 @@ function pushListChromeKeys(out, list) {
|
|
|
279
285
|
for (const action of list.toolbarActions ?? [])
|
|
280
286
|
pushToolbarActionKeys(out, action);
|
|
281
287
|
for (const bulk of list.bulkActions ?? [])
|
|
282
|
-
|
|
288
|
+
pushBulkActionKeys(out, bulk);
|
|
283
289
|
}
|
|
284
290
|
function collectEntityListKeys(ctx, list) {
|
|
285
291
|
for (const col of list.columns) {
|
|
@@ -325,6 +331,13 @@ function collectEntityEditKeys(ctx, edit) {
|
|
|
325
331
|
pushKey(ctx.out, edit.titleTemplate);
|
|
326
332
|
pushEditLayoutSectionKeys(ctx, edit.layout.sections, edit.entity, edit.fieldLabels);
|
|
327
333
|
}
|
|
334
|
+
function pushPreviewKeys(ctx, preview) {
|
|
335
|
+
pushKey(ctx.out, preview?.title);
|
|
336
|
+
for (const fact of preview?.facts ?? [])
|
|
337
|
+
pushKey(ctx.out, fact.label);
|
|
338
|
+
for (const column of preview?.list?.columns ?? [])
|
|
339
|
+
pushKey(ctx.out, column.label);
|
|
340
|
+
}
|
|
328
341
|
function collectActionFormKeys(ctx, form) {
|
|
329
342
|
pushKey(ctx.out, form.submitLabel);
|
|
330
343
|
pushKey(ctx.out, form.summary?.title);
|
|
@@ -341,6 +354,7 @@ function collectActionFormKeys(ctx, form) {
|
|
|
341
354
|
pushKey(ctx.out, link.label);
|
|
342
355
|
for (const fact of form.successFacts ?? [])
|
|
343
356
|
pushKey(ctx.out, fact.label);
|
|
357
|
+
pushPreviewKeys(ctx, form.preview);
|
|
344
358
|
pushKey(ctx.out, form.successItems?.link?.label);
|
|
345
359
|
for (const fieldName of Object.keys(form.fields)) {
|
|
346
360
|
pushFieldLabelOrOverrideKey(ctx, ACTION_FORM_ENTITY, fieldName, form.fieldLabels);
|
|
@@ -430,7 +444,7 @@ function collectProjectionDetailKeys(ctx, detail) {
|
|
|
430
444
|
if (section.kind === "relatedList") {
|
|
431
445
|
pushRelatedListSectionKeys(ctx.out, section);
|
|
432
446
|
for (const bulk of section.bulkActions ?? [])
|
|
433
|
-
|
|
447
|
+
pushBulkActionKeys(ctx.out, bulk);
|
|
434
448
|
continue;
|
|
435
449
|
}
|
|
436
450
|
if (section.kind === "stepList") {
|
|
@@ -593,6 +607,7 @@ export function findTranslationLocaleGaps(features) {
|
|
|
593
607
|
return gaps;
|
|
594
608
|
}
|
|
595
609
|
const LOCALE_PACKAGE_PREFIX = "locale-";
|
|
610
|
+
const PLURAL_FORM_NAMES = ["zero", "one", "two", "few", "many", "other"];
|
|
596
611
|
function collectLocalesByName(features) {
|
|
597
612
|
// A plain key of a regular feature is only its own; registering it raw would let two
|
|
598
613
|
// features with the same plain key cover each other's missing locales.
|
|
@@ -600,20 +615,42 @@ function collectLocalesByName(features) {
|
|
|
600
615
|
? [`${featureName}:${key}`, key]
|
|
601
616
|
: [`${featureName}:${key}`];
|
|
602
617
|
const localesByName = new Map();
|
|
618
|
+
const blankLocalesByName = new Map();
|
|
619
|
+
const addAll = (target, name, locales) => {
|
|
620
|
+
const set = target.get(name) ?? new Set();
|
|
621
|
+
for (const locale of locales)
|
|
622
|
+
set.add(locale);
|
|
623
|
+
target.set(name, set);
|
|
624
|
+
};
|
|
603
625
|
for (const feature of features) {
|
|
604
626
|
for (const [key, byLocale] of Object.entries(feature.translations ?? {})) {
|
|
605
|
-
const
|
|
627
|
+
const entries = Object.entries(byLocale);
|
|
628
|
+
const present = entries
|
|
606
629
|
.filter(([, value]) => hasLocaleValue(value))
|
|
607
630
|
.map(([locale]) => locale);
|
|
631
|
+
const blank = entries.filter(([, value]) => !hasLocaleValue(value)).map(([locale]) => locale);
|
|
608
632
|
for (const name of namesOf(feature.name, key)) {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
633
|
+
addAll(localesByName, name, present);
|
|
634
|
+
addAll(blankLocalesByName, name, blank);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
return { localesByName, blankLocalesByName };
|
|
639
|
+
}
|
|
640
|
+
function presentLocalesForKey(effective, key, localesByName, blankLocalesByName) {
|
|
641
|
+
// Locale packages spell plurals as flat `.one`/`.other` keys; `other` is the form every locale has.
|
|
642
|
+
const present = new Set([effective, key, `${effective}.other`, `${key}.other`].flatMap((name) => [
|
|
643
|
+
...(localesByName.get(name) ?? []),
|
|
644
|
+
]));
|
|
645
|
+
// A blank flat form (`.one`) leaves the plural incomplete even when `.other` is filled.
|
|
646
|
+
for (const name of [effective, key]) {
|
|
647
|
+
for (const form of PLURAL_FORM_NAMES) {
|
|
648
|
+
for (const locale of blankLocalesByName.get(`${name}.${form}`) ?? []) {
|
|
649
|
+
present.delete(locale);
|
|
613
650
|
}
|
|
614
651
|
}
|
|
615
652
|
}
|
|
616
|
-
return
|
|
653
|
+
return present;
|
|
617
654
|
}
|
|
618
655
|
/**
|
|
619
656
|
* Per translation key, the union of locales over ALL features must cover
|
|
@@ -627,7 +664,7 @@ function collectLocalesByName(features) {
|
|
|
627
664
|
*/
|
|
628
665
|
export function findRequiredLocaleGaps(features, requiredLocales) {
|
|
629
666
|
const featureNames = new Set(features.map((feature) => feature.name));
|
|
630
|
-
const localesByName = collectLocalesByName(features);
|
|
667
|
+
const { localesByName, blankLocalesByName } = collectLocalesByName(features);
|
|
631
668
|
const gaps = [];
|
|
632
669
|
const reported = new Set();
|
|
633
670
|
for (const feature of features) {
|
|
@@ -641,10 +678,7 @@ export function findRequiredLocaleGaps(features, requiredLocales) {
|
|
|
641
678
|
const effective = key.includes(":") ? key : `${feature.name}:${key}`;
|
|
642
679
|
if (reported.has(effective))
|
|
643
680
|
continue;
|
|
644
|
-
|
|
645
|
-
const present = new Set([effective, key, `${effective}.other`, `${key}.other`].flatMap((name) => [
|
|
646
|
-
...(localesByName.get(name) ?? []),
|
|
647
|
-
]));
|
|
681
|
+
const present = presentLocalesForKey(effective, key, localesByName, blankLocalesByName);
|
|
648
682
|
const missingLocales = requiredLocales.filter((locale) => !present.has(locale));
|
|
649
683
|
if (missingLocales.length > 0) {
|
|
650
684
|
reported.add(effective);
|
package/dist/ui-types/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type { EmbeddedDerivedCellDef, EntityDefinition, FieldDefinition, Options
|
|
|
11
11
|
export type { AccessRule } from "../engine/types/handlers.ts";
|
|
12
12
|
export { isOpenToAllGranted, isUiAccessGranted } from "../engine/types/handlers.ts";
|
|
13
13
|
export type { IconKey, NavDefinition, NavIconKey } from "../engine/types/nav.ts";
|
|
14
|
-
export type { ActionFormFooterAction, ActionFormLoad, ActionFormRedirect, ActionFormScreenDefinition, ActionFormSuccessFact, ActionFormSuccessItems, ActionFormSuccessLink, ConfigEditAction, ConfigEditScreenDefinition, CustomScreenDefinition, DashboardChartMarkerKind, DashboardChartPanel, DashboardCurrencyFormat, DashboardCustomPanel, DashboardDateParam, DashboardFeedPanel, DashboardFilterDefinition, DashboardI18nText, DashboardLayout, DashboardListFooterLink, DashboardListNarrow, DashboardListPanel, DashboardListRowToneMarker, DashboardMoneyParam, DashboardPanelColumn, DashboardPanelDefinition, DashboardPanelEmptyState, DashboardPanelNarrow, DashboardPanelQueryOptions, DashboardPanelSpan, DashboardPanelVisibility, DashboardProgressListPanel, DashboardProgressTone, DashboardRefresh, DashboardRelativeTimeParam, DashboardScopeDefinition, DashboardScreenDefinition, DashboardScreenPanel, DashboardStatGroupLayout, DashboardStatGroupLink, DashboardStatGroupNarrow, DashboardStatGroupPanel, DashboardStatPanel, DashboardText, DashboardTextBlock, DashboardTextPanel, DashboardTextParam, DashboardTimeRangeDefinition, EditExtensionSection, EditFieldSpec, EditFieldsSection, EditLayout, EditRelatedListSection, EditSectionSpec, EditStepListSection, EditWriteFormSection, EmbeddedListEditSpec, EntityEditAction, EntityEditScreenDefinition, EntityListFacetConfig, EntityListScreenDefinition, FieldAffix, FieldAiAssist, FieldAiAssistChip, FieldBadge, FieldCondition, FieldFillAction, FieldIconKey, FieldRenderer, FieldTextRef, FieldValueChips, FormWidth, ListBulkAction, ListColumnHint, ListColumnSpec, ListEmptyStateSpec, ListFacetSpec, ListRowDecoration, ListSortOption, ListSortSpec, ListTableOptions, ListTableSummaryRow, ListToolbarActionsPlacement, MetricNavigate, PlatformComponent, ProjectionDetailInitialTab, ProjectionDetailScreenDefinition, ProjectionListScreenDefinition, RecordBannerSpec, RecordBreadcrumbItem, RecordBreadcrumbSpec, RecordHeaderSubtitlePart, RecordNotice, RecordProgress, RecordProgressSpec, RecordProgressStep, RecordStep, RecordStepsSpec, RecordSummarySpec, RelatedListEmptyStateSpec, RelatedListEmptyStateVariant, RelatedListRowTone, RelatedListToolbarAction, RowAction, RowActionClientAction, RowActionDisplay, RowActionDrawer, RowActionMode, RowActionNavigate, RowActionWriteHandler, RowFieldExtractor, ScreenDefinition, ScreenFallback, ScreenFallbackByReason, ScreenFallbackReason, ScreenSlots, ScreenVisibility, SecretMintConfirmStep, SecretMintScreenDefinition, SecretsEditScreenDefinition, StepListItem, ToolbarAction, } from "../engine/types/screen.ts";
|
|
14
|
+
export type { ActionFormFooterAction, ActionFormLoad, ActionFormPreview, ActionFormPreviewList, ActionFormRedirect, ActionFormScreenDefinition, ActionFormSuccessFact, ActionFormSuccessItems, ActionFormSuccessLink, ActionFormValueType, ConfigEditAction, ConfigEditScreenDefinition, CustomScreenDefinition, DashboardChartMarkerKind, DashboardChartPanel, DashboardCurrencyFormat, DashboardCustomPanel, DashboardDateParam, DashboardFeedPanel, DashboardFilterDefinition, DashboardI18nText, DashboardLayout, DashboardListFooterLink, DashboardListNarrow, DashboardListPanel, DashboardListRowToneMarker, DashboardMoneyParam, DashboardPanelColumn, DashboardPanelDefinition, DashboardPanelEmptyState, DashboardPanelNarrow, DashboardPanelQueryOptions, DashboardPanelSpan, DashboardPanelVisibility, DashboardProgressListPanel, DashboardProgressTone, DashboardRefresh, DashboardRelativeTimeParam, DashboardScopeDefinition, DashboardScreenDefinition, DashboardScreenPanel, DashboardStatGroupLayout, DashboardStatGroupLink, DashboardStatGroupNarrow, DashboardStatGroupPanel, DashboardStatPanel, DashboardText, DashboardTextBlock, DashboardTextPanel, DashboardTextParam, DashboardTimeRangeDefinition, EditExtensionSection, EditFieldSpec, EditFieldsSection, EditLayout, EditRelatedListSection, EditSectionSpec, EditStepListSection, EditWriteFormSection, EmbeddedListEditSpec, EntityEditAction, EntityEditScreenDefinition, EntityListFacetConfig, EntityListScreenDefinition, FieldAffix, FieldAiAssist, FieldAiAssistChip, FieldBadge, FieldCondition, FieldFillAction, FieldIconKey, FieldRenderer, FieldTextRef, FieldValueChips, FormWidth, ListBulkAction, ListColumnHint, ListColumnSpec, ListEmptyStateSpec, ListFacetSpec, ListRowDecoration, ListSortOption, ListSortSpec, ListTableOptions, ListTableSummaryRow, ListToolbarActionsPlacement, MetricNavigate, PlatformComponent, ProjectionDetailInitialTab, ProjectionDetailScreenDefinition, ProjectionListScreenDefinition, RecordBannerSpec, RecordBreadcrumbItem, RecordBreadcrumbSpec, RecordHeaderSubtitlePart, RecordNotice, RecordProgress, RecordProgressSpec, RecordProgressStep, RecordStep, RecordStepsSpec, RecordSummarySpec, RelatedListEmptyStateSpec, RelatedListEmptyStateVariant, RelatedListRowTone, RelatedListToolbarAction, RowAction, RowActionClientAction, RowActionDisplay, RowActionDrawer, RowActionMode, RowActionNavigate, RowActionWriteHandler, RowFieldExtractor, ScreenDefinition, ScreenFallback, ScreenFallbackByReason, ScreenFallbackReason, ScreenSlots, ScreenVisibility, SecretMintConfirmStep, SecretMintScreenDefinition, SecretsEditScreenDefinition, StepListItem, ToolbarAction, } from "../engine/types/screen.ts";
|
|
15
15
|
export { MAX_BULK_SELECTION } from "../engine/types/screen.ts";
|
|
16
16
|
export type { TargetRef } from "../engine/types/target-ref.ts";
|
|
17
17
|
export type { TreeAction } from "../engine/types/tree-node.ts";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.419.0",
|
|
4
4
|
"description": "Framework core — engine, pipeline, API, DB, and every other bit that makes Kumiko go.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
"./package.json": "./package.json"
|
|
205
205
|
},
|
|
206
206
|
"dependencies": {
|
|
207
|
-
"@cosmicdrift/kumiko-types": "0.
|
|
207
|
+
"@cosmicdrift/kumiko-types": "0.419.0",
|
|
208
208
|
"bullmq": "^5.81.5",
|
|
209
209
|
"hono": "^4.13.14",
|
|
210
210
|
"i18next": "^26.5.12",
|
|
@@ -226,7 +226,7 @@
|
|
|
226
226
|
}
|
|
227
227
|
},
|
|
228
228
|
"devDependencies": {
|
|
229
|
-
"@cosmicdrift/kumiko-testing": "0.
|
|
229
|
+
"@cosmicdrift/kumiko-testing": "0.419.0",
|
|
230
230
|
"bun-types": "^1.4.4",
|
|
231
231
|
"fflate": "^0.8.3",
|
|
232
232
|
"meilisearch": "^0.62.0",
|
package/src/changes.json
CHANGED
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.419.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "Modal size, labelled action menu and menu item descriptions",
|
|
6
|
+
"detail": "`Modal` takes `size: \"wide\"` for content with lists beside actions. The action menu accepts `triggerLabel` for a labelled button instead of the three-dots icon, and a `MenuItemDef` can carry a `description` line and its own `testId`."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.418.0",
|
|
10
|
+
"type": "improvement",
|
|
11
|
+
"title": "Bulk action opens an actionForm with all selected ids",
|
|
12
|
+
"detail": "A list `bulkActions` entry `{ id, label, icon?, screen, idsField }` opens the actionForm `screen` once for the checkbox selection. The selected ids arrive as a `string[]` in `idsField`, so the form's handler runs once for all rows. `idsField` must be a `multiSelect` with the new `display: \"count\"`, which shows \"n selected\" read-only. The ids travel in memory, so only the 100-row selection cap applies. The `rowAction` form is unchanged. The boot validator checks label, screen, actionForm type, field and layout (rules `list-bulk/form-*`)."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"version": "0.418.0",
|
|
16
|
+
"type": "improvement",
|
|
17
|
+
"title": "actionForm preview from a query over the form values",
|
|
18
|
+
"detail": "An actionForm `preview` `{ query, fields?, title?, facts?, list? }` shows a panel above the submit button. The query runs over the current form values 300 ms after the last change, not while a required sent field is empty; empty optional fields stay out of the query payload, an untouched money field that holds only its currency included. Its result renders as facts and a table. A failing query shows a hint and never blocks the submit. The boot validator checks the query, the sent fields and the labels (rules `action-form-preview/*`). A form bulk action's write handler must bound the id list with `.max(MAX_BULK_SELECTION)` and check every id itself. Facts (also the success box ones) and list columns take an optional `type` (`number`, `money`, `date`, `timestamp`); a money value is `{ amount, currency }` in major units."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"version": "0.418.0",
|
|
22
|
+
"type": "fix",
|
|
23
|
+
"title": "Boot validator checks dateOnlyAfterDays on list columns",
|
|
24
|
+
"detail": "A column's `dateOnlyAfterDays` must be a non-negative whole number on every list kind. On an entityList column it requires a timestamp, locatedTimestamp or date field or a `relativeTime` format; on a projectionList or relatedList column a numeric `valueType` (number, decimal, bigInt, money) is rejected, and a relatedList column with an entity is checked against that entity's field type. Number columns that showed 42 as 1 January 1970 now fail at boot (rules `list/date-only-after-days-invalid` and `list/date-only-after-days-wrong-type`)."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"version": "0.418.0",
|
|
28
|
+
"type": "fix",
|
|
29
|
+
"title": "Boot warns on tenant or user rate limits without a RateLimitResolver",
|
|
30
|
+
"detail": "A handler `rateLimit` with a `tenant` or `user` bucket needs a `RateLimitResolver`. Without one the server still boots but logs a warning naming the handlers, which answer every call with a 500. Wire a Redis client on `context.redis` or pass `context.rateLimit`."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"version": "0.418.0",
|
|
34
|
+
"type": "fix",
|
|
35
|
+
"title": "URL prefill and the hidden-required boot rule follow navigate targets given as a QN",
|
|
36
|
+
"detail": "`urlPrefillFields` and the boot rule `submit-prefilled-hidden-required` resolved a navigate `screen` only by its short id, so a target written as `<feature>:screen:<id>` was skipped silently. Its `params` keys now prefill the target form and seed its hidden required fields like a short-id target does."
|
|
37
|
+
},
|
|
2
38
|
{
|
|
3
39
|
"version": "0.417.0",
|
|
4
40
|
"type": "improvement",
|