@cosmicdrift/kumiko-bundled-features 0.418.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/dist/template-resolver/compile-document-body.js +3 -6
- package/dist/template-resolver/compile-document-styles.d.ts +3 -0
- package/dist/template-resolver/compile-document-styles.js +84 -0
- package/dist/template-resolver/document-frames.d.ts +3 -0
- package/dist/template-resolver/document-frames.js +19 -0
- package/dist/template-resolver/document-op-blocks.d.ts +495 -0
- package/dist/template-resolver/document-op-blocks.js +430 -0
- package/dist/template-resolver/document-ops.d.ts +1809 -37
- package/dist/template-resolver/document-ops.js +97 -104
- package/dist/template-resolver/document-print-only.d.ts +10 -0
- package/dist/template-resolver/document-print-only.js +24 -0
- package/dist/template-resolver/document-sanitizer.d.ts +1 -1
- package/dist/template-resolver/document-sanitizer.js +24 -13
- package/dist/template-resolver/feature.d.ts +3 -0
- package/dist/template-resolver/feature.js +14 -1
- package/dist/template-resolver/handlers/apply-layout.write.d.ts +29 -0
- package/dist/template-resolver/handlers/apply-layout.write.js +118 -0
- package/dist/template-resolver/handlers/create-layout.write.d.ts +15 -0
- package/dist/template-resolver/handlers/create-layout.write.js +78 -0
- package/dist/template-resolver/handlers/document-base.d.ts +2 -2
- package/dist/template-resolver/handlers/document-blocks.query.d.ts +10 -3
- package/dist/template-resolver/handlers/document-blocks.query.js +13 -8
- package/dist/template-resolver/handlers/document-region.d.ts +19 -0
- package/dist/template-resolver/handlers/document-region.js +27 -0
- package/dist/template-resolver/handlers/failure-reason.d.ts +2 -0
- package/dist/template-resolver/handlers/failure-reason.js +12 -0
- package/dist/template-resolver/handlers/import-bundle-system.write.js +4 -0
- package/dist/template-resolver/handlers/layout-source.query.d.ts +3 -3
- package/dist/template-resolver/handlers/layout-source.query.js +6 -2
- package/dist/template-resolver/handlers/overview.query.d.ts +8 -0
- package/dist/template-resolver/handlers/overview.query.js +12 -6
- package/dist/template-resolver/handlers/patch-draft.write.d.ts +905 -4
- package/dist/template-resolver/handlers/patch-draft.write.js +10 -6
- package/dist/template-resolver/handlers/publish-templates.write.d.ts +40 -0
- package/dist/template-resolver/handlers/publish-templates.write.js +61 -0
- package/dist/template-resolver/handlers/set.write.js +4 -1
- package/dist/template-resolver/handlers/template-write.js +7 -2
- package/dist/template-resolver/handlers/tenant-settings.d.ts +17 -0
- package/dist/template-resolver/handlers/tenant-settings.js +91 -0
- package/dist/template-resolver/handlers/toggle-status.write.d.ts +14 -9
- package/dist/template-resolver/handlers/toggle-status.write.js +11 -7
- package/dist/template-resolver/handlers/upsert-system.write.js +15 -9
- package/dist/template-resolver/handlers/usage.query.d.ts +14 -0
- package/dist/template-resolver/handlers/usage.query.js +80 -12
- package/dist/template-resolver/handlers/validate.query.d.ts +2 -0
- package/dist/template-resolver/handlers/validate.query.js +10 -0
- package/dist/template-resolver/i18n.js +3 -0
- package/dist/template-resolver/index.d.ts +7 -2
- package/dist/template-resolver/index.js +6 -2
- package/dist/template-resolver/layout-regions.d.ts +4 -5
- package/dist/template-resolver/layout-regions.js +38 -11
- package/dist/template-resolver/print-document.js +3 -1
- package/dist/template-resolver/seeding.js +4 -0
- package/dist/template-resolver/template-delivery-policy.d.ts +1 -0
- package/dist/template-resolver/template-delivery-policy.js +9 -1
- package/dist/template-resolver/template-edit-policy.d.ts +5 -1
- package/dist/template-resolver/template-edit-policy.js +29 -1
- package/dist/template-resolver/template-meta.d.ts +27 -2
- package/dist/template-resolver/template-meta.js +21 -5
- package/dist/template-resolver/template-preview.js +8 -8
- package/dist/template-resolver/template-validation.js +10 -3
- package/dist/template-resolver/web/constants.d.ts +7 -1
- package/dist/template-resolver/web/constants.js +21 -1
- package/dist/template-resolver/web/document-blocks.d.ts +1 -0
- package/dist/template-resolver/web/document-blocks.js +2 -0
- package/dist/template-resolver/web/document-editor-extensions.d.ts +9 -1
- package/dist/template-resolver/web/document-editor-extensions.js +27 -2
- package/dist/template-resolver/web/document-editor-fonts.d.ts +10 -0
- package/dist/template-resolver/web/document-editor-fonts.js +13 -0
- package/dist/template-resolver/web/document-fonts.d.ts +4 -0
- package/dist/template-resolver/web/document-fonts.js +18 -0
- package/dist/template-resolver/web/document-frame-control.d.ts +61 -0
- package/dist/template-resolver/web/document-frame-control.js +329 -0
- package/dist/template-resolver/web/document-frame-node-view.d.ts +4 -0
- package/dist/template-resolver/web/document-frame-node-view.js +173 -0
- package/dist/template-resolver/web/document-print-decorations.d.ts +12 -0
- package/dist/template-resolver/web/document-print-decorations.js +147 -0
- package/dist/template-resolver/web/document-print-defaults.d.ts +14 -0
- package/dist/template-resolver/web/document-print-defaults.js +25 -0
- package/dist/template-resolver/web/document-print-style.d.ts +71 -0
- package/dist/template-resolver/web/document-print-style.js +199 -0
- package/dist/template-resolver/web/document-repeat-strip.d.ts +8 -0
- package/dist/template-resolver/web/document-repeat-strip.js +78 -0
- package/dist/template-resolver/web/document-schema.js +23 -9
- package/dist/template-resolver/web/document-style-css.d.ts +29 -0
- package/dist/template-resolver/web/document-style-css.js +76 -0
- package/dist/template-resolver/web/document-tiptap-bubble.js +13 -3
- package/dist/template-resolver/web/document-tiptap-content.d.ts +2 -1
- package/dist/template-resolver/web/document-tiptap-content.js +36 -4
- package/dist/template-resolver/web/document-tiptap-context.d.ts +6 -2
- package/dist/template-resolver/web/document-tiptap-context.js +2 -1
- package/dist/template-resolver/web/document-tiptap-editor.d.ts +1 -1
- package/dist/template-resolver/web/document-tiptap-editor.js +13 -5
- package/dist/template-resolver/web/document-tiptap-helpers.d.ts +30 -1
- package/dist/template-resolver/web/document-tiptap-helpers.js +103 -2
- package/dist/template-resolver/web/document-tiptap-toolbar-groups.d.ts +5 -0
- package/dist/template-resolver/web/document-tiptap-toolbar-groups.js +89 -6
- package/dist/template-resolver/web/document-tiptap-toolbar.js +45 -8
- package/dist/template-resolver/web/document-toolbar-blocks.d.ts +17 -0
- package/dist/template-resolver/web/i18n.js +19 -0
- package/dist/template-resolver/web/index.d.ts +8 -2
- package/dist/template-resolver/web/index.js +6 -1
- package/dist/template-resolver/web/pdf-constants.d.ts +3 -0
- package/dist/template-resolver/web/pdf-constants.js +3 -0
- package/dist/template-resolver/web/qualified-names.d.ts +7 -0
- package/dist/template-resolver/web/qualified-names.js +6 -0
- package/dist/template-resolver/web/use-document-tiptap-model.d.ts +6 -2
- package/dist/template-resolver/web/use-document-tiptap-model.js +38 -3
- package/dist/tenant/company-config.d.ts +6 -0
- package/dist/tenant/company-config.js +41 -0
- package/dist/tenant/feature.js +11 -0
- package/dist/tenant/i18n.js +14 -0
- package/package.json +16 -11
- package/src/template-resolver/changes.json +38 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createTenantConfig } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
+
export const COMPANY_DATA_KEYS = [
|
|
3
|
+
"companyAddress",
|
|
4
|
+
"companyPhone",
|
|
5
|
+
"companyEmail",
|
|
6
|
+
"companyWebsite",
|
|
7
|
+
"companyRegister",
|
|
8
|
+
"companyVatId",
|
|
9
|
+
"companyManagement",
|
|
10
|
+
"companyBank",
|
|
11
|
+
"companyIban",
|
|
12
|
+
"companyBic",
|
|
13
|
+
];
|
|
14
|
+
export const COMPANY_SECTION_I18N_KEY = "tenant.company.section";
|
|
15
|
+
const COMPANY_KEY_ICONS = {
|
|
16
|
+
companyAddress: "map-pin",
|
|
17
|
+
companyPhone: "phone",
|
|
18
|
+
companyEmail: "mail",
|
|
19
|
+
companyWebsite: "link",
|
|
20
|
+
companyRegister: "file",
|
|
21
|
+
companyVatId: "receipt",
|
|
22
|
+
companyManagement: "user",
|
|
23
|
+
companyBank: "building",
|
|
24
|
+
companyIban: "coins",
|
|
25
|
+
companyBic: "hash",
|
|
26
|
+
};
|
|
27
|
+
export function companyI18nKey(key) {
|
|
28
|
+
return `tenant.company.${key}`;
|
|
29
|
+
}
|
|
30
|
+
// Printed on documents (letterhead, footer); the generated settings screen groups them in one section.
|
|
31
|
+
export function companyDataConfig(key) {
|
|
32
|
+
return createTenantConfig("text", {
|
|
33
|
+
default: "",
|
|
34
|
+
mask: {
|
|
35
|
+
title: companyI18nKey(key),
|
|
36
|
+
icon: COMPANY_KEY_ICONS[key],
|
|
37
|
+
order: 10 + COMPANY_DATA_KEYS.indexOf(key),
|
|
38
|
+
section: COMPANY_SECTION_I18N_KEY,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
package/dist/tenant/feature.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { access, assignableAppRolesFromUsages, bootRuleError, createSystemConfig, createTenantConfig, defineEntityDetailHandler, defineEntityListHandler, defineEntityUpdateHandler, defineFeature, EXT_ASSIGNABLE_ROLE, i18nKey, } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { TENANT_BOOT_RULES } from "./boot-rules.js";
|
|
3
|
+
import { companyDataConfig } from "./company-config.js";
|
|
3
4
|
import { activeTenantIdsQuery } from "./handlers/active-tenant-ids.query.js";
|
|
4
5
|
import { addMemberWrite } from "./handlers/add-member.write.js";
|
|
5
6
|
import { cancelInvitationWrite } from "./handlers/cancel-invitation.write.js";
|
|
@@ -60,6 +61,16 @@ export function createTenantFeature(options) {
|
|
|
60
61
|
keys: {
|
|
61
62
|
// Core tenant settings — tenant admins can change them; all users can read them.
|
|
62
63
|
companyName: createTenantConfig("text", { default: "" }),
|
|
64
|
+
companyAddress: companyDataConfig("companyAddress"),
|
|
65
|
+
companyPhone: companyDataConfig("companyPhone"),
|
|
66
|
+
companyEmail: companyDataConfig("companyEmail"),
|
|
67
|
+
companyWebsite: companyDataConfig("companyWebsite"),
|
|
68
|
+
companyRegister: companyDataConfig("companyRegister"),
|
|
69
|
+
companyVatId: companyDataConfig("companyVatId"),
|
|
70
|
+
companyManagement: companyDataConfig("companyManagement"),
|
|
71
|
+
companyBank: companyDataConfig("companyBank"),
|
|
72
|
+
companyIban: companyDataConfig("companyIban"),
|
|
73
|
+
companyBic: companyDataConfig("companyBic"),
|
|
63
74
|
// Curated subset of IANA time zones covering the most relevant practical cases.
|
|
64
75
|
// Extend it when a real need arises.
|
|
65
76
|
timezone: createTenantConfig("select", {
|
package/dist/tenant/i18n.js
CHANGED
|
@@ -5,6 +5,20 @@ export const TENANT_I18N = {
|
|
|
5
5
|
"screen:invite-create.title": { en: "New invitation" },
|
|
6
6
|
"screen:member-roles-edit.title": { en: "Edit roles" },
|
|
7
7
|
"tenant.nav.members": { en: "Team" },
|
|
8
|
+
"tenant.company.section": { en: "Company details" },
|
|
9
|
+
"screen:tenant-tenant.title": { en: "Company details" },
|
|
10
|
+
"screen:tenant-system.title": { en: "Company details of all tenants" },
|
|
11
|
+
"tenant.settings": { en: "Company details" },
|
|
12
|
+
"tenant.company.companyAddress": { en: "Address" },
|
|
13
|
+
"tenant.company.companyPhone": { en: "Phone" },
|
|
14
|
+
"tenant.company.companyEmail": { en: "Email" },
|
|
15
|
+
"tenant.company.companyWebsite": { en: "Website" },
|
|
16
|
+
"tenant.company.companyRegister": { en: "Commercial register" },
|
|
17
|
+
"tenant.company.companyVatId": { en: "VAT ID" },
|
|
18
|
+
"tenant.company.companyManagement": { en: "Management" },
|
|
19
|
+
"tenant.company.companyBank": { en: "Bank" },
|
|
20
|
+
"tenant.company.companyIban": { en: "IBAN" },
|
|
21
|
+
"tenant.company.companyBic": { en: "BIC" },
|
|
8
22
|
"tenant.members.actions.editRoles": { en: "Edit roles" },
|
|
9
23
|
"tenant.members.col.email": { en: "Email" },
|
|
10
24
|
"tenant.members.col.roles": { en: "Roles" },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-bundled-features",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.419.0",
|
|
4
4
|
"description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -642,9 +642,14 @@
|
|
|
642
642
|
}
|
|
643
643
|
},
|
|
644
644
|
"dependencies": {
|
|
645
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
646
|
-
"@cosmicdrift/kumiko-renderer": "0.
|
|
647
|
-
"@cosmicdrift/kumiko-types": "0.
|
|
645
|
+
"@cosmicdrift/kumiko-framework": "0.419.0",
|
|
646
|
+
"@cosmicdrift/kumiko-renderer": "0.419.0",
|
|
647
|
+
"@cosmicdrift/kumiko-types": "0.419.0",
|
|
648
|
+
"@fontsource/arimo": "^5.3.0",
|
|
649
|
+
"@fontsource/caladea": "^5.3.0",
|
|
650
|
+
"@fontsource/carlito": "^5.3.0",
|
|
651
|
+
"@fontsource/cousine": "^5.3.0",
|
|
652
|
+
"@fontsource/tinos": "^5.3.0",
|
|
648
653
|
"@mollie/api-client": "^4.6.0",
|
|
649
654
|
"@node-rs/argon2": "^2.2.2",
|
|
650
655
|
"@tiptap/core": "^3.32.2",
|
|
@@ -1310,19 +1315,19 @@
|
|
|
1310
1315
|
"LICENSE"
|
|
1311
1316
|
],
|
|
1312
1317
|
"devDependencies": {
|
|
1313
|
-
"@cosmicdrift/kumiko-locale-de": "0.
|
|
1314
|
-
"@cosmicdrift/kumiko-locale-es": "0.
|
|
1315
|
-
"@cosmicdrift/kumiko-locale-fr": "0.
|
|
1316
|
-
"@cosmicdrift/kumiko-locale-it": "0.
|
|
1317
|
-
"@cosmicdrift/kumiko-renderer-mail-html": "0.
|
|
1318
|
-
"@cosmicdrift/kumiko-testing": "0.
|
|
1318
|
+
"@cosmicdrift/kumiko-locale-de": "0.419.0",
|
|
1319
|
+
"@cosmicdrift/kumiko-locale-es": "0.419.0",
|
|
1320
|
+
"@cosmicdrift/kumiko-locale-fr": "0.419.0",
|
|
1321
|
+
"@cosmicdrift/kumiko-locale-it": "0.419.0",
|
|
1322
|
+
"@cosmicdrift/kumiko-renderer-mail-html": "0.419.0",
|
|
1323
|
+
"@cosmicdrift/kumiko-testing": "0.419.0",
|
|
1319
1324
|
"@testing-library/user-event": "^14.6.8",
|
|
1320
1325
|
"@types/sanitize-html": "^2.16.2",
|
|
1321
1326
|
"jsqr": "^1.4.0",
|
|
1322
1327
|
"unpdf": "^1.9.1"
|
|
1323
1328
|
},
|
|
1324
1329
|
"peerDependencies": {
|
|
1325
|
-
"@cosmicdrift/kumiko-testing": "0.
|
|
1330
|
+
"@cosmicdrift/kumiko-testing": "0.419.0"
|
|
1326
1331
|
},
|
|
1327
1332
|
"peerDependenciesMeta": {
|
|
1328
1333
|
"@cosmicdrift/kumiko-testing": {
|
|
@@ -1,4 +1,42 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.419.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "Frames and text styles in PDF templates",
|
|
6
|
+
"detail": "A PDF body can hold positioned frames (address window at DIN 5008 form B or A, free text frame, as `div[data-frame]` with `data-x`, `data-y`, `data-width`, `data-height` in mm) and text styles (`span[data-text-style]` with font, size in pt and colour, plus line height and paragraph spacing on blocks). Both go through the sanitizer and compile to inline CSS. The font catalog is Arial, Times New Roman, Courier New, Calibri and Cambria; the puppeteer-service image needs the metric-compatible fonts (Carlito, Caladea) next to the Liberation ones, so rebuild it."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.419.0",
|
|
10
|
+
"type": "breaking",
|
|
11
|
+
"title": "signature and imprint are no longer placeholders, company* names are reserved",
|
|
12
|
+
"detail": "In `document-pdf` and `pdf-layout` templates, `signature` and `imprint` are no longer placeholders; a template that uses them fails on save and publish. The ten `company*` names (`companyAddress`, `companyPhone`, `companyEmail`, `companyWebsite`, `companyRegister`, `companyVatId`, `companyManagement`, `companyBank`, `companyIban`, `companyBic`) are now reserved, so a notification variable with such a name fails at boot.",
|
|
13
|
+
"migration": "Remove `signature` and `imprint` from PDF templates and layouts. Rename notification variables that collide with a reserved `company*` name."
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"version": "0.419.0",
|
|
17
|
+
"type": "improvement",
|
|
18
|
+
"title": "Header and footer use the layout font size",
|
|
19
|
+
"detail": "PDF header and footer take the layout's `fontSizePt` and fall back to 10.5pt, the size the editor always showed; before they printed at 9px. Paragraphs in header and footer no longer carry margins. Existing PDF layouts therefore change on the next render: a footer taller than the bottom margin minus 4mm reaches into the page body, so check multi-line footers."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"version": "0.419.0",
|
|
23
|
+
"type": "improvement",
|
|
24
|
+
"title": "Default PDF layout per tenant, apply-layout and publish-templates",
|
|
25
|
+
"detail": "The tenant config key `template-resolver:config:default-pdf-layout-slug` picks the layout of PDF templates that name none. `template-resolver:write:apply-layout` sets it (mode `all`, no copies) or writes the layout into a tenant draft per chosen template (mode `selected`, text unchanged); `template-resolver:write:publish-templates` activates drafts together and reports per template what failed. The usage query lists the templates a layout serves, with `hasOwnLayout` for those that follow the default."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"version": "0.419.0",
|
|
29
|
+
"type": "breaking",
|
|
30
|
+
"title": "Line grid, flush tables and the address window in PDF bodies",
|
|
31
|
+
"detail": "PDF bodies print at line height 1.2. Paragraphs, lists, headings and tables are spaced by one body line (`--doc-line`, font size times 1.2) instead of 6pt after a paragraph and browser heading margins; the last element in a cell, list item, frame or the document has no bottom margin. Tables are flush with the text margin: the outer cells lose their left and right padding unless the layout table style is `grid` or the header has a background. Address paragraphs start at the text margin, have no spacing between lines, and the sender line prints at 7pt and wraps instead of being cut off. Flow text below a frame that reserves space starts 8mm under it. In the editor, cells are top-aligned, header cells print like body text, and rules appear only where the layout table style prints them; an untouched layout shows the table style \"plain\", as the PDF always printed it; a dashed outline marks cells while editing. Frames snap to page margins and other frames while moving or resizing (hold Alt to move freely).",
|
|
32
|
+
"migration": "Render existing PDF templates once and check the page breaks. A template that relied on the 6pt paragraph gap sets the spacing per paragraph instead."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"version": "0.419.0",
|
|
36
|
+
"type": "improvement",
|
|
37
|
+
"title": "patch-draft and create-layout let an agent rebuild PDF templates and layouts",
|
|
38
|
+
"detail": "patch-draft and document-blocks accept inline runs (bold, italic, underline, font, size, color), block formatting, lists, tables with a repeat row, address and text frames, a replaceBody op and a formatBlock op, all checked against the editor's print ranges and fonts. They also take kind pdf-layout with a region (header, signature or footer). The new create-layout handler creates an empty PDF layout draft under the slug tenant-layout-<name>; a tenant may edit, publish and use such layouts as soon as it may edit any PDF template, and system layouts may not take that prefix (reserved_layout_slug). patch-draft is now an agent proposal with risk low; its new refusals use the patch error codes print_style_not_allowed, invalid_table, too_many_blocks and others."
|
|
39
|
+
},
|
|
2
40
|
{
|
|
3
41
|
"version": "0.415.0",
|
|
4
42
|
"type": "fix",
|