cross-state 0.37.0 → 0.37.1

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,6 +1,6 @@
1
1
  import type { Store } from '../core/store';
2
2
  import { type Path, type Value } from '../lib/path';
3
- import { type Draft } from '../mutative';
3
+ import { type Draft } from 'mutative';
4
4
  export type Mutation<T> = (draft: Draft<T>) => void;
5
5
  declare function update<T>(this: Store<T>, mutation: Mutation<T>): void;
6
6
  declare function update<T, const P extends Path<T>>(this: Store<T>, path: P, mutation: Mutation<Value<T, P>>): void;
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from '../../react';
1
+ import type { ReactNode } from 'react';
2
2
  export interface CustomInputProps extends React.HTMLAttributes<HTMLDivElement> {
3
3
  name: string;
4
4
  children?: ReactNode;
@@ -1,7 +1,7 @@
1
1
  import { type Store, type UrlStoreOptions } from '../../core';
2
2
  import { type Path, type PathAsString, type Value, type WildcardPathAsString, type WildcardValue } from '../../lib/path';
3
3
  import type { Object_ } from '../../lib/typeHelpers';
4
- import { type FormEvent, type HTMLProps, type ReactNode } from '../../react';
4
+ import { type FormEvent, type HTMLProps, type ReactNode } from 'react';
5
5
  import { type UseStoreOptions } from '../useStore';
6
6
  import { type FormFieldComponent, type FormFieldPropsWithComponent, type FormFieldPropsWithRender } from './formField';
7
7
  import { type ElementName, type ForEachPath, type FormForEachProps } from './formForEach';
@@ -74,7 +74,7 @@ export interface FormInstance<TDraft, TOriginal> extends FormDerivedState<TDraft
74
74
  }
75
75
  export declare class Form<TDraft, TOriginal extends TDraft = TDraft> {
76
76
  readonly options: FormOptions<TDraft, TOriginal>;
77
- context: import("../../react").Context<FormContext<TDraft, TOriginal> | null>;
77
+ context: import("react").Context<FormContext<TDraft, TOriginal> | null>;
78
78
  constructor(options: FormOptions<TDraft, TOriginal>);
79
79
  useForm(): FormContext<TDraft, TOriginal>;
80
80
  useFormState<S>(selector: (state: FormInstance<TDraft, TOriginal>) => S, useStoreOptions?: UseStoreOptions<S>): S;
@@ -1,6 +1,6 @@
1
1
  import { type PathAsString } from '../../index';
2
2
  import { type Value } from '../../lib/path';
3
- import { type Component, type ComponentPropsWithoutRef, type ReactNode } from '../../react';
3
+ import { type Component, type ComponentPropsWithoutRef, type ReactNode } from 'react';
4
4
  import { type Form } from './form';
5
5
  export interface FormFieldComponentProps<TValue, TPath> {
6
6
  name: TPath;
@@ -59,5 +59,5 @@ export type FormFieldPropsWithComponent<TDraft, TPath extends PathAsString<TDraf
59
59
  } : {
60
60
  deserialize: (value: FieldChangeValue<TComponent>) => Value<TDraft, TPath>;
61
61
  });
62
- export declare function FormField<TDraft, TPath extends PathAsString<TDraft>, TComponent extends FormFieldComponent>(this: Form<TDraft, any>, { name, component, commitOnBlur, commitDebounce, render, inputFilter, defaultValue, serialize, deserialize, ...restProps }: FormFieldPropsWithRender<TDraft, TPath> | FormFieldPropsWithComponent<TDraft, TPath, TComponent>): string | number | boolean | import("../../react").ReactElement<any, string | import("../../react").JSXElementConstructor<any>> | Iterable<ReactNode> | null;
62
+ export declare function FormField<TDraft, TPath extends PathAsString<TDraft>, TComponent extends FormFieldComponent>(this: Form<TDraft, any>, { name, component, commitOnBlur, commitDebounce, render, inputFilter, defaultValue, serialize, deserialize, ...restProps }: FormFieldPropsWithRender<TDraft, TPath> | FormFieldPropsWithComponent<TDraft, TPath, TComponent>): string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null;
63
63
  export {};
@@ -1,5 +1,5 @@
1
1
  import { type GetKeys, type Join, type PathAsString, type Value } from '../../lib/path';
2
- import { type ReactNode } from '../../react';
2
+ import { type ReactNode } from 'react';
3
3
  import { type FieldHelperMethods, type Form } from './form';
4
4
  export type ForEachPath<T> = PathAsString<T>;
5
5
  export type ElementName<TDraft, TPath extends PathAsString<TDraft>> = Join<TPath, GetKeys<NonNullable<Value<TDraft, TPath>>> & (string | number)>;
@@ -1,4 +1,4 @@
1
- import { type ReactNode } from '../react';
1
+ import { type ReactNode } from 'react';
2
2
  export interface LoadingBoundaryEntry {
3
3
  label?: ReactNode;
4
4
  }
@@ -1,4 +1,4 @@
1
- import type { Context, ReactNode } from '../react';
1
+ import type { Context, ReactNode } from 'react';
2
2
  import { type UseStoreOptions } from './useStore';
3
3
  import type { Store } from '../core/store';
4
4
  import type { Scope } from '../core';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cross-state",
3
- "version": "0.37.0",
3
+ "version": "0.37.1",
4
4
  "description": "(React) state library",
5
5
  "license": "ISC",
6
6
  "repository": "schummar/cross-state",