@tecof/theme-editor 0.0.27 → 0.0.28

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/index.d.mts CHANGED
@@ -111,6 +111,8 @@ interface TecofRenderProps {
111
111
  config: any;
112
112
  /** Additional class name */
113
113
  className?: string;
114
+ /** Raw CMS item data (only present for CMS template pages) */
115
+ cmsData?: Record<string, any> | null;
114
116
  }
115
117
  interface MerchantInfoData {
116
118
  /** Available language codes (e.g. ["tr", "en", "de"]) */
@@ -250,9 +252,12 @@ declare const TecofEditor: ({ pageId, config, accessToken, onSave, onChange, ove
250
252
  * TecofRender — Puck page renderer.
251
253
  *
252
254
  * Pass `data` (PuckPageData) and `config` (Puck Config) directly.
255
+ * Optionally pass `cmsData` to make CMS item data available to all
256
+ * Puck components via `puck.metadata.cmsData`.
257
+ *
253
258
  * No API fetch, no provider required.
254
259
  */
255
- declare const TecofRender: ({ data, config, className }: TecofRenderProps) => react_jsx_runtime.JSX.Element | null;
260
+ declare const TecofRender: ({ data, config, className, cmsData }: TecofRenderProps) => react_jsx_runtime.JSX.Element | null;
256
261
 
257
262
  type PictureSize = 'thumbnail' | 'medium' | 'large' | 'full';
258
263
  interface TecofPictureProps {
@@ -578,6 +583,43 @@ declare const createColorField: (options?: ColorFieldOptions) => {
578
583
  render: ({ value, onChange, readOnly, field, name, id }: ColorFieldProps) => react_jsx_runtime.JSX.Element;
579
584
  };
580
585
 
586
+ interface RepeaterFieldProps {
587
+ field: any;
588
+ name: string;
589
+ id: string;
590
+ value: Record<string, any>[];
591
+ onChange: (value: Record<string, any>[]) => void;
592
+ readOnly?: boolean;
593
+ }
594
+ interface RepeaterFieldOptions {
595
+ /** Field label displayed in the Puck sidebar */
596
+ label?: string;
597
+ /** Icon displayed next to the label */
598
+ labelIcon?: ReactElement;
599
+ /** Whether this field is visible in the sidebar */
600
+ visible?: boolean;
601
+ /** Sub-fields definition — each key maps to a createXxxField() result */
602
+ subFields: Record<string, any>;
603
+ /** Minimum number of rows */
604
+ minItems?: number;
605
+ /** Maximum number of rows */
606
+ maxItems?: number;
607
+ /** Default values for a new row */
608
+ defaultRow?: Record<string, any>;
609
+ }
610
+ declare const RepeaterField: {
611
+ ({ value: rawValue, onChange, readOnly, subFields, minItems, maxItems, defaultRow, }: RepeaterFieldProps & RepeaterFieldOptions): react_jsx_runtime.JSX.Element;
612
+ displayName: string;
613
+ };
614
+ declare const createRepeaterField: (options: RepeaterFieldOptions) => {
615
+ type: "custom";
616
+ _fieldType: "repeater";
617
+ label: string | undefined;
618
+ labelIcon: ReactElement<unknown, string | react.JSXElementConstructor<any>> | undefined;
619
+ visible: boolean | undefined;
620
+ render: ({ value, onChange, readOnly, field, name, id }: RepeaterFieldProps) => react_jsx_runtime.JSX.Element;
621
+ };
622
+
581
623
  interface FieldErrorBoundaryProps {
582
624
  /** The field name (for error reporting) */
583
625
  fieldName?: string;
@@ -619,4 +661,4 @@ declare function generateCSSVariables(theme: ThemeConfig): string;
619
661
  declare function getDefaultTheme(): ThemeConfig;
620
662
  declare function mergeTheme(base: ThemeConfig, overrides: Partial<ThemeConfig>): ThemeConfig;
621
663
 
622
- export { type ApiResponse, CodeEditorField, ColorField, EditorField, FieldErrorBoundary, type HSL, LanguageField, type LanguageFieldValue, LinkField, type LinkFieldValue, type MerchantInfoData, type PageApiData, type PuckContentItem, type PuckPageData, TecofApiClient, TecofEditor, type TecofEditorProps, TecofPicture, type TecofPictureProps, TecofProvider, type TecofProviderProps, TecofRender, type TecofRenderProps, type ThemeColors, type ThemeConfig, type ThemeSpacing, type ThemeTypography, UploadField, type UploadedFile, createCodeEditorField, createColorField, createEditorField, createLanguageField, createLinkField, createUploadField, darken, generateCSSVariables, getDefaultTheme, hexToHsl, hslToHex, lighten, mergeTheme, useTecof };
664
+ export { type ApiResponse, CodeEditorField, ColorField, EditorField, FieldErrorBoundary, type HSL, LanguageField, type LanguageFieldValue, LinkField, type LinkFieldValue, type MerchantInfoData, type PageApiData, type PuckContentItem, type PuckPageData, RepeaterField, TecofApiClient, TecofEditor, type TecofEditorProps, TecofPicture, type TecofPictureProps, TecofProvider, type TecofProviderProps, TecofRender, type TecofRenderProps, type ThemeColors, type ThemeConfig, type ThemeSpacing, type ThemeTypography, UploadField, type UploadedFile, createCodeEditorField, createColorField, createEditorField, createLanguageField, createLinkField, createRepeaterField, createUploadField, darken, generateCSSVariables, getDefaultTheme, hexToHsl, hslToHex, lighten, mergeTheme, useTecof };
package/dist/index.d.ts CHANGED
@@ -111,6 +111,8 @@ interface TecofRenderProps {
111
111
  config: any;
112
112
  /** Additional class name */
113
113
  className?: string;
114
+ /** Raw CMS item data (only present for CMS template pages) */
115
+ cmsData?: Record<string, any> | null;
114
116
  }
115
117
  interface MerchantInfoData {
116
118
  /** Available language codes (e.g. ["tr", "en", "de"]) */
@@ -250,9 +252,12 @@ declare const TecofEditor: ({ pageId, config, accessToken, onSave, onChange, ove
250
252
  * TecofRender — Puck page renderer.
251
253
  *
252
254
  * Pass `data` (PuckPageData) and `config` (Puck Config) directly.
255
+ * Optionally pass `cmsData` to make CMS item data available to all
256
+ * Puck components via `puck.metadata.cmsData`.
257
+ *
253
258
  * No API fetch, no provider required.
254
259
  */
255
- declare const TecofRender: ({ data, config, className }: TecofRenderProps) => react_jsx_runtime.JSX.Element | null;
260
+ declare const TecofRender: ({ data, config, className, cmsData }: TecofRenderProps) => react_jsx_runtime.JSX.Element | null;
256
261
 
257
262
  type PictureSize = 'thumbnail' | 'medium' | 'large' | 'full';
258
263
  interface TecofPictureProps {
@@ -578,6 +583,43 @@ declare const createColorField: (options?: ColorFieldOptions) => {
578
583
  render: ({ value, onChange, readOnly, field, name, id }: ColorFieldProps) => react_jsx_runtime.JSX.Element;
579
584
  };
580
585
 
586
+ interface RepeaterFieldProps {
587
+ field: any;
588
+ name: string;
589
+ id: string;
590
+ value: Record<string, any>[];
591
+ onChange: (value: Record<string, any>[]) => void;
592
+ readOnly?: boolean;
593
+ }
594
+ interface RepeaterFieldOptions {
595
+ /** Field label displayed in the Puck sidebar */
596
+ label?: string;
597
+ /** Icon displayed next to the label */
598
+ labelIcon?: ReactElement;
599
+ /** Whether this field is visible in the sidebar */
600
+ visible?: boolean;
601
+ /** Sub-fields definition — each key maps to a createXxxField() result */
602
+ subFields: Record<string, any>;
603
+ /** Minimum number of rows */
604
+ minItems?: number;
605
+ /** Maximum number of rows */
606
+ maxItems?: number;
607
+ /** Default values for a new row */
608
+ defaultRow?: Record<string, any>;
609
+ }
610
+ declare const RepeaterField: {
611
+ ({ value: rawValue, onChange, readOnly, subFields, minItems, maxItems, defaultRow, }: RepeaterFieldProps & RepeaterFieldOptions): react_jsx_runtime.JSX.Element;
612
+ displayName: string;
613
+ };
614
+ declare const createRepeaterField: (options: RepeaterFieldOptions) => {
615
+ type: "custom";
616
+ _fieldType: "repeater";
617
+ label: string | undefined;
618
+ labelIcon: ReactElement<unknown, string | react.JSXElementConstructor<any>> | undefined;
619
+ visible: boolean | undefined;
620
+ render: ({ value, onChange, readOnly, field, name, id }: RepeaterFieldProps) => react_jsx_runtime.JSX.Element;
621
+ };
622
+
581
623
  interface FieldErrorBoundaryProps {
582
624
  /** The field name (for error reporting) */
583
625
  fieldName?: string;
@@ -619,4 +661,4 @@ declare function generateCSSVariables(theme: ThemeConfig): string;
619
661
  declare function getDefaultTheme(): ThemeConfig;
620
662
  declare function mergeTheme(base: ThemeConfig, overrides: Partial<ThemeConfig>): ThemeConfig;
621
663
 
622
- export { type ApiResponse, CodeEditorField, ColorField, EditorField, FieldErrorBoundary, type HSL, LanguageField, type LanguageFieldValue, LinkField, type LinkFieldValue, type MerchantInfoData, type PageApiData, type PuckContentItem, type PuckPageData, TecofApiClient, TecofEditor, type TecofEditorProps, TecofPicture, type TecofPictureProps, TecofProvider, type TecofProviderProps, TecofRender, type TecofRenderProps, type ThemeColors, type ThemeConfig, type ThemeSpacing, type ThemeTypography, UploadField, type UploadedFile, createCodeEditorField, createColorField, createEditorField, createLanguageField, createLinkField, createUploadField, darken, generateCSSVariables, getDefaultTheme, hexToHsl, hslToHex, lighten, mergeTheme, useTecof };
664
+ export { type ApiResponse, CodeEditorField, ColorField, EditorField, FieldErrorBoundary, type HSL, LanguageField, type LanguageFieldValue, LinkField, type LinkFieldValue, type MerchantInfoData, type PageApiData, type PuckContentItem, type PuckPageData, RepeaterField, TecofApiClient, TecofEditor, type TecofEditorProps, TecofPicture, type TecofPictureProps, TecofProvider, type TecofProviderProps, TecofRender, type TecofRenderProps, type ThemeColors, type ThemeConfig, type ThemeSpacing, type ThemeTypography, UploadField, type UploadedFile, createCodeEditorField, createColorField, createEditorField, createLanguageField, createLinkField, createRepeaterField, createUploadField, darken, generateCSSVariables, getDefaultTheme, hexToHsl, hslToHex, lighten, mergeTheme, useTecof };