uhuu-components 0.3.0 → 0.3.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/index.d.ts CHANGED
@@ -469,6 +469,35 @@ export interface InteractiveModeContextValue {
469
469
  interactive: boolean;
470
470
  setInteractive: (interactive: boolean) => void;
471
471
  enableDevTools?: boolean;
472
+ /** The shell's resolved interface language (`de`, `fr`, `it`, `en`, or what the template passed). */
473
+ locale: string;
474
+ }
475
+
476
+ /**
477
+ * A label as one string, or one string per language: `{ en: 'Cover', de: 'Titelseite' }`.
478
+ * Accepted wherever `templateConfig` and `pageOptions` take a `label` (pages, groups, options,
479
+ * select and colour values) and by `reorderTitle` / `reorderDescription`. Resolved in the shell's
480
+ * language, then English, then the first entry.
481
+ */
482
+ export type LocalizedText = string | Record<string, string>;
483
+
484
+ /** Editor shell words, nested as in the English catalog (docs/editor-shell-translations.md). */
485
+ export type EditorShellTranslations = { [key: string]: string | EditorShellTranslations };
486
+
487
+ export interface InteractiveModeProviderProps {
488
+ children: ReactNode;
489
+ defaultInteractive?: boolean;
490
+ enableDevTools?: boolean;
491
+ /**
492
+ * The shell's interface language. Default: the host's (uhuu-app's locale from the SDK
493
+ * handshake), then `?lang=`, `<html lang>`, the browser's languages, then `en`.
494
+ */
495
+ locale?: string;
496
+ /**
497
+ * Per-language overrides of the shell's words, or a whole catalog for a language the package
498
+ * does not ship: `{ de: { toolbar: { add: 'Neu' } }, rm: romanshCatalog }`. Pass a stable object.
499
+ */
500
+ translations?: Record<string, EditorShellTranslations>;
472
501
  }
473
502
 
474
503
  export interface BrandKitOption {
@@ -535,8 +564,8 @@ export interface PageEditorProps {
535
564
  pageId?: string;
536
565
  parent?: unknown;
537
566
  }) => ReactNode;
538
- reorderTitle?: string;
539
- reorderDescription?: string;
567
+ reorderTitle?: LocalizedText;
568
+ reorderDescription?: LocalizedText;
540
569
  stateKey?: string;
541
570
  brandKits?: BrandKitOption[];
542
571
  activeBrandKitId?: string;
@@ -570,11 +599,7 @@ export interface IntegrationAdapter {
570
599
  export const EditorShell: {
571
600
  TemplateDataProvider: ComponentType<TemplateDataProviderProps>;
572
601
  PageEditor: ComponentType<PageEditorProps>;
573
- InteractiveModeProvider: ComponentType<{
574
- children: ReactNode;
575
- defaultInteractive?: boolean;
576
- enableDevTools?: boolean;
577
- }>;
602
+ InteractiveModeProvider: ComponentType<InteractiveModeProviderProps>;
578
603
  useInteractive: () => InteractiveModeContextValue;
579
604
  useIntegrationAdapter: (config: IntegrationAdapterConfig) => IntegrationAdapter;
580
605
  };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.0",
2
+ "version": "0.3.1",
3
3
  "name": "uhuu-components",
4
4
  "main": "uhuu-components.umd.cjs",
5
5
  "module": "uhuu-components.es.js",
@@ -15,6 +15,15 @@
15
15
  }
16
16
  },
17
17
  "license": "https://uhuu.io/license",
18
+ "files": [
19
+ "uhuu-components.es.js",
20
+ "uhuu-components.es.js.map",
21
+ "uhuu-components.umd.cjs",
22
+ "uhuu-components.umd.cjs.map",
23
+ "index.d.ts",
24
+ "README.md",
25
+ "CHANGELOG.md"
26
+ ],
18
27
  "peerDependencies": {
19
28
  "react": "^18.0.0 || ^19.0.0",
20
29
  "react-dom": "^18.0.0 || ^19.0.0"