@picked/client 0.0.62-next.11 → 0.0.62-next.2
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-C-Q9t21v.cjs +1 -0
- package/dist/{api-C6HQ65g9.js → api-Cfb-8mqu.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/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/single-page-app/index.js +1 -1
- package/dist/cjs/plugins/web-components/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/docs/image-optimisation-service.md +6 -6
- package/dist/docs/sdk/content-security-policy.md +7 -8
- package/dist/docs/sdk/fields.md +2 -2
- package/dist/docs/workspaces.mdx +1 -1
- package/dist/esm/form/index.js +1 -1
- package/dist/esm/index.js +472 -1015
- package/dist/esm/plugins/create-experience/index.js +1 -1
- package/dist/esm/plugins/dynamic-experiences/index.js +60 -133
- package/dist/esm/plugins/experience-browser-storage/index.js +6 -9
- package/dist/esm/plugins/history-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
- package/dist/esm/plugins/single-page-app/index.js +1 -1
- package/dist/esm/plugins/web-components/index.js +1 -1
- package/dist/esm/server/index.js +13 -23
- package/dist/experience-instance-DC2gKwA6.cjs +1 -0
- package/dist/experience-instance-DJaNc5Ob.js +486 -0
- package/dist/rules-logic-BTIxfrJJ.js +240 -0
- package/dist/rules-logic-DNLOv90w.cjs +1 -0
- package/dist/types/entities/action/action.d.ts +3 -6
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/component/component.d.ts +2 -39
- package/dist/types/entities/component/component.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts +113 -69
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +2 -17
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts +2 -26
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/framework/framework.d.ts +3 -24
- package/dist/types/entities/framework/framework.d.ts.map +1 -1
- package/dist/types/entities/plugin/plugin.d.ts +1 -32
- package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
- package/dist/types/entities/predicate/predicate.d.ts +3 -24
- package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
- package/dist/types/entities/step/step.d.ts +2 -17
- package/dist/types/entities/step/step.d.ts.map +1 -1
- package/dist/types/exports.d.ts +4 -8
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic-engine.d.ts +1 -1
- package/dist/types/logic-engine.d.ts.map +1 -1
- package/dist/types/picked.d.ts +186 -141
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts +1 -2
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +1 -18
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +1 -63
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/web-components/plugin.d.ts.map +1 -1
- package/dist/types/server/index.d.ts +0 -7
- package/dist/types/server/index.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +1 -1
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/rules-logic.d.ts +9 -4
- package/dist/types/utils/rules-logic.d.ts.map +1 -1
- package/dist/types/utils/state-snaphot.d.ts +26 -0
- package/dist/types/utils/state-snaphot.d.ts.map +1 -0
- package/dist/types/utils/user-session.d.ts +12 -0
- package/dist/types/utils/user-session.d.ts.map +1 -0
- package/package.json +2 -12
- package/dist/api-v323-Asd.cjs +0 -1
- package/dist/cjs/plugins/dom-observer/index.js +0 -1
- package/dist/dom-C3C6Fmwz.cjs +0 -1
- package/dist/dom-DGePXPpM.js +0 -84
- package/dist/esm/plugins/dom-observer/index.js +0 -87
- package/dist/experience-instance-DImym3m_.js +0 -419
- package/dist/experience-instance-DygAdzbn.cjs +0 -1
- package/dist/rules-logic-D_CVBuv7.js +0 -13
- package/dist/rules-logic-H6P8xwHF.cjs +0 -1
- package/dist/types/entities/content/content.d.ts +0 -37
- package/dist/types/entities/content/content.d.ts.map +0 -1
- package/dist/types/entities/session/session.d.ts +0 -45
- package/dist/types/entities/session/session.d.ts.map +0 -1
- package/dist/types/lifecycle/lifecycle.d.ts +0 -47
- package/dist/types/lifecycle/lifecycle.d.ts.map +0 -1
- package/dist/types/lifecycle/rules-logic.d.ts +0 -24
- package/dist/types/lifecycle/rules-logic.d.ts.map +0 -1
- package/dist/types/lifecycle/state-snapshot.d.ts +0 -37
- package/dist/types/lifecycle/state-snapshot.d.ts.map +0 -1
- package/dist/types/plugins/dom-observer/index.d.ts +0 -3
- package/dist/types/plugins/dom-observer/index.d.ts.map +0 -1
- package/dist/types/plugins/dom-observer/plugin.d.ts +0 -50
- package/dist/types/plugins/dom-observer/plugin.d.ts.map +0 -1
- /package/dist/{id-Cg7fVl1O.cjs → id-Bv44ilEo.cjs} +0 -0
- /package/dist/{id-n2yrHvNo.js → id-CRqy981z.js} +0 -0
- /package/dist/{object-DvUDOytC.js → object-C82v79xc.js} +0 -0
- /package/dist/{object-ThO1DEyl.cjs → object-CUJOjanb.cjs} +0 -0
- /package/dist/{storage-hOHCCXvP.js → storage-6Xk0uAxB.js} +0 -0
- /package/dist/{storage-BXSlLTRa.cjs → storage-B6lQtc4-.cjs} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./object-CUJOjanb.cjs`);function t(e){return typeof e==`number`&&!isNaN(e)}function n(e){return typeof e==`string`}function r(e){return Array.isArray(e)}function i(e){return e instanceof Promise}function a(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.keys(e).length===1}function o(e){if(t(e))return e;let n=parseFloat(`${e}`);return isNaN(n)?0:n}function s(e){return`${e}`}var c={"==":(e,t)=>e==t,"===":(e,t)=>e===t,"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,">":(e,t)=>o(e)>o(t),">=":(e,t)=>o(e)>=o(t),"<":(e,t,n)=>{let r=o(e),i=o(t);if(n===void 0)return r<i;let a=o(n);return r<i&&i<a},"<=":(e,t,n)=>{let r=o(e),i=o(t);if(n===void 0)return r<=i;let a=o(n);return r<=i&&i<=a},"!!":async e=>await u(e),"!":async e=>!await u(e),"%":(e,t)=>o(e)%o(t),log:e=>(console.log(e),e),in:(e,t)=>t?n(t)?t.indexOf(s(e))!==-1:r(t)?t.includes(e):!1:!1,cat:(...e)=>e.map(s).join(``),substr:(e,t,n)=>{let r=s(e),i=o(t);if(n===void 0)return r.substr(i);let a=o(n);if(a<0){let e=r.substr(i);return e.substr(0,e.length+a)}return r.substr(i,a)},"+":(...e)=>e.reduce((e,t)=>o(e)+o(t),0),"*":(...e)=>e.reduce((e,t)=>o(e)*o(t),1),"-":(e,t)=>{let n=o(e);return t===void 0?-n:n-o(t)},"/":(e,t)=>o(e)/o(t),min:(...e)=>Math.min(...e.map(o)),max:(...e)=>Math.max(...e.map(o)),merge:(...e)=>e.reduce((e,t)=>r(t)?e.concat(t):e.concat([t]),[]),var(e,t){let n=arguments.length>1?t:null;if(e===``||e===`.`||e==null)return this;if(typeof e==`number`&&Array.isArray(this))return e>=0&&e<this.length?this[e]:n;let r=s(e);if(r===``||r===`.`)return this;let i=r.split(`.`),a=this;for(let e of i){if(a==null)return n;if(Array.isArray(a)){let t=parseInt(e,10);a=isNaN(t)?a[e]:a[t]}else a=a[e]}return a===void 0?n:a},async missing(...e){let t=r(e[0])?e[0]:e,n=[];for(let e of t){let t=await l({var:e},this);(t===null||t===``)&&n.push(`${e}`)}return n},async missing_some(e,t){let i=await l({missing:t},this);if(!r(i)||!r(t))return[];let a=i.filter(n);return t.filter(n).length-a.length>=o(e)?[]:a},invoke(...e){let[t,...n]=e;return typeof t==`function`?Reflect.apply(t,null,n):null},startsWith:(e,t)=>n(e)&&n(t)&&e.startsWith(t),endsWith:(e,t)=>n(e)&&n(t)&&e.endsWith(t),regexp_matches(e,t){let i=e,a=``;if(r(e)){let[t,n]=e;i=t,a=n}return!n(i)||!n(a)?!1:new RegExp(i,a).test(s(t))},throw(e){throw Error(s(e))}};async function l(e,t){if(!e)return e;if(i(e))return l(await e,t);if(r(e))return Promise.all(e.map(e=>l(e,t)));if(!a(e))return e;let n=d(e),o=n?e[n]??[]:[];switch(r(o)||(o=[o]),n){case`if`:case`?:`:for(let e=0;e<o.length-1;e+=2)if(await u(await l(o[e],t)))return l(o[e+1],t);return o.length%2==1?l(o[o.length-1],t):null;case`and`:{let e=null;for(let n of o)if(e=await l(n,t),!await u(e))return e;return e}case`or`:{let e=null;for(let n of o)if(e=await l(n,t),await u(e))return e;return e}case`map`:{let e=await l(o[0],t);return r(e)?await Promise.all(e.map(e=>l(o[1],e))):[]}case`filter`:{let e=await l(o[0],t);return r(e)?(await Promise.all(e.map(async e=>({item:e,shouldInclude:await u(await l(o[1],e))})))).filter(({shouldInclude:e})=>e).map(({item:e})=>e):[]}case`reduce`:{let e=await l(o[0],t);if(!r(e))return o.length>2?await l(o[2],t):null;let n=o[1],i=o.length>2?await l(o[2],t):null;for(let t of e)i=await l(n,{current:t,accumulator:i});return i}case`all`:{let e=await l(o[0],t);if(!r(e)||e.length===0)return!1;for(let t of e)if(!await u(await l(o[1],t)))return!1;return!0}case`some`:{let e=await l(o[0],t);if(!r(e))return!1;for(let t of e)if(await u(await l(o[1],t)))return!0;return!1}case`none`:{let e=await l(o[0],t);if(!r(e))return!0;for(let t of e)if(await u(await l(o[1],t)))return!1;return!0}case`catch`:try{return await l(o[0],t)}catch(e){return a(e)?await l(e,t):o[1]?await l(o[1],e):e instanceof Error?e.message:e}}let s=await Promise.all(o.map(e=>l(e,t))),f=n?c[n]:void 0;if(!f)throw Error(`Unrecognized operation ${n}`);return f.apply(t,s)}async function u(e){return i(e)?u(await e):!(Array.isArray(e)&&e.length===0)&&!!e}function d(e){return Object.keys(e)[0]}function f(t){return!e.t(t)}async function p(e,t,n){let r=e.getStateSnapshot(),i=e.predicates.listStore.getState().reduce((e,t)=>({...e,[t.name]:(...e)=>t.predicate({...r,args:e})}),{}),a=e.actions.listStore.getState().reduce((e,t)=>({...e,[t.key]:(...e)=>t.action({...r,args:e},null)}),{}),o=e.features.listStore.getState().reduce((e,t)=>({...e,[t.id]:async()=>{let{bucket:e}=await t.getBucket();return e}}),{});return await l(t,{responses:e.responses.getAllStore.getState(),location:typeof r.location==`object`?{hash:r.location.hash,host:r.location.host,hostname:r.location.hostname,href:r.location.href,origin:r.location.origin,pathname:r.location.pathname,port:r.location.port,protocol:r.location.protocol,search:r.location.search}:void 0,predicates:i,actions:a,features:o,...n})}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { StateSnapshot } from '../../
|
|
1
|
+
import { Store } from 'effector';
|
|
2
|
+
import { StateSnapshot } from '../../utils/state-snaphot';
|
|
3
3
|
import { Picked } from '../../picked';
|
|
4
4
|
import { ExperienceInstance } from '../experience-instance/experience-instance';
|
|
5
5
|
/**
|
|
@@ -40,10 +40,7 @@ export interface ActionIndexItem {
|
|
|
40
40
|
declare const createActionIndexFactory: ({ client }: {
|
|
41
41
|
client: Picked;
|
|
42
42
|
}) => {
|
|
43
|
-
register:
|
|
44
|
-
key: string;
|
|
45
|
-
action: Action;
|
|
46
|
-
}>;
|
|
43
|
+
register: (key: string, action: Action) => void;
|
|
47
44
|
getByKey: (key: string) => Store<Action | undefined>;
|
|
48
45
|
listStore: Store<ActionIndexItem[]>;
|
|
49
46
|
getEvokableAction: (actionKey: string, options?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/entities/action/action.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/entities/action/action.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,EAA8D,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAGjG,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACnF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAA;AAEpF;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,sEAAsE;IACtE,UAAU,EAAE,kBAAkB,CAAA;CAC/B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,MAAM,GAAG,CACnB,QAAQ,EAAE,aAAa,GAAG;IAAE,IAAI,EAAE,OAAO,EAAE,CAAA;CAAE,EAC7C,OAAO,EAAE,aAAa,GAAG,IAAI,KAE3B,OAAO,GACP,OAAO,CAAC,OAAO,CAAC,GAChB,MAAM,GACN,OAAO,CAAC,MAAM,CAAC,GACf,MAAM,EAAE,GACR,OAAO,CAAC,MAAM,EAAE,CAAC,GACjB,IAAI,GACJ,OAAO,CAAC,IAAI,CAAC,GACb,SAAS,CAAA;AAEb,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEtE,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;CACf;AAKD,QAAA,MAAM,wBAAwB,eAA8B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;oBA+BrD,MAAM,UAAU,MAAM,KAAG,IAAI;oBA2B7B,MAAM;;mCA2BhB,MAAM,YACP;QAAE,UAAU,EAAE,kBAAkB,CAAA;KAAE,KAC3C,KAAK,CAAC,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;CAyClC,CAAA;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC,CAAC,EACxF,MAAM,EAAE,CAAC,GACR,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAE7C;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,QAAQ,MAAM,EAAE,SAAS,YAAY,KAAG,IAEhF,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Store } from 'effector';
|
|
2
2
|
import { Picked } from '../../picked';
|
|
3
3
|
import { LazyComponentLoader } from './lazyComponent';
|
|
4
4
|
export interface AdaptedComponentStyle {
|
|
@@ -32,25 +32,11 @@ declare const createComponentFactory: ({ client, component, name }: {
|
|
|
32
32
|
component: AdaptedComponent<string, unknown>;
|
|
33
33
|
frameworkStore: Store<import('../..').Framework | undefined>;
|
|
34
34
|
};
|
|
35
|
-
/**
|
|
36
|
-
* Creates a component with framework-specific metadata and loader.
|
|
37
|
-
*
|
|
38
|
-
* @template T - Factory parameter type.
|
|
39
|
-
* @param params - The client, component name, and adapted component.
|
|
40
|
-
* @returns A component with name, component, and frameworkStore.
|
|
41
|
-
* @example
|
|
42
|
-
* ```ts
|
|
43
|
-
* const component = createComponent({ client, name: 'experience', component: adaptedComp })
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
35
|
export declare function createComponent<T extends Parameters<typeof createComponentFactory>[0]>(params: T): ReturnType<typeof createComponentFactory>;
|
|
47
36
|
declare const createComponentIndexFactory: ({ client }: {
|
|
48
37
|
client: Picked;
|
|
49
38
|
}) => {
|
|
50
|
-
register:
|
|
51
|
-
name: string;
|
|
52
|
-
component: AdaptedComponent;
|
|
53
|
-
}>;
|
|
39
|
+
register: (name: string, component: AdaptedComponent) => void;
|
|
54
40
|
getByName: (name: string) => Store<{
|
|
55
41
|
name: string;
|
|
56
42
|
component: AdaptedComponent;
|
|
@@ -61,30 +47,7 @@ declare const createComponentIndexFactory: ({ client }: {
|
|
|
61
47
|
frameworkStore: Store<import('../..').Framework | undefined>;
|
|
62
48
|
}[]>;
|
|
63
49
|
};
|
|
64
|
-
/**
|
|
65
|
-
* Creates a component index with lifecycle stores and registration logic.
|
|
66
|
-
*
|
|
67
|
-
* @template T - Factory parameter type.
|
|
68
|
-
* @param {T} params - Factory parameters including the client.
|
|
69
|
-
* @returns {ReturnType<typeof createComponentIndexFactory>} The component index with register, getByName, and listStore methods.
|
|
70
|
-
* @example
|
|
71
|
-
* ```ts
|
|
72
|
-
* const components = createComponentIndex({ client })
|
|
73
|
-
* components.register('experience', adaptedComponent)
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
50
|
export declare function createComponentIndex<T extends Parameters<typeof createComponentIndexFactory>[0]>(params: T): ReturnType<typeof createComponentIndexFactory>;
|
|
77
|
-
/**
|
|
78
|
-
* Convenience helper that registers a single component on the given index.
|
|
79
|
-
*
|
|
80
|
-
* @param {string} name - Unique name for the component.
|
|
81
|
-
* @param {AdaptedComponent} component - The adapted component to register.
|
|
82
|
-
* @param {ComponentIndex} components - The component index to register into.
|
|
83
|
-
* @example
|
|
84
|
-
* ```ts
|
|
85
|
-
* setupComponent('experience', adaptedComponent, componentsIndex)
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
51
|
export declare const setupComponent: (name: string, component: AdaptedComponent, components: ComponentIndex) => void;
|
|
89
52
|
export {};
|
|
90
53
|
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/entities/component/component.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/entities/component/component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAIrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAE1D,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAA;CACf;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,OAAO;IAC1E,aAAa,EAAE,CAAC,CAAA;IAChB,SAAS,EAAE,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC,CAAA;KAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAC3D,KAAK,CAAC,EAAE,qBAAqB,CAAA;CAC9B;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,OAAO;IAC3E,aAAa,EAAE,CAAC,CAAA;IAChB,SAAS,EAAE,CAAC,CAAA;IACZ,KAAK,CAAC,EAAE,qBAAqB,CAAA;CAC9B;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,OAAO,IAC/D,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1B,qBAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAE/B,MAAM,WAAW,mBAAmB,CAAC,CAAC,GAAG,gBAAgB,CAAC,MAAM,CAAC;IAC/D,UAAU,EAAE,CAAC,CAAA;CACd;AAED,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACpE,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;AAI1D,QAAA,MAAM,sBAAsB,gCACI;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,gBAAgB,CAAA;CAAE;;;;CAS5F,CAAA;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,EACpF,MAAM,EAAE,CAAC,GACR,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAE3C;AAED,QAAA,MAAM,2BAA2B,eAA8B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;qBAcvD,MAAM,aAAa,gBAAgB,KAAG,IAAI;sBAkBzC,MAAM,KAAG,KAAK,CACnC;QACE,IAAI,EAAE,MAAM,CAAA;QACZ,SAAS,EAAE,gBAAgB,CAAA;KAC5B,GACD,SAAS,CACZ;;;;;;CASD,CAAA;AAEF,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC,CAAC,CAAC,EAC9F,MAAM,EAAE,CAAC,GACR,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAEhD;AAED,eAAO,MAAM,cAAc,GACzB,MAAM,MAAM,EACZ,WAAW,gBAAgB,EAC3B,YAAY,cAAc,KACzB,IAEF,CAAA"}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Store } from 'effector';
|
|
2
2
|
import { AdaptedComponent } from '../component/component';
|
|
3
3
|
import { Condition } from '../condition/condition';
|
|
4
4
|
import { ExperienceStep } from '../step/step';
|
|
5
|
-
import { Framework } from '../framework/framework';
|
|
6
5
|
import { Picked } from '../../picked';
|
|
7
6
|
import { LogicRule, LogicValue } from '../../logic-engine';
|
|
8
7
|
export type ExperiencesListStore = ReturnType<typeof createExperienceIndex>;
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
export type ExperienceStore = ReturnType<typeof createExperience>;
|
|
9
|
+
declare const createExperienceFactory: ({ client, experience }: {
|
|
10
|
+
client: Picked;
|
|
11
|
+
experience: Experience;
|
|
12
|
+
}) => {
|
|
11
13
|
id: string;
|
|
12
14
|
key: string;
|
|
13
15
|
name: string;
|
|
14
16
|
configStore: Store<{
|
|
15
17
|
name: string;
|
|
16
|
-
decisionLogic
|
|
18
|
+
decisionLogic: LogicValue | LogicRule;
|
|
17
19
|
targetSelectors: ExperienceTarget[];
|
|
18
|
-
initializeOpenLogic
|
|
20
|
+
initializeOpenLogic: LogicValue | LogicRule;
|
|
19
21
|
}>;
|
|
20
22
|
treeStore: Store<{
|
|
21
23
|
steps: ExperienceStep[];
|
|
@@ -25,64 +27,26 @@ export interface ExperienceStore {
|
|
|
25
27
|
}>;
|
|
26
28
|
componentStore: Store<{
|
|
27
29
|
name: string;
|
|
28
|
-
component: AdaptedComponent
|
|
29
|
-
frameworkStore: Store<Framework | undefined>;
|
|
30
|
+
component: AdaptedComponent<string, unknown>;
|
|
31
|
+
frameworkStore: Store<import('../..').Framework | undefined>;
|
|
30
32
|
} | undefined>;
|
|
31
33
|
actions: ExperienceAction[];
|
|
32
|
-
|
|
33
|
-
merge: (payload: {
|
|
34
|
+
merge: import('effector').EventCallable<{
|
|
34
35
|
experience: Partial<Experience>;
|
|
35
|
-
strategy:
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
* Per-experience initialise effect. Attaches over `configStore` and spawns one
|
|
39
|
-
* instance per matched DOM target.
|
|
40
|
-
*/
|
|
41
|
-
initialiseFx: Effect<LaunchExperienceOptions | undefined, void, Error>;
|
|
42
|
-
/**
|
|
43
|
-
* Per-experience gate evaluation effect. Attaches over `client.preconditionPassedStore`,
|
|
44
|
-
* the session's `isUser` slice, and `configStore`. Returns true when the experience
|
|
45
|
-
* should be initialised.
|
|
46
|
-
*/
|
|
47
|
-
shouldInitialiseFx: Effect<void, boolean, Error>;
|
|
48
|
-
/**
|
|
49
|
-
* Public event — requests initialisation, gated by `shouldInitialiseFx`. When the
|
|
50
|
-
* gate passes, the sample graph fires `prepareExperienceContentFx` and `initialiseFx`
|
|
51
|
-
* in parallel so content loading does not delay initialisation.
|
|
52
|
-
*/
|
|
53
|
-
initialiseRequested: EventCallable<LaunchExperienceOptions | undefined>;
|
|
54
|
-
/**
|
|
55
|
-
* Public event — requests initialisation directly, bypassing the `shouldInitialiseFx`
|
|
56
|
-
* gate. Fires `prepareExperienceContentFx` and `initialiseFx` in parallel.
|
|
57
|
-
*/
|
|
58
|
-
initialiseDirectly: EventCallable<LaunchExperienceOptions | undefined>;
|
|
59
|
-
/**
|
|
60
|
-
* Prepares per-experience CMS content by calling `client.contentLoader` and
|
|
61
|
-
* registering returned blobs into `client.contents`. Driven by the sample graph
|
|
62
|
-
* on `initialiseRequested`/`initialiseDirectly`; can also be called directly for
|
|
63
|
-
* speculative prefetch (e.g. Visibility-driven warm-up). Failure-tolerant:
|
|
64
|
-
* always resolves `true` even when the loader rejects, so initialisation is
|
|
65
|
-
* never blocked by content failures.
|
|
66
|
-
*/
|
|
67
|
-
prepareExperienceContentFx: Effect<void, boolean, Error>;
|
|
68
|
-
}
|
|
36
|
+
strategy: "override";
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
69
39
|
/**
|
|
70
40
|
* Creates an Effector store for a single experience.
|
|
71
41
|
*
|
|
72
|
-
* @
|
|
73
|
-
* @
|
|
74
|
-
* @param {Picked} params.client - The Picked client instance the experience is bound to.
|
|
75
|
-
* @param {Experience} params.experience - The experience definition to wrap in stores and effects.
|
|
76
|
-
* @returns {ReturnType<typeof createExperienceFactory>} An experience store with config, tree, fields, and component sub-stores.
|
|
42
|
+
* @param params - The client instance and experience data.
|
|
43
|
+
* @returns An experience store with config, tree, fields, and component sub-stores.
|
|
77
44
|
* @example
|
|
78
45
|
* ```typescript
|
|
79
46
|
* const store = createExperience({ client, experience })
|
|
80
47
|
* ```
|
|
81
48
|
*/
|
|
82
|
-
export declare function createExperience(params:
|
|
83
|
-
client: Picked;
|
|
84
|
-
experience: Experience;
|
|
85
|
-
}): ExperienceStore;
|
|
49
|
+
export declare function createExperience<T extends Parameters<typeof createExperienceFactory>[0]>(params: T): ReturnType<typeof createExperienceFactory>;
|
|
86
50
|
/** Options for launching an experience. */
|
|
87
51
|
export interface LaunchExperienceOptions {
|
|
88
52
|
/** When true, the experience will be opened immediately after initialization. */
|
|
@@ -96,15 +60,67 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
96
60
|
client: Picked;
|
|
97
61
|
}) => {
|
|
98
62
|
/** Registers an experience in the index. If an experience with the same ID already exists, it is merged. */
|
|
99
|
-
register:
|
|
63
|
+
register: (experience: Experience) => void;
|
|
100
64
|
/** Returns a derived store for an experience by its ID. The store value is `undefined` when no match exists. */
|
|
101
|
-
get: (id: Experience["id"]) => Store<
|
|
65
|
+
get: (id: Experience["id"]) => Store<{
|
|
66
|
+
id: string;
|
|
67
|
+
key: string;
|
|
68
|
+
name: string;
|
|
69
|
+
configStore: Store<{
|
|
70
|
+
name: string;
|
|
71
|
+
decisionLogic: LogicValue | LogicRule;
|
|
72
|
+
targetSelectors: ExperienceTarget[];
|
|
73
|
+
initializeOpenLogic: LogicValue | LogicRule;
|
|
74
|
+
}>;
|
|
75
|
+
treeStore: Store<{
|
|
76
|
+
steps: ExperienceStep[];
|
|
77
|
+
nodes: ExperienceNode[];
|
|
78
|
+
edges: ExperienceEdge[];
|
|
79
|
+
conditions: Condition[];
|
|
80
|
+
}>;
|
|
81
|
+
componentStore: Store<{
|
|
82
|
+
name: string;
|
|
83
|
+
component: AdaptedComponent<string, unknown>;
|
|
84
|
+
frameworkStore: Store<import('../..').Framework | undefined>;
|
|
85
|
+
} | undefined>;
|
|
86
|
+
actions: ExperienceAction[];
|
|
87
|
+
merge: import('effector').EventCallable<{
|
|
88
|
+
experience: Partial<Experience>;
|
|
89
|
+
strategy: "override";
|
|
90
|
+
}>;
|
|
91
|
+
} | undefined>;
|
|
102
92
|
/** @deprecated Use `experiences.get(id)` instead. */
|
|
103
|
-
getById: (id: Experience["id"]) => Store<
|
|
93
|
+
getById: (id: Experience["id"]) => Store<{
|
|
94
|
+
id: string;
|
|
95
|
+
key: string;
|
|
96
|
+
name: string;
|
|
97
|
+
configStore: Store<{
|
|
98
|
+
name: string;
|
|
99
|
+
decisionLogic: LogicValue | LogicRule;
|
|
100
|
+
targetSelectors: ExperienceTarget[];
|
|
101
|
+
initializeOpenLogic: LogicValue | LogicRule;
|
|
102
|
+
}>;
|
|
103
|
+
treeStore: Store<{
|
|
104
|
+
steps: ExperienceStep[];
|
|
105
|
+
nodes: ExperienceNode[];
|
|
106
|
+
edges: ExperienceEdge[];
|
|
107
|
+
conditions: Condition[];
|
|
108
|
+
}>;
|
|
109
|
+
componentStore: Store<{
|
|
110
|
+
name: string;
|
|
111
|
+
component: AdaptedComponent<string, unknown>;
|
|
112
|
+
frameworkStore: Store<import('../..').Framework | undefined>;
|
|
113
|
+
} | undefined>;
|
|
114
|
+
actions: ExperienceAction[];
|
|
115
|
+
merge: import('effector').EventCallable<{
|
|
116
|
+
experience: Partial<Experience>;
|
|
117
|
+
strategy: "override";
|
|
118
|
+
}>;
|
|
119
|
+
} | undefined>;
|
|
104
120
|
/** Returns a derived store for an experience by its key. The store value is `undefined` when no match exists. */
|
|
105
121
|
getByKey: (key: Experience["key"]) => Store<ExperienceStore | undefined>;
|
|
106
122
|
/** Effector effect that launches an experience by its key. */
|
|
107
|
-
launch: Effect<{
|
|
123
|
+
launch: import('effector').Effect<{
|
|
108
124
|
key: string;
|
|
109
125
|
options?: LaunchExperienceOptions;
|
|
110
126
|
} | {
|
|
@@ -112,7 +128,7 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
112
128
|
options?: LaunchExperienceOptions;
|
|
113
129
|
}, void, Error>;
|
|
114
130
|
/** Effector effect that opens an experience's existing instances, or launches it with `initialiseOpen` if none exist. */
|
|
115
|
-
open: Effect<{
|
|
131
|
+
open: import('effector').Effect<{
|
|
116
132
|
key: string;
|
|
117
133
|
options?: OpenExperienceOptions;
|
|
118
134
|
} | {
|
|
@@ -120,16 +136,39 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
120
136
|
options?: OpenExperienceOptions;
|
|
121
137
|
}, void, Error>;
|
|
122
138
|
/** Derived store containing all registered experiences as an array. */
|
|
123
|
-
listStore: Store<
|
|
124
|
-
|
|
125
|
-
|
|
139
|
+
listStore: Store<{
|
|
140
|
+
id: string;
|
|
141
|
+
key: string;
|
|
142
|
+
name: string;
|
|
143
|
+
configStore: Store<{
|
|
144
|
+
name: string;
|
|
145
|
+
decisionLogic: LogicValue | LogicRule;
|
|
146
|
+
targetSelectors: ExperienceTarget[];
|
|
147
|
+
initializeOpenLogic: LogicValue | LogicRule;
|
|
148
|
+
}>;
|
|
149
|
+
treeStore: Store<{
|
|
150
|
+
steps: ExperienceStep[];
|
|
151
|
+
nodes: ExperienceNode[];
|
|
152
|
+
edges: ExperienceEdge[];
|
|
153
|
+
conditions: Condition[];
|
|
154
|
+
}>;
|
|
155
|
+
componentStore: Store<{
|
|
156
|
+
name: string;
|
|
157
|
+
component: AdaptedComponent<string, unknown>;
|
|
158
|
+
frameworkStore: Store<import('../..').Framework | undefined>;
|
|
159
|
+
} | undefined>;
|
|
160
|
+
actions: ExperienceAction[];
|
|
161
|
+
merge: import('effector').EventCallable<{
|
|
162
|
+
experience: Partial<Experience>;
|
|
163
|
+
strategy: "override";
|
|
164
|
+
}>;
|
|
165
|
+
}[]>;
|
|
126
166
|
};
|
|
127
167
|
/**
|
|
128
168
|
* Creates an Effector-based index for registering and retrieving experiences.
|
|
129
169
|
*
|
|
130
|
-
* @
|
|
131
|
-
* @
|
|
132
|
-
* @returns {ReturnType<typeof createExperienceIndexFactory>} An experience index with register, getById, getByKey, launch, and open methods.
|
|
170
|
+
* @param params - The client instance.
|
|
171
|
+
* @returns An experience index with register, getById, getByKey, launch, and open methods.
|
|
133
172
|
* @example
|
|
134
173
|
* ```typescript
|
|
135
174
|
* const index = createExperienceIndex({ client })
|
|
@@ -195,17 +234,22 @@ export interface Experience {
|
|
|
195
234
|
targets: ExperienceTarget[];
|
|
196
235
|
}
|
|
197
236
|
/**
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
237
|
+
* Initializes an experience for each target that exists in the DOM.
|
|
238
|
+
*
|
|
239
|
+
* @param client - The Picked client instance.
|
|
240
|
+
* @param experience - The experience store to initialise.
|
|
241
|
+
*/
|
|
242
|
+
export declare const initialiseExperience: (client: Picked, experience: ExperienceStore, options?: LaunchExperienceOptions) => void;
|
|
243
|
+
/**
|
|
244
|
+
* Conditionally initializes experiences.
|
|
201
245
|
*
|
|
202
|
-
* @param
|
|
203
|
-
* @returns {Promise<void>} Resolves when all per-experience initialisations settle.
|
|
246
|
+
* @param client - The Picked client instance.
|
|
204
247
|
* @example
|
|
205
248
|
* ```typescript
|
|
206
249
|
* await initialiseExperiences(client)
|
|
207
250
|
* ```
|
|
208
251
|
*/
|
|
209
252
|
export declare const initialiseExperiences: (client: Picked) => Promise<void>;
|
|
253
|
+
export declare const shouldInitialiseExperience: (client: Picked, experience: ExperienceStore) => Promise<boolean>;
|
|
210
254
|
export {};
|
|
211
255
|
//# sourceMappingURL=experience.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experience.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience/experience.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,OAAO,
|
|
1
|
+
{"version":3,"file":"experience.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience/experience.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,OAAO,EAA4C,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAE/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,M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QAAQ,MAAM,EACd,YAAY,eAAe,EAC3B,UAAU,uBAAuB,SAkBlC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAAU,QAAQ,MAAM,kBASzD,CAAA;AAmBD,eAAO,MAAM,0BAA0B,GACrC,QAAQ,MAAM,EACd,YAAY,eAAe,KAC1B,OAAO,CAAC,OAAO,CAiCjB,CAAA"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EventCallable, Store } from 'effector';
|
|
2
2
|
import { Experience, ExperienceNode, ExperienceStore, ExperienceTarget, LaunchExperienceOptions } from '../experience/experience';
|
|
3
|
-
import { Component } from '../component/component';
|
|
4
|
-
import { Framework } from '../framework/framework';
|
|
5
3
|
import { ExperienceStep } from '../step/step';
|
|
6
4
|
import { Picked } from '../../picked';
|
|
7
5
|
import { HistoryEntry } from '../history/history';
|
|
@@ -9,18 +7,9 @@ export interface ExperienceInstance {
|
|
|
9
7
|
id: string;
|
|
10
8
|
experienceKey: Experience['key'];
|
|
11
9
|
experienceId: Experience['id'];
|
|
12
|
-
/** Static name snapshot captured at spawn time. Use `configStore` for the latest (reactive) value. */
|
|
13
|
-
experienceName: string;
|
|
14
10
|
configStore: ExperienceStore['configStore'];
|
|
15
11
|
target: HTMLElement | undefined;
|
|
16
12
|
componentStore: ExperienceStore['componentStore'];
|
|
17
|
-
/**
|
|
18
|
-
* Reactive store of the resolved `{ component, framework }` pair for this instance, derived via `combine` over the instance's `componentStore` and `client.frameworks.listStore`. Resolves to `null` when either side is missing.
|
|
19
|
-
*/
|
|
20
|
-
componentAndFrameworkStore: Store<{
|
|
21
|
-
component: Component;
|
|
22
|
-
framework: Framework;
|
|
23
|
-
} | null>;
|
|
24
13
|
stateStore: Store<'transitioning' | 'ready'>;
|
|
25
14
|
isOpenStore: Store<boolean>;
|
|
26
15
|
open: EventCallable<void>;
|
|
@@ -38,10 +27,6 @@ export interface ExperienceInstance {
|
|
|
38
27
|
goToPreviousStep: EventCallable<void>;
|
|
39
28
|
goToStepById: EventCallable<string>;
|
|
40
29
|
stepsHistoryStore: Store<HistoryEntry[]>;
|
|
41
|
-
/**
|
|
42
|
-
* Per-instance mount effect. Attached over `componentAndFrameworkStore` so the render call always receives the current resolved component+framework pair.
|
|
43
|
-
*/
|
|
44
|
-
mountFx: Effect<void, void, Error>;
|
|
45
30
|
}
|
|
46
31
|
export type ExperienceInstanceIndex = ReturnType<typeof createExperienceInstanceIndex>;
|
|
47
32
|
export interface ExperienceInstanceTarget {
|
|
@@ -53,7 +38,7 @@ declare const createExperienceInstanceFactory: ({ client, experience, target, op
|
|
|
53
38
|
experience: ExperienceStore;
|
|
54
39
|
target?: HTMLElement;
|
|
55
40
|
options?: LaunchExperienceOptions;
|
|
56
|
-
}) => ExperienceInstance
|
|
41
|
+
}) => Readonly<ExperienceInstance>;
|
|
57
42
|
/**
|
|
58
43
|
* Creates an experience instance with lifecycle stores and navigation logic.
|
|
59
44
|
*
|
|
@@ -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,
|
|
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,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,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAiB1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAItD,MAA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AuB,GAAG,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAA;AACtF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,WAAW,EAAE,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,iCAgdF,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;wBA0J1E,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,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Store } from 'effector';
|
|
2
2
|
import { Picked } from '../../picked';
|
|
3
3
|
export interface Feature {
|
|
4
4
|
key: string;
|
|
@@ -42,37 +42,13 @@ export type FeatureBucket = UnresolvedFeatureBucket | ResolvedFeatureBucket;
|
|
|
42
42
|
declare const createFeatureIndexFactory: ({ client }: {
|
|
43
43
|
client: Picked;
|
|
44
44
|
}) => {
|
|
45
|
-
register:
|
|
46
|
-
id: string;
|
|
47
|
-
feature: Feature;
|
|
48
|
-
}>;
|
|
45
|
+
register: (id: string, feature: Feature) => void;
|
|
49
46
|
getById: (id: string) => Store<FeatureBucket | undefined>;
|
|
50
47
|
getByName: (name: string) => Store<FeatureIndexItem | undefined>;
|
|
51
48
|
listStore: Store<FeatureBucket[]>;
|
|
52
49
|
getEvokableFeature: (featureName: string) => Store<() => Promise<boolean | string | undefined>>;
|
|
53
50
|
};
|
|
54
|
-
/**
|
|
55
|
-
* Creates a feature index with lifecycle stores and registration logic.
|
|
56
|
-
*
|
|
57
|
-
* @template T - Factory parameter type.
|
|
58
|
-
* @param {T} params - Factory parameters including the client.
|
|
59
|
-
* @returns {ReturnType<typeof createFeatureIndexFactory>} The feature index with register, getById, getByName, listStore, and getEvokableFeature methods.
|
|
60
|
-
* @example
|
|
61
|
-
* ```ts
|
|
62
|
-
* const features = createFeatureIndex({ client })
|
|
63
|
-
* features.register('test-feature-1', { key: 'test', name: 'Test Feature', decide: () => true })
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
51
|
export declare function createFeatureIndex<T extends Parameters<typeof createFeatureIndexFactory>[0]>(params: T): ReturnType<typeof createFeatureIndexFactory>;
|
|
67
|
-
/**
|
|
68
|
-
* Convenience helper that dispatches `features.register` with object-payload shape.
|
|
69
|
-
*
|
|
70
|
-
* @param {string} name - Feature id.
|
|
71
|
-
* @param {Feature} feature - The feature config.
|
|
72
|
-
* @param {FeaturesStore} features - The features index.
|
|
73
|
-
* @example
|
|
74
|
-
* setupFeature('winter-sale', { key: 'v1', name: 'Winter sale', decide: () => true }, featuresIndex)
|
|
75
|
-
*/
|
|
76
52
|
export declare const setupFeature: (name: string, feature: Feature, features: FeaturesStore) => void;
|
|
77
53
|
export {};
|
|
78
54
|
//# sourceMappingURL=feature.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../../../src/entities/feature/feature.ts"],"names":[],"mappings":"AAAA,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;;;;GAQG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAE7E"}
|
|
@@ -1,41 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Picked } from '../../picked';
|
|
2
2
|
import { AdaptedComponent } from '../component/component';
|
|
3
3
|
import { ExperienceInstance } from '../experience-instance/experience-instance';
|
|
4
|
-
import { Picked } from '../../picked';
|
|
5
4
|
export type FrameworksStore = ReturnType<typeof createFrameworkIndex>;
|
|
6
5
|
export interface Framework {
|
|
7
6
|
name: string;
|
|
8
7
|
render: FrameworkRender;
|
|
9
8
|
}
|
|
10
|
-
declare const createFrameworkIndexFactory: (
|
|
9
|
+
declare const createFrameworkIndexFactory: ({ client }: {
|
|
11
10
|
client: Picked;
|
|
12
11
|
}) => {
|
|
13
|
-
register:
|
|
14
|
-
name: string;
|
|
15
|
-
framework: Framework;
|
|
16
|
-
}>;
|
|
12
|
+
register: (name: string, framework: Framework) => void;
|
|
17
13
|
getByName: (name: string) => import('effector').Store<Framework | undefined>;
|
|
18
14
|
listStore: import('effector').Store<Framework[]>;
|
|
19
15
|
};
|
|
20
|
-
/**
|
|
21
|
-
* Creates a framework index with stores and registration logic.
|
|
22
|
-
*
|
|
23
|
-
* @template T - Factory parameter type.
|
|
24
|
-
* @param {T} params - Factory parameters including the client.
|
|
25
|
-
* @returns {ReturnType<typeof createFrameworkIndexFactory>} The framework index.
|
|
26
|
-
* @example
|
|
27
|
-
* const frameworks = createFrameworkIndex({ client })
|
|
28
|
-
*/
|
|
29
16
|
export declare function createFrameworkIndex<T extends Parameters<typeof createFrameworkIndexFactory>[0]>(params: T): ReturnType<typeof createFrameworkIndexFactory>;
|
|
30
17
|
export type FrameworkRender = (shadowRoot: ShadowRoot, component: AdaptedComponent, client: Picked, experience: ExperienceInstance) => void;
|
|
31
|
-
/**
|
|
32
|
-
* Convenience helper that dispatches `frameworks.register` with object-payload shape.
|
|
33
|
-
*
|
|
34
|
-
* @param {Framework} framework - The framework to register.
|
|
35
|
-
* @param {FrameworksStore} frameworks - The frameworks index.
|
|
36
|
-
* @example
|
|
37
|
-
* setupFramework({ name: 'react', render: renderFn }, frameworksIndex)
|
|
38
|
-
*/
|
|
39
18
|
export declare const setupFramework: (framework: Framework, frameworks: FrameworksStore) => void;
|
|
40
19
|
export {};
|
|
41
20
|
//# sourceMappingURL=framework.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework.d.ts","sourceRoot":"","sources":["../../../../src/entities/framework/framework.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"framework.d.ts","sourceRoot":"","sources":["../../../../src/entities/framework/framework.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAA;AAEpF,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAIrE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,eAAe,CAAA;CACxB;AAGD,QAAA,MAAM,2BAA2B,eAA8B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;qBAcvD,MAAM,aAAa,SAAS,KAAG,IAAI;sBAiBlC,MAAM;;CAS/B,CAAA;AAEF,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC,CAAC,CAAC,EAC9F,MAAM,EAAE,CAAC,GACR,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAEhD;AAED,MAAM,MAAM,eAAe,GAAG,CAC5B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,gBAAgB,EAC3B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,kBAAkB,KAC3B,IAAI,CAAA;AAET,eAAO,MAAM,cAAc,GAAI,WAAW,SAAS,EAAE,YAAY,eAAe,KAAG,IAElF,CAAA"}
|
|
@@ -1,45 +1,14 @@
|
|
|
1
|
-
import { Effect } from 'effector';
|
|
2
1
|
import { Picked } from '../../picked';
|
|
3
2
|
export interface Plugin {
|
|
4
3
|
name: string;
|
|
5
4
|
setup: (client: Picked) => void | PluginConfig;
|
|
6
5
|
}
|
|
7
6
|
export interface PluginConfig {
|
|
8
|
-
|
|
9
|
-
onStart?: Effect<void, void, Error>;
|
|
7
|
+
onStart?: () => void | Promise<void>;
|
|
10
8
|
[key: string]: unknown;
|
|
11
9
|
}
|
|
12
10
|
export interface PluginConfigIndex {
|
|
13
11
|
[key: string]: PluginConfig;
|
|
14
12
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Wraps a plain async handler as an effector Effect for use as a plugin onStart hook.
|
|
17
|
-
*
|
|
18
|
-
* @param {() => void | Promise<void>} handler - The function to execute when the plugin starts. May be sync or return a Promise.
|
|
19
|
-
* @returns {Effect<void, void, Error>} An Effect that runs the handler.
|
|
20
|
-
* @example
|
|
21
|
-
* ```typescript
|
|
22
|
-
* const myPlugin: Plugin = {
|
|
23
|
-
* name: 'my-plugin',
|
|
24
|
-
* setup: () => ({
|
|
25
|
-
* onStart: createPluginEffect(async () => {
|
|
26
|
-
* await fetch('/init')
|
|
27
|
-
* }),
|
|
28
|
-
* }),
|
|
29
|
-
* }
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export declare function createPluginEffect(handler: () => void | Promise<void>): Effect<void, void, Error>;
|
|
33
|
-
/**
|
|
34
|
-
* Registers a plugin with the client by calling its setup hook and merging any returned config into the plugin index.
|
|
35
|
-
*
|
|
36
|
-
* @param {Picked} client - The Picked client instance.
|
|
37
|
-
* @param {Plugin} plugin - The plugin to register.
|
|
38
|
-
* @param {PluginConfigIndex} plugins - The plugin config index to mutate.
|
|
39
|
-
* @example
|
|
40
|
-
* ```typescript
|
|
41
|
-
* setupPlugin(client, myPlugin, this.plugins)
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
13
|
export declare const setupPlugin: (client: Picked, plugin: Plugin, plugins: PluginConfigIndex) => void;
|
|
45
14
|
//# sourceMappingURL=plugin.d.ts.map
|