@picked/client 0.0.1-dev.1785287094311 → 0.0.1-dev.1785826066660

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 (209) hide show
  1. package/dist/.tsbuildinfo +1 -0
  2. package/dist/api-Djuh2gfe.cjs +1 -0
  3. package/dist/api-d0qKmzPH.js +38 -0
  4. package/dist/cjs/form/index.js +1 -1
  5. package/dist/cjs/index.js +2 -2
  6. package/dist/cjs/plugins/dom-observer/index.js +1 -1
  7. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  8. package/dist/cjs/preview/index.js +1 -0
  9. package/dist/cjs/server/index.js +1 -1
  10. package/dist/docs/actions.mdx +38 -18
  11. package/dist/docs/api/authentication.md +75 -48
  12. package/dist/docs/api/authorization-and-scopes.md +63 -47
  13. package/dist/docs/api/error-handling.md +70 -54
  14. package/dist/docs/api/index.md +41 -22
  15. package/dist/docs/api/pagination.md +30 -20
  16. package/dist/docs/api-keys.mdx +11 -6
  17. package/dist/docs/chrome-extension.md +22 -5
  18. package/dist/docs/conditions.mdx +32 -19
  19. package/dist/docs/content/asset-library.mdx +65 -34
  20. package/dist/docs/content/content-entries.mdx +8 -2
  21. package/dist/docs/content/layouts.mdx +45 -29
  22. package/dist/docs/content/pages.mdx +29 -14
  23. package/dist/docs/content/sections.mdx +19 -8
  24. package/dist/docs/delivery-api/experience-content.md +10 -5
  25. package/dist/docs/delivery-api/index.md +19 -12
  26. package/dist/docs/delivery-api/preview-caching-crawling.md +27 -14
  27. package/dist/docs/delivery-api/project-config.md +6 -4
  28. package/dist/docs/experiences.mdx +26 -10
  29. package/dist/docs/features.mdx +93 -22
  30. package/dist/docs/fields.mdx +42 -27
  31. package/dist/docs/flow-builder/building-flows.md +38 -20
  32. package/dist/docs/flow-builder/condition-builder.md +32 -21
  33. package/dist/docs/flow-builder/keyboard-shortcuts.md +18 -18
  34. package/dist/docs/flow-builder/nodes.md +26 -13
  35. package/dist/docs/flow-builder/overview.mdx +28 -15
  36. package/dist/docs/gtm-template.md +35 -26
  37. package/dist/docs/guides/build-a-personalized-page.mdx +36 -18
  38. package/dist/docs/image-optimisation-service.md +33 -17
  39. package/dist/docs/index.md +28 -17
  40. package/dist/docs/mcp.md +47 -39
  41. package/dist/docs/pickedql/data-sources.md +65 -43
  42. package/dist/docs/pickedql/dimensions.md +27 -12
  43. package/dist/docs/pickedql/examples.md +38 -26
  44. package/dist/docs/pickedql/filtering.md +10 -6
  45. package/dist/docs/pickedql/index.md +32 -14
  46. package/dist/docs/pickedql/schema.md +85 -76
  47. package/dist/docs/pickedql/virtual-functions.md +62 -36
  48. package/dist/docs/projects.mdx +14 -7
  49. package/dist/docs/reports.mdx +5 -3
  50. package/dist/docs/sdk/actions.md +33 -17
  51. package/dist/docs/sdk/conditions.md +8 -5
  52. package/dist/docs/sdk/content-security-policy.md +5 -4
  53. package/dist/docs/sdk/experiences.md +29 -11
  54. package/dist/docs/sdk/feature-allocation.md +161 -0
  55. package/dist/docs/sdk/features.md +181 -73
  56. package/dist/docs/sdk/fields.md +66 -42
  57. package/dist/docs/sdk/index.md +25 -10
  58. package/dist/docs/sdk/plugins/create-experience.md +18 -15
  59. package/dist/docs/sdk/plugins/dynamic-experiences.md +43 -17
  60. package/dist/docs/sdk/predicates.md +53 -37
  61. package/dist/docs/sdk/ssr/index.md +25 -8
  62. package/dist/docs/sdk/ssr/rendering-and-hydration.md +37 -16
  63. package/dist/docs/sdk/ssr/serialize.md +38 -20
  64. package/dist/docs/sdk/ssr/slots-and-placements.md +28 -10
  65. package/dist/docs/sdk/steps.md +100 -55
  66. package/dist/docs/steps.mdx +20 -11
  67. package/dist/docs/team-management.md +17 -11
  68. package/dist/docs/vite-plugin.md +26 -19
  69. package/dist/docs/workspace-versioning.mdx +14 -8
  70. package/dist/docs/workspaces.mdx +55 -24
  71. package/dist/{dom-BwmTHeT7.js → dom-BqcToNL0.js} +1 -3
  72. package/dist/{dom-CDrHc_j9.cjs → dom-DlLH3FxV.cjs} +1 -1
  73. package/dist/esm/form/index.js +2 -4
  74. package/dist/esm/index.js +434 -334
  75. package/dist/esm/plugins/dom-observer/index.js +1 -1
  76. package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
  77. package/dist/esm/preview/index.js +2 -0
  78. package/dist/esm/server/index.js +13 -11
  79. package/dist/{experience-instance-DOJShRk5.js → experience-instance-DGk11d8a.js} +3 -3
  80. package/dist/experience-instance-Dej3P1sE.cjs +1 -0
  81. package/dist/inert-script-report-B_bMPRzp.js +18 -0
  82. package/dist/inert-script-report-ijRHPtcY.cjs +1 -0
  83. package/dist/{plugin-C46DEiGE.js → plugin-BVAFWjpT.js} +61 -56
  84. package/dist/plugin-BcCn2llk.cjs +1 -0
  85. package/dist/preview-channel-CSr96XAo.js +98 -0
  86. package/dist/preview-channel-Cx0e6fye.cjs +1 -0
  87. package/dist/protocol-Bb_vpLKE.cjs +1 -0
  88. package/dist/protocol-C5KkkiZc.js +84 -0
  89. package/dist/types/client.d.ts +7 -6
  90. package/dist/types/entities/action/action.d.ts +5 -4
  91. package/dist/types/entities/action/action.d.ts.map +1 -1
  92. package/dist/types/entities/component/component.d.ts +6 -5
  93. package/dist/types/entities/component/component.d.ts.map +1 -1
  94. package/dist/types/entities/condition/condition.d.ts +5 -5
  95. package/dist/types/entities/content/content.d.ts +14 -3
  96. package/dist/types/entities/content/content.d.ts.map +1 -1
  97. package/dist/types/entities/content/reference.d.ts +101 -0
  98. package/dist/types/entities/content/reference.d.ts.map +1 -0
  99. package/dist/types/entities/experience/experience.d.ts +11 -10
  100. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  101. package/dist/types/entities/experience-instance/experience-instance.d.ts +10 -9
  102. package/dist/types/entities/feature/feature.d.ts +3 -2
  103. package/dist/types/entities/feature/feature.d.ts.map +1 -1
  104. package/dist/types/entities/field/field.d.ts +7 -6
  105. package/dist/types/entities/framework/framework.d.ts +7 -6
  106. package/dist/types/entities/framework/framework.d.ts.map +1 -1
  107. package/dist/types/entities/history/history.d.ts +6 -6
  108. package/dist/types/entities/plugin/plugin.d.ts +3 -2
  109. package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
  110. package/dist/types/entities/predicate/predicate.d.ts +4 -3
  111. package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
  112. package/dist/types/entities/response/response-validation.d.ts +3 -2
  113. package/dist/types/entities/response/response.d.ts +12 -11
  114. package/dist/types/entities/session/session.d.ts +2 -1
  115. package/dist/types/entities/step/step.d.ts +6 -5
  116. package/dist/types/exports.d.ts +6 -1
  117. package/dist/types/exports.d.ts.map +1 -1
  118. package/dist/types/form/build-responses.d.ts +2 -1
  119. package/dist/types/form/create-field-evaluator.d.ts +4 -3
  120. package/dist/types/form/create-field-validation.d.ts +5 -4
  121. package/dist/types/form/create-form.d.ts +7 -6
  122. package/dist/types/form/create-submit-pipeline.d.ts +7 -6
  123. package/dist/types/form/get-step-fields.d.ts +3 -2
  124. package/dist/types/index.d.ts +1 -0
  125. package/dist/types/index.d.ts.map +1 -1
  126. package/dist/types/lifecycle/condition-selection.d.ts +14 -4
  127. package/dist/types/lifecycle/lifecycle.d.ts +4 -3
  128. package/dist/types/lifecycle/rules-logic.d.ts +4 -3
  129. package/dist/types/lifecycle/state-snapshot.d.ts +4 -3
  130. package/dist/types/picked.d.ts +102 -68
  131. package/dist/types/picked.d.ts.map +1 -1
  132. package/dist/types/ping.d.ts +1 -1
  133. package/dist/types/ping.d.ts.map +1 -1
  134. package/dist/types/plugins/create-experience/create-experience.d.ts +9 -8
  135. package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
  136. package/dist/types/plugins/create-experience/plugin.d.ts +3 -2
  137. package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
  138. package/dist/types/plugins/create-experience/serialization.d.ts.map +1 -1
  139. package/dist/types/plugins/dom-observer/plugin.d.ts +1 -1
  140. package/dist/types/plugins/dynamic-experiences/hash.d.ts +40 -5
  141. package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +1 -1
  142. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +3 -3
  143. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
  144. package/dist/types/plugins/dynamic-experiences/types.d.ts +24 -5
  145. package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
  146. package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -1
  147. package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
  148. package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -1
  149. package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
  150. package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -1
  151. package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
  152. package/dist/types/plugins/responses-indexeddb/plugin.d.ts +1 -1
  153. package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
  154. package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
  155. package/dist/types/plugins/web-components/plugin.d.ts +2 -1
  156. package/dist/types/plugins/window-object/plugin.d.ts +2 -2
  157. package/dist/types/preview/index.d.ts +18 -0
  158. package/dist/types/preview/index.d.ts.map +1 -0
  159. package/dist/types/preview-channel.d.ts +16 -0
  160. package/dist/types/preview-channel.d.ts.map +1 -0
  161. package/dist/types/preview-receiver/apply-ops.d.ts +32 -0
  162. package/dist/types/preview-receiver/apply-ops.d.ts.map +1 -0
  163. package/dist/types/preview-receiver/index.d.ts +32 -0
  164. package/dist/types/preview-receiver/index.d.ts.map +1 -0
  165. package/dist/types/preview-receiver/protocol.d.ts +69 -0
  166. package/dist/types/preview-receiver/protocol.d.ts.map +1 -0
  167. package/dist/types/server/index.d.ts +3 -3
  168. package/dist/types/server/serialize.d.ts +8 -3
  169. package/dist/types/server/serialize.d.ts.map +1 -1
  170. package/dist/types/utils/content-path.d.ts +37 -0
  171. package/dist/types/utils/content-path.d.ts.map +1 -0
  172. package/dist/types/utils/dom.d.ts +2 -1
  173. package/dist/types/utils/events.d.ts +6 -6
  174. package/dist/types/utils/events.d.ts.map +1 -1
  175. package/dist/types/utils/global-obj.d.ts +1 -1
  176. package/dist/types/utils/global-obj.d.ts.map +1 -1
  177. package/dist/types/utils/id.d.ts.map +1 -1
  178. package/dist/types/utils/inert-script-report.d.ts +40 -0
  179. package/dist/types/utils/inert-script-report.d.ts.map +1 -0
  180. package/dist/types/utils/logger.d.ts +2 -1
  181. package/dist/types/utils/logger.d.ts.map +1 -1
  182. package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +2 -1
  183. package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +2 -1
  184. package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
  185. package/dist/types/utils/node-tree/get-next-node.d.ts.map +1 -1
  186. package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
  187. package/dist/types/utils/node-tree/get-origin-node.d.ts.map +1 -1
  188. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +1 -1
  189. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
  190. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +1 -1
  191. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
  192. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +1 -1
  193. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
  194. package/dist/types/utils/nodes.d.ts +1 -1
  195. package/dist/types/utils/picked-config.d.ts +2 -1
  196. package/dist/types/utils/preview-session.d.ts +12 -0
  197. package/dist/types/utils/preview-session.d.ts.map +1 -0
  198. package/dist/types/utils/rehydrate-scripts.d.ts +6 -0
  199. package/dist/types/utils/rehydrate-scripts.d.ts.map +1 -1
  200. package/dist/types/utils/rules-logic.d.ts +6 -2
  201. package/dist/types/utils/storage.d.ts +1 -1
  202. package/dist/types/utils/storage.d.ts.map +1 -1
  203. package/package.json +35 -24
  204. package/dist/api-BzcdC_7V.cjs +0 -1
  205. package/dist/api-o8w9kJwm.js +0 -40
  206. package/dist/experience-instance-DurC3pE-.cjs +0 -1
  207. package/dist/plugin-nrEJGTuE.cjs +0 -1
  208. package/dist/preview-bridge-CpX1BkSA.cjs +0 -1
  209. package/dist/preview-bridge-D76l-dPy.js +0 -33
@@ -1,18 +1,53 @@
1
+ /** @file Deterministic, independent per-feature bucket allocation for A/B testing. */
1
2
  /**
2
3
  * FNV-1a 32-bit hash.
3
4
  * Deterministic, fast, well-distributed for short strings.
5
+ *
6
+ * @param {string} input - String to hash.
7
+ * @returns {number} Unsigned 32-bit hash.
8
+ * @example
9
+ * ```typescript
10
+ * fnv1a32('sess_1:winter-sale')
11
+ * ```
4
12
  */
5
13
  export declare function fnv1a32(input: string): number;
6
14
  /**
7
15
  * Deterministic dice roll for A/B testing.
8
- * Returns a value 0–99 derived from the sessionId so the same
9
- * dice roll applies to every feature for a given session.
16
+ *
17
+ * Returns a value 0–99 that is stable for a given session and feature. Seeding
18
+ * on the feature as well as the session keeps flags independent of one another:
19
+ * two flags at weight 50 each take half of sessions, and a quarter of sessions
20
+ * land in both. Independence rests on the avalanche in {@link fmix32}, not on
21
+ * the seed alone.
22
+ *
23
+ * The feature version keys the stored bucket rather than the roll, so
24
+ * publishing a new version re-runs `decide` against the current weight and an
25
+ * unchanged weight keeps the same audience.
26
+ *
27
+ * @param {string} sessionId - Current session id, stable across page loads.
28
+ * @param {string} featureId - Feature the roll is for.
29
+ * @returns {number} A value in the range 0–99.
30
+ * @example
31
+ * ```typescript
32
+ * const diceRoll = featureDiceRoll('sess_1', 'winter-sale')
33
+ * ```
10
34
  */
11
- export declare function sessionDiceRoll(sessionId: string): number;
35
+ export declare function featureDiceRoll(sessionId: string, featureId: string): number;
12
36
  /**
13
37
  * Whether the given dice roll falls within the feature's weight.
14
- * A feature with weight 50 is a strict superset of one with weight 30.
15
- * If you're in the 30% group, you're always in the 50% group too.
38
+ *
39
+ * Widening a weight admits sessions the narrower weight excluded and never
40
+ * evicts one already inside, so a rollout can ratchet up without re-bucketing
41
+ * anyone. The roll is per feature, so this describes one feature's own weight
42
+ * changing over time; two features at the same weight overlap by chance.
43
+ *
44
+ * @param {number} diceRoll - Roll from {@link featureDiceRoll}, 0–99.
45
+ * @param {number} weight - Feature weight, 0–100.
46
+ * @returns {boolean} Whether the session is allocated to the feature.
47
+ * @example
48
+ * ```typescript
49
+ * isAllocated(42, 50) // true
50
+ * ```
16
51
  */
17
52
  export declare function isAllocated(diceRoll: number, weight: number): boolean;
18
53
  //# sourceMappingURL=hash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/hash.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAU7C;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAUrE"}
1
+ {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/hash.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAY7C;AA8BD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAUrE"}
@@ -1,6 +1,6 @@
1
- import { Plugin } from '../../entities/plugin/plugin';
2
- import { Picked } from '../../picked';
3
- import { DynamicExperiencesPluginOptions, ExperienceContentResponse, FetchProjectOptions, ProjectConfig } from './types';
1
+ import type { Plugin } from '../../entities/plugin/plugin';
2
+ import type { Picked } from '../../picked';
3
+ import type { DynamicExperiencesPluginOptions, ExperienceContentResponse, FetchProjectOptions, ProjectConfig } from './types';
4
4
  /**
5
5
  * Synchronously registers a complete project config with the client: features, conditions,
6
6
  * fields, steps, and experiences, in dependency order.
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAoB,MAAM,cAAc,CAAA;AAI5D,OAAO,KAAK,EAEV,+BAA+B,EAC/B,yBAAyB,EACzB,mBAAmB,EACnB,aAAa,EAId,MAAM,SAAS,CAAA;AA4JhB;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACjD,IAAI,CAMN;AA8JD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAmC/B;AAoBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAsC3C;AA4QD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,+BAA+B,GAAG,MAAM,CAmC1F"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAoB,MAAM,cAAc,CAAA;AAI5D,OAAO,KAAK,EAEV,+BAA+B,EAC/B,yBAAyB,EACzB,mBAAmB,EACnB,aAAa,EAId,MAAM,SAAS,CAAA;AA4JhB;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACjD,IAAI,CAMN;AAyJD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAmC/B;AAoBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAsC3C;AAgRD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,+BAA+B,GAAG,MAAM,CAsC1F"}
@@ -1,8 +1,11 @@
1
- import { ExperienceStep } from '../../entities/step/step';
2
- import { Field } from '../../entities/field/field';
3
- import { ExperienceEdge, ExperienceNode, ExperienceTarget } from '../../entities/experience/experience';
4
- import { Condition } from '../../entities/condition/condition';
5
- import { LogicRule, LogicValue } from '../../logic-engine';
1
+ /**
2
+ * @file Types for the dynamic-experiences plugin: project config shapes returned by the Picked API.
3
+ */
4
+ import type { ExperienceStep } from '../../entities/step/step';
5
+ import type { Field } from '../../entities/field/field';
6
+ import type { ExperienceEdge, ExperienceNode, ExperienceTarget } from '../../entities/experience/experience';
7
+ import type { Condition } from '../../entities/condition/condition';
8
+ import type { LogicRule, LogicValue } from '../../logic-engine';
6
9
  /**
7
10
  * Wire-format step as returned by the Picked API. Matches {@link ExperienceStep}
8
11
  * except that fields are still referenced by ID — the plugin resolves them to
@@ -68,6 +71,12 @@ export interface ProjectConfig {
68
71
  name: string;
69
72
  key: string;
70
73
  }>;
74
+ /**
75
+ * Origins permitted to push live-preview content patches into this page, issued by the API on the
76
+ * preview surface only. The preview receiver validates every inbound message against this list;
77
+ * absent or empty means no embedder is trusted and the channel stays closed.
78
+ */
79
+ previewEmbedderOrigins?: string[];
71
80
  }
72
81
  export interface DynamicExperiencesPluginOptions {
73
82
  apiUrl?: string;
@@ -113,7 +122,17 @@ export interface ContentBlob {
113
122
  export interface ExperienceContentResponse {
114
123
  experienceId: string;
115
124
  versionId: string | null;
125
+ /** The Content records the experience's steps point at, via `Step.layoutContentId`. */
116
126
  content: ContentBlob[];
127
+ /**
128
+ * Content records reached from `content` through a `reference` field, deduped
129
+ * and excluding the step blobs. Registered into the content registry the same
130
+ * way, so a `{ contentEntryId }` pointer resolves through `contents.getById`.
131
+ *
132
+ * Optional: a response produced before this field existed — notably a build-time
133
+ * cache written by an older `@picked/vite-plugin-picked` — omits it entirely.
134
+ */
135
+ references?: ContentBlob[];
117
136
  }
118
137
  /**
119
138
  * Function that resolves an experience's content blobs. Set on the Picked client by
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4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iBAAiB,EAAE,aAAa,CAAA;IAChC,gBAAgB,EAAE;QAChB,IAAI,EAAE,KAAK,GAAG,OAAO,CAAA;QACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;QACxB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;QAC/B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;KAC3B,CAAA;CACF"}
@@ -1,4 +1,4 @@
1
- import { Plugin } from '../../entities/plugin/plugin';
1
+ import type { Plugin } from '../../entities/plugin/plugin';
2
2
  interface ExperienceBrowserStoragePlugin {
3
3
  storage?: 'local' | 'session';
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/experience-browser-storage/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,UAAU,8BAA8B;IACtC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,eAAO,MAAM,8BAA8B,GAAI,eAE5C,8BAAmC,KAAG,MAmDxC,CAAA"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/experience-browser-storage/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,UAAU,8BAA8B;IACtC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,eAAO,MAAM,8BAA8B,kBAExC,8BAA8B,KAAQ,MAmDxC,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Plugin } from '../../entities/plugin/plugin';
1
+ import type { Plugin } from '../../entities/plugin/plugin';
2
2
  /** @public */
3
3
  export interface HistoryBrowserStoragePlugin {
4
4
  storage?: 'local' | 'session';
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/history-browser-storage/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,cAAc;AACd,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,eAAO,MAAM,2BAA2B,GAAI,eAEzC,2BAAgC,KAAG,MA8BrC,CAAA"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/history-browser-storage/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,cAAc;AACd,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,eAAO,MAAM,2BAA2B,kBAErC,2BAA2B,KAAQ,MA8BrC,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Plugin } from '../../entities/plugin/plugin';
1
+ import type { Plugin } from '../../entities/plugin/plugin';
2
2
  interface ResponsesBrowserStoragePlugin {
3
3
  storage?: 'local' | 'session';
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-browser-storage/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,UAAU,6BAA6B;IACrC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAiCD,eAAO,MAAM,6BAA6B,GAAI,eAE3C,6BAAkC,KAAG,MAuCvC,CAAA"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-browser-storage/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,UAAU,6BAA6B;IACrC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAiCD,eAAO,MAAM,6BAA6B,kBAEvC,6BAA6B,KAAQ,MAuCvC,CAAA"}
@@ -1,3 +1,3 @@
1
- import { Plugin } from '../../entities/plugin/plugin';
1
+ import type { Plugin } from '../../entities/plugin/plugin';
2
2
  export declare const responsesIndexedDBPlugin: () => Plugin;
3
3
  //# sourceMappingURL=plugin.d.ts.map
@@ -1,4 +1,4 @@
1
- import { Plugin } from '../../entities/plugin/plugin';
1
+ import type { Plugin } from '../../entities/plugin/plugin';
2
2
  interface SinglePageAppPluginOptions {
3
3
  /**
4
4
  * Enables monitoring of browser history events (pushState, replaceState, popstate)
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/single-page-app/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,UAAU,0BAA0B;IAClC;;;;OAIG;IACH,iBAAiB,EAAE,IAAI,CAAA;CACxB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,GAAI,UAAU,0BAA0B,KAAG,MAa1E,CAAA;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAwC5D"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/single-page-app/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,UAAU,0BAA0B;IAClC;;;;OAIG;IACH,iBAAiB,EAAE,IAAI,CAAA;CACxB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,aAAc,0BAA0B,KAAG,MAa1E,CAAA;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAwC5D"}
@@ -1,3 +1,4 @@
1
- import { Plugin } from '../../entities/plugin/plugin';
1
+ /** @file Web Components plugin — registers a `<picked-root>` custom element that launches a Picked experience by id when connected to the DOM. */
2
+ import type { Plugin } from '../../entities/plugin/plugin';
2
3
  export declare const webComponentsPlugin: () => Plugin;
3
4
  //# sourceMappingURL=plugin.d.ts.map
@@ -1,5 +1,5 @@
1
- import { Plugin } from '../../entities/plugin/plugin';
2
- import { Picked } from '../../picked';
1
+ import type { Plugin } from '../../entities/plugin/plugin';
2
+ import type { Picked } from '../../picked';
3
3
  declare global {
4
4
  interface Window {
5
5
  Picked: Picked;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @file Public entry for live-preview helpers.
3
+ *
4
+ * Separate from the root entry so the path parser and the ops applier never reach the bundle every
5
+ * customer page loads. Imported by the Picked dashboard, and by the SDK's own preview receiver.
6
+ *
7
+ * The wire protocol is exported from here so the embedder builds against the same declaration the
8
+ * receiver does — see `preview-receiver/protocol` for why that stays compatible with older SDKs.
9
+ * The receiver's own inbound guard is not exported: the embedder sends patches rather than
10
+ * receiving them, and leaving it out keeps this entry inside its `size-limit` budget.
11
+ */
12
+ export { formatContentPath, parseContentPath } from '../utils/content-path';
13
+ export type { ContentPathSegment } from '../utils/content-path';
14
+ export { applyContentOps } from '../preview-receiver/apply-ops';
15
+ export type { ContentPatchOp } from '../preview-receiver/apply-ops';
16
+ export { PREVIEW_CONTENT_PATCH_MESSAGE, PREVIEW_INERT_SCRIPTS_MESSAGE, PREVIEW_PROTOCOL_VERSION, PREVIEW_READY_MESSAGE, PREVIEW_RESYNC_MESSAGE, } from '../preview-receiver/protocol';
17
+ export type { PreviewInertScriptsMessage, PreviewReadyMessage, PreviewResyncMessage, } from '../preview-receiver/protocol';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/preview/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC3E,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,YAAY,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,8BAA8B,CAAA;AACrC,YAAY,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,8BAA8B,CAAA"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @file Single entry point for the live-preview channel, so the bridge and the receiver share one
3
+ * dynamic-import boundary and neither reaches production bundles.
4
+ */
5
+ import type { Picked } from './picked';
6
+ /**
7
+ * Starts both halves of the preview channel: the outbound bridge that reports this frame's URL to
8
+ * the dashboard, and the inbound receiver that applies the dashboard's content patches.
9
+ *
10
+ * @param {Picked} client - The Picked client whose content index receives the patches.
11
+ * @returns {() => void} Teardown that stops both halves.
12
+ * @example
13
+ * const stop = initPreviewChannel(client)
14
+ */
15
+ export declare function initPreviewChannel(client: Picked): () => void;
16
+ //# sourceMappingURL=preview-channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-channel.d.ts","sourceRoot":"","sources":["../../src/preview-channel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAItC;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,CAQ7D"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * A single path-addressed replacement inside a content record's `data`.
3
+ *
4
+ * `path` uses the format the Picked API already emits for content-data validation errors —
5
+ * `$.sections[0].data.title`. See `utils/content-path`.
6
+ */
7
+ export interface ContentPatchOp {
8
+ /** Path to the value being replaced, for example `$.sections[0].data.title`. */
9
+ path: string;
10
+ /** The replacement value. */
11
+ value: unknown;
12
+ }
13
+ /**
14
+ * Applies path-addressed replacements to a content `data` blob, returning a new blob that shares
15
+ * every untouched branch with the original.
16
+ *
17
+ * That structural sharing is the point of per-field patching: replacing the whole blob would mint a
18
+ * fresh object identity for every field on every keystroke, re-rendering every memoised consumer in
19
+ * the host app's tree. Here only the touched spine changes identity.
20
+ *
21
+ * Ops that cannot be applied — a malformed path, the root, a prototype-polluting key, an index into
22
+ * a non-array, an out-of-range index — are skipped. A patch arrives from another frame, so a bad op
23
+ * must degrade to a no-op rather than throw inside a customer's page.
24
+ *
25
+ * @param {Record<string, unknown>} data - The content `data` blob to patch.
26
+ * @param {readonly ContentPatchOp[]} ops - The replacements to apply, in order.
27
+ * @returns {Record<string, unknown>} The patched blob, or `data` unchanged when no op applied.
28
+ * @example
29
+ * applyContentOps({ headline: 'old' }, [{ path: '$.headline', value: 'new' }])
30
+ */
31
+ export declare function applyContentOps(data: Record<string, unknown>, ops: readonly ContentPatchOp[]): Record<string, unknown>;
32
+ //# sourceMappingURL=apply-ops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-ops.d.ts","sourceRoot":"","sources":["../../../src/preview-receiver/apply-ops.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,KAAK,EAAE,OAAO,CAAA;CACf;AA4DD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,GAAG,EAAE,SAAS,cAAc,EAAE,GAC7B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAUzB"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @file Live-preview receiver: applies content patches pushed by the Picked dashboard.
3
+ *
4
+ * Reached only through a dynamic `import()` the client performs when a preview session is detected,
5
+ * so it stays out of production bundles. It touches only `client.contents`, which is
6
+ * framework-agnostic, so React, Svelte and script-tag installs all get live preview without any
7
+ * per-binding code.
8
+ *
9
+ * Trust model: the customer's page does not opt in, so the origin check is the only defence and it
10
+ * cannot come from the page itself. The API issues `previewEmbedderOrigins` alongside the preview
11
+ * project config; every inbound message is validated against that list, and the handshake is posted
12
+ * only to those origins. Never `document.referrer` (it becomes this frame's own origin after an
13
+ * in-frame navigation) and never a wildcard target.
14
+ *
15
+ * The base blob is the SDK's own preview-token fetch, so the receiver announces readiness only once
16
+ * content is registered and patches always land on a server-projected base.
17
+ */
18
+ import type { Picked } from '../picked';
19
+ /**
20
+ * Starts the live-preview receiver: announces readiness to the allowlisted embedder origins once
21
+ * content is registered, then applies inbound content patches to the client's content index.
22
+ *
23
+ * Wired at most once per frame, so several Picked clients on one page cannot double-apply a patch.
24
+ *
25
+ * @param {Picked} client - The Picked client whose content index receives the patches.
26
+ * @returns {() => void} Teardown that detaches every listener and re-arms the receiver.
27
+ * @example
28
+ * const stop = initPreviewReceiver(client)
29
+ * // later, e.g. in a test: stop()
30
+ */
31
+ export declare function initPreviewReceiver(client: Picked): () => void;
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/preview-receiver/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AA4CvC;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,CAyG9D"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @file Wire protocol for the Picked live-preview channel.
3
+ *
4
+ * **Additive-only.** A message type is never removed, a field's meaning never changes, and an
5
+ * optional field is never promoted to required — new capability arrives as a new optional field or
6
+ * a new message type, and both ends ignore anything they do not recognise. That is what lets an old
7
+ * SDK in the wild degrade in capability rather than fail, and why there is no version floor to keep
8
+ * current. `protocolVersion` on the handshake is diagnostics, not a gate.
9
+ */
10
+ import type { ContentPatchOp } from './apply-ops';
11
+ /** Current protocol version. Reported on the handshake for support and telemetry only. */
12
+ export declare const PREVIEW_PROTOCOL_VERSION = 1;
13
+ /** Receiver → embedder: the frame is listening and content is registered. */
14
+ export declare const PREVIEW_READY_MESSAGE = "picked-preview:ready";
15
+ /** Embedder → receiver: path-addressed replacements for one content record. */
16
+ export declare const PREVIEW_CONTENT_PATCH_MESSAGE = "picked-preview:content-patch";
17
+ /** Receiver → embedder: a sequence gap was detected; resend the dirty paths. */
18
+ export declare const PREVIEW_RESYNC_MESSAGE = "picked-preview:resync";
19
+ /** Receiver → embedder: cumulative count of inserted subtrees whose scripts were neutralised. */
20
+ export declare const PREVIEW_INERT_SCRIPTS_MESSAGE = "picked-preview:inert-scripts";
21
+ /** Handshake posted by the receiver to each allowlisted origin. */
22
+ export interface PreviewReadyMessage {
23
+ /** Discriminator. */
24
+ type: typeof PREVIEW_READY_MESSAGE;
25
+ /** Protocol version this receiver speaks. Diagnostics only. */
26
+ protocolVersion: number;
27
+ /** Content record ids currently registered, so the embedder knows what it can patch. */
28
+ contentIds: string[];
29
+ }
30
+ /** Patch posted by the embedder for one content record. Narrowed to by {@link isContentPatchMessage}. */
31
+ interface PreviewContentPatchMessage {
32
+ /** Discriminator. */
33
+ type: typeof PREVIEW_CONTENT_PATCH_MESSAGE;
34
+ /** The content record to patch. */
35
+ contentId: string;
36
+ /** Path-addressed replacements, applied in order. */
37
+ ops: ContentPatchOp[];
38
+ /** Monotonic per-record sequence number, used only to detect a dropped message. */
39
+ seq: number;
40
+ }
41
+ /** Resync request posted by the receiver after a sequence gap. */
42
+ export interface PreviewResyncMessage {
43
+ /** Discriminator. */
44
+ type: typeof PREVIEW_RESYNC_MESSAGE;
45
+ /** The content record whose sequence broke. */
46
+ contentId: string;
47
+ /** The last sequence number successfully applied. */
48
+ lastSeq: number;
49
+ }
50
+ /** Inert-script report posted by the receiver. */
51
+ export interface PreviewInertScriptsMessage {
52
+ /** Discriminator. */
53
+ type: typeof PREVIEW_INERT_SCRIPTS_MESSAGE;
54
+ /** Cumulative count of inserted subtrees whose scripts were neutralised this session. */
55
+ total: number;
56
+ }
57
+ /**
58
+ * Type guard for an inbound content-patch message.
59
+ *
60
+ * Validates structurally rather than trusting the sender: the message crosses a frame boundary, and
61
+ * an unrecognised or malformed one is ignored rather than throwing inside a customer's page.
62
+ *
63
+ * @param {unknown} data - The `MessageEvent.data` payload.
64
+ * @returns {boolean} True when the payload is a well-formed content-patch message.
65
+ * @example isContentPatchMessage(event.data)
66
+ */
67
+ export declare function isContentPatchMessage(data: unknown): data is PreviewContentPatchMessage;
68
+ export {};
69
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/preview-receiver/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,0FAA0F;AAC1F,eAAO,MAAM,wBAAwB,IAAI,CAAA;AAEzC,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB,yBAAyB,CAAA;AAC3D,+EAA+E;AAC/E,eAAO,MAAM,6BAA6B,iCAAiC,CAAA;AAC3E,gFAAgF;AAChF,eAAO,MAAM,sBAAsB,0BAA0B,CAAA;AAC7D,iGAAiG;AACjG,eAAO,MAAM,6BAA6B,iCAAiC,CAAA;AAE3E,mEAAmE;AACnE,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,IAAI,EAAE,OAAO,qBAAqB,CAAA;IAClC,+DAA+D;IAC/D,eAAe,EAAE,MAAM,CAAA;IACvB,wFAAwF;IACxF,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB;AAED,yGAAyG;AACzG,UAAU,0BAA0B;IAClC,qBAAqB;IACrB,IAAI,EAAE,OAAO,6BAA6B,CAAA;IAC1C,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAA;IACjB,qDAAqD;IACrD,GAAG,EAAE,cAAc,EAAE,CAAA;IACrB,mFAAmF;IACnF,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,kEAAkE;AAClE,MAAM,WAAW,oBAAoB;IACnC,qBAAqB;IACrB,IAAI,EAAE,OAAO,sBAAsB,CAAA;IACnC,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAA;IACjB,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,kDAAkD;AAClD,MAAM,WAAW,0BAA0B;IACzC,qBAAqB;IACrB,IAAI,EAAE,OAAO,6BAA6B,CAAA;IAC1C,yFAAyF;IACzF,KAAK,EAAE,MAAM,CAAA;CACd;AA8BD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,0BAA0B,CAavF"}
@@ -1,6 +1,6 @@
1
- import { Picked } from '../picked';
2
- import { ExperienceInstance } from '../entities/experience-instance/experience-instance';
3
- import { AdaptedComponent } from '../entities/component/component';
1
+ import type { Picked } from '../picked';
2
+ import type { ExperienceInstance } from '../entities/experience-instance/experience-instance';
3
+ import type { AdaptedComponent } from '../entities/component/component';
4
4
  export { serialize, type PickedSnapshot, type SerializeParams, type SerializeAttributes, type SerializeLocation, type SerializeGetContent, } from './serialize';
5
5
  export { createExperienceInstance } from '../entities/experience-instance/experience-instance';
6
6
  export type { ExperienceInstance } from '../entities/experience-instance/experience-instance';
@@ -1,5 +1,5 @@
1
- import { Picked } from '../picked';
2
- import { ContentBlob, ExperienceContentResponse, ProjectConfig } from '../plugins/dynamic-experiences/types';
1
+ import type { Picked } from '../picked';
2
+ import type { ContentBlob, ExperienceContentResponse, ProjectConfig } from '../plugins/dynamic-experiences/types';
3
3
  /** Subset of `Location` fields that can be injected into the selection context. */
4
4
  export interface SerializeLocation {
5
5
  href: string;
@@ -52,7 +52,12 @@ export interface PickedSnapshot {
52
52
  versionId: string | null;
53
53
  /** The project config the server selected with (travels for preview parity). */
54
54
  projectConfig: ProjectConfig;
55
- /** Deduped content blobs for the selected experiences. */
55
+ /**
56
+ * Deduped content blobs for the selected experiences — the steps' own layout
57
+ * content and every entry reached from it through a `reference` field. The
58
+ * client provider seeds the whole array into the content registry, so both
59
+ * resolve identically on the server render and the first client paint.
60
+ */
56
61
  content: ContentBlob[];
57
62
  /** Memoized condition-evaluation results keyed by rule hash. */
58
63
  conditionResults: Record<string, boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../../src/server/serialize.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAOvC,OAAO,KAAK,EACV,WAAW,EACX,yBAAyB,EACzB,aAAa,EAEd,MAAM,sCAAsC,CAAA;AAE7C,mFAAmF;AACnF,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,mFAAmF;AACnF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;CACtC;AAED,+FAA+F;AAC/F,MAAM,MAAM,mBAAmB,GAAG,CAChC,UAAU,EAAE;IACV,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;CACZ,EACD,OAAO,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,KAChC,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAAA;AAK9C,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,aAAa,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QAAQ,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;CACtC;AAED,+FAA+F;AAC/F,MAAM,MAAM,mBAAmB,GAAG,CAChC,UAAU,EAAE;IACV,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;CACZ,EACD,OAAO,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,KAChC,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAAA;AAK9C,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,aAAa,EAAE,aAAa,CAAA;IAC5B,0DAA0D;IAC1D,UAAU,CAAC,EAAE,mBAAmB,CAAA;IAChC,4EAA4E;IAC5E,UAAU,CAAC,EAAE,mBAAmB,CAAA;IAChC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,qFAAqF;IACrF,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,gFAAgF;IAChF,aAAa,EAAE,aAAa,CAAA;IAC5B;;;;;OAKG;IACH,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,gEAAgE;IAChE,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC1C;AAoCD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAmEhG"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @file Content-path parsing for live-preview patches.
3
+ *
4
+ * Paths address a field inside a Content Entry's delivered `data` blob using the format the Picked
5
+ * API already emits for content-data validation errors — `$.sections[0].data.title`, rooted at `$`,
6
+ * with `.key` for object keys and `[n]` for array indices. Reusing that format keeps one convention
7
+ * across validation errors and preview patches instead of inventing a second.
8
+ *
9
+ * Content-model field keys are constrained to `/^[a-z][a-z0-9_]*$/` server-side, so no key can
10
+ * contain `.` or `[` and the string form needs no escaping.
11
+ */
12
+ /** One step along a content path: an object key, or an array index. */
13
+ export type ContentPathSegment = string | number;
14
+ /**
15
+ * Parses a content path into its segments.
16
+ *
17
+ * Returns an empty list for the root path *and* for anything malformed. Callers treat an empty list
18
+ * as "no addressable target" and skip the operation, so a corrupt or hostile path from another
19
+ * frame degrades to a no-op instead of throwing inside a customer's page.
20
+ *
21
+ * @param {string} path - The path to parse, for example `$.sections[0].data.title`.
22
+ * @returns {ContentPathSegment[]} The parsed segments, or `[]` for the root or an invalid path.
23
+ * @example
24
+ * parseContentPath('$.sections[0].data.title') // ['sections', 0, 'data', 'title']
25
+ */
26
+ export declare function parseContentPath(path: string): ContentPathSegment[];
27
+ /**
28
+ * Formats segments back into a content path. Inverse of {@link parseContentPath} for every
29
+ * well-formed path.
30
+ *
31
+ * @param {readonly ContentPathSegment[]} segments - The segments to format.
32
+ * @returns {string} The path string, or `'$'` when there are no segments.
33
+ * @example
34
+ * formatContentPath(['sections', 0, 'data', 'title']) // '$.sections[0].data.title'
35
+ */
36
+ export declare function formatContentPath(segments: readonly ContentPathSegment[]): string;
37
+ //# sourceMappingURL=content-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-path.d.ts","sourceRoot":"","sources":["../../../src/utils/content-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,uEAAuE;AACvE,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,CAAA;AA2ChD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAYnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,CAOjF"}
@@ -1,4 +1,5 @@
1
- import { ExperienceTarget } from '../entities/experience/experience';
1
+ /** @file DOM utilities for experience target resolution, host element creation, and root management. */
2
+ import type { ExperienceTarget } from '../entities/experience/experience';
2
3
  export declare function querySelector(selector: string): HTMLElement[];
3
4
  export declare function createShadowRoot(target: HTMLElement): ShadowRoot;
4
5
  export declare function domInteractive(): Promise<void>;
@@ -1,9 +1,9 @@
1
- import { Store, createEvent } from 'effector';
2
- import { ValidationError } from '../entities/response/response';
3
- import { ExperienceStep } from '../entities/step/step';
4
- import { ExperienceInstance } from '../entities/experience-instance/experience-instance';
5
- import { ResolvedFeature } from '../entities/feature/feature';
6
- import { Session } from '../entities/session/session';
1
+ import type { Store, createEvent } from 'effector';
2
+ import type { ValidationError } from '../entities/response/response';
3
+ import type { ExperienceStep } from '../entities/step/step';
4
+ import type { ExperienceInstance } from '../entities/experience-instance/experience-instance';
5
+ import type { ResolvedFeature } from '../entities/feature/feature';
6
+ import type { Session } from '../entities/session/session';
7
7
  export interface FormPayload {
8
8
  id: string;
9
9
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/utils/events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAA;AAC7F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAE1D,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,KAAK,CAAA;IACZ,IAAI,EAAE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EAAE;YAAE,MAAM,EAAE,eAAe,EAAE,CAAA;SAAE,CAAA;QACxC,UAAU,EAAE,kBAAkB,CAAA;QAC9B,IAAI,CAAC,EAAE,cAAc,CAAA;KACtB,CAAA;IACD,SAAS,EAAE;QACT,KAAK,EAAE,OAAO,GAAG,MAAM,CAAA;QACvB,IAAI,EAAE,OAAO,CAAA;KACd,CAAA;CACF;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,UAAU,CAAA;AAE9C,MAAM,MAAM,eAAe,GAAG;KAC3B,CAAC,IAAI,eAAe,GAAG;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,KAAK,GACxF,MAAM,GACN,UAAU,CAAC,CAAC,CAAC,CAAC;CACnB,CAAC,eAAe,CAAC,CAAA;AAElB,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,IAAI,CAAA;IACR,OAAO,EAAE,eAAe,CAAA;CACzB;AAED,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAA;AAgB1D,eAAO,MAAM,kBAAkB,aACnB,UAAU,CAAC,OAAO,WAAW,CAAC,eAAe,CAAC,CAAC,KACxD,iBAgBF,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Picked } from '../picked';
1
+ import type { Picked } from '../picked';
2
2
  declare const globalObjKey: unique symbol;
3
3
  interface InternalGlobal {
4
4
  [globalObjKey]?: Picked;
@@ -1 +1 @@
1
- {"version":3,"file":"global-obj.d.ts","sourceRoot":"","sources":["../../../src/utils/global-obj.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC,QAAA,MAAM,YAAY,eAAmB,CAAA;AAErC,UAAU,cAAc;IACtB,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAGD,eAAO,MAAM,UAAU,EAAiB,OAAO,UAAU,GAAG,cAAc,CAAA;AAE1E,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,SAExC,CAAA"}
1
+ {"version":3,"file":"global-obj.d.ts","sourceRoot":"","sources":["../../../src/utils/global-obj.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC,QAAA,MAAM,YAAY,eAAmB,CAAA;AAErC,UAAU,cAAc;IACtB,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAGD,eAAO,MAAM,UAAU,EAAiB,OAAO,UAAU,GAAG,cAAc,CAAA;AAE1E,eAAO,MAAM,UAAU,WAAY,MAAM,SAExC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../src/utils/id.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG,MAMzC,CAAA"}
1
+ {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../src/utils/id.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,SAAU,MAAM,KAAG,MAMzC,CAAA"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @file Relays the count of preview-inserted subtrees whose scripts were neutralised.
3
+ *
4
+ * The render layer (`@picked/react`'s `HtmlRender`) knows how many script-bearing subtrees a
5
+ * preview morph inserted; the preview receiver knows how to tell the dashboard. Neither should
6
+ * import the other, so the count passes through this tiny module. Every framework binding's render
7
+ * path reports into the same receiver through it.
8
+ *
9
+ * The count is cumulative for the session and only ever grows, which matches how the editor uses
10
+ * it: "some markup you added is inert until you save", not a per-edit delta.
11
+ */
12
+ /** Listener notified when the cumulative inert-subtree count changes. */
13
+ type InertScriptListener = (total: number) => void;
14
+ /**
15
+ * Records that a preview render inserted `count` subtrees whose scripts were neutralised.
16
+ *
17
+ * @param {number} count - Subtrees neutralised by the render that just completed.
18
+ * @returns {void} Nothing.
19
+ * @example reportInertScriptSubtrees(2)
20
+ */
21
+ export declare function reportInertScriptSubtrees(count: number): void;
22
+ /**
23
+ * Subscribes to the cumulative inert-subtree count, invoking `listener` immediately with the
24
+ * current total so a late subscriber (the receiver connects after first paint) is not left behind.
25
+ *
26
+ * @param {InertScriptListener} listener - Called with the running total.
27
+ * @returns {() => void} Unsubscribe function.
28
+ * @example const stop = onInertScriptSubtrees((n) => post({ inertScriptSubtrees: n }))
29
+ */
30
+ export declare function onInertScriptSubtrees(listener: InertScriptListener): () => void;
31
+ /**
32
+ * Resets the cumulative count and drops every listener. Exposed for tests, which share a module
33
+ * registry across cases.
34
+ *
35
+ * @returns {void} Nothing.
36
+ * @example resetInertScriptReport()
37
+ */
38
+ export declare function resetInertScriptReport(): void;
39
+ export {};
40
+ //# sourceMappingURL=inert-script-report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inert-script-report.d.ts","sourceRoot":"","sources":["../../../src/utils/inert-script-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,yEAAyE;AACzE,KAAK,mBAAmB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;AAKlD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAI7D;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM,IAAI,CAM/E;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAG7C"}