@contentful/experiences-core 3.8.3-dev-20251010T1235-2d92513.0 → 3.8.3-dev-20251020T1356-dca4ced.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/dist/{constants.cjs → cjs/constants.cjs} +2 -0
- package/dist/cjs/constants.cjs.map +1 -0
- package/dist/{index.cjs → cjs/index.cjs} +129 -127
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/types/index.d.ts +1675 -0
- package/package.json +17 -21
- package/dist/communication/sendMessage.d.ts +0 -5
- package/dist/constants.cjs.map +0 -1
- package/dist/constants.js.map +0 -1
- package/dist/deep-binding/DeepReference.d.ts +0 -44
- package/dist/definitions/styles.d.ts +0 -11
- package/dist/entity/EditorEntityStore.d.ts +0 -34
- package/dist/entity/EditorModeEntityStore.d.ts +0 -28
- package/dist/entity/EntityStore.d.ts +0 -99
- package/dist/entity/EntityStoreBase.d.ts +0 -53
- package/dist/entity/InMemoryEntitiesPublicApi.d.ts +0 -41
- package/dist/entity/InMemoryEntitiesStore.d.ts +0 -17
- package/dist/enums.d.ts +0 -6
- package/dist/exports.d.ts +0 -3
- package/dist/fetchers/createExperience.d.ts +0 -25
- package/dist/fetchers/fetchAllEntities.d.ts +0 -30
- package/dist/fetchers/fetchById.d.ts +0 -24
- package/dist/fetchers/fetchBySlug.d.ts +0 -24
- package/dist/fetchers/fetchExperienceEntry.d.ts +0 -30
- package/dist/fetchers/fetchReferencedEntities.d.ts +0 -28
- package/dist/fetchers/gatherAutoFetchedReferentsFromIncludes.d.ts +0 -11
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -42
- package/dist/index.js.map +0 -1
- package/dist/registries/breakpointsRegistry.d.ts +0 -43
- package/dist/registries/designTokenRegistry.d.ts +0 -13
- package/dist/registries/sdkOptionsRegistry.d.ts +0 -11
- package/dist/types.d.ts +0 -630
- package/dist/utils/breakpoints.d.ts +0 -26
- package/dist/utils/components.d.ts +0 -17
- package/dist/utils/debugLogger.d.ts +0 -36
- package/dist/utils/domValues.d.ts +0 -16
- package/dist/utils/extractPrebindingData.d.ts +0 -46
- package/dist/utils/isLink.d.ts +0 -7
- package/dist/utils/isLinkToAsset.d.ts +0 -5
- package/dist/utils/isLinkToEntry.d.ts +0 -5
- package/dist/utils/localizeEntity.d.ts +0 -24
- package/dist/utils/pathSchema.d.ts +0 -43
- package/dist/utils/resolveHyperlinkPattern.d.ts +0 -17
- package/dist/utils/sanitizeNodeProps.d.ts +0 -7
- package/dist/utils/schema/experienceSchema.d.ts +0 -23
- package/dist/utils/schema/references.d.ts +0 -18
- package/dist/utils/splitDirectAndSlotChildren.d.ts +0 -12
- package/dist/utils/styleUtils/ssrStyles.d.ts +0 -75
- package/dist/utils/styleUtils/styleTransformers.d.ts +0 -6
- package/dist/utils/styleUtils/stylesUtils.d.ts +0 -64
- package/dist/utils/styleUtils/toMediaQuery.d.ts +0 -15
- package/dist/utils/transformers/transformBoundContentValue.d.ts +0 -8
- package/dist/utils/treeTraversal.d.ts +0 -17
- package/dist/utils/typeguards.d.ts +0 -15
- package/dist/utils/utils.d.ts +0 -32
- package/dist/utils/validations.d.ts +0 -11
- package/dist/{constants.js → esm/constants.js} +0 -0
- package/dist/{index.js → esm/index.js} +127 -127
- /package/dist/{constants.d.ts → types/constants.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experiences-core",
|
|
3
|
-
"version": "3.8.3-dev-
|
|
3
|
+
"version": "3.8.3-dev-20251020T1356-dca4ced.0",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
5
|
+
"main": "dist/esm/index.js",
|
|
6
|
+
"module": "dist/esm/index.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -21,22 +21,18 @@
|
|
|
21
21
|
],
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
-
"import": "./dist/index.js",
|
|
25
|
-
"require": "./dist/index.cjs",
|
|
26
|
-
"default": "./dist/index.js",
|
|
27
|
-
"types":
|
|
28
|
-
"./dist/index.d.ts"
|
|
29
|
-
]
|
|
24
|
+
"import": "./dist/esm/index.js",
|
|
25
|
+
"require": "./dist/cjs/index.cjs",
|
|
26
|
+
"default": "./dist/esm/index.js",
|
|
27
|
+
"types": "./dist/types/index.d.ts"
|
|
30
28
|
},
|
|
31
29
|
"./constants": {
|
|
32
|
-
"import": "./dist/constants.js",
|
|
33
|
-
"require": "./dist/constants.cjs",
|
|
34
|
-
"default": "./dist/constants.js",
|
|
35
|
-
"types":
|
|
36
|
-
"./dist/constants.d.ts"
|
|
37
|
-
]
|
|
30
|
+
"import": "./dist/esm/constants.js",
|
|
31
|
+
"require": "./dist/cjs/constants.cjs",
|
|
32
|
+
"default": "./dist/esm/constants.js",
|
|
33
|
+
"types": "./dist/types/constants.d.ts"
|
|
38
34
|
},
|
|
39
|
-
"./types": "./dist/types.d.ts"
|
|
35
|
+
"./types": "./dist/types/index.d.ts"
|
|
40
36
|
},
|
|
41
37
|
"publishConfig": {
|
|
42
38
|
"registry": "https://npm.pkg.github.com/"
|
|
@@ -44,10 +40,10 @@
|
|
|
44
40
|
"typesVersions": {
|
|
45
41
|
"*": {
|
|
46
42
|
"types": [
|
|
47
|
-
"./dist/types.d.ts"
|
|
43
|
+
"./dist/types/index.d.ts"
|
|
48
44
|
],
|
|
49
45
|
"constants": [
|
|
50
|
-
"./dist/constants.d.ts"
|
|
46
|
+
"./dist/types/constants.d.ts"
|
|
51
47
|
]
|
|
52
48
|
}
|
|
53
49
|
},
|
|
@@ -80,7 +76,7 @@
|
|
|
80
76
|
"vitest": "^2.1.1"
|
|
81
77
|
},
|
|
82
78
|
"dependencies": {
|
|
83
|
-
"@contentful/experiences-validators": "3.8.3-dev-
|
|
79
|
+
"@contentful/experiences-validators": "3.8.3-dev-20251020T1356-dca4ced.0",
|
|
84
80
|
"@contentful/rich-text-types": "^17.0.0",
|
|
85
81
|
"lodash.clonedeep": "^4.5.0",
|
|
86
82
|
"zustand": "^4.4.7"
|
|
@@ -88,5 +84,5 @@
|
|
|
88
84
|
"peerDependencies": {
|
|
89
85
|
"contentful": ">=10.6.0"
|
|
90
86
|
},
|
|
91
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "63b3a2216153b88eb2c90251b3b6cbd03fd17516"
|
|
92
88
|
}
|
package/dist/constants.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","sources":["../src/constants.ts"],"sourcesContent":["/** @deprecated will be removed when dropping backward compatibility for old DND */\nexport const SCROLL_STATES = {\n Start: 'scrollStart',\n IsScrolling: 'isScrolling',\n End: 'scrollEnd',\n} as const;\n\nexport const OUTGOING_EVENTS = {\n Connected: 'connected',\n DesignTokens: 'registerDesignTokens',\n RegisteredBreakpoints: 'registeredBreakpoints',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n MouseMove: 'mouseMove',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentSelected: 'componentSelected',\n RegisteredComponents: 'registeredComponents',\n RequestComponentTreeUpdate: 'requestComponentTreeUpdate',\n CanvasReload: 'canvasReload',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n UpdateSelectedComponentCoordinates: 'updateSelectedComponentCoordinates',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n CanvasScroll: 'canvasScrolling',\n CanvasError: 'canvasError',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n OutsideCanvasClick: 'outsideCanvasClick',\n SDKFeatures: 'sdkFeatures',\n RequestEntities: 'REQUEST_ENTITIES',\n CanvasGeometryUpdated: 'canvasGeometryUpdated',\n CanvasPan: 'canvasPan',\n} as const;\n\nexport const INCOMING_EVENTS = {\n RequestEditorMode: 'requestEditorMode',\n RequestReadOnlyMode: 'requestReadOnlyMode',\n ExperienceUpdated: 'componentTreeUpdated',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentDraggingChanged: 'componentDraggingChanged',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentDragCanceled: 'componentDragCanceled',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentDragStarted: 'componentDragStarted',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentDragEnded: 'componentDragEnded',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentMoveEnded: 'componentMoveEnded',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n CanvasResized: 'canvasResized',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n SelectComponent: 'selectComponent',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n HoverComponent: 'hoverComponent',\n UpdatedEntity: 'updatedEntity',\n /** @deprecated not needed after `patternResolution` was introduced. Will be removed in the next major version. */\n AssembliesAdded: 'assembliesAdded',\n /** @deprecated not needed after `patternResolution` was introduced. Will be removed in the next major version. */\n AssembliesRegistered: 'assembliesRegistered',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n MouseMove: 'mouseMove',\n RequestedEntities: 'REQUESTED_ENTITIES',\n} as const;\n\nexport const INTERNAL_EVENTS = {\n ComponentsRegistered: 'cfComponentsRegistered',\n VisualEditorInitialize: 'cfVisualEditorInitialize',\n} as const;\n\nexport const VISUAL_EDITOR_EVENTS = {\n Ready: 'cfVisualEditorReady',\n};\n\n/**\n * These modes are ONLY intended to be internally used within the context of\n * editing an experience inside of Contentful Studio. i.e. these modes\n * intentionally do not include preview/delivery modes.\n */\nexport enum StudioCanvasMode {\n READ_ONLY = 'readOnlyMode',\n EDITOR = 'editorMode',\n NONE = 'none',\n}\n\nexport const VISUAL_EDITOR_CONTAINER_ID = 'cf-visual-editor';\nexport const CONTENTFUL_COMPONENT_CATEGORY = 'contentful-component';\nexport const CONTENTFUL_DEFAULT_CATEGORY = 'Contentful';\n\nexport const CONTENTFUL_COMPONENTS = {\n section: {\n id: 'contentful-section',\n name: 'Section',\n },\n container: {\n id: 'contentful-container',\n name: 'Container',\n },\n columns: {\n id: 'contentful-columns',\n name: 'Columns',\n },\n singleColumn: {\n id: 'contentful-single-column',\n name: 'Column',\n },\n button: {\n id: 'contentful-button',\n name: 'Button',\n },\n heading: {\n id: 'contentful-heading',\n name: 'Heading',\n },\n image: {\n id: 'contentful-image',\n name: 'Image',\n },\n richText: {\n id: 'contentful-richText',\n name: 'Rich Text',\n },\n text: {\n id: 'contentful-text',\n name: 'Text',\n },\n divider: {\n id: 'contentful-divider',\n name: 'Divider',\n },\n carousel: {\n id: 'contentful-carousel',\n name: 'Carousel',\n },\n} as const;\n\nexport const ASSEMBLY_NODE_TYPE = 'assembly';\nexport const ASSEMBLY_DEFAULT_CATEGORY = 'Assemblies';\nexport const ASSEMBLY_BLOCK_NODE_TYPE = 'assemblyBlock';\nexport const ASSEMBLY_NODE_TYPES = [ASSEMBLY_NODE_TYPE, ASSEMBLY_BLOCK_NODE_TYPE];\nexport const LATEST_SCHEMA_VERSION = '2023-09-28';\nexport const CF_STYLE_ATTRIBUTES = [\n 'cfVisibility',\n 'cfHorizontalAlignment',\n 'cfVerticalAlignment',\n 'cfMargin',\n 'cfPadding',\n 'cfBackgroundColor',\n 'cfWidth',\n 'cfMaxWidth',\n 'cfHeight',\n 'cfImageAsset',\n 'cfImageOptions',\n 'cfBackgroundImageUrl',\n 'cfBackgroundImageOptions',\n 'cfFlexDirection',\n 'cfFlexWrap',\n 'cfFlexReverse',\n 'cfBorder',\n 'cfBorderRadius',\n 'cfGap',\n 'cfColumnSpan',\n 'cfColumnSpanLock',\n 'cfColumns',\n 'cfFontSize',\n 'cfFontWeight',\n 'cfLineHeight',\n 'cfLetterSpacing',\n 'cfTextColor',\n 'cfTextAlign',\n 'cfTextTransform',\n 'cfTextBold',\n 'cfTextItalic',\n 'cfTextUnderline',\n];\n\nexport const EMPTY_CONTAINER_SIZE = '80px';\n\nexport const HYPERLINK_DEFAULT_PATTERN = `/{locale}/{entry.fields.slug}/`;\n\nexport enum PostMessageMethods {\n REQUEST_ENTITIES = 'REQUEST_ENTITIES',\n REQUESTED_ENTITIES = 'REQUESTED_ENTITIES',\n}\n\nexport const SUPPORTED_IMAGE_FORMATS = ['jpg', 'png', 'webp', 'gif', 'avif'] as const;\n"],"names":["StudioCanvasMode","PostMessageMethods"],"mappings":";;AAAA;AACa,MAAA,aAAa,GAAG;AAC3B,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,GAAG,EAAE,WAAW;EACP;AAEE,MAAA,eAAe,GAAG;AAC7B,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,YAAY,EAAE,sBAAsB;AACpC,IAAA,qBAAqB,EAAE,uBAAuB;;AAE9C,IAAA,SAAS,EAAE,WAAW;;AAEtB,IAAA,iBAAiB,EAAE,mBAAmB;AACtC,IAAA,oBAAoB,EAAE,sBAAsB;AAC5C,IAAA,0BAA0B,EAAE,4BAA4B;AACxD,IAAA,YAAY,EAAE,cAAc;;AAE5B,IAAA,kCAAkC,EAAE,oCAAoC;;AAExE,IAAA,YAAY,EAAE,iBAAiB;AAC/B,IAAA,WAAW,EAAE,aAAa;;AAE1B,IAAA,kBAAkB,EAAE,oBAAoB;AACxC,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,eAAe,EAAE,kBAAkB;AACnC,IAAA,qBAAqB,EAAE,uBAAuB;AAC9C,IAAA,SAAS,EAAE,WAAW;EACb;AAEE,MAAA,eAAe,GAAG;AAC7B,IAAA,iBAAiB,EAAE,mBAAmB;AACtC,IAAA,mBAAmB,EAAE,qBAAqB;AAC1C,IAAA,iBAAiB,EAAE,sBAAsB;;AAEzC,IAAA,wBAAwB,EAAE,0BAA0B;;AAEpD,I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,0BAA0B;IAC1B,iBAAiB;IACjB,YAAY;IACZ,eAAe;IACf,UAAU;IACV,gBAAgB;IAChB,OAAO;IACP,cAAc;IACd,kBAAkB;IAClB,WAAW;IACX,YAAY;IACZ,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,aAAa;IACb,aAAa;IACb,iBAAiB;IACjB,YAAY;IACZ,cAAc;IACd,iBAAiB;EACjB;AAEK,MAAM,oBAAoB,GAAG,OAAO;AAEpC,MAAM,yBAAyB,GAAG,iCAAiC;AAE9DC,oCAGX;AAHD,CAAA,UAAY,kBAAkB,EAAA;AAC5B,IAAA,kBAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC,CAAA;AACrC,IAAA,kBAAA,CAAA,oBAAA,CAAA,GAAA,oBAAyC,CAAA;AAC3C,CAAC,EAHWA,0BAAkB,KAAlBA,0BAAkB,GAG7B,EAAA,CAAA,CAAA,CAAA;AAEM,MAAM,uBAAuB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["/** @deprecated will be removed when dropping backward compatibility for old DND */\nexport const SCROLL_STATES = {\n Start: 'scrollStart',\n IsScrolling: 'isScrolling',\n End: 'scrollEnd',\n} as const;\n\nexport const OUTGOING_EVENTS = {\n Connected: 'connected',\n DesignTokens: 'registerDesignTokens',\n RegisteredBreakpoints: 'registeredBreakpoints',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n MouseMove: 'mouseMove',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentSelected: 'componentSelected',\n RegisteredComponents: 'registeredComponents',\n RequestComponentTreeUpdate: 'requestComponentTreeUpdate',\n CanvasReload: 'canvasReload',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n UpdateSelectedComponentCoordinates: 'updateSelectedComponentCoordinates',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n CanvasScroll: 'canvasScrolling',\n CanvasError: 'canvasError',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n OutsideCanvasClick: 'outsideCanvasClick',\n SDKFeatures: 'sdkFeatures',\n RequestEntities: 'REQUEST_ENTITIES',\n CanvasGeometryUpdated: 'canvasGeometryUpdated',\n CanvasPan: 'canvasPan',\n} as const;\n\nexport const INCOMING_EVENTS = {\n RequestEditorMode: 'requestEditorMode',\n RequestReadOnlyMode: 'requestReadOnlyMode',\n ExperienceUpdated: 'componentTreeUpdated',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentDraggingChanged: 'componentDraggingChanged',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentDragCanceled: 'componentDragCanceled',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentDragStarted: 'componentDragStarted',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentDragEnded: 'componentDragEnded',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentMoveEnded: 'componentMoveEnded',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n CanvasResized: 'canvasResized',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n SelectComponent: 'selectComponent',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n HoverComponent: 'hoverComponent',\n UpdatedEntity: 'updatedEntity',\n /** @deprecated not needed after `patternResolution` was introduced. Will be removed in the next major version. */\n AssembliesAdded: 'assembliesAdded',\n /** @deprecated not needed after `patternResolution` was introduced. Will be removed in the next major version. */\n AssembliesRegistered: 'assembliesRegistered',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n MouseMove: 'mouseMove',\n RequestedEntities: 'REQUESTED_ENTITIES',\n} as const;\n\nexport const INTERNAL_EVENTS = {\n ComponentsRegistered: 'cfComponentsRegistered',\n VisualEditorInitialize: 'cfVisualEditorInitialize',\n} as const;\n\nexport const VISUAL_EDITOR_EVENTS = {\n Ready: 'cfVisualEditorReady',\n};\n\n/**\n * These modes are ONLY intended to be internally used within the context of\n * editing an experience inside of Contentful Studio. i.e. these modes\n * intentionally do not include preview/delivery modes.\n */\nexport enum StudioCanvasMode {\n READ_ONLY = 'readOnlyMode',\n EDITOR = 'editorMode',\n NONE = 'none',\n}\n\nexport const VISUAL_EDITOR_CONTAINER_ID = 'cf-visual-editor';\nexport const CONTENTFUL_COMPONENT_CATEGORY = 'contentful-component';\nexport const CONTENTFUL_DEFAULT_CATEGORY = 'Contentful';\n\nexport const CONTENTFUL_COMPONENTS = {\n section: {\n id: 'contentful-section',\n name: 'Section',\n },\n container: {\n id: 'contentful-container',\n name: 'Container',\n },\n columns: {\n id: 'contentful-columns',\n name: 'Columns',\n },\n singleColumn: {\n id: 'contentful-single-column',\n name: 'Column',\n },\n button: {\n id: 'contentful-button',\n name: 'Button',\n },\n heading: {\n id: 'contentful-heading',\n name: 'Heading',\n },\n image: {\n id: 'contentful-image',\n name: 'Image',\n },\n richText: {\n id: 'contentful-richText',\n name: 'Rich Text',\n },\n text: {\n id: 'contentful-text',\n name: 'Text',\n },\n divider: {\n id: 'contentful-divider',\n name: 'Divider',\n },\n carousel: {\n id: 'contentful-carousel',\n name: 'Carousel',\n },\n} as const;\n\nexport const ASSEMBLY_NODE_TYPE = 'assembly';\nexport const ASSEMBLY_DEFAULT_CATEGORY = 'Assemblies';\nexport const ASSEMBLY_BLOCK_NODE_TYPE = 'assemblyBlock';\nexport const ASSEMBLY_NODE_TYPES = [ASSEMBLY_NODE_TYPE, ASSEMBLY_BLOCK_NODE_TYPE];\nexport const LATEST_SCHEMA_VERSION = '2023-09-28';\nexport const CF_STYLE_ATTRIBUTES = [\n 'cfVisibility',\n 'cfHorizontalAlignment',\n 'cfVerticalAlignment',\n 'cfMargin',\n 'cfPadding',\n 'cfBackgroundColor',\n 'cfWidth',\n 'cfMaxWidth',\n 'cfHeight',\n 'cfImageAsset',\n 'cfImageOptions',\n 'cfBackgroundImageUrl',\n 'cfBackgroundImageOptions',\n 'cfFlexDirection',\n 'cfFlexWrap',\n 'cfFlexReverse',\n 'cfBorder',\n 'cfBorderRadius',\n 'cfGap',\n 'cfColumnSpan',\n 'cfColumnSpanLock',\n 'cfColumns',\n 'cfFontSize',\n 'cfFontWeight',\n 'cfLineHeight',\n 'cfLetterSpacing',\n 'cfTextColor',\n 'cfTextAlign',\n 'cfTextTransform',\n 'cfTextBold',\n 'cfTextItalic',\n 'cfTextUnderline',\n];\n\nexport const EMPTY_CONTAINER_SIZE = '80px';\n\nexport const HYPERLINK_DEFAULT_PATTERN = `/{locale}/{entry.fields.slug}/`;\n\nexport enum PostMessageMethods {\n REQUEST_ENTITIES = 'REQUEST_ENTITIES',\n REQUESTED_ENTITIES = 'REQUESTED_ENTITIES',\n}\n\nexport const SUPPORTED_IMAGE_FORMATS = ['jpg', 'png', 'webp', 'gif', 'avif'] as const;\n"],"names":[],"mappings":"AAAA;AACa,MAAA,aAAa,GAAG;AAC3B,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,GAAG,EAAE,WAAW;EACP;AAEE,MAAA,eAAe,GAAG;AAC7B,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,YAAY,EAAE,sBAAsB;AACpC,IAAA,qBAAqB,EAAE,uBAAuB;;AAE9C,IAAA,SAAS,EAAE,WAAW;;AAEtB,IAAA,iBAAiB,EAAE,mBAAmB;AACtC,IAAA,oBAAoB,EAAE,sBAAsB;AAC5C,IAAA,0BAA0B,EAAE,4BAA4B;AACxD,IAAA,YAAY,EAAE,cAAc;;AAE5B,IAAA,kCAAkC,EAAE,oCAAoC;;AAExE,IAAA,YAAY,EAAE,iBAAiB;AAC/B,IAAA,WAAW,EAAE,aAAa;;AAE1B,IAAA,kBAAkB,EAAE,oBAAoB;AACxC,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,eAAe,EAAE,kBAAkB;AACnC,IAAA,qBAAqB,EA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B,EAAE;AAC3E,MAAM,qBAAqB,GAAG,aAAa;AACrC,MAAA,mBAAmB,GAAG;IACjC,cAAc;IACd,uBAAuB;IACvB,qBAAqB;IACrB,UAAU;IACV,WAAW;IACX,mBAAmB;IACnB,SAAS;IACT,YAAY;IACZ,UAAU;IACV,cAAc;IACd,gBAAgB;IAChB,sBAAsB;IACtB,0BAA0B;IAC1B,iBAAiB;IACjB,YAAY;IACZ,eAAe;IACf,UAAU;IACV,gBAAgB;IAChB,OAAO;IACP,cAAc;IACd,kBAAkB;IAClB,WAAW;IACX,YAAY;IACZ,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,aAAa;IACb,aAAa;IACb,iBAAiB;IACjB,YAAY;IACZ,cAAc;IACd,iBAAiB;EACjB;AAEK,MAAM,oBAAoB,GAAG,OAAO;AAEpC,MAAM,yBAAyB,GAAG,iCAAiC;IAE9D,mBAGX;AAHD,CAAA,UAAY,kBAAkB,EAAA;AAC5B,IAAA,kBAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC,CAAA;AACrC,IAAA,kBAAA,CAAA,oBAAA,CAAA,GAAA,oBAAyC,CAAA;AAC3C,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,GAG7B,EAAA,CAAA,CAAA,CAAA;AAEM,MAAM,uBAAuB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;;;"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { DataSourceEntryValueType, Link, ExperienceEntry, ExperienceTreeNode } from '../types.js';
|
|
2
|
-
import { Entry } from 'contentful';
|
|
3
|
-
import { EntityFromLink, EntityStoreBase } from '../entity/EntityStoreBase.js';
|
|
4
|
-
import { ExperienceDataSource } from '@contentful/experiences-validators';
|
|
5
|
-
import { PrebindingData } from '../utils/extractPrebindingData.js';
|
|
6
|
-
|
|
7
|
-
type DeepReferenceOpts = {
|
|
8
|
-
path: string;
|
|
9
|
-
dataSource: ExperienceDataSource;
|
|
10
|
-
};
|
|
11
|
-
declare class DeepReference {
|
|
12
|
-
entityId: string;
|
|
13
|
-
entityLink: DataSourceEntryValueType;
|
|
14
|
-
field: string;
|
|
15
|
-
referentField: string;
|
|
16
|
-
originalPath: string;
|
|
17
|
-
constructor({ path, dataSource }: DeepReferenceOpts);
|
|
18
|
-
get headEntityId(): string;
|
|
19
|
-
/**
|
|
20
|
-
* Extracts referent from the path, using EntityStore as source of
|
|
21
|
-
* entities during the resolution path.
|
|
22
|
-
*/
|
|
23
|
-
extractReferent(entityStore: EntityFromLink): Link<'Asset' | 'Entry'> | undefined;
|
|
24
|
-
static from(opt: DeepReferenceOpts): DeepReference;
|
|
25
|
-
}
|
|
26
|
-
declare function gatherDeepReferencesFromExperienceEntry(experienceEntry: ExperienceEntry): DeepReference[];
|
|
27
|
-
declare function gatherDeepPrebindingReferencesFromExperienceEntry({ experienceEntry, fetchedPatterns, prebindingDataByPatternId, fetchedLevel1Entries, }: {
|
|
28
|
-
experienceEntry: ExperienceEntry;
|
|
29
|
-
fetchedPatterns: Array<ExperienceEntry>;
|
|
30
|
-
prebindingDataByPatternId: Record<string, PrebindingData>;
|
|
31
|
-
fetchedLevel1Entries: Array<Entry>;
|
|
32
|
-
}): DeepReference[];
|
|
33
|
-
declare function gatherDeepPrebindingReferencesFromPatternEntry({ patternEntry, fetchedPatterns, prebindingDataByPatternId, fetchedLevel1Entries, }: {
|
|
34
|
-
patternEntry: ExperienceEntry;
|
|
35
|
-
fetchedPatterns: Array<ExperienceEntry>;
|
|
36
|
-
prebindingDataByPatternId: Record<string, PrebindingData>;
|
|
37
|
-
fetchedLevel1Entries: Array<Entry>;
|
|
38
|
-
}): DeepReference[];
|
|
39
|
-
/**
|
|
40
|
-
* used in editor mode. for delivery mode see `gatherDeepReferencesFromExperienceEntry`
|
|
41
|
-
*/
|
|
42
|
-
declare function gatherDeepReferencesFromTree(startingNode: ExperienceTreeNode, dataSource: ExperienceDataSource, getEntityFromLink: EntityStoreBase['getEntityFromLink']): DeepReference[];
|
|
43
|
-
|
|
44
|
-
export { DeepReference, gatherDeepPrebindingReferencesFromExperienceEntry, gatherDeepPrebindingReferencesFromPatternEntry, gatherDeepReferencesFromExperienceEntry, gatherDeepReferencesFromTree };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DesignVariableMap } from '../types.js';
|
|
2
|
-
|
|
3
|
-
declare const builtInStyles: Partial<DesignVariableMap>;
|
|
4
|
-
declare const optionalBuiltInStyles: Partial<DesignVariableMap>;
|
|
5
|
-
declare const sectionBuiltInStyles: Partial<DesignVariableMap>;
|
|
6
|
-
declare const containerBuiltInStyles: Partial<DesignVariableMap>;
|
|
7
|
-
declare const dividerBuiltInStyles: Partial<DesignVariableMap>;
|
|
8
|
-
declare const singleColumnBuiltInStyles: Partial<DesignVariableMap>;
|
|
9
|
-
declare const columnsBuiltInStyles: Partial<DesignVariableMap>;
|
|
10
|
-
|
|
11
|
-
export { builtInStyles, columnsBuiltInStyles, containerBuiltInStyles, dividerBuiltInStyles, optionalBuiltInStyles, sectionBuiltInStyles, singleColumnBuiltInStyles };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Entry, Asset } from 'contentful';
|
|
2
|
-
import { EntityStoreBase } from './EntityStoreBase.js';
|
|
3
|
-
import { PostMessageMethods } from '../constants.js';
|
|
4
|
-
import { RequestEntitiesMessage, RequestedEntitiesMessage } from '../types.js';
|
|
5
|
-
|
|
6
|
-
type SendMessage = (method: PostMessageMethods.REQUEST_ENTITIES, params: RequestEntitiesMessage) => void;
|
|
7
|
-
type Subscribe = (method: PostMessageMethods.REQUESTED_ENTITIES, cb: (message: RequestedEntitiesMessage) => void) => VoidFunction;
|
|
8
|
-
/**
|
|
9
|
-
* EntityStore which resolves entries and assets from the editor
|
|
10
|
-
* over the sendMessage and subscribe functions.
|
|
11
|
-
*/
|
|
12
|
-
declare abstract class EditorEntityStore extends EntityStoreBase {
|
|
13
|
-
private requestCache;
|
|
14
|
-
private sendMessage;
|
|
15
|
-
private subscribe;
|
|
16
|
-
private timeoutDuration;
|
|
17
|
-
constructor({ entities, locale, sendMessage, subscribe, timeoutDuration, }: {
|
|
18
|
-
entities: Array<Entry | Asset>;
|
|
19
|
-
locale: string;
|
|
20
|
-
sendMessage: SendMessage;
|
|
21
|
-
subscribe: Subscribe;
|
|
22
|
-
timeoutDuration?: number;
|
|
23
|
-
});
|
|
24
|
-
private cleanupPromise;
|
|
25
|
-
private cacheIdSeperator;
|
|
26
|
-
private getCacheId;
|
|
27
|
-
private fetchEntity;
|
|
28
|
-
fetchAsset(id: string, skipCache?: boolean): Promise<Asset | undefined>;
|
|
29
|
-
fetchAssets(ids: string[], skipCache?: boolean): Promise<Asset[]>;
|
|
30
|
-
fetchEntry(id: string, skipCache?: boolean): Promise<Entry | undefined>;
|
|
31
|
-
fetchEntries(ids: string[], skipCache?: boolean): Promise<Entry[]>;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export { EditorEntityStore };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Asset, Entry, UnresolvedLink } from 'contentful';
|
|
2
|
-
import { EditorEntityStore } from './EditorEntityStore.js';
|
|
3
|
-
|
|
4
|
-
declare class EditorModeEntityStore extends EditorEntityStore {
|
|
5
|
-
constructor({ entities, locale }: {
|
|
6
|
-
entities: Array<Asset | Entry>;
|
|
7
|
-
locale: string;
|
|
8
|
-
});
|
|
9
|
-
/**
|
|
10
|
-
* This function collects and returns the list of requested entries and assets. Additionally, it checks
|
|
11
|
-
* upfront whether any async fetching logic is actually happening. If not, it returns a plain `false` value, so we
|
|
12
|
-
* can detect this early and avoid unnecessary re-renders.
|
|
13
|
-
* @param entityLinks
|
|
14
|
-
* @returns false if no async fetching is happening, otherwise a promise that resolves when all entities are fetched
|
|
15
|
-
*/
|
|
16
|
-
fetchEntities({ missingEntryIds, missingAssetIds, skipCache, }: {
|
|
17
|
-
missingEntryIds: string[];
|
|
18
|
-
missingAssetIds: string[];
|
|
19
|
-
skipCache?: boolean;
|
|
20
|
-
}): Promise<void>;
|
|
21
|
-
getMissingEntityIds(entityLinks: UnresolvedLink<'Entry' | 'Asset'>[]): {
|
|
22
|
-
missingEntryIds: string[];
|
|
23
|
-
missingAssetIds: string[];
|
|
24
|
-
};
|
|
25
|
-
getValue(entityLinkOrEntity: UnresolvedLink<'Entry' | 'Asset'> | Entry | Asset, path: string[]): string | undefined;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { EditorModeEntityStore };
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import * as contentful from 'contentful';
|
|
2
|
-
import { UnresolvedLink, Entry, Asset } from 'contentful';
|
|
3
|
-
import { ExperienceFields, ExperienceEntry } from '../types.js';
|
|
4
|
-
import { EntityStoreBase } from './EntityStoreBase.js';
|
|
5
|
-
import { ExperienceUnboundValues } from '@contentful/experiences-validators';
|
|
6
|
-
|
|
7
|
-
type EntityStoreArgs = {
|
|
8
|
-
experienceEntry: ExperienceEntry | Entry;
|
|
9
|
-
entities: Array<Entry | Asset>;
|
|
10
|
-
locale: string;
|
|
11
|
-
};
|
|
12
|
-
declare class EntityStore extends EntityStoreBase {
|
|
13
|
-
private _isExperienceAPatternEntry;
|
|
14
|
-
private _experienceEntryFields;
|
|
15
|
-
private _experienceEntryId;
|
|
16
|
-
private _unboundValues;
|
|
17
|
-
private _usedComponentsWithDeepReferences;
|
|
18
|
-
private _hoistedParameterDefinitions;
|
|
19
|
-
private _hoistedVariableMappings;
|
|
20
|
-
constructor(json: string);
|
|
21
|
-
constructor({ experienceEntry, entities, locale }: EntityStoreArgs);
|
|
22
|
-
private static calculateHoistedParameterDefinitions;
|
|
23
|
-
private static calculateHoistedVariableMappings;
|
|
24
|
-
getCurrentLocale(): string;
|
|
25
|
-
get isExperienceAPatternEntry(): boolean;
|
|
26
|
-
get hoistedVariableMappings(): Record<string, {
|
|
27
|
-
type: "ContentTypeMapping";
|
|
28
|
-
parameterId: string;
|
|
29
|
-
pathsByContentType: Record<string, {
|
|
30
|
-
path: string;
|
|
31
|
-
}>;
|
|
32
|
-
}>;
|
|
33
|
-
get hoistedParameterDefinitions(): Record<string, {
|
|
34
|
-
contentTypes: string[];
|
|
35
|
-
passToNodes: {
|
|
36
|
-
prebindingId: string;
|
|
37
|
-
parameterId: string;
|
|
38
|
-
nodeId: string;
|
|
39
|
-
}[];
|
|
40
|
-
defaultSource?: {
|
|
41
|
-
type: "Entry";
|
|
42
|
-
contentTypeId: string;
|
|
43
|
-
link: {
|
|
44
|
-
sys: {
|
|
45
|
-
type: "Link";
|
|
46
|
-
id: string;
|
|
47
|
-
linkType: "Entry";
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
} | undefined;
|
|
51
|
-
}>;
|
|
52
|
-
get experienceEntryFields(): ExperienceFields | undefined;
|
|
53
|
-
get experienceEntryId(): string | undefined;
|
|
54
|
-
get schemaVersion(): "2023-09-28" | undefined;
|
|
55
|
-
get breakpoints(): {
|
|
56
|
-
id: string;
|
|
57
|
-
query: "*" | `>${number}px` | `<${number}px`;
|
|
58
|
-
displayName: string;
|
|
59
|
-
previewSize?: string | undefined;
|
|
60
|
-
displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
|
|
61
|
-
}[];
|
|
62
|
-
get dataSource(): Record<string, {
|
|
63
|
-
sys: {
|
|
64
|
-
type: "Link";
|
|
65
|
-
id: string;
|
|
66
|
-
linkType: "Entry" | "Asset";
|
|
67
|
-
};
|
|
68
|
-
}>;
|
|
69
|
-
get unboundValues(): Record<string, {
|
|
70
|
-
value?: string | number | boolean | Record<any, any> | undefined;
|
|
71
|
-
}>;
|
|
72
|
-
get usedComponents(): ExperienceEntry[];
|
|
73
|
-
/**
|
|
74
|
-
* Extend the existing set of unbound values with the ones from the assembly definition.
|
|
75
|
-
* When creating a new assembly out of a container, the unbound value keys are copied and
|
|
76
|
-
* thus the existing and the added ones have colliding keys. In the case of overlapping value
|
|
77
|
-
* keys, the ones from the experience overrule the ones from the assembly definition as
|
|
78
|
-
* the latter one is certainly just a default value while the other one is from the actual instance.
|
|
79
|
-
* @param unboundValues set of unbound values defined in the assembly definition
|
|
80
|
-
*/
|
|
81
|
-
addAssemblyUnboundValues(unboundValues: ExperienceUnboundValues): void;
|
|
82
|
-
getValue(entityLinkOrEntity: UnresolvedLink<'Entry' | 'Asset'> | Entry | Asset, path: string[]): string | undefined;
|
|
83
|
-
toJSON(): {
|
|
84
|
-
entryMap: {
|
|
85
|
-
[k: string]: Entry;
|
|
86
|
-
};
|
|
87
|
-
assetMap: {
|
|
88
|
-
[k: string]: Asset<contentful.ChainModifiers, string>;
|
|
89
|
-
};
|
|
90
|
-
locale: string;
|
|
91
|
-
_experienceEntryFields: ExperienceFields | undefined;
|
|
92
|
-
_experienceEntryId: string | undefined;
|
|
93
|
-
_unboundValues: Record<string, {
|
|
94
|
-
value?: string | number | boolean | Record<any, any> | undefined;
|
|
95
|
-
}> | undefined;
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export { EntityStore };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Entry, Asset, ChainModifiers, UnresolvedLink } from 'contentful';
|
|
2
|
-
|
|
3
|
-
interface EntityFromLink {
|
|
4
|
-
getEntityFromLink(link: UnresolvedLink<'Entry' | 'Asset'>): Asset | Entry | undefined;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Base Store for entities
|
|
8
|
-
* Can be extended for the different loading behaviours (editor, production, ..)
|
|
9
|
-
*/
|
|
10
|
-
declare abstract class EntityStoreBase implements EntityFromLink {
|
|
11
|
-
locale: string;
|
|
12
|
-
protected entryMap: Map<string, Entry>;
|
|
13
|
-
protected assetMap: Map<string, Asset<ChainModifiers, string>>;
|
|
14
|
-
constructor({ entities, locale }: {
|
|
15
|
-
entities: Array<Entry | Asset>;
|
|
16
|
-
locale: string;
|
|
17
|
-
});
|
|
18
|
-
get entities(): (Entry | Asset<ChainModifiers, string>)[];
|
|
19
|
-
updateEntity(entity: Entry | Asset): void;
|
|
20
|
-
getEntryOrAsset(linkOrEntryOrAsset: UnresolvedLink<'Entry' | 'Asset'> | Asset | Entry, path: string): Entry | Asset | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated in the base class this should be simply an abstract method
|
|
23
|
-
* @param entityLink
|
|
24
|
-
* @param path
|
|
25
|
-
* @returns
|
|
26
|
-
*/
|
|
27
|
-
getValue(entityLink: UnresolvedLink<'Entry' | 'Asset'>, path: string[]): string | undefined;
|
|
28
|
-
getEntityFromLink(link: UnresolvedLink<'Entry' | 'Asset'>): Asset | Entry | undefined;
|
|
29
|
-
getAssetById(assetId: string): Asset | undefined;
|
|
30
|
-
getEntryById(entryId: string): Entry | undefined;
|
|
31
|
-
protected getEntitiesFromMap(type: 'Entry' | 'Asset', ids: string[]): {
|
|
32
|
-
resolved: (Entry | Asset<ChainModifiers, string>)[];
|
|
33
|
-
missing: string[];
|
|
34
|
-
};
|
|
35
|
-
protected addEntity(entity: Entry | Asset): void;
|
|
36
|
-
fetchAsset(id: string): Promise<Asset | undefined>;
|
|
37
|
-
fetchAssets(ids: string[]): Promise<Asset[]>;
|
|
38
|
-
fetchEntry(id: string): Promise<Entry | undefined>;
|
|
39
|
-
fetchEntries(ids: string[]): Promise<Entry[]>;
|
|
40
|
-
private getDeepEntry;
|
|
41
|
-
private getEntity;
|
|
42
|
-
toJSON(): {
|
|
43
|
-
entryMap: {
|
|
44
|
-
[k: string]: Entry;
|
|
45
|
-
};
|
|
46
|
-
assetMap: {
|
|
47
|
-
[k: string]: Asset<ChainModifiers, string>;
|
|
48
|
-
};
|
|
49
|
-
locale: string;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export { type EntityFromLink, EntityStoreBase };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { UnresolvedLink, Entry, Asset } from 'contentful';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Resolves a link to its corresponding entry or asset if available.
|
|
5
|
-
*
|
|
6
|
-
* @note When using this function please ensure to explicitly handle `undefined` values in
|
|
7
|
-
* your component to protect against scenarios where the property was not yet bound to an
|
|
8
|
-
* entity inside the editor UI. The SDK will set the property to `undefined` in those cases.
|
|
9
|
-
* You can use the SDK helper functions `isLink`, `isLinkToEntry`, `isLinkToAsset`, or
|
|
10
|
-
* `isArrayOfLinks` for this purpose.
|
|
11
|
-
*/
|
|
12
|
-
declare function maybeResolveLink(maybeLink: UnresolvedLink<'Entry'>): Entry | undefined;
|
|
13
|
-
declare function maybeResolveLink(maybeLink: UnresolvedLink<'Asset'>): Asset | undefined;
|
|
14
|
-
declare function maybeResolveLink(maybeLink: UnresolvedLink<'Asset' | 'Entry'>): Asset | Entry | undefined;
|
|
15
|
-
declare function maybeResolveLink(maybeLink: NonNullable<unknown>): Entry | Asset | undefined;
|
|
16
|
-
declare function maybeResolveByAssetId(assetId: string): Asset | undefined;
|
|
17
|
-
declare function maybeResolveByEntryId(entryId: string): Entry | undefined;
|
|
18
|
-
declare function hasEntry(entryId: string): boolean;
|
|
19
|
-
declare function hasAsset(assetId: string): boolean;
|
|
20
|
-
declare function addEntities(entities: Array<Entry>): void;
|
|
21
|
-
declare function addEntities(entities: Array<Asset>): void;
|
|
22
|
-
declare function addEntities(entities: Array<Entry | Asset>): void;
|
|
23
|
-
declare const inMemoryEntities: {
|
|
24
|
-
maybeResolveLink: typeof maybeResolveLink;
|
|
25
|
-
maybeResolveByAssetId: typeof maybeResolveByAssetId;
|
|
26
|
-
maybeResolveByEntryId: typeof maybeResolveByEntryId;
|
|
27
|
-
hasEntry: typeof hasEntry;
|
|
28
|
-
hasAsset: typeof hasAsset;
|
|
29
|
-
addEntities: typeof addEntities;
|
|
30
|
-
};
|
|
31
|
-
type InMemoryEntitiesPublicApi = typeof inMemoryEntities;
|
|
32
|
-
declare const useInMemoryEntities: () => {
|
|
33
|
-
maybeResolveLink: typeof maybeResolveLink;
|
|
34
|
-
maybeResolveByAssetId: typeof maybeResolveByAssetId;
|
|
35
|
-
maybeResolveByEntryId: typeof maybeResolveByEntryId;
|
|
36
|
-
hasEntry: typeof hasEntry;
|
|
37
|
-
hasAsset: typeof hasAsset;
|
|
38
|
-
addEntities: typeof addEntities;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export { type InMemoryEntitiesPublicApi, inMemoryEntities, useInMemoryEntities };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as zustand from 'zustand';
|
|
2
|
-
import { EntityStoreBase } from './EntityStoreBase.js';
|
|
3
|
-
import { UnresolvedLink, Entry, Asset } from 'contentful';
|
|
4
|
-
|
|
5
|
-
interface InMemoryEntitiesState {
|
|
6
|
-
entityStore: EntityStoreBase;
|
|
7
|
-
areEntitiesFetched: boolean;
|
|
8
|
-
setEntitiesFetched: (fetched: boolean) => void;
|
|
9
|
-
resolveEntity: <T extends 'Entry' | 'Asset'>(link?: UnresolvedLink<T>) => Entry | Asset | undefined;
|
|
10
|
-
resolveAssetById: (assetId?: string) => Asset | undefined;
|
|
11
|
-
resolveEntryById: (entryId?: string) => Entry | undefined;
|
|
12
|
-
resetEntityStore: (entityStore: EntityStoreBase) => void;
|
|
13
|
-
}
|
|
14
|
-
declare const inMemoryEntitiesStore: zustand.UseBoundStore<zustand.StoreApi<InMemoryEntitiesState>>;
|
|
15
|
-
type InMemoryEntitiesStore = typeof inMemoryEntitiesStore;
|
|
16
|
-
|
|
17
|
-
export { type InMemoryEntitiesState, type InMemoryEntitiesStore, inMemoryEntitiesStore };
|
package/dist/enums.d.ts
DELETED
package/dist/exports.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { ASSEMBLY_BLOCK_NODE_TYPE, ASSEMBLY_DEFAULT_CATEGORY, ASSEMBLY_NODE_TYPE, ASSEMBLY_NODE_TYPES, CF_STYLE_ATTRIBUTES, CONTENTFUL_COMPONENTS, CONTENTFUL_COMPONENT_CATEGORY, CONTENTFUL_DEFAULT_CATEGORY, EMPTY_CONTAINER_SIZE, HYPERLINK_DEFAULT_PATTERN, INCOMING_EVENTS, INTERNAL_EVENTS, LATEST_SCHEMA_VERSION, OUTGOING_EVENTS, PostMessageMethods, SCROLL_STATES, SUPPORTED_IMAGE_FORMATS, StudioCanvasMode, VISUAL_EDITOR_CONTAINER_ID, VISUAL_EDITOR_EVENTS } from './constants.js';
|
|
2
|
-
export { AssembliesAddedPayload, AssembliesRegisteredPayload, BackgroundImageAlignmentOption, BackgroundImageOptions, BackgroundImageScalingOption, Binding, BindingMap, BindingMapByBlockId, BoundComponentPropertyTypes, CSSProperties, CanvasErrorPayload, CanvasGeometryUpdateSourceEvent, CanvasReloadPayload, CanvasResizedPayload, CanvasScrollPayload, ComponentBinding, ComponentDefinition, ComponentDefinitionVariable, ComponentDefinitionVariableBase, ComponentDefinitionVariableTypeMap, ComponentDefinitionVariableValidation, ComponentDragCanceledPayload, ComponentDragEndedPayload, ComponentDragStartedPayload, ComponentDraggingChangedPayload, ComponentDroppedPayload, ComponentMoveEndedPayload, ComponentMoveStartedPayload, ComponentMovedPayload, ComponentRegistration, ComponentRegistrationOptions, ComponentSelectedPayload, ConnectedPayload, ContainerStyleVariableName, Coordinates, DataSourceEntryValueType, DesignTokensDefinition, DesignTokensPayload, DesignVariableMap, DesignVariableTypes, EditorProperties, EditorPropertyNames, Experience, ExperienceEntry, ExperienceFields, ExperienceTree, ExperienceTreeNode, ExperienceUpdatedPayload, HoverComponentPayload, HoveredElement, ImageLoadingOption, ImageObjectFitOption, ImageObjectPositionOption, ImageOptions, IncomingComponentDragCanceledPayload, IncomingComponentMoveEndedPayload, IncomingEvent, IncomingMessage, IncomingMouseMovePayload, InternalEvent, Link, ManagementEntity, MouseMovePayload, NewHoveredElementPayload, OptimizedBackgroundImageAsset, OptimizedImageAsset, OutgoingEvent, OutgoingMessage, OutsideCanvasClickPayload, RawCoordinates, RecursiveDesignTokenDefinition, RegisteredBreakpointsPayload, RegisteredComponentsPayload, RequestComponentTreeUpdatePayload, RequestEditorModePayload, RequestEntitiesMessage, RequestEntitiesPayload, RequestReadOnlyModePayload, RequestedEntitiesMessage, RequestedEntitiesPayload, ResolveDesignValueType, SDKFeaturesPayload, ScrollState, SdkOptions, SelectComponentPayload, SendMessageParams, StyleProps, UpdateSelectedComponentCoordinatesPayload, UpdatedEntityPayload, ValidationOption, VariableFormats } from './types.js';
|
|
3
|
-
export { BoundValue, Breakpoint, ComponentDefinitionPropertyType as ComponentDefinitionVariableType, ComponentPropertyValue, ComponentTreeNode, ComponentValue, DesignValue, ExperienceComponentSettings, ExperienceDataSource, ExperienceUnboundValues, NoValue, Parameter, ParameterDefinition, PrimitiveValue, SchemaVersions, UnboundValue, ValuesByBreakpoint, VariableMapping } from '@contentful/experiences-validators';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Entry, Asset } from 'contentful';
|
|
2
|
-
import { Experience } from '../types.js';
|
|
3
|
-
import { EntityStore } from '../entity/EntityStore.js';
|
|
4
|
-
|
|
5
|
-
type CreateExperienceParams = {
|
|
6
|
-
experienceEntry: Entry;
|
|
7
|
-
referencedEntries: Array<Entry>;
|
|
8
|
-
referencedAssets: Array<Asset>;
|
|
9
|
-
locale: string;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Create an experience instance using a serialized version of the entity store for SSR purposes.
|
|
13
|
-
* @param {string} json - JSON representation of the experience
|
|
14
|
-
*/
|
|
15
|
-
declare function createExperience(json: string): Experience<EntityStore>;
|
|
16
|
-
/**
|
|
17
|
-
* Create an experience instance using the already fetched entries and assets.
|
|
18
|
-
* @param options.experienceEntry - Localized experience entry which will be rendered
|
|
19
|
-
* @param options.referencedEntries - Array of localized entries which are referenced by the experience entry in its dataSource
|
|
20
|
-
* @param options.referencedAssets - Array of localized assets which are referenced by the experience entry in its dataSource
|
|
21
|
-
* @param options.locale - (Soon to be removed unused parameter)
|
|
22
|
-
*/
|
|
23
|
-
declare function createExperience(options: CreateExperienceParams): Experience<EntityStore>;
|
|
24
|
-
|
|
25
|
-
export { createExperience };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ContentfulClientApi, Entry, Asset } from 'contentful';
|
|
2
|
-
import { MinimalEntryCollection } from './gatherAutoFetchedReferentsFromIncludes.js';
|
|
3
|
-
|
|
4
|
-
declare const fetchAllEntries: ({ client, ids, locale, skip, limit, responseItems, responseIncludes, }: {
|
|
5
|
-
client: ContentfulClientApi<undefined> | ContentfulClientApi<"WITH_ALL_LOCALES">;
|
|
6
|
-
ids: string[];
|
|
7
|
-
locale?: string;
|
|
8
|
-
skip?: number;
|
|
9
|
-
limit?: number;
|
|
10
|
-
responseItems?: Entry[];
|
|
11
|
-
responseIncludes?: MinimalEntryCollection["includes"];
|
|
12
|
-
}) => Promise<{
|
|
13
|
-
items: Entry[];
|
|
14
|
-
includes: {
|
|
15
|
-
Entry: Entry[];
|
|
16
|
-
Asset: Asset[];
|
|
17
|
-
};
|
|
18
|
-
}>;
|
|
19
|
-
declare const fetchAllAssets: ({ client, ids, locale, skip, limit, responseItems, }: {
|
|
20
|
-
client: ContentfulClientApi<undefined> | ContentfulClientApi<"WITH_ALL_LOCALES">;
|
|
21
|
-
ids: string[];
|
|
22
|
-
locale?: string;
|
|
23
|
-
skip?: number;
|
|
24
|
-
limit?: number;
|
|
25
|
-
responseItems?: Asset[];
|
|
26
|
-
}) => Promise<{
|
|
27
|
-
items: Asset[];
|
|
28
|
-
}>;
|
|
29
|
-
|
|
30
|
-
export { fetchAllAssets, fetchAllEntries };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Experience } from '../types.js';
|
|
2
|
-
import { ContentfulClientApi } from 'contentful';
|
|
3
|
-
import { EntityStore } from '../entity/EntityStore.js';
|
|
4
|
-
|
|
5
|
-
type FetchByIdParams = {
|
|
6
|
-
/** instantiated client from the Contentful SDK */
|
|
7
|
-
client: ContentfulClientApi<undefined>;
|
|
8
|
-
/** id of the content type associated with the experience */
|
|
9
|
-
experienceTypeId: string;
|
|
10
|
-
/** id of the experience (defined in entry settings) */
|
|
11
|
-
id: string;
|
|
12
|
-
/** locale code to fetch the experience */
|
|
13
|
-
localeCode: string;
|
|
14
|
-
/** if the experience is being loaded in the Contentful Studio editor or not. If true, this function is a noop. */
|
|
15
|
-
isEditorMode?: boolean;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Fetches an experience entry by its id and additionally fetches all its references to return
|
|
19
|
-
* an initilized experience instance.
|
|
20
|
-
* @param {FetchByIdParams} options - options to fetch the experience
|
|
21
|
-
*/
|
|
22
|
-
declare function fetchById({ client, experienceTypeId, id, localeCode, isEditorMode, }: FetchByIdParams): Promise<Experience<EntityStore> | undefined>;
|
|
23
|
-
|
|
24
|
-
export { fetchById };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Experience } from '../types.js';
|
|
2
|
-
import { ContentfulClientApi } from 'contentful';
|
|
3
|
-
import { EntityStore } from '../entity/EntityStore.js';
|
|
4
|
-
|
|
5
|
-
type FetchBySlugParams = {
|
|
6
|
-
/** instantiated client from the Contentful SDK */
|
|
7
|
-
client: ContentfulClientApi<undefined>;
|
|
8
|
-
/** id of the content type associated with the experience */
|
|
9
|
-
experienceTypeId: string;
|
|
10
|
-
/** slug of the experience (defined in entry settings) */
|
|
11
|
-
slug: string;
|
|
12
|
-
/** locale code to fetch the experience */
|
|
13
|
-
localeCode: string;
|
|
14
|
-
/** if the experience is being loaded in the Contentful Studio editor or not. If true, this function is a noop. */
|
|
15
|
-
isEditorMode?: boolean;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Fetches an experience entry by its slug and additionally fetches all its references to return
|
|
19
|
-
* an initilized experience instance.
|
|
20
|
-
* @param {FetchBySlugParams} options - options to fetch the experience
|
|
21
|
-
*/
|
|
22
|
-
declare function fetchBySlug({ client, experienceTypeId, slug, localeCode, isEditorMode, }: FetchBySlugParams): Promise<Experience<EntityStore> | undefined>;
|
|
23
|
-
|
|
24
|
-
export { fetchBySlug };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Entry, ContentfulClientApi } from 'contentful';
|
|
2
|
-
|
|
3
|
-
type ClientAndLocaleParams = {
|
|
4
|
-
client: ContentfulClientApi<undefined>;
|
|
5
|
-
locale?: string;
|
|
6
|
-
} | {
|
|
7
|
-
client: ContentfulClientApi<'WITH_ALL_LOCALES'>;
|
|
8
|
-
/** When fetching all locales, this may not be defined */
|
|
9
|
-
locale?: undefined;
|
|
10
|
-
};
|
|
11
|
-
type FetchExperienceEntryParams = {
|
|
12
|
-
experienceTypeId: string;
|
|
13
|
-
identifier: {
|
|
14
|
-
slug: string;
|
|
15
|
-
} | {
|
|
16
|
-
id: string;
|
|
17
|
-
};
|
|
18
|
-
} & ClientAndLocaleParams;
|
|
19
|
-
/**
|
|
20
|
-
* Fetches an experience entry by its slug or id. Throws an error if there are multiple
|
|
21
|
-
* entries with the same slug. Additionally, it resolves all nested pattern entries inside `fields.usedComponents`.
|
|
22
|
-
* @param options.client - Instantiated client from the Contentful SDK. If this is using the `withAllLocales` modifier, you may not provide a specific locale.
|
|
23
|
-
* @param options.locale - Provide a locale if your experience contains custom localized fields. Otherwise, it will fallback to the default locale.
|
|
24
|
-
* @param options.experienceTypeId - id of the content type associated with the experience
|
|
25
|
-
* @param options.identifier - identifying condition to find the correct experience entry
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
|
-
declare const fetchExperienceEntry: ({ client, experienceTypeId, locale, identifier, }: FetchExperienceEntryParams) => Promise<Entry | undefined>;
|
|
29
|
-
|
|
30
|
-
export { fetchExperienceEntry };
|