@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.
- package/dist/{api-DDuD7JeP.cjs → api-CEoqdaqt.cjs} +1 -1
- package/dist/{api-DyalyzzP.js → api-CHtZJL48.js} +1 -1
- package/dist/cjs/form/index.js +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/dom-observer/index.js +1 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/responses-indexeddb/index.js +1 -1
- package/dist/cjs/plugins/single-page-app/index.js +1 -1
- package/dist/cjs/plugins/web-components/index.js +1 -1
- package/dist/cjs/plugins/window-object/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/docs/api/index.md +4 -0
- package/dist/docs/content/asset-library.mdx +50 -0
- package/dist/docs/content/content-entries.mdx +30 -0
- package/dist/docs/content/layouts.mdx +70 -0
- package/dist/docs/content/pages.mdx +67 -0
- package/dist/docs/content/sections.mdx +33 -0
- package/dist/docs/delivery-api/experience-content.md +85 -0
- package/dist/docs/delivery-api/index.md +46 -0
- package/dist/docs/delivery-api/preview-caching-crawling.md +59 -0
- package/dist/docs/delivery-api/project-config.md +56 -0
- package/dist/docs/experiences.mdx +3 -1
- package/dist/docs/fields.mdx +2 -0
- package/dist/docs/guides/build-a-personalized-page.mdx +143 -0
- package/dist/docs/sdk/experiences.md +2 -0
- package/dist/docs/sdk/index.md +11 -1
- package/dist/docs/sdk/ssr/index.md +62 -0
- package/dist/docs/sdk/ssr/rendering-and-hydration.md +141 -0
- package/dist/docs/sdk/ssr/serialize.md +86 -0
- package/dist/docs/sdk/ssr/slots-and-placements.md +35 -0
- package/dist/docs/sdk/steps.md +2 -0
- package/dist/docs/steps.mdx +2 -0
- package/dist/docs/workspace-versioning.mdx +28 -0
- package/dist/{dom-DjfSrkpp.js → dom-BwmTHeT7.js} +1 -1
- package/dist/{dom-sqnnO-CT.cjs → dom-CDrHc_j9.cjs} +1 -1
- package/dist/esm/form/index.js +1 -1
- package/dist/esm/index.js +206 -192
- package/dist/esm/plugins/create-experience/index.js +1 -1
- package/dist/esm/plugins/dom-observer/index.js +3 -3
- package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
- package/dist/esm/plugins/experience-browser-storage/index.js +3 -3
- package/dist/esm/plugins/history-browser-storage/index.js +2 -2
- package/dist/esm/plugins/responses-browser-storage/index.js +2 -2
- package/dist/esm/plugins/responses-indexeddb/index.js +1 -1
- package/dist/esm/plugins/single-page-app/index.js +2 -2
- package/dist/esm/plugins/web-components/index.js +1 -1
- package/dist/esm/plugins/window-object/index.js +1 -1
- package/dist/esm/server/index.js +33 -33
- package/dist/{experience-instance-DBzfLqnk.js → experience-instance-CBJJPjEJ.js} +189 -141
- package/dist/experience-instance-qBWC_Wr2.cjs +1 -0
- package/dist/id-Js-62re-.cjs +1 -0
- package/dist/logger-CSTvAyyB.cjs +1 -0
- package/dist/{object-ThO1DEyl.cjs → object-CIkt7Fkr.cjs} +1 -1
- package/dist/{plugin-Bxbu49WU.cjs → plugin-C1fanByQ.cjs} +1 -1
- package/dist/{plugin-BtpXkpqU.js → plugin-mTF3d8cX.js} +11 -7
- package/dist/{preview-bridge-DIdDvNXQ.cjs → preview-bridge-CpX1BkSA.cjs} +1 -1
- package/dist/{preview-bridge-CGyx7dEx.js → preview-bridge-D76l-dPy.js} +2 -2
- package/dist/rules-logic-CGZIYgAI.cjs +1 -0
- package/dist/{rules-logic-D_CVBuv7.js → rules-logic-HesIUCu6.js} +1 -1
- package/dist/{storage-BXSlLTRa.cjs → storage-DUw9UJ2h.cjs} +1 -1
- package/dist/{supports-34OzZK5j.cjs → supports-DBzjGaWD.cjs} +1 -1
- package/dist/types/entities/action/action.d.ts +1 -1
- package/dist/types/entities/condition/condition.d.ts +9 -0
- package/dist/types/entities/condition/condition.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +6 -0
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/lifecycle/condition-selection.d.ts +24 -0
- package/dist/types/lifecycle/condition-selection.d.ts.map +1 -1
- package/dist/types/lifecycle/rules-logic.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/server/index.d.ts +1 -1
- package/dist/types/server/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/experience-instance-CVKoGtYE.cjs +0 -1
- package/dist/id-Cg7fVl1O.cjs +0 -1
- package/dist/logger-fbvQC40v.cjs +0 -1
- package/dist/rules-logic-H6P8xwHF.cjs +0 -1
- /package/dist/{id-n2yrHvNo.js → id-Bo4RBeOs.js} +0 -0
- /package/dist/{logger-6z_gb4rA.js → logger-DMN6TxJJ.js} +0 -0
- /package/dist/{object-DvUDOytC.js → object-BUDGxEqy.js} +0 -0
- /package/dist/{storage-hOHCCXvP.js → storage-1MW3-_As.js} +0 -0
- /package/dist/{supports-BgjwyijI.js → supports-CO9bJGNl.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./logger-
|
|
2
|
-
import { t as e } from "./api-
|
|
1
|
+
import "./logger-DMN6TxJJ.js";
|
|
2
|
+
import { t as e } from "./api-CHtZJL48.js";
|
|
3
3
|
import { attach as t } from "effector";
|
|
4
4
|
//#region src/plugins/dynamic-experiences/hash.ts
|
|
5
5
|
function n(e) {
|
|
@@ -188,7 +188,11 @@ function D(e, t) {
|
|
|
188
188
|
return n.set(r.id, o), o;
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
function O(e, t) {
|
|
192
|
+
let n = new Set(t && Array.isArray(t.experiences) ? t.experiences.map((e) => e.id) : []);
|
|
193
|
+
return (t, r) => n.has(t.id) ? e(t, r) : Promise.resolve(null);
|
|
194
|
+
}
|
|
195
|
+
async function k(e) {
|
|
192
196
|
let { client: t, apiUrl: n, options: r } = e, i = f(t), a = !!i, o = r?.projectConfig ?? null, s = r?.getContent ? T(r.getContent, i) : null, c = null;
|
|
193
197
|
if (i) return o ??= await v(n, t.projectId, { previewToken: i }), s ??= w(n, t.projectId, i), {
|
|
194
198
|
config: o,
|
|
@@ -215,7 +219,7 @@ async function O(e) {
|
|
|
215
219
|
isPreview: a
|
|
216
220
|
});
|
|
217
221
|
}
|
|
218
|
-
function
|
|
222
|
+
function A(e) {
|
|
219
223
|
return {
|
|
220
224
|
name: "dynamic-experiences",
|
|
221
225
|
setup: (n) => {
|
|
@@ -223,12 +227,12 @@ function k(e) {
|
|
|
223
227
|
return { onStart: t({
|
|
224
228
|
source: n.session.store.map((e) => e.id),
|
|
225
229
|
effect: async (t) => {
|
|
226
|
-
let { config: i, contentLoader: a, dataSource: o, isPreview: s } = await
|
|
230
|
+
let { config: i, contentLoader: a, dataSource: o, isPreview: s } = await k({
|
|
227
231
|
client: n,
|
|
228
232
|
apiUrl: r,
|
|
229
233
|
options: e
|
|
230
234
|
});
|
|
231
|
-
a && (n.contentLoader = D(n, a)), n.dataSource = o, i && d(n, i, {
|
|
235
|
+
a && (n.contentLoader = D(n, O(a, i))), n.dataSource = o, i && d(n, i, {
|
|
232
236
|
isPreview: s,
|
|
233
237
|
sessionId: t
|
|
234
238
|
});
|
|
@@ -238,4 +242,4 @@ function k(e) {
|
|
|
238
242
|
};
|
|
239
243
|
}
|
|
240
244
|
//#endregion
|
|
241
|
-
export { d as i, b as n, v as r,
|
|
245
|
+
export { d as i, b as n, v as r, A as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("./object-CIkt7Fkr.cjs"),t=require("./supports-DBzjGaWD.cjs");var n=`picked-preview:navigation`,r=!1;function i(){return`*`}function a(){let{href:e,pathname:t,search:r}=globalThis.location,a={type:n,href:e,pathname:t,search:r};globalThis.parent.postMessage(a,i())}function o(e){return function(...t){e.apply(this,t),a()}}function s(){if(r||!t.f())return()=>void 0;r=!0,a();let n=()=>{a()};return globalThis.addEventListener(`popstate`,n),t.a()&&(e.n(globalThis.history,`pushState`,o),e.n(globalThis.history,`replaceState`,o)),()=>{r=!1,globalThis.removeEventListener(`popstate`,n)}}exports.initPreviewBridge=s;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e } from "./object-
|
|
2
|
-
import { a as t, f as n } from "./supports-
|
|
1
|
+
import { n as e } from "./object-BUDGxEqy.js";
|
|
2
|
+
import { a as t, f as n } from "./supports-CO9bJGNl.js";
|
|
3
3
|
//#region src/preview-bridge/index.ts
|
|
4
4
|
var r = "picked-preview:navigation", i = !1;
|
|
5
5
|
function a() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./object-CIkt7Fkr.cjs");function t(t){return!e.t(t)}async function n(e,t,n){return await e.evaluateRuleLogicFx({rule:t,context:n})}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=e=>btoa([...e].map(e=>String.fromCharCode(e.charCodeAt(0)^7)).join(``)).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``);function t(t,n=`global`,r){let i=`pckd`;if(n===`experience`){if(!r)throw Error(`Experience instance is required to scope storage to an experience`);i=`${i}:${r.experienceId}`}return{_:`${i}:${e(t)}`,scope:n}}var n=new Map;function r(e,t){let r=n.get(e._);r&&r.forEach(n=>n(e,t))}function i(e,t,n,i){let a=n===`local`?localStorage:sessionStorage,o=typeof t==`string`?t:JSON.stringify(t);if(a.setItem(e._,o),typeof i==`number`){let t=new Date(Date.now()+i).toISOString();a.setItem(`${e._}:expires-at`,t)}r(e,n)}function a(e,t){let n=t===`local`?localStorage:sessionStorage;n.removeItem(e._),n.removeItem(`${e._}:expires-at`),r(e,t)}function o(e,t,r,i){let a=t===`local`?localStorage:sessionStorage;function o(t){t.storageArea===a&&t.key===e._&&i(r(e))}function s(e,n){n===t&&i(r(e))}window.addEventListener(`storage`,o),n.has(e._)||n.set(e._,new Set);let c=n.get(e._);return c&&c.add(s),function(){window.removeEventListener(`storage`,o);let t=n.get(e._);t&&(t.delete(s),t.size===0&&n.delete(e._))}}function s(e,t){let n=t===`local`?localStorage:sessionStorage,r=n.getItem(e._),c=n.getItem(`${e._}:expires-at`),l=(n,r)=>i(e,n,t,r),u=()=>a(e,t),d=n=>o(e,t,e=>s(e,t),n);return c&&new Date>new Date(c)?(a(e,t),{isSet:()=>!1,text:()=>null,json:()=>null,boolean:()=>null,set:l,remove:u,subscribe:d}):{isSet(){return r!==null},text(){return r},json(){return r?JSON.parse(r):null},boolean(){return r?r===`true`:null},set:l,remove:u,subscribe:d}}var c={get(e){return s(e,`session`)},set(e,t,n){i(e,t,`session`,n)},remove(e){a(e,`session`)},subscribe(e,t){return o(e,`session`,this.get,t)}},l={get(e){return s(e,`local`)},set(e,t,n){i(e,t,`local`,n)},remove(e){a(e,`local`)},subscribe(e,t){return o(e,`local`,this.get,t)}};Object.defineProperty(exports
|
|
1
|
+
var e=e=>btoa([...e].map(e=>String.fromCharCode(e.charCodeAt(0)^7)).join(``)).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``);function t(t,n=`global`,r){let i=`pckd`;if(n===`experience`){if(!r)throw Error(`Experience instance is required to scope storage to an experience`);i=`${i}:${r.experienceId}`}return{_:`${i}:${e(t)}`,scope:n}}var n=new Map;function r(e,t){let r=n.get(e._);r&&r.forEach(n=>n(e,t))}function i(e,t,n,i){let a=n===`local`?localStorage:sessionStorage,o=typeof t==`string`?t:JSON.stringify(t);if(a.setItem(e._,o),typeof i==`number`){let t=new Date(Date.now()+i).toISOString();a.setItem(`${e._}:expires-at`,t)}r(e,n)}function a(e,t){let n=t===`local`?localStorage:sessionStorage;n.removeItem(e._),n.removeItem(`${e._}:expires-at`),r(e,t)}function o(e,t,r,i){let a=t===`local`?localStorage:sessionStorage;function o(t){t.storageArea===a&&t.key===e._&&i(r(e))}function s(e,n){n===t&&i(r(e))}window.addEventListener(`storage`,o),n.has(e._)||n.set(e._,new Set);let c=n.get(e._);return c&&c.add(s),function(){window.removeEventListener(`storage`,o);let t=n.get(e._);t&&(t.delete(s),t.size===0&&n.delete(e._))}}function s(e,t){let n=t===`local`?localStorage:sessionStorage,r=n.getItem(e._),c=n.getItem(`${e._}:expires-at`),l=(n,r)=>i(e,n,t,r),u=()=>a(e,t),d=n=>o(e,t,e=>s(e,t),n);return c&&new Date>new Date(c)?(a(e,t),{isSet:()=>!1,text:()=>null,json:()=>null,boolean:()=>null,set:l,remove:u,subscribe:d}):{isSet(){return r!==null},text(){return r},json(){return r?JSON.parse(r):null},boolean(){return r?r===`true`:null},set:l,remove:u,subscribe:d}}var c={get(e){return s(e,`session`)},set(e,t,n){i(e,t,`session`,n)},remove(e){a(e,`session`)},subscribe(e,t){return o(e,`session`,this.get,t)}},l={get(e){return s(e,`local`)},set(e,t,n){i(e,t,`local`,n)},remove(e){a(e,`local`)},subscribe(e,t){return o(e,`local`,this.get,t)}};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Symbol(`Picked`),t=globalThis,n=n=>{t[e]=n};function r(){try{return`location`in t&&!!t.location}catch{return!1}}function i(){try{return`history`in t&&!!t.history}catch{return!1}}function a(){try{return`localStorage`in t&&!!t.localStorage}catch{return!1}}function o(){try{return`sessionStorage`in t&&!!t.sessionStorage}catch{return!1}}function s(){try{return`document`in t&&`cookie`in t.document}catch{return!1}}function c(){try{return`document`in t&&`createElement`in t.document&&`attachShadow`in t.document.createElement(`div`)}catch{return!1}}function l(){try{return`window`in t}catch{return!1}}function u(){try{return l()&&t.top!==t.self}catch{return!0}}function d(){try{return`document`in t}catch{return!1}}function f(){try{return`IntersectionObserver`in t}catch{return!1}}function p(){try{return`customElements`in t&&!!t.customElements}catch{return!1}}function m(){try{return`crypto`in t&&`randomUUID`in t.crypto}catch{return!1}}Object.defineProperty(exports
|
|
1
|
+
var e=Symbol(`Picked`),t=globalThis,n=n=>{t[e]=n};function r(){try{return`location`in t&&!!t.location}catch{return!1}}function i(){try{return`history`in t&&!!t.history}catch{return!1}}function a(){try{return`localStorage`in t&&!!t.localStorage}catch{return!1}}function o(){try{return`sessionStorage`in t&&!!t.sessionStorage}catch{return!1}}function s(){try{return`document`in t&&`cookie`in t.document}catch{return!1}}function c(){try{return`document`in t&&`createElement`in t.document&&`attachShadow`in t.document.createElement(`div`)}catch{return!1}}function l(){try{return`window`in t}catch{return!1}}function u(){try{return l()&&t.top!==t.self}catch{return!0}}function d(){try{return`document`in t}catch{return!1}}function f(){try{return`IntersectionObserver`in t}catch{return!1}}function p(){try{return`customElements`in t&&!!t.customElements}catch{return!1}}function m(){try{return`crypto`in t&&`randomUUID`in t.crypto}catch{return!1}}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return c}});
|
|
@@ -21,7 +21,7 @@ export interface ActionContext {
|
|
|
21
21
|
* only and have no triggering instance.
|
|
22
22
|
*
|
|
23
23
|
* Re-entrancy: do not synchronously call navigation events (`goToNextStep`,
|
|
24
|
-
* `goToPreviousStep`, `goToStepById`) or open-state events (`open`, `close`,
|
|
24
|
+
* `goToPreviousStep`, `goToStepById`, `goToStepByKey`) or open-state events (`open`, `close`,
|
|
25
25
|
* `toggleOpen`, `setOpen`) on `context.experience` before the handler's returned
|
|
26
26
|
* promise resolves. Those writes race the flow runtime's post-action history
|
|
27
27
|
* push and produce non-deterministic ordering. Perform control flow after your
|
|
@@ -15,6 +15,15 @@ declare const createConditionIndexFactory: () => {
|
|
|
15
15
|
[id: string]: Condition;
|
|
16
16
|
}>;
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Creates a reactive condition index with registration and derived lookup helpers
|
|
20
|
+
* (by id, by key, and full list).
|
|
21
|
+
*
|
|
22
|
+
* @returns {ConditionsStore} The condition index and its helpers.
|
|
23
|
+
* @example
|
|
24
|
+
* const conditions = createConditionIndex()
|
|
25
|
+
* conditions.register({ id: 'c1', key: 'is-home', name: 'Home', logic: { '==': [1, 1] } })
|
|
26
|
+
*/
|
|
18
27
|
export declare function createConditionIndex(): ReturnType<typeof createConditionIndexFactory>;
|
|
19
28
|
export {};
|
|
20
29
|
//# sourceMappingURL=condition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../../../src/entities/condition/condition.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEnD,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAIrE,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,SAAS,CAAA;CACjB;
|
|
1
|
+
{"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../../../src/entities/condition/condition.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEnD,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAIrE,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,SAAS,CAAA;CACjB;AAED,QAAA,MAAM,2BAA2B;0BAqBF,SAAS,KAAG,IAAI;kBAgBxB,SAAS,CAAC,IAAI,CAAC;oBAYb,SAAS,CAAC,KAAK,CAAC;;;;;CAgBvC,CAAA;AAEF;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,IAAI,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAErF"}
|
|
@@ -29,6 +29,11 @@ export interface ExperienceInstance {
|
|
|
29
29
|
setOpen: EventCallable<boolean>;
|
|
30
30
|
treeStore: ExperienceStore['treeStore'];
|
|
31
31
|
currentNodeStore: Store<ExperienceNode | null>;
|
|
32
|
+
/**
|
|
33
|
+
* The current step to render. Set explicitly (not derived) so it "sticks"
|
|
34
|
+
* while the engine transits a non-step node — an action running or a condition
|
|
35
|
+
* evaluating — instead of blanking; only step nodes update it.
|
|
36
|
+
*/
|
|
32
37
|
currentStepStore: Store<ExperienceStep | null>;
|
|
33
38
|
previousStepStore: Store<ExperienceStep | null>;
|
|
34
39
|
nextReachableStepNodesStore: Store<ExperienceNode[]>;
|
|
@@ -37,6 +42,7 @@ export interface ExperienceInstance {
|
|
|
37
42
|
goToNextStep: EventCallable<void>;
|
|
38
43
|
goToPreviousStep: EventCallable<void>;
|
|
39
44
|
goToStepById: EventCallable<string>;
|
|
45
|
+
goToStepByKey: EventCallable<string>;
|
|
40
46
|
stepsHistoryStore: Store<HistoryEntry[]>;
|
|
41
47
|
/**
|
|
42
48
|
* Per-instance mount effect. Attached over `componentAndFrameworkStore` so the render call always receives the current resolved component+framework pair.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experience-instance.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience-instance/experience-instance.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAOL,KAAK,MAAM,EACX,KAAK,aAAa,EAGlB,KAAK,KAAK,EACX,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAiB1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAItD,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,CAAA;IAChC,YAAY,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IAC9B,sGAAsG;IACtG,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,eAAe,CAAC,aAAa,CAAC,CAAA;IAC3C,MAAM,EAAE,WAAW,GAAG,SAAS,CAAA;IAC/B,cAAc,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAA;IACjD;;OAEG;IACH,0BAA0B,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,SAAS,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gB,CAAC,WAAW,CAAC,CAAA;CACzC;AAED,QAAA,MAAM,+BAA+B,6CAMhC;IACD,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,eAAe,CAAA;IAC3B,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,OAAO,CAAC,EAAE,uBAAuB,CAAA;CAClC,
|
|
1
|
+
{"version":3,"file":"experience-instance.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience-instance/experience-instance.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAOL,KAAK,MAAM,EACX,KAAK,aAAa,EAGlB,KAAK,KAAK,EACX,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAiB1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAItD,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,CAAA;IAChC,YAAY,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IAC9B,sGAAsG;IACtG,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,eAAe,CAAC,aAAa,CAAC,CAAA;IAC3C,MAAM,EAAE,WAAW,GAAG,SAAS,CAAA;IAC/B,cAAc,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAA;IACjD;;OAEG;IACH,0BAA0B,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,SAAS,CAAC;QAAC,SAAS,EAAE,SAAS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AAE,CAAA;IACvB,SAAS,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAA;CACzC;AAED,QAAA,MAAM,+BAA+B,6CAMhC;IACD,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,eAAe,CAAA;IAC3B,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,OAAO,CAAC,EAAE,uBAAuB,CAAA;CAClC,uBAyiBF,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,CAAC,SAAS,UAAU,CAAC,OAAO,+BAA+B,CAAC,CAAC,CAAC,CAAC,EAC/D,MAAM,EAAE,CAAC,GAAG,UAAU,CAAC,OAAO,+BAA+B,CAAC,CAE/D;AAED,QAAA,MAAM,oCAAoC,eAA8B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;wBA4H1E,eAAe,UACnB,WAAW,YACT,uBAAuB;8BAmBF,UAAU,CAAC,KAAK,CAAC;4BAiBnB,UAAU,CAAC,IAAI,CAAC;;CAU/C,CAAA;AAEF;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAC3C,CAAC,SAAS,UAAU,CAAC,OAAO,oCAAoC,CAAC,CAAC,CAAC,CAAC,EACpE,MAAM,EAAE,CAAC,GAAG,UAAU,CAAC,OAAO,oCAAoC,CAAC,CAEpE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Store } from 'effector';
|
|
2
|
+
import { Condition } from '../entities/condition/condition';
|
|
2
3
|
import { LogicObject, LogicRule, LogicValue } from '../logic-engine';
|
|
3
4
|
import { Picked } from '../picked';
|
|
4
5
|
/** A condition rule that may be json-logic, a raw logic value, or unset. */
|
|
@@ -59,6 +60,29 @@ export declare function createConditionResults(): ConditionResults;
|
|
|
59
60
|
* ruleReferencesAction({ invoke: [{ var: 'actions.track' }] }) // true
|
|
60
61
|
*/
|
|
61
62
|
export declare function ruleReferencesAction(value: unknown): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Extracts the keys of every composed condition reference (`{ var: 'conditions.<key>' }`) found
|
|
65
|
+
* anywhere in a rule tree.
|
|
66
|
+
*
|
|
67
|
+
* @param {unknown} value - The rule fragment to inspect.
|
|
68
|
+
* @returns {string[]} The referenced condition keys (duplicates possible; callers dedupe).
|
|
69
|
+
* @example
|
|
70
|
+
* extractConditionKeys({ invoke: [{ var: 'conditions.is-home' }] }) // ['is-home']
|
|
71
|
+
*/
|
|
72
|
+
export declare function extractConditionKeys(value: unknown): string[];
|
|
73
|
+
/**
|
|
74
|
+
* Determines whether a rule references an action directly, or transitively through composed
|
|
75
|
+
* condition references by walking into each referenced condition's logic. Rules that reach an action
|
|
76
|
+
* must bypass the result cache so the action's side effect re-runs on every evaluation.
|
|
77
|
+
*
|
|
78
|
+
* @param {unknown} value - The rule fragment to inspect.
|
|
79
|
+
* @param {Record<string, Condition>} conditionsByKey - All available conditions indexed by key.
|
|
80
|
+
* @param {Set<string>} [visited] - Condition keys already inspected; guards against reference cycles.
|
|
81
|
+
* @returns {boolean} True when an action is reachable directly or through a composed condition.
|
|
82
|
+
* @example
|
|
83
|
+
* ruleReferencesActionDeep({ invoke: [{ var: 'conditions.b' }] }, conditionsByKey)
|
|
84
|
+
*/
|
|
85
|
+
export declare function ruleReferencesActionDeep(value: unknown, conditionsByKey: Record<string, Condition>, visited?: Set<string>): boolean;
|
|
62
86
|
/**
|
|
63
87
|
* Evaluates a condition rule with memoization against the client's `conditionResults` store.
|
|
64
88
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"condition-selection.d.ts","sourceRoot":"","sources":["../../../src/lifecycle/condition-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAA2B,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+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AC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAgB7D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,EACd,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAC1C,OAAO,GAAE,GAAG,CAAC,MAAM,CAAa,GAC/B,OAAO,CAqBT;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,aAAa,EACnB,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,WAAW,CAAA;CAAE,GAClC,OAAO,CAAC,OAAO,CAAC,CAuBlB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE;IAAE,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;CAAE,EAClD,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IACrC,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;CACnC,GACA,OAAO,CAAC,OAAO,CAAC,CAYlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules-logic.d.ts","sourceRoot":"","sources":["../../../src/lifecycle/rules-logic.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"rules-logic.d.ts","sourceRoot":"","sources":["../../../src/lifecycle/rules-logic.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAG9C,OAAO,KAAK,EAAgB,WAAW,EAAE,SAAS,EAAc,MAAM,iBAAiB,CAAA;AAEvF,OAAO,KAAK,EAAE,MAA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|
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;AA4JD;;;;;;;;;;;;;;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"}
|
|
@@ -5,7 +5,7 @@ export { serialize, type PickedSnapshot, type SerializeParams, type SerializeAtt
|
|
|
5
5
|
export { createExperienceInstance } from '../entities/experience-instance/experience-instance';
|
|
6
6
|
export type { ExperienceInstance } from '../entities/experience-instance/experience-instance';
|
|
7
7
|
export { registerProjectConfig } from '../plugins/dynamic-experiences/plugin';
|
|
8
|
-
export { hashRule, evaluateConditionMemo, isExperienceActive, ruleReferencesAction, } from '../lifecycle/condition-selection';
|
|
8
|
+
export { hashRule, evaluateConditionMemo, isExperienceActive, ruleReferencesAction, ruleReferencesActionDeep, } from '../lifecycle/condition-selection';
|
|
9
9
|
export type { ContentBlob, ProjectConfig, ProjectConfigExperience, ExperienceContentResponse, } from '../plugins/dynamic-experiences/types';
|
|
10
10
|
export interface Renderer<T = AdaptedComponent<string, unknown>> {
|
|
11
11
|
isValidComponent: (component: AdaptedComponent<string, unknown>) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAA;AAE7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAEvE,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAA;AAC9F,YAAY,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAA;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAA;AAE7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAEvE,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAA;AAC9F,YAAY,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAA;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,kCAAkC,CAAA;AACzC,YAAY,EACV,WAAW,EACX,aAAa,EACb,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,sCAAsC,CAAA;AA0B7C,MAAM,WAAW,QAAQ,CAAC,CAAC,GAAG,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC;IAC7D,gBAAgB,EAAE,CAAC,SAAS,EAAE,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAA;IAC3E,MAAM,EAAE,CACN,SAAS,EAAE,CAAC,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,kBAAkB,KAC3B,OAAO,CAAC;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;KACb,CAAC,CAAA;CACH;AAmBD;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAoJ/E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/client",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.1783393641770",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@withease/factories": "^1.0.5"
|
|
6
6
|
},
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
"size-limit": [
|
|
167
167
|
{
|
|
168
168
|
"path": "dist/esm/index.js",
|
|
169
|
-
"limit": "14 kB"
|
|
169
|
+
"limit": "14.5 kB"
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
"path": "dist/esm/server/index.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./rules-logic-H6P8xwHF.cjs`);require(`./logger-fbvQC40v.cjs`);const t=require(`./dom-sqnnO-CT.cjs`);let n=require(`effector`),r=require(`@withease/factories`);function i(e){return e.type===`condition`}function a(e){return e.type===`step`}function o(e){return e.type===`experience`}function s(e){return e.type===`origin`}function c(e){return e.type===`action`}var l=(0,n.createDomain)(`condition-results`);function u(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function d(e){if(e===void 0)return null;if(Array.isArray(e))return e.map(e=>d(e));if(u(e)){let t=Object.keys(e).sort((e,t)=>e.localeCompare(t)),n={};for(let r of t)n[r]=d(e[r]);return n}return e}function f(e){return JSON.stringify(d(e))}var p=(0,r.createFactory)(()=>{let e=l.store({}),t=(0,n.createApi)(e,{set(e,t){return{...e,[t.hash]:t.result}},seed(e,t){return{...e,...t}},clear(){return{}}});function r(e){t.set(e)}function i(e){t.seed(e)}function a(){t.clear()}function o(t){return e.getState()[t]}return{store:e,set:r,seed:i,peek:o,reset:a}});function m(){return(0,r.invoke)(p)}async function h(t,n,r){return n==null?!0:typeof n==`boolean`?n:e.n(n)?await e.t(t,n,r)===!0:!0}function g(e){if(typeof e==`string`)return e;if(Array.isArray(e)&&typeof e[0]==`string`)return e[0]}function _(e){if(Array.isArray(e))return e.some(_);if(u(e)){let t=g(e.var);return t!==void 0&&(t===`actions`||t.startsWith(`actions.`))?!0:Object.values(e).some(_)}return!1}async function v(e,t,n){let r=_(t),i=f(t);if(!r){let t=e.conditionResults.peek(i);if(t!==void 0)return t}let a=await h(e,t,n?.context);return r||e.conditionResults.set({hash:i,result:a}),a}async function y(e,t,n){let r=n?.context,i=[n?.precondition,n?.condition,t.condition];for(let t of i)if(!await v(e,t,{context:r}))return!1;return!0}var b=(e,t,n,r,i=new Set)=>i.has(n.id)?[]:(i.add(n.id),a(n)&&!r?[n]:t.filter(e=>e.sourceNodeId===n.id).flatMap(n=>{let r=e.find(e=>e.id===n.destinationNodeId);return r?b(e,t,r,!1,i):[]})),x=(e,t,n)=>b(e,t,n,!0,new Set),S=(e,t,n,r,i=new Set)=>{if(i.has(n.id))return[-1,-1];i.add(n.id);let a=t.filter(e=>e.sourceNodeId===n.id);if(a.length===0)return[0,0];let o=1/0,s=-1/0;for(let n of a){let r=e.find(e=>e.id===n.destinationNodeId);if(!r)continue;let[a,c]=S(e,t,r,!1,new Set(i));a!==-1&&(o=Math.min(o,a+1),s=Math.max(s,c+1))}return o===1/0?[-1,-1]:[o,s]},C=(e,t,n)=>S(e,t,n,!0,new Set),w=(e,t,n,r=new Set)=>{if(r.has(n.id))return[-1,-1];if(r.add(n.id),n.type===`origin`)return[0,0];let i=t.filter(e=>e.destinationNodeId===n.id);if(i.length===0)return[-1,-1];let a=1/0,o=-1/0;for(let n of i){let i=e.find(e=>e.id===n.sourceNodeId);if(!i)continue;let[s,c]=w(e,t,i,new Set(r));s!==-1&&(a=Math.min(a,s+1),o=Math.max(o,c+1))}return a===1/0?[-1,-1]:[a,o]},T=(e,t,n)=>w(e,t,n,new Set),E=e=>e.find(e=>e.type===`origin`)||null,D=(e,t,n)=>{if(!e)return E(t);let r=n.find(t=>t.sourceNodeId===e.id);return r&&t.find(e=>e.id===r.destinationNodeId)||null};async function O(e,t,n,r){let i=e?`true`:`false`,a=r.find(e=>e.sourceHandle===i&&e.sourceNodeId===t);return n.find(e=>e.id===a?.destinationNodeId)}var k=(0,n.createDomain)(`experience-instance`),A=(0,r.createFactory)(({client:r,experience:l,target:u,options:d})=>{let f=(0,n.createEvent)(),p=(0,n.createEvent)(),m=(0,n.createEvent)(),h=(0,n.createEvent)(),g=(0,n.createEvent)(),_=(0,n.createEvent)(),v=l.componentStore,y=k.store(`transitioning`),b=r.history.entriesStore.map(e=>e.filter(e=>e.experienceId===l.id)),S=b.map(e=>e.filter(e=>a(e.node))),w=b.map(e=>e.at(-1)?.node||null),A=(0,n.combine)(r.steps.listStore,w,(e,t)=>e.find(e=>t&&a(t)&&e.id===t.stepId)||null),j=(0,n.combine)(r.steps.listStore,S,(e,t)=>{let n=t.at(-2);if(!n||!a(n.node))return null;let r=n.node;return e.find(e=>e.id===r.stepId)||null}),M=(0,n.combine)(l.treeStore,w,({nodes:e,edges:t},n)=>n?x(e,t,n):[]),N=(0,n.combine)(l.treeStore,w,({nodes:e,edges:t},n)=>n?T(e,t,n):[-1,-1]),P=(0,n.combine)(l.treeStore,w,({nodes:e,edges:t},n)=>n?C(e,t,n):[-1,-1]),F=k.store(!1),I=(0,n.createApi)(F,{open:()=>!0,close:()=>!1,toggle:e=>!e,set:(e,t)=>t}),L=(0,n.createEffect)(async()=>{r.history.back({experienceId:l.id})}),R=(0,n.attach)({source:l.treeStore,effect:async(e,t)=>{let n=e.nodes.find(e=>a(e)&&e.stepId===t);n&&r.history.push({experienceId:l.id,node:n})}}),z=(0,n.attach)({source:w,effect:e=>{}}),B=(0,n.attach)({source:l.treeStore,effect:async({nodes:e})=>E(e)}),V=(0,n.attach)({source:l.treeStore,effect:async({nodes:e,edges:t},n)=>{if(s(n))return D(n,e,t)}}),H=(0,n.attach)({source:l.treeStore,effect:async({nodes:t,edges:n,conditions:a},o)=>{if(!i(o))return;let s=a.find(e=>e.id===o.conditionId)?.logic;return s?O(!!await e.t(r,s),o.id,t,n):void 0}}),U=(0,n.attach)({source:{tree:l.treeStore,actions:r.actions.listStore,snapshot:r.stateSnapshotStore},effect:async({tree:e,actions:t,snapshot:n},r)=>{let{nodes:i,edges:a}=e;if(!c(r))return;let o=r.actionKey;if(!o){`${r.id}`;return}let s=t.find(e=>e.key===o)?.action;if(!s){`${o}`;let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`false`);return e?i.find(t=>t.id===e.destinationNodeId):null}if(typeof s!=`function`){`${o}`;let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`false`);return e?i.find(t=>t.id===e.destinationNodeId):null}try{`${o}`,await s({...n,args:[]},{experience:X});let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`true`);if(!e)return`${r.id}`,null;let t=i.find(t=>t.id===e.destinationNodeId);return`${o}${t?.id}`,t||null}catch{`${o}`;let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`false`);if(!e)return`${r.id}`,null;let t=i.find(t=>t.id===e.destinationNodeId);return`${o}${t?.id}`,t||null}}}),W=(0,n.createEffect)(e=>{o(e)&&r.experiences.launch({key:e.experienceKey})}),G=(0,n.attach)({source:[w,l.treeStore],effect:async([e,{nodes:t,edges:n}])=>D(e,t,n)}),K=(0,n.attach)({source:[w,l.treeStore],effect:async([e,{nodes:t,edges:n}])=>D(e,t,n)}),q=(0,n.createEffect)(e=>{r.history.push({experienceId:l.id,node:e})}),J=(0,n.attach)({source:l.configStore,effect:async({initializeOpenLogic:t})=>d?.initialiseOpen===void 0?e.n(t)?!!await e.t(r,t):t??!1:d.initialiseOpen}),Y=(0,n.combine)(v,r.frameworks.listStore,(e,t)=>{if(!e)return null;let n=t.find(t=>t.name===e.component.frameworkName);return n?{component:e,framework:n}:null},{skipVoid:!1}),X,Z=(0,n.attach)({source:Y,effect:e=>{if(!e)return;if(!u){`${l.id}`;return}let n=t.n(u);try{e.framework.render(n,e.component.component,r,X)}catch{}}});X=Object.freeze({id:Math.random().toString(36).substring(7),experienceKey:l.key,experienceId:l.id,experienceName:l.name,configStore:l.configStore,target:u,componentStore:v,componentAndFrameworkStore:Y,stateStore:y,isOpenStore:F,open:I.open,close:I.close,toggleOpen:I.toggle,setOpen:I.set,treeStore:l.treeStore,currentNodeStore:w,currentStepStore:A,previousStepStore:j,nextReachableStepNodesStore:M,stepsToOriginStore:N,stepsToLeafStore:P,goToNextStep:p,goToPreviousStep:m,goToStepById:h,stepsHistoryStore:S,mountFx:Z});let Q=(0,n.createEvent)(),$=(0,n.createEvent)();return(0,n.sample)({clock:w,target:Q}),(0,n.sample)({clock:Q,filter:e=>e===null,target:B}),(0,n.sample)({clock:Q,filter:e=>e!==null,target:$}),(0,n.split)({source:$,match:e=>i(e)?`condition`:a(e)?`step`:o(e)?`launchExperience`:s(e)?`origin`:c(e)?`action`:`other`,cases:{origin:V,condition:H,step:z,launchExperience:W,action:U,__:(0,n.createEvent)()}}),(0,n.sample)({clock:[H.doneData,V.doneData,B.doneData,K.doneData,G.doneData,U.doneData],filter:Boolean,target:q}),(0,n.sample)({clock:p,target:K}),(0,n.sample)({clock:p,source:A,filter:Boolean,target:r.eventBus.prepend(e=>({type:`step_submit`,step:e,experience:X}))}),(0,n.sample)({clock:K.done,source:A,filter:Boolean,target:r.eventBus.prepend(e=>({type:`step_submit_success`,step:e,experience:X}))}),(0,n.sample)({clock:K.fail,source:A,filter:Boolean,target:r.eventBus.prepend(e=>({type:`step_submit_error`,step:e,experience:X}))}),(0,n.sample)({clock:m,target:L}),(0,n.sample)({clock:h,target:R}),(0,n.sample)({source:(0,n.combine)([H.pending,V.pending,B.pending,K.pending]),fn:e=>e.some(Boolean)?`transitioning`:`ready`,target:y}),(0,n.sample)({clock:z.doneData,source:A,filter:Boolean,target:r.eventBus.prepend(e=>({type:`step_enter`,step:e,experience:X}))}),(0,n.sample)({clock:_,target:J}),(0,n.sample)({source:J.doneData,fn:Boolean,target:F}),(0,n.sample)({source:w,clock:f,filter:e=>e?s(e):!0,target:G}),(0,n.sample)({source:F,filter:Boolean,target:f}),(0,n.sample)({source:F,filter:Boolean,target:r.eventBus.prepend(()=>({type:`experience_open`,experience:X}))}),(0,n.sample)({source:F,filter:e=>!e,target:r.eventBus.prepend(()=>({type:`experience_close`,experience:X}))}),(0,n.sample)({clock:g,target:[_]}),g(),X});function j(e){return(0,r.invoke)(A,e)}var M=(0,r.createFactory)(({client:e})=>{let r=k.store({}),i=(0,n.createEvent)(),a=(0,n.createEvent)(),o=(0,n.createEvent)(),s=(0,n.createApi)(r,{register(e,t){let n=[...e[t.experienceId]??[]];return n.push(t),{...e,[t.experienceId]:n}},unregister(e,t){let n=t.experienceId,r=e[n]?.filter(e=>e!==t);return{...e,[n]:r??[]}}}),c=(0,n.createEffect)(({experience:t,target:n,options:r})=>j({client:e,experience:t,target:n,options:r})),l=(0,n.createEffect)(e=>{s.register(e)}),u=(0,n.createEffect)(e=>{e.target&&t.o(e.target,()=>{o(e)})}),d=(0,n.createEffect)(e=>{s.unregister(e)}),f=(0,n.createEffect)(async e=>{await e.mountFx()});(0,n.sample)({clock:i,target:c}),(0,n.sample)({clock:o,target:d}),(0,n.sample)({clock:c.doneData,target:[l,u,a]}),(0,n.sample)({clock:c.doneData,target:e.eventBus.prepend(e=>({type:`experience_initialize`,experience:e}))}),(0,n.sample)({clock:a,target:f});function p(e,t,n){i({experience:e,target:t,options:n})}let m=r.map(e=>Object.values(e).flat());function h(e){return m.map(t=>t.filter(t=>t.experienceKey===e),{skipVoid:!1})}function g(e){return r.map(t=>t[e]||[],{skipVoid:!1})}return{spawn:p,getByExperienceKey:h,getByExperienceId:g,listStore:m}});function N(e){return(0,r.invoke)(M,e)}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return j}});
|
package/dist/id-Cg7fVl1O.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={},t=0,n=n=>(e[n]||(e[n]=`${(t++).toString(36)}`),`${e[n]}:${(t++).toString(36)}`);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
package/dist/logger-fbvQC40v.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=(e,...t)=>{};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./object-ThO1DEyl.cjs`);function t(t){return!e.t(t)}async function n(e,t,n){return await e.evaluateRuleLogicFx({rule:t,context:n})}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|