@cosmicdrift/kumiko-document-designer 0.373.0 → 0.377.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/web/cells.js +2 -2
- package/dist/web/client-plugin.d.ts +1 -1
- package/dist/web/editor-header.js +1 -1
- package/dist/web/editor-shell.js +1 -1
- package/dist/web/errors.d.ts +1 -1
- package/dist/web/field-issue-text.d.ts +1 -1
- package/dist/web/layout-editor-body.js +1 -1
- package/dist/web/layout-editor.js +1 -1
- package/dist/web/layout-html.js +1 -1
- package/dist/web/mail-draft.js +1 -1
- package/dist/web/mail-editor-body.js +4 -1
- package/dist/web/mail-editor.js +1 -1
- package/dist/web/mail-origin-bar.js +1 -1
- package/dist/web/mail-pdf-link-modal.js +1 -1
- package/dist/web/mail-preview-side.d.ts +4 -2
- package/dist/web/mail-preview-side.js +3 -4
- package/dist/web/mail-preview.d.ts +5 -2
- package/dist/web/mail-preview.js +3 -3
- package/dist/web/mail-types.d.ts +1 -0
- package/dist/web/mail-versions.js +2 -2
- package/dist/web/origin-bar.js +2 -2
- package/dist/web/overrides-drawer.js +1 -1
- package/dist/web/page-canvas.js +1 -1
- package/dist/web/pdf-left-rail.js +1 -1
- package/dist/web/pdf-template-editor.js +1 -1
- package/dist/web/rail.js +1 -1
- package/dist/web/status-label.d.ts +1 -1
- package/dist/web/types.d.ts +1 -1
- package/dist/web/used-by-label.js +1 -1
- package/package.json +6 -8
package/dist/web/cells.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { TemplateResolverQueries } from "@cosmicdrift/kumiko-bundled-features/template-resolver/web";
|
|
4
|
-
import { EMPTY_VALUE_PLACEHOLDER, toInstant } from "@cosmicdrift/kumiko-headless";
|
|
5
4
|
import { formatWhen, useQuery, useTranslation, } from "@cosmicdrift/kumiko-renderer";
|
|
6
|
-
import {
|
|
5
|
+
import { EMPTY_VALUE_PLACEHOLDER, toInstant } from "@cosmicdrift/kumiko-renderer/headless";
|
|
6
|
+
import { StatusBadge } from "@cosmicdrift/kumiko-renderer/web";
|
|
7
7
|
import { parseOverviewRow } from "./overview-row.js";
|
|
8
8
|
import { statusLabel, statusTone } from "./status-label.js";
|
|
9
9
|
import { templateTitle, usedByLabel } from "./used-by-label.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer
|
|
1
|
+
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer/web";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* Custom screen body: the template comes from the URL (`?slug=...&locale=...`),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
4
|
-
import { ModeSwitch, StatusBadge } from "@cosmicdrift/kumiko-renderer
|
|
4
|
+
import { ModeSwitch, StatusBadge } from "@cosmicdrift/kumiko-renderer/web";
|
|
5
5
|
import { asRowStatus, statusLabel, statusTone } from "./status-label.js";
|
|
6
6
|
const ORIGIN_LABEL = {
|
|
7
7
|
system: "documentDesigner.origin.system",
|
package/dist/web/editor-shell.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
4
|
-
import { cn } from "@cosmicdrift/kumiko-renderer
|
|
4
|
+
import { cn } from "@cosmicdrift/kumiko-renderer/web";
|
|
5
5
|
import { OriginBadge } from "./editor-header.js";
|
|
6
6
|
import { formatRelativeWhen } from "./relative-time.js";
|
|
7
7
|
const INFO_BAR_TONE = {
|
package/dist/web/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DispatcherError } from "@cosmicdrift/kumiko-headless";
|
|
1
|
+
import type { DispatcherError } from "@cosmicdrift/kumiko-renderer/headless";
|
|
2
2
|
type Translate = (key: string, params?: Readonly<Record<string, unknown>>) => string;
|
|
3
3
|
export declare function isAlreadyActive(error: DispatcherError): boolean;
|
|
4
4
|
/** Plain-language text for a failed call; falls back to the server message when no translation exists. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DispatcherError } from "@cosmicdrift/kumiko-headless";
|
|
1
|
+
import type { DispatcherError } from "@cosmicdrift/kumiko-renderer/headless";
|
|
2
2
|
type Translate = (key: string, params?: Readonly<Record<string, unknown>>) => string;
|
|
3
3
|
export declare function errorTextWithFieldIssues(error: DispatcherError, translate: Translate): string;
|
|
4
4
|
export {};
|
|
@@ -2,7 +2,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { DocumentContentEditor, MAIL_DOCUMENT_BLOCKS, PDF_DOCUMENT_BLOCKS, TemplateResolverHandlers, TemplateResolverQueries, } from "@cosmicdrift/kumiko-bundled-features/template-resolver/web";
|
|
4
4
|
import { dispatcherErrorText, useMutation, usePrimitives, useQuery, useTranslation, } from "@cosmicdrift/kumiko-renderer";
|
|
5
|
-
import { cn, ModeSwitch, TextareaField } from "@cosmicdrift/kumiko-renderer
|
|
5
|
+
import { cn, ModeSwitch, TextareaField } from "@cosmicdrift/kumiko-renderer/web";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { BRANDING_QUERY_QN } from "../constants.js";
|
|
8
8
|
import { composeLayoutHtml } from "./compose-layout.js";
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { TemplateResolverQueries } from "@cosmicdrift/kumiko-bundled-features/template-resolver/web";
|
|
4
4
|
import { useNav, useQuery, useUserRoles } from "@cosmicdrift/kumiko-renderer";
|
|
5
|
-
import { ErrorState, LoadingState } from "@cosmicdrift/kumiko-renderer
|
|
5
|
+
import { ErrorState, LoadingState } from "@cosmicdrift/kumiko-renderer/web";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { DEFAULT_LAYOUT_SLUG } from "../constants.js";
|
|
8
8
|
import { LayoutEditorBody } from "./layout-editor-body.js";
|
package/dist/web/layout-html.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// @runtime client
|
|
3
|
-
import { cn } from "@cosmicdrift/kumiko-renderer
|
|
3
|
+
import { cn } from "@cosmicdrift/kumiko-renderer/web";
|
|
4
4
|
import { createElement, useMemo } from "react";
|
|
5
5
|
// Layout regions arrive server-sanitised, but the preview still renders them
|
|
6
6
|
// through a whitelist instead of innerHTML so a sanitiser gap can never run
|
package/dist/web/mail-draft.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @runtime client
|
|
2
|
-
import { DOCUMENT_FALLBACK_CURRENCY, formatDocumentDate, formatDocumentMoney, formatDocumentPercent, } from "@cosmicdrift/kumiko-headless";
|
|
2
|
+
import { DOCUMENT_FALLBACK_CURRENCY, formatDocumentDate, formatDocumentMoney, formatDocumentPercent, } from "@cosmicdrift/kumiko-renderer/headless";
|
|
3
3
|
import { variableLabelText } from "./used-by-label.js";
|
|
4
4
|
export const EMPTY_DRAFT = {
|
|
5
5
|
subject: "",
|
|
@@ -55,6 +55,7 @@ export function MailEditorBody(props) {
|
|
|
55
55
|
const [editorEpoch, setEditorEpoch] = useState(0);
|
|
56
56
|
const [includeAttachments, setIncludeAttachments] = useState(true);
|
|
57
57
|
const [prefixSubject, setPrefixSubject] = useState(true);
|
|
58
|
+
const [picked, setPicked] = useState(null);
|
|
58
59
|
const insert = useInsertTargets();
|
|
59
60
|
const persistence = useMailPersistence({
|
|
60
61
|
slug,
|
|
@@ -149,6 +150,7 @@ export function MailEditorBody(props) {
|
|
|
149
150
|
variableSchema,
|
|
150
151
|
includeAttachments,
|
|
151
152
|
prefixSubject,
|
|
153
|
+
...(picked !== null && { variables: picked }),
|
|
152
154
|
});
|
|
153
155
|
};
|
|
154
156
|
// Nothing is written yet in a missing language, so no placeholder may read as missing.
|
|
@@ -180,7 +182,8 @@ export function MailEditorBody(props) {
|
|
|
180
182
|
content: settled.body,
|
|
181
183
|
meta: buildMeta(settled),
|
|
182
184
|
variableSchema,
|
|
183
|
-
|
|
185
|
+
...(picked !== null && { variables: picked }),
|
|
186
|
+
}, picked: picked, onPick: setPicked, validation: validation ?? null, slug: slug, locale: locale, fromName: settled.senderName, own: own, origin: origin, controls: controls, testMail: {
|
|
184
187
|
pending: testMail.pending,
|
|
185
188
|
onSend: sendTestMail,
|
|
186
189
|
includeAttachments,
|
package/dist/web/mail-editor.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { TemplateResolverQueries } from "@cosmicdrift/kumiko-bundled-features/template-resolver/web";
|
|
4
4
|
import { useLocale, useNav, useQuery, useTranslation, useUserRoles, } from "@cosmicdrift/kumiko-renderer";
|
|
5
|
-
import { LoadingState } from "@cosmicdrift/kumiko-renderer
|
|
5
|
+
import { LoadingState } from "@cosmicdrift/kumiko-renderer/web";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { DEFAULT_TEMPLATE_LOCALES } from "../constants.js";
|
|
8
8
|
import { defaultLocaleOf } from "./editor-locale.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { TemplateResolverHandlers } from "@cosmicdrift/kumiko-bundled-features/template-resolver/web";
|
|
4
|
-
import { EMPTY_VALUE_PLACEHOLDER } from "@cosmicdrift/kumiko-headless";
|
|
5
4
|
import { dispatcherErrorText, formatWhen, useMutation, usePrimitives, useTranslation, } from "@cosmicdrift/kumiko-renderer";
|
|
5
|
+
import { EMPTY_VALUE_PLACEHOLDER } from "@cosmicdrift/kumiko-renderer/headless";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { originOf } from "./editor-header.js";
|
|
8
8
|
import { EditorInfoBar } from "./editor-shell.js";
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { PlaceholderLineEditor, TemplateResolverHandlers, TemplateResolverQueries, } from "@cosmicdrift/kumiko-bundled-features/template-resolver/web";
|
|
4
4
|
import { dispatcherErrorText, useMutation, usePrimitives, useQuery, useTranslation, } from "@cosmicdrift/kumiko-renderer";
|
|
5
|
-
import { EmptyState } from "@cosmicdrift/kumiko-renderer
|
|
5
|
+
import { EmptyState } from "@cosmicdrift/kumiko-renderer/web";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { lastSlugSegment, parseJsonRecord, uniqueResourceKey } from "./mail-draft.js";
|
|
8
8
|
function pdfRowIdOf(summaries, slug) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import type { MailPreview, MailValidation } from "./mail-types.ts";
|
|
2
|
+
import type { MailPreview, MailValidation, PickedValues } from "./mail-types.ts";
|
|
3
3
|
import type { OwnAddress } from "./use-own-address.ts";
|
|
4
4
|
export type TestMailControls = {
|
|
5
5
|
readonly pending: boolean;
|
|
@@ -9,11 +9,13 @@ export type TestMailControls = {
|
|
|
9
9
|
readonly prefixSubject: boolean;
|
|
10
10
|
readonly onPrefixSubject: (next: boolean) => void;
|
|
11
11
|
};
|
|
12
|
-
export declare function PreviewSide({ preview, validation, slug, locale, own, testMail, }: {
|
|
12
|
+
export declare function PreviewSide({ preview, validation, slug, locale, own, testMail, picked, onPick, }: {
|
|
13
13
|
readonly preview: MailPreview | null;
|
|
14
14
|
readonly validation: MailValidation | null;
|
|
15
15
|
readonly slug: string;
|
|
16
16
|
readonly locale: string;
|
|
17
|
+
readonly picked: PickedValues | null;
|
|
18
|
+
readonly onPick: (values: PickedValues) => void;
|
|
17
19
|
readonly own: OwnAddress;
|
|
18
20
|
readonly testMail: TestMailControls;
|
|
19
21
|
}): ReactNode;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { ConfigQueries } from "@cosmicdrift/kumiko-bundled-features/config/web";
|
|
4
|
-
import { DOCUMENT_FALLBACK_CURRENCY } from "@cosmicdrift/kumiko-headless";
|
|
5
4
|
import { useNav, usePrimitives, useQuery, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
5
|
+
import { DOCUMENT_FALLBACK_CURRENCY } from "@cosmicdrift/kumiko-renderer/headless";
|
|
6
6
|
import { TENANT_CURRENCY_CONFIG_KEY } from "@cosmicdrift/kumiko-types/fields";
|
|
7
7
|
import { useState } from "react";
|
|
8
8
|
import { displayValue } from "./mail-draft.js";
|
|
@@ -73,10 +73,9 @@ function TestMailRecipient({ own }) {
|
|
|
73
73
|
const { profileScreenId } = own;
|
|
74
74
|
return (_jsxs(RailField, { children: [_jsx(Field, { id: "mail-test-recipient", label: t("documentDesigner.mail.testMail.recipient"), children: _jsx(Input, { kind: "text", id: "mail-test-recipient", name: "mail-test-recipient", testId: "mail-test-recipient", value: own.email ?? t("documentDesigner.mail.testMail.ownAddress"), onChange: noop, disabled: true }) }), profileScreenId !== null && (_jsx(Link, { href: nav.hrefFor({ screenId: profileScreenId }), onPress: () => nav.navigate({ screenId: profileScreenId }), testId: "mail-test-recipient-edit", children: t("documentDesigner.mail.testMail.changeAddress") }))] }));
|
|
75
75
|
}
|
|
76
|
-
export function PreviewSide({ preview, validation, slug, locale, own, testMail, }) {
|
|
76
|
+
export function PreviewSide({ preview, validation, slug, locale, own, testMail, picked, onPick, }) {
|
|
77
77
|
const t = useTranslation();
|
|
78
78
|
const { Button, Field, Input, Text } = usePrimitives();
|
|
79
79
|
const hasAttachments = preview?.attachments.some((a) => a.kind !== "inline") === true;
|
|
80
|
-
|
|
81
|
-
return (_jsxs("div", { "data-testid": "mail-preview-side", children: [_jsxs(RailSection, { title: t("documentDesigner.mail.preview.samples"), action: _jsx(RecordPickerLink, { slug: slug, locale: locale, onPick: setPicked }), children: [_jsx(SampleValues, { preview: preview, validation: validation, picked: picked, locale: locale }), _jsx(RailHint, { children: t("documentDesigner.mail.preview.samplesHint") })] }), _jsxs(RailSection, { title: t("documentDesigner.mail.testMail.title"), children: [_jsx(TestMailRecipient, { own: own }), _jsxs(RailField, { children: [_jsx(Field, { id: "mail-test-prefix", label: t("documentDesigner.mail.testMail.prefixSubject"), layout: "inline", children: _jsx(Input, { kind: "boolean", id: "mail-test-prefix", name: "mail-test-prefix", value: testMail.prefixSubject, onChange: testMail.onPrefixSubject }) }), hasAttachments ? (_jsx(Field, { id: "mail-test-attachments", label: t("documentDesigner.mail.testMail.attachments"), layout: "inline", children: _jsx(Input, { kind: "boolean", id: "mail-test-attachments", name: "mail-test-attachments", value: testMail.includeAttachments, onChange: testMail.onIncludeAttachments }) })) : (_jsx(Text, { variant: "muted", testId: "mail-test-no-attachments", children: t("documentDesigner.mail.testMail.noAttachments") })), _jsx(Button, { variant: "secondary", width: "full", disabled: testMail.pending, loading: testMail.pending, onClick: testMail.onSend, testId: "mail-test-send", children: t("documentDesigner.mail.testMail.send") })] }), _jsx(RailHint, { children: t("documentDesigner.mail.testMail.hint") })] }), _jsxs(RailSection, { title: t("documentDesigner.mail.preview.checks"), testId: "mail-preview-checks", children: [(preview?.checks ?? []).map((check) => (_jsx(RailRow, { testId: `mail-check-${check.code}`, symbol: check.ok ? "✓" : "!", label: checkText(t, check, validation), bad: !check.ok }, check.code))), _jsx(RailHint, { children: t("documentDesigner.mail.preview.checksHint") })] })] }));
|
|
80
|
+
return (_jsxs("div", { "data-testid": "mail-preview-side", children: [_jsxs(RailSection, { title: t("documentDesigner.mail.preview.samples"), action: _jsx(RecordPickerLink, { slug: slug, locale: locale, onPick: onPick }), children: [_jsx(SampleValues, { preview: preview, validation: validation, picked: picked, locale: locale }), _jsx(RailHint, { children: t("documentDesigner.mail.preview.samplesHint") })] }), _jsxs(RailSection, { title: t("documentDesigner.mail.testMail.title"), children: [_jsx(TestMailRecipient, { own: own }), _jsxs(RailField, { children: [_jsx(Field, { id: "mail-test-prefix", label: t("documentDesigner.mail.testMail.prefixSubject"), layout: "inline", children: _jsx(Input, { kind: "boolean", id: "mail-test-prefix", name: "mail-test-prefix", value: testMail.prefixSubject, onChange: testMail.onPrefixSubject }) }), hasAttachments ? (_jsx(Field, { id: "mail-test-attachments", label: t("documentDesigner.mail.testMail.attachments"), layout: "inline", children: _jsx(Input, { kind: "boolean", id: "mail-test-attachments", name: "mail-test-attachments", value: testMail.includeAttachments, onChange: testMail.onIncludeAttachments }) })) : (_jsx(Text, { variant: "muted", testId: "mail-test-no-attachments", children: t("documentDesigner.mail.testMail.noAttachments") })), _jsx(Button, { variant: "secondary", width: "full", disabled: testMail.pending, loading: testMail.pending, onClick: testMail.onSend, testId: "mail-test-send", children: t("documentDesigner.mail.testMail.send") })] }), _jsx(RailHint, { children: t("documentDesigner.mail.testMail.hint") })] }), _jsxs(RailSection, { title: t("documentDesigner.mail.preview.checks"), testId: "mail-preview-checks", children: [(preview?.checks ?? []).map((check) => (_jsx(RailRow, { testId: `mail-check-${check.code}`, symbol: check.ok ? "✓" : "!", label: checkText(t, check, validation), bad: !check.ok }, check.code))), _jsx(RailHint, { children: t("documentDesigner.mail.preview.checksHint") })] })] }));
|
|
82
81
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { EditorOrigin } from "./editor-header.tsx";
|
|
3
3
|
import { type TestMailControls } from "./mail-preview-side.tsx";
|
|
4
|
-
import type { MailValidation } from "./mail-types.ts";
|
|
4
|
+
import type { MailValidation, PickedValues } from "./mail-types.ts";
|
|
5
5
|
import type { OwnAddress } from "./use-own-address.ts";
|
|
6
6
|
export type PreviewPayload = {
|
|
7
7
|
readonly slug: string;
|
|
@@ -10,8 +10,11 @@ export type PreviewPayload = {
|
|
|
10
10
|
readonly content: string;
|
|
11
11
|
readonly meta: Readonly<Record<string, unknown>>;
|
|
12
12
|
readonly variableSchema: unknown;
|
|
13
|
+
readonly variables?: PickedValues;
|
|
13
14
|
};
|
|
14
|
-
export declare function MailPreviewMode({ payload, validation, slug, locale, fromName, own, controls, origin, testMail, }: {
|
|
15
|
+
export declare function MailPreviewMode({ payload, validation, slug, locale, fromName, own, controls, origin, testMail, picked, onPick, }: {
|
|
16
|
+
readonly picked: PickedValues | null;
|
|
17
|
+
readonly onPick: (values: PickedValues) => void;
|
|
15
18
|
readonly payload: PreviewPayload;
|
|
16
19
|
readonly validation: MailValidation | null;
|
|
17
20
|
readonly slug: string;
|
package/dist/web/mail-preview.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { TemplateResolverQueries } from "@cosmicdrift/kumiko-bundled-features/template-resolver/web";
|
|
4
4
|
import { dispatcherErrorText, usePrimitives, useQuery, useTranslation, } from "@cosmicdrift/kumiko-renderer";
|
|
5
|
-
import { LoadingState, ModeSwitch } from "@cosmicdrift/kumiko-renderer
|
|
5
|
+
import { LoadingState, ModeSwitch } from "@cosmicdrift/kumiko-renderer/web";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { EditorBody, EditorInfoBar } from "./editor-shell.js";
|
|
8
8
|
import { formatKilobytes } from "./mail-draft.js";
|
|
@@ -37,7 +37,7 @@ function layoutText(t, preview) {
|
|
|
37
37
|
? t("documentDesigner.mail.preview.barPlain")
|
|
38
38
|
: t("documentDesigner.mail.preview.bar", { version: preview.mailLayout.version });
|
|
39
39
|
}
|
|
40
|
-
export function MailPreviewMode({ payload, validation, slug, locale, fromName, own, controls, origin, testMail, }) {
|
|
40
|
+
export function MailPreviewMode({ payload, validation, slug, locale, fromName, own, controls, origin, testMail, picked, onPick, }) {
|
|
41
41
|
const t = useTranslation();
|
|
42
42
|
const { Banner } = usePrimitives();
|
|
43
43
|
const [format, setFormat] = useState("html");
|
|
@@ -50,5 +50,5 @@ export function MailPreviewMode({ payload, validation, slug, locale, fromName, o
|
|
|
50
50
|
] }), _jsx(ModeSwitch, { value: width, onChange: setWidth, ariaLabel: t("documentDesigner.mail.preview.widthSwitch"), testId: "mail-preview-width", options: [
|
|
51
51
|
{ value: "desktop", label: t("documentDesigner.mail.preview.desktop") },
|
|
52
52
|
{ value: "mobile", label: t("documentDesigner.mail.preview.mobile") },
|
|
53
|
-
] })] }), children: layoutText(t, preview) }), _jsx(EditorBody, { testId: "mail-editor-preview", center: _jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-3 overflow-auto px-8 py-6", children: [query.error !== null && (_jsx(Banner, { variant: "error", testId: "mail-preview-error", children: dispatcherErrorText(query.error, t) })), preview === null ? (query.error === null && _jsx(LoadingState, {})) : (_jsx(MailFrame, { preview: preview, format: format, width: width, fromName: fromName, recipient: recipientOf(preview, own) }))] }), right: _jsx(PreviewSide, { preview: preview, validation: validation, slug: slug, locale: locale, own: own, testMail: testMail }) })] }));
|
|
53
|
+
] })] }), children: layoutText(t, preview) }), _jsx(EditorBody, { testId: "mail-editor-preview", center: _jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-3 overflow-auto px-8 py-6", children: [query.error !== null && (_jsx(Banner, { variant: "error", testId: "mail-preview-error", children: dispatcherErrorText(query.error, t) })), preview === null ? (query.error === null && _jsx(LoadingState, {})) : (_jsx(MailFrame, { preview: preview, format: format, width: width, fromName: fromName, recipient: recipientOf(preview, own) }))] }), right: _jsx(PreviewSide, { preview: preview, validation: validation, slug: slug, locale: locale, own: own, testMail: testMail, picked: picked, onPick: onPick }) })] }));
|
|
54
54
|
}
|
package/dist/web/mail-types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { EMPTY_VALUE_PLACEHOLDER } from "@cosmicdrift/kumiko-headless";
|
|
3
2
|
// @runtime client
|
|
4
3
|
import { formatWhen, useAppFeatures, useQuery, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
5
|
-
import {
|
|
4
|
+
import { EMPTY_VALUE_PLACEHOLDER } from "@cosmicdrift/kumiko-renderer/headless";
|
|
5
|
+
import { StatusBadge } from "@cosmicdrift/kumiko-renderer/web";
|
|
6
6
|
import { RailHint, RailRow, RailSection } from "./rail.js";
|
|
7
7
|
import { asRowStatus, statusLabel, statusTone } from "./status-label.js";
|
|
8
8
|
const AUDIT_FEATURE = "audit";
|
package/dist/web/origin-bar.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { TemplateResolverHandlers, TemplateResolverQueries, } from "@cosmicdrift/kumiko-bundled-features/template-resolver/web";
|
|
4
|
-
import { EMPTY_VALUE_PLACEHOLDER } from "@cosmicdrift/kumiko-headless";
|
|
5
4
|
import { dispatcherErrorText, useMutation, usePrimitives, useQuery, useTranslation, } from "@cosmicdrift/kumiko-renderer";
|
|
6
|
-
import {
|
|
5
|
+
import { EMPTY_VALUE_PLACEHOLDER } from "@cosmicdrift/kumiko-renderer/headless";
|
|
6
|
+
import { EmptyState, ErrorState, LoadingState } from "@cosmicdrift/kumiko-renderer/web";
|
|
7
7
|
import { useState } from "react";
|
|
8
8
|
import { originOf } from "./editor-header.js";
|
|
9
9
|
import { EditorInfoBar } from "./editor-shell.js";
|
|
@@ -2,7 +2,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { TemplateResolverQueries } from "@cosmicdrift/kumiko-bundled-features/template-resolver/web";
|
|
4
4
|
import { formatWhen, usePrimitives, useQuery, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
5
|
-
import { Drawer, EmptyState, LoadingState } from "@cosmicdrift/kumiko-renderer
|
|
5
|
+
import { Drawer, EmptyState, LoadingState } from "@cosmicdrift/kumiko-renderer/web";
|
|
6
6
|
import { useMemo, useState } from "react";
|
|
7
7
|
import { DiffView } from "./origin-bar.js";
|
|
8
8
|
import { DOCUMENT_PDF_KIND, } from "./types.js";
|
package/dist/web/page-canvas.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { DocumentContentEditor, PDF_DEFAULT_MARGIN_MM, PDF_DOCUMENT_BLOCKS, PDF_FOOTER_MARGIN_MM, } from "@cosmicdrift/kumiko-bundled-features/template-resolver/web";
|
|
4
4
|
import { useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
5
|
-
import { cn } from "@cosmicdrift/kumiko-renderer
|
|
5
|
+
import { cn } from "@cosmicdrift/kumiko-renderer/web";
|
|
6
6
|
import { useCallback } from "react";
|
|
7
7
|
import { LayoutHtml } from "./layout-html.js";
|
|
8
8
|
import { MARGIN_SIDES } from "./pdf-meta.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
4
|
-
import { UploadZone } from "@cosmicdrift/kumiko-renderer
|
|
4
|
+
import { UploadZone } from "@cosmicdrift/kumiko-renderer/web";
|
|
5
5
|
import { RailField, RailHint, RailRow, RailSection } from "./rail.js";
|
|
6
6
|
// unsubscribeUrl belongs to mail; the PDF designer never offers it.
|
|
7
7
|
const HIDDEN_SYSTEM_PLACEHOLDERS = new Set(["unsubscribeUrl"]);
|
|
@@ -2,8 +2,8 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { TemplateResolverHandlers, TemplateResolverQueries, } from "@cosmicdrift/kumiko-bundled-features/template-resolver/web";
|
|
4
4
|
import { useDispatcher, usePrimitives, useQuery, useTranslation, useUserRoles, } from "@cosmicdrift/kumiko-renderer";
|
|
5
|
+
import { ErrorState, LoadingState, uploadFileRef } from "@cosmicdrift/kumiko-renderer/web";
|
|
5
6
|
import { RendererPuppeteerClientQueries } from "@cosmicdrift/kumiko-renderer-puppeteer-client/qualified-names";
|
|
6
|
-
import { ErrorState, LoadingState, uploadFileRef } from "@cosmicdrift/kumiko-renderer-web";
|
|
7
7
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
8
8
|
import { BRANDING_QUERY_QN } from "../constants.js";
|
|
9
9
|
import { EditorHeader, EditorLocaleSwitch, EditorModeSwitch, originOf, } from "./editor-header.js";
|
package/dist/web/rail.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// @runtime client
|
|
3
|
-
import { cn } from "@cosmicdrift/kumiko-renderer
|
|
3
|
+
import { cn } from "@cosmicdrift/kumiko-renderer/web";
|
|
4
4
|
export function RailSection({ title, action, testId, children, }) {
|
|
5
5
|
return (_jsxs("section", { className: "flex flex-col border-b pb-1", "data-testid": testId, children: [_jsxs("div", { className: "flex items-center gap-2 px-3.5 pt-2.5 pb-1", children: [_jsx("span", { className: "text-xs font-medium uppercase tracking-wider text-muted-foreground", children: title }), _jsx("div", { className: "grow" }), action] }), children] }));
|
|
6
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StatusBadgeTone } from "@cosmicdrift/kumiko-renderer
|
|
1
|
+
import type { StatusBadgeTone } from "@cosmicdrift/kumiko-renderer/web";
|
|
2
2
|
import type { OverviewRowView } from "./overview-row.ts";
|
|
3
3
|
type Translate = (key: string, params?: Readonly<Record<string, unknown>>) => string;
|
|
4
4
|
export declare function statusTone(status: OverviewRowView["status"]): StatusBadgeTone;
|
package/dist/web/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldIssue } from "@cosmicdrift/kumiko-headless";
|
|
1
|
+
import type { FieldIssue } from "@cosmicdrift/kumiko-renderer/headless";
|
|
2
2
|
import type { TemplateDiff } from "./layout-types.ts";
|
|
3
3
|
export type TemplateScope = "system" | "tenant";
|
|
4
4
|
export type TemplateStatus = "draft" | "active" | "archived";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EMPTY_VALUE_PLACEHOLDER } from "@cosmicdrift/kumiko-headless";
|
|
1
|
+
import { EMPTY_VALUE_PLACEHOLDER } from "@cosmicdrift/kumiko-renderer/headless";
|
|
2
2
|
// @runtime client
|
|
3
3
|
import { DEFAULT_LAYOUT_SLUG } from "../constants.js";
|
|
4
4
|
// t() returns the key itself when no translation exists.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-document-designer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.377.0",
|
|
4
4
|
"description": "Document designer for Kumiko: template overview, layout editor (mail layout, PDF letterhead) and the PDF template editor.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -19,13 +19,11 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@cosmicdrift/kumiko-bundled-features": "0.
|
|
23
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
24
|
-
"@cosmicdrift/kumiko-
|
|
25
|
-
"@cosmicdrift/kumiko-renderer": "0.
|
|
26
|
-
"@cosmicdrift/kumiko-
|
|
27
|
-
"@cosmicdrift/kumiko-renderer-web": "0.373.0",
|
|
28
|
-
"@cosmicdrift/kumiko-types": "0.373.0",
|
|
22
|
+
"@cosmicdrift/kumiko-bundled-features": "0.377.0",
|
|
23
|
+
"@cosmicdrift/kumiko-framework": "0.377.0",
|
|
24
|
+
"@cosmicdrift/kumiko-renderer": "0.377.0",
|
|
25
|
+
"@cosmicdrift/kumiko-renderer-puppeteer-client": "0.377.0",
|
|
26
|
+
"@cosmicdrift/kumiko-types": "0.377.0",
|
|
29
27
|
"pdfjs-dist": "6.3.289",
|
|
30
28
|
"react": "^19.2.6"
|
|
31
29
|
},
|