@cosmicdrift/kumiko-framework 0.422.0 → 0.424.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/renderer-web.md +2 -1
- package/agents/api/types.md +8 -0
- package/agents/boot-rules.md +2 -1
- package/agents/features-index.md +2 -0
- package/agents/features.md +8 -0
- package/dist/auth/roles.d.ts +0 -1
- package/dist/auth/roles.js +0 -3
- package/dist/engine/boot-validator/boot-rules.d.ts +1 -1
- package/dist/engine/boot-validator/screens-actions-rules.d.ts +1 -1
- package/dist/engine/boot-validator/screens-actions-rules.js +1 -1
- package/dist/engine/boot-validator/screens-actions.js +2 -1
- package/dist/engine/boot-validator/url-prefill-fields.js +2 -0
- package/dist/engine/role-assignment.js +3 -3
- package/package.json +3 -3
- package/src/changes.json +19 -0
|
@@ -36,7 +36,7 @@ function DropdownMenuSeparator(props: ComponentPropsWithoutRef<typeof Primitive.
|
|
|
36
36
|
function EditorBody(props: { left?: ReactNode; center: ReactNode; right: ReactNode; testId?: string; }): ReactNode;
|
|
37
37
|
function EditorFooter(props: { testIdPrefix: string; actionTestIds?: EditorActionTestIds; message: { tone: FooterTone; text: string; } | null; pendingMessage?: string; saveError: string | null; modifiedAt: string | null; dirty: boolean; busy: boolean; canSave: boolean; canPublish?: boolean; onDiscard: () => void; onSave: () => void; saveLabel?: string; onPublish?: () => void; }): ReactNode;
|
|
38
38
|
function EditorFrame(props: { testId: string; children: ReactNode; }): ReactNode;
|
|
39
|
-
function EditorHeader(props: { title: string; status?: ReactNode; actions
|
|
39
|
+
function EditorHeader(props: { title: string; status?: ReactNode; actions?: EditorSaveActions; testIds?: EditorHeaderTestIds; children: ReactNode; }): ReactNode;
|
|
40
40
|
function EditorInfoBar(props: { tone: InfoBarTone; testId: string; origin?: ReactNode; controls?: ReactNode; links?: ReactNode; overlays?: ReactNode; children: ReactNode; }): ReactNode;
|
|
41
41
|
function EditorLocaleSwitch(props: { testIdPrefix: string; locales: string[]; locale: string; onLocale: (locale: string) => void; }): ReactNode;
|
|
42
42
|
function EditorModeSwitch(props: { testIdPrefix: string; mode: EditorMode; onMode: (mode: EditorMode) => void; }): ReactNode;
|
|
@@ -388,6 +388,7 @@ type CorePrimitives = {
|
|
|
388
388
|
CopyButton?: ComponentType<CopyButtonProps>; // Optional — additive rollout, see StickyActionBar.
|
|
389
389
|
ShareButton?: ComponentType<ShareButtonProps>; // Optional — additive rollout, see StickyActionBar.
|
|
390
390
|
PromoPanel?: ComponentType<PromoPanelProps>; // Optional — additive rollout, see StickyActionBar.
|
|
391
|
+
EmptyState?: ComponentType<EmptyStateProps>; // Optional — additive rollout, see StickyActionBar.
|
|
391
392
|
};
|
|
392
393
|
type CoreTokens = {
|
|
393
394
|
color: ColorTokens;
|
package/agents/api/types.md
CHANGED
|
@@ -2463,6 +2463,14 @@ type CopyButtonProps = { // Copies `text` to the clipboard; the label flips to `
|
|
|
2463
2463
|
className?: string; // Layout extras, merged via cn().
|
|
2464
2464
|
testId?: string;
|
|
2465
2465
|
};
|
|
2466
|
+
type EmptyStateIcon = "unavailable" | "not-found"; // Semantic picture of an `EmptyState`; each platform maps it to its own icon, so platform-neutral code never imports an icon library.
|
|
2467
|
+
type EmptyStateProps = { // Calm centered "nothing here" page: icon in a soft circle, title, one explanation and the way out as `actions`.
|
|
2468
|
+
icon: EmptyStateIcon;
|
|
2469
|
+
title: string;
|
|
2470
|
+
description?: ReactNode;
|
|
2471
|
+
actions?: ReactNode;
|
|
2472
|
+
testId?: string;
|
|
2473
|
+
};
|
|
2466
2474
|
type PromoPanelAction =
|
|
2467
2475
|
| {
|
|
2468
2476
|
label: string;
|
package/agents/boot-rules.md
CHANGED
|
@@ -1156,7 +1156,7 @@
|
|
|
1156
1156
|
| <a id="screen-primary-action-unknown"></a>`screen/primary-action-unknown` | primaryAction, inlineActions and footerActions name a declared action id or the default edit. | Use a declared action id, or "edit" when the screen sets detailFor. | `packages/framework/src/engine/boot-validator/screens-actions-rules.ts` |
|
|
1157
1157
|
| <a id="screen-query-empty"></a>`screen/query-empty` | A screen or section query is a non-empty string. | Set query to a registered query name. | `packages/framework/src/engine/boot-validator/screens-kind-rules.ts` |
|
|
1158
1158
|
| <a id="screen-redirect-id-from-empty"></a>`screen/redirect-id-from-empty` | A redirect object's idFrom is a non-empty string. | Name the success-payload field carrying the navigation id, or use the plain string redirect. | `packages/framework/src/engine/boot-validator/screens-actions-rules.ts` |
|
|
1159
|
-
| <a id="screen-redirect-id-from-on-idless-target"></a>`screen/redirect-id-from-on-idless-target` | A redirect idFrom only targets entityEdit or
|
|
1159
|
+
| <a id="screen-redirect-id-from-on-idless-target"></a>`screen/redirect-id-from-on-idless-target` | A redirect idFrom only targets entityEdit, projectionDetail or custom screens. | Use the plain string redirect form. | `packages/framework/src/engine/boot-validator/screens-actions-rules.ts` |
|
|
1160
1160
|
| <a id="screen-redirect-id-from-whitespace"></a>`screen/redirect-id-from-whitespace` | A redirect idFrom has no leading or trailing whitespace. | Remove the whitespace from idFrom. | `packages/framework/src/engine/boot-validator/screens-actions-rules.ts` |
|
|
1161
1161
|
| <a id="screen-redirect-on-list-row-action"></a>`screen/redirect-on-list-row-action` | List and related-list row actions do not set redirect. | Remove redirect; it is only honored on record actions. | `packages/framework/src/engine/boot-validator/screens-actions-rules.ts` |
|
|
1162
1162
|
| <a id="screen-redirect-search-params-empty"></a>`screen/redirect-search-params-empty` | A redirect searchParams entry has a non-empty param name and payload field. | Map each search param name to a success-payload field. | `packages/framework/src/engine/boot-validator/screens-actions-rules.ts` |
|
|
@@ -1243,6 +1243,7 @@
|
|
|
1243
1243
|
| <a id="template-resolver-collection-refused-kind"></a>`template-resolver/collection-refused-kind` | Collections only use kinds that collections may write. | Pick an allowed collection kind. | `packages/bundled-features/src/template-resolver/boot-rules.ts` |
|
|
1244
1244
|
| <a id="template-resolver-tenant-editable-duplicate"></a>`template-resolver/tenant-editable-duplicate` | tenantEditable lists each kind and slug once. | Remove the duplicate entry. | `packages/bundled-features/src/template-resolver/boot-rules.ts` |
|
|
1245
1245
|
| <a id="template-resolver-tenant-editable-invalid-entry"></a>`template-resolver/tenant-editable-invalid-entry` | Each tenantEditable entry has a non-empty slug and at least one access role. | Give the entry a slug and roles. | `packages/bundled-features/src/template-resolver/boot-rules.ts` |
|
|
1246
|
+
| <a id="template-resolver-tenant-editable-variants-need-pdf"></a>`template-resolver/tenant-editable-variants-need-pdf` | Only tenantEditable entries of kind document-pdf may set variants. | Remove variants from the entry or change its kind to document-pdf. | `packages/bundled-features/src/template-resolver/boot-rules.ts` |
|
|
1246
1247
|
|
|
1247
1248
|
## tenant
|
|
1248
1249
|
|
package/agents/features-index.md
CHANGED
|
@@ -62,6 +62,8 @@ One entry per feature a package ships: purpose, import of its factory, required
|
|
|
62
62
|
`import { createDerivativesSharpFeature } from "@cosmicdrift/kumiko-bundled-features/derivatives-sharp"`; requires `file-derivatives`
|
|
63
63
|
- `document-designer`: Template overview and layout editor: lists the mail, PDF and layout templates of a tenant (platform admins see the system templates and how many tenants customised each) and edits the mail layout and the PDF letterhead in the browser.
|
|
64
64
|
`import { createDocumentDesignerFeature } from "@cosmicdrift/kumiko-document-designer"`; requires `template-resolver`
|
|
65
|
+
- `document-draft`: Document drafts: one editable copy of a PDF document template per object (for example a lease contract).
|
|
66
|
+
`import { createDocumentDraftFeature } from "@cosmicdrift/kumiko-bundled-features/document-draft"`; requires `files`, `template-resolver`, `user-data-rights`
|
|
65
67
|
- `document-ingest-foundation`: Shared PDF/Scan/Image → normalized-text ingest primitive.
|
|
66
68
|
`import { createDocumentIngestFoundationFeature } from "@cosmicdrift/kumiko-bundled-features/document-ingest-foundation"`; requires `config`, `tenant-lifecycle`
|
|
67
69
|
- `documents`: Filed documents with title, category, issue and expiry date and one file, shown on the records they are linked to.
|
package/agents/features.md
CHANGED
|
@@ -254,6 +254,14 @@ Category: content
|
|
|
254
254
|
|
|
255
255
|
Requires: `template-resolver`
|
|
256
256
|
|
|
257
|
+
## document-draft
|
|
258
|
+
|
|
259
|
+
Document drafts: one editable copy of a PDF document template per object (for example a lease contract). A draft is created from a template or one of its variants with the values for its placeholders, changed with the structured operations of template patch-draft or the editor, and finalized to a stored PDF through the injected print function; the template stays unchanged. Revise reopens a finalized draft. Body, variables and the last change are personal data of the draft, which is its own crypto-shredding subject.
|
|
260
|
+
|
|
261
|
+
Category: data
|
|
262
|
+
|
|
263
|
+
Requires: `files`, `template-resolver`, `user-data-rights`
|
|
264
|
+
|
|
257
265
|
## document-ingest-foundation
|
|
258
266
|
|
|
259
267
|
Shared PDF/Scan/Image → normalized-text ingest primitive. Owns the `documentExtract` entity (fileRefId, storageKey, per-page text + metadata) as an implicit entity-projection, the per-tenant `ocrLanguage`/`maxPagesPerFile` config keys, the `documentIngestProvider` extension-point providers register accepted mimeTypes/size caps under, and a fileRef.created/fileRef.restored trigger that resolves the provider for a file's mimeType and requests ingest via `documentIngest.requested` tagged with the winning provider — a delete→restore round-trip re-requests ingest the same way a fresh upload does. An orphan-extract guard forgets any `documentExtract` whose fileRef is no longer live at processing time, regardless of how a provider's own write races the fileRef's delete/forget — providers should write through `writeDocumentExtractForLiveFileRef`.
|
package/dist/auth/roles.d.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* these constants exclusively instead of string literals.
|
|
4
4
|
*/
|
|
5
5
|
export declare const ROLES: {
|
|
6
|
-
readonly TenantOwner: "TenantOwner";
|
|
7
6
|
readonly TenantAdmin: "TenantAdmin";
|
|
8
7
|
readonly DataProtectionOfficer: "DataProtectionOfficer";
|
|
9
8
|
readonly SystemAdmin: "SystemAdmin";
|
package/dist/auth/roles.js
CHANGED
|
@@ -8,8 +8,6 @@
|
|
|
8
8
|
// being changed.
|
|
9
9
|
//
|
|
10
10
|
// Canonical names:
|
|
11
|
-
// TenantOwner — Full tenant authority; the only role allowed
|
|
12
|
-
// to trigger tenant destruction.
|
|
13
11
|
// TenantAdmin — Tenant configuration and user management.
|
|
14
12
|
// The existing "Admin" string is migrated
|
|
15
13
|
// to this role.
|
|
@@ -27,7 +25,6 @@
|
|
|
27
25
|
* these constants exclusively instead of string literals.
|
|
28
26
|
*/
|
|
29
27
|
export const ROLES = {
|
|
30
|
-
TenantOwner: "TenantOwner",
|
|
31
28
|
TenantAdmin: "TenantAdmin",
|
|
32
29
|
DataProtectionOfficer: "DataProtectionOfficer",
|
|
33
30
|
SystemAdmin: "SystemAdmin",
|
|
@@ -388,7 +388,7 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
|
|
|
388
388
|
};
|
|
389
389
|
readonly redirectIdFromOnIdlessTarget: {
|
|
390
390
|
readonly id: "screen/redirect-id-from-on-idless-target";
|
|
391
|
-
readonly summary: "A redirect idFrom only targets entityEdit or
|
|
391
|
+
readonly summary: "A redirect idFrom only targets entityEdit, projectionDetail or custom screens.";
|
|
392
392
|
readonly fix: "Use the plain string redirect form.";
|
|
393
393
|
};
|
|
394
394
|
readonly redirectSearchParamsOnlyActionForm: {
|
|
@@ -126,7 +126,7 @@ export declare const SCREEN_ACTION_RULES: {
|
|
|
126
126
|
};
|
|
127
127
|
readonly redirectIdFromOnIdlessTarget: {
|
|
128
128
|
readonly id: "screen/redirect-id-from-on-idless-target";
|
|
129
|
-
readonly summary: "A redirect idFrom only targets entityEdit or
|
|
129
|
+
readonly summary: "A redirect idFrom only targets entityEdit, projectionDetail or custom screens.";
|
|
130
130
|
readonly fix: "Use the plain string redirect form.";
|
|
131
131
|
};
|
|
132
132
|
readonly redirectSearchParamsOnlyActionForm: {
|
|
@@ -126,7 +126,7 @@ export const SCREEN_ACTION_RULES = {
|
|
|
126
126
|
},
|
|
127
127
|
redirectIdFromOnIdlessTarget: {
|
|
128
128
|
id: "screen/redirect-id-from-on-idless-target",
|
|
129
|
-
summary: "A redirect idFrom only targets entityEdit or
|
|
129
|
+
summary: "A redirect idFrom only targets entityEdit, projectionDetail or custom screens.",
|
|
130
130
|
fix: "Use the plain string redirect form.",
|
|
131
131
|
},
|
|
132
132
|
redirectSearchParamsOnlyActionForm: {
|
|
@@ -449,7 +449,8 @@ function validateRedirectIdFromShape(featureName, screenId, screenKind, property
|
|
|
449
449
|
function validateRedirectIdFromTarget(featureName, screenId, screenKind, propertyPath, redirectTarget, sameFeatureTarget) {
|
|
450
450
|
if (sameFeatureTarget !== undefined &&
|
|
451
451
|
sameFeatureTarget.type !== "entityEdit" &&
|
|
452
|
-
sameFeatureTarget.type !== "projectionDetail"
|
|
452
|
+
sameFeatureTarget.type !== "projectionDetail" &&
|
|
453
|
+
sameFeatureTarget.type !== "custom") {
|
|
453
454
|
throw bootRuleError(SCREEN_ACTION_RULES.redirectIdFromOnIdlessTarget, {
|
|
454
455
|
message: `[Feature ${featureName}] Screen "${screenId}" (${screenKind}) ${propertyPath}.idFrom is set but target screen ` +
|
|
455
456
|
`"${redirectTarget}" (${sameFeatureTarget.type}) carries no id — use the plain string form.`,
|
|
@@ -24,6 +24,8 @@ function subtitlePartNavigates(screen) {
|
|
|
24
24
|
function projectionDetailNavigateActions(screen) {
|
|
25
25
|
return [
|
|
26
26
|
...scopeActions(screen.actions, screen.detailFor),
|
|
27
|
+
...scopeActions(screen.steps?.actions, screen.detailFor),
|
|
28
|
+
...scopeActions(screen.banner?.actions, screen.detailFor),
|
|
27
29
|
...screen.layout.sections.flatMap((section) => section.kind !== "relatedList"
|
|
28
30
|
? []
|
|
29
31
|
: [
|
|
@@ -45,9 +45,9 @@ export function assignableAppRolesFromUsages(usages) {
|
|
|
45
45
|
message: "assignableRole: role name must not be empty",
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
//
|
|
49
|
-
// TenantAdmin/Admin cannot reach — declaring
|
|
50
|
-
// self-grant it, so
|
|
48
|
+
// The platform role DataProtectionOfficer gates handlers that
|
|
49
|
+
// TenantAdmin/Admin cannot reach — declaring it would let an Admin
|
|
50
|
+
// self-grant it, so it stays out of reach of app declarations.
|
|
51
51
|
if (ROLE_RANKS.has(role) || PLATFORM_ROLE_NAMES.has(role)) {
|
|
52
52
|
throw bootRuleError(DEFINITION_ROLE_ASSIGNMENT_RULES.builtIn, {
|
|
53
53
|
message: `assignableRole: "${role}" is a built-in role and cannot be redeclared`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.424.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.424.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.424.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,23 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.424.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "A redirect with idFrom opens a custom screen on its record",
|
|
6
|
+
"detail": "`redirect: { screen, idFrom }` and success links with `idFrom` to a custom screen pass the payload field as the route id (`nav.route.entityId`) and win over the caller's `returnTo`, like a redirect to an entityEdit or projectionDetail screen. Without `idFrom` a custom target stays id-less and `returnTo` still wins. The boot rule `screen/redirect-id-from-on-idless-target` no longer rejects `idFrom` on a custom screen."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.423.0",
|
|
10
|
+
"type": "breaking",
|
|
11
|
+
"title": "ROLES.TenantOwner is removed",
|
|
12
|
+
"detail": "`ROLES` no longer has a `TenantOwner` entry and `\"TenantOwner\"` is no longer a reserved platform role name, so an app may declare an `assignableRole` with that name. No bundled feature grants or checks the role any more.",
|
|
13
|
+
"migration": "Replace `ROLES.TenantOwner` and the string \"TenantOwner\" with `Admin` (or `TenantAdmin` where the handler also allows it). Remove `TenantOwner` from role lists and translations."
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"version": "0.423.0",
|
|
17
|
+
"type": "fix",
|
|
18
|
+
"title": "Step and banner actions prefill their target form",
|
|
19
|
+
"detail": "Navigate actions under `steps.actions` and `banner.actions` of a projectionDetail screen now seed the target form's URL prefill fields from `params.map`, like the screen's own actions. A next-step button that passes a field other than the id fills the form instead of failing validation."
|
|
20
|
+
},
|
|
2
21
|
{
|
|
3
22
|
"version": "0.420.0",
|
|
4
23
|
"type": "fix",
|