admin-lib-cms 1.1.5 → 1.1.6
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/chunk-WBQAMGXK.mjs +0 -0
- package/dist/index.d.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +5 -3
- package/dist/index.mjs +6 -3
- package/dist/types.mjs +1 -0
- package/package.json +1 -1
|
File without changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { CmsConfig, StorageAdapter, OverridesMap, EditableMeta } from './types.mjs';
|
|
4
|
+
export { CollectionDef, CollectionEntry, CollectionField, FieldType, GlobalGroup, PageDef, Submission } from './types.mjs';
|
|
4
5
|
export { generateDefaultTemplate, sendEmailNotification } from './emails/index.mjs';
|
|
5
6
|
|
|
6
7
|
interface CmsContextValue {
|
|
@@ -62,11 +63,12 @@ interface EditableImageProps extends BaseProps {
|
|
|
62
63
|
declare function EditableImage({ id, label, section, pageId, src, alt, className, width, height, }: EditableImageProps): react.JSX.Element;
|
|
63
64
|
interface EditableLinkProps extends BaseProps {
|
|
64
65
|
href: string;
|
|
65
|
-
children
|
|
66
|
+
children?: React.ReactNode;
|
|
67
|
+
text?: string;
|
|
66
68
|
className?: string;
|
|
67
69
|
target?: string;
|
|
68
70
|
}
|
|
69
|
-
declare function EditableLink({ id, label, section, pageId, href, children, className, target, }: EditableLinkProps): react.JSX.Element;
|
|
71
|
+
declare function EditableLink({ id, label, section, pageId, href, children, text, className, target, }: EditableLinkProps): react.JSX.Element;
|
|
70
72
|
interface EditableListProps<T = any> extends BaseProps {
|
|
71
73
|
initialItems: T[];
|
|
72
74
|
renderItem?: (item: T, index: number) => React.ReactNode;
|
|
@@ -126,4 +128,4 @@ declare function SubscriptionProvider({ children, apiUrl, projectId, email, }: {
|
|
|
126
128
|
|
|
127
129
|
declare function SubscriptionPage(): react.JSX.Element;
|
|
128
130
|
|
|
129
|
-
export { AdminApp, AdminLogin, type AdminLoginProps, CmsProvider, EditableImage, EditableLink, EditableList, EditableText, type SubscriptionContextValue, type SubscriptionData, SubscriptionPage, SubscriptionProvider, useCmsContext, useCmsOptional, useSubmit, useSubscription, useSubscriptionContext };
|
|
131
|
+
export { AdminApp, AdminLogin, type AdminLoginProps, CmsConfig, CmsProvider, EditableImage, EditableLink, EditableList, EditableMeta, EditableText, OverridesMap, StorageAdapter, type SubscriptionContextValue, type SubscriptionData, SubscriptionPage, SubscriptionProvider, useCmsContext, useCmsOptional, useSubmit, useSubscription, useSubscriptionContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { CmsConfig, StorageAdapter, OverridesMap, EditableMeta } from './types.js';
|
|
4
|
+
export { CollectionDef, CollectionEntry, CollectionField, FieldType, GlobalGroup, PageDef, Submission } from './types.js';
|
|
4
5
|
export { generateDefaultTemplate, sendEmailNotification } from './emails/index.js';
|
|
5
6
|
|
|
6
7
|
interface CmsContextValue {
|
|
@@ -62,11 +63,12 @@ interface EditableImageProps extends BaseProps {
|
|
|
62
63
|
declare function EditableImage({ id, label, section, pageId, src, alt, className, width, height, }: EditableImageProps): react.JSX.Element;
|
|
63
64
|
interface EditableLinkProps extends BaseProps {
|
|
64
65
|
href: string;
|
|
65
|
-
children
|
|
66
|
+
children?: React.ReactNode;
|
|
67
|
+
text?: string;
|
|
66
68
|
className?: string;
|
|
67
69
|
target?: string;
|
|
68
70
|
}
|
|
69
|
-
declare function EditableLink({ id, label, section, pageId, href, children, className, target, }: EditableLinkProps): react.JSX.Element;
|
|
71
|
+
declare function EditableLink({ id, label, section, pageId, href, children, text, className, target, }: EditableLinkProps): react.JSX.Element;
|
|
70
72
|
interface EditableListProps<T = any> extends BaseProps {
|
|
71
73
|
initialItems: T[];
|
|
72
74
|
renderItem?: (item: T, index: number) => React.ReactNode;
|
|
@@ -126,4 +128,4 @@ declare function SubscriptionProvider({ children, apiUrl, projectId, email, }: {
|
|
|
126
128
|
|
|
127
129
|
declare function SubscriptionPage(): react.JSX.Element;
|
|
128
130
|
|
|
129
|
-
export { AdminApp, AdminLogin, type AdminLoginProps, CmsProvider, EditableImage, EditableLink, EditableList, EditableText, type SubscriptionContextValue, type SubscriptionData, SubscriptionPage, SubscriptionProvider, useCmsContext, useCmsOptional, useSubmit, useSubscription, useSubscriptionContext };
|
|
131
|
+
export { AdminApp, AdminLogin, type AdminLoginProps, CmsConfig, CmsProvider, EditableImage, EditableLink, EditableList, EditableMeta, EditableText, OverridesMap, StorageAdapter, type SubscriptionContextValue, type SubscriptionData, SubscriptionPage, SubscriptionProvider, useCmsContext, useCmsOptional, useSubmit, useSubscription, useSubscriptionContext };
|
package/dist/index.js
CHANGED
|
@@ -311,13 +311,15 @@ function EditableLink({
|
|
|
311
311
|
pageId,
|
|
312
312
|
href,
|
|
313
313
|
children,
|
|
314
|
+
text,
|
|
314
315
|
className,
|
|
315
316
|
target
|
|
316
317
|
}) {
|
|
317
|
-
const
|
|
318
|
+
const defaultText = text ?? (typeof children === "string" ? children : "");
|
|
319
|
+
const ctx = useRegister(id, "link", label, section, pageId, { href, text: defaultText });
|
|
318
320
|
const override = ctx?.overrides[id];
|
|
319
321
|
const hrefValue = override?.href ?? href;
|
|
320
|
-
const textValue = override?.text ??
|
|
322
|
+
const textValue = override?.text ?? defaultText;
|
|
321
323
|
const active = !!ctx?.editMode;
|
|
322
324
|
const selected = ctx?.selectedId === id;
|
|
323
325
|
const onClick = (e) => {
|
|
@@ -338,7 +340,7 @@ function EditableLink({
|
|
|
338
340
|
"data-cms-id": id,
|
|
339
341
|
onClick: active ? onClick : void 0,
|
|
340
342
|
className: [className, editableClasses(active, selected)].filter(Boolean).join(" "),
|
|
341
|
-
children: textValue
|
|
343
|
+
children: typeof children !== "undefined" ? children : textValue
|
|
342
344
|
}
|
|
343
345
|
);
|
|
344
346
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "./chunk-WBQAMGXK.mjs";
|
|
2
3
|
import {
|
|
3
4
|
generateDefaultTemplate,
|
|
4
5
|
sendEmailNotification
|
|
@@ -283,13 +284,15 @@ function EditableLink({
|
|
|
283
284
|
pageId,
|
|
284
285
|
href,
|
|
285
286
|
children,
|
|
287
|
+
text,
|
|
286
288
|
className,
|
|
287
289
|
target
|
|
288
290
|
}) {
|
|
289
|
-
const
|
|
291
|
+
const defaultText = text ?? (typeof children === "string" ? children : "");
|
|
292
|
+
const ctx = useRegister(id, "link", label, section, pageId, { href, text: defaultText });
|
|
290
293
|
const override = ctx?.overrides[id];
|
|
291
294
|
const hrefValue = override?.href ?? href;
|
|
292
|
-
const textValue = override?.text ??
|
|
295
|
+
const textValue = override?.text ?? defaultText;
|
|
293
296
|
const active = !!ctx?.editMode;
|
|
294
297
|
const selected = ctx?.selectedId === id;
|
|
295
298
|
const onClick = (e) => {
|
|
@@ -310,7 +313,7 @@ function EditableLink({
|
|
|
310
313
|
"data-cms-id": id,
|
|
311
314
|
onClick: active ? onClick : void 0,
|
|
312
315
|
className: [className, editableClasses(active, selected)].filter(Boolean).join(" "),
|
|
313
|
-
children: textValue
|
|
316
|
+
children: typeof children !== "undefined" ? children : textValue
|
|
314
317
|
}
|
|
315
318
|
);
|
|
316
319
|
}
|
package/dist/types.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./chunk-WBQAMGXK.mjs";
|