@contentful/experiences-core 3.8.0-dev-20250925T1014-c658e71.0 → 3.8.0-dev-20250926T1559-e1ab24d.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 +0 -4
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.ts +1 -3
- package/dist/constants.js +1 -3
- package/dist/constants.js.map +1 -1
- package/dist/entity/EntityStore.d.ts +2 -0
- package/dist/exports.d.ts +1 -1
- package/dist/index.cjs +23 -91
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -91
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/constants.cjs
CHANGED
|
@@ -172,8 +172,6 @@ exports.PostMessageMethods = void 0;
|
|
|
172
172
|
PostMessageMethods["REQUESTED_ENTITIES"] = "REQUESTED_ENTITIES";
|
|
173
173
|
})(exports.PostMessageMethods || (exports.PostMessageMethods = {}));
|
|
174
174
|
const SUPPORTED_IMAGE_FORMATS = ['jpg', 'png', 'webp', 'gif', 'avif'];
|
|
175
|
-
const PATTERN_PROPERTY_DIVIDER = '-----';
|
|
176
|
-
const SIDELOADED_PREFIX = 'sideloaded_';
|
|
177
175
|
|
|
178
176
|
exports.ASSEMBLY_BLOCK_NODE_TYPE = ASSEMBLY_BLOCK_NODE_TYPE;
|
|
179
177
|
exports.ASSEMBLY_DEFAULT_CATEGORY = ASSEMBLY_DEFAULT_CATEGORY;
|
|
@@ -189,9 +187,7 @@ exports.INCOMING_EVENTS = INCOMING_EVENTS;
|
|
|
189
187
|
exports.INTERNAL_EVENTS = INTERNAL_EVENTS;
|
|
190
188
|
exports.LATEST_SCHEMA_VERSION = LATEST_SCHEMA_VERSION;
|
|
191
189
|
exports.OUTGOING_EVENTS = OUTGOING_EVENTS;
|
|
192
|
-
exports.PATTERN_PROPERTY_DIVIDER = PATTERN_PROPERTY_DIVIDER;
|
|
193
190
|
exports.SCROLL_STATES = SCROLL_STATES;
|
|
194
|
-
exports.SIDELOADED_PREFIX = SIDELOADED_PREFIX;
|
|
195
191
|
exports.SUPPORTED_IMAGE_FORMATS = SUPPORTED_IMAGE_FORMATS;
|
|
196
192
|
exports.VISUAL_EDITOR_CONTAINER_ID = VISUAL_EDITOR_CONTAINER_ID;
|
|
197
193
|
exports.VISUAL_EDITOR_EVENTS = VISUAL_EDITOR_EVENTS;
|
package/dist/constants.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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":["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AGX;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.d.ts
CHANGED
|
@@ -135,7 +135,5 @@ declare enum PostMessageMethods {
|
|
|
135
135
|
REQUESTED_ENTITIES = "REQUESTED_ENTITIES"
|
|
136
136
|
}
|
|
137
137
|
declare const SUPPORTED_IMAGE_FORMATS: readonly ["jpg", "png", "webp", "gif", "avif"];
|
|
138
|
-
declare const PATTERN_PROPERTY_DIVIDER = "-----";
|
|
139
|
-
declare const SIDELOADED_PREFIX = "sideloaded_";
|
|
140
138
|
|
|
141
|
-
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,
|
|
139
|
+
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 };
|
package/dist/constants.js
CHANGED
|
@@ -170,8 +170,6 @@ var PostMessageMethods;
|
|
|
170
170
|
PostMessageMethods["REQUESTED_ENTITIES"] = "REQUESTED_ENTITIES";
|
|
171
171
|
})(PostMessageMethods || (PostMessageMethods = {}));
|
|
172
172
|
const SUPPORTED_IMAGE_FORMATS = ['jpg', 'png', 'webp', 'gif', 'avif'];
|
|
173
|
-
const PATTERN_PROPERTY_DIVIDER = '-----';
|
|
174
|
-
const SIDELOADED_PREFIX = 'sideloaded_';
|
|
175
173
|
|
|
176
|
-
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,
|
|
174
|
+
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 };
|
|
177
175
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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,EA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AA,CAAA,CAAA,CAAA;AAEM,MAAM,uBAAuB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;;;"}
|
|
@@ -10,6 +10,7 @@ type EntityStoreArgs = {
|
|
|
10
10
|
locale: string;
|
|
11
11
|
};
|
|
12
12
|
declare class EntityStore extends EntityStoreBase {
|
|
13
|
+
private _isExperienceAPatternEntry;
|
|
13
14
|
private _experienceEntryFields;
|
|
14
15
|
private _experienceEntryId;
|
|
15
16
|
private _unboundValues;
|
|
@@ -21,6 +22,7 @@ declare class EntityStore extends EntityStoreBase {
|
|
|
21
22
|
private static calculateHoistedParameterDefinitions;
|
|
22
23
|
private static calculateHoistedVariableMappings;
|
|
23
24
|
getCurrentLocale(): string;
|
|
25
|
+
get isExperienceAPatternEntry(): boolean;
|
|
24
26
|
get hoistedVariableMappings(): Record<string, {
|
|
25
27
|
type: "ContentTypeMapping";
|
|
26
28
|
parameterId: string;
|
package/dist/exports.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
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,
|
|
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
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
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';
|
package/dist/index.cjs
CHANGED
|
@@ -137,7 +137,6 @@ var PostMessageMethods;
|
|
|
137
137
|
PostMessageMethods["REQUESTED_ENTITIES"] = "REQUESTED_ENTITIES";
|
|
138
138
|
})(PostMessageMethods || (PostMessageMethods = {}));
|
|
139
139
|
const SUPPORTED_IMAGE_FORMATS = ['jpg', 'png', 'webp', 'gif', 'avif'];
|
|
140
|
-
const SIDELOADED_PREFIX = 'sideloaded_';
|
|
141
140
|
|
|
142
141
|
const structureComponentIds = new Set([
|
|
143
142
|
CONTENTFUL_COMPONENTS.section.id,
|
|
@@ -990,6 +989,16 @@ const ComponentVariableSchema = zod.z.object({
|
|
|
990
989
|
});
|
|
991
990
|
const ComponentTreeNodeSchema = BaseComponentTreeNodeSchema.extend({
|
|
992
991
|
children: zod.z.lazy(() => ComponentTreeNodeSchema.array()),
|
|
992
|
+
}).superRefine(({ id, prebindingId, parameters }, ctx) => {
|
|
993
|
+
// We don't fail if parameters are present but prebindingId is not because
|
|
994
|
+
// older experiences (updated before 21-09-2025) always included parameters
|
|
995
|
+
// and they will start failing if we do.
|
|
996
|
+
if (prebindingId && !parameters) {
|
|
997
|
+
ctx.addIssue({
|
|
998
|
+
code: zod.z.ZodIssueCode.custom,
|
|
999
|
+
message: `Found "prebindingId" but no "parameters" for node with id: "${id}"`,
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
993
1002
|
});
|
|
994
1003
|
const ComponentTreeSchema = zod.z
|
|
995
1004
|
.object({
|
|
@@ -1990,6 +1999,9 @@ const getPrebindingPathBySourceEntry = (preboundValueProperty, getHeadEntityByDa
|
|
|
1990
1999
|
return undefined;
|
|
1991
2000
|
}
|
|
1992
2001
|
const contentTypeId = headEntity.sys.contentType.sys.id;
|
|
2002
|
+
if (!preboundValueProperty.pathsByContentType?.[contentTypeId]) {
|
|
2003
|
+
return undefined;
|
|
2004
|
+
}
|
|
1993
2005
|
return preboundValueProperty.pathsByContentType?.[contentTypeId]?.path;
|
|
1994
2006
|
};
|
|
1995
2007
|
const parseDeepPath = (deepPathCandidate) => {
|
|
@@ -2413,6 +2425,7 @@ const detachExperienceStyles = (experience) => {
|
|
|
2413
2425
|
if (!experienceTreeRoot) {
|
|
2414
2426
|
return;
|
|
2415
2427
|
}
|
|
2428
|
+
const isRenderingAPatternEntry = experience.entityStore?.isExperienceAPatternEntry;
|
|
2416
2429
|
const mapOfDesignVariableKeys = flattenDesignTokenRegistry(exports.designTokensRegistry);
|
|
2417
2430
|
// getting breakpoints from the entry componentTree field
|
|
2418
2431
|
const { breakpoints } = experienceTreeRoot;
|
|
@@ -2427,7 +2440,7 @@ const detachExperienceStyles = (experience) => {
|
|
|
2427
2440
|
}), {});
|
|
2428
2441
|
// getting the breakpoint ids
|
|
2429
2442
|
const breakpointIds = Object.keys(mediaQueryDataByBreakpoint);
|
|
2430
|
-
const iterateOverTreeAndExtractStyles = ({ componentTree, dataSource, unboundValues, componentSettings, componentVariablesOverwrites, patternWrapper, wrappingPatternIds, wrappingPatternNodeIds = [], }) => {
|
|
2443
|
+
const iterateOverTreeAndExtractStyles = ({ componentTree, dataSource, unboundValues, componentSettings, componentVariablesOverwrites, patternWrapper, wrappingPatternIds, wrappingPatternNodeIds = isRenderingAPatternEntry ? ['root'] : [], }) => {
|
|
2431
2444
|
// traversing the tree
|
|
2432
2445
|
const queue = [];
|
|
2433
2446
|
queue.push(...componentTree.children);
|
|
@@ -2518,7 +2531,7 @@ const detachExperienceStyles = (experience) => {
|
|
|
2518
2531
|
// Chain IDs to avoid overwriting styles across multiple instances of the same pattern
|
|
2519
2532
|
// e.g. `{outerPatternNodeId}{innerPatternNodeId}-{currentNodeId}`
|
|
2520
2533
|
// (!) Notice that the chain of patterns (before the dash) follows the format of prebinding/ parameters
|
|
2521
|
-
const currentNodeIdsChain =
|
|
2534
|
+
const currentNodeIdsChain = [...wrappingPatternNodeIds, currentNode.id].join('-');
|
|
2522
2535
|
// For each breakpoint, resolve design tokens, create the CSS and generate a unique className.
|
|
2523
2536
|
for (const breakpointId of breakpointIds) {
|
|
2524
2537
|
const propsByBreakpointWithResolvedDesignTokens = Object.entries(propsByBreakpoint[breakpointId]).reduce((acc, [variableName, variableValue]) => {
|
|
@@ -3693,7 +3706,7 @@ const generateDefaultDataSourceForPrebindingDefinition = (prebindingDefinitions
|
|
|
3693
3706
|
const parameters = {};
|
|
3694
3707
|
for (const [parameterId, parameterDefinition] of Object.entries(prebindingDefinition.parameterDefinitions ?? {})) {
|
|
3695
3708
|
if (parameterDefinition.defaultSource && isLink(parameterDefinition.defaultSource.link)) {
|
|
3696
|
-
const dataSourceKey =
|
|
3709
|
+
const dataSourceKey = parameterDefinition.defaultSource.link.sys.id;
|
|
3697
3710
|
dataSource[dataSourceKey] = parameterDefinition.defaultSource.link;
|
|
3698
3711
|
parameters[parameterId] = {
|
|
3699
3712
|
type: 'BoundValue',
|
|
@@ -4234,6 +4247,9 @@ class EntityStore extends EntityStoreBase {
|
|
|
4234
4247
|
this._experienceEntryId = experienceEntry.sys.id;
|
|
4235
4248
|
this._unboundValues = experienceEntry.fields.unboundValues;
|
|
4236
4249
|
}
|
|
4250
|
+
this._isExperienceAPatternEntry = checkIsAssemblyEntry({
|
|
4251
|
+
fields: this._experienceEntryFields,
|
|
4252
|
+
});
|
|
4237
4253
|
// DERIVE ENTITY STORE INSTANCE VARIBLES
|
|
4238
4254
|
// Register prebindings
|
|
4239
4255
|
{
|
|
@@ -4317,6 +4333,9 @@ class EntityStore extends EntityStoreBase {
|
|
|
4317
4333
|
getCurrentLocale() {
|
|
4318
4334
|
return this.locale;
|
|
4319
4335
|
}
|
|
4336
|
+
get isExperienceAPatternEntry() {
|
|
4337
|
+
return this._isExperienceAPatternEntry;
|
|
4338
|
+
}
|
|
4320
4339
|
get hoistedVariableMappings() {
|
|
4321
4340
|
return this._hoistedVariableMappings;
|
|
4322
4341
|
}
|
|
@@ -5029,92 +5048,6 @@ const removeSelfReferencingDataSource = (experienceEntry) => {
|
|
|
5029
5048
|
experienceEntry.fields.dataSource = newDataSource;
|
|
5030
5049
|
};
|
|
5031
5050
|
|
|
5032
|
-
/**
|
|
5033
|
-
* Attaches the default prebinding value (if any) to the experience entry's dataSource.
|
|
5034
|
-
*
|
|
5035
|
-
* This ensures that any default values defined in pattern property definitions are included
|
|
5036
|
-
* in the dataSource, so that linked entities can be fetched and resolved correctly.
|
|
5037
|
-
* Without this, defaults may be omitted, resulting in unresolved references during binding.
|
|
5038
|
-
*
|
|
5039
|
-
* @returns The number of sideloaded default values, or false if the entry is not a pattern.
|
|
5040
|
-
*/
|
|
5041
|
-
const sideloadPrebindingDefaultValues = (patternEntry) => {
|
|
5042
|
-
let sideloadedCount = 0;
|
|
5043
|
-
const addDefaultValueToDataSource = (_definitionId, definition) => {
|
|
5044
|
-
if (!definition.defaultSource) {
|
|
5045
|
-
// prebinding preset doesn't have default value, which is perfectly fine
|
|
5046
|
-
return;
|
|
5047
|
-
}
|
|
5048
|
-
const { contentTypeId, link, type, // At the time of writing, it means that defaultSource is a link to a Contentful Entry, but in the future it could be a link to third party resource or smth.
|
|
5049
|
-
// this .type enumeration will not have the same meaning as `Link#sys#linkType`.
|
|
5050
|
-
} = definition.defaultSource;
|
|
5051
|
-
if (!isLink(link)) {
|
|
5052
|
-
// default value is not a link, maybe due to a bug
|
|
5053
|
-
return;
|
|
5054
|
-
}
|
|
5055
|
-
if (!type || !contentTypeId) {
|
|
5056
|
-
// broken data structure, unlikely to happen, only due to a bug
|
|
5057
|
-
return;
|
|
5058
|
-
}
|
|
5059
|
-
// Throw in the link to the default-entry into the dataSource, this way
|
|
5060
|
-
// we rely on the mechanism of fetchReferencedEntities() to "sideload" them.
|
|
5061
|
-
// Keep in mind that dataSource will be available as EntityStore.dataSource
|
|
5062
|
-
// and now will contain also key for `sideloaded_uuid` entry.
|
|
5063
|
-
// When "sideloading" entries into the entityStore, we must ensure that
|
|
5064
|
-
// there's corresponding entry in the dataSource, because all bound variables
|
|
5065
|
-
// are resolved, via path that is indirectly referencing the dataSource,
|
|
5066
|
-
// eg. { type: 'BoundValue', path: '/sideloaded_uuid/fields/title' }
|
|
5067
|
-
patternEntry.fields.dataSource = {
|
|
5068
|
-
...patternEntry.fields.dataSource,
|
|
5069
|
-
[`${SIDELOADED_PREFIX}${link.sys.id}`]: {
|
|
5070
|
-
// to highlight that this is a sideloaded entry, we prefix it
|
|
5071
|
-
sys: {
|
|
5072
|
-
type: 'Link',
|
|
5073
|
-
linkType: link.sys.linkType,
|
|
5074
|
-
id: link.sys.id,
|
|
5075
|
-
},
|
|
5076
|
-
},
|
|
5077
|
-
};
|
|
5078
|
-
sideloadedCount++;
|
|
5079
|
-
};
|
|
5080
|
-
if (!checkIsAssemblyEntry(patternEntry)) {
|
|
5081
|
-
// Only supported for pattern entries since experience entries don't define pattern properties.
|
|
5082
|
-
return false;
|
|
5083
|
-
}
|
|
5084
|
-
// --------------------
|
|
5085
|
-
// Sideload prebinding values for the L1 parent pattern aka `pA`
|
|
5086
|
-
// --------------------
|
|
5087
|
-
const definitions = patternEntry.fields.componentSettings?.prebindingDefinitions?.[0].parameterDefinitions ?? {};
|
|
5088
|
-
Object.entries(definitions).forEach(([id, definition]) => {
|
|
5089
|
-
addDefaultValueToDataSource(id, definition);
|
|
5090
|
-
});
|
|
5091
|
-
// --------------------
|
|
5092
|
-
// Sideload all default values for the L2 nested patterns, patterns aka`pB`
|
|
5093
|
-
// --------------------
|
|
5094
|
-
const nestedPatternEntriesLevel2 = (patternEntry.fields.usedComponents || []).filter((component) => component !== undefined && checkIsAssemblyEntry(component));
|
|
5095
|
-
nestedPatternEntriesLevel2.forEach((patternEntry) => {
|
|
5096
|
-
const parameterDefinitions = patternEntry.fields.componentSettings?.prebindingDefinitions?.[0].parameterDefinitions ?? {};
|
|
5097
|
-
Object.entries(parameterDefinitions).forEach(([id, definition]) => {
|
|
5098
|
-
addDefaultValueToDataSource(id, definition);
|
|
5099
|
-
});
|
|
5100
|
-
});
|
|
5101
|
-
// --------------------
|
|
5102
|
-
// Sideload all default values for the L3 nested patterns, patterns aka `pC`
|
|
5103
|
-
// --------------------
|
|
5104
|
-
const nestedPatternEntriesLevel3 = nestedPatternEntriesLevel2.flatMap((patternEntryLevel2) => {
|
|
5105
|
-
const usedComponents = patternEntryLevel2.fields.usedComponents || [];
|
|
5106
|
-
const filteredUsedComponents = usedComponents.filter((component) => component !== undefined && checkIsAssemblyEntry(component));
|
|
5107
|
-
return filteredUsedComponents;
|
|
5108
|
-
});
|
|
5109
|
-
nestedPatternEntriesLevel3.forEach((patternEntry) => {
|
|
5110
|
-
const parameterDefinitions = patternEntry.fields.componentSettings?.prebindingDefinitions?.[0].parameterDefinitions ?? {};
|
|
5111
|
-
Object.entries(parameterDefinitions).forEach(([id, definition]) => {
|
|
5112
|
-
addDefaultValueToDataSource(id, definition);
|
|
5113
|
-
});
|
|
5114
|
-
});
|
|
5115
|
-
return sideloadedCount;
|
|
5116
|
-
};
|
|
5117
|
-
|
|
5118
5051
|
/**
|
|
5119
5052
|
* Run additional checks on the references used in the experience entry and
|
|
5120
5053
|
* process data required for prebinding. This must be used after fetching an
|
|
@@ -5125,7 +5058,6 @@ const sideloadPrebindingDefaultValues = (patternEntry) => {
|
|
|
5125
5058
|
const prepareExperienceEntry = (experienceEntry) => {
|
|
5126
5059
|
removeCircularPatternReferences(experienceEntry);
|
|
5127
5060
|
removeSelfReferencingDataSource(experienceEntry);
|
|
5128
|
-
sideloadPrebindingDefaultValues(experienceEntry);
|
|
5129
5061
|
};
|
|
5130
5062
|
|
|
5131
5063
|
const errorMessagesWhileFetching$1 = {
|