@cosmicdrift/kumiko-document-designer 0.378.0 → 0.380.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/feature.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/list-definition.js +14 -2
- package/dist/web/cells.js +3 -4
- package/dist/web/client-plugin.js +3 -4
- package/dist/{constants.js → web/constants.js} +0 -1
- package/dist/web/default-translations.d.ts +2 -0
- package/dist/web/default-translations.js +218 -0
- package/dist/web/editor-header.js +1 -2
- package/dist/web/editor-locale.js +1 -2
- package/dist/web/editor-shell.js +8 -4
- package/dist/web/errors.js +0 -1
- package/dist/web/field-issue-text.js +0 -1
- package/dist/web/file-name.js +0 -1
- package/dist/web/i18n.d.ts +6 -2
- package/dist/web/i18n.js +873 -216
- package/dist/web/index.d.ts +1 -1
- package/dist/web/index.js +1 -2
- package/dist/web/layout-editor-body.js +4 -4
- package/dist/web/layout-editor.js +1 -2
- package/dist/web/layout-html.js +0 -1
- package/dist/web/layout-meta.js +0 -1
- package/dist/web/layout-rails.js +3 -3
- package/dist/web/layout-users.js +1 -2
- package/dist/web/mail-dialogs.js +0 -1
- package/dist/web/mail-draft.js +4 -3
- package/dist/web/mail-edit-center.js +0 -1
- package/dist/web/mail-editor-body.js +3 -3
- package/dist/web/mail-editor.js +1 -2
- package/dist/web/mail-footer.d.ts +1 -1
- package/dist/web/mail-footer.js +2 -2
- package/dist/web/mail-left-rail.js +0 -1
- package/dist/web/mail-missing-locale.js +0 -1
- package/dist/web/mail-origin-bar.js +0 -1
- package/dist/web/mail-pdf-link-modal.js +5 -2
- package/dist/web/mail-preview-side.js +0 -1
- package/dist/web/mail-preview.js +0 -1
- package/dist/web/mail-right-rail.js +1 -2
- package/dist/web/mail-upload-modal.js +0 -1
- package/dist/web/mail-versions.js +0 -1
- package/dist/web/origin-bar.js +2 -3
- package/dist/web/overrides-drawer.js +0 -1
- package/dist/web/overview-row.d.ts +4 -1
- package/dist/web/overview-row.js +3 -1
- package/dist/web/page-canvas.js +0 -1
- package/dist/web/pdf-left-rail.js +0 -1
- package/dist/web/pdf-meta.js +0 -1
- package/dist/web/pdf-template-editor.js +1 -2
- package/dist/web/preview-record-picker.js +0 -1
- package/dist/web/rail.js +8 -4
- package/dist/web/settings-panel.js +0 -1
- package/dist/web/template-rows.js +0 -1
- package/dist/web/use-files-capability.js +1 -2
- package/dist/web/use-mail-persistence.js +0 -1
- package/dist/web/use-overview-rows.js +0 -1
- package/dist/web/use-own-address.js +1 -2
- package/dist/web/use-settled-value.js +0 -1
- package/dist/web/use-test-mail.js +0 -1
- package/dist/web/used-by-label.d.ts +1 -0
- package/dist/web/used-by-label.js +10 -5
- package/package.json +6 -6
- package/src/changes.json +18 -0
- package/dist/i18n.d.ts +0 -6
- package/dist/i18n.js +0 -848
- /package/dist/{constants.d.ts → web/constants.d.ts} +0 -0
package/dist/feature.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { access, defineFeature, i18nKey, } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { DOCUMENT_DESIGNER_FEATURE, LAYOUT_EDITOR_SCREEN_ID, MAIL_EDITOR_SCREEN_ID, PDF_TEMPLATE_EDITOR_SCREEN_ID, PLATFORM_TEMPLATES_NAV_ID, PLATFORM_TEMPLATES_SCREEN_ID, TEMPLATES_NAV_ID, TEMPLATES_SCREEN_ID, } from "./constants.js";
|
|
3
|
-
import { DOCUMENT_DESIGNER_I18N } from "./i18n.js";
|
|
4
2
|
import { TEMPLATE_FACETS, templateColumns, templateRowActions } from "./list-definition.js";
|
|
3
|
+
import { DOCUMENT_DESIGNER_FEATURE, LAYOUT_EDITOR_SCREEN_ID, MAIL_EDITOR_SCREEN_ID, PDF_TEMPLATE_EDITOR_SCREEN_ID, PLATFORM_TEMPLATES_NAV_ID, PLATFORM_TEMPLATES_SCREEN_ID, TEMPLATES_NAV_ID, TEMPLATES_SCREEN_ID, } from "./web/constants.js";
|
|
4
|
+
import { DOCUMENT_DESIGNER_I18N } from "./web/i18n.js";
|
|
5
5
|
const OVERVIEW_QUERY = "template-resolver:query:overview";
|
|
6
6
|
export function createDocumentDesignerFeature(options = {}) {
|
|
7
7
|
const editorRoles = [...new Set(["SystemAdmin", ...(options.access?.roles ?? [])])];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DEFAULT_TEMPLATE_LOCALES, DOCUMENT_DESIGNER_FEATURE, LAYOUT_EDITOR_SCREEN_ID, MAIL_EDITOR_SCREEN_ID, PDF_TEMPLATE_EDITOR_SCREEN_ID, PLATFORM_TEMPLATES_NAV_ID, PLATFORM_TEMPLATES_SCREEN_ID, TEMPLATE_EDITOR_SCREENS, TEMPLATES_NAV_ID, TEMPLATES_SCREEN_ID, type TemplateEditorKind, } from "./constants.ts";
|
|
2
1
|
export { createDocumentDesignerFeature, type DocumentDesignerOptions } from "./feature.ts";
|
|
2
|
+
export { DEFAULT_TEMPLATE_LOCALES, DOCUMENT_DESIGNER_FEATURE, LAYOUT_EDITOR_SCREEN_ID, MAIL_EDITOR_SCREEN_ID, PDF_TEMPLATE_EDITOR_SCREEN_ID, PLATFORM_TEMPLATES_NAV_ID, PLATFORM_TEMPLATES_SCREEN_ID, TEMPLATE_EDITOR_SCREENS, TEMPLATES_NAV_ID, TEMPLATES_SCREEN_ID, type TemplateEditorKind, } from "./web/constants.ts";
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DEFAULT_TEMPLATE_LOCALES, DOCUMENT_DESIGNER_FEATURE, LAYOUT_EDITOR_SCREEN_ID, MAIL_EDITOR_SCREEN_ID, PDF_TEMPLATE_EDITOR_SCREEN_ID, PLATFORM_TEMPLATES_NAV_ID, PLATFORM_TEMPLATES_SCREEN_ID, TEMPLATE_EDITOR_SCREENS, TEMPLATES_NAV_ID, TEMPLATES_SCREEN_ID, } from "./constants.js";
|
|
2
1
|
export { createDocumentDesignerFeature } from "./feature.js";
|
|
2
|
+
export { DEFAULT_TEMPLATE_LOCALES, DOCUMENT_DESIGNER_FEATURE, LAYOUT_EDITOR_SCREEN_ID, MAIL_EDITOR_SCREEN_ID, PDF_TEMPLATE_EDITOR_SCREEN_ID, PLATFORM_TEMPLATES_NAV_ID, PLATFORM_TEMPLATES_SCREEN_ID, TEMPLATE_EDITOR_SCREENS, TEMPLATES_NAV_ID, TEMPLATES_SCREEN_ID, } from "./web/constants.js";
|
package/dist/list-definition.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i18nKey, } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { DocumentDesignerCells, TEMPLATE_EDITOR_SCREENS, } from "./constants.js";
|
|
2
|
+
import { DocumentDesignerCells, TEMPLATE_EDITOR_SCREENS, } from "./web/constants.js";
|
|
3
3
|
function cell(component) {
|
|
4
4
|
return { react: { __component: component } };
|
|
5
5
|
}
|
|
@@ -90,8 +90,19 @@ const EDITABLE_KINDS = [
|
|
|
90
90
|
"mail-layout",
|
|
91
91
|
"pdf-layout",
|
|
92
92
|
];
|
|
93
|
+
const RESET_TO_SYSTEM_HANDLER = "template-resolver:write:reset-to-system";
|
|
94
|
+
const RESET_LOCKED_OVERRIDE_ACTION = {
|
|
95
|
+
id: "reset-locked-override",
|
|
96
|
+
label: i18nKey("documentDesigner.action.resetLockedOverride"),
|
|
97
|
+
handler: RESET_TO_SYSTEM_HANDLER,
|
|
98
|
+
payload: { map: { id: "lockedOverrideId" } },
|
|
99
|
+
confirm: i18nKey("documentDesigner.action.resetLockedOverride.confirm"),
|
|
100
|
+
confirmLabel: i18nKey("documentDesigner.action.resetLockedOverride.confirmLabel"),
|
|
101
|
+
style: "danger",
|
|
102
|
+
visible: { field: "canResetLockedOverride", eq: true },
|
|
103
|
+
};
|
|
93
104
|
export function templateRowActions() {
|
|
94
|
-
|
|
105
|
+
const editActions = EDITABLE_KINDS.flatMap((kind) => {
|
|
95
106
|
const screen = TEMPLATE_EDITOR_SCREENS[kind];
|
|
96
107
|
if (screen === undefined)
|
|
97
108
|
return [];
|
|
@@ -106,4 +117,5 @@ export function templateRowActions() {
|
|
|
106
117
|
},
|
|
107
118
|
];
|
|
108
119
|
});
|
|
120
|
+
return [...editActions, RESET_LOCKED_OVERRIDE_ACTION];
|
|
109
121
|
}
|
package/dist/web/cells.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// @runtime client
|
|
3
2
|
import { TemplateResolverQueries } from "@cosmicdrift/kumiko-bundled-features/template-resolver/web";
|
|
4
3
|
import { formatWhen, useQuery, useTranslation, } from "@cosmicdrift/kumiko-renderer";
|
|
5
4
|
import { EMPTY_VALUE_PLACEHOLDER, toInstant } from "@cosmicdrift/kumiko-renderer/headless";
|
|
@@ -13,7 +12,7 @@ function withRow(row, render) {
|
|
|
13
12
|
}
|
|
14
13
|
export function TitleCell({ row }) {
|
|
15
14
|
const t = useTranslation();
|
|
16
|
-
return withRow(row, (r) => (_jsxs("div", { children: [_jsx("div", { className: "font-medium", children: templateTitle(t, r) }), _jsx("span", { className: "block max-w-40 truncate font-mono text-xs text-muted-foreground", title: r.slug, children: r.slug })] })));
|
|
15
|
+
return withRow(row, (r) => (_jsxs("div", { children: [_jsx("div", { className: "max-w-48 whitespace-normal font-medium", children: templateTitle(t, r) }), _jsx("span", { className: "block max-w-40 truncate font-mono text-xs text-muted-foreground", title: r.slug, children: r.slug })] })));
|
|
17
16
|
}
|
|
18
17
|
const KIND_KEY = {
|
|
19
18
|
mail: "documentDesigner.kind.mail",
|
|
@@ -44,7 +43,7 @@ export function createLocalesCell(appLocales) {
|
|
|
44
43
|
}
|
|
45
44
|
export function StatusCell({ row }) {
|
|
46
45
|
const t = useTranslation();
|
|
47
|
-
return withRow(row, (r) => (_jsxs("span", { className: "flex flex-col items-start gap-1", children: [_jsx(StatusBadge, { tone: statusTone(r.status), testId: "document-designer-status", children: statusLabel(t, r.status, r.version) }), r.status === "active" && r.draftVersion !== null && (_jsx(StatusBadge, { tone: statusTone("draft"), testId: "document-designer-draft-status", children: statusLabel(t, "draft", r.draftVersion) }))] })));
|
|
46
|
+
return withRow(row, (r) => (_jsxs("span", { className: "flex flex-col items-start gap-1", children: [_jsx(StatusBadge, { tone: statusTone(r.status), testId: "document-designer-status", children: statusLabel(t, r.status, r.version) }), r.lockedOverride && r.lockedOverrideI18nKey !== null && (_jsx("span", { title: t(r.lockedOverrideI18nKey), children: _jsx(StatusBadge, { tone: "warn", testId: "document-designer-locked-override", children: t("documentDesigner.status.lockedOverride") }) })), r.status === "active" && r.draftVersion !== null && (_jsx(StatusBadge, { tone: statusTone("draft"), testId: "document-designer-draft-status", children: statusLabel(t, "draft", r.draftVersion) }))] })));
|
|
48
47
|
}
|
|
49
48
|
export function UsedByCell({ row }) {
|
|
50
49
|
const t = useTranslation();
|
|
@@ -80,7 +79,7 @@ function OverriddenByCount({ slug, kind, }) {
|
|
|
80
79
|
active: data.activeOverrides,
|
|
81
80
|
total: data.totalTenants,
|
|
82
81
|
});
|
|
83
|
-
return _jsx("span", {
|
|
82
|
+
return _jsx("span", { children: label });
|
|
84
83
|
}
|
|
85
84
|
export function OverriddenByCell({ row }) {
|
|
86
85
|
return withRow(row, (r) => r.origin === "system" ? (_jsx(OverriddenByCount, { slug: r.slug, kind: r.kind })) : (EMPTY_VALUE_PLACEHOLDER));
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// @runtime client
|
|
3
2
|
import { textBlocksClient } from "@cosmicdrift/kumiko-bundled-features/template-resolver/web";
|
|
4
3
|
import { mergeTranslations, translationsByLocaleFromKeys, useNav, } from "@cosmicdrift/kumiko-renderer";
|
|
5
|
-
import { DEFAULT_TEMPLATE_LOCALES, DOCUMENT_DESIGNER_FEATURE, DocumentDesignerCells, LAYOUT_EDITOR_SCREEN_ID, MAIL_EDITOR_SCREEN_ID, PDF_TEMPLATE_EDITOR_SCREEN_ID, } from "../constants.js";
|
|
6
|
-
import { DOCUMENT_DESIGNER_I18N } from "../i18n.js";
|
|
7
4
|
import { createLocalesCell, KindCell, ModifiedCell, OriginCell, OverriddenByCell, StatusCell, TitleCell, UsedByCell, } from "./cells.js";
|
|
8
|
-
import {
|
|
5
|
+
import { DEFAULT_TEMPLATE_LOCALES, DOCUMENT_DESIGNER_FEATURE, DocumentDesignerCells, LAYOUT_EDITOR_SCREEN_ID, MAIL_EDITOR_SCREEN_ID, PDF_TEMPLATE_EDITOR_SCREEN_ID, } from "./constants.js";
|
|
6
|
+
import { documentDesignerTranslations } from "./default-translations.js";
|
|
7
|
+
import { DOCUMENT_DESIGNER_I18N } from "./i18n.js";
|
|
9
8
|
import { LayoutEditor } from "./layout-editor.js";
|
|
10
9
|
import { createMailEditor } from "./mail-editor.js";
|
|
11
10
|
import { PdfTemplateEditor } from "./pdf-template-editor.js";
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
export const documentDesignerTranslations = {
|
|
2
|
+
en: {
|
|
3
|
+
"documentDesigner.actions.generatePdf": "Generate PDF",
|
|
4
|
+
"documentDesigner.canvas.caption": 'Page 1 · {format} · The preview shows page breaks only roughly; "Generate PDF" is authoritative.',
|
|
5
|
+
"documentDesigner.canvas.fromLayout": 'from layout "{layout}"',
|
|
6
|
+
"documentDesigner.error.resourceTooLarge": "The image is too large. Please choose a smaller file.",
|
|
7
|
+
"documentDesigner.error.resourceUnsupportedImage": "This image format is not supported. Use PNG, JPEG, GIF or WebP.",
|
|
8
|
+
"documentDesigner.locale": "Language",
|
|
9
|
+
"documentDesigner.localeDialog.cancel": "Cancel",
|
|
10
|
+
"documentDesigner.localeDialog.description": "The changes of this language have not been saved yet.",
|
|
11
|
+
"documentDesigner.localeDialog.discard": "Discard changes",
|
|
12
|
+
"documentDesigner.localeDialog.save": "Save and switch",
|
|
13
|
+
"documentDesigner.localeDialog.title": "Unsaved changes",
|
|
14
|
+
"documentDesigner.notFound": 'Template "{slug}" was not found.',
|
|
15
|
+
"documentDesigner.originBar.export": "Export as bundle",
|
|
16
|
+
"documentDesigner.originBar.noTotal": "System template for all tenants. {count} tenants have their own version and do not receive changes made here.",
|
|
17
|
+
"documentDesigner.originBar.withTotal": "System template for all tenants. {count} of {total} tenants have their own version and do not receive changes made here.",
|
|
18
|
+
"documentDesigner.originBar.showOverrides": "Show tenant customisations",
|
|
19
|
+
"documentDesigner.overrides.action.diff": "Show difference",
|
|
20
|
+
"documentDesigner.overrides.action.open": "Open",
|
|
21
|
+
"documentDesigner.overrides.back": "Back to the list",
|
|
22
|
+
"documentDesigner.overrides.column.changed": "Changed",
|
|
23
|
+
"documentDesigner.overrides.column.status": "Status",
|
|
24
|
+
"documentDesigner.overrides.column.tenant": "Tenant",
|
|
25
|
+
"documentDesigner.overrides.column.version": "Version",
|
|
26
|
+
"documentDesigner.overrides.detail.version": "{tenant}, version {version}",
|
|
27
|
+
"documentDesigner.overrides.empty": "No tenant has customised this template. Changes here apply to everyone.",
|
|
28
|
+
"documentDesigner.overrides.status.active": "Customised",
|
|
29
|
+
"documentDesigner.overrides.status.draft": "Draft",
|
|
30
|
+
"documentDesigner.overrides.summary": "{count} tenants have their own version.",
|
|
31
|
+
"documentDesigner.overrides.title": "Tenant customisations",
|
|
32
|
+
"documentDesigner.overrides.usedBy": "Used by",
|
|
33
|
+
"documentDesigner.overrides.usedByEmpty": "No registered notification uses this template directly.",
|
|
34
|
+
"documentDesigner.pdfUnavailable": "PDF generation is not available: {message}",
|
|
35
|
+
"documentDesigner.pdfUnavailableNoReason": "PDF generation is not available.",
|
|
36
|
+
"documentDesigner.placeholders.layoutHint": 'Images travel with the PDF as data URIs. Header and footer come from the layout "{layout}" and are the same on every page.',
|
|
37
|
+
"documentDesigner.preview.loading": "Generating PDF...",
|
|
38
|
+
"documentDesigner.preview.stale": "The preview is out of date. Generate the PDF again.",
|
|
39
|
+
"documentDesigner.resources.empty": "No images yet.",
|
|
40
|
+
"documentDesigner.resources.noFilesFeature": "Uploads need the files feature, which this app has not mounted.",
|
|
41
|
+
"documentDesigner.resources.saveFirst": "Save the template first, then you can upload images.",
|
|
42
|
+
"documentDesigner.resources.title": "Resources",
|
|
43
|
+
"documentDesigner.resources.upload": "+ Upload",
|
|
44
|
+
"documentDesigner.settings.fileName": "File name",
|
|
45
|
+
"documentDesigner.settings.fileNamePlaceholder": "invoice-{{number}}.pdf",
|
|
46
|
+
"documentDesigner.settings.landscape": "Landscape",
|
|
47
|
+
"documentDesigner.settings.layout": "Layout",
|
|
48
|
+
"documentDesigner.settings.layoutHeaderFooter": "Header and footer from layout",
|
|
49
|
+
"documentDesigner.settings.marginBottom": "Bottom (mm)",
|
|
50
|
+
"documentDesigner.settings.marginLeft": "Left (mm)",
|
|
51
|
+
"documentDesigner.settings.marginRight": "Right (mm)",
|
|
52
|
+
"documentDesigner.settings.marginTop": "Top (mm)",
|
|
53
|
+
"documentDesigner.settings.metaAuthor": "Author",
|
|
54
|
+
"documentDesigner.settings.metadata": "PDF metadata",
|
|
55
|
+
"documentDesigner.settings.metaLanguage": "Language",
|
|
56
|
+
"documentDesigner.settings.metaLanguageHint": "Follows the template language. Switch it with the language selector in the header.",
|
|
57
|
+
"documentDesigner.settings.margins": "Margins in mm (top, right, bottom, left)",
|
|
58
|
+
"documentDesigner.settings.metaTitle": "Title",
|
|
59
|
+
"documentDesigner.settings.orientation": "Orientation",
|
|
60
|
+
"documentDesigner.settings.page": "Document",
|
|
61
|
+
"documentDesigner.settings.pageFormat": "Page format",
|
|
62
|
+
"documentDesigner.settings.portrait": "Portrait",
|
|
63
|
+
"documentDesigner.settings.printBackground": "Print backgrounds and colours",
|
|
64
|
+
"documentDesigner.settings.storage": "Storage",
|
|
65
|
+
"documentDesigner.settings.storageHint": "Every generated PDF carries the template id and version. Invoices stay verifiable even if the template changes later.",
|
|
66
|
+
"documentDesigner.status.active": "Active",
|
|
67
|
+
"documentDesigner.status.activeVersion": "Active v{version}",
|
|
68
|
+
"documentDesigner.status.draft": "Draft",
|
|
69
|
+
"documentDesigner.status.draftVersion": "Draft v{version}",
|
|
70
|
+
"documentDesigner.validation.lastProbe": "Last test run: {pages} pages, {size}, {seconds} s",
|
|
71
|
+
"documentDesigner.validation.missingRequired": 'Required placeholder "{name}" is missing. Publishing is blocked.',
|
|
72
|
+
"documentDesigner.validation.ok": "All required placeholders are present. After publishing, new PDFs use this version.",
|
|
73
|
+
},
|
|
74
|
+
de: {
|
|
75
|
+
"documentDesigner.actions.generatePdf": "PDF erzeugen",
|
|
76
|
+
"documentDesigner.canvas.caption": 'Seite 1 · {format} · Die Vorschau zeigt Seitengrenzen nur ungefähr, verbindlich ist "PDF erzeugen".',
|
|
77
|
+
"documentDesigner.canvas.fromLayout": "aus Layout „{layout}“",
|
|
78
|
+
"documentDesigner.error.resourceTooLarge": "Das Bild ist zu groß. Bitte eine kleinere Datei wählen.",
|
|
79
|
+
"documentDesigner.error.resourceUnsupportedImage": "Dieses Bildformat wird nicht unterstützt. Nutze PNG, JPEG, GIF oder WebP.",
|
|
80
|
+
"documentDesigner.locale": "Sprache",
|
|
81
|
+
"documentDesigner.localeDialog.cancel": "Abbrechen",
|
|
82
|
+
"documentDesigner.localeDialog.description": "Die Änderungen in dieser Sprache sind noch nicht gespeichert.",
|
|
83
|
+
"documentDesigner.localeDialog.discard": "Änderungen verwerfen",
|
|
84
|
+
"documentDesigner.localeDialog.save": "Speichern und wechseln",
|
|
85
|
+
"documentDesigner.localeDialog.title": "Ungespeicherte Änderungen",
|
|
86
|
+
"documentDesigner.notFound": 'Die Vorlage "{slug}" wurde nicht gefunden.',
|
|
87
|
+
"documentDesigner.originBar.export": "Als Bundle exportieren",
|
|
88
|
+
"documentDesigner.originBar.noTotal": "System-Vorlage für alle Mandanten. {count} Mandanten haben eine eigene Fassung und bekommen Änderungen hier nicht.",
|
|
89
|
+
"documentDesigner.originBar.withTotal": "System-Vorlage für alle Mandanten. {count} von {total} Mandanten haben eine eigene Fassung und bekommen Änderungen hier nicht.",
|
|
90
|
+
"documentDesigner.originBar.showOverrides": "Anpassungen der Mandanten anzeigen",
|
|
91
|
+
"documentDesigner.overrides.action.diff": "Unterschied anzeigen",
|
|
92
|
+
"documentDesigner.overrides.action.open": "Öffnen",
|
|
93
|
+
"documentDesigner.overrides.back": "Zurück zur Liste",
|
|
94
|
+
"documentDesigner.overrides.column.changed": "Geändert",
|
|
95
|
+
"documentDesigner.overrides.column.status": "Status",
|
|
96
|
+
"documentDesigner.overrides.column.tenant": "Mandant",
|
|
97
|
+
"documentDesigner.overrides.column.version": "Version",
|
|
98
|
+
"documentDesigner.overrides.detail.version": "{tenant}, Version {version}",
|
|
99
|
+
"documentDesigner.overrides.empty": "Kein Mandant hat diese Vorlage angepasst. Änderungen hier gelten für alle.",
|
|
100
|
+
"documentDesigner.overrides.status.active": "Angepasst",
|
|
101
|
+
"documentDesigner.overrides.status.draft": "Entwurf",
|
|
102
|
+
"documentDesigner.overrides.summary": "{count} Mandanten haben eine eigene Fassung.",
|
|
103
|
+
"documentDesigner.overrides.title": "Anpassungen der Mandanten",
|
|
104
|
+
"documentDesigner.overrides.usedBy": "Wird verwendet von",
|
|
105
|
+
"documentDesigner.overrides.usedByEmpty": "Keine registrierte Benachrichtigung nutzt diese Vorlage direkt.",
|
|
106
|
+
"documentDesigner.pdfUnavailable": "PDF-Erzeugung nicht verfügbar: {message}",
|
|
107
|
+
"documentDesigner.pdfUnavailableNoReason": "PDF-Erzeugung nicht verfügbar.",
|
|
108
|
+
"documentDesigner.placeholders.layoutHint": 'Bilder gehen im PDF als Data-URI mit. Kopf- und Fußzeile kommen aus dem Layout "{layout}" und sind auf allen Seiten gleich.',
|
|
109
|
+
"documentDesigner.preview.loading": "PDF wird erzeugt ...",
|
|
110
|
+
"documentDesigner.preview.stale": "Die Vorschau ist veraltet. Bitte das PDF neu erzeugen.",
|
|
111
|
+
"documentDesigner.resources.empty": "Noch keine Bilder.",
|
|
112
|
+
"documentDesigner.resources.noFilesFeature": "Uploads brauchen das Files-Feature, das diese App nicht eingebunden hat.",
|
|
113
|
+
"documentDesigner.resources.saveFirst": "Speichere die Vorlage zuerst, danach können Bilder hochgeladen werden.",
|
|
114
|
+
"documentDesigner.resources.title": "Ressourcen",
|
|
115
|
+
"documentDesigner.resources.upload": "+ Hochladen",
|
|
116
|
+
"documentDesigner.settings.fileName": "Dateiname",
|
|
117
|
+
"documentDesigner.settings.fileNamePlaceholder": "rechnung-{{number}}.pdf",
|
|
118
|
+
"documentDesigner.settings.landscape": "Querformat",
|
|
119
|
+
"documentDesigner.settings.layout": "Layout",
|
|
120
|
+
"documentDesigner.settings.layoutHeaderFooter": "Kopf- und Fußzeile aus Layout",
|
|
121
|
+
"documentDesigner.settings.marginBottom": "Unten (mm)",
|
|
122
|
+
"documentDesigner.settings.marginLeft": "Links (mm)",
|
|
123
|
+
"documentDesigner.settings.marginRight": "Rechts (mm)",
|
|
124
|
+
"documentDesigner.settings.marginTop": "Oben (mm)",
|
|
125
|
+
"documentDesigner.settings.metaAuthor": "Autor",
|
|
126
|
+
"documentDesigner.settings.metadata": "Metadaten im PDF",
|
|
127
|
+
"documentDesigner.settings.metaLanguage": "Sprache",
|
|
128
|
+
"documentDesigner.settings.metaLanguageHint": "Folgt der Sprache der Vorlage. Umstellen über die Sprachauswahl im Kopf.",
|
|
129
|
+
"documentDesigner.settings.margins": "Ränder in mm (oben, rechts, unten, links)",
|
|
130
|
+
"documentDesigner.settings.metaTitle": "Titel",
|
|
131
|
+
"documentDesigner.settings.orientation": "Ausrichtung",
|
|
132
|
+
"documentDesigner.settings.page": "Dokument",
|
|
133
|
+
"documentDesigner.settings.pageFormat": "Seitenformat",
|
|
134
|
+
"documentDesigner.settings.portrait": "Hochformat",
|
|
135
|
+
"documentDesigner.settings.printBackground": "Hintergründe und Farben drucken",
|
|
136
|
+
"documentDesigner.settings.storage": "Ablage",
|
|
137
|
+
"documentDesigner.settings.storageHint": "Jedes erzeugte PDF trägt Vorlagen-Id und Version. Rechnungen bleiben so nachweisbar, auch wenn die Vorlage später geändert wird.",
|
|
138
|
+
"documentDesigner.status.active": "Aktiv",
|
|
139
|
+
"documentDesigner.status.activeVersion": "Aktiv v{version}",
|
|
140
|
+
"documentDesigner.status.draft": "Entwurf",
|
|
141
|
+
"documentDesigner.status.draftVersion": "Entwurf v{version}",
|
|
142
|
+
"documentDesigner.validation.lastProbe": "Letzte Probe-Erzeugung: {pages} Seiten, {size}, {seconds} s",
|
|
143
|
+
"documentDesigner.validation.missingRequired": 'Pflicht-Platzhalter "{name}" fehlt. Veröffentlichen ist gesperrt.',
|
|
144
|
+
"documentDesigner.validation.ok": "Alle Pflicht-Platzhalter vorhanden. Nach dem Veröffentlichen nutzen neue PDFs diese Fassung.",
|
|
145
|
+
},
|
|
146
|
+
es: {
|
|
147
|
+
"documentDesigner.actions.generatePdf": "Generar PDF",
|
|
148
|
+
"documentDesigner.canvas.caption": "Página 1 · {format} · La vista previa solo muestra los saltos de página de forma aproximada; lo que vale es «Generar PDF».",
|
|
149
|
+
"documentDesigner.canvas.fromLayout": "del diseño «{layout}»",
|
|
150
|
+
"documentDesigner.error.resourceTooLarge": "La imagen es demasiado grande. Elige un archivo más pequeño.",
|
|
151
|
+
"documentDesigner.error.resourceUnsupportedImage": "Este formato de imagen no es compatible. Usa PNG, JPEG, GIF o WebP.",
|
|
152
|
+
"documentDesigner.locale": "Idioma",
|
|
153
|
+
"documentDesigner.localeDialog.cancel": "Cancelar",
|
|
154
|
+
"documentDesigner.localeDialog.description": "Los cambios en este idioma aún no se han guardado.",
|
|
155
|
+
"documentDesigner.localeDialog.discard": "Descartar cambios",
|
|
156
|
+
"documentDesigner.localeDialog.save": "Guardar y cambiar",
|
|
157
|
+
"documentDesigner.localeDialog.title": "Cambios sin guardar",
|
|
158
|
+
"documentDesigner.notFound": "No se encontró la plantilla «{slug}».",
|
|
159
|
+
"documentDesigner.originBar.export": "Exportar como paquete",
|
|
160
|
+
"documentDesigner.originBar.noTotal": "Plantilla del sistema para todas las organizaciones. {count} organizaciones tienen su propia versión y no reciben los cambios que hagas aquí.",
|
|
161
|
+
"documentDesigner.originBar.withTotal": "Plantilla del sistema para todas las organizaciones. {count} de {total} organizaciones tienen su propia versión y no reciben los cambios que hagas aquí.",
|
|
162
|
+
"documentDesigner.originBar.showOverrides": "Ver personalizaciones de las organizaciones",
|
|
163
|
+
"documentDesigner.overrides.action.diff": "Ver diferencias",
|
|
164
|
+
"documentDesigner.overrides.action.open": "Abrir",
|
|
165
|
+
"documentDesigner.overrides.back": "Volver a la lista",
|
|
166
|
+
"documentDesigner.overrides.column.changed": "Modificada",
|
|
167
|
+
"documentDesigner.overrides.column.status": "Estado",
|
|
168
|
+
"documentDesigner.overrides.column.tenant": "Organización",
|
|
169
|
+
"documentDesigner.overrides.column.version": "Versión",
|
|
170
|
+
"documentDesigner.overrides.detail.version": "{tenant}, versión {version}",
|
|
171
|
+
"documentDesigner.overrides.empty": "Ninguna organización ha personalizado esta plantilla. Los cambios que hagas aquí se aplican a todas.",
|
|
172
|
+
"documentDesigner.overrides.status.active": "Personalizada",
|
|
173
|
+
"documentDesigner.overrides.status.draft": "Borrador",
|
|
174
|
+
"documentDesigner.overrides.summary": "{count} organizaciones tienen su propia versión.",
|
|
175
|
+
"documentDesigner.overrides.title": "Personalizaciones de las organizaciones",
|
|
176
|
+
"documentDesigner.overrides.usedBy": "Se usa en",
|
|
177
|
+
"documentDesigner.overrides.usedByEmpty": "Ninguna notificación registrada usa esta plantilla directamente.",
|
|
178
|
+
"documentDesigner.pdfUnavailable": "La generación de PDF no está disponible: {message}",
|
|
179
|
+
"documentDesigner.pdfUnavailableNoReason": "La generación de PDF no está disponible.",
|
|
180
|
+
"documentDesigner.placeholders.layoutHint": "Las imágenes van incluidas en el PDF como URI de datos. El encabezado y el pie de página vienen del diseño «{layout}» y son iguales en todas las páginas.",
|
|
181
|
+
"documentDesigner.preview.loading": "Generando PDF...",
|
|
182
|
+
"documentDesigner.preview.stale": "La vista previa está desactualizada. Vuelve a generar el PDF.",
|
|
183
|
+
"documentDesigner.resources.empty": "Todavía no hay imágenes.",
|
|
184
|
+
"documentDesigner.resources.noFilesFeature": "Las subidas necesitan la función de archivos, que esta app no ha montado.",
|
|
185
|
+
"documentDesigner.resources.saveFirst": "Guarda primero la plantilla; después podrás subir imágenes.",
|
|
186
|
+
"documentDesigner.resources.title": "Recursos",
|
|
187
|
+
"documentDesigner.resources.upload": "+ Subir",
|
|
188
|
+
"documentDesigner.settings.fileName": "Nombre del archivo",
|
|
189
|
+
"documentDesigner.settings.fileNamePlaceholder": "factura-{{number}}.pdf",
|
|
190
|
+
"documentDesigner.settings.landscape": "Horizontal",
|
|
191
|
+
"documentDesigner.settings.layout": "Diseño",
|
|
192
|
+
"documentDesigner.settings.layoutHeaderFooter": "Encabezado y pie de página del diseño",
|
|
193
|
+
"documentDesigner.settings.marginBottom": "Inferior (mm)",
|
|
194
|
+
"documentDesigner.settings.marginLeft": "Izquierdo (mm)",
|
|
195
|
+
"documentDesigner.settings.marginRight": "Derecho (mm)",
|
|
196
|
+
"documentDesigner.settings.marginTop": "Superior (mm)",
|
|
197
|
+
"documentDesigner.settings.metaAuthor": "Autor",
|
|
198
|
+
"documentDesigner.settings.metadata": "Metadatos del PDF",
|
|
199
|
+
"documentDesigner.settings.metaLanguage": "Idioma",
|
|
200
|
+
"documentDesigner.settings.metaLanguageHint": "Sigue el idioma de la plantilla. Cámbialo con el selector de idioma del encabezado.",
|
|
201
|
+
"documentDesigner.settings.margins": "Márgenes en mm (superior, derecho, inferior, izquierdo)",
|
|
202
|
+
"documentDesigner.settings.metaTitle": "Título",
|
|
203
|
+
"documentDesigner.settings.orientation": "Orientación",
|
|
204
|
+
"documentDesigner.settings.page": "Documento",
|
|
205
|
+
"documentDesigner.settings.pageFormat": "Formato de página",
|
|
206
|
+
"documentDesigner.settings.portrait": "Vertical",
|
|
207
|
+
"documentDesigner.settings.printBackground": "Imprimir fondos y colores",
|
|
208
|
+
"documentDesigner.settings.storage": "Almacenamiento",
|
|
209
|
+
"documentDesigner.settings.storageHint": "Cada PDF generado lleva el id y la versión de la plantilla. Así las facturas siguen siendo verificables aunque la plantilla cambie más adelante.",
|
|
210
|
+
"documentDesigner.status.active": "Activa",
|
|
211
|
+
"documentDesigner.status.activeVersion": "Activa v{version}",
|
|
212
|
+
"documentDesigner.status.draft": "Borrador",
|
|
213
|
+
"documentDesigner.status.draftVersion": "Borrador v{version}",
|
|
214
|
+
"documentDesigner.validation.lastProbe": "Última generación de prueba: {pages} páginas, {size}, {seconds} s",
|
|
215
|
+
"documentDesigner.validation.missingRequired": "Falta el marcador obligatorio «{name}». No se puede publicar.",
|
|
216
|
+
"documentDesigner.validation.ok": "Están todos los marcadores obligatorios. Tras publicar, los PDF nuevos usan esta versión.",
|
|
217
|
+
},
|
|
218
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// @runtime client
|
|
3
2
|
import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
4
3
|
import { ModeSwitch, StatusBadge } from "@cosmicdrift/kumiko-renderer/web";
|
|
5
4
|
import { asRowStatus, statusLabel, statusTone } from "./status-label.js";
|
|
@@ -39,5 +38,5 @@ export function EditorHeader({ title, stored, actions, children, }) {
|
|
|
39
38
|
const { Button, PageHeader } = usePrimitives();
|
|
40
39
|
if (PageHeader === undefined)
|
|
41
40
|
return null;
|
|
42
|
-
return (_jsx(PageHeader, { title: title, status: stored !== null && _jsx(StoredStatus, { stored: stored }), actions: _jsxs("span", { className: "flex items-center gap-2 [&_button]:px-2.5 [&_button]:text-sm", children: [children, _jsx(Button, { variant: "secondary", size: "sm", disabled: !actions.canSave, loading: actions.busy, onClick: actions.onSave, testId: "document-designer-header-save", children: t("documentDesigner.editor.save") }), _jsx(Button, { size: "sm", disabled: !actions.canPublish, onClick: actions.onPublish, testId: "document-designer-header-publish", children: t("documentDesigner.editor.publish") })] }) }));
|
|
41
|
+
return (_jsx(PageHeader, { title: title, status: stored !== null && _jsx(StoredStatus, { stored: stored }), actions: _jsxs("span", { className: "flex items-center gap-2 [&_button]:px-2.5 [&_button]:text-sm", children: [children, _jsxs("span", { className: "hidden items-center gap-2 xl:flex", children: [_jsx(Button, { variant: "secondary", size: "sm", disabled: !actions.canSave, loading: actions.busy, onClick: actions.onSave, testId: "document-designer-header-save", children: t("documentDesigner.editor.save") }), _jsx(Button, { size: "sm", disabled: !actions.canPublish, onClick: actions.onPublish, testId: "document-designer-header-publish", children: t("documentDesigner.editor.publish") })] })] }) }));
|
|
43
42
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { DEFAULT_TEMPLATE_LOCALES } from "../constants.js";
|
|
1
|
+
import { DEFAULT_TEMPLATE_LOCALES } from "./constants.js";
|
|
3
2
|
// The editor opens in the language the user works in when the template has it
|
|
4
3
|
// (or, for a template without any version yet, when the app offers it).
|
|
5
4
|
export function defaultLocaleOf(uiLocale, appLocales, rowLocales) {
|
package/dist/web/editor-shell.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// @runtime client
|
|
3
2
|
import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
4
3
|
import { cn } from "@cosmicdrift/kumiko-renderer/web";
|
|
5
4
|
import { OriginBadge } from "./editor-header.js";
|
|
@@ -22,9 +21,14 @@ export function EditorInfoBar({ tone, testId, origin, controls, links, overlays,
|
|
|
22
21
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: cn("flex items-start gap-4 border-b px-6 py-2 text-sm", INFO_BAR_TONE[tone]), "data-testid": testId, "data-variant": tone === "warn" ? "warn" : undefined, children: [_jsxs("span", { className: "min-w-0 flex-1", children: [origin != null && _jsx(OriginBadge, { origin: origin }), " ", children] }), controls !== undefined && (_jsx("div", { className: "flex shrink-0 items-center gap-2", children: controls })), links !== undefined && _jsx("div", { className: "flex shrink-0 items-center gap-4", children: links })] }), overlays] }));
|
|
23
22
|
}
|
|
24
23
|
export function EditorBody({ left, center, right, testId, }) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const centerColumn = (_jsx("div", { className: "flex min-h-0 min-w-0 flex-col overflow-hidden bg-muted", children: center }));
|
|
25
|
+
if (left === undefined) {
|
|
26
|
+
return (_jsxs("div", { className: "grid min-h-0 flex-1 grid-cols-[minmax(0,1fr)_280px]", "data-testid": testId, children: [centerColumn, _jsx("aside", { className: "min-h-0 overflow-y-auto border-l bg-background", children: right })] }));
|
|
27
|
+
}
|
|
28
|
+
// Three columns leave a narrow window (1024px beside the app sidebar) too little room for the
|
|
29
|
+
// page: there both rails share the left column, one below the other, and the center keeps its width.
|
|
30
|
+
// The rail column is display:contents while wide, so both rails stay grid items of their own.
|
|
31
|
+
return (_jsx("div", { className: "@container flex min-h-0 min-w-0 flex-1", "data-testid": testId, children: _jsxs("div", { className: "grid min-h-0 min-w-0 flex-1 grid-cols-[240px_minmax(0,1fr)_280px] @max-4xl:grid-cols-[240px_minmax(0,1fr)]", children: [_jsxs("div", { className: "contents @max-4xl:block @max-4xl:min-h-0 @max-4xl:overflow-y-auto @max-4xl:border-r @max-4xl:bg-background", children: [_jsx("aside", { className: "min-h-0 overflow-y-auto border-r bg-background @max-4xl:overflow-visible @max-4xl:border-r-0 @max-4xl:border-b", children: left }), _jsx("aside", { className: "order-last min-h-0 overflow-y-auto border-l bg-background @max-4xl:overflow-visible @max-4xl:border-l-0", children: right })] }), centerColumn] }) }));
|
|
28
32
|
}
|
|
29
33
|
export function EditorFooter({ testIdPrefix, message, saveError, modifiedAt, dirty, busy, canSave, canPublish, onDiscard, onSave, onPublish, }) {
|
|
30
34
|
const t = useTranslation();
|
package/dist/web/errors.js
CHANGED
package/dist/web/file-name.js
CHANGED
package/dist/web/i18n.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type Localized = {
|
|
2
|
+
readonly en: string;
|
|
3
|
+
readonly de: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const DOCUMENT_DESIGNER_I18N: Readonly<Record<string, Localized>>;
|
|
6
|
+
export {};
|