admin-lib-cms 1.2.0 → 1.2.2

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.
@@ -0,0 +1,10 @@
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined") return require.apply(this, arguments);
5
+ throw Error('Dynamic require of "' + x + '" is not supported');
6
+ });
7
+
8
+ export {
9
+ __require
10
+ };
package/dist/index.d.mts CHANGED
@@ -55,8 +55,9 @@ interface EditableTextProps extends BaseProps {
55
55
  children: string;
56
56
  as?: "span" | "p" | "h1" | "h2" | "h3" | "h4" | "div";
57
57
  className?: string;
58
+ type?: "text" | "textarea" | "richtext";
58
59
  }
59
- declare function EditableText({ id, label, section, pageId, children, as, className, }: EditableTextProps): react.ReactElement<any, string | react.JSXElementConstructor<any>>;
60
+ declare function EditableText({ id, label, section, pageId, children, as, className, type, }: EditableTextProps): react.ReactElement<any, string | react.JSXElementConstructor<any>>;
60
61
  interface EditableImageProps extends BaseProps {
61
62
  src: string;
62
63
  alt?: string;
@@ -86,15 +87,24 @@ interface EditableListProps<T = any> extends BaseProps {
86
87
  renderList?: (items: T[]) => React.ReactNode;
87
88
  itemSchema?: {
88
89
  key: string;
89
- type: "text" | "textarea" | "boolean" | "icon" | "image" | "number";
90
+ type: "text" | "textarea" | "boolean" | "icon" | "image" | "file" | "number" | "select";
90
91
  label?: string;
91
92
  options?: string[];
92
93
  }[];
93
94
  fixedLength?: boolean;
94
95
  className?: string;
95
96
  listClassName?: string;
97
+ search?: boolean;
96
98
  }
97
- declare function EditableList<T = any>({ id, label, section, pageId, initialItems, renderItem, renderList, itemSchema, fixedLength, className, listClassName, }: EditableListProps<T>): react.JSX.Element;
99
+ declare function EditableList<T = any>({ id, label, section, pageId, initialItems, renderItem, renderList, itemSchema, fixedLength, className, listClassName, search, }: EditableListProps<T>): react.JSX.Element;
100
+ interface EditableReferenceProps extends BaseProps {
101
+ collection: string;
102
+ max?: number;
103
+ displayField?: string;
104
+ className?: string;
105
+ children?: React.ReactNode | ((items: any[]) => React.ReactNode);
106
+ }
107
+ declare function EditableReference({ id, label, section, pageId, collection, max, displayField, className, children, }: EditableReferenceProps): react.JSX.Element;
98
108
 
99
109
  declare function AdminApp({ apiUrl, projectId, email }: {
100
110
  apiUrl?: string;
@@ -141,4 +151,4 @@ declare function SubscriptionProvider({ children, apiUrl, projectId, email, vali
141
151
 
142
152
  declare function SubscriptionPage(): react.JSX.Element;
143
153
 
144
- export { AdminApp, AdminLogin, type AdminLoginProps, CmsConfig, CmsProvider, EditableFile, EditableImage, EditableLink, EditableList, EditableMeta, EditableText, OverridesMap, StorageAdapter, type SubscriptionContextValue, type SubscriptionData, SubscriptionPage, SubscriptionProvider, useCmsContext, useCmsOptional, useSubmit, useSubscription, useSubscriptionContext };
154
+ export { AdminApp, AdminLogin, type AdminLoginProps, CmsConfig, CmsProvider, EditableFile, EditableImage, EditableLink, EditableList, EditableMeta, EditableReference, EditableText, OverridesMap, StorageAdapter, type SubscriptionContextValue, type SubscriptionData, SubscriptionPage, SubscriptionProvider, useCmsContext, useCmsOptional, useSubmit, useSubscription, useSubscriptionContext };
package/dist/index.d.ts CHANGED
@@ -55,8 +55,9 @@ interface EditableTextProps extends BaseProps {
55
55
  children: string;
56
56
  as?: "span" | "p" | "h1" | "h2" | "h3" | "h4" | "div";
57
57
  className?: string;
58
+ type?: "text" | "textarea" | "richtext";
58
59
  }
59
- declare function EditableText({ id, label, section, pageId, children, as, className, }: EditableTextProps): react.ReactElement<any, string | react.JSXElementConstructor<any>>;
60
+ declare function EditableText({ id, label, section, pageId, children, as, className, type, }: EditableTextProps): react.ReactElement<any, string | react.JSXElementConstructor<any>>;
60
61
  interface EditableImageProps extends BaseProps {
61
62
  src: string;
62
63
  alt?: string;
@@ -86,15 +87,24 @@ interface EditableListProps<T = any> extends BaseProps {
86
87
  renderList?: (items: T[]) => React.ReactNode;
87
88
  itemSchema?: {
88
89
  key: string;
89
- type: "text" | "textarea" | "boolean" | "icon" | "image" | "number";
90
+ type: "text" | "textarea" | "boolean" | "icon" | "image" | "file" | "number" | "select";
90
91
  label?: string;
91
92
  options?: string[];
92
93
  }[];
93
94
  fixedLength?: boolean;
94
95
  className?: string;
95
96
  listClassName?: string;
97
+ search?: boolean;
96
98
  }
97
- declare function EditableList<T = any>({ id, label, section, pageId, initialItems, renderItem, renderList, itemSchema, fixedLength, className, listClassName, }: EditableListProps<T>): react.JSX.Element;
99
+ declare function EditableList<T = any>({ id, label, section, pageId, initialItems, renderItem, renderList, itemSchema, fixedLength, className, listClassName, search, }: EditableListProps<T>): react.JSX.Element;
100
+ interface EditableReferenceProps extends BaseProps {
101
+ collection: string;
102
+ max?: number;
103
+ displayField?: string;
104
+ className?: string;
105
+ children?: React.ReactNode | ((items: any[]) => React.ReactNode);
106
+ }
107
+ declare function EditableReference({ id, label, section, pageId, collection, max, displayField, className, children, }: EditableReferenceProps): react.JSX.Element;
98
108
 
99
109
  declare function AdminApp({ apiUrl, projectId, email }: {
100
110
  apiUrl?: string;
@@ -141,4 +151,4 @@ declare function SubscriptionProvider({ children, apiUrl, projectId, email, vali
141
151
 
142
152
  declare function SubscriptionPage(): react.JSX.Element;
143
153
 
144
- export { AdminApp, AdminLogin, type AdminLoginProps, CmsConfig, CmsProvider, EditableFile, EditableImage, EditableLink, EditableList, EditableMeta, EditableText, OverridesMap, StorageAdapter, type SubscriptionContextValue, type SubscriptionData, SubscriptionPage, SubscriptionProvider, useCmsContext, useCmsOptional, useSubmit, useSubscription, useSubscriptionContext };
154
+ export { AdminApp, AdminLogin, type AdminLoginProps, CmsConfig, CmsProvider, EditableFile, EditableImage, EditableLink, EditableList, EditableMeta, EditableReference, EditableText, OverridesMap, StorageAdapter, type SubscriptionContextValue, type SubscriptionData, SubscriptionPage, SubscriptionProvider, useCmsContext, useCmsOptional, useSubmit, useSubscription, useSubscriptionContext };