@picked/client 0.0.1-dev.1780617185476 → 0.0.1-dev.1783393641770

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 (86) hide show
  1. package/dist/{api-DDuD7JeP.cjs → api-CEoqdaqt.cjs} +1 -1
  2. package/dist/{api-DyalyzzP.js → api-CHtZJL48.js} +1 -1
  3. package/dist/cjs/form/index.js +1 -1
  4. package/dist/cjs/index.js +2 -2
  5. package/dist/cjs/plugins/create-experience/index.js +1 -1
  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/plugins/experience-browser-storage/index.js +1 -1
  9. package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
  10. package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
  11. package/dist/cjs/plugins/responses-indexeddb/index.js +1 -1
  12. package/dist/cjs/plugins/single-page-app/index.js +1 -1
  13. package/dist/cjs/plugins/web-components/index.js +1 -1
  14. package/dist/cjs/plugins/window-object/index.js +1 -1
  15. package/dist/cjs/server/index.js +1 -1
  16. package/dist/docs/api/index.md +4 -0
  17. package/dist/docs/content/asset-library.mdx +50 -0
  18. package/dist/docs/content/content-entries.mdx +30 -0
  19. package/dist/docs/content/layouts.mdx +70 -0
  20. package/dist/docs/content/pages.mdx +67 -0
  21. package/dist/docs/content/sections.mdx +33 -0
  22. package/dist/docs/delivery-api/experience-content.md +85 -0
  23. package/dist/docs/delivery-api/index.md +46 -0
  24. package/dist/docs/delivery-api/preview-caching-crawling.md +59 -0
  25. package/dist/docs/delivery-api/project-config.md +56 -0
  26. package/dist/docs/experiences.mdx +3 -1
  27. package/dist/docs/fields.mdx +2 -0
  28. package/dist/docs/guides/build-a-personalized-page.mdx +143 -0
  29. package/dist/docs/sdk/experiences.md +2 -0
  30. package/dist/docs/sdk/index.md +11 -1
  31. package/dist/docs/sdk/ssr/index.md +62 -0
  32. package/dist/docs/sdk/ssr/rendering-and-hydration.md +141 -0
  33. package/dist/docs/sdk/ssr/serialize.md +86 -0
  34. package/dist/docs/sdk/ssr/slots-and-placements.md +35 -0
  35. package/dist/docs/sdk/steps.md +2 -0
  36. package/dist/docs/steps.mdx +2 -0
  37. package/dist/docs/workspace-versioning.mdx +28 -0
  38. package/dist/{dom-DjfSrkpp.js → dom-BwmTHeT7.js} +1 -1
  39. package/dist/{dom-sqnnO-CT.cjs → dom-CDrHc_j9.cjs} +1 -1
  40. package/dist/esm/form/index.js +1 -1
  41. package/dist/esm/index.js +206 -192
  42. package/dist/esm/plugins/create-experience/index.js +1 -1
  43. package/dist/esm/plugins/dom-observer/index.js +3 -3
  44. package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
  45. package/dist/esm/plugins/experience-browser-storage/index.js +3 -3
  46. package/dist/esm/plugins/history-browser-storage/index.js +2 -2
  47. package/dist/esm/plugins/responses-browser-storage/index.js +2 -2
  48. package/dist/esm/plugins/responses-indexeddb/index.js +1 -1
  49. package/dist/esm/plugins/single-page-app/index.js +2 -2
  50. package/dist/esm/plugins/web-components/index.js +1 -1
  51. package/dist/esm/plugins/window-object/index.js +1 -1
  52. package/dist/esm/server/index.js +33 -33
  53. package/dist/{experience-instance-DBzfLqnk.js → experience-instance-CBJJPjEJ.js} +189 -141
  54. package/dist/experience-instance-qBWC_Wr2.cjs +1 -0
  55. package/dist/id-Js-62re-.cjs +1 -0
  56. package/dist/logger-CSTvAyyB.cjs +1 -0
  57. package/dist/{object-ThO1DEyl.cjs → object-CIkt7Fkr.cjs} +1 -1
  58. package/dist/{plugin-Bxbu49WU.cjs → plugin-C1fanByQ.cjs} +1 -1
  59. package/dist/{plugin-BtpXkpqU.js → plugin-mTF3d8cX.js} +11 -7
  60. package/dist/{preview-bridge-DIdDvNXQ.cjs → preview-bridge-CpX1BkSA.cjs} +1 -1
  61. package/dist/{preview-bridge-CGyx7dEx.js → preview-bridge-D76l-dPy.js} +2 -2
  62. package/dist/rules-logic-CGZIYgAI.cjs +1 -0
  63. package/dist/{rules-logic-D_CVBuv7.js → rules-logic-HesIUCu6.js} +1 -1
  64. package/dist/{storage-BXSlLTRa.cjs → storage-DUw9UJ2h.cjs} +1 -1
  65. package/dist/{supports-34OzZK5j.cjs → supports-DBzjGaWD.cjs} +1 -1
  66. package/dist/types/entities/action/action.d.ts +1 -1
  67. package/dist/types/entities/condition/condition.d.ts +9 -0
  68. package/dist/types/entities/condition/condition.d.ts.map +1 -1
  69. package/dist/types/entities/experience-instance/experience-instance.d.ts +6 -0
  70. package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
  71. package/dist/types/lifecycle/condition-selection.d.ts +24 -0
  72. package/dist/types/lifecycle/condition-selection.d.ts.map +1 -1
  73. package/dist/types/lifecycle/rules-logic.d.ts.map +1 -1
  74. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
  75. package/dist/types/server/index.d.ts +1 -1
  76. package/dist/types/server/index.d.ts.map +1 -1
  77. package/package.json +2 -2
  78. package/dist/experience-instance-CVKoGtYE.cjs +0 -1
  79. package/dist/id-Cg7fVl1O.cjs +0 -1
  80. package/dist/logger-fbvQC40v.cjs +0 -1
  81. package/dist/rules-logic-H6P8xwHF.cjs +0 -1
  82. /package/dist/{id-n2yrHvNo.js → id-Bo4RBeOs.js} +0 -0
  83. /package/dist/{logger-6z_gb4rA.js → logger-DMN6TxJJ.js} +0 -0
  84. /package/dist/{object-DvUDOytC.js → object-BUDGxEqy.js} +0 -0
  85. /package/dist/{storage-hOHCCXvP.js → storage-1MW3-_As.js} +0 -0
  86. /package/dist/{supports-BgjwyijI.js → supports-CO9bJGNl.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../../id-n2yrHvNo.js";
1
+ import { t as e } from "../../../id-Bo4RBeOs.js";
2
2
  //#region src/plugins/create-experience/serialization.ts
3
3
  var t = {
4
4
  serialize(e) {
@@ -1,6 +1,6 @@
1
- import "../../../logger-6z_gb4rA.js";
2
- import { f as e, i as t } from "../../../supports-BgjwyijI.js";
3
- import { r as n } from "../../../dom-DjfSrkpp.js";
1
+ import "../../../logger-DMN6TxJJ.js";
2
+ import { f as e, i as t } from "../../../supports-CO9bJGNl.js";
3
+ import { r as n } from "../../../dom-BwmTHeT7.js";
4
4
  import { createEffect as r, createEvent as i, createStore as a, sample as o } from "effector";
5
5
  //#region src/plugins/dom-observer/plugin.ts
6
6
  var s = /* @__PURE__ */ new WeakSet(), c = () => ({
@@ -1,3 +1,3 @@
1
- import { i as e } from "../../../api-DyalyzzP.js";
2
- import { n as t, r as n, t as r } from "../../../plugin-BtpXkpqU.js";
1
+ import { i as e } from "../../../api-CHtZJL48.js";
2
+ import { n as t, r as n, t as r } from "../../../plugin-mTF3d8cX.js";
3
3
  export { e as createClientHeaders, r as dynamicExperiencesPlugin, t as fetchExperienceContent, n as fetchProject };
@@ -1,6 +1,6 @@
1
- import "../../../logger-6z_gb4rA.js";
2
- import { f as e } from "../../../supports-BgjwyijI.js";
3
- import { n as t, r as n, t as r } from "../../../storage-hOHCCXvP.js";
1
+ import "../../../logger-DMN6TxJJ.js";
2
+ import { f as e } from "../../../supports-CO9bJGNl.js";
3
+ import { n as t, r as n, t as r } from "../../../storage-1MW3-_As.js";
4
4
  import { createEffect as i, sample as a } from "effector";
5
5
  //#region src/plugins/experience-browser-storage/plugin.ts
6
6
  var o = ({ storage: o = "local" } = {}) => ({
@@ -1,5 +1,5 @@
1
- import { f as e } from "../../../supports-BgjwyijI.js";
2
- import { n as t, r as n, t as r } from "../../../storage-hOHCCXvP.js";
1
+ import { f as e } from "../../../supports-CO9bJGNl.js";
2
+ import { n as t, r as n, t as r } from "../../../storage-1MW3-_As.js";
3
3
  import { createEffect as i, sample as a } from "effector";
4
4
  //#region src/plugins/history-browser-storage/plugin.ts
5
5
  var o = r("history", "global"), s = ({ storage: r = "local" } = {}) => ({
@@ -1,5 +1,5 @@
1
- import { f as e } from "../../../supports-BgjwyijI.js";
2
- import { n as t, r as n, t as r } from "../../../storage-hOHCCXvP.js";
1
+ import { f as e } from "../../../supports-CO9bJGNl.js";
2
+ import { n as t, r as n, t as r } from "../../../storage-1MW3-_As.js";
3
3
  import { attach as i, createEffect as a, sample as o } from "effector";
4
4
  //#region src/plugins/responses-browser-storage/plugin.ts
5
5
  var s = r("responses", "global");
@@ -1,4 +1,4 @@
1
- import { f as e } from "../../../supports-BgjwyijI.js";
1
+ import { f as e } from "../../../supports-CO9bJGNl.js";
2
2
  import { createEffect as t, sample as n } from "effector";
3
3
  //#region src/utils/indexed-db.ts
4
4
  var r = "picked";
@@ -1,5 +1,5 @@
1
- import { n as e } from "../../../object-DvUDOytC.js";
2
- import { a as t, f as n, p as r } from "../../../supports-BgjwyijI.js";
1
+ import { n as e } from "../../../object-BUDGxEqy.js";
2
+ import { a as t, f as n, p as r } from "../../../supports-CO9bJGNl.js";
3
3
  //#region src/plugins/single-page-app/plugin.ts
4
4
  var i = r, a, o = (e) => ({
5
5
  name: "single-page-app",
@@ -1,4 +1,4 @@
1
- import { d as e, f as t } from "../../../supports-BgjwyijI.js";
1
+ import { d as e, f as t } from "../../../supports-CO9bJGNl.js";
2
2
  //#region src/plugins/web-components/plugin.ts
3
3
  var n = () => ({
4
4
  name: "web-components",
@@ -1,4 +1,4 @@
1
- import { f as e } from "../../../supports-BgjwyijI.js";
1
+ import { f as e } from "../../../supports-CO9bJGNl.js";
2
2
  //#region src/plugins/window-object/plugin.ts
3
3
  var t = () => ({
4
4
  name: "window",
@@ -1,31 +1,31 @@
1
- import { a as e, i as t, l as n, o as r, s as i, t as a } from "../../experience-instance-DBzfLqnk.js";
2
- import { i as o, n as s } from "../../plugin-BtpXkpqU.js";
3
- import { attach as c, createEffect as l, createEvent as u, createStore as d, sample as f } from "effector";
1
+ import { a as e, c as t, i as n, o as r, s as i, t as a, u as o } from "../../experience-instance-CBJJPjEJ.js";
2
+ import { i as s, n as c } from "../../plugin-mTF3d8cX.js";
3
+ import { attach as l, createEffect as u, createEvent as d, createStore as f, sample as p } from "effector";
4
4
  //#region src/server/serialize.ts
5
- var p = 1e4;
6
- function m(e) {
5
+ var m = 1e4;
6
+ function h(e) {
7
7
  if (e?.location !== void 0) return { location: e.location };
8
8
  }
9
- function h(e, t) {
10
- return e.nodes.filter(n).some((e) => t.get(e.stepId) === !0);
9
+ function g(e, t) {
10
+ return e.nodes.filter(o).some((e) => t.get(e.stepId) === !0);
11
11
  }
12
- async function g(e, t) {
12
+ async function _(e, t) {
13
13
  let { projectConfig: n } = t, i = e.session.store.getState().id;
14
- e.conditionResults.reset(), o(e, n, {
14
+ e.conditionResults.reset(), s(e, n, {
15
15
  isPreview: !1,
16
16
  sessionId: i
17
17
  });
18
- let a = m(t.attributes), c = t.timeoutMs ?? p, l = new Map(n.steps.map((e) => [e.id, e.layoutContentId !== void 0 && e.layoutContentId !== null])), u = [];
18
+ let a = h(t.attributes), o = t.timeoutMs ?? m, l = new Map(n.steps.map((e) => [e.id, e.layoutContentId !== void 0 && e.layoutContentId !== null])), u = [];
19
19
  for (let t of n.experiences) await r(e, { condition: t.condition }, { context: a }) && u.push(t);
20
20
  let d = /* @__PURE__ */ new Map();
21
21
  for (let n of u) {
22
- if (!h(n, l)) continue;
22
+ if (!g(n, l)) continue;
23
23
  let r = t.getContent ? await t.getContent({
24
24
  id: n.id,
25
25
  key: n.key
26
- }, { previewToken: t.previewToken }) : await s(e.apiUrl, e.projectId, n.id, {
26
+ }, { previewToken: t.previewToken }) : await c(e.apiUrl, e.projectId, n.id, {
27
27
  previewToken: t.previewToken,
28
- signal: AbortSignal.timeout(c)
28
+ signal: AbortSignal.timeout(o)
29
29
  });
30
30
  if (r) for (let e of r.content) d.set(e.id, e);
31
31
  }
@@ -38,7 +38,7 @@ async function g(e, t) {
38
38
  }
39
39
  //#endregion
40
40
  //#region src/server/index.ts
41
- function _() {
41
+ function v() {
42
42
  let e, t;
43
43
  return {
44
44
  promise: new Promise((n, r) => {
@@ -48,16 +48,16 @@ function _() {
48
48
  reject: (e) => t(e)
49
49
  };
50
50
  }
51
- function v(e, t) {
52
- let { promise: n, resolve: r } = _(), i = u(), o = u(), s = u(), p = u(), m = u(), h = e.experiences.listStore.map((t) => t.map((t) => a({
51
+ function y(e, t) {
52
+ let { promise: n, resolve: r } = v(), i = d(), o = d(), s = d(), c = d(), m = d(), h = e.experiences.listStore.map((t) => t.map((t) => a({
53
53
  client: e,
54
54
  experience: t
55
- }))), g = d({
55
+ }))), g = f({
56
56
  currentExperienceIndex: 0,
57
57
  renderedExperiences: [],
58
58
  isComplete: !1
59
- }), v = l(async (t) => {
60
- let n = c({
59
+ }), _ = u(async (t) => {
60
+ let n = l({
61
61
  source: t.experience.componentStore,
62
62
  effect: async (n, r) => {
63
63
  let i = t.availableRenderers[r];
@@ -72,7 +72,7 @@ function v(e, t) {
72
72
  if (t) return t;
73
73
  }
74
74
  return null;
75
- }), y = l(async ({ experience: e, availableRenderers: t, startRendererIndex: n = 0 }) => e ? v({
75
+ }), y = u(async ({ experience: e, availableRenderers: t, startRendererIndex: n = 0 }) => e ? _({
76
76
  experience: e,
77
77
  availableRenderers: t,
78
78
  startRendererIndex: n
@@ -84,13 +84,13 @@ function v(e, t) {
84
84
  })).on(m, (e) => ({
85
85
  ...e,
86
86
  currentExperienceIndex: e.currentExperienceIndex + 1
87
- })).on(p, (e) => ({
87
+ })).on(c, (e) => ({
88
88
  ...e,
89
89
  isComplete: !0
90
- })).reset(i), f({
90
+ })).reset(i), p({
91
91
  clock: i,
92
92
  target: o
93
- }), f({
93
+ }), p({
94
94
  clock: o,
95
95
  source: {
96
96
  experiences: h,
@@ -103,22 +103,22 @@ function v(e, t) {
103
103
  startRendererIndex: 0
104
104
  }),
105
105
  target: y
106
- }), f({
106
+ }), p({
107
107
  clock: y.doneData,
108
108
  filter: (e) => e !== null,
109
109
  fn: (e) => e.rendered.body,
110
110
  target: s
111
- }), f({
111
+ }), p({
112
112
  clock: s,
113
113
  target: o
114
- }), f({
114
+ }), p({
115
115
  clock: y.doneData,
116
116
  filter: (e) => e === null,
117
117
  target: m
118
- }), f({
118
+ }), p({
119
119
  clock: m,
120
120
  target: o
121
- }), f({
121
+ }), p({
122
122
  clock: [
123
123
  o,
124
124
  m,
@@ -129,10 +129,10 @@ function v(e, t) {
129
129
  state: g
130
130
  },
131
131
  filter: ({ experiences: e, state: t }) => t.currentExperienceIndex >= e.length,
132
- target: p
133
- }), f({
134
- clock: p,
135
- target: c({
132
+ target: c
133
+ }), p({
134
+ clock: c,
135
+ target: l({
136
136
  source: g,
137
137
  effect: (e) => {
138
138
  e.isComplete && r(e.renderedExperiences);
@@ -141,4 +141,4 @@ function v(e, t) {
141
141
  }), i(), n;
142
142
  }
143
143
  //#endregion
144
- export { a as createExperienceInstance, t as evaluateConditionMemo, e as hashRule, r as isExperienceActive, o as registerProjectConfig, v as render, i as ruleReferencesAction, g as serialize };
144
+ export { a as createExperienceInstance, n as evaluateConditionMemo, e as hashRule, r as isExperienceActive, s as registerProjectConfig, y as render, i as ruleReferencesAction, t as ruleReferencesActionDeep, _ as serialize };