@contentstack/studio-messenger 1.3.0 → 1.3.1
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/cjs/index.cjs +55 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/constant.js +55 -0
- package/dist/esm/constant.js.map +1 -1
- package/dist/esm/index.d.ts +61 -14
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -21,6 +21,31 @@ const COMPOSABLE_STUDIO_QUERY_PARAM = {
|
|
|
21
21
|
CONNECTED_CONTENT_TYPE: "connected-content-type",
|
|
22
22
|
DYNAMIC_URL: "dynamic-url",
|
|
23
23
|
VISUAL_BUILDER: "builder",
|
|
24
|
+
/**
|
|
25
|
+
* When Studio renders the iframe and the user has explicitly picked an
|
|
26
|
+
* entry from the navbar, Studio appends this param so the SDK (running
|
|
27
|
+
* inside Studio) can prefer it over a host-passed `templateEntryUid`.
|
|
28
|
+
*
|
|
29
|
+
* Only honored when the SDK detects it is running inside Studio (via
|
|
30
|
+
* `ENABLED`). Outside Studio it is ignored.
|
|
31
|
+
*/
|
|
32
|
+
TEMPLATE_ENTRY_UID: "cs-template-entry-uid",
|
|
33
|
+
/**
|
|
34
|
+
* Locale Studio wants the SDK to render in. Set by Studio when its canvas
|
|
35
|
+
* URL carries `?locale=...`. The SDK overrides its own `config.locale`
|
|
36
|
+
* with this value so all SDK-side data fetches (initial + linked entries)
|
|
37
|
+
* use the right locale, and so the postmessages back to Studio
|
|
38
|
+
* (INIT_STUDIO.globalLocale, GET_COMPOSITION_SPEC.locale) carry it too.
|
|
39
|
+
*
|
|
40
|
+
* Only honored when the SDK detects it is running inside Studio (via
|
|
41
|
+
* `ENABLED`). Outside Studio it is ignored.
|
|
42
|
+
*/
|
|
43
|
+
LOCALE: "cs-locale",
|
|
44
|
+
/**
|
|
45
|
+
* Variant alias Studio wants the SDK to render in. Same flow as `LOCALE`
|
|
46
|
+
* but for variant. Set by Studio when its canvas URL carries `?variant=...`.
|
|
47
|
+
*/
|
|
48
|
+
VARIANT_ALIAS: "cs-variant-alias",
|
|
24
49
|
};
|
|
25
50
|
const POST_MESSAGE_EVENTS = {
|
|
26
51
|
INIT_STUDIO: "init-studio",
|
|
@@ -49,6 +74,25 @@ const POST_MESSAGE_EVENTS = {
|
|
|
49
74
|
REGISTER_BREAKPOINTS: "register-breakpoints",
|
|
50
75
|
SET_CURSOR_TYPE: "set-cursor-type",
|
|
51
76
|
GET_COMPOSITION_SPEC: "get-composition-spec",
|
|
77
|
+
// Studio Intelligence Protocol (SDK 1.5.0+)
|
|
78
|
+
GET_STUDIO_INTELLIGENCE: "get-studio-intelligence",
|
|
79
|
+
// Fast Rendering Protocol (Canvas Delay Fix)
|
|
80
|
+
IFRAME_STUDIO_CONTEXT: "iframe-studio-context",
|
|
81
|
+
SDK_SPEC_RESOLVED: "sdk-spec-resolved",
|
|
82
|
+
// Iframe → Studio: per-component resolution telemetry (what was queried,
|
|
83
|
+
// which compositions were shortlisted with specificity, and which won).
|
|
84
|
+
// Emitted by every SDK component instance regardless of the edited-composition
|
|
85
|
+
// gate, so Studio can list what loaded and explain why the edited one didn't.
|
|
86
|
+
SDK_DIAGNOSTICS: "sdk-diagnostics",
|
|
87
|
+
// SDK Initialization Signal (SDK 1.5.0+)
|
|
88
|
+
SDK_INITIALIZED: "sdk-initialized",
|
|
89
|
+
// Iframe → Studio: fired once the post-message listeners registered by
|
|
90
|
+
// `useSpecDataListener` are in place. Studio should gate any editor → iframe
|
|
91
|
+
// sends (notably UPDATE_SPEC_DATA) on receipt of this signal — it is the
|
|
92
|
+
// only event guaranteed to fire AFTER EditableRenderer commits its first
|
|
93
|
+
// render. Earlier signals (SDK_SPEC_RESOLVED, INIT_STUDIO) fire before the
|
|
94
|
+
// React tree mounts and race against the listener registration.
|
|
95
|
+
LISTENERS_READY: "listeners-ready",
|
|
52
96
|
REPLACE_PREVIEW_ENTRY: "replace-preview-entry",
|
|
53
97
|
CHANGE_ACTIVE_STYLE_SECTION: "change-active-style-section",
|
|
54
98
|
CHANGE_STYLE_SECTION: "change-style-section",
|
|
@@ -58,6 +102,17 @@ const POST_MESSAGE_EVENTS = {
|
|
|
58
102
|
UPDATE_BINDING_ERRORS: "update-binding-errors",
|
|
59
103
|
OPEN_IN_COMPOSABLE_STUDIO_EVENT_MESSAGE: "open-composable-studio",
|
|
60
104
|
UPDATE_SYMBOLS: "update-symbols",
|
|
105
|
+
GET_SYMBOLS: "get-symbols",
|
|
106
|
+
GET_SECTIONS: "get-sections",
|
|
107
|
+
// Parent → SDK: push the latest per-instance section binding map
|
|
108
|
+
// (dataSources.section_compositions) after a section-context recompute on
|
|
109
|
+
// Studio side. Carries only the section slice, not the full spec.data.
|
|
110
|
+
UPDATE_SECTION_CONTEXTS: "update-section-contexts",
|
|
111
|
+
// Parent → SDK: push the full section-composition catalog (one entry per
|
|
112
|
+
// section in the project). Fired by Studio whenever the local section
|
|
113
|
+
// store hydrates / updates, so the iframe doesn't depend on a one-shot
|
|
114
|
+
// GET_SECTIONS reply that races with Studio's async fetch.
|
|
115
|
+
UPDATE_SECTIONS_CATALOG: "update-sections-catalog",
|
|
61
116
|
ADD_NEW_SYMBOL: "add-new-symbol",
|
|
62
117
|
HIDDEN_COMPONENT_NOTIFICATION: "hidden-component-notification",
|
|
63
118
|
CONTEXT_MENU: "context-menu",
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/constant.ts","../../src/main.ts"],"sourcesContent":[null,null],"names":["EventManager"],"mappings":";;;;AAAO,MAAM,4BAA4B,GAAG;AACrC,MAAM,4CAA4C,GACvD;AACK,MAAM,sBAAsB,GAAG;AAE/B,MAAM,kCAAkC,GAAG;AAC3C,MAAM,yBAAyB,GAAG;AAElC,MAAM,6BAA6B,GAAG;AAC3C,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,qBAAqB,EAAE,oBAAoB;AAC3C,IAAA,cAAc,EAAE,mBAAmB;AACnC,IAAA,YAAY,EAAE,MAAM;AACpB;;;;AAIG;AACH,IAAA,iBAAiB,EAAE,cAAc;AACjC,IAAA,sBAAsB,EAAE,wBAAwB;AAChD,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,cAAc,EAAE,SAAS;;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/constant.ts","../../src/main.ts"],"sourcesContent":[null,null],"names":["EventManager"],"mappings":";;;;AAAO,MAAM,4BAA4B,GAAG;AACrC,MAAM,4CAA4C,GACvD;AACK,MAAM,sBAAsB,GAAG;AAE/B,MAAM,kCAAkC,GAAG;AAC3C,MAAM,yBAAyB,GAAG;AAElC,MAAM,6BAA6B,GAAG;AAC3C,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,qBAAqB,EAAE,oBAAoB;AAC3C,IAAA,cAAc,EAAE,mBAAmB;AACnC,IAAA,YAAY,EAAE,MAAM;AACpB;;;;AAIG;AACH,IAAA,iBAAiB,EAAE,cAAc;AACjC,IAAA,sBAAsB,EAAE,wBAAwB;AAChD,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,cAAc,EAAE,SAAS;AACzB;;;;;;;AAOG;AACH,IAAA,kBAAkB,EAAE,uBAAuB;AAC3C;;;;;;;;;AASG;AACH,IAAA,MAAM,EAAE,WAAW;AACnB;;;AAGG;AACH,IAAA,aAAa,EAAE,kBAAkB;;AAG5B,MAAM,mBAAmB,GAAG;AACjC,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,gBAAgB,EAAE,kBAAkB;AACpC,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,qBAAqB,EAAE,uBAAuB;AAC9C,IAAA,mBAAmB,EAAE,qBAAqB;AAC1C,IAAA,mBAAmB,EAAE,qBAAqB;AAC1C,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,sBAAsB,EAAE,wBAAwB;A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{
|
|
|
17
17
|
CONNECTED_CONTENT_TYPE: "connected-content-type",
|
|
18
18
|
DYNAMIC_URL: "dynamic-url",
|
|
19
19
|
VISUAL_BUILDER: "builder",
|
|
20
|
+
/**
|
|
21
|
+
* When Studio renders the iframe and the user has explicitly picked an
|
|
22
|
+
* entry from the navbar, Studio appends this param so the SDK (running
|
|
23
|
+
* inside Studio) can prefer it over a host-passed `templateEntryUid`.
|
|
24
|
+
*
|
|
25
|
+
* Only honored when the SDK detects it is running inside Studio (via
|
|
26
|
+
* `ENABLED`). Outside Studio it is ignored.
|
|
27
|
+
*/
|
|
28
|
+
TEMPLATE_ENTRY_UID: "cs-template-entry-uid",
|
|
29
|
+
/**
|
|
30
|
+
* Locale Studio wants the SDK to render in. Set by Studio when its canvas
|
|
31
|
+
* URL carries `?locale=...`. The SDK overrides its own `config.locale`
|
|
32
|
+
* with this value so all SDK-side data fetches (initial + linked entries)
|
|
33
|
+
* use the right locale, and so the postmessages back to Studio
|
|
34
|
+
* (INIT_STUDIO.globalLocale, GET_COMPOSITION_SPEC.locale) carry it too.
|
|
35
|
+
*
|
|
36
|
+
* Only honored when the SDK detects it is running inside Studio (via
|
|
37
|
+
* `ENABLED`). Outside Studio it is ignored.
|
|
38
|
+
*/
|
|
39
|
+
LOCALE: "cs-locale",
|
|
40
|
+
/**
|
|
41
|
+
* Variant alias Studio wants the SDK to render in. Same flow as `LOCALE`
|
|
42
|
+
* but for variant. Set by Studio when its canvas URL carries `?variant=...`.
|
|
43
|
+
*/
|
|
44
|
+
VARIANT_ALIAS: "cs-variant-alias",
|
|
20
45
|
};
|
|
21
46
|
const POST_MESSAGE_EVENTS = {
|
|
22
47
|
INIT_STUDIO: "init-studio",
|
|
@@ -45,6 +70,25 @@ const POST_MESSAGE_EVENTS = {
|
|
|
45
70
|
REGISTER_BREAKPOINTS: "register-breakpoints",
|
|
46
71
|
SET_CURSOR_TYPE: "set-cursor-type",
|
|
47
72
|
GET_COMPOSITION_SPEC: "get-composition-spec",
|
|
73
|
+
// Studio Intelligence Protocol (SDK 1.5.0+)
|
|
74
|
+
GET_STUDIO_INTELLIGENCE: "get-studio-intelligence",
|
|
75
|
+
// Fast Rendering Protocol (Canvas Delay Fix)
|
|
76
|
+
IFRAME_STUDIO_CONTEXT: "iframe-studio-context",
|
|
77
|
+
SDK_SPEC_RESOLVED: "sdk-spec-resolved",
|
|
78
|
+
// Iframe → Studio: per-component resolution telemetry (what was queried,
|
|
79
|
+
// which compositions were shortlisted with specificity, and which won).
|
|
80
|
+
// Emitted by every SDK component instance regardless of the edited-composition
|
|
81
|
+
// gate, so Studio can list what loaded and explain why the edited one didn't.
|
|
82
|
+
SDK_DIAGNOSTICS: "sdk-diagnostics",
|
|
83
|
+
// SDK Initialization Signal (SDK 1.5.0+)
|
|
84
|
+
SDK_INITIALIZED: "sdk-initialized",
|
|
85
|
+
// Iframe → Studio: fired once the post-message listeners registered by
|
|
86
|
+
// `useSpecDataListener` are in place. Studio should gate any editor → iframe
|
|
87
|
+
// sends (notably UPDATE_SPEC_DATA) on receipt of this signal — it is the
|
|
88
|
+
// only event guaranteed to fire AFTER EditableRenderer commits its first
|
|
89
|
+
// render. Earlier signals (SDK_SPEC_RESOLVED, INIT_STUDIO) fire before the
|
|
90
|
+
// React tree mounts and race against the listener registration.
|
|
91
|
+
LISTENERS_READY: "listeners-ready",
|
|
48
92
|
REPLACE_PREVIEW_ENTRY: "replace-preview-entry",
|
|
49
93
|
CHANGE_ACTIVE_STYLE_SECTION: "change-active-style-section",
|
|
50
94
|
CHANGE_STYLE_SECTION: "change-style-section",
|
|
@@ -54,6 +98,17 @@ const POST_MESSAGE_EVENTS = {
|
|
|
54
98
|
UPDATE_BINDING_ERRORS: "update-binding-errors",
|
|
55
99
|
OPEN_IN_COMPOSABLE_STUDIO_EVENT_MESSAGE: "open-composable-studio",
|
|
56
100
|
UPDATE_SYMBOLS: "update-symbols",
|
|
101
|
+
GET_SYMBOLS: "get-symbols",
|
|
102
|
+
GET_SECTIONS: "get-sections",
|
|
103
|
+
// Parent → SDK: push the latest per-instance section binding map
|
|
104
|
+
// (dataSources.section_compositions) after a section-context recompute on
|
|
105
|
+
// Studio side. Carries only the section slice, not the full spec.data.
|
|
106
|
+
UPDATE_SECTION_CONTEXTS: "update-section-contexts",
|
|
107
|
+
// Parent → SDK: push the full section-composition catalog (one entry per
|
|
108
|
+
// section in the project). Fired by Studio whenever the local section
|
|
109
|
+
// store hydrates / updates, so the iframe doesn't depend on a one-shot
|
|
110
|
+
// GET_SECTIONS reply that races with Studio's async fetch.
|
|
111
|
+
UPDATE_SECTIONS_CATALOG: "update-sections-catalog",
|
|
57
112
|
ADD_NEW_SYMBOL: "add-new-symbol",
|
|
58
113
|
HIDDEN_COMPONENT_NOTIFICATION: "hidden-component-notification",
|
|
59
114
|
CONTEXT_MENU: "context-menu",
|
package/dist/esm/constant.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constant.js","sources":["../../src/constant.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAO,MAAM,4BAA4B,GAAG;AACrC,MAAM,4CAA4C,GACvD;AACK,MAAM,sBAAsB,GAAG;AAE/B,MAAM,kCAAkC,GAAG;AAC3C,MAAM,yBAAyB,GAAG;AAElC,MAAM,6BAA6B,GAAG;AAC3C,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,qBAAqB,EAAE,oBAAoB;AAC3C,IAAA,cAAc,EAAE,mBAAmB;AACnC,IAAA,YAAY,EAAE,MAAM;AACpB;;;;AAIG;AACH,IAAA,iBAAiB,EAAE,cAAc;AACjC,IAAA,sBAAsB,EAAE,wBAAwB;AAChD,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,cAAc,EAAE,SAAS;;
|
|
1
|
+
{"version":3,"file":"constant.js","sources":["../../src/constant.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAO,MAAM,4BAA4B,GAAG;AACrC,MAAM,4CAA4C,GACvD;AACK,MAAM,sBAAsB,GAA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gCAAgC;;MAGrD,UAAU,GAAG,OAAO,MAAM,KAAK;;;;"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventManager } from '@contentstack/advanced-post-message';
|
|
2
|
-
export { CompositionSavedEventData, GetNodeScreenshotEventData, GetNodeScreenshotResponseEventData, HiddenElementNotificationEventData, OpenComposableStudioFromStudioEventData, OpenComposableStudioFromVBEventData, PrimaryCompositionDetectedEventData } from '@contentstack/studio-message-types/latest';
|
|
2
|
+
export { CompositionResolutionDiagnosticEventData, CompositionSavedEventData, GetNodeScreenshotEventData, GetNodeScreenshotResponseEventData, HiddenElementNotificationEventData, OpenComposableStudioFromStudioEventData, OpenComposableStudioFromVBEventData, PrimaryCompositionDetectedEventData, ResolvedComposition, ShortlistedComposition } from '@contentstack/studio-message-types/latest';
|
|
3
|
+
export { CompositionQuery } from '@contentstack/studio-message-types/base';
|
|
3
4
|
|
|
4
5
|
declare const composableStudioEventManager: EventManager | undefined;
|
|
5
6
|
declare const composableStudioPopupEventManager: EventManager | undefined;
|
|
@@ -25,6 +26,31 @@ declare const COMPOSABLE_STUDIO_QUERY_PARAM: {
|
|
|
25
26
|
readonly CONNECTED_CONTENT_TYPE: "connected-content-type";
|
|
26
27
|
readonly DYNAMIC_URL: "dynamic-url";
|
|
27
28
|
readonly VISUAL_BUILDER: "builder";
|
|
29
|
+
/**
|
|
30
|
+
* When Studio renders the iframe and the user has explicitly picked an
|
|
31
|
+
* entry from the navbar, Studio appends this param so the SDK (running
|
|
32
|
+
* inside Studio) can prefer it over a host-passed `templateEntryUid`.
|
|
33
|
+
*
|
|
34
|
+
* Only honored when the SDK detects it is running inside Studio (via
|
|
35
|
+
* `ENABLED`). Outside Studio it is ignored.
|
|
36
|
+
*/
|
|
37
|
+
readonly TEMPLATE_ENTRY_UID: "cs-template-entry-uid";
|
|
38
|
+
/**
|
|
39
|
+
* Locale Studio wants the SDK to render in. Set by Studio when its canvas
|
|
40
|
+
* URL carries `?locale=...`. The SDK overrides its own `config.locale`
|
|
41
|
+
* with this value so all SDK-side data fetches (initial + linked entries)
|
|
42
|
+
* use the right locale, and so the postmessages back to Studio
|
|
43
|
+
* (INIT_STUDIO.globalLocale, GET_COMPOSITION_SPEC.locale) carry it too.
|
|
44
|
+
*
|
|
45
|
+
* Only honored when the SDK detects it is running inside Studio (via
|
|
46
|
+
* `ENABLED`). Outside Studio it is ignored.
|
|
47
|
+
*/
|
|
48
|
+
readonly LOCALE: "cs-locale";
|
|
49
|
+
/**
|
|
50
|
+
* Variant alias Studio wants the SDK to render in. Same flow as `LOCALE`
|
|
51
|
+
* but for variant. Set by Studio when its canvas URL carries `?variant=...`.
|
|
52
|
+
*/
|
|
53
|
+
readonly VARIANT_ALIAS: "cs-variant-alias";
|
|
28
54
|
};
|
|
29
55
|
declare const POST_MESSAGE_EVENTS: {
|
|
30
56
|
readonly INIT_STUDIO: "init-studio";
|
|
@@ -53,6 +79,12 @@ declare const POST_MESSAGE_EVENTS: {
|
|
|
53
79
|
readonly REGISTER_BREAKPOINTS: "register-breakpoints";
|
|
54
80
|
readonly SET_CURSOR_TYPE: "set-cursor-type";
|
|
55
81
|
readonly GET_COMPOSITION_SPEC: "get-composition-spec";
|
|
82
|
+
readonly GET_STUDIO_INTELLIGENCE: "get-studio-intelligence";
|
|
83
|
+
readonly IFRAME_STUDIO_CONTEXT: "iframe-studio-context";
|
|
84
|
+
readonly SDK_SPEC_RESOLVED: "sdk-spec-resolved";
|
|
85
|
+
readonly SDK_DIAGNOSTICS: "sdk-diagnostics";
|
|
86
|
+
readonly SDK_INITIALIZED: "sdk-initialized";
|
|
87
|
+
readonly LISTENERS_READY: "listeners-ready";
|
|
56
88
|
readonly REPLACE_PREVIEW_ENTRY: "replace-preview-entry";
|
|
57
89
|
readonly CHANGE_ACTIVE_STYLE_SECTION: "change-active-style-section";
|
|
58
90
|
readonly CHANGE_STYLE_SECTION: "change-style-section";
|
|
@@ -61,6 +93,10 @@ declare const POST_MESSAGE_EVENTS: {
|
|
|
61
93
|
readonly UPDATE_BINDING_ERRORS: "update-binding-errors";
|
|
62
94
|
readonly OPEN_IN_COMPOSABLE_STUDIO_EVENT_MESSAGE: "open-composable-studio";
|
|
63
95
|
readonly UPDATE_SYMBOLS: "update-symbols";
|
|
96
|
+
readonly GET_SYMBOLS: "get-symbols";
|
|
97
|
+
readonly GET_SECTIONS: "get-sections";
|
|
98
|
+
readonly UPDATE_SECTION_CONTEXTS: "update-section-contexts";
|
|
99
|
+
readonly UPDATE_SECTIONS_CATALOG: "update-sections-catalog";
|
|
64
100
|
readonly ADD_NEW_SYMBOL: "add-new-symbol";
|
|
65
101
|
readonly HIDDEN_COMPONENT_NOTIFICATION: "hidden-component-notification";
|
|
66
102
|
readonly CONTEXT_MENU: "context-menu";
|
|
@@ -83,20 +119,15 @@ type ComposableStudioQueryParams = {
|
|
|
83
119
|
[key in ComposableStudioQueryParamsKeys]: string;
|
|
84
120
|
};
|
|
85
121
|
|
|
86
|
-
type
|
|
87
|
-
composableUid: string;
|
|
88
|
-
} | {
|
|
122
|
+
type CompositionQueryInput = {
|
|
89
123
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
124
|
+
* Passing only the composition UID is the fastest way to fetch the composition.
|
|
125
|
+
* It is useful for the freeform templates.
|
|
126
|
+
*
|
|
127
|
+
* However, if you only pass the composition UID, you should also pass the
|
|
128
|
+
* `templateEntryUid` to fetch the correct entry from the connected content type.
|
|
129
|
+
* Otherwise, we will fetch the first entry of the connected content type.
|
|
93
130
|
*/
|
|
94
|
-
url: string;
|
|
95
|
-
} | {
|
|
96
|
-
composableUid: string;
|
|
97
|
-
url: string;
|
|
98
|
-
};
|
|
99
|
-
type CompositionQueryInput = {
|
|
100
131
|
compositionUid: string;
|
|
101
132
|
} | {
|
|
102
133
|
/**
|
|
@@ -108,6 +139,22 @@ type CompositionQueryInput = {
|
|
|
108
139
|
} | {
|
|
109
140
|
compositionUid: string;
|
|
110
141
|
url: string;
|
|
142
|
+
} | {
|
|
143
|
+
url: string;
|
|
144
|
+
/**
|
|
145
|
+
* It is the Content type UID of the connected content type.
|
|
146
|
+
*/
|
|
147
|
+
templateContentTypeUid: string;
|
|
148
|
+
} | {
|
|
149
|
+
/**
|
|
150
|
+
* It is the Content type UID of the connected content type.
|
|
151
|
+
*
|
|
152
|
+
* If you only pass the template content type UID, you should also pass the
|
|
153
|
+
* `templateEntryUid` to fetch the correct entry from the connected content type.
|
|
154
|
+
* Otherwise, we will fetch the first entry of the connected content type.
|
|
155
|
+
* first entry of the connected content type for the linked templates.
|
|
156
|
+
*/
|
|
157
|
+
templateContentTypeUid: string;
|
|
111
158
|
};
|
|
112
159
|
|
|
113
160
|
type BuiltInCanvasConfig = {
|
|
@@ -115,4 +162,4 @@ type BuiltInCanvasConfig = {
|
|
|
115
162
|
};
|
|
116
163
|
|
|
117
164
|
export { COMPOSABLE_STUDIO_BUILT_IN_CANVAS_CHANNEL_ID, COMPOSABLE_STUDIO_BUILT_IN_CANVAS_POST_MESSAGE_EVENTS, COMPOSABLE_STUDIO_CHANNEL_ID, COMPOSABLE_STUDIO_POPUP_CHANNEL_ID, COMPOSABLE_STUDIO_QUERY_PARAM, IS_BROWSER, LIVE_EDITOR_CHANNEL_ID, POST_MESSAGE_EVENTS, VISUAL_BUILDER_CHANNEL_ID, VISUAL_BUILDER_POST_MESSAGE_EVENTS, composableStudioBuiltInCanvasEventManager, composableStudioEventManager, composableStudioPopupEventManager, visualBuilderEventManager };
|
|
118
|
-
export type { BuiltInCanvasConfig, ComposableStudioQueryParams, ComposableStudioQueryParamsKeys,
|
|
165
|
+
export type { BuiltInCanvasConfig, ComposableStudioQueryParams, ComposableStudioQueryParamsKeys, CompositionQueryInput };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/studio-messenger",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "This package handles communication between the Studio platform and the iframe webpage.",
|
|
5
5
|
"main": "dist/cjs/index.cjs",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"url": "https://github.com/contentstack/composable-studio-sdk/issues"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@contentstack/common-config": "^1.1.
|
|
43
|
+
"@contentstack/common-config": "^1.1.7",
|
|
44
44
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
45
45
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
46
46
|
"@rollup/plugin-terser": "^1.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@contentstack/advanced-post-message": "^0.0.2",
|
|
56
|
-
"@contentstack/studio-message-types": "^1.2.
|
|
56
|
+
"@contentstack/studio-message-types": "^1.2.1"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "d4e0a1d80b39a2bfa9ac12baa5d4d4a852f4b326"
|
|
59
59
|
}
|