@contentstack/studio-client 3.1.0 → 3.2.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/index.d.ts CHANGED
@@ -614,23 +614,45 @@ type StudioComponentFetchOptions = {
614
614
  */
615
615
  type StudioComponentSpecOptions = {
616
616
  /**
617
- * When the componen is rendered in SSR within the studio,
618
- * we get the spec as null. YOU SHOULD NOT PASS IT AS NULL.
617
+ * The resolved composition. `null` only when a caller builds this object by
618
+ * hand to mean "I hold no spec, fetch it from the parent window" — the
619
+ * built-in canvas does exactly that, having no credentials to fetch with.
620
+ * A fetch never returns `null`; it rejects instead.
619
621
  */
620
622
  spec: StudioSpec | null;
623
+ /**
624
+ * Opaque machinery for `<StudioComponent>` — pass it through, do not inspect
625
+ * it. The renderer reads the composition query, the query options and the
626
+ * config out of it to re-initialise and re-fetch on the client.
627
+ */
621
628
  fetchOptions: StudioComponentFetchOptions;
622
629
  /**
623
- * This is used to determine whether the spec is available.
624
- * If the spec is not available, we can show a 404 page.
630
+ * Whether the resolved spec carries a composition entry.
631
+ *
632
+ * **Not a 404 signal.** Every "there is no composition here" outcome rejects
633
+ * rather than returning, so on a resolved fetch this is always `true`, and on
634
+ * the push path it is `true` whenever Studio supplied a spec. To test for the
635
+ * no-spec sentinel, check `spec` itself.
636
+ *
637
+ * @deprecated Read `spec.compositionEntry` directly, and decide 404 from the
638
+ * rejected `ComposableStudioError`. Slated for removal in a future major.
625
639
  */
626
640
  hasSpec: boolean;
627
641
  /**
628
- * This is used to determine whether the template (connected Template data)
629
- * is available.
630
- * If the template is not available, we can show a 404 page.
642
+ * Whether the spec carries resolved data for a connected content type.
643
+ *
644
+ * **Not a 404 signal.** It is `false` for every **freeform** composition, so
645
+ * gating a 404 on it returns 404 for every freeform page, however that page
646
+ * is published. Its exact meaning also differs between the fetch and push
647
+ * paths, which is a second reason not to branch on it.
631
648
  *
632
- * This value is false if the template is not available or the composition
633
- * is not connected to a template.
649
+ * @deprecated For composition kind read
650
+ * `spec.compositionEntry.connected_content_type` (empty or absent means
651
+ * freeform). For the 404 decision branch on the rejected
652
+ * `ComposableStudioError`'s `id`: `COMPOSITION_NOT_FOUND`,
653
+ * `COMPOSITION_NOT_FOUND_BY_URL` and `PREVIEW_ENTRY_NOT_FOUND` mean "no page
654
+ * at this URL"; every other id is a render failure and should surface as
655
+ * 5xx, not 404. Slated for removal in a future major.
634
656
  */
635
657
  hasTemplate: boolean;
636
658
  /**
@@ -838,6 +860,24 @@ declare class ComposableStudioError extends Error {
838
860
  }
839
861
 
840
862
  declare const evaluateCondition: (condition: Condition, data: any) => boolean;
863
+ /**
864
+ * Answers both questions a ConditionBlock has to ask: does this condition pass,
865
+ * and what data should its children see.
866
+ *
867
+ * When the condition binds through a repeater, the bound value is projected
868
+ * onto the repeater's context path so descendants resolve against the matched
869
+ * branch. Everything off that path is shared by reference — the projection must
870
+ * not deep-copy the spec, which is large.
871
+ *
872
+ * Lives here, with `evaluateCondition`, because all three renderers (runtime,
873
+ * editor and RSC) need the identical answer and previously derived it
874
+ * separately. `shouldRender` is evaluated against the UNPROJECTED data, which
875
+ * is what all three did.
876
+ */
877
+ declare const resolveConditionScope: <T>(condition: Condition, data: T) => {
878
+ shouldRender: boolean;
879
+ scopedData: T;
880
+ };
841
881
 
842
882
  declare class RendererModeUtil {
843
883
  private searchParams;
@@ -982,6 +1022,18 @@ interface SectionNeeds {
982
1022
  uidRemapping?: Record<string, string>;
983
1023
  cardinality?: "collection" | "single";
984
1024
  componentPropsFallback?: Record<string, unknown>;
1025
+ /**
1026
+ * The document this instance's section data lives in (ADR 0017): `"template"`,
1027
+ * a `<ct>:<uid>` pinned-entry key, or `query:<dsUid>`. Absent ⇒ template, so
1028
+ * every pre-existing composition behaves exactly as before.
1029
+ */
1030
+ fetchRootKey?: string;
1031
+ /**
1032
+ * The path WITHIN that document. For the template root this is the same thing
1033
+ * as `selectedField`; for a pinned-entry root it is the root path with the
1034
+ * `<ct>:<uid>` document segment already dropped.
1035
+ */
1036
+ fetchRootPrefix?: string[];
985
1037
  }
986
1038
  type NeedsBySection = Map<string, SectionNeeds>;
987
1039
 
@@ -1086,6 +1138,251 @@ declare function getCompositionMetadata(specOptions: Pick<StudioComponentSpecOpt
1086
1138
  */
1087
1139
  declare function renderMetadataToHtml(metadata: CompositionMetadata): string;
1088
1140
 
1141
+ /**
1142
+ * A placement's **Section data** — the binding that supplies a placed section's
1143
+ * data, i.e. what the section's own `template.*` paths resolve against.
1144
+ *
1145
+ * Persisted on the placed section-composition node as part of
1146
+ * `metadata.sectionBindingOverride`. Being a binding rather than a bare field
1147
+ * path is what lets a section root at a pinned entry, a query result or a
1148
+ * repeater item — none of which a freeform page can express as a path into a
1149
+ * page template entry it does not have. See ADR 0016.
1150
+ *
1151
+ * Three states, all distinguishable and all load-bearing:
1152
+ *
1153
+ * | value | meaning |
1154
+ * |-------------|--------------------------------------------------------|
1155
+ * | `undefined` | inherit the section's declared `selected_field` |
1156
+ * | `null` | deliberately cleared — render no bound data |
1157
+ * | a binding | the author's choice |
1158
+ *
1159
+ * `undefined` cannot be collapsed into `null`: absence has to keep meaning
1160
+ * "follow the section's declaration", so a section author's later change to
1161
+ * `linked_schemas` still propagates to placements that never opted in.
1162
+ */
1163
+ type SectionDataBinding = BindingType | null | undefined;
1164
+ interface SectionBindingOverride {
1165
+ /**
1166
+ * Legacy per-placement field path. Still READ (it is the migration source for
1167
+ * `rootBinding`), never newly written.
1168
+ */
1169
+ selectedField?: string;
1170
+ uidRemapping?: Record<string, string>;
1171
+ /** The Section data. See {@link SectionDataBinding} for the three states. */
1172
+ rootBinding?: BindingType | null;
1173
+ /**
1174
+ * Which `linked_schemas` entry the Section data matched.
1175
+ *
1176
+ * On a template the winner is found by `content_type_uid === pageCT`. A
1177
+ * freeform page has no page content type, so without this the cold-load path
1178
+ * falls back to `linked_schemas[0]` and reads `cardinality` off the wrong
1179
+ * schema — a collection section then silently renders as a single element.
1180
+ */
1181
+ matchedSchemaCt?: string;
1182
+ }
1183
+ /** Binding `type` for a path into the page's template entry. */
1184
+ declare const TEMPLATE_BINDING_TYPE = "template";
1185
+ /**
1186
+ * Split a dotted field path into binding-path segments, dropping the array
1187
+ * indices and modular-block numeric prefixes that are not data keys. Mirrors
1188
+ * `sanitizeFieldPath` in sdk.ts — kept local so this module stays dependency-free
1189
+ * and usable from Studio.
1190
+ */
1191
+ declare function splitFieldPath(path: string): string[];
1192
+ /**
1193
+ * Nest dotted path segments into the object shape a binding `value.path` uses:
1194
+ * `["a", "b"]` → `{ a: { b: {} } }`. An empty path nests to `{}`, which is what
1195
+ * a scope-root binding carries.
1196
+ */
1197
+ declare function nestPath(segments: string[]): Record<string, unknown>;
1198
+ /** The inverse of {@link nestPath}: walk the single-key chain back to segments. */
1199
+ declare function flattenPath(path: Record<string, unknown> | undefined | null): string[];
1200
+ /**
1201
+ * Build the template-typed Section data equivalent to a legacy `selectedField`.
1202
+ *
1203
+ * This is the whole migration: every placement saved before the Section data
1204
+ * existed resolves to exactly the binding it behaved as, derived on read. No
1205
+ * stored data changes.
1206
+ */
1207
+ declare function synthesizeTemplateRootBinding(selectedField: string | undefined): BindingType;
1208
+ /** Whether a resolved Section data means "deliberately cleared". */
1209
+ declare function isDataRootCleared(root: SectionDataBinding): root is null;
1210
+ /**
1211
+ * Whether a Section data points into the page's template entry — the only kind
1212
+ * that extends a page-template prefix. A contentstack / query / repeater-typed
1213
+ * root names its own document instead (see ADR 0017's fetch root).
1214
+ */
1215
+ declare function isTemplateRootBinding(root: SectionDataBinding): boolean;
1216
+ /**
1217
+ * The path a Section data addresses **within the scope its placement already
1218
+ * inherits** — the page template entry for a `template` root, the live
1219
+ * iteration item for a `repeater` one (ADR 0006).
1220
+ *
1221
+ * This is what the renderer means by `selectedField`: the provider scopes the
1222
+ * enclosing repeater item (or the template entry) by it. A root naming ANOTHER
1223
+ * document carries its path in the fetch root's `prefix` instead, so it has no
1224
+ * scope path — the two are never both in play.
1225
+ *
1226
+ * The `template`-only version of this test is what left a repeater-relative
1227
+ * root unusable: its path (`hero_card` inside the item) was dropped on the way
1228
+ * to the renderer, every iteration scoped to the whole item, and the section
1229
+ * rendered component defaults.
1230
+ */
1231
+ declare function getRootScopePath(root: SectionDataBinding): string[];
1232
+ /**
1233
+ * The dotted path a Section data addresses *within* its document.
1234
+ *
1235
+ * For a template root this is the old `selectedField`. For a contentstack root
1236
+ * the first segment is the `<ct>:<uid>` pool key, which names the **document**
1237
+ * rather than a field inside it — callers that need the in-document path must
1238
+ * drop it (`dropDocumentSegment`).
1239
+ */
1240
+ declare function getRootBindingPath(root: SectionDataBinding): string[];
1241
+ interface SectionInstanceNode {
1242
+ metadata?: {
1243
+ sectionBindingOverride?: SectionBindingOverride;
1244
+ selectedField?: string;
1245
+ compositionUID?: string;
1246
+ [key: string]: unknown;
1247
+ };
1248
+ }
1249
+ type LinkedSchemasLookup = (compositionUid: string | undefined) => Array<{
1250
+ content_type_uid: string;
1251
+ selected_field?: string;
1252
+ }>;
1253
+ /**
1254
+ * The legacy `selectedField` ladder, verbatim: per-instance override → legacy
1255
+ * `metadata.selectedField` → the `linked_schemas` default for the page content
1256
+ * type → the first schema.
1257
+ *
1258
+ * Extracted so the Section data resolver and the existing page-template
1259
+ * projection read the SAME ladder and cannot drift. Returns the path
1260
+ * **unsanitised** — callers that need CDA-safe segments sanitise at the point
1261
+ * of use, exactly as they did before the Section data existed.
1262
+ */
1263
+ declare function resolveLegacySelectedField(node: SectionInstanceNode, linkedSchemasFor: LinkedSchemasLookup, pageContentTypeUid: string): string;
1264
+ /**
1265
+ * Where a resolved `selectedField` came from — which decides whether it is
1266
+ * relative to an enclosing wrapper section or absolute from the page root.
1267
+ *
1268
+ * - `"override"` — the page composer picked it. The picker's options come from
1269
+ * `findMatchingPageFields` against the schema **scoped to the drop
1270
+ * location**, so an override is RELATIVE to the enclosing wrapper.
1271
+ * - `"declared"` — read off `linked_schemas` by matching the PAGE content
1272
+ * type, so it is rooted at the page entry: ABSOLUTE.
1273
+ * - `"legacy"` — `metadata.selectedField` from before per-instance overrides
1274
+ * existed; same origin as `declared`, so also absolute.
1275
+ *
1276
+ * This distinction is what the leading-overlap collapse in
1277
+ * `composeSectionTemplatePrefix` was approximating by string comparison. Overlap
1278
+ * catches an absolute path that happens to SHARE a leading segment with its
1279
+ * ancestor; it cannot catch one that does not, which is how a slot child ends up
1280
+ * with `author.related_block` — a path the referenced content type does not
1281
+ * have, silently dropped by CDA.
1282
+ */
1283
+ type SelectedFieldProvenance = "override" | "legacy" | "declared";
1284
+ declare function resolveLegacySelectedFieldWithProvenance(node: SectionInstanceNode, linkedSchemasFor: LinkedSchemasLookup, pageContentTypeUid: string): {
1285
+ field: string;
1286
+ provenance: SelectedFieldProvenance;
1287
+ };
1288
+ /**
1289
+ * Whether a resolved field is rooted at the page entry rather than at an
1290
+ * enclosing wrapper section. A page-absolute field must REPLACE the inherited
1291
+ * prefix, never be concatenated onto it.
1292
+ *
1293
+ * A scope-root field ("") is neither — it adds no segment either way — so it is
1294
+ * reported as not absolute to keep the inherited prefix intact.
1295
+ */
1296
+ declare function isPageAbsoluteField(field: string, provenance: SelectedFieldProvenance): boolean;
1297
+ /**
1298
+ * Resolve a section-composition node's effective **Section data**.
1299
+ *
1300
+ * Resolution order — the existing `selectedField` ladder with one tier added on
1301
+ * top, so this is strictly a superset of today's behaviour:
1302
+ *
1303
+ * 1. `sectionBindingOverride.rootBinding` when the key is PRESENT (including
1304
+ * an explicit `null`, which means cleared)
1305
+ * 2. otherwise synthesise a template-typed binding from the legacy
1306
+ * `selectedField` ladder: override → `metadata.selectedField` →
1307
+ * `linked_schemas` default for the page content type → first schema
1308
+ *
1309
+ * The caller MUST NOT write the result back onto the node. Persisted state is
1310
+ * structurally diffed against the save baseline (ADR 0007), so persisting a
1311
+ * derived value would mark every pre-existing page dirty the moment it opens,
1312
+ * and would freeze a live fallback into a copy.
1313
+ */
1314
+ declare function resolveInstanceRootBinding(node: SectionInstanceNode, linkedSchemasFor: LinkedSchemasLookup, pageContentTypeUid: string): SectionDataBinding;
1315
+ /**
1316
+ * Which `linked_schemas` entry a placement is bound to.
1317
+ *
1318
+ * Prefers the persisted `matchedSchemaCt` (the only answer available on a
1319
+ * freeform page), falling back to matching the page content type the way the
1320
+ * template path always has.
1321
+ */
1322
+ declare function resolveMatchedSchema<T extends {
1323
+ content_type_uid: string;
1324
+ selected_field?: string;
1325
+ }>(node: {
1326
+ metadata?: {
1327
+ sectionBindingOverride?: SectionBindingOverride;
1328
+ };
1329
+ }, linkedSchemas: T[] | undefined, pageContentTypeUid: string): T | undefined;
1330
+ /**
1331
+ * Deep-compare two Section datas. Used by the stamp pass, which must compare a
1332
+ * DERIVED binding against a DERIVED binding: comparing a `BindingType` object
1333
+ * against a raw `selectedField` string never matches, so every template
1334
+ * placement would stamp and every old page would go dirty on open.
1335
+ */
1336
+ declare function sectionDataEqual(a: SectionDataBinding, b: SectionDataBinding): boolean;
1337
+ /**
1338
+ * A **fetch root**: the single fetched document a set of data paths is rooted
1339
+ * at, and whose CDA `include[]` those paths are contributed to.
1340
+ *
1341
+ * `include[]` / `only[]` are properties of a *request*, not of a path — you can
1342
+ * only add an include to a document that is actually being fetched. So a path
1343
+ * is only meaningful paired with the document it counts from.
1344
+ *
1345
+ * A template page has exactly ONE fetch root (the template entry), which is why
1346
+ * the pre-existing code could accumulate every section's paths into two flat
1347
+ * arrays. A freeform page has one per Section data in play, so the destination is
1348
+ * per-instance and only knowable after resolving that instance's binding.
1349
+ */
1350
+ interface FetchRoot {
1351
+ /** `"template"`, a `<ct>:<uid>` pool key, or `query:<dsUid>`. */
1352
+ key: string;
1353
+ /** The path *within* that document. */
1354
+ prefix: string[];
1355
+ }
1356
+ declare const TEMPLATE_FETCH_ROOT_KEY = "template";
1357
+ declare const templateFetchRoot: (prefix?: string[]) => FetchRoot;
1358
+ /** Whether a fetch-root key names the page template entry. */
1359
+ declare function isTemplateFetchRoot(key: string): boolean;
1360
+ /**
1361
+ * Parse a `<ct>:<uid>` fetch-root key back into its parts. Returns null for the
1362
+ * template root and for query roots, neither of which is an entry.
1363
+ */
1364
+ declare function parseEntryFetchRootKey(key: string): {
1365
+ contentTypeUid: string;
1366
+ entryUid: string;
1367
+ } | null;
1368
+ /**
1369
+ * Derive the fetch root a Section data addresses.
1370
+ *
1371
+ * The first path segment of a non-template binding names the **document**, not
1372
+ * a field inside it, so it becomes the key and is dropped from the prefix:
1373
+ *
1374
+ * { contentstack, path: { "mkt_ct:blt1": { banner: {} } } }
1375
+ * → { key: "mkt_ct:blt1", prefix: ["banner"] }
1376
+ *
1377
+ * A `repeater`-typed root inherits the enclosing document: the repeater re-scopes
1378
+ * per iteration at render time, but the includes still belong to whichever
1379
+ * document the repeater's own source was fetched from.
1380
+ *
1381
+ * Returns `inherited` unchanged for a cleared root — there is nothing to fetch,
1382
+ * so nothing should be re-anchored.
1383
+ */
1384
+ declare function fetchRootFromBinding(root: SectionDataBinding, inherited: FetchRoot): FetchRoot;
1385
+
1089
1386
  /**
1090
1387
  * Processes the raw static values and stored them against their static value UID.
1091
1388
  *
@@ -1729,5 +2026,5 @@ declare function rankUrlMatches(requestUrl: string, lightweightEntries: Lightwei
1729
2026
  */
1730
2027
  declare function shouldUseUrlMetadataPath(url_metadata?: Partial<CompositionUrlMetadataSerialized>): boolean;
1731
2028
 
1732
- export { BreakpointManager, COMPOSABLE_DATA_ATTRIBUTES, COMPOSABLE_STUDIO_EMITTED_EVENTS, COMPOSITION_PLACEMENT_OPTIONS, COMPOSITION_PREVIEW_URL_SOURCES, COMPOSITION_PREVIEW_URL_SOURCES_VALUES, ComposableStudioError, ComposableStudioErrors, DEFAULT_BREAKPOINTS, DEFAULT_COMPOSITION_PREVIEW_URL_SOURCE, EDGE_PADDING, ELEMENT_TO_NODE, ExpressionResolver, GOOGLE_FONT_API, INCLUDE_DEPTH_COUNT, MAX_SCROLL_SPEED, NODE_TO_ELEMENT, NODE_TO_PARENT, NODE_TO_PATH_NODE, QueryExecutor, RendererMode, RendererModeUtil, SCHEMA_VERSION, SCROLL_INTERVAL, SDK_VERSION, SECTION_COMPOSITIONS_KEY, STUDIO_CANVAS_QUERY_PARAM, STUDIO_MODE_HTML_CLASS, TEMPLATE_FULL_ENTRY_KEY, URL_PATTERN_DATE_VARIABLES, URL_PATTERN_METADATA_FIELDS, URL_PATTERN_METADATA_FIELDS_VALUES, URL_PATTERN_VARIABLE_TYPES, addBreakpointEventListeners, addContextMenuEventListeners, addHighlightNodeEventListeners, addHighlightSpacingEventListeners, addUrlChangeListeners, analyzeMultipleSpecs, analyzeUsedComponents, applyOperation, batchFetchEntries, buildSectionScopedData, buildTemplateQuery, buildUrlMetadataQueryObject, calculateDynamicSpeed, clientRendererModeUtil, closeHiddenElementNotification, compileUrlPattern, composableStudioEventEmitter, compositionSaveEventListener, computePatternSpecificity, createClassNameUid, createEmbeddedEntryConversion, studioSdk as default, defaultAssetRender, detectStudioMode, dndEventListener, dndManager, entriesFromResponse, evaluateCondition, extractHtmlRteRefs, extractJsonRteRefs, fetchEmbeddedEntries, findNearestBuilderNode, findNearestSlotNode, findPath, findPathForElement, getBindingStringForCS, getComponentUsageStats, getComposableElement, getCompositionMetadata, getComputedStyles, getDefaultConfig, getEmbeddedAssetRenderer, getEmbeddedEntryRenderer, getHitboxDetails, getHitboxDirection, getJSONRTE, getNodeScreenshotEvent, getScrollableParent, getSeoMetadataPure, handleOnScroll, handleResize, hasSlotDropzone, hiddenElementNotificationEventEmitter, highlightNodeManager, isBrowser, isCompositionBeingEdited, isInsideIframe, isInsideVisualBuilderFrame, isModKey, isStudioCanvas, isStudioEditorMode, loadGoogleFont, markStudioMode, matchCompositionUrl, matchUrlPattern, onlyParmasGenerator, openHiddenElementNotification, parseStringValue, parseUrlMetadata, preProcessStaticValues, queryParam, rankUrlMatches, registerEmbeddedEntryRenderer, registerJSONRTE, registerRTERenderer, removeStaticEntryFromDS, renderMetadataToHtml, resolveByUrlSource, serializeComputedStyles, serializeEvent, setStaticEntryInDS, setTemplateEntryInDS, shouldExtractTaxonomies, shouldUseUrlMetadataPath, specUsesComponent, studioSdk, toggleNodeVisible, updateStyleOnStyleNodeChange };
1733
- export type { ClientEditableNodeInternalAttributes, ClientPreviewNodeInternalAttributes, ComposableStudioErrorDetails, ComposableStudioLightSdk, CompositionEntry, CompositionEntryIncompleteUi, CompositionFetcher, CompositionMetaTag, CompositionMetadata, CompositionPlacement, CompositionPreviewUrlSource, CompositionPreviewUrlSourceValues, CompositionQueryForSSR, CompositionQueryForSSRInput, CompositionQueryOptions, CompositionUrlMetadata, CompositionUrlMetadataSerialized, CompositionUrlQueries, Config, ConnectedEntryResult, DateVariableKey, EmbeddedAssetRenderArgs, EmbeddedEntryConversionOptions, EmbeddedEntryRenderArgs, EmittedEvents, ExtractedUrlPatternVariables, ExtractedUrlVariables, FetchCompositionContext, FetchTemplateEntryContext, FieldValue, FontVariants, GetCompositionMetadataOptions, GoogleFont, HiddenElementNotificationHandler, LightConfig, LightweightCompositionEntry, MetaProp, ParsedStringResult, PatternMatchResult, QueryExecutionOptions, QueryResult, QuerySpec, QueryState, RTEConfig, RankingResult, ReferenceFieldValue, RenderableCompositionEntry, ResolvedEmbeddedEntry, ResolvedQueryOptions, RuntimeContext, SearchQueryInput, SectionCompositionEntry, SeoMetadata, StudioComponentFetchOptions, StudioComponentSpecOptions, StudioMode, StudioSdk, StudioSpec, TemplateEntryFetcher, TemplateQueryContext, TroubleshootingInfo, URLSearchParamsString, UrlMatchDiagnostic, UrlMetadataQueryMode, UrlPatternMetadataField, UrlPatternMetadataFieldValue, UserConfig };
2029
+ export { BreakpointManager, COMPOSABLE_DATA_ATTRIBUTES, COMPOSABLE_STUDIO_EMITTED_EVENTS, COMPOSITION_PLACEMENT_OPTIONS, COMPOSITION_PREVIEW_URL_SOURCES, COMPOSITION_PREVIEW_URL_SOURCES_VALUES, ComposableStudioError, ComposableStudioErrors, DEFAULT_BREAKPOINTS, DEFAULT_COMPOSITION_PREVIEW_URL_SOURCE, EDGE_PADDING, ELEMENT_TO_NODE, ExpressionResolver, GOOGLE_FONT_API, INCLUDE_DEPTH_COUNT, MAX_SCROLL_SPEED, NODE_TO_ELEMENT, NODE_TO_PARENT, NODE_TO_PATH_NODE, QueryExecutor, RendererMode, RendererModeUtil, SCHEMA_VERSION, SCROLL_INTERVAL, SDK_VERSION, SECTION_COMPOSITIONS_KEY, STUDIO_CANVAS_QUERY_PARAM, STUDIO_MODE_HTML_CLASS, TEMPLATE_BINDING_TYPE, TEMPLATE_FETCH_ROOT_KEY, TEMPLATE_FULL_ENTRY_KEY, URL_PATTERN_DATE_VARIABLES, URL_PATTERN_METADATA_FIELDS, URL_PATTERN_METADATA_FIELDS_VALUES, URL_PATTERN_VARIABLE_TYPES, addBreakpointEventListeners, addContextMenuEventListeners, addHighlightNodeEventListeners, addHighlightSpacingEventListeners, addUrlChangeListeners, analyzeMultipleSpecs, analyzeUsedComponents, applyOperation, batchFetchEntries, buildSectionScopedData, buildTemplateQuery, buildUrlMetadataQueryObject, calculateDynamicSpeed, clientRendererModeUtil, closeHiddenElementNotification, compileUrlPattern, composableStudioEventEmitter, compositionSaveEventListener, computePatternSpecificity, createClassNameUid, createEmbeddedEntryConversion, studioSdk as default, defaultAssetRender, detectStudioMode, dndEventListener, dndManager, entriesFromResponse, evaluateCondition, extractHtmlRteRefs, extractJsonRteRefs, fetchEmbeddedEntries, fetchRootFromBinding, findNearestBuilderNode, findNearestSlotNode, findPath, findPathForElement, flattenPath, getBindingStringForCS, getComponentUsageStats, getComposableElement, getCompositionMetadata, getComputedStyles, getDefaultConfig, getEmbeddedAssetRenderer, getEmbeddedEntryRenderer, getHitboxDetails, getHitboxDirection, getJSONRTE, getNodeScreenshotEvent, getRootBindingPath, getRootScopePath, getScrollableParent, getSeoMetadataPure, handleOnScroll, handleResize, hasSlotDropzone, hiddenElementNotificationEventEmitter, highlightNodeManager, isBrowser, isCompositionBeingEdited, isDataRootCleared, isInsideIframe, isInsideVisualBuilderFrame, isModKey, isPageAbsoluteField, isStudioCanvas, isStudioEditorMode, isTemplateFetchRoot, isTemplateRootBinding, loadGoogleFont, markStudioMode, matchCompositionUrl, matchUrlPattern, nestPath, onlyParmasGenerator, openHiddenElementNotification, parseEntryFetchRootKey, parseStringValue, parseUrlMetadata, preProcessStaticValues, queryParam, rankUrlMatches, registerEmbeddedEntryRenderer, registerJSONRTE, registerRTERenderer, removeStaticEntryFromDS, renderMetadataToHtml, resolveByUrlSource, resolveConditionScope, resolveInstanceRootBinding, resolveLegacySelectedField, resolveLegacySelectedFieldWithProvenance, resolveMatchedSchema, sectionDataEqual, serializeComputedStyles, serializeEvent, setStaticEntryInDS, setTemplateEntryInDS, shouldExtractTaxonomies, shouldUseUrlMetadataPath, specUsesComponent, splitFieldPath, studioSdk, synthesizeTemplateRootBinding, templateFetchRoot, toggleNodeVisible, updateStyleOnStyleNodeChange };
2030
+ export type { ClientEditableNodeInternalAttributes, ClientPreviewNodeInternalAttributes, ComposableStudioErrorDetails, ComposableStudioLightSdk, CompositionEntry, CompositionEntryIncompleteUi, CompositionFetcher, CompositionMetaTag, CompositionMetadata, CompositionPlacement, CompositionPreviewUrlSource, CompositionPreviewUrlSourceValues, CompositionQueryForSSR, CompositionQueryForSSRInput, CompositionQueryOptions, CompositionUrlMetadata, CompositionUrlMetadataSerialized, CompositionUrlQueries, Config, ConnectedEntryResult, DateVariableKey, EmbeddedAssetRenderArgs, EmbeddedEntryConversionOptions, EmbeddedEntryRenderArgs, EmittedEvents, ExtractedUrlPatternVariables, ExtractedUrlVariables, FetchCompositionContext, FetchRoot, FetchTemplateEntryContext, FieldValue, FontVariants, GetCompositionMetadataOptions, GoogleFont, HiddenElementNotificationHandler, LightConfig, LightweightCompositionEntry, LinkedSchemasLookup, MetaProp, ParsedStringResult, PatternMatchResult, QueryExecutionOptions, QueryResult, QuerySpec, QueryState, RTEConfig, RankingResult, ReferenceFieldValue, RenderableCompositionEntry, ResolvedEmbeddedEntry, ResolvedQueryOptions, RuntimeContext, SearchQueryInput, SectionBindingOverride, SectionCompositionEntry, SectionDataBinding, SectionInstanceNode, SelectedFieldProvenance, SeoMetadata, StudioComponentFetchOptions, StudioComponentSpecOptions, StudioMode, StudioSdk, StudioSpec, TemplateEntryFetcher, TemplateQueryContext, TroubleshootingInfo, URLSearchParamsString, UrlMatchDiagnostic, UrlMetadataQueryMode, UrlPatternMetadataField, UrlPatternMetadataFieldValue, UserConfig };
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ import { studioSdk } from './composable-studio/initializer-sdk.js';
2
2
  export { ELEMENT_TO_NODE, NODE_TO_ELEMENT, NODE_TO_PARENT, NODE_TO_PATH_NODE } from './composable-studio/weak-maps.js';
3
3
  export { buildSectionScopedData, getSeoMetadataPure } from './composable-studio/sdk.js';
4
4
  export { getCompositionMetadata, renderMetadataToHtml } from './composable-studio/composition-metadata.js';
5
+ export { TEMPLATE_BINDING_TYPE, TEMPLATE_FETCH_ROOT_KEY, fetchRootFromBinding, flattenPath, getRootBindingPath, getRootScopePath, isDataRootCleared, isPageAbsoluteField, isTemplateFetchRoot, isTemplateRootBinding, nestPath, parseEntryFetchRootKey, resolveInstanceRootBinding, resolveLegacySelectedField, resolveLegacySelectedFieldWithProvenance, resolveMatchedSchema, sectionDataEqual, splitFieldPath, synthesizeTemplateRootBinding, templateFetchRoot } from './composable-studio/section-data.js';
5
6
  export { parseStringValue, preProcessStaticValues } from './composable-studio/data/pre-process-static-values.js';
6
7
  export { COMPOSITION_PLACEMENT_OPTIONS } from './composable-studio/composition-placement.types.js';
7
8
  export { addContextMenuEventListeners } from './context-menu/context-menu.js';
@@ -28,7 +29,7 @@ export { isInsideVisualBuilderFrame } from './utils/is-inside-visual-builder-fra
28
29
  export { isInsideIframe } from './utils/is-inside-iframe.js';
29
30
  export { STUDIO_CANVAS_QUERY_PARAM, STUDIO_MODE_HTML_CLASS, detectStudioMode, isStudioCanvas, isStudioEditorMode, markStudioMode } from './utils/editor-mode.js';
30
31
  export { ComposableStudioError, ComposableStudioErrors } from './utils/composable-studio-error.js';
31
- export { evaluateCondition } from './utils/conditionBlock.js';
32
+ export { evaluateCondition, resolveConditionScope } from './utils/conditionBlock.js';
32
33
  export { RendererModeUtil, clientRendererModeUtil, serializeComputedStyles } from './utils/canvas.js';
33
34
  export { analyzeMultipleSpecs, analyzeUsedComponents, getComponentUsageStats, specUsesComponent } from './utils/spec-analyzer.js';
34
35
  export { loadGoogleFont } from './design/fonts/index.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;"}
@@ -75,7 +75,7 @@ function buildReferencePredicate(ref, mode) {
75
75
  * pass the per-field object unchanged.
76
76
  */
77
77
  function buildTemplateQuery(stackSdk, context, queryOptions, mode = "match") {
78
- const { parsedUrlQueries, connectedContentType, extractedVariables, url_source, } = context;
78
+ const { compositionQuery, parsedUrlQueries, connectedContentType, extractedVariables, url_source, } = context;
79
79
  const queryObject = buildUrlMetadataQueryObject(context, mode);
80
80
  // Full-path `$or` branch for `{{entry.url}}` (entry.url-only for now). The
81
81
  // `url` field holds the full path, so we match it against the whole request
@@ -85,12 +85,22 @@ function buildTemplateQuery(stackSdk, context, queryOptions, mode = "match") {
85
85
  url_source !== COMPOSITION_PREVIEW_URL_SOURCES.LEGACY_URL;
86
86
  const hasEntryUrl = typeof extractedVariables.fields.url === "string" ||
87
87
  typeof extractedVariables.fields.url === "number";
88
+ // A literal pattern extracts no variables, so the decomposition is `{}` —
89
+ // which with `.limit(1)` means "any one entry of this content type", not
90
+ // "no filter". Match the request path against `url` instead, as
91
+ // content_type_url_pattern and the legacy path both do. Existence mode is
92
+ // exempt: it deliberately wants any entry fitting the pattern.
93
+ const literalUrl = extractedVariables.requestPath ?? compositionQuery.url;
94
+ const isVariableless = Object.keys(queryObject).length === 0;
95
+ const decomposedQuery = mode === "match" && isPatternSource && isVariableless && literalUrl
96
+ ? { url: literalUrl }
97
+ : queryObject;
88
98
  const finalQuery = mode === "match" &&
89
99
  isPatternSource &&
90
100
  hasEntryUrl &&
91
101
  extractedVariables.requestPath
92
- ? { $or: [queryObject, { url: extractedVariables.requestPath }] }
93
- : queryObject;
102
+ ? { $or: [decomposedQuery, { url: extractedVariables.requestPath }] }
103
+ : decomposedQuery;
94
104
  return stackSdk
95
105
  .ctQuery(connectedContentType, {
96
106
  references: [
@@ -1 +1 @@
1
- {"version":3,"file":"build-template-query.js","sources":["../../src/url-metadata/build-template-query.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAoBA;AACA,MAAM,SAAS,GAA2C;AACxD,IAAA,IAAI,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC;CACjB;AAED;AACA,MAAM,eAAe,GAAsB,EAAE,OAAO,EAAE,IAAI,EAAE;AAE5D;;;;;;;;;;AAUG;SACa,2BAA2B,CACzC,OAGC,EACD,OAA6B,OAAO,EAAA;IAEpC,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,OAAO;IACpE,MAAM,KAAK,GAAwB,EAAE;AAErC,IAAA,IACE,UAAU,KAAK,+BAA+B,CAAC,wBAAwB;AACvE,QAAA,UAAU,KAAK,+BAA+B,CAAC,UAAU,EACzD;AACA,QAAA,IAAI,IAAI,KAAK,WAAW,EAAE;AACxB,YAAA,KAAK,CAAC,GAAG,GAAG,EAAE,GAAG,SAAS,EAAE;QAC9B;AAAO,aAAA,IAAI,gBAAgB,CAAC,GAAG,EAAE;AAC/B,YAAA,KAAK,CAAC,GAAG,GAAG,gBAAgB,CAAC,GAAG;QAClC;AACA,QAAA,OAAO,KAAK;IACd;;AAGA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AkC,EAClC,kBAAgD,EAChD,gBAAuC,EACvC,oBAA4B,EAC5B,YAOC,EAAA;AAED,IAAA,MAAM,OAAO,GAAyB;QACpC,gBAAgB;QAChB,kBAAkB;QAClB,gBAAgB;QAChB,oBAAoB;AACpB,QAAA,UAAU,EAAE,UAA+C;KAC5D;IAED,OAAO,kBAAkB,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC;AAC5D;;;;"}
1
+ {"version":3,"file":"build-template-query.js","sources":["../../src/url-metadata/build-template-query.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAoBA;AACA,MAAM,SAAS,GAA2C;AACxD,IAAA,IAAI,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC;CACjB;AAED;AACA,MAAM,eAAe,GAAsB,EAAE,OAAO,EAAE,IAAI,EAAE;AAE5D;;;;;;;;;;AAUG;SACa,2BAA2B,CACzC,OAGC,EACD,OAA6B,OAAO,EAAA;IAEpC,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,OAAO;IACpE,MAAM,KAAK,GAAwB,EAAE;AAErC,IAAA,IACE,UAAU,KAAK,+BAA+B,CAAC,wBAAwB;AACvE,QAAA,UAAU,KAAK,+BAA+B,CAAC,UAAU,EACzD;AACA,QAAA,IAAI,IAAI,KAAK,WAAW,EAAE;AACxB,YAAA,KAAK,CAAC,GAAG,GAAG,EAAE,GAAG,SAAS,EAAE;QAC9B;AAAO,aAAA,IAAI,gBAAgB,CAAC,GAAG,EAAE;AAC/B,YAAA,KAAK,CAAC,GAAG,GAAG,gBAAgB,CAAC,GAAG;QAClC;AACA,QAAA,OAAO,KAAK;IACd;;AAGA,IAAA,KAAK,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAClD,kBAAkB,CAAC,MAAM,CAC1B,EAAE;AACD,QAAA,IAAI,qBAAqB,CAAC,UAAU,CAAC,EAAE;YACrC,KAAK,CAAC,SAAS,CAAC,GAAG;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U;KAClB;SACA,KAAK,CAAC,CAAC,CAAC;AACb;AAEA;;AAEG;AACG,SAAU,kBAAkB,CAChC,QAAkB,EAClB,UAAkB,EAClB,gBAAkC,EAClC,kBAAgD,EAChD,gBAAuC,EACvC,oBAA4B,EAC5B,YAOC,EAAA;AAED,IAAA,MAAM,OAAO,GAAyB;QACpC,gBAAgB;QAChB,kBAAkB;QAClB,gBAAgB;QAChB,oBAAoB;AACpB,QAAA,UAAU,EAAE,UAA+C;KAC5D;IAED,OAAO,kBAAkB,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC;AAC5D;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { has, get, isEqual, isPlainObject } from 'lodash-es';
2
2
  import { isNotEqual, doesArrayInclude, isLessThanOrEqual, isLessThan, isGreaterThanOrEqual, isGreaterThan } from './condition-block.utils.js';
3
- import { getBindingString } from '@contentstack/studio-registry';
3
+ import { getBindingString, getRepeaterContextPath } from '@contentstack/studio-registry';
4
4
 
5
5
  const EXISTENCE_OPERATOR_VALUES = new Set(["exists", "notExists"]);
6
6
  const EMPTINESS_OPERATOR_VALUES = new Set(["isEmpty", "isNotEmpty"]);
@@ -107,6 +107,15 @@ const evaluateCondition = (condition, data) => {
107
107
  return handleArrayCondition(condition, conditionValue);
108
108
  }
109
109
  case "modular_block":
110
+ // A Length check and a Block Name check save the same shape — `eq` is
111
+ // shared and the sub-type was not always recorded. Only a condition that
112
+ // SAYS it is a length check gets length semantics; inferring it from the
113
+ // value here would re-interpret every saved `Length == N` on the next SDK
114
+ // upgrade, changing published pages with no edit or publish event
115
+ // (ADR 0014). Absent `subType`, behave exactly as before.
116
+ if (condition.subType === "length") {
117
+ return handleArrayCondition(condition, conditionValue);
118
+ }
110
119
  switch (condition.operator) {
111
120
  case "is":
112
121
  case "eq":
@@ -150,6 +159,11 @@ const evaluateCondition = (condition, data) => {
150
159
  return handleNumberComparison(condition.operator, imageSize, condition.value);
151
160
  }
152
161
  case "reference": {
162
+ // Same ambiguity as `modular_block`: `eq` is shared between a Content Type
163
+ // check and a Length check. See the note above.
164
+ if (condition.subType === "length") {
165
+ return handleArrayCondition(condition, conditionValue);
166
+ }
153
167
  switch (condition.operator) {
154
168
  case "contentTypeIs":
155
169
  case "eq":
@@ -162,9 +176,72 @@ const evaluateCondition = (condition, data) => {
162
176
  return false;
163
177
  }
164
178
  };
179
+ /**
180
+ * Immutably set `value` at a dotted `path`, cloning only the objects along the
181
+ * path and sharing every untouched subtree by reference. A missing intermediate
182
+ * becomes `{}`.
183
+ *
184
+ * Object keys only — a spread would turn an array into an object. The one
185
+ * caller passes `getRepeaterContextPath` output, which has no indices.
186
+ */
187
+ const setInShallow = (root, path, value) => {
188
+ const keys = path.split(".");
189
+ const leaf = keys.pop();
190
+ const out = { ...root };
191
+ let cursor = out;
192
+ for (const key of keys)
193
+ cursor = cursor[key] = { ...cursor[key] };
194
+ cursor[leaf] = value;
195
+ return out;
196
+ };
197
+ /**
198
+ * Answers both questions a ConditionBlock has to ask: does this condition pass,
199
+ * and what data should its children see.
200
+ *
201
+ * When the condition binds through a repeater, the bound value is projected
202
+ * onto the repeater's context path so descendants resolve against the matched
203
+ * branch. Everything off that path is shared by reference — the projection must
204
+ * not deep-copy the spec, which is large.
205
+ *
206
+ * Lives here, with `evaluateCondition`, because all three renderers (runtime,
207
+ * editor and RSC) need the identical answer and previously derived it
208
+ * separately. `shouldRender` is evaluated against the UNPROJECTED data, which
209
+ * is what all three did.
210
+ */
211
+ const resolveConditionScope = (condition, data) => {
212
+ const shouldRender = evaluateCondition(condition, data);
213
+ // A false condition renders nothing, so no descendant ever reads the scoped
214
+ // data — projecting it would rebuild the repeater spine for a subtree the
215
+ // caller is about to throw away.
216
+ if (!shouldRender)
217
+ return { shouldRender, scopedData: data };
218
+ const binding = condition?.dataBinding;
219
+ const dataPath = binding && getBindingString(binding);
220
+ const repeaterPath = binding &&
221
+ getRepeaterContextPath(binding.value);
222
+ if (!dataPath || !repeaterPath || dataPath === repeaterPath) {
223
+ // No sub-path to project: writing the value back where it already sits
224
+ // would only cost a clone and a fresh identity.
225
+ return { shouldRender, scopedData: data };
226
+ }
227
+ const bound = get(data, dataPath);
228
+ if (!bound)
229
+ return { shouldRender, scopedData: data };
230
+ return { shouldRender, scopedData: setInShallow(data, repeaterPath, bound) };
231
+ };
165
232
  function handleArrayCondition(condition, conditionValue) {
166
233
  const arrayValue = Array.isArray(conditionValue) ? conditionValue : [];
167
- return handleNumberComparison(condition.operator, arrayValue.length, condition.value);
234
+ // `convertValueByDataType` coerces only for `boolean` and `number` FIELD data
235
+ // types, so a length check on a `blocks` or `reference` field persisted "3"
236
+ // rather than 3 — and `isEqual(3, "3")` is false, which broke `eq` even when
237
+ // it reached here. The ordering operators only worked by JS coercion.
238
+ const target = Number(condition.value);
239
+ // A length can only be compared against a number. Anything else (a hand
240
+ // authored `subType: "length"` with a block uid, say) would otherwise compare
241
+ // against NaN and silently return false for every operator, including `neq`.
242
+ if (Number.isNaN(target))
243
+ return false;
244
+ return handleNumberComparison(condition.operator, arrayValue.length, target);
168
245
  }
169
246
  function handleNumberComparison(operator, value1, value2) {
170
247
  switch (operator) {
@@ -185,5 +262,5 @@ function handleNumberComparison(operator, value1, value2) {
185
262
  }
186
263
  }
187
264
 
188
- export { evaluateCondition };
265
+ export { evaluateCondition, resolveConditionScope };
189
266
  //# sourceMappingURL=conditionBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditionBlock.js","sources":["../../src/utils/conditionBlock.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAiBA,MAAM,yBAAyB,GAC7B,IAAI,GAAG,CAAoB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAErD,MAAM,yBAAyB,GAC7B,IAAI,GAAG,CAAoB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AAEvD;;;;;AAKG;AACH,MAAM,wBAAwB,GAAwB,IAAI,GAAG,CAAS;AACpE,IAAA,GAAG,yBAAyB;AAC5B,IAAA,GAAG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IAAI,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE;AAC9E;AAEA,SAAS,oBAAoB,CAAC,SAAoB,EAAE,cAAmB,EAAA;AACrE,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,cAAc,GAAG,EAAE;;;;;IAKtE,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;;;;AAItC,IAAA,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;AAAE,QAAA,OAAO,KAAK;AACtC,IAAA,OAAO,sBAAsB,CAAC,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC;AAC9E;AAEA,SAAS,sBAAsB,CAC7B,QAAgB,EAChB,MAAc,EACd,MAAc,EAAA;IAEd,QAAQ,QAAQ;AACd,QAAA,KAAK,IAAI;AACP,YAAA,OAAO,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC;AAChC,QAAA,KAAK,KAAK;AACR,YAAA,OAAO,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC;AACnC,QAAA,KAAK,IAAI;AACP,YAAA,OAAO,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC;AACtC,QAAA,KAAK,KAAK;AACR,YAAA,OAAO,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC;AAC7C,QAAA,KAAK,IAAI;AACP,YAAA,OAAO,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC;AACnC,QAAA,KAAK,KAAK;AACR,YAAA,OAAO,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1C,QAAA;AACE,YAAA,OAAO,KAAK;;AAElB;;;;"}
@@ -22,7 +22,7 @@ const isBrowser = () => {
22
22
  */
23
23
  const INCLUDE_DEPTH_COUNT = 3;
24
24
  // SDK Version constants for Studio Intelligence
25
- const SDK_VERSION = "3.1.0";
25
+ const SDK_VERSION = "3.2.0-alpha-9e6cc9b.0";
26
26
  const SCHEMA_VERSION = "1.0.0";
27
27
  const COMPOSABLE_DATA_ATTRIBUTES = {
28
28
  BUILDER: "data-composable-studio-builder",