@picked/react 0.0.1-dev.1783642866820 → 0.0.1-dev.1784003142683

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.
@@ -21,5 +21,6 @@ interface ExperienceHostProps {
21
21
  * <ExperienceHost experience={experienceStore} client={client} />
22
22
  */
23
23
  declare function ExperienceHost({ experience, client }: ExperienceHostProps): React.JSX.Element | null;
24
- export default ExperienceHost;
24
+ declare const MemoisedExperienceHost: React.MemoExoticComponent<typeof ExperienceHost>;
25
+ export default MemoisedExperienceHost;
25
26
  //# sourceMappingURL=ExperienceHost.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExperienceHost.d.ts","sourceRoot":"","sources":["../../src/experience/ExperienceHost.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAA+C,MAAM,OAAO,CAAA;AAEnE,OAAO,KAAK,EAAsB,eAAe,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAOjF,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAA;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAiBD;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,cAAc,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,mBAAmB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAyD7F;AAED,eAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"ExperienceHost.d.ts","sourceRoot":"","sources":["../../src/experience/ExperienceHost.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAA+C,MAAM,OAAO,CAAA;AAEnE,OAAO,KAAK,EAAsB,eAAe,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAOjF,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAA;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAiBD;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,cAAc,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,mBAAmB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAyD7F;AAED,QAAA,MAAM,sBAAsB,kDAA6B,CAAA;AAGzD,eAAe,sBAAsB,CAAA"}
@@ -1 +1 @@
1
- import{isValidAdaptedComponent as e}from"../component.js";import{ExperienceProvider as t}from"../context.js";import{useStoreGlobal as n}from"../hooks/use-store-global.js";import r,{Suspense as i,useEffect as a,useMemo as o,useRef as s}from"react";import{isLazyLoader as c,supportsWindow as l}from"@picked/client";import{createExperienceInstance as u}from"@picked/client/server";import{jsx as d}from"react/jsx-runtime";function f(e){return typeof e==`function`&&!c(e)&&!(e instanceof Promise)}function p({experience:p,client:m}){let h=s(null);h.current??=u({client:m,experience:p});let g=h.current,_=n(g.componentAndFrameworkStore),v=n(m.readyStore);a(()=>{v&&l()&&p.prepareExperienceContentFx().catch(()=>void 0)},[v,p]);let y=_?.component.component,b=y&&e(y)?y.component:void 0,x=o(()=>c(b)?r.lazy(()=>b.load()):b instanceof Promise?r.lazy(()=>b):null,[b]);return f(b)?d(t,{value:g,children:d(b,{client:m,experience:g})}):x?d(t,{value:g,children:d(i,{fallback:null,children:d(x,{client:m,experience:g})})}):null}export{p as default};
1
+ import{isValidAdaptedComponent as e}from"../component.js";import{ExperienceProvider as t}from"../context.js";import{useStoreGlobal as n}from"../hooks/use-store-global.js";import r,{Suspense as i,useEffect as a,useMemo as o,useRef as s}from"react";import{isLazyLoader as c,supportsWindow as l}from"@picked/client";import{createExperienceInstance as u}from"@picked/client/server";import{jsx as d}from"react/jsx-runtime";function f(e){return typeof e==`function`&&!c(e)&&!(e instanceof Promise)}function p({experience:p,client:m}){let h=s(null);h.current??=u({client:m,experience:p});let g=h.current,_=n(g.componentAndFrameworkStore),v=n(m.readyStore);a(()=>{v&&l()&&p.prepareExperienceContentFx().catch(()=>void 0)},[v,p]);let y=_?.component.component,b=y&&e(y)?y.component:void 0,x=o(()=>c(b)?r.lazy(()=>b.load()):b instanceof Promise?r.lazy(()=>b):null,[b]);return f(b)?d(t,{value:g,children:d(b,{client:m,experience:g})}):x?d(t,{value:g,children:d(i,{fallback:null,children:d(x,{client:m,experience:g})})}):null}var m=r.memo(p);m.displayName=`ExperienceHost`;export{m as default};
@@ -1,6 +1,7 @@
1
1
  import { ExperienceInstance, Picked } from '@picked/client';
2
2
  /**
3
3
  * Retrieves the Picked Client for the Experience Instance.
4
+ *
4
5
  * @returns The Picked client instance that provides access to experiences, steps, and other Picked functionality.
5
6
  * @example
6
7
  * const client = usePicked()
@@ -8,9 +9,17 @@ import { ExperienceInstance, Picked } from '@picked/client';
8
9
  export declare function usePicked(): Picked;
9
10
  /**
10
11
  * Retrieves the Experience Store for the current Experience Instance.
12
+ *
13
+ * The returned instance exposes `restart` and `isResumableStore` for SDK-native
14
+ * resume/restart flows: call `instance.restart()` to clear this instance's history and
15
+ * the experience's owned responses, and read `instance.isResumableStore` (via `useUnit`)
16
+ * to render a "continue / start over" prompt once the user has progressed past the first
17
+ * step (it stays `false` on the first step, even with a saved answer).
18
+ *
11
19
  * @returns The Experience store instance that provides access to experience configuration and state.
12
20
  * @example
13
21
  * const experience = useExperience()
22
+ * const canResume = useUnit(experience.isResumableStore)
14
23
  */
15
24
  export declare function useExperience(): ExperienceInstance;
16
25
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/hooks/client.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAGhE;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAOlC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,kBAAkB,CAOlD"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/hooks/client.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAGhE;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAOlC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,IAAI,kBAAkB,CAOlD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picked/react",
3
- "version": "0.0.1-dev.1783642866820",
3
+ "version": "0.0.1-dev.1784003142683",
4
4
  "devDependencies": {
5
5
  "@picked/client": "workspace:*",
6
6
  "@repo/eslint-config": "workspace:*",
@@ -85,7 +85,7 @@
85
85
  },
86
86
  "module": "./dist/index.js",
87
87
  "peerDependencies": {
88
- "@picked/client": "0.0.1-dev.1783642866820",
88
+ "@picked/client": "0.0.1-dev.1784003142683",
89
89
  "effector": "^23.3.0",
90
90
  "react": "19.2.2",
91
91
  "react-dom": "19.2.2"