@picked/react 0.0.1-dev.1775631463406 → 0.0.1-dev.1776231725998

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.
@@ -1,28 +1,37 @@
1
+ import { FormEvent } from 'react';
1
2
  import { FormInstance as CoreFormInstance, ErrorCallback, SubmitCallback, SuccessCallback } from '@picked/client/form';
2
3
  interface UseFormOptions {
3
4
  formId: string;
4
5
  title: string;
5
- fieldIds: string[];
6
+ fieldKeys: string[];
6
7
  }
7
8
  /**
8
- * React FormInstance — identical to core but callback registration returns void
9
- * (cleanup is handled automatically via useEffect, not by the consumer).
9
+ * React FormInstance — identical to core but with React-compatible form props
10
+ * and callback registration that returns void (cleanup is automatic via useEffect).
10
11
  */
11
- interface FormInstance<TFieldIds extends string = string> extends Omit<CoreFormInstance<TFieldIds>, 'form'> {
12
- form: Omit<CoreFormInstance<TFieldIds>['form'], 'onBeforeSubmit' | 'onSuccess' | 'onError'> & {
13
- onBeforeSubmit: (callback: SubmitCallback<TFieldIds>) => void;
14
- onSuccess: (callback: SuccessCallback<TFieldIds>) => void;
12
+ interface FormInstance<TFieldKeys extends string = string> extends Omit<CoreFormInstance<TFieldKeys>, 'form'> {
13
+ form: Omit<CoreFormInstance<TFieldKeys>['form'], 'onBeforeSubmit' | 'onSuccess' | 'onError' | 'props'> & {
14
+ props: {
15
+ onSubmit: (e: FormEvent<HTMLFormElement>) => void;
16
+ };
17
+ onBeforeSubmit: (callback: SubmitCallback<TFieldKeys>) => void;
18
+ onSuccess: (callback: SuccessCallback<TFieldKeys>) => void;
15
19
  onError: (callback: ErrorCallback) => void;
16
20
  };
17
21
  }
18
22
  /**
19
- * React hook wrapping the framework-agnostic createForm from @picked/client/form.
23
+ * React hook wrapping the framework-agnostic createForm from `@picked/client/form`.
20
24
  *
21
- * - Injects client and experienceInstance from React context
22
- * - Collects unsubscribe functions from callback registration and cleans them
23
- * up on unmount via a single useEffect
24
- * - Consumer DX: `form.onSuccess(cb)` — no hooks or lifecycle awareness needed
25
+ * Injects client and experienceInstance from React context, collects unsubscribe
26
+ * functions from callback registration, and cleans them up on unmount.
27
+ *
28
+ * @param {UseFormOptions} root0 - Form configuration options.
29
+ * @param {string} root0.formId - Unique identifier for this form instance.
30
+ * @param {string} root0.title - The form/step title.
31
+ * @param {string[]} root0.fieldKeys - Field keys that belong to this form.
32
+ * @returns {FormInstance} A form instance with reactive field stores and callback registration.
33
+ * @example useForm({ formId: 'lead-capture', title: 'Contact', fieldKeys: ['email', 'name'] })
25
34
  */
26
- export declare function useForm({ formId, title, fieldIds }: UseFormOptions): FormInstance;
35
+ export declare function useForm({ formId, title, fieldKeys }: UseFormOptions): FormInstance;
27
36
  export {};
28
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/form/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,YAAY,IAAI,gBAAgB,EACrC,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAA;AAG5B,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED;;;GAGG;AACH,UAAU,YAAY,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,IAAI,CACpE,gBAAgB,CAAC,SAAS,CAAC,EAC3B,MAAM,CACP;IACC,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,WAAW,GAAG,SAAS,CAAC,GAAG;QAC5F,cAAc,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC,SAAS,CAAC,KAAK,IAAI,CAAA;QAC7D,SAAS,EAAE,CAAC,QAAQ,EAAE,eAAe,CAAC,SAAS,CAAC,KAAK,IAAI,CAAA;QACz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AgB,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,cAAc,GAAG,YAAY,CAgDlF"}
@@ -1 +1 @@
1
- import{useExperience as e,usePicked as t}from"../hooks/client.js";import"../hooks/index.js";import{useEffect as n,useMemo as r,useRef as i}from"react";import{createStore as a}from"effector";import{createForm as o}from"@picked/client/form";function s({formId:s,title:c,fieldIds:l}){let u=t(),d=e(),f=r(()=>a(c),[c]),p=r(()=>a(l),[l]),m=r(()=>o({client:u,experienceInstance:d},s,f,p),[u,d,s,f,p]),h=i([]);return n(()=>()=>{h.current.forEach(e=>e()),h.current=[]},[]),{form:r(()=>({...m.form,onBeforeSubmit:e=>{h.current.push(m.form.onBeforeSubmit(e))},onSuccess:e=>{h.current.push(m.form.onSuccess(e))},onError:e=>{h.current.push(m.form.onError(e))}}),[m]),fields:m.fields}}export{s as useForm};
1
+ import{useExperience as e,usePicked as t}from"../hooks/client.js";import"../hooks/index.js";import{useEffect as n,useMemo as r,useRef as i}from"react";import{createStore as a}from"effector";import{createForm as o}from"@picked/client/form";function s(e){return`submitter`in e&&e.currentTarget instanceof HTMLFormElement}function c({formId:c,title:l,fieldKeys:u}){let d=t(),f=e(),p=r(()=>a(l),[l]),m=r(()=>a(u),[u]),h=r(()=>o({client:d,experienceInstance:f},c,p,m),[d,f,c,p,m]),g=i([]);return n(()=>()=>{g.current.forEach(e=>e()),g.current=[]},[]),{form:r(()=>({...h.form,props:{onSubmit:e=>{e.preventDefault(),s(e.nativeEvent)&&h.form.props.onsubmit(e.nativeEvent)}},onBeforeSubmit:e=>{g.current.push(h.form.onBeforeSubmit(e))},onSuccess:e=>{g.current.push(h.form.onSuccess(e))},onError:e=>{g.current.push(h.form.onError(e))}}),[h]),fields:h.fields}}export{c as useForm};
@@ -0,0 +1,25 @@
1
+ type FeatureBucket = boolean | string | undefined;
2
+ interface FeatureResult {
3
+ id: string;
4
+ bucket: string | boolean;
5
+ }
6
+ /**
7
+ * Returns the current evokable feature function, reactive to store updates.
8
+ *
9
+ * @param {string} featureName - The name of the feature to retrieve.
10
+ * @returns {() => Promise<FeatureBucket>} The evokable feature function.
11
+ * @example
12
+ * const evoke = useFeature('my-feature')
13
+ */
14
+ export declare function useFeature(featureName: string): () => Promise<FeatureBucket>;
15
+ /**
16
+ * Returns an Effector store that resolves to the feature's evaluated bucket result.
17
+ *
18
+ * @param {string} featureName - The name of the feature to evaluate.
19
+ * @returns {FeatureResult | undefined} The current feature evaluation result, reactive to store updates.
20
+ * @example
21
+ * const result = useFeatureResult('my-feature')
22
+ */
23
+ export declare function useFeatureResult(featureName: string): FeatureResult | undefined;
24
+ export {};
25
+ //# sourceMappingURL=feature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../src/hooks/feature.ts"],"names":[],"mappings":"AAQA,KAAK,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;AAEjD,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB;AAgBD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,CAE5E;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CA0C/E"}
@@ -0,0 +1 @@
1
+ import{usePicked as e}from"./client.js";import{attach as t,createEffect as n,createEvent as r,createStore as i,sample as a}from"effector";import{useUnit as o}from"effector-react";function s(t){return e().features.getEvokableFeature(t)}function c(e){return o(s(e))}function l(e){let c=s(e),l=i(void 0,{skipVoid:!1}),u=r(),d=t({source:c,mapParams:(e,t)=>t,effect:n(async e=>await e())});return a({clock:u,target:d}),a({clock:d.doneData,fn:t=>{if(t!==void 0)return{id:e,bucket:t}},target:l}),u(),a({clock:c,target:u}),o(l)}export{c as useFeature,l as useFeatureResult};
@@ -1,10 +1,12 @@
1
1
  /**
2
2
  * @file Public re-exports for the hooks entry point.
3
3
  */
4
+ export { ClientContext, ClientProvider, ExperienceContext, ExperienceProvider } from '../context';
4
5
  export { usePicked, useExperience } from './client';
5
6
  export { useStep, useSetStepContext } from './step';
6
7
  export type { StepContext } from './step';
7
8
  export { useSessionStorage, useLocalStorage } from './storage';
8
9
  export type { UseStorageOptions } from './storage';
9
10
  export * from './field';
11
+ export { useFeature, useFeatureResult } from './feature';
10
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAClD,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACjG,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAClD,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA"}
@@ -1 +1 @@
1
- import{useExperience as e,usePicked as t}from"./client.js";import{useSetStepContext as n,useStep as r}from"./step.js";import{useLocalStorage as i,useSessionStorage as a}from"./storage.js";import{getField as o}from"./field.js";export{o as getField,e as useExperience,i as useLocalStorage,t as usePicked,a as useSessionStorage,n as useSetStepContext,r as useStep};
1
+ import{ClientContext as e,ClientProvider as t,ExperienceContext as n,ExperienceProvider as r}from"../context.js";import{useExperience as i,usePicked as a}from"./client.js";import{useSetStepContext as o,useStep as s}from"./step.js";import{useLocalStorage as c,useSessionStorage as l}from"./storage.js";import{getField as u}from"./field.js";import{useFeature as d,useFeatureResult as f}from"./feature.js";export{e as ClientContext,t as ClientProvider,n as ExperienceContext,r as ExperienceProvider,u as getField,i as useExperience,d as useFeature,f as useFeatureResult,c as useLocalStorage,a as usePicked,l as useSessionStorage,o as useSetStepContext,s as useStep};
@@ -1,6 +1,7 @@
1
- import { EventCallable, Store } from 'effector';
1
+ import { FormEvent } from 'react';
2
+ import { Store } from 'effector';
2
3
  import { ExperienceStep, ValidationError } from '@picked/client';
3
- import { FormField, ErrorCallback, SubmitCallback, SubmitEventWithCurrentTarget, SuccessCallback } from '@picked/client/form';
4
+ import { FormField, ErrorCallback, SubmitCallback, SuccessCallback } from '@picked/client/form';
4
5
  export interface StepContext {
5
6
  step: Store<ExperienceStep>;
6
7
  /** Reactive store of fields with current values, errors, touched state, and event handlers. */
@@ -9,9 +10,9 @@ export interface StepContext {
9
10
  /** @deprecated Use `isActive` instead. */
10
11
  isActiveStep: boolean;
11
12
  form: {
12
- /** HTML-safe attributes to spread onto a form element. */
13
+ /** React-compatible attributes to spread onto a <form> element. */
13
14
  props: {
14
- onsubmit: EventCallable<SubmitEventWithCurrentTarget>;
15
+ onSubmit: (e: FormEvent<HTMLFormElement>) => void;
15
16
  };
16
17
  /** Flat list of all current validation errors. */
17
18
  errors: Store<ValidationError[]>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C;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CA0E9D"}
@@ -1 +1 @@
1
- import{useExperience as e,usePicked as t}from"./client.js";import{useStepRouter as n}from"../router/context.js";import{createContext as r,useContext as i,useEffect as a,useMemo as o,useRef as s}from"react";import{createForm as c}from"@picked/client/form";var l=r(null);function u(){let e=i(l);if(!e)throw Error(`useStep must be used within a StepContextProvider`);return e}function d(r){let i=e(),l=t(),{activeStep:u}=n(),d=o(()=>u?.key===r,[u?.key,r]),f=o(()=>i.treeStore.map(e=>{let t=e.steps.find(e=>e.key===r);if(!t)throw Error(`Step with key "${r}" not found in the experience tree.`);return t}),[i,r]),p=o(()=>f.map(e=>e.name),[f]),m=o(()=>f.map(e=>e.fieldIds),[f]),h=o(()=>c({client:l,experienceInstance:i},r,p,m),[l,i,r,p,m]),g=s([]);a(()=>()=>{g.current.forEach(e=>e()),g.current=[]},[]);let _=o(()=>({...h.form,onBeforeSubmit:e=>{g.current.push(h.form.onBeforeSubmit(e))},onSuccess:e=>{g.current.push(h.form.onSuccess(e))},onError:e=>{g.current.push(h.form.onError(e))}}),[h]);return{step:f,fields:h.fields,isActive:d,isActiveStep:d,form:_}}export{l as StepContextProvider,d as useSetStepContext,u as useStep};
1
+ import{useExperience as e,usePicked as t}from"./client.js";import{useStepRouter as n}from"../router/context.js";import{createContext as r,useContext as i,useEffect as a,useMemo as o,useRef as s}from"react";import{createForm as c}from"@picked/client/form";function l(e){return`submitter`in e&&e.currentTarget instanceof HTMLFormElement}var u=r(null);function d(){let e=i(u);if(!e)throw Error(`useStep must be used within a StepContextProvider`);return e}function f(r){let i=e(),u=t(),{activeStep:d}=n(),f=o(()=>d?.key===r,[d?.key,r]),p=o(()=>i.treeStore.map(e=>{let t=e.steps.find(e=>e.key===r);if(!t)throw Error(`Step with key "${r}" not found in the experience tree.`);return t}),[i,r]),m=o(()=>p.map(e=>e.name),[p]),h=o(()=>p.map(e=>e.fieldKeys),[p]),g=o(()=>c({client:u,experienceInstance:i},r,m,h),[u,i,r,m,h]),_=s([]);a(()=>()=>{_.current.forEach(e=>e()),_.current=[]},[]);let v=o(()=>({...g.form,props:{onSubmit:e=>{e.preventDefault(),l(e.nativeEvent)&&g.form.props.onsubmit(e.nativeEvent)}},onBeforeSubmit:e=>{_.current.push(g.form.onBeforeSubmit(e))},onSuccess:e=>{_.current.push(g.form.onSuccess(e))},onError:e=>{_.current.push(g.form.onError(e))}}),[g]);return{step:p,fields:g.fields,isActive:f,isActiveStep:f,form:v}}export{u as StepContextProvider,f as useSetStepContext,d as useStep};
package/dist/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @file Public re-exports for the main `@picked/react` entry point.
3
+ */
1
4
  export { adaptReactComponent, isValidAdaptedComponent } from './component';
2
5
  export type * from './component';
3
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAC1E,mBAAmB,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAC1E,mBAAmB,aAAa,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picked/react",
3
- "version": "0.0.1-dev.1775631463406",
3
+ "version": "0.0.1-dev.1776231725998",
4
4
  "devDependencies": {
5
5
  "@picked/client": "workspace:*",
6
6
  "@repo/eslint-config": "workspace:*",
@@ -19,7 +19,7 @@
19
19
  "size-limit": "^12.0.0",
20
20
  "typedoc": "^0.28.5",
21
21
  "typedoc-plugin-markdown": "^4.6.3",
22
- "vite": "^8.0.7",
22
+ "vite": "^8.0.8",
23
23
  "vite-plugin-dts": "^4.5.4",
24
24
  "vitest": "^4.1.0"
25
25
  },
@@ -85,7 +85,7 @@
85
85
  },
86
86
  "module": "./dist/index.js",
87
87
  "peerDependencies": {
88
- "@picked/client": "0.0.1-dev.1775631463406",
88
+ "@picked/client": "0.0.1-dev.1776231725998",
89
89
  "effector": "^23.3.0",
90
90
  "effector-react": "^23.3.0",
91
91
  "react": "19.2.2",