@plasmicapp/react-web 0.2.201 → 0.2.202

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.
Files changed (148) hide show
  1. package/dist/all.d.ts +1926 -1925
  2. package/dist/auth/PlasmicPageGuard.d.ts +11 -11
  3. package/dist/common.d.ts +10 -10
  4. package/dist/data-sources/index.d.ts +1 -1
  5. package/dist/host/index.d.ts +1 -1
  6. package/dist/index-common.d.ts +18 -18
  7. package/dist/index-skinny.d.ts +1 -1
  8. package/dist/index.cjs.js +3495 -3495
  9. package/dist/index.cjs.js.map +1 -1
  10. package/dist/index.d.ts +11 -11
  11. package/dist/plume/button/index.d.ts +36 -36
  12. package/dist/plume/checkbox/index.d.ts +47 -47
  13. package/dist/plume/collection-utils.d.ts +191 -191
  14. package/dist/plume/collection-utils.spec.d.ts +1 -1
  15. package/dist/plume/menu/context.d.ts +8 -8
  16. package/dist/plume/menu/index.d.ts +3 -3
  17. package/dist/plume/menu/menu-group.d.ts +23 -23
  18. package/dist/plume/menu/menu-item.d.ts +23 -23
  19. package/dist/plume/menu/menu.d.ts +39 -39
  20. package/dist/plume/menu-button/DropdownMenu.d.ts +34 -34
  21. package/dist/plume/menu-button/index.d.ts +2 -2
  22. package/dist/plume/menu-button/menu-button.d.ts +72 -72
  23. package/dist/plume/menu-button/menu-trigger.d.ts +21 -21
  24. package/dist/plume/plume-utils.d.ts +41 -41
  25. package/dist/plume/props-utils.d.ts +15 -15
  26. package/dist/plume/select/context.d.ts +3 -3
  27. package/dist/plume/select/index.d.ts +4 -4
  28. package/dist/plume/select/select-option-group.d.ts +23 -23
  29. package/dist/plume/select/select-option.d.ts +23 -23
  30. package/dist/plume/select/select.d.ts +111 -111
  31. package/dist/plume/switch/index.d.ts +39 -39
  32. package/dist/plume/text-input/index.d.ts +36 -36
  33. package/dist/plume/triggered-overlay/context.d.ts +14 -14
  34. package/dist/plume/triggered-overlay/index.d.ts +2 -2
  35. package/dist/plume/triggered-overlay/triggered-overlay.d.ts +24 -24
  36. package/dist/query/index.d.ts +1 -1
  37. package/dist/react-utils.d.ts +21 -21
  38. package/dist/react-utils.spec.d.ts +1 -1
  39. package/dist/react-web.esm.js +3496 -3496
  40. package/dist/react-web.esm.js.map +1 -1
  41. package/dist/render/PlasmicHead/index.d.ts +37 -37
  42. package/dist/render/PlasmicIcon.d.ts +4 -4
  43. package/dist/render/PlasmicImg/index.d.ts +81 -81
  44. package/dist/render/PlasmicLink.d.ts +2 -2
  45. package/dist/render/PlasmicSlot.d.ts +11 -11
  46. package/dist/render/Stack.d.ts +51 -51
  47. package/dist/render/elements.d.ts +74 -74
  48. package/dist/render/global-variants.d.ts +1 -1
  49. package/dist/render/screen-variants.d.ts +5 -5
  50. package/dist/render/ssr.d.ts +21 -21
  51. package/dist/render/translation.d.ts +19 -19
  52. package/dist/render/triggers.d.ts +39 -39
  53. package/dist/states/errors.d.ts +13 -13
  54. package/dist/states/graph.d.ts +25 -25
  55. package/dist/states/helpers.d.ts +43 -43
  56. package/dist/states/index.d.ts +4 -4
  57. package/dist/states/types.d.ts +66 -66
  58. package/dist/states/valtio.d.ts +10 -10
  59. package/dist/states/vanilla.d.ts +3 -3
  60. package/dist/stories/PlasmicImg.stories.d.ts +6 -6
  61. package/dist/stories/UseDollarState.stories.d.ts +78 -78
  62. package/lib/data-sources/index.d.ts +1 -1
  63. package/lib/host/index.d.ts +1 -1
  64. package/lib/query/index.d.ts +1 -1
  65. package/package.json +8 -9
  66. package/skinny/dist/auth/PlasmicPageGuard.d.ts +11 -11
  67. package/skinny/dist/{collection-utils-0967eaf0.js → collection-utils-2f28e4eb.js} +297 -297
  68. package/skinny/dist/{collection-utils-0967eaf0.js.map → collection-utils-2f28e4eb.js.map} +1 -1
  69. package/skinny/dist/{common-9d6d348d.js → common-ed411407.js} +130 -130
  70. package/skinny/dist/{common-9d6d348d.js.map → common-ed411407.js.map} +1 -1
  71. package/skinny/dist/common.d.ts +10 -10
  72. package/skinny/dist/data-sources/index.d.ts +1 -1
  73. package/skinny/dist/host/index.d.ts +1 -1
  74. package/skinny/dist/index-common.d.ts +18 -18
  75. package/skinny/dist/index-skinny.d.ts +1 -1
  76. package/skinny/dist/index.d.ts +11 -11
  77. package/skinny/dist/index.js +1559 -1559
  78. package/skinny/dist/index.js.map +1 -1
  79. package/skinny/dist/plume/button/index.d.ts +36 -36
  80. package/skinny/dist/plume/button/index.js +21 -21
  81. package/skinny/dist/plume/checkbox/index.d.ts +47 -47
  82. package/skinny/dist/plume/checkbox/index.js +64 -64
  83. package/skinny/dist/plume/collection-utils.d.ts +191 -191
  84. package/skinny/dist/plume/collection-utils.spec.d.ts +1 -1
  85. package/skinny/dist/plume/menu/context.d.ts +8 -8
  86. package/skinny/dist/plume/menu/index.d.ts +3 -3
  87. package/skinny/dist/plume/menu/index.js +165 -165
  88. package/skinny/dist/plume/menu/menu-group.d.ts +23 -23
  89. package/skinny/dist/plume/menu/menu-item.d.ts +23 -23
  90. package/skinny/dist/plume/menu/menu.d.ts +39 -39
  91. package/skinny/dist/plume/menu-button/DropdownMenu.d.ts +34 -34
  92. package/skinny/dist/plume/menu-button/index.d.ts +2 -2
  93. package/skinny/dist/plume/menu-button/index.js +125 -125
  94. package/skinny/dist/plume/menu-button/index.js.map +1 -1
  95. package/skinny/dist/plume/menu-button/menu-button.d.ts +72 -72
  96. package/skinny/dist/plume/menu-button/menu-trigger.d.ts +21 -21
  97. package/skinny/dist/plume/plume-utils.d.ts +41 -41
  98. package/skinny/dist/plume/props-utils.d.ts +15 -15
  99. package/skinny/dist/plume/select/context.d.ts +3 -3
  100. package/skinny/dist/plume/select/index.d.ts +4 -4
  101. package/skinny/dist/plume/select/index.js +250 -250
  102. package/skinny/dist/plume/select/index.js.map +1 -1
  103. package/skinny/dist/plume/select/select-option-group.d.ts +23 -23
  104. package/skinny/dist/plume/select/select-option.d.ts +23 -23
  105. package/skinny/dist/plume/select/select.d.ts +111 -111
  106. package/skinny/dist/plume/switch/index.d.ts +39 -39
  107. package/skinny/dist/plume/switch/index.js +61 -61
  108. package/skinny/dist/plume/text-input/index.d.ts +36 -36
  109. package/skinny/dist/plume/text-input/index.js +45 -45
  110. package/skinny/dist/plume/triggered-overlay/context.d.ts +14 -14
  111. package/skinny/dist/plume/triggered-overlay/index.d.ts +2 -2
  112. package/skinny/dist/plume/triggered-overlay/index.js +100 -100
  113. package/skinny/dist/plume/triggered-overlay/index.js.map +1 -1
  114. package/skinny/dist/plume/triggered-overlay/triggered-overlay.d.ts +24 -24
  115. package/skinny/dist/{plume-utils-7d68bcc0.js → plume-utils-e699cd08.js} +30 -30
  116. package/skinny/dist/{plume-utils-7d68bcc0.js.map → plume-utils-e699cd08.js.map} +1 -1
  117. package/skinny/dist/{props-utils-9f9c761a.js → props-utils-9d74371f.js} +4 -4
  118. package/skinny/dist/{props-utils-9f9c761a.js.map → props-utils-9d74371f.js.map} +1 -1
  119. package/skinny/dist/query/index.d.ts +1 -1
  120. package/skinny/dist/{react-utils-ee4e03ba.js → react-utils-5ff031c2.js} +195 -195
  121. package/skinny/dist/{react-utils-ee4e03ba.js.map → react-utils-5ff031c2.js.map} +1 -1
  122. package/skinny/dist/react-utils.d.ts +21 -21
  123. package/skinny/dist/react-utils.spec.d.ts +1 -1
  124. package/skinny/dist/render/PlasmicHead/index.d.ts +37 -37
  125. package/skinny/dist/render/PlasmicHead/index.js +54 -54
  126. package/skinny/dist/render/PlasmicIcon.d.ts +4 -4
  127. package/skinny/dist/render/PlasmicImg/index.d.ts +81 -81
  128. package/skinny/dist/render/PlasmicImg/index.js +297 -297
  129. package/skinny/dist/render/PlasmicLink.d.ts +2 -2
  130. package/skinny/dist/render/PlasmicSlot.d.ts +11 -11
  131. package/skinny/dist/render/Stack.d.ts +51 -51
  132. package/skinny/dist/render/elements.d.ts +74 -74
  133. package/skinny/dist/render/global-variants.d.ts +1 -1
  134. package/skinny/dist/render/screen-variants.d.ts +5 -5
  135. package/skinny/dist/render/ssr.d.ts +21 -21
  136. package/skinny/dist/render/translation.d.ts +19 -19
  137. package/skinny/dist/render/triggers.d.ts +39 -39
  138. package/skinny/dist/{ssr-c9834f50.js → ssr-8625df04.js} +107 -107
  139. package/skinny/dist/{ssr-c9834f50.js.map → ssr-8625df04.js.map} +1 -1
  140. package/skinny/dist/states/errors.d.ts +13 -13
  141. package/skinny/dist/states/graph.d.ts +25 -25
  142. package/skinny/dist/states/helpers.d.ts +43 -43
  143. package/skinny/dist/states/index.d.ts +4 -4
  144. package/skinny/dist/states/types.d.ts +66 -66
  145. package/skinny/dist/states/valtio.d.ts +10 -10
  146. package/skinny/dist/states/vanilla.d.ts +3 -3
  147. package/skinny/dist/stories/PlasmicImg.stories.d.ts +6 -6
  148. package/skinny/dist/stories/UseDollarState.stories.d.ts +78 -78
@@ -1,39 +1,39 @@
1
- import * as React from "react";
2
- declare function useFocused(opts: {
3
- isTextInput?: boolean;
4
- }): (boolean | import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement>)[];
5
- declare function useFocusVisible(opts: {
6
- isTextInput?: boolean;
7
- }): (boolean | import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement>)[];
8
- declare function useFocusedWithin(opts: {
9
- isTextInput?: boolean;
10
- }): (boolean | import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement>)[];
11
- declare function useFocusVisibleWithin(opts: {
12
- isTextInput?: boolean;
13
- }): (boolean | import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement>)[];
14
- declare function useHover(): (boolean | {
15
- onMouseEnter: () => void;
16
- onMouseLeave: () => void;
17
- })[];
18
- declare function usePressed(): (boolean | {
19
- onMouseDown: () => void;
20
- onMouseUp: () => void;
21
- })[];
22
- declare const TRIGGER_TO_HOOK: {
23
- readonly useHover: typeof useHover;
24
- readonly useFocused: typeof useFocused;
25
- readonly useFocusVisible: typeof useFocusVisible;
26
- readonly useFocusedWithin: typeof useFocusedWithin;
27
- readonly useFocusVisibleWithin: typeof useFocusVisibleWithin;
28
- readonly usePressed: typeof usePressed;
29
- };
30
- type TriggerType = keyof typeof TRIGGER_TO_HOOK;
31
- interface TriggerOpts {
32
- isTextInput?: boolean;
33
- }
34
- /**
35
- * Installs argment trigger. All the useTrigger calls must use hardcoded `trigger` arg,
36
- * as it's not valid to install variable React hooks!
37
- */
38
- export declare function useTrigger(trigger: TriggerType, opts: TriggerOpts): [boolean, React.HTMLAttributes<HTMLElement>];
39
- export {};
1
+ import * as React from "react";
2
+ declare function useFocused(opts: {
3
+ isTextInput?: boolean;
4
+ }): (boolean | import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement>)[];
5
+ declare function useFocusVisible(opts: {
6
+ isTextInput?: boolean;
7
+ }): (boolean | import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement>)[];
8
+ declare function useFocusedWithin(opts: {
9
+ isTextInput?: boolean;
10
+ }): (boolean | import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement>)[];
11
+ declare function useFocusVisibleWithin(opts: {
12
+ isTextInput?: boolean;
13
+ }): (boolean | import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement>)[];
14
+ declare function useHover(): (boolean | {
15
+ onMouseEnter: () => void;
16
+ onMouseLeave: () => void;
17
+ })[];
18
+ declare function usePressed(): (boolean | {
19
+ onMouseDown: () => void;
20
+ onMouseUp: () => void;
21
+ })[];
22
+ declare const TRIGGER_TO_HOOK: {
23
+ readonly useHover: typeof useHover;
24
+ readonly useFocused: typeof useFocused;
25
+ readonly useFocusVisible: typeof useFocusVisible;
26
+ readonly useFocusedWithin: typeof useFocusedWithin;
27
+ readonly useFocusVisibleWithin: typeof useFocusVisibleWithin;
28
+ readonly usePressed: typeof usePressed;
29
+ };
30
+ type TriggerType = keyof typeof TRIGGER_TO_HOOK;
31
+ interface TriggerOpts {
32
+ isTextInput?: boolean;
33
+ }
34
+ /**
35
+ * Installs argment trigger. All the useTrigger calls must use hardcoded `trigger` arg,
36
+ * as it's not valid to install variable React hooks!
37
+ */
38
+ export declare function useTrigger(trigger: TriggerType, opts: TriggerOpts): [boolean, React.HTMLAttributes<HTMLElement>];
39
+ export {};
@@ -1,13 +1,13 @@
1
- export declare class CustomError extends Error {
2
- name: string;
3
- constructor(msg?: string);
4
- }
5
- export declare class CyclicStatesReferencesError extends Error {
6
- constructor(stateAccessCycle: string[]);
7
- }
8
- export declare class InvalidOperation extends Error {
9
- constructor(msg: string);
10
- }
11
- export declare class UnknownError extends Error {
12
- constructor(msg: string);
13
- }
1
+ export declare class CustomError extends Error {
2
+ name: string;
3
+ constructor(msg?: string);
4
+ }
5
+ export declare class CyclicStatesReferencesError extends Error {
6
+ constructor(stateAccessCycle: string[]);
7
+ }
8
+ export declare class InvalidOperation extends Error {
9
+ constructor(msg: string);
10
+ }
11
+ export declare class UnknownError extends Error {
12
+ constructor(msg: string);
13
+ }
@@ -1,25 +1,25 @@
1
- import { $StateSpec, Internal$StateSpec, ObjectPath } from "./types";
2
- export declare class StateSpecNode<T> {
3
- private _specs;
4
- private _edges;
5
- constructor(specs: Internal$StateSpec<T>[]);
6
- setSpecs(specs: Internal$StateSpec<T>[]): void;
7
- edges(): Map<string | symbol, StateSpecNode<any>>;
8
- hasEdge(key: string | symbol): boolean;
9
- addEdge(key: string | symbol, node: StateSpecNode<any>): void;
10
- clearEdges(): void;
11
- children(): IterableIterator<StateSpecNode<any>>;
12
- makeTransition(key: string | symbol | number): StateSpecNode<any> | undefined;
13
- isLeaf(): boolean;
14
- hasArrayTransition(): boolean;
15
- getSpec(): Internal$StateSpec<T>;
16
- getAllSpecs(): Internal$StateSpec<T>[];
17
- }
18
- export declare const transformPathStringToObj: (str: string) => (string | symbol)[];
19
- export declare function buildTree(specs: $StateSpec<any>[]): StateSpecNode<any>;
20
- export declare function updateTree(root: StateSpecNode<any>, specs: $StateSpec<any>[]): StateSpecNode<any>;
21
- export declare function getSpecTreeLeaves(root: StateSpecNode<any>): StateSpecNode<any>[];
22
- export declare function findStateCell(root: StateSpecNode<any>, pathStr: string, repetitionIndex?: number[]): {
23
- node: StateSpecNode<any>;
24
- realPath: ObjectPath;
25
- };
1
+ import { $StateSpec, Internal$StateSpec, ObjectPath } from "./types";
2
+ export declare class StateSpecNode<T> {
3
+ private _specs;
4
+ private _edges;
5
+ constructor(specs: Internal$StateSpec<T>[]);
6
+ setSpecs(specs: Internal$StateSpec<T>[]): void;
7
+ edges(): Map<string | symbol, StateSpecNode<any>>;
8
+ hasEdge(key: string | symbol): boolean;
9
+ addEdge(key: string | symbol, node: StateSpecNode<any>): void;
10
+ clearEdges(): void;
11
+ children(): IterableIterator<StateSpecNode<any>>;
12
+ makeTransition(key: string | symbol | number): StateSpecNode<any> | undefined;
13
+ isLeaf(): boolean;
14
+ hasArrayTransition(): boolean;
15
+ getSpec(): Internal$StateSpec<T>;
16
+ getAllSpecs(): Internal$StateSpec<T>[];
17
+ }
18
+ export declare const transformPathStringToObj: (str: string) => (string | symbol)[];
19
+ export declare function buildTree(specs: $StateSpec<any>[]): StateSpecNode<any>;
20
+ export declare function updateTree(root: StateSpecNode<any>, specs: $StateSpec<any>[]): StateSpecNode<any>;
21
+ export declare function getSpecTreeLeaves(root: StateSpecNode<any>): StateSpecNode<any>[];
22
+ export declare function findStateCell(root: StateSpecNode<any>, pathStr: string, repetitionIndex?: number[]): {
23
+ node: StateSpecNode<any>;
24
+ realPath: ObjectPath;
25
+ };
@@ -1,43 +1,43 @@
1
- import type { ComponentHelpers } from "@plasmicapp/host";
2
- import { useLayoutEffect } from "react";
3
- import { StateSpecNode } from "./graph";
4
- import { $State, InitFunc, ObjectPath, StateCell } from "./types";
5
- export declare function initializeCodeComponentStates($state: $State, states: {
6
- name: string;
7
- plasmicStateName: string;
8
- }[], repetitionIndex: number[], componentHelpers: ComponentHelpers<any>, child$Props: Record<string, any>): void;
9
- export declare function initializePlasmicStates($state: $State, states: {
10
- name: string;
11
- initFunc: InitFunc<any>;
12
- }[], repetitionIndex: number[]): void;
13
- export declare function generateStateOnChangeProp($state: $State, path: ObjectPath): (val: any) => void;
14
- export declare function generateStateOnChangePropForCodeComponents($state: $State, stateName: string, plasmicStatePath: ObjectPath, componentHelpers: ComponentHelpers<any>): (val: any) => void;
15
- export declare function generateStateValueProp($state: $State, path: ObjectPath): any;
16
- export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
17
- export declare function isPlasmicStateProxy(obj: any): boolean;
18
- export declare function is$StateProxy(obj: any): number | boolean | undefined;
19
- export declare function getStateCells($state: $State, root: StateSpecNode<any>): StateCell<any>[];
20
- export declare function getStateCellsInPlasmicProxy(obj: any): {
21
- realPath: ObjectPath;
22
- path: string;
23
- }[];
24
- export declare function getStateSpecInPlasmicProxy(obj: any, path: ObjectPath): {
25
- spec: import("./types").Internal$StateSpec<any>;
26
- isImplicitStateArray: boolean;
27
- } | undefined;
28
- export declare function getCurrentInitialValue(obj: any, path: ObjectPath): any;
29
- export declare function resetToInitialValue(obj: any, path: ObjectPath): void;
30
- export declare function shallowEqual<T>(a1: T[], a2: T[]): boolean;
31
- /**
32
- * Shallow comparison of arrays.
33
- */
34
- export declare function arrayEq(xs: ReadonlyArray<any>, ys: ReadonlyArray<any>): boolean;
35
- export declare function isNum(value: string | number | symbol): value is number;
36
- type StringGen = string | (() => string);
37
- export declare function assert<T>(cond: T, msg?: StringGen): asserts cond;
38
- /**
39
- * Forked from https://github.com/lukeed/dset
40
- * Changes: fixed setting a deep value to a proxy object
41
- */
42
- export declare function set(obj: any, keys: any, val: any): void;
43
- export {};
1
+ import type { ComponentHelpers } from "@plasmicapp/host";
2
+ import { useLayoutEffect } from "react";
3
+ import { StateSpecNode } from "./graph";
4
+ import { $State, InitFunc, ObjectPath, StateCell } from "./types";
5
+ export declare function initializeCodeComponentStates($state: $State, states: {
6
+ name: string;
7
+ plasmicStateName: string;
8
+ }[], repetitionIndex: number[], componentHelpers: ComponentHelpers<any>, child$Props: Record<string, any>): void;
9
+ export declare function initializePlasmicStates($state: $State, states: {
10
+ name: string;
11
+ initFunc: InitFunc<any>;
12
+ }[], repetitionIndex: number[]): void;
13
+ export declare function generateStateOnChangeProp($state: $State, path: ObjectPath): (val: any) => void;
14
+ export declare function generateStateOnChangePropForCodeComponents($state: $State, stateName: string, plasmicStatePath: ObjectPath, componentHelpers: ComponentHelpers<any>): (val: any) => void;
15
+ export declare function generateStateValueProp($state: $State, path: ObjectPath): any;
16
+ export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
17
+ export declare function isPlasmicStateProxy(obj: any): boolean;
18
+ export declare function is$StateProxy(obj: any): number | boolean | undefined;
19
+ export declare function getStateCells($state: $State, root: StateSpecNode<any>): StateCell<any>[];
20
+ export declare function getStateCellsInPlasmicProxy(obj: any): {
21
+ realPath: ObjectPath;
22
+ path: string;
23
+ }[];
24
+ export declare function getStateSpecInPlasmicProxy(obj: any, path: ObjectPath): {
25
+ spec: import("./types").Internal$StateSpec<any>;
26
+ isImplicitStateArray: boolean;
27
+ } | undefined;
28
+ export declare function getCurrentInitialValue(obj: any, path: ObjectPath): any;
29
+ export declare function resetToInitialValue(obj: any, path: ObjectPath): void;
30
+ export declare function shallowEqual<T>(a1: T[], a2: T[]): boolean;
31
+ /**
32
+ * Shallow comparison of arrays.
33
+ */
34
+ export declare function arrayEq(xs: ReadonlyArray<any>, ys: ReadonlyArray<any>): boolean;
35
+ export declare function isNum(value: string | number | symbol): value is number;
36
+ type StringGen = string | (() => string);
37
+ export declare function assert<T>(cond: T, msg?: StringGen): asserts cond;
38
+ /**
39
+ * Forked from https://github.com/lukeed/dset
40
+ * Changes: fixed setting a deep value to a proxy object
41
+ */
42
+ export declare function set(obj: any, keys: any, val: any): void;
43
+ export {};
@@ -1,4 +1,4 @@
1
- export { default as get } from "dlv";
2
- export { generateStateOnChangeProp, generateStateOnChangePropForCodeComponents, generateStateValueProp, getCurrentInitialValue, getStateCellsInPlasmicProxy, getStateSpecInPlasmicProxy, initializeCodeComponentStates, initializePlasmicStates, is$StateProxy, isPlasmicStateProxy, resetToInitialValue, set, } from "./helpers";
3
- export { $State, $StateSpec } from "./types";
4
- export { useDollarState } from "./valtio";
1
+ export { default as get } from "dlv";
2
+ export { generateStateOnChangeProp, generateStateOnChangePropForCodeComponents, generateStateValueProp, getCurrentInitialValue, getStateCellsInPlasmicProxy, getStateSpecInPlasmicProxy, initializeCodeComponentStates, initializePlasmicStates, is$StateProxy, isPlasmicStateProxy, resetToInitialValue, set, } from "./helpers";
3
+ export { $State, $StateSpec } from "./types";
4
+ export { useDollarState } from "./valtio";
@@ -1,66 +1,66 @@
1
- import { StateSpecNode } from "./graph";
2
- export type InitFuncEnv = {
3
- $props: Record<string, any>;
4
- $state: Record<string, any>;
5
- $queries?: Record<string, any>;
6
- $ctx?: Record<string, any>;
7
- };
8
- export type DollarStateEnv = Omit<InitFuncEnv, "$state">;
9
- export type NoUndefinedField<T> = {
10
- [P in keyof T]-?: T[P];
11
- };
12
- export type InitFunc<T> = (env: NoUndefinedField<InitFuncEnv>) => T;
13
- export type DeprecatedInitFunc<T> = ($props: Record<string, any>, $state: $State, $ctx: Record<string, any>) => T;
14
- export type ObjectPath = (string | number)[];
15
- export interface $StateSpec<T> {
16
- path: string;
17
- initFunc?: InitFunc<T>;
18
- initVal?: T;
19
- type: "private" | "readonly" | "writable";
20
- valueProp?: string;
21
- onChangeProp?: string;
22
- isImmutable?: boolean;
23
- variableType: "text" | "number" | "boolean" | "array" | "object" | "variant";
24
- initFuncHash?: string;
25
- }
26
- export interface $State {
27
- [key: string]: any;
28
- registerInitFunc?: (path: string, f: InitFunc<any>, repetitonIndex?: number[], overrideEnv?: DollarStateEnv) => any;
29
- }
30
- export declare const ARRAY_SYMBOL: unique symbol;
31
- export declare const PLASMIC_STATE_PROXY_SYMBOL: unique symbol;
32
- export declare const UNINITIALIZED: unique symbol;
33
- export interface Internal$StateSpec<T> extends $StateSpec<T> {
34
- isRepeated: boolean;
35
- pathObj: (string | symbol)[];
36
- }
37
- export interface Internal$StateInstance {
38
- path: ObjectPath;
39
- specKey: string;
40
- }
41
- export interface StateCell<T> {
42
- initialValue?: T | Symbol;
43
- node: StateSpecNode<any>;
44
- path: ObjectPath;
45
- initFunc?: InitFunc<T>;
46
- listeners: (() => void)[];
47
- initFuncHash: string;
48
- overrideEnv?: NoUndefinedField<DollarStateEnv>;
49
- }
50
- export interface Internal$State {
51
- registrationsQueue: {
52
- node: StateSpecNode<any>;
53
- path: ObjectPath;
54
- f: InitFunc<any>;
55
- overrideEnv?: NoUndefinedField<DollarStateEnv>;
56
- }[];
57
- stateValues: Record<string, any>;
58
- env: NoUndefinedField<DollarStateEnv>;
59
- rootSpecTree: StateSpecNode<any>;
60
- specTreeLeaves: StateSpecNode<any>[];
61
- specs: $StateSpec<any>[];
62
- stateInitializationEnv: {
63
- stack: string[];
64
- visited: Set<string>;
65
- };
66
- }
1
+ import { StateSpecNode } from "./graph";
2
+ export type InitFuncEnv = {
3
+ $props: Record<string, any>;
4
+ $state: Record<string, any>;
5
+ $queries?: Record<string, any>;
6
+ $ctx?: Record<string, any>;
7
+ };
8
+ export type DollarStateEnv = Omit<InitFuncEnv, "$state">;
9
+ export type NoUndefinedField<T> = {
10
+ [P in keyof T]-?: T[P];
11
+ };
12
+ export type InitFunc<T> = (env: NoUndefinedField<InitFuncEnv>) => T;
13
+ export type DeprecatedInitFunc<T> = ($props: Record<string, any>, $state: $State, $ctx: Record<string, any>) => T;
14
+ export type ObjectPath = (string | number)[];
15
+ export interface $StateSpec<T> {
16
+ path: string;
17
+ initFunc?: InitFunc<T>;
18
+ initVal?: T;
19
+ type: "private" | "readonly" | "writable";
20
+ valueProp?: string;
21
+ onChangeProp?: string;
22
+ isImmutable?: boolean;
23
+ variableType: "text" | "number" | "boolean" | "array" | "object" | "variant";
24
+ initFuncHash?: string;
25
+ }
26
+ export interface $State {
27
+ [key: string]: any;
28
+ registerInitFunc?: (path: string, f: InitFunc<any>, repetitonIndex?: number[], overrideEnv?: DollarStateEnv) => any;
29
+ }
30
+ export declare const ARRAY_SYMBOL: unique symbol;
31
+ export declare const PLASMIC_STATE_PROXY_SYMBOL: unique symbol;
32
+ export declare const UNINITIALIZED: unique symbol;
33
+ export interface Internal$StateSpec<T> extends $StateSpec<T> {
34
+ isRepeated: boolean;
35
+ pathObj: (string | symbol)[];
36
+ }
37
+ export interface Internal$StateInstance {
38
+ path: ObjectPath;
39
+ specKey: string;
40
+ }
41
+ export interface StateCell<T> {
42
+ initialValue?: T | Symbol;
43
+ node: StateSpecNode<any>;
44
+ path: ObjectPath;
45
+ initFunc?: InitFunc<T>;
46
+ listeners: (() => void)[];
47
+ initFuncHash: string;
48
+ overrideEnv?: NoUndefinedField<DollarStateEnv>;
49
+ }
50
+ export interface Internal$State {
51
+ registrationsQueue: {
52
+ node: StateSpecNode<any>;
53
+ path: ObjectPath;
54
+ f: InitFunc<any>;
55
+ overrideEnv?: NoUndefinedField<DollarStateEnv>;
56
+ }[];
57
+ stateValues: Record<string, any>;
58
+ env: NoUndefinedField<DollarStateEnv>;
59
+ rootSpecTree: StateSpecNode<any>;
60
+ specTreeLeaves: StateSpecNode<any>[];
61
+ specs: $StateSpec<any>[];
62
+ stateInitializationEnv: {
63
+ stack: string[];
64
+ visited: Set<string>;
65
+ };
66
+ }
@@ -1,10 +1,10 @@
1
- import { StateSpecNode } from "./graph";
2
- import { $State, $StateSpec, Internal$State, ObjectPath, StateCell } from "./types";
3
- export declare const proxyObjToStateCell: WeakMap<object, Record<string | number | symbol, StateCell<any>>>;
4
- export declare const valtioSubscriptions: WeakMap<object, (() => boolean)[]>;
5
- export declare function tryGetStateCellFrom$StateRoot($state: $State, path: ObjectPath): StateCell<any> | undefined;
6
- export declare function getStateCellFrom$StateRoot($state: $State, path: ObjectPath): StateCell<any>;
7
- export declare function unsubscribeToValtio($$state: Internal$State, statePath: ObjectPath): void;
8
- export declare function subscribeToValtio($$state: Internal$State, statePath: ObjectPath, node: StateSpecNode<any>): void;
9
- export declare function useDollarState(specs: $StateSpec<any>[], ...rest: any[]): $State;
10
- export default useDollarState;
1
+ import { StateSpecNode } from "./graph";
2
+ import { $State, $StateSpec, Internal$State, ObjectPath, StateCell } from "./types";
3
+ export declare const proxyObjToStateCell: WeakMap<object, Record<string | number | symbol, StateCell<any>>>;
4
+ export declare const valtioSubscriptions: WeakMap<object, (() => boolean)[]>;
5
+ export declare function tryGetStateCellFrom$StateRoot($state: $State, path: ObjectPath): StateCell<any> | undefined;
6
+ export declare function getStateCellFrom$StateRoot($state: $State, path: ObjectPath): StateCell<any>;
7
+ export declare function unsubscribeToValtio($$state: Internal$State, statePath: ObjectPath): void;
8
+ export declare function subscribeToValtio($$state: Internal$State, statePath: ObjectPath, node: StateSpecNode<any>): void;
9
+ export declare function useDollarState(specs: $StateSpec<any>[], ...rest: any[]): $State;
10
+ export default useDollarState;
@@ -1,3 +1,3 @@
1
- import { $State, $StateSpec } from ".";
2
- declare function useVanillaDollarState(_specs: $StateSpec<any>[], props: Record<string, any>): $State;
3
- export default useVanillaDollarState;
1
+ import { $State, $StateSpec } from ".";
2
+ declare function useVanillaDollarState(_specs: $StateSpec<any>[], props: Record<string, any>): $State;
3
+ export default useVanillaDollarState;
@@ -1,6 +1,6 @@
1
- import { ComponentMeta, ComponentStory } from "@storybook/react";
2
- import React from "react";
3
- import "../styles/plasmic.css";
4
- export declare const Base: ComponentStory<React.ForwardRefExoticComponent<import("../render/PlasmicImg").PlasmicImgProps & React.RefAttributes<HTMLElement>>>;
5
- declare const _default: ComponentMeta<React.ForwardRefExoticComponent<import("../render/PlasmicImg").PlasmicImgProps & React.RefAttributes<HTMLElement>>>;
6
- export default _default;
1
+ import { ComponentMeta, ComponentStory } from "@storybook/react";
2
+ import React from "react";
3
+ import "../styles/plasmic.css";
4
+ export declare const Base: ComponentStory<React.ForwardRefExoticComponent<import("../render/PlasmicImg").PlasmicImgProps & React.RefAttributes<HTMLElement>>>;
5
+ declare const _default: ComponentMeta<React.ForwardRefExoticComponent<import("../render/PlasmicImg").PlasmicImgProps & React.RefAttributes<HTMLElement>>>;
6
+ export default _default;
@@ -1,78 +1,78 @@
1
- import { Story } from "@storybook/react";
2
- import React from "react";
3
- declare const _default: {
4
- title: string;
5
- };
6
- export default _default;
7
- interface CounterArgs {
8
- stateType?: "private" | "readonly" | "writable";
9
- showCount?: boolean;
10
- onChange?: (val: number) => void;
11
- initCount?: number;
12
- useInitalFunction?: boolean;
13
- "data-testid"?: string;
14
- title?: React.ReactNode;
15
- }
16
- export declare const PrivateCounter: Story<CounterArgs>;
17
- export declare const ReadonlyCounter: Story<{
18
- counterStateType?: "readonly" | "writable" | undefined;
19
- }>;
20
- export declare const WritableCounter: Story<{
21
- counterStateType?: "readonly" | "writable" | undefined;
22
- }>;
23
- export declare const DynamicInitCount: Story<import("@storybook/react").Args>;
24
- export declare const ResetInput: Story<{
25
- peopleList: {
26
- firstName: string;
27
- lastName: string;
28
- }[];
29
- }>;
30
- export declare const RepeatedStates: Story<{
31
- size: number;
32
- }>;
33
- export declare const NestedRepeatedCounter: Story<{}>;
34
- export declare const MatrixRepeatedCounter: Story<{}>;
35
- export declare const InitFuncFromInternalContextData: Story<{
36
- products: {
37
- price: number;
38
- name: string;
39
- }[];
40
- }>;
41
- export declare const InitFuncFromRootContextData: Story<{
42
- products: {
43
- price: number;
44
- name: string;
45
- }[];
46
- }>;
47
- export declare const InitFuncFromInternalContextDataWithDelay: Story<{
48
- products: {
49
- price: number;
50
- name: string;
51
- }[];
52
- }>;
53
- export declare const RepeatedImplicitState: Story<{}>;
54
- interface Person {
55
- firstName: string;
56
- lastName: string;
57
- nicknames: string[];
58
- }
59
- export declare const FormBuilder: Story<{
60
- people: Person[];
61
- }>;
62
- export declare const FormBuilderImplicitStates: Story<{
63
- people: Person[];
64
- }>;
65
- export declare const StateCellIsArray: Story<{
66
- people: Person[];
67
- }>;
68
- export declare const StateCellIsMatrix: Story<{
69
- board: number[][];
70
- }>;
71
- export declare const IsOnChangePropImmediatelyFired: Story<{}>;
72
- export declare const ImmutableStateCells: Story<{
73
- people: Person[];
74
- }>;
75
- export declare const InCanvasDollarState: Story<{}>;
76
- export declare const AddDeleteSpecsInCanvas: Story<{}>;
77
- export declare const TodoApp: Story<{}>;
78
- export declare const CycleInStateInitialization: Story<{}>;
1
+ import { Story } from "@storybook/react";
2
+ import React from "react";
3
+ declare const _default: {
4
+ title: string;
5
+ };
6
+ export default _default;
7
+ interface CounterArgs {
8
+ stateType?: "private" | "readonly" | "writable";
9
+ showCount?: boolean;
10
+ onChange?: (val: number) => void;
11
+ initCount?: number;
12
+ useInitalFunction?: boolean;
13
+ "data-testid"?: string;
14
+ title?: React.ReactNode;
15
+ }
16
+ export declare const PrivateCounter: Story<CounterArgs>;
17
+ export declare const ReadonlyCounter: Story<{
18
+ counterStateType?: "readonly" | "writable" | undefined;
19
+ }>;
20
+ export declare const WritableCounter: Story<{
21
+ counterStateType?: "readonly" | "writable" | undefined;
22
+ }>;
23
+ export declare const DynamicInitCount: Story;
24
+ export declare const ResetInput: Story<{
25
+ peopleList: {
26
+ firstName: string;
27
+ lastName: string;
28
+ }[];
29
+ }>;
30
+ export declare const RepeatedStates: Story<{
31
+ size: number;
32
+ }>;
33
+ export declare const NestedRepeatedCounter: Story<{}>;
34
+ export declare const MatrixRepeatedCounter: Story<{}>;
35
+ export declare const InitFuncFromInternalContextData: Story<{
36
+ products: {
37
+ price: number;
38
+ name: string;
39
+ }[];
40
+ }>;
41
+ export declare const InitFuncFromRootContextData: Story<{
42
+ products: {
43
+ price: number;
44
+ name: string;
45
+ }[];
46
+ }>;
47
+ export declare const InitFuncFromInternalContextDataWithDelay: Story<{
48
+ products: {
49
+ price: number;
50
+ name: string;
51
+ }[];
52
+ }>;
53
+ export declare const RepeatedImplicitState: Story<{}>;
54
+ interface Person {
55
+ firstName: string;
56
+ lastName: string;
57
+ nicknames: string[];
58
+ }
59
+ export declare const FormBuilder: Story<{
60
+ people: Person[];
61
+ }>;
62
+ export declare const FormBuilderImplicitStates: Story<{
63
+ people: Person[];
64
+ }>;
65
+ export declare const StateCellIsArray: Story<{
66
+ people: Person[];
67
+ }>;
68
+ export declare const StateCellIsMatrix: Story<{
69
+ board: number[][];
70
+ }>;
71
+ export declare const IsOnChangePropImmediatelyFired: Story<{}>;
72
+ export declare const ImmutableStateCells: Story<{
73
+ people: Person[];
74
+ }>;
75
+ export declare const InCanvasDollarState: Story<{}>;
76
+ export declare const AddDeleteSpecsInCanvas: Story<{}>;
77
+ export declare const TodoApp: Story<{}>;
78
+ export declare const CycleInStateInitialization: Story<{}>;
@@ -1 +1 @@
1
- export * from "@plasmicapp/data-sources";
1
+ export * from "@plasmicapp/data-sources";
@@ -1 +1 @@
1
- export * from "@plasmicapp/host";
1
+ export * from "@plasmicapp/host";
@@ -1 +1 @@
1
- export * from "@plasmicapp/query";
1
+ export * from "@plasmicapp/query";