@cosmicdrift/kumiko-document-designer 0.403.0 → 0.404.1

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/README.md CHANGED
@@ -12,9 +12,7 @@ createTemplateResolverFeature();
12
12
  createDocumentDesignerFeature();
13
13
 
14
14
  createKumikoApp({
15
- clientFeatures: [
16
- documentDesignerClient({ appLocales: ["de", "en"] }),
17
- ],
15
+ clientFeatures: [documentDesignerClient({ appLocales: ["de", "en"] })],
18
16
  });
19
17
  ```
20
18
 
package/dist/web/cells.js CHANGED
@@ -28,6 +28,7 @@ export function OriginCell({ row }) {
28
28
  return withRow(row, (r) => (_jsx(StatusBadge, { tone: r.origin === "tenant" ? "accent" : "muted", testId: "document-designer-origin", children: t(r.origin === "tenant" ? "documentDesigner.source.tenant" : "documentDesigner.source.system") })));
29
29
  }
30
30
  export function createLocalesCell(appLocales) {
31
+ // biome-ignore lint/correctness/noComponentHookFactories: setup-time factory, called once per documentDesignerClient(); the column-renderer slot only passes row props, so appLocales is bound here
31
32
  return function LocalesCell({ row }) {
32
33
  return withRow(row, (r) => {
33
34
  if (r.kind === "mail-layout" || r.kind === "pdf-layout")
@@ -16,12 +16,11 @@ function LayoutEditorScreen() {
16
16
  function PlatformLayoutEditorScreen() {
17
17
  return (_jsx(Suspense, { fallback: _jsx(LoadingState, {}), children: _jsx(LazyLayoutEditor, { scope: "system" }) }));
18
18
  }
19
- function createLazyMailEditor(appLocales) {
20
- const LazyMailEditor = lazy(() => import("./mail-editor.js").then((module) => ({
21
- default: module.createMailEditor(appLocales),
22
- })));
19
+ const LazyMailEditor = lazy(() => import("./mail-editor.js").then((module) => ({ default: module.MailEditor })));
20
+ function createMailEditorScreen(appLocales) {
21
+ // biome-ignore lint/correctness/noComponentHookFactories: setup-time factory, called once per documentDesignerClient(); custom screens receive no props, so appLocales is bound here
23
22
  return function MailEditorScreen() {
24
- return (_jsx(Suspense, { fallback: _jsx(LoadingState, {}), children: _jsx(LazyMailEditor, {}) }));
23
+ return (_jsx(Suspense, { fallback: _jsx(LoadingState, {}), children: _jsx(LazyMailEditor, { appLocales: appLocales }) }));
25
24
  };
26
25
  }
27
26
  /**
@@ -52,7 +51,7 @@ export function documentDesignerClient(options = {}) {
52
51
  [LAYOUT_EDITOR_SCREEN_ID]: LayoutEditorScreen,
53
52
  [PLATFORM_LAYOUT_EDITOR_SCREEN_ID]: PlatformLayoutEditorScreen,
54
53
  [PDF_TEMPLATE_EDITOR_SCREEN_ID]: PdfTemplateEditorScreen,
55
- [MAIL_EDITOR_SCREEN_ID]: createLazyMailEditor(options.appLocales ?? DEFAULT_TEMPLATE_LOCALES),
54
+ [MAIL_EDITOR_SCREEN_ID]: createMailEditorScreen(options.appLocales ?? DEFAULT_TEMPLATE_LOCALES),
56
55
  },
57
56
  translations: mergeTranslations(mergeTranslations(textBlocksClient().translations ?? {}, documentDesignerTranslations), translationsByLocaleFromKeys(DOCUMENT_DESIGNER_I18N)),
58
57
  };
@@ -1,2 +1,4 @@
1
- import { type ComponentType } from "react";
2
- export declare function createMailEditor(appLocales: readonly string[]): ComponentType;
1
+ import { type ReactNode } from "react";
2
+ export declare function MailEditor({ appLocales }: {
3
+ readonly appLocales: readonly string[];
4
+ }): ReactNode;
@@ -43,7 +43,7 @@ function MailEditorData({ slug, locale, locales, overviewRow, isSystemAdmin, onL
43
43
  await stored.refetch();
44
44
  } }, `${locale}|${generation}|${row?.id ?? "none"}`));
45
45
  }
46
- function MailEditorEntry({ appLocales }) {
46
+ export function MailEditor({ appLocales }) {
47
47
  const nav = useNav();
48
48
  const roles = useUserRoles();
49
49
  const uiLocale = useLocale().locale();
@@ -58,8 +58,3 @@ function MailEditorEntry({ appLocales }) {
58
58
  const locales = [...new Set([...appLocales, ...rowLocales])];
59
59
  return (_jsx(MailEditorData, { slug: slug, locale: locale, locales: locales, overviewRow: overviewRow, isSystemAdmin: roles?.includes("SystemAdmin") === true, onLocaleChange: setPicked, refreshOverview: overview.refetch }, locale));
60
60
  }
61
- export function createMailEditor(appLocales) {
62
- return function MailEditor() {
63
- return _jsx(MailEditorEntry, { appLocales: appLocales });
64
- };
65
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-document-designer",
3
- "version": "0.403.0",
3
+ "version": "0.404.1",
4
4
  "description": "Document designer for Kumiko: template overview, layout editor (mail layout, PDF letterhead) and the PDF template editor.",
5
5
  "license": "MIT",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -20,16 +20,16 @@
20
20
  "./web/styles.css": "./src/web/styles.css"
21
21
  },
22
22
  "dependencies": {
23
- "@cosmicdrift/kumiko-bundled-features": "0.403.0",
24
- "@cosmicdrift/kumiko-framework": "0.403.0",
25
- "@cosmicdrift/kumiko-renderer": "0.403.0",
26
- "@cosmicdrift/kumiko-renderer-puppeteer-client": "0.403.0",
27
- "@cosmicdrift/kumiko-types": "0.403.0",
28
- "react": "^19.2.6"
23
+ "@cosmicdrift/kumiko-bundled-features": "0.404.1",
24
+ "@cosmicdrift/kumiko-framework": "0.404.1",
25
+ "@cosmicdrift/kumiko-renderer": "0.404.1",
26
+ "@cosmicdrift/kumiko-renderer-puppeteer-client": "0.404.1",
27
+ "@cosmicdrift/kumiko-types": "0.404.1",
28
+ "react": "^19.3.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@testing-library/react": "^16.3.3",
32
- "@types/react": "^19.2.14"
32
+ "@types/react": "^19.3.0"
33
33
  },
34
34
  "repository": {
35
35
  "type": "git",