@contentful/experiences-sdk-react 1.9.0-dev-20240628T2230-7a4f71f.0 → 1.9.0-dev-20240628T2235-7a4f71f.0
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/package.json +6 -6
- package/dist/ExperienceRoot.js +0 -25
- package/dist/ExperienceRoot.js.map +0 -1
- package/dist/blocks/editor/VisualEditorInjectScript.js +0 -38
- package/dist/blocks/editor/VisualEditorInjectScript.js.map +0 -1
- package/dist/blocks/editor/VisualEditorLoader.js +0 -28
- package/dist/blocks/editor/VisualEditorLoader.js.map +0 -1
- package/dist/blocks/editor/VisualEditorRoot.js +0 -17
- package/dist/blocks/editor/VisualEditorRoot.js.map +0 -1
- package/dist/blocks/preview/CompositionBlock.js +0 -132
- package/dist/blocks/preview/CompositionBlock.js.map +0 -1
- package/dist/blocks/preview/PreviewDeliveryRoot.js +0 -23
- package/dist/blocks/preview/PreviewDeliveryRoot.js.map +0 -1
- package/dist/components/Assembly.js +0 -13
- package/dist/components/Assembly.js.map +0 -1
- package/dist/components/ErrorBoundary.js +0 -37
- package/dist/components/ErrorBoundary.js.map +0 -1
- package/dist/constants.js +0 -5
- package/dist/constants.js.map +0 -1
- package/dist/core/componentRegistry.js +0 -292
- package/dist/core/componentRegistry.js.map +0 -1
- package/dist/core/preview/assemblyUtils.js +0 -71
- package/dist/core/preview/assemblyUtils.js.map +0 -1
- package/dist/core/sdkFeatures.js +0 -7
- package/dist/core/sdkFeatures.js.map +0 -1
- package/dist/hooks/useBreakpoints.js +0 -40
- package/dist/hooks/useBreakpoints.js.map +0 -1
- package/dist/hooks/useClassName.js +0 -42
- package/dist/hooks/useClassName.js.map +0 -1
- package/dist/hooks/useDetectEditorMode.js +0 -60
- package/dist/hooks/useDetectEditorMode.js.map +0 -1
- package/dist/hooks/useFetchByBase.js +0 -38
- package/dist/hooks/useFetchByBase.js.map +0 -1
- package/dist/hooks/useFetchById.js +0 -16
- package/dist/hooks/useFetchById.js.map +0 -1
- package/dist/hooks/useFetchBySlug.js +0 -16
- package/dist/hooks/useFetchBySlug.js.map +0 -1
- package/dist/hooks/useInitializeVisualEditor.js +0 -56
- package/dist/hooks/useInitializeVisualEditor.js.map +0 -1
- package/dist/index.d.ts +0 -67
- package/dist/index.js +0 -16
- package/dist/index.js.map +0 -1
- package/dist/sdkVersion.js +0 -4
- package/dist/sdkVersion.js.map +0 -1
- package/dist/src/ExperienceRoot.d.ts +0 -10
- package/dist/src/blocks/editor/VisualEditorInjectScript.d.ts +0 -4
- package/dist/src/blocks/editor/VisualEditorLoader.d.ts +0 -9
- package/dist/src/blocks/editor/VisualEditorRoot.d.ts +0 -10
- package/dist/src/blocks/preview/CompositionBlock.d.ts +0 -11
- package/dist/src/blocks/preview/CompositionBlock.spec.d.ts +0 -1
- package/dist/src/blocks/preview/PreviewDeliveryRoot.d.ts +0 -8
- package/dist/src/blocks/preview/PreviewDeliveryRoot.test.d.ts +0 -1
- package/dist/src/components/Assembly.d.ts +0 -3
- package/dist/src/components/ErrorBoundary.d.ts +0 -19
- package/dist/src/components/Flex.d.ts +0 -64
- package/dist/src/constants.d.ts +0 -3
- package/dist/src/core/componentRegistry.d.ts +0 -32
- package/dist/src/core/componentRegistry.test.d.ts +0 -1
- package/dist/src/core/index.d.ts +0 -1
- package/dist/src/core/preview/assemblyUtils.d.ts +0 -10
- package/dist/src/core/preview/assemblyUtils.spec.d.ts +0 -1
- package/dist/src/core/sdkFeatures.d.ts +0 -1
- package/dist/src/hooks/index.d.ts +0 -3
- package/dist/src/hooks/useBreakpoints.d.ts +0 -4
- package/dist/src/hooks/useBreakpoints.spec.d.ts +0 -1
- package/dist/src/hooks/useClassName.d.ts +0 -13
- package/dist/src/hooks/useClassName.spec.d.ts +0 -1
- package/dist/src/hooks/useDetectEditorMode.d.ts +0 -7
- package/dist/src/hooks/useFetchByBase.d.ts +0 -8
- package/dist/src/hooks/useFetchById.d.ts +0 -17
- package/dist/src/hooks/useFetchById.spec.d.ts +0 -1
- package/dist/src/hooks/useFetchBySlug.d.ts +0 -18
- package/dist/src/hooks/useFetchBySlug.spec.d.ts +0 -1
- package/dist/src/hooks/useInitializeVisualEditor.d.ts +0 -7
- package/dist/src/hooks/usePrevious.d.ts +0 -6
- package/dist/src/index.d.ts +0 -7
- package/dist/src/sdkVersion.d.ts +0 -1
- package/dist/src/utils/withComponentWrapper.d.ts +0 -22
- package/dist/src/utils/withComponentWrapper.spec.d.ts +0 -1
- package/dist/styles/ErrorBoundary.css.js +0 -7
- package/dist/styles/ErrorBoundary.css.js.map +0 -1
- package/dist/test/__fixtures__/assembly.d.ts +0 -96
- package/dist/test/__fixtures__/composition.d.ts +0 -7
- package/dist/test/__fixtures__/entities.d.ts +0 -9
- package/dist/test/components/Test.d.ts +0 -1
- package/dist/test/components/Test.spec.d.ts +0 -1
- package/dist/utils/withComponentWrapper.js +0 -32
- package/dist/utils/withComponentWrapper.js.map +0 -1
- package/dist/vite.config.d.ts +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchByBase.js","sources":["../../../src/hooks/useFetchByBase.ts"],"sourcesContent":["'use client';\nimport { useEffect, useState } from 'react';\nimport { EntityStore } from '@contentful/experiences-core';\nimport type { Experience } from '@contentful/experiences-core/types';\n\nexport const useFetchByBase = (\n fetchMethod: () => Promise<Experience<EntityStore> | undefined>,\n isEditorMode: boolean,\n) => {\n const [experience, setExperience] = useState<Experience<EntityStore>>();\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error>();\n\n useEffect(() => {\n (async () => {\n // if we are in editor mode, we don't want to fetch the experience here\n // it is passed via postMessage instead\n if (isEditorMode) {\n return;\n }\n setIsLoading(true);\n setError(undefined);\n try {\n const exp = await fetchMethod();\n setExperience(exp);\n } catch (error) {\n setError(error as Error);\n } finally {\n setIsLoading(false);\n }\n })();\n }, [fetchMethod, isEditorMode]);\n\n return {\n error,\n experience,\n isLoading,\n isEditorMode,\n };\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAsBM;AACE;;;;;;;;;;AAQN;;;;;;;AAQF;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
import { useFetchByBase } from './useFetchByBase.js';
|
|
3
|
-
import { fetchById } from '@contentful/experiences-core';
|
|
4
|
-
import { useDetectEditorMode } from './useDetectEditorMode.js';
|
|
5
|
-
|
|
6
|
-
const useFetchById = ({ id, localeCode, client, experienceTypeId, hyperlinkPattern, }) => {
|
|
7
|
-
const isEditorMode = useDetectEditorMode({ isClientSide: typeof window !== 'undefined' });
|
|
8
|
-
const fetchMethod = useCallback(() => {
|
|
9
|
-
return fetchById({ id, localeCode, client, experienceTypeId });
|
|
10
|
-
}, [id, localeCode, client, experienceTypeId]);
|
|
11
|
-
const fetchResult = useFetchByBase(fetchMethod, isEditorMode);
|
|
12
|
-
return { ...fetchResult, experience: { ...fetchResult.experience, hyperlinkPattern } };
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { useFetchById };
|
|
16
|
-
//# sourceMappingURL=useFetchById.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchById.js","sources":["../../../src/hooks/useFetchById.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport type { ContentfulClientApi } from 'contentful';\nimport { useFetchByBase } from './useFetchByBase';\nimport { fetchById } from '@contentful/experiences-core';\nimport { useDetectEditorMode } from './useDetectEditorMode';\n\nexport type UseFetchByIdArgs = {\n client: ContentfulClientApi<undefined>;\n id: string;\n experienceTypeId: string;\n localeCode: string;\n hyperlinkPattern?: string;\n};\n\nexport const useFetchById = ({\n id,\n localeCode,\n client,\n experienceTypeId,\n hyperlinkPattern,\n}: UseFetchByIdArgs) => {\n const isEditorMode = useDetectEditorMode({ isClientSide: typeof window !== 'undefined' });\n\n const fetchMethod = useCallback(() => {\n return fetchById({ id, localeCode, client, experienceTypeId });\n }, [id, localeCode, client, experienceTypeId]);\n\n const fetchResult = useFetchByBase(fetchMethod, isEditorMode);\n\n return { ...fetchResult, experience: { ...fetchResult.experience, hyperlinkPattern } };\n};\n"],"names":[],"mappings":";;;;;AAca,MAAA,YAAY,GAAG,CAAC,EAC3B,EAAE,EACF,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,gBAAgB,GACC,KAAI;AACrB,IAAA,MAAM,YAAY,GAAG,mBAAmB,CAAC,EAAE,YAAY,EAAE,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC,CAAC;AAE1F,IAAA,MAAM,WAAW,GAAG,WAAW,CAAC,MAAK;AACnC,QAAA,OAAO,SAAS,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;KAChE,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAE/C,MAAM,WAAW,GAAG,cAAc,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAE9D,IAAA,OAAO,EAAE,GAAG,WAAW,EAAE,UAAU,EAAE,EAAE,GAAG,WAAW,CAAC,UAAU,EAAE,gBAAgB,EAAE,EAAE,CAAC;AACzF;;;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
import { useFetchByBase } from './useFetchByBase.js';
|
|
3
|
-
import { fetchBySlug } from '@contentful/experiences-core';
|
|
4
|
-
import { useDetectEditorMode } from './useDetectEditorMode.js';
|
|
5
|
-
|
|
6
|
-
const useFetchBySlug = ({ slug, localeCode, client, experienceTypeId, hyperlinkPattern, }) => {
|
|
7
|
-
const isEditorMode = useDetectEditorMode({ isClientSide: typeof window !== 'undefined' });
|
|
8
|
-
const fetchMethod = useCallback(() => {
|
|
9
|
-
return fetchBySlug({ slug, localeCode, client, experienceTypeId });
|
|
10
|
-
}, [slug, localeCode, client, experienceTypeId]);
|
|
11
|
-
const fetchResult = useFetchByBase(fetchMethod, isEditorMode);
|
|
12
|
-
return { ...fetchResult, experience: { ...fetchResult.experience, hyperlinkPattern } };
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { useFetchBySlug };
|
|
16
|
-
//# sourceMappingURL=useFetchBySlug.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchBySlug.js","sources":["../../../src/hooks/useFetchBySlug.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport type { ContentfulClientApi } from 'contentful';\nimport { useFetchByBase } from './useFetchByBase';\nimport { fetchBySlug } from '@contentful/experiences-core';\nimport { useDetectEditorMode } from './useDetectEditorMode';\n\nexport type UseFetchBySlugArgs = {\n client: ContentfulClientApi<undefined>;\n slug: string;\n experienceTypeId: string;\n localeCode: string;\n /** The pattern being used to generate links for hyperlink properties **/\n hyperlinkPattern?: string;\n};\n\nexport const useFetchBySlug = ({\n slug,\n localeCode,\n client,\n experienceTypeId,\n hyperlinkPattern,\n}: UseFetchBySlugArgs) => {\n const isEditorMode = useDetectEditorMode({ isClientSide: typeof window !== 'undefined' });\n\n const fetchMethod = useCallback(() => {\n return fetchBySlug({ slug, localeCode, client, experienceTypeId });\n }, [slug, localeCode, client, experienceTypeId]);\n\n const fetchResult = useFetchByBase(fetchMethod, isEditorMode);\n\n return { ...fetchResult, experience: { ...fetchResult.experience, hyperlinkPattern } };\n};\n"],"names":[],"mappings":";;;;;AAea,MAAA,cAAc,GAAG,CAAC,EAC7B,IAAI,EACJ,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,gBAAgB,GACG,KAAI;AACvB,IAAA,MAAM,YAAY,GAAG,mBAAmB,CAAC,EAAE,YAAY,EAAE,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC,CAAC;AAE1F,IAAA,MAAM,WAAW,GAAG,WAAW,CAAC,MAAK;AACnC,QAAA,OAAO,WAAW,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;KACpE,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAEjD,MAAM,WAAW,GAAG,cAAc,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAE9D,IAAA,OAAO,EAAE,GAAG,WAAW,EAAE,UAAU,EAAE,EAAE,GAAG,WAAW,CAAC,UAAU,EAAE,gBAAgB,EAAE,EAAE,CAAC;AACzF;;;;"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { useState, useRef, useEffect } from 'react';
|
|
2
|
-
import { runBreakpointsValidation, designTokensRegistry, breakpointsRegistry } from '@contentful/experiences-core';
|
|
3
|
-
import { runRegisteredComponentValidations, sendConnectedEventWithRegisteredComponents, sendRegisteredComponentsMessage, componentRegistry } from '../core/componentRegistry.js';
|
|
4
|
-
import { INTERNAL_EVENTS, VISUAL_EDITOR_EVENTS } from '@contentful/experiences-core/constants';
|
|
5
|
-
|
|
6
|
-
const useInitializeVisualEditor = (params) => {
|
|
7
|
-
const { initialLocale, initialEntities } = params;
|
|
8
|
-
const [locale, setLocale] = useState(initialLocale);
|
|
9
|
-
const hasConnectEventBeenSent = useRef(false);
|
|
10
|
-
// sends component definitions to the web app
|
|
11
|
-
// InternalEvents.COMPONENTS_REGISTERED is triggered by defineComponents function
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
if (!hasConnectEventBeenSent.current) {
|
|
14
|
-
runRegisteredComponentValidations();
|
|
15
|
-
runBreakpointsValidation();
|
|
16
|
-
// sending CONNECT but with the registered components now
|
|
17
|
-
sendConnectedEventWithRegisteredComponents();
|
|
18
|
-
hasConnectEventBeenSent.current = true;
|
|
19
|
-
}
|
|
20
|
-
const onComponentsRegistered = () => {
|
|
21
|
-
runRegisteredComponentValidations();
|
|
22
|
-
sendRegisteredComponentsMessage();
|
|
23
|
-
};
|
|
24
|
-
if (typeof window !== 'undefined') {
|
|
25
|
-
window.addEventListener(INTERNAL_EVENTS.ComponentsRegistered, onComponentsRegistered);
|
|
26
|
-
}
|
|
27
|
-
return () => {
|
|
28
|
-
if (typeof window !== 'undefined') {
|
|
29
|
-
window.removeEventListener(INTERNAL_EVENTS.ComponentsRegistered, onComponentsRegistered);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}, []);
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
setLocale(initialLocale);
|
|
35
|
-
}, [initialLocale]);
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
const onVisualEditorReady = () => {
|
|
38
|
-
window.dispatchEvent(new CustomEvent(INTERNAL_EVENTS.VisualEditorInitialize, {
|
|
39
|
-
detail: {
|
|
40
|
-
componentRegistry,
|
|
41
|
-
designTokens: designTokensRegistry,
|
|
42
|
-
breakpoints: breakpointsRegistry,
|
|
43
|
-
locale,
|
|
44
|
-
entities: initialEntities ?? [],
|
|
45
|
-
},
|
|
46
|
-
}));
|
|
47
|
-
};
|
|
48
|
-
window.addEventListener(VISUAL_EDITOR_EVENTS.Ready, onVisualEditorReady);
|
|
49
|
-
return () => {
|
|
50
|
-
window.removeEventListener(VISUAL_EDITOR_EVENTS.Ready, onVisualEditorReady);
|
|
51
|
-
};
|
|
52
|
-
}, [locale, initialEntities]);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export { useInitializeVisualEditor };
|
|
56
|
-
//# sourceMappingURL=useInitializeVisualEditor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInitializeVisualEditor.js","sources":["../../../src/hooks/useInitializeVisualEditor.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { EntityStore, breakpointsRegistry } from '@contentful/experiences-core';\nimport {\n componentRegistry,\n sendConnectedEventWithRegisteredComponents,\n sendRegisteredComponentsMessage,\n runRegisteredComponentValidations,\n} from '../core/componentRegistry';\nimport { INTERNAL_EVENTS, VISUAL_EDITOR_EVENTS } from '@contentful/experiences-core/constants';\nimport { designTokensRegistry, runBreakpointsValidation } from '@contentful/experiences-core';\n\ntype InitializeVisualEditorParams = {\n initialLocale: string;\n initialEntities?: EntityStore['entities'];\n};\n\nexport const useInitializeVisualEditor = (params: InitializeVisualEditorParams) => {\n const { initialLocale, initialEntities } = params;\n const [locale, setLocale] = useState<string>(initialLocale);\n const hasConnectEventBeenSent = useRef(false);\n\n // sends component definitions to the web app\n // InternalEvents.COMPONENTS_REGISTERED is triggered by defineComponents function\n useEffect(() => {\n if (!hasConnectEventBeenSent.current) {\n runRegisteredComponentValidations();\n runBreakpointsValidation();\n // sending CONNECT but with the registered components now\n sendConnectedEventWithRegisteredComponents();\n hasConnectEventBeenSent.current = true;\n }\n\n const onComponentsRegistered = () => {\n runRegisteredComponentValidations();\n sendRegisteredComponentsMessage();\n };\n\n if (typeof window !== 'undefined') {\n window.addEventListener(INTERNAL_EVENTS.ComponentsRegistered, onComponentsRegistered);\n }\n\n return () => {\n if (typeof window !== 'undefined') {\n window.removeEventListener(INTERNAL_EVENTS.ComponentsRegistered, onComponentsRegistered);\n }\n };\n }, []);\n\n useEffect(() => {\n setLocale(initialLocale);\n }, [initialLocale]);\n\n useEffect(() => {\n const onVisualEditorReady = () => {\n window.dispatchEvent(\n new CustomEvent(INTERNAL_EVENTS.VisualEditorInitialize, {\n detail: {\n componentRegistry,\n designTokens: designTokensRegistry,\n breakpoints: breakpointsRegistry,\n locale,\n entities: initialEntities ?? [],\n },\n }),\n );\n };\n\n window.addEventListener(VISUAL_EDITOR_EVENTS.Ready, onVisualEditorReady);\n return () => {\n window.removeEventListener(VISUAL_EDITOR_EVENTS.Ready, onVisualEditorReady);\n };\n }, [locale, initialEntities]);\n};\n"],"names":[],"mappings":";;;;;AAgBa,MAAA,yBAAyB,GAAG,CAAC,MAAoC,KAAI;AAChF,IAAA,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;IAClD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAS,aAAa,CAAC,CAAC;AAC5D,IAAA,MAAM,uBAAuB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;;;IAI9C,SAAS,CAAC,MAAK;AACb,QAAA,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE;AACpC,YAAA,iCAAiC,EAAE,CAAC;AACpC,YAAA,wBAAwB,EAAE,CAAC;;AAE3B,YAAA,0CAA0C,EAAE,CAAC;AAC7C,YAAA,uBAAuB,CAAC,OAAO,GAAG,IAAI,CAAC;SACxC;QAED,MAAM,sBAAsB,GAAG,MAAK;AAClC,YAAA,iCAAiC,EAAE,CAAC;AACpC,YAAA,+BAA+B,EAAE,CAAC;AACpC,SAAC,CAAC;AAEF,QAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YACjC,MAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;SACvF;AAED,QAAA,OAAO,MAAK;AACV,YAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;gBACjC,MAAM,CAAC,mBAAmB,CAAC,eAAe,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;aAC1F;AACH,SAAC,CAAC;KACH,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,MAAK;QACb,SAAS,CAAC,aAAa,CAAC,CAAC;AAC3B,KAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,SAAS,CAAC,MAAK;QACb,MAAM,mBAAmB,GAAG,MAAK;YAC/B,MAAM,CAAC,aAAa,CAClB,IAAI,WAAW,CAAC,eAAe,CAAC,sBAAsB,EAAE;AACtD,gBAAA,MAAM,EAAE;oBACN,iBAAiB;AACjB,oBAAA,YAAY,EAAE,oBAAoB;AAClC,oBAAA,WAAW,EAAE,mBAAmB;oBAChC,MAAM;oBACN,QAAQ,EAAE,eAAe,IAAI,EAAE;AAChC,iBAAA;AACF,aAAA,CAAC,CACH,CAAC;AACJ,SAAC,CAAC;QAEF,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;AACzE,QAAA,OAAO,MAAK;YACV,MAAM,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;AAC9E,SAAC,CAAC;AACJ,KAAC,EAAE,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;AAChC;;;;"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as _contentful_experiences_core from '@contentful/experiences-core';
|
|
3
|
-
import { EntityStore, VisualEditorMode } from '@contentful/experiences-core';
|
|
4
|
-
export { VisualEditorMode, createExperience, defineBreakpoints, defineDesignTokens, detachExperienceStyles, fetchById, fetchBySlug } from '@contentful/experiences-core';
|
|
5
|
-
import { Experience, ComponentRegistration, ComponentRegistrationOptions } from '@contentful/experiences-core/types';
|
|
6
|
-
export { ComponentDefinition, ExternalSDKMode } from '@contentful/experiences-core/types';
|
|
7
|
-
import { ContentfulClientApi } from 'contentful';
|
|
8
|
-
export { CF_STYLE_ATTRIBUTES, CONTENTFUL_COMPONENTS, LATEST_SCHEMA_VERSION } from '@contentful/experiences-core/constants';
|
|
9
|
-
|
|
10
|
-
type ExperienceRootProps = {
|
|
11
|
-
experience?: Experience<EntityStore> | string | null;
|
|
12
|
-
locale: string;
|
|
13
|
-
visualEditorMode?: VisualEditorMode;
|
|
14
|
-
};
|
|
15
|
-
declare const ExperienceRoot: ({ locale, experience, visualEditorMode, }: ExperienceRootProps) => react_jsx_runtime.JSX.Element | null;
|
|
16
|
-
|
|
17
|
-
type UseFetchByIdArgs = {
|
|
18
|
-
client: ContentfulClientApi<undefined>;
|
|
19
|
-
id: string;
|
|
20
|
-
experienceTypeId: string;
|
|
21
|
-
localeCode: string;
|
|
22
|
-
hyperlinkPattern?: string;
|
|
23
|
-
};
|
|
24
|
-
declare const useFetchById: ({ id, localeCode, client, experienceTypeId, hyperlinkPattern, }: UseFetchByIdArgs) => {
|
|
25
|
-
experience: {
|
|
26
|
-
hyperlinkPattern: string | undefined;
|
|
27
|
-
entityStore?: _contentful_experiences_core.EntityStore | undefined;
|
|
28
|
-
};
|
|
29
|
-
error: Error | undefined;
|
|
30
|
-
isLoading: boolean;
|
|
31
|
-
isEditorMode: boolean;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
type UseFetchBySlugArgs = {
|
|
35
|
-
client: ContentfulClientApi<undefined>;
|
|
36
|
-
slug: string;
|
|
37
|
-
experienceTypeId: string;
|
|
38
|
-
localeCode: string;
|
|
39
|
-
/** The pattern being used to generate links for hyperlink properties **/
|
|
40
|
-
hyperlinkPattern?: string;
|
|
41
|
-
};
|
|
42
|
-
declare const useFetchBySlug: ({ slug, localeCode, client, experienceTypeId, hyperlinkPattern, }: UseFetchBySlugArgs) => {
|
|
43
|
-
experience: {
|
|
44
|
-
hyperlinkPattern: string | undefined;
|
|
45
|
-
entityStore?: _contentful_experiences_core.EntityStore | undefined;
|
|
46
|
-
};
|
|
47
|
-
error: Error | undefined;
|
|
48
|
-
isLoading: boolean;
|
|
49
|
-
isEditorMode: boolean;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Registers multiple components and their component definitions at once
|
|
54
|
-
* @param componentRegistrations - ComponentRegistration[]
|
|
55
|
-
* @returns void
|
|
56
|
-
*/
|
|
57
|
-
declare const defineComponents: (componentRegistrations: ComponentRegistration[], options?: ComponentRegistrationOptions) => void;
|
|
58
|
-
/**
|
|
59
|
-
* @deprecated This method is used to maintain the basic component ids (without the prefix 'contentful-') in order to be compatible
|
|
60
|
-
* with experiences created with an older alpha version of the SDK. Components in these experiences should be migrated to use
|
|
61
|
-
* the components with the 'contentful-' prefix. To do so, load the experience in the editor, and replace any older basic components
|
|
62
|
-
* (marked with [OLD] in the UI) with the new components (without the [OLD]). This method (and functionality for the older components)
|
|
63
|
-
* will be removed in the next major release.
|
|
64
|
-
*/
|
|
65
|
-
declare const maintainBasicComponentIdsWithoutPrefix: () => void;
|
|
66
|
-
|
|
67
|
-
export { ExperienceRoot, defineComponents, maintainBasicComponentIdsWithoutPrefix, useFetchById, useFetchBySlug };
|
package/dist/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { SDK_VERSION } from './sdkVersion.js';
|
|
2
|
-
export { ExperienceRoot } from './ExperienceRoot.js';
|
|
3
|
-
export { VisualEditorMode, createExperience, defineBreakpoints, defineDesignTokens, detachExperienceStyles, fetchById, fetchBySlug } from '@contentful/experiences-core';
|
|
4
|
-
import 'react';
|
|
5
|
-
export { useFetchById } from './hooks/useFetchById.js';
|
|
6
|
-
export { useFetchBySlug } from './hooks/useFetchBySlug.js';
|
|
7
|
-
export { defineComponents, maintainBasicComponentIdsWithoutPrefix } from './core/componentRegistry.js';
|
|
8
|
-
export { CF_STYLE_ATTRIBUTES, CONTENTFUL_COMPONENTS, LATEST_SCHEMA_VERSION } from '@contentful/experiences-core/constants';
|
|
9
|
-
|
|
10
|
-
// Simple state store to store a few things that are needed across the SDK
|
|
11
|
-
if (typeof window !== 'undefined') {
|
|
12
|
-
window.__EB__ = {
|
|
13
|
-
sdkVersion: SDK_VERSION,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { SDK_VERSION } from './sdkVersion';\n\nexport { ExperienceRoot } from './ExperienceRoot';\nexport { useFetchById, useFetchBySlug } from './hooks';\nexport { defineComponents, maintainBasicComponentIdsWithoutPrefix } from './core/componentRegistry';\nexport {\n defineDesignTokens,\n defineBreakpoints,\n VisualEditorMode,\n fetchById,\n fetchBySlug,\n createExperience,\n} from '@contentful/experiences-core';\nexport {\n CONTENTFUL_COMPONENTS,\n LATEST_SCHEMA_VERSION,\n CF_STYLE_ATTRIBUTES,\n} from '@contentful/experiences-core/constants';\n\n// Simple state store to store a few things that are needed across the SDK\nif (typeof window !== 'undefined') {\n window.__EB__ = {\n sdkVersion: SDK_VERSION,\n };\n}\n\nexport type { ExternalSDKMode, ComponentDefinition } from '@contentful/experiences-core/types';\n\nexport { detachExperienceStyles } from '@contentful/experiences-core';\n"],"names":[],"mappings":";;;;;;;;;AAmBA;AACA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,MAAM,CAAC,MAAM,GAAG;AACd,QAAA,UAAU,EAAE,WAAW;KACxB,CAAC;AACJ"}
|
package/dist/sdkVersion.js
DELETED
package/dist/sdkVersion.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdkVersion.js","sources":["../../src/sdkVersion.ts"],"sourcesContent":["export const SDK_VERSION = '1.9.0-dev-20240628T2230-7a4f71f.0';\n"],"names":[],"mappings":"AAAO,MAAM,WAAW,GAAG;;;;"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { VisualEditorMode } from '@contentful/experiences-core';
|
|
2
|
-
import { EntityStore } from '@contentful/experiences-core';
|
|
3
|
-
import type { Experience } from '@contentful/experiences-core/types';
|
|
4
|
-
type ExperienceRootProps = {
|
|
5
|
-
experience?: Experience<EntityStore> | string | null;
|
|
6
|
-
locale: string;
|
|
7
|
-
visualEditorMode?: VisualEditorMode;
|
|
8
|
-
};
|
|
9
|
-
export declare const ExperienceRoot: ({ locale, experience, visualEditorMode, }: ExperienceRootProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { EntityStore, VisualEditorMode } from '@contentful/experiences-core';
|
|
3
|
-
import type { Experience } from '@contentful/experiences-core/types';
|
|
4
|
-
type VisualEditorLoaderProps = {
|
|
5
|
-
visualEditorMode: VisualEditorMode;
|
|
6
|
-
experience?: Experience<EntityStore>;
|
|
7
|
-
};
|
|
8
|
-
export declare const VisualEditorLoader: React.FC<VisualEditorLoaderProps>;
|
|
9
|
-
export default VisualEditorLoader;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { EntityStore, VisualEditorMode } from '@contentful/experiences-core';
|
|
3
|
-
import type { Experience } from '@contentful/experiences-core/types';
|
|
4
|
-
type VisualEditorRootProps = {
|
|
5
|
-
visualEditorMode: VisualEditorMode;
|
|
6
|
-
experience?: Experience<EntityStore>;
|
|
7
|
-
initialLocale: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const VisualEditorRoot: React.FC<VisualEditorRootProps>;
|
|
10
|
-
export default VisualEditorRoot;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EntityStore } from '@contentful/experiences-core';
|
|
2
|
-
import type { ComponentTreeNode, ResolveDesignValueType } from '@contentful/experiences-core/types';
|
|
3
|
-
type CompositionBlockProps = {
|
|
4
|
-
node: ComponentTreeNode;
|
|
5
|
-
locale: string;
|
|
6
|
-
entityStore: EntityStore;
|
|
7
|
-
hyperlinkPattern?: string | undefined;
|
|
8
|
-
resolveDesignValue: ResolveDesignValueType;
|
|
9
|
-
};
|
|
10
|
-
export declare const CompositionBlock: ({ node: rawNode, locale, entityStore, hyperlinkPattern, resolveDesignValue, }: CompositionBlockProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { EntityStore } from '@contentful/experiences-core';
|
|
2
|
-
import type { Experience } from '@contentful/experiences-core/types';
|
|
3
|
-
type DeliveryRootProps = {
|
|
4
|
-
experience: Experience<EntityStore>;
|
|
5
|
-
locale: string;
|
|
6
|
-
};
|
|
7
|
-
export declare const PreviewDeliveryRoot: ({ locale, experience }: DeliveryRootProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React, { ErrorInfo, ReactElement } from 'react';
|
|
2
|
-
import '../styles/ErrorBoundary.css';
|
|
3
|
-
export declare class ErrorBoundary extends React.Component<{
|
|
4
|
-
children: ReactElement;
|
|
5
|
-
}, {
|
|
6
|
-
hasError: boolean;
|
|
7
|
-
error: Error | null;
|
|
8
|
-
errorInfo: ErrorInfo | null;
|
|
9
|
-
showErrorDetails: boolean;
|
|
10
|
-
}> {
|
|
11
|
-
constructor(props: {
|
|
12
|
-
children: ReactElement;
|
|
13
|
-
});
|
|
14
|
-
static getDerivedStateFromError(): {
|
|
15
|
-
hasError: boolean;
|
|
16
|
-
};
|
|
17
|
-
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
18
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React, { MouseEventHandler } from 'react';
|
|
2
|
-
import type * as CSS from 'csstype';
|
|
3
|
-
export interface FlexProps {
|
|
4
|
-
/**
|
|
5
|
-
* Child nodes to be rendered in the component */
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
/**
|
|
8
|
-
* A shorthand property for flex-grow, flex-shrink, flex-basis
|
|
9
|
-
*/
|
|
10
|
-
flex?: CSS.Property.Flex;
|
|
11
|
-
/**
|
|
12
|
-
* Defines the initial size of a flexbox item.
|
|
13
|
-
* */
|
|
14
|
-
flexBasis?: CSS.Property.FlexBasis;
|
|
15
|
-
/**
|
|
16
|
-
* Defines how much a flexbox item should shrink if there's not enough space available. */
|
|
17
|
-
flexShrink?: CSS.Property.FlexShrink;
|
|
18
|
-
/**
|
|
19
|
-
* Defines if flexbox items appear on a single line or on multiple lines within a flexbox container. */
|
|
20
|
-
flexWrap?: CSS.Property.FlexWrap;
|
|
21
|
-
/**
|
|
22
|
-
* Defines how flexbox items are ordered within a flexbox container. */
|
|
23
|
-
flexDirection?: CSS.Property.FlexDirection;
|
|
24
|
-
/**
|
|
25
|
-
* Defines how much a flexbox item should grow if there's space available. */
|
|
26
|
-
flexGrow?: CSS.Property.FlexGrow;
|
|
27
|
-
/**
|
|
28
|
-
* Defines a gap between flexbox items. */
|
|
29
|
-
gap?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Defines how flexbox/grid items are aligned according to the main axis, within a flexbox/grid container. */
|
|
32
|
-
justifyContent?: CSS.Property.JustifyContent;
|
|
33
|
-
/**
|
|
34
|
-
* Defines the default justify-self for all items of the box, giving them all a default way of justifying each box along the appropriate axis. */
|
|
35
|
-
justifyItems?: CSS.Property.JustifyContent;
|
|
36
|
-
/**
|
|
37
|
-
* Sets the way a box is justified inside its alignment container along the appropriate axis. */
|
|
38
|
-
justifySelf?: CSS.Property.JustifySelf;
|
|
39
|
-
/**
|
|
40
|
-
* Defines how flexbox items are aligned according to the cross axis, within a line of a flexbox container.
|
|
41
|
-
*/
|
|
42
|
-
alignItems?: CSS.Property.AlignItems;
|
|
43
|
-
/**
|
|
44
|
-
* Works like align-items, but applies only to a single flexbox item, instead of all of them.
|
|
45
|
-
*/
|
|
46
|
-
alignSelf?: CSS.Property.AlignItems;
|
|
47
|
-
/**
|
|
48
|
-
* Defines how each line is aligned within a flexbox/grid container.
|
|
49
|
-
*/
|
|
50
|
-
alignContent?: CSS.Property.AlignContent;
|
|
51
|
-
/**
|
|
52
|
-
* Defines the order of a flexbox item
|
|
53
|
-
*/
|
|
54
|
-
order?: CSS.Property.Order;
|
|
55
|
-
onMouseEnter?: MouseEventHandler<HTMLDivElement>;
|
|
56
|
-
onMouseLeave?: MouseEventHandler<HTMLDivElement>;
|
|
57
|
-
onMouseUp?: MouseEventHandler<HTMLDivElement>;
|
|
58
|
-
onMouseDown?: MouseEventHandler<HTMLDivElement>;
|
|
59
|
-
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
60
|
-
className?: string;
|
|
61
|
-
cssStyles?: Record<string, string>;
|
|
62
|
-
id?: string;
|
|
63
|
-
}
|
|
64
|
-
export declare const Flex: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<HTMLDivElement>>;
|
package/dist/src/constants.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { ComponentRegistration, ComponentRegistrationOptions } from '@contentful/experiences-core/types';
|
|
2
|
-
export declare const enrichComponentDefinition: ({ component, definition, options, }: ComponentRegistration) => ComponentRegistration;
|
|
3
|
-
export declare const componentRegistry: Map<string, ComponentRegistration>;
|
|
4
|
-
export declare const optionalBuiltInComponents: string[];
|
|
5
|
-
export declare const sendRegisteredComponentsMessage: () => void;
|
|
6
|
-
export declare const runRegisteredComponentValidations: () => void;
|
|
7
|
-
export declare const sendConnectedEventWithRegisteredComponents: () => void;
|
|
8
|
-
/**
|
|
9
|
-
* Registers multiple components and their component definitions at once
|
|
10
|
-
* @param componentRegistrations - ComponentRegistration[]
|
|
11
|
-
* @returns void
|
|
12
|
-
*/
|
|
13
|
-
export declare const defineComponents: (componentRegistrations: ComponentRegistration[], options?: ComponentRegistrationOptions) => void;
|
|
14
|
-
/**
|
|
15
|
-
* use this function only in tests
|
|
16
|
-
*/
|
|
17
|
-
export declare const resetComponentRegistry: () => void;
|
|
18
|
-
export declare const getComponentRegistration: (id: string) => ComponentRegistration | undefined;
|
|
19
|
-
export declare const addComponentRegistration: (componentRegistration: ComponentRegistration) => void;
|
|
20
|
-
export declare const createAssemblyRegistration: ({ definitionId, definitionName, component, }: {
|
|
21
|
-
definitionId: string;
|
|
22
|
-
definitionName?: string;
|
|
23
|
-
component: ComponentRegistration["component"];
|
|
24
|
-
}) => ComponentRegistration | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated This method is used to maintain the basic component ids (without the prefix 'contentful-') in order to be compatible
|
|
27
|
-
* with experiences created with an older alpha version of the SDK. Components in these experiences should be migrated to use
|
|
28
|
-
* the components with the 'contentful-' prefix. To do so, load the experience in the editor, and replace any older basic components
|
|
29
|
-
* (marked with [OLD] in the UI) with the new components (without the [OLD]). This method (and functionality for the older components)
|
|
30
|
-
* will be removed in the next major release.
|
|
31
|
-
*/
|
|
32
|
-
export declare const maintainBasicComponentIdsWithoutPrefix: () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/src/core/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Flex } from '../components/Flex';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { EntityStore } from '@contentful/experiences-core';
|
|
2
|
-
import type { ComponentTreeNode } from '@contentful/experiences-core/types';
|
|
3
|
-
export declare const deserializeAssemblyNode: ({ node, componentInstanceVariables, }: {
|
|
4
|
-
node: ComponentTreeNode;
|
|
5
|
-
componentInstanceVariables: ComponentTreeNode["variables"];
|
|
6
|
-
}) => ComponentTreeNode;
|
|
7
|
-
export declare const resolveAssembly: ({ node, entityStore, }: {
|
|
8
|
-
node: ComponentTreeNode;
|
|
9
|
-
entityStore: EntityStore;
|
|
10
|
-
}) => ComponentTreeNode;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const sdkFeatures: Record<string, unknown>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ComponentTreeNode } from '@contentful/experiences-core/types';
|
|
2
|
-
/**
|
|
3
|
-
* This hook can generate className and inject styles on a client side as a <style> tag
|
|
4
|
-
* or it derives the className set on the server side
|
|
5
|
-
*
|
|
6
|
-
* @param node: the componenet node for which the styles will be injected
|
|
7
|
-
* @param props: the props of the component, represented by the node
|
|
8
|
-
* @returns the className that was eitner generated on the client side or derived from the value, set on server side
|
|
9
|
-
*/
|
|
10
|
-
export declare const useClassName: ({ node, props, }: {
|
|
11
|
-
node: ComponentTreeNode;
|
|
12
|
-
props: Record<string, any>;
|
|
13
|
-
}) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
type UseDetectEditorModeArgs = {
|
|
2
|
-
/** If running from a known client side only situation (ie: useFetchBySlug),
|
|
3
|
-
* set this to true to kick in editor mode check sooner (which avoids a render cycle) */
|
|
4
|
-
isClientSide?: boolean;
|
|
5
|
-
};
|
|
6
|
-
export declare const useDetectEditorMode: ({ isClientSide }?: UseDetectEditorModeArgs) => boolean;
|
|
7
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { EntityStore } from '@contentful/experiences-core';
|
|
2
|
-
import type { Experience } from '@contentful/experiences-core/types';
|
|
3
|
-
export declare const useFetchByBase: (fetchMethod: () => Promise<Experience<EntityStore> | undefined>, isEditorMode: boolean) => {
|
|
4
|
-
error: Error | undefined;
|
|
5
|
-
experience: Experience<EntityStore> | undefined;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
isEditorMode: boolean;
|
|
8
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ContentfulClientApi } from 'contentful';
|
|
2
|
-
export type UseFetchByIdArgs = {
|
|
3
|
-
client: ContentfulClientApi<undefined>;
|
|
4
|
-
id: string;
|
|
5
|
-
experienceTypeId: string;
|
|
6
|
-
localeCode: string;
|
|
7
|
-
hyperlinkPattern?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const useFetchById: ({ id, localeCode, client, experienceTypeId, hyperlinkPattern, }: UseFetchByIdArgs) => {
|
|
10
|
-
experience: {
|
|
11
|
-
hyperlinkPattern: string | undefined;
|
|
12
|
-
entityStore?: import("@contentful/experiences-core").EntityStore | undefined;
|
|
13
|
-
};
|
|
14
|
-
error: Error | undefined;
|
|
15
|
-
isLoading: boolean;
|
|
16
|
-
isEditorMode: boolean;
|
|
17
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ContentfulClientApi } from 'contentful';
|
|
2
|
-
export type UseFetchBySlugArgs = {
|
|
3
|
-
client: ContentfulClientApi<undefined>;
|
|
4
|
-
slug: string;
|
|
5
|
-
experienceTypeId: string;
|
|
6
|
-
localeCode: string;
|
|
7
|
-
/** The pattern being used to generate links for hyperlink properties **/
|
|
8
|
-
hyperlinkPattern?: string;
|
|
9
|
-
};
|
|
10
|
-
export declare const useFetchBySlug: ({ slug, localeCode, client, experienceTypeId, hyperlinkPattern, }: UseFetchBySlugArgs) => {
|
|
11
|
-
experience: {
|
|
12
|
-
hyperlinkPattern: string | undefined;
|
|
13
|
-
entityStore?: import("@contentful/experiences-core").EntityStore | undefined;
|
|
14
|
-
};
|
|
15
|
-
error: Error | undefined;
|
|
16
|
-
isLoading: boolean;
|
|
17
|
-
isEditorMode: boolean;
|
|
18
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { EntityStore } from '@contentful/experiences-core';
|
|
2
|
-
type InitializeVisualEditorParams = {
|
|
3
|
-
initialLocale: string;
|
|
4
|
-
initialEntities?: EntityStore['entities'];
|
|
5
|
-
};
|
|
6
|
-
export declare const useInitializeVisualEditor: (params: InitializeVisualEditorParams) => void;
|
|
7
|
-
export {};
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { ExperienceRoot } from './ExperienceRoot';
|
|
2
|
-
export { useFetchById, useFetchBySlug } from './hooks';
|
|
3
|
-
export { defineComponents, maintainBasicComponentIdsWithoutPrefix } from './core/componentRegistry';
|
|
4
|
-
export { defineDesignTokens, defineBreakpoints, VisualEditorMode, fetchById, fetchBySlug, createExperience, } from '@contentful/experiences-core';
|
|
5
|
-
export { CONTENTFUL_COMPONENTS, LATEST_SCHEMA_VERSION, CF_STYLE_ATTRIBUTES, } from '@contentful/experiences-core/constants';
|
|
6
|
-
export type { ExternalSDKMode, ComponentDefinition } from '@contentful/experiences-core/types';
|
|
7
|
-
export { detachExperienceStyles } from '@contentful/experiences-core';
|
package/dist/src/sdkVersion.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.9.0-dev-20240628T2230-7a4f71f.0";
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ComponentRegistration } from '@contentful/experiences-core/types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
interface CFProps extends React.HtmlHTMLAttributes<HTMLElement> {
|
|
4
|
-
/**
|
|
5
|
-
* Classes to be applied to the container component if `wrapComponent` is true, or directly to the child component if false.
|
|
6
|
-
*/
|
|
7
|
-
className?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Classes to be applied to the child component if `wrapComponent` is true, or directly to the child component if false.
|
|
10
|
-
*/
|
|
11
|
-
classes?: string;
|
|
12
|
-
dragProps?: any;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Sets up a component to be consumed by Experience Builder. This function can be used to wrap a component with a container component, or to pass props to the component directly.
|
|
16
|
-
* @param Component Component to be used by Experience Builder.
|
|
17
|
-
* @param options Options for the `withComponentWrapper` function.
|
|
18
|
-
* @default { wrapComponent: true, wrapContainerTag: 'div' }
|
|
19
|
-
* @returns A component that can be passed to `defineComponents`.
|
|
20
|
-
*/
|
|
21
|
-
export declare function withComponentWrapper<T>(Component: React.ElementType, options?: ComponentRegistration['options']): React.FC<CFProps & T>;
|
|
22
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import styleInject from 'style-inject';
|
|
2
|
-
|
|
3
|
-
var css_248z = ".cf-error-message {\n margin: 24px;\n font-size: var(--exp-builder-font-size-m);\n font-family: var(--exp-builder-font-stack-primary);\n color: var(--exp-builder-red800);\n padding: 16px;\n background-color: var(--exp-builder-red200);\n}\n\n.cf-error-message .title {\n margin-top: 0;\n font-size: var(--exp-builder-font-size-l);\n}\n\n.cf-error-message .more-details {\n cursor: pointer;\n color: var(--exp-builder-blue700);\n}\n";
|
|
4
|
-
styleInject(css_248z);
|
|
5
|
-
|
|
6
|
-
export { css_248z as default };
|
|
7
|
-
//# sourceMappingURL=ErrorBoundary.css.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|