@contentful/experiences-core 0.0.1-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/LICENSE +21 -0
  2. package/dist/communication/sendMessage.d.ts +6 -0
  3. package/dist/constants.d.ts +122 -0
  4. package/dist/constants.js +159 -0
  5. package/dist/constants.js.map +1 -0
  6. package/dist/deep-binding/DeepReference.d.ts +28 -0
  7. package/dist/definitions/components.d.ts +8 -0
  8. package/dist/definitions/styles.d.ts +9 -0
  9. package/dist/entity/EditorEntityStore.d.ts +34 -0
  10. package/dist/entity/EditorModeEntityStore.d.ts +29 -0
  11. package/dist/entity/EntityStore.d.ts +54 -0
  12. package/dist/entity/EntityStoreBase.d.ts +39 -0
  13. package/dist/enums.d.ts +6 -0
  14. package/dist/exports.d.ts +3 -0
  15. package/dist/exports.js +2 -0
  16. package/dist/exports.js.map +1 -0
  17. package/dist/fetchers/createExperience.d.ts +20 -0
  18. package/dist/fetchers/fetchById.d.ts +20 -0
  19. package/dist/fetchers/fetchBySlug.d.ts +20 -0
  20. package/dist/index.d.ts +24 -0
  21. package/dist/index.js +2169 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/registries/designTokenRegistry.d.ts +12 -0
  24. package/dist/types.d.ts +223 -0
  25. package/dist/utils/breakpoints.d.ts +12 -0
  26. package/dist/utils/components.d.ts +4 -0
  27. package/dist/utils/domValues.d.ts +15 -0
  28. package/dist/utils/isLink.d.ts +5 -0
  29. package/dist/utils/isLinkToAsset.d.ts +5 -0
  30. package/dist/utils/pathSchema.d.ts +30 -0
  31. package/dist/utils/stylesUtils.d.ts +20 -0
  32. package/dist/utils/supportedModes.d.ts +5 -0
  33. package/dist/utils/transformers.d.ts +24 -0
  34. package/dist/utils/typeguards.d.ts +7 -0
  35. package/dist/utils/utils.d.ts +46 -0
  36. package/dist/utils/validations.d.ts +15 -0
  37. package/package.json +75 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Contentful
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ import { PostMessageMethods } from '../constants.js';
2
+ import { OutgoingEvent } from '../types.js';
3
+
4
+ declare const sendMessage: (eventType: OutgoingEvent | PostMessageMethods, data?: unknown) => void;
5
+
6
+ export { sendMessage };
@@ -0,0 +1,122 @@
1
+ declare const SCROLL_STATES: {
2
+ Start: string;
3
+ IsScrolling: string;
4
+ End: string;
5
+ };
6
+ declare const OUTGOING_EVENTS: {
7
+ Connected: string;
8
+ DesignTokens: string;
9
+ HoveredSection: string;
10
+ MouseMove: string;
11
+ NewHoveredElement: string;
12
+ ComponentSelected: string;
13
+ RegisteredComponents: string;
14
+ RequestComponentTreeUpdate: string;
15
+ ComponentDragCanceled: string;
16
+ ComponentDropped: string;
17
+ ComponentMoved: string;
18
+ CanvasReload: string;
19
+ UpdateSelectedComponentCoordinates: string;
20
+ UpdateHoveredComponentCoordinates: string;
21
+ CanvasScroll: string;
22
+ CanvasError: string;
23
+ OutsideCanvasClick: string;
24
+ };
25
+ declare const INCOMING_EVENTS: {
26
+ RequestEditorMode: string;
27
+ CompositionUpdated: string;
28
+ ComponentDraggingChanged: string;
29
+ ComponentDragCanceled: string;
30
+ ComponentDragStarted: string;
31
+ ComponentDragEnded: string;
32
+ CanvasResized: string;
33
+ SelectComponent: string;
34
+ HoverComponent: string;
35
+ UpdatedEntity: string;
36
+ /**
37
+ * @deprecated use `AssembliesAdded` instead. This will be removed in version 5.
38
+ * In the meanwhile, the experience builder will send the old and the new event to support multiple SDK versions.
39
+ */
40
+ DesignComponentsAdded: string;
41
+ /**
42
+ * @deprecated use `AssembliesRegistered` instead. This will be removed in version 5.
43
+ * In the meanwhile, the experience builder will send the old and the new event to support multiple SDK versions.
44
+ */
45
+ DesignComponentsRegistered: string;
46
+ AssembliesAdded: string;
47
+ AssembliesRegistered: string;
48
+ InitEditor: string;
49
+ };
50
+ declare const INTERNAL_EVENTS: {
51
+ ComponentsRegistered: string;
52
+ VisualEditorInitialize: string;
53
+ };
54
+ declare const VISUAL_EDITOR_EVENTS: {
55
+ Ready: string;
56
+ };
57
+ declare const VISUAL_EDITOR_CONTAINER_ID = "cf-visual-editor";
58
+ declare const CONTENTFUL_COMPONENT_CATEGORY = "contentful-component";
59
+ declare const CONTENTFUL_DEFAULT_CATEGORY = "Contentful";
60
+ declare const CONTENTFUL_COMPONENTS: {
61
+ section: {
62
+ id: string;
63
+ name: string;
64
+ };
65
+ container: {
66
+ id: string;
67
+ name: string;
68
+ };
69
+ columns: {
70
+ id: string;
71
+ name: string;
72
+ };
73
+ singleColumn: {
74
+ id: string;
75
+ name: string;
76
+ };
77
+ button: {
78
+ id: string;
79
+ name: string;
80
+ };
81
+ heading: {
82
+ id: string;
83
+ name: string;
84
+ };
85
+ image: {
86
+ id: string;
87
+ name: string;
88
+ };
89
+ richText: {
90
+ id: string;
91
+ name: string;
92
+ };
93
+ text: {
94
+ id: string;
95
+ name: string;
96
+ };
97
+ };
98
+ /** @deprecated use `CONTENTFUL_COMPONENTS.section.id` instead. This will be removed in version 4. */
99
+ declare const CONTENTFUL_SECTION_ID: string;
100
+ /** @deprecated use `CONTENTFUL_COMPONENTS.container.id` instead. This will be removed in version 4. */
101
+ declare const CONTENTFUL_CONTAINER_ID: string;
102
+ declare const ASSEMBLY_NODE_TYPE = "assembly";
103
+ declare const ASSEMBLY_DEFAULT_CATEGORY = "Assemblies";
104
+ declare const ASSEMBLY_BLOCK_NODE_TYPE = "assemblyBlock";
105
+ declare const ASSEMBLY_NODE_TYPES: string[];
106
+ /** @deprecated use `ASSEMBLY_NODE_TYPE` instead. This will be removed in version 5. */
107
+ declare const DESIGN_COMPONENT_NODE_TYPE = "designComponent";
108
+ /** @deprecated use `ASSEMBLY_DEFAULT_CATEGORY` instead. This will be removed in version 5. */
109
+ declare const DESIGN_COMPONENT_DEFAULT_CATEGORY = "Design Components";
110
+ /** @deprecated use `ASSEMBLY_BLOCK_NODE_TYPE` instead. This will be removed in version 5. */
111
+ declare const DESIGN_COMPONENT_BLOCK_NODE_TYPE = "designComponentBlock";
112
+ /** @deprecated use `ASSEMBLY_NODE_TYPES` instead. This will be removed in version 5. */
113
+ declare const DESIGN_COMPONENT_NODE_TYPES: string[];
114
+ declare const LATEST_SCHEMA_VERSION = "2023-09-28";
115
+ declare const CF_STYLE_ATTRIBUTES: string[];
116
+ declare const EMPTY_CONTAINER_HEIGHT = "80px";
117
+ declare enum PostMessageMethods {
118
+ REQUEST_ENTITIES = "REQUEST_ENTITIES",
119
+ REQUESTED_ENTITIES = "REQUESTED_ENTITIES"
120
+ }
121
+
122
+ export { ASSEMBLY_BLOCK_NODE_TYPE, ASSEMBLY_DEFAULT_CATEGORY, ASSEMBLY_NODE_TYPE, ASSEMBLY_NODE_TYPES, CF_STYLE_ATTRIBUTES, CONTENTFUL_COMPONENTS, CONTENTFUL_COMPONENT_CATEGORY, CONTENTFUL_CONTAINER_ID, CONTENTFUL_DEFAULT_CATEGORY, CONTENTFUL_SECTION_ID, DESIGN_COMPONENT_BLOCK_NODE_TYPE, DESIGN_COMPONENT_DEFAULT_CATEGORY, DESIGN_COMPONENT_NODE_TYPE, DESIGN_COMPONENT_NODE_TYPES, EMPTY_CONTAINER_HEIGHT, INCOMING_EVENTS, INTERNAL_EVENTS, LATEST_SCHEMA_VERSION, OUTGOING_EVENTS, PostMessageMethods, SCROLL_STATES, VISUAL_EDITOR_CONTAINER_ID, VISUAL_EDITOR_EVENTS };
@@ -0,0 +1,159 @@
1
+ const SCROLL_STATES = {
2
+ Start: 'scrollStart',
3
+ IsScrolling: 'isScrolling',
4
+ End: 'scrollEnd',
5
+ };
6
+ const OUTGOING_EVENTS = {
7
+ Connected: 'connected',
8
+ DesignTokens: 'registerDesignTokens',
9
+ HoveredSection: 'hoveredSection',
10
+ MouseMove: 'mouseMove',
11
+ NewHoveredElement: 'newHoveredElement',
12
+ ComponentSelected: 'componentSelected',
13
+ RegisteredComponents: 'registeredComponents',
14
+ RequestComponentTreeUpdate: 'requestComponentTreeUpdate',
15
+ ComponentDragCanceled: 'componentDragCanceled',
16
+ ComponentDropped: 'componentDropped',
17
+ ComponentMoved: 'componentMoved',
18
+ CanvasReload: 'canvasReload',
19
+ UpdateSelectedComponentCoordinates: 'updateSelectedComponentCoordinates',
20
+ UpdateHoveredComponentCoordinates: 'updateHoveredComponentCoordinates',
21
+ CanvasScroll: 'canvasScrolling',
22
+ CanvasError: 'canvasError',
23
+ OutsideCanvasClick: 'outsideCanvasClick',
24
+ };
25
+ const INCOMING_EVENTS = {
26
+ RequestEditorMode: 'requestEditorMode',
27
+ CompositionUpdated: 'componentTreeUpdated',
28
+ ComponentDraggingChanged: 'componentDraggingChanged',
29
+ ComponentDragCanceled: 'componentDragCanceled',
30
+ ComponentDragStarted: 'componentDragStarted',
31
+ ComponentDragEnded: 'componentDragEnded',
32
+ CanvasResized: 'canvasResized',
33
+ SelectComponent: 'selectComponent',
34
+ HoverComponent: 'hoverComponent',
35
+ UpdatedEntity: 'updatedEntity',
36
+ /**
37
+ * @deprecated use `AssembliesAdded` instead. This will be removed in version 5.
38
+ * In the meanwhile, the experience builder will send the old and the new event to support multiple SDK versions.
39
+ */
40
+ DesignComponentsAdded: 'designComponentsAdded',
41
+ /**
42
+ * @deprecated use `AssembliesRegistered` instead. This will be removed in version 5.
43
+ * In the meanwhile, the experience builder will send the old and the new event to support multiple SDK versions.
44
+ */
45
+ DesignComponentsRegistered: 'designComponentsRegistered',
46
+ AssembliesAdded: 'assembliesAdded',
47
+ AssembliesRegistered: 'assembliesRegistered',
48
+ InitEditor: 'initEditor',
49
+ };
50
+ const INTERNAL_EVENTS = {
51
+ ComponentsRegistered: 'cfComponentsRegistered',
52
+ VisualEditorInitialize: 'cfVisualEditorInitialize',
53
+ };
54
+ const VISUAL_EDITOR_EVENTS = {
55
+ Ready: 'cfVisualEditorReady',
56
+ };
57
+ const VISUAL_EDITOR_CONTAINER_ID = 'cf-visual-editor';
58
+ const CONTENTFUL_COMPONENT_CATEGORY = 'contentful-component';
59
+ const CONTENTFUL_DEFAULT_CATEGORY = 'Contentful';
60
+ const CONTENTFUL_COMPONENTS = {
61
+ section: {
62
+ id: 'contentful-section',
63
+ name: 'Section',
64
+ },
65
+ container: {
66
+ id: 'contentful-container',
67
+ name: 'Container',
68
+ },
69
+ columns: {
70
+ id: 'contentful-columns',
71
+ name: 'Columns',
72
+ },
73
+ singleColumn: {
74
+ id: 'contentful-single-column',
75
+ name: 'Column',
76
+ },
77
+ button: {
78
+ id: 'button',
79
+ name: 'Button',
80
+ },
81
+ heading: {
82
+ id: 'heading',
83
+ name: 'Heading',
84
+ },
85
+ image: {
86
+ id: 'image',
87
+ name: 'Image',
88
+ },
89
+ richText: {
90
+ id: 'richText',
91
+ name: 'Rich Text',
92
+ },
93
+ text: {
94
+ id: 'text',
95
+ name: 'Text',
96
+ },
97
+ };
98
+ /** @deprecated use `CONTENTFUL_COMPONENTS.section.id` instead. This will be removed in version 4. */
99
+ const CONTENTFUL_SECTION_ID = CONTENTFUL_COMPONENTS.section.id;
100
+ /** @deprecated use `CONTENTFUL_COMPONENTS.container.id` instead. This will be removed in version 4. */
101
+ const CONTENTFUL_CONTAINER_ID = CONTENTFUL_COMPONENTS.container.id;
102
+ const ASSEMBLY_NODE_TYPE = 'assembly';
103
+ const ASSEMBLY_DEFAULT_CATEGORY = 'Assemblies';
104
+ const ASSEMBLY_BLOCK_NODE_TYPE = 'assemblyBlock';
105
+ const ASSEMBLY_NODE_TYPES = [ASSEMBLY_NODE_TYPE, ASSEMBLY_BLOCK_NODE_TYPE];
106
+ /** @deprecated use `ASSEMBLY_NODE_TYPE` instead. This will be removed in version 5. */
107
+ const DESIGN_COMPONENT_NODE_TYPE = 'designComponent';
108
+ /** @deprecated use `ASSEMBLY_DEFAULT_CATEGORY` instead. This will be removed in version 5. */
109
+ const DESIGN_COMPONENT_DEFAULT_CATEGORY = 'Design Components';
110
+ /** @deprecated use `ASSEMBLY_BLOCK_NODE_TYPE` instead. This will be removed in version 5. */
111
+ const DESIGN_COMPONENT_BLOCK_NODE_TYPE = 'designComponentBlock';
112
+ /** @deprecated use `ASSEMBLY_NODE_TYPES` instead. This will be removed in version 5. */
113
+ const DESIGN_COMPONENT_NODE_TYPES = [
114
+ DESIGN_COMPONENT_NODE_TYPE,
115
+ DESIGN_COMPONENT_BLOCK_NODE_TYPE,
116
+ ];
117
+ const LATEST_SCHEMA_VERSION = '2023-09-28';
118
+ const CF_STYLE_ATTRIBUTES = [
119
+ 'cfHorizontalAlignment',
120
+ 'cfVerticalAlignment',
121
+ 'cfMargin',
122
+ 'cfPadding',
123
+ 'cfBackgroundColor',
124
+ 'cfWidth',
125
+ 'cfMaxWidth',
126
+ 'cfHeight',
127
+ 'cfFlexDirection',
128
+ 'cfFlexWrap',
129
+ 'cfBorder',
130
+ 'cfGap',
131
+ 'cfBackgroundImageUrl',
132
+ 'cfBackgroundImageScaling',
133
+ 'cfBackgroundImageAlignment',
134
+ 'cfFontSize',
135
+ 'cfFontWeight',
136
+ 'cfLineHeight',
137
+ 'cfLetterSpacing',
138
+ 'cfTextColor',
139
+ 'cfTextAlign',
140
+ 'cfTextTransform',
141
+ 'cfTextBold',
142
+ 'cfTextItalic',
143
+ 'cfTextUnderline',
144
+ // For backwards compatibility
145
+ // we need to keep those in this constant array
146
+ // so that omit() in <VisualEditorBlock> and <CompositionBlock>
147
+ // can filter them out and not pass as props
148
+ 'cfBackgroundImageAlignmentVertical',
149
+ 'cfBackgroundImageAlignmentHorizontal',
150
+ ];
151
+ const EMPTY_CONTAINER_HEIGHT = '80px';
152
+ var PostMessageMethods;
153
+ (function (PostMessageMethods) {
154
+ PostMessageMethods["REQUEST_ENTITIES"] = "REQUEST_ENTITIES";
155
+ PostMessageMethods["REQUESTED_ENTITIES"] = "REQUESTED_ENTITIES";
156
+ })(PostMessageMethods || (PostMessageMethods = {}));
157
+
158
+ export { ASSEMBLY_BLOCK_NODE_TYPE, ASSEMBLY_DEFAULT_CATEGORY, ASSEMBLY_NODE_TYPE, ASSEMBLY_NODE_TYPES, CF_STYLE_ATTRIBUTES, CONTENTFUL_COMPONENTS, CONTENTFUL_COMPONENT_CATEGORY, CONTENTFUL_CONTAINER_ID, CONTENTFUL_DEFAULT_CATEGORY, CONTENTFUL_SECTION_ID, DESIGN_COMPONENT_BLOCK_NODE_TYPE, DESIGN_COMPONENT_DEFAULT_CATEGORY, DESIGN_COMPONENT_NODE_TYPE, DESIGN_COMPONENT_NODE_TYPES, EMPTY_CONTAINER_HEIGHT, INCOMING_EVENTS, INTERNAL_EVENTS, LATEST_SCHEMA_VERSION, OUTGOING_EVENTS, PostMessageMethods, SCROLL_STATES, VISUAL_EDITOR_CONTAINER_ID, VISUAL_EDITOR_EVENTS };
159
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["export const SCROLL_STATES = {\n Start: 'scrollStart',\n IsScrolling: 'isScrolling',\n End: 'scrollEnd',\n};\n\nexport const OUTGOING_EVENTS = {\n Connected: 'connected',\n DesignTokens: 'registerDesignTokens',\n HoveredSection: 'hoveredSection',\n MouseMove: 'mouseMove',\n NewHoveredElement: 'newHoveredElement',\n ComponentSelected: 'componentSelected',\n RegisteredComponents: 'registeredComponents',\n RequestComponentTreeUpdate: 'requestComponentTreeUpdate',\n ComponentDragCanceled: 'componentDragCanceled',\n ComponentDropped: 'componentDropped',\n ComponentMoved: 'componentMoved',\n CanvasReload: 'canvasReload',\n UpdateSelectedComponentCoordinates: 'updateSelectedComponentCoordinates',\n UpdateHoveredComponentCoordinates: 'updateHoveredComponentCoordinates',\n CanvasScroll: 'canvasScrolling',\n CanvasError: 'canvasError',\n OutsideCanvasClick: 'outsideCanvasClick',\n};\n\nexport const INCOMING_EVENTS = {\n RequestEditorMode: 'requestEditorMode',\n CompositionUpdated: 'componentTreeUpdated',\n ComponentDraggingChanged: 'componentDraggingChanged',\n ComponentDragCanceled: 'componentDragCanceled',\n ComponentDragStarted: 'componentDragStarted',\n ComponentDragEnded: 'componentDragEnded',\n CanvasResized: 'canvasResized',\n SelectComponent: 'selectComponent',\n HoverComponent: 'hoverComponent',\n UpdatedEntity: 'updatedEntity',\n /**\n * @deprecated use `AssembliesAdded` instead. This will be removed in version 5.\n * In the meanwhile, the experience builder will send the old and the new event to support multiple SDK versions.\n */\n DesignComponentsAdded: 'designComponentsAdded',\n /**\n * @deprecated use `AssembliesRegistered` instead. This will be removed in version 5.\n * In the meanwhile, the experience builder will send the old and the new event to support multiple SDK versions.\n */\n DesignComponentsRegistered: 'designComponentsRegistered',\n AssembliesAdded: 'assembliesAdded',\n AssembliesRegistered: 'assembliesRegistered',\n InitEditor: 'initEditor',\n};\n\nexport const INTERNAL_EVENTS = {\n ComponentsRegistered: 'cfComponentsRegistered',\n VisualEditorInitialize: 'cfVisualEditorInitialize',\n};\n\nexport const VISUAL_EDITOR_EVENTS = {\n Ready: 'cfVisualEditorReady',\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: 'button',\n name: 'Button',\n },\n heading: {\n id: 'heading',\n name: 'Heading',\n },\n image: {\n id: 'image',\n name: 'Image',\n },\n richText: {\n id: 'richText',\n name: 'Rich Text',\n },\n text: {\n id: 'text',\n name: 'Text',\n },\n};\n\n/** @deprecated use `CONTENTFUL_COMPONENTS.section.id` instead. This will be removed in version 4. */\nexport const CONTENTFUL_SECTION_ID = CONTENTFUL_COMPONENTS.section.id;\n/** @deprecated use `CONTENTFUL_COMPONENTS.container.id` instead. This will be removed in version 4. */\nexport const CONTENTFUL_CONTAINER_ID = CONTENTFUL_COMPONENTS.container.id;\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];\n\n/** @deprecated use `ASSEMBLY_NODE_TYPE` instead. This will be removed in version 5. */\nexport const DESIGN_COMPONENT_NODE_TYPE = 'designComponent';\n/** @deprecated use `ASSEMBLY_DEFAULT_CATEGORY` instead. This will be removed in version 5. */\nexport const DESIGN_COMPONENT_DEFAULT_CATEGORY = 'Design Components';\n/** @deprecated use `ASSEMBLY_BLOCK_NODE_TYPE` instead. This will be removed in version 5. */\nexport const DESIGN_COMPONENT_BLOCK_NODE_TYPE = 'designComponentBlock';\n/** @deprecated use `ASSEMBLY_NODE_TYPES` instead. This will be removed in version 5. */\nexport const DESIGN_COMPONENT_NODE_TYPES = [\n DESIGN_COMPONENT_NODE_TYPE,\n DESIGN_COMPONENT_BLOCK_NODE_TYPE,\n];\nexport const LATEST_SCHEMA_VERSION = '2023-09-28';\nexport const CF_STYLE_ATTRIBUTES = [\n 'cfHorizontalAlignment',\n 'cfVerticalAlignment',\n 'cfMargin',\n 'cfPadding',\n 'cfBackgroundColor',\n 'cfWidth',\n 'cfMaxWidth',\n 'cfHeight',\n 'cfFlexDirection',\n 'cfFlexWrap',\n 'cfBorder',\n 'cfGap',\n 'cfBackgroundImageUrl',\n 'cfBackgroundImageScaling',\n 'cfBackgroundImageAlignment',\n 'cfFontSize',\n 'cfFontWeight',\n 'cfLineHeight',\n 'cfLetterSpacing',\n 'cfTextColor',\n 'cfTextAlign',\n 'cfTextTransform',\n 'cfTextBold',\n 'cfTextItalic',\n 'cfTextUnderline',\n // For backwards compatibility\n // we need to keep those in this constant array\n // so that omit() in <VisualEditorBlock> and <CompositionBlock>\n // can filter them out and not pass as props\n 'cfBackgroundImageAlignmentVertical',\n 'cfBackgroundImageAlignmentHorizontal',\n];\n\nexport const EMPTY_CONTAINER_HEIGHT = '80px';\n\nexport enum PostMessageMethods {\n REQUEST_ENTITIES = 'REQUEST_ENTITIES',\n REQUESTED_ENTITIES = 'REQUESTED_ENTITIES',\n}\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,28 @@
1
+ import { DataSourceEntryValueType, Link, ExperienceEntry, CompositionComponentNode } from '../types.js';
2
+ import { EntityStoreBase } from '../entity/EntityStoreBase.js';
3
+ import { ExperienceDataSource } from '@contentful/experiences-validators';
4
+
5
+ type DeepReferenceOpts = {
6
+ path: string;
7
+ dataSource: ExperienceDataSource;
8
+ };
9
+ declare class DeepReference {
10
+ entityId: string;
11
+ entityLink: DataSourceEntryValueType;
12
+ field: string;
13
+ referentField: string;
14
+ originalPath: string;
15
+ constructor({ path, dataSource }: DeepReferenceOpts);
16
+ get headEntityId(): string;
17
+ /**
18
+ * Extracts referent from the path, using EntityStore as source of
19
+ * entities during the resolution path.
20
+ * TODO: should it be called `extractLeafReferent` ? or `followToLeafReferent`
21
+ */
22
+ extractReferent(entityStore: EntityStoreBase): Link<'Asset' | 'Entry'> | undefined;
23
+ static from(opt: DeepReferenceOpts): DeepReference;
24
+ }
25
+ declare function gatherDeepReferencesFromExperienceEntry(experienceEntry: ExperienceEntry): DeepReference[];
26
+ declare function gatherDeepReferencesFromTree(startingNode: CompositionComponentNode, dataSource: ExperienceDataSource): DeepReference[];
27
+
28
+ export { DeepReference, gatherDeepReferencesFromExperienceEntry, gatherDeepReferencesFromTree };
@@ -0,0 +1,8 @@
1
+ import { ComponentDefinition } from '../types.js';
2
+
3
+ declare const sectionDefinition: ComponentDefinition;
4
+ declare const containerDefinition: ComponentDefinition;
5
+ declare const columnsDefinition: ComponentDefinition;
6
+ declare const singleColumnDefinition: ComponentDefinition;
7
+
8
+ export { columnsDefinition, containerDefinition, sectionDefinition, singleColumnDefinition };
@@ -0,0 +1,9 @@
1
+ import { ContainerStyleVariableName, ComponentDefinitionVariable } from '../types.js';
2
+
3
+ declare const builtInStyles: Partial<Record<ContainerStyleVariableName, ComponentDefinitionVariable<'Text' | 'Boolean'>>>;
4
+ declare const optionalBuiltInStyles: Partial<Record<ContainerStyleVariableName, ComponentDefinitionVariable<'Text' | 'Boolean'>>>;
5
+ declare const containerBuiltInStyles: Partial<Record<ContainerStyleVariableName, ComponentDefinitionVariable<'Text' | 'Boolean'>>>;
6
+ declare const singleColumnBuiltInStyles: Partial<Record<ContainerStyleVariableName, ComponentDefinitionVariable<'Text' | 'Boolean'>>>;
7
+ declare const columnsBuiltInStyles: Partial<Record<ContainerStyleVariableName, ComponentDefinitionVariable<'Text' | 'Boolean'>>>;
8
+
9
+ export { builtInStyles, columnsBuiltInStyles, containerBuiltInStyles, optionalBuiltInStyles, singleColumnBuiltInStyles };
@@ -0,0 +1,34 @@
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 };
@@ -0,0 +1,29 @@
1
+ import { Asset, Entry, UnresolvedLink } from 'contentful';
2
+ import { EditorEntityStore } from './EditorEntityStore.js';
3
+
4
+ declare class EditorModeEntityStore extends EditorEntityStore {
5
+ locale: string;
6
+ constructor({ entities, locale }: {
7
+ entities: Array<Asset | Entry>;
8
+ locale: string;
9
+ });
10
+ /**
11
+ * This function collects and returns the list of requested entries and assets. Additionally, it checks
12
+ * upfront whether any async fetching logic is actually happening. If not, it returns a plain `false` value, so we
13
+ * can detect this early and avoid unnecessary re-renders.
14
+ * @param entityLinks
15
+ * @returns false if no async fetching is happening, otherwise a promise that resolves when all entities are fetched
16
+ */
17
+ fetchEntities({ missingEntryIds, missingAssetIds, skipCache, }: {
18
+ missingEntryIds: string[];
19
+ missingAssetIds: string[];
20
+ skipCache?: boolean;
21
+ }): Promise<void>;
22
+ getMissingEntityIds(entityLinks: UnresolvedLink<'Entry' | 'Asset'>[]): {
23
+ missingEntryIds: string[];
24
+ missingAssetIds: string[];
25
+ };
26
+ getValue(entityLink: UnresolvedLink<'Entry' | 'Asset'> | undefined, path: string[]): string | undefined;
27
+ }
28
+
29
+ export { EditorModeEntityStore };
@@ -0,0 +1,54 @@
1
+ import { UnresolvedLink, Entry, Asset } from 'contentful';
2
+ import { Composition, ExperienceEntry } from '../types.js';
3
+ import { EntityStoreBase } from './EntityStoreBase.js';
4
+ import { ExperienceUnboundValues } from '@contentful/experiences-validators';
5
+
6
+ type EntityStoreArgs = {
7
+ experienceEntry: ExperienceEntry | Entry;
8
+ entities: Array<Entry | Asset>;
9
+ locale: string;
10
+ };
11
+ declare class EntityStore extends EntityStoreBase {
12
+ private _experienceEntry;
13
+ private _unboundValues;
14
+ constructor(json: string);
15
+ constructor({ experienceEntry, entities, locale }: EntityStoreArgs);
16
+ getCurrentLocale(): string;
17
+ get experienceEntryFields(): Composition | undefined;
18
+ get schemaVersion(): "2023-09-28" | "2023-08-23" | "2023-07-26" | "2023-06-27" | undefined;
19
+ get breakpoints(): {
20
+ id: string;
21
+ query: string;
22
+ previewSize: string;
23
+ displayName: string;
24
+ }[];
25
+ get dataSource(): Record<string, {
26
+ sys: {
27
+ type: "Link";
28
+ id: string;
29
+ linkType: "Asset" | "Entry";
30
+ };
31
+ }>;
32
+ get unboundValues(): Record<string, {
33
+ value?: string | number | boolean | Record<any, any> | undefined;
34
+ }>;
35
+ get usedComponents(): {
36
+ sys: {
37
+ type: "Link";
38
+ id: string;
39
+ linkType: "Entry";
40
+ };
41
+ }[] | ExperienceEntry[];
42
+ /**
43
+ * Extend the existing set of unbound values with the ones from the assembly definition.
44
+ * When creating a new assembly out of a container, the unbound value keys are copied and
45
+ * thus the existing and the added ones have colliding keys. In the case of overlapping value
46
+ * keys, the ones from the experience overrule the ones from the assembly definition as
47
+ * the latter one is certainly just a default value while the other one is from the actual instance.
48
+ * @param unboundValues set of unbound values defined in the assembly definition
49
+ */
50
+ addAssemblyUnboundValues(unboundValues: ExperienceUnboundValues): void;
51
+ getValue(entityLinkOrEntity: UnresolvedLink<'Entry' | 'Asset'> | Entry | Asset, path: string[]): string | undefined;
52
+ }
53
+
54
+ export { EntityStore };
@@ -0,0 +1,39 @@
1
+ import { Entry, Asset, ChainModifiers, UnresolvedLink } from 'contentful';
2
+
3
+ /**
4
+ * Base Store for entities
5
+ * Can be extened for the different loading behaviours (editor, production, ..)
6
+ */
7
+ declare abstract class EntityStoreBase {
8
+ protected locale: string;
9
+ protected entryMap: Map<string, Entry>;
10
+ protected assetMap: Map<string, Asset<ChainModifiers, string>>;
11
+ constructor({ entities, locale }: {
12
+ entities: Array<Entry | Asset>;
13
+ locale: string;
14
+ });
15
+ get entities(): (Entry | Asset<ChainModifiers, string>)[];
16
+ updateEntity(entity: Entry | Asset): void;
17
+ getValueDeep(headLinkOrEntity: UnresolvedLink<'Entry' | 'Asset'> | Asset | Entry, deepPath: string): string | undefined;
18
+ /**
19
+ * @deprecated in the base class this should be simply an abstract method
20
+ * @param entityLink
21
+ * @param path
22
+ * @returns
23
+ */
24
+ getValue(entityLink: UnresolvedLink<'Entry' | 'Asset'>, path: string[]): string | undefined;
25
+ getEntityFromLink(link: UnresolvedLink<'Entry' | 'Asset'>): Asset | Entry | undefined;
26
+ protected getEntitiesFromMap(type: 'Entry' | 'Asset', ids: string[]): {
27
+ resolved: (Entry | Asset<ChainModifiers, string>)[];
28
+ missing: string[];
29
+ };
30
+ protected addEntity(entity: Entry | Asset): void;
31
+ fetchAsset(id: string): Promise<Asset | undefined>;
32
+ fetchAssets(ids: string[]): Promise<Asset[]>;
33
+ fetchEntry(id: string): Promise<Entry | undefined>;
34
+ fetchEntries(ids: string[]): Promise<Entry[]>;
35
+ private isAsset;
36
+ private getEntity;
37
+ }
38
+
39
+ export { EntityStoreBase };
@@ -0,0 +1,6 @@
1
+ declare enum VisualEditorMode {
2
+ LazyLoad = "lazyLoad",
3
+ InjectScript = "injectScript"
4
+ }
5
+
6
+ export { VisualEditorMode };
@@ -0,0 +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_CONTAINER_ID, CONTENTFUL_DEFAULT_CATEGORY, CONTENTFUL_SECTION_ID, DESIGN_COMPONENT_BLOCK_NODE_TYPE, DESIGN_COMPONENT_DEFAULT_CATEGORY, DESIGN_COMPONENT_NODE_TYPE, DESIGN_COMPONENT_NODE_TYPES, EMPTY_CONTAINER_HEIGHT, INCOMING_EVENTS, INTERNAL_EVENTS, LATEST_SCHEMA_VERSION, OUTGOING_EVENTS, PostMessageMethods, SCROLL_STATES, VISUAL_EDITOR_CONTAINER_ID, VISUAL_EDITOR_EVENTS } from './constants.js';
2
+ export { Binding, BindingMap, BindingMapByBlockId, CSSProperties, ComponentBinding, ComponentDefinition, ComponentDefinitionVariable, ComponentDefinitionVariableBase, ComponentDefinitionVariableType, ComponentDefinitionVariableValidation, ComponentRegistration, ComponentRegistrationOptions, Composition, CompositionComponentNode, CompositionTree, ContainerStyleVariableName, Coordinates, DataSourceEntryValueType, DeprecatedExperience, DesignTokensDefinition, Experience, ExperienceEntry, ExternalSDKMode, HoveredElement, IncomingEvent, InternalEvent, InternalSDKMode, Link, ManagementEntity, OutgoingEvent, RawCoordinates, RecursiveDesignTokenDefinition, RequestEntitiesMessage, RequestedEntitiesMessage, ResolveDesignValueType, ScrollState, StyleProps, ValidationOption, VariableFormats } from './types.js';
3
+ export { BoundValue, Breakpoint, ComponentPropertyValue, ComponentTreeNode, ComponentValue, ComponentPropertyValue as CompositionComponentPropValue, ExperienceDataSource as CompositionDataSource, ComponentTreeNode as CompositionNode, ExperienceUnboundValues as CompositionUnboundValues, PrimitiveValue as CompositionVariableValueType, DesignValue, ExperienceComponentSettings, ExperienceDataSource, ExperienceUnboundValues, PrimitiveValue, SchemaVersions, UnboundValue, ValuesByBreakpoint } from '@contentful/experiences-validators';
@@ -0,0 +1,2 @@
1
+ export { ASSEMBLY_BLOCK_NODE_TYPE, ASSEMBLY_DEFAULT_CATEGORY, ASSEMBLY_NODE_TYPE, ASSEMBLY_NODE_TYPES, CF_STYLE_ATTRIBUTES, CONTENTFUL_COMPONENTS, CONTENTFUL_COMPONENT_CATEGORY, CONTENTFUL_CONTAINER_ID, CONTENTFUL_DEFAULT_CATEGORY, CONTENTFUL_SECTION_ID, DESIGN_COMPONENT_BLOCK_NODE_TYPE, DESIGN_COMPONENT_DEFAULT_CATEGORY, DESIGN_COMPONENT_NODE_TYPE, DESIGN_COMPONENT_NODE_TYPES, EMPTY_CONTAINER_HEIGHT, INCOMING_EVENTS, INTERNAL_EVENTS, LATEST_SCHEMA_VERSION, OUTGOING_EVENTS, PostMessageMethods, SCROLL_STATES, VISUAL_EDITOR_CONTAINER_ID, VISUAL_EDITOR_EVENTS } from './constants.js';
2
+ //# sourceMappingURL=exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import { Entry, Asset } from 'contentful';
2
+ import { Experience, ExternalSDKMode } from '../types.js';
3
+ import { EntityStore } from '../entity/EntityStore.js';
4
+
5
+ type createExperienceArgs = {
6
+ experienceEntry: Entry;
7
+ referencedEntries: Array<Entry>;
8
+ referencedAssets: Array<Asset>;
9
+ locale: string;
10
+ /** @deprecated mode no longer needed */
11
+ mode?: ExternalSDKMode;
12
+ };
13
+ /**
14
+ * Create an experience instance
15
+ * @param {string} json - JSON representation of the experience
16
+ */
17
+ declare function createExperience(json: string): Experience<EntityStore>;
18
+ declare function createExperience(args: createExperienceArgs): Experience<EntityStore>;
19
+
20
+ export { createExperience };
@@ -0,0 +1,20 @@
1
+ import { ExternalSDKMode, Experience } from '../types.js';
2
+ import { ContentfulClientApi } from 'contentful';
3
+ import { EntityStore } from '../entity/EntityStore.js';
4
+
5
+ /**
6
+ * Fetch experience entry using slug as the identifier
7
+ * @param {string} experienceTypeId - id of the content type associated with the experience
8
+ * @param {string} slug - slug of the experience (defined in entry settings)
9
+ * @param {string} localeCode - locale code to fetch the experience. Falls back to the currently active locale in the state
10
+ */
11
+ declare function fetchById({ client, experienceTypeId, id, localeCode, }: {
12
+ client: ContentfulClientApi<undefined>;
13
+ experienceTypeId: string;
14
+ id: string;
15
+ localeCode: string;
16
+ /** @deprecated mode no longer needed */
17
+ mode?: ExternalSDKMode;
18
+ }): Promise<Experience<EntityStore> | undefined>;
19
+
20
+ export { fetchById };
@@ -0,0 +1,20 @@
1
+ import { ExternalSDKMode, Experience } from '../types.js';
2
+ import { ContentfulClientApi } from 'contentful';
3
+ import { EntityStore } from '../entity/EntityStore.js';
4
+
5
+ /**
6
+ * Fetch experience entry using slug as the identifier
7
+ * @param {string} experienceTypeId - id of the content type associated with the experience
8
+ * @param {string} slug - slug of the experience (defined in entry settings)
9
+ * @param {string} localeCode - locale code to fetch the experience. Falls back to the currently active locale in the state
10
+ */
11
+ declare function fetchBySlug({ client, experienceTypeId, slug, localeCode, }: {
12
+ client: ContentfulClientApi<undefined>;
13
+ experienceTypeId: string;
14
+ slug: string;
15
+ localeCode: string;
16
+ /** @deprecated mode no longer needed */
17
+ mode?: ExternalSDKMode;
18
+ }): Promise<Experience<EntityStore> | undefined>;
19
+
20
+ export { fetchBySlug };