@plasmicapp/react-web 0.2.109 → 0.2.112

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 (77) hide show
  1. package/dist/all.d.ts +30 -13
  2. package/dist/index-common.d.ts +1 -1
  3. package/dist/index.d.ts +1 -1
  4. package/dist/react-web.cjs.development.js +378 -349
  5. package/dist/react-web.cjs.development.js.map +1 -1
  6. package/dist/react-web.cjs.production.min.js +1 -1
  7. package/dist/react-web.cjs.production.min.js.map +1 -1
  8. package/dist/react-web.esm.js +375 -349
  9. package/dist/react-web.esm.js.map +1 -1
  10. package/dist/render/elements.d.ts +5 -0
  11. package/dist/states/helpers.d.ts +5 -0
  12. package/dist/states/index.d.ts +1 -1
  13. package/dist/states/valtio.d.ts +16 -0
  14. package/dist/stories/UseDollarState.stories.d.ts +11 -0
  15. package/package.json +6 -2
  16. package/skinny/dist/collection-utils-42de4441.js +244 -0
  17. package/skinny/dist/collection-utils-42de4441.js.map +1 -0
  18. package/skinny/dist/{collection-utils-3487dd27.js → collection-utils-bf37b8fb.js} +5 -5
  19. package/skinny/dist/collection-utils-bf37b8fb.js.map +1 -0
  20. package/skinny/dist/common-98719219.js +68 -0
  21. package/skinny/dist/common-98719219.js.map +1 -0
  22. package/skinny/dist/common-9efbae57.js +201 -0
  23. package/skinny/dist/common-9efbae57.js.map +1 -0
  24. package/skinny/dist/context-4ca6f5cd.js +6 -0
  25. package/skinny/dist/context-4ca6f5cd.js.map +1 -0
  26. package/skinny/dist/index-common.d.ts +1 -1
  27. package/skinny/dist/index.d.ts +1 -1
  28. package/skinny/dist/index.js +17 -4
  29. package/skinny/dist/index.js.map +1 -1
  30. package/skinny/dist/plume/checkbox/index.js +2 -1
  31. package/skinny/dist/plume/checkbox/index.js.map +1 -1
  32. package/skinny/dist/plume/menu/index.js +2 -1
  33. package/skinny/dist/plume/menu/index.js.map +1 -1
  34. package/skinny/dist/plume/menu-button/index.js +2 -1
  35. package/skinny/dist/plume/menu-button/index.js.map +1 -1
  36. package/skinny/dist/plume/select/index.js +2 -1
  37. package/skinny/dist/plume/select/index.js.map +1 -1
  38. package/skinny/dist/plume/switch/index.js +2 -1
  39. package/skinny/dist/plume/switch/index.js.map +1 -1
  40. package/skinny/dist/plume-utils-1e225de5.js +25 -0
  41. package/skinny/dist/plume-utils-1e225de5.js.map +1 -0
  42. package/skinny/dist/plume-utils-d2476af1.js +35 -0
  43. package/skinny/dist/plume-utils-d2476af1.js.map +1 -0
  44. package/skinny/dist/props-utils-c60d3105.js +8 -0
  45. package/skinny/dist/props-utils-c60d3105.js.map +1 -0
  46. package/skinny/dist/props-utils-cac0cccf.js +8 -0
  47. package/skinny/dist/props-utils-cac0cccf.js.map +1 -0
  48. package/skinny/dist/react-utils-6050fadc.js +201 -0
  49. package/skinny/dist/react-utils-6050fadc.js.map +1 -0
  50. package/skinny/dist/react-utils-b5dc6320.js +155 -0
  51. package/skinny/dist/react-utils-b5dc6320.js.map +1 -0
  52. package/skinny/dist/render/PlasmicHead/index.js +14 -9
  53. package/skinny/dist/render/PlasmicHead/index.js.map +1 -1
  54. package/skinny/dist/render/elements.d.ts +5 -0
  55. package/skinny/dist/ssr-68913b60.js +107 -0
  56. package/skinny/dist/ssr-68913b60.js.map +1 -0
  57. package/skinny/dist/{ssr-84e27ffb.js → ssr-d3321868.js} +9 -4
  58. package/skinny/dist/ssr-d3321868.js.map +1 -0
  59. package/skinny/dist/{ssr-b1615b80.js → ssr-f4053cdd.js} +1 -1
  60. package/skinny/dist/{ssr-84e27ffb.js.map → ssr-f4053cdd.js.map} +1 -1
  61. package/skinny/dist/states/helpers.d.ts +5 -0
  62. package/skinny/dist/states/index.d.ts +1 -1
  63. package/skinny/dist/states/valtio copy.d.ts +15 -0
  64. package/skinny/dist/states/valtio.d.ts +16 -0
  65. package/skinny/dist/stories/UseDollarState.stories.d.ts +11 -0
  66. package/skinny/dist/stories/UseDollarState.test.d.ts +11 -0
  67. package/skinny/dist/stories/UseDollarState2.stories.d.ts +7 -0
  68. package/skinny/dist/collection-utils-3487dd27.js.map +0 -1
  69. package/skinny/dist/ssr-14264281.js +0 -158
  70. package/skinny/dist/ssr-14264281.js.map +0 -1
  71. package/skinny/dist/ssr-5141fc77.js +0 -158
  72. package/skinny/dist/ssr-5141fc77.js.map +0 -1
  73. package/skinny/dist/ssr-579df58f.js +0 -158
  74. package/skinny/dist/ssr-579df58f.js.map +0 -1
  75. package/skinny/dist/ssr-b1615b80.js.map +0 -1
  76. package/skinny/dist/ssr-d2fd94f2.js +0 -31
  77. package/skinny/dist/ssr-d2fd94f2.js.map +0 -1
package/dist/all.d.ts CHANGED
@@ -21,6 +21,23 @@ declare function omit<T>(obj: T, ...keys: (keyof T)[]): Partial<T>;
21
21
  declare type StrictProps<T, TExpected> = Exclude<keyof T, keyof TExpected> extends never ? {} : Partial<"Unexpected extraneous props">;
22
22
  declare type HTMLElementRefOf<T extends keyof JSX.IntrinsicElements> = Exclude<React__default.ComponentProps<T>["ref"], string>;
23
23
 
24
+ declare type InitFunc$1<T> = ($props: Record<string, any>, $state: $State$1, indexes: number[]) => T;
25
+ interface $State$1 {
26
+ [key: string]: any;
27
+ registerInitFunc?: (path: string, f: InitFunc$1<any>) => any;
28
+ }
29
+ interface $StateSpec<T> {
30
+ path: string;
31
+ initFunc?: InitFunc$1<T>;
32
+ initVal?: T;
33
+ type: "private" | "readonly" | "writable";
34
+ valueProp?: string;
35
+ onChangeProp?: string;
36
+ }
37
+ declare function useDollarState(specs: $StateSpec<any>[], props: Record<string, any>): any;
38
+
39
+ declare function useCanvasDollarState(specs: $StateSpec<any>[], props: Record<string, any>): any;
40
+
24
41
  interface Variants {
25
42
  [vg: string]: any;
26
43
  }
@@ -69,6 +86,10 @@ declare function wrapWithClassName(element: React.ReactNode, className: string):
69
86
  display: "grid";
70
87
  };
71
88
  }, HTMLElement>;
89
+ declare function mergeVariantsWithStates(variants: Variants, $state: $State$1, linkedStates: {
90
+ variantGroup: string;
91
+ statePath: (string | number)[];
92
+ }[]): Variants;
72
93
  declare function deriveRenderOpts(props: Record<string, any>, config: {
73
94
  name: string;
74
95
  descendantNames: string[];
@@ -1574,17 +1595,8 @@ declare const TriggeredOverlayContext: React.Context<TriggeredOverlayContextValu
1574
1595
  declare type InitFunc<T> = ($props: Record<string, any>, $state: $State) => T;
1575
1596
  interface $State {
1576
1597
  [key: string]: any;
1577
- registerInitFunc: (path: string, f: InitFunc<any>) => any;
1578
- }
1579
- interface $StateSpec<T> {
1580
- path: string;
1581
- initFunc?: InitFunc<T>;
1582
- initVal?: T;
1583
- type: "private" | "readonly" | "writable";
1584
- valueProp?: string;
1585
- onChangeProp?: string;
1586
- }
1587
- declare function useVanillaDollarState(_specs: $StateSpec<any>[], props: Record<string, any>): $State;
1598
+ registerInitFunc?: (path: string, f: InitFunc<any>) => any;
1599
+ }
1588
1600
 
1589
1601
  declare function generateStateOnChangeProp($state: $State, stateName: string, dataReps: number[]): (val: any, path: (string | number)[]) => void;
1590
1602
  /**
@@ -1593,6 +1605,11 @@ declare function generateStateOnChangeProp($state: $State, stateName: string, da
1593
1605
  * - parent[][].counter[].count
1594
1606
  * We need to pass `parent[index1][index2].counter to the child component
1595
1607
  */
1596
- declare function generateStateValueProp($state: $State, path: (string | number)[]): any;
1608
+ declare function generateStateValueProp($state: $State, path: (string | number)[]): any;
1609
+ /**
1610
+ * Forked from https://github.com/lukeed/dset
1611
+ * Changes: fixed setting a deep value to a proxy object
1612
+ */
1613
+ declare function set(obj: any, keys: any, val: any): void;
1597
1614
 
1598
- export { BaseButtonProps, BaseMenuButtonProps, BaseMenuGroupProps, BaseMenuItemProps, BaseMenuProps, BaseSelectOptionGroupProps, BaseSelectOptionProps, BaseSelectProps, BaseTextInputProps, BaseTriggeredOverlayProps, ButtonRef, CheckboxProps, CheckboxRef, CheckboxRefValue, DropdownMenu, Flex, HTMLElementRefOf, HtmlAnchorOnlyProps, HtmlButtonOnlyProps, MenuButtonRef, MenuButtonRefValue, MenuRef, MenuRefValue, MultiChoiceArg, PlasmicHead, PlasmicIcon, PlasmicImg, PlasmicLink, PlasmicRootProvider, PlasmicSlot, SelectContext, SelectOptionRef, SelectRef, SelectRefValue, SingleBooleanChoiceArg, SingleChoiceArg, Stack, StrictProps, SwitchProps, SwitchRef, SwitchRefValue, TextInputRef, TextInputRefValue, Trans, TriggeredOverlayConfig, TriggeredOverlayContext, TriggeredOverlayRef, classNames, createPlasmicElementProxy, createUseScreenVariants, deriveRenderOpts, ensureGlobalVariants, genTranslatableString, generateStateOnChangeProp, generateStateValueProp, getDataProps, hasVariant, makeFragment, omit, pick, plasmicHeadMeta, renderPlasmicSlot, setPlumeStrictMode, useButton, useCheckbox, useVanillaDollarState as useDollarState, useIsSSR, useMenu, useMenuButton, useMenuGroup, useMenuItem, useSelect, useSelectOption, useSelectOptionGroup, useSwitch, useTextInput, useTrigger, useTriggeredOverlay, wrapWithClassName };
1615
+ export { $State$1 as $State, BaseButtonProps, BaseMenuButtonProps, BaseMenuGroupProps, BaseMenuItemProps, BaseMenuProps, BaseSelectOptionGroupProps, BaseSelectOptionProps, BaseSelectProps, BaseTextInputProps, BaseTriggeredOverlayProps, ButtonRef, CheckboxProps, CheckboxRef, CheckboxRefValue, DropdownMenu, Flex, HTMLElementRefOf, HtmlAnchorOnlyProps, HtmlButtonOnlyProps, MenuButtonRef, MenuButtonRefValue, MenuRef, MenuRefValue, MultiChoiceArg, PlasmicHead, PlasmicIcon, PlasmicImg, PlasmicLink, PlasmicRootProvider, PlasmicSlot, SelectContext, SelectOptionRef, SelectRef, SelectRefValue, SingleBooleanChoiceArg, SingleChoiceArg, Stack, StrictProps, SwitchProps, SwitchRef, SwitchRefValue, TextInputRef, TextInputRefValue, Trans, TriggeredOverlayConfig, TriggeredOverlayContext, TriggeredOverlayRef, classNames, createPlasmicElementProxy, createUseScreenVariants, deriveRenderOpts, ensureGlobalVariants, genTranslatableString, generateStateOnChangeProp, generateStateValueProp, getDataProps, hasVariant, makeFragment, mergeVariantsWithStates, omit, pick, plasmicHeadMeta, renderPlasmicSlot, set, setPlumeStrictMode, useButton, useCanvasDollarState, useCheckbox, useDollarState, useIsSSR, useMenu, useMenuButton, useMenuGroup, useMenuItem, useSelect, useSelectOption, useSelectOptionGroup, useSwitch, useTextInput, useTrigger, useTriggeredOverlay, wrapWithClassName };
@@ -1,7 +1,7 @@
1
1
  export declare const classNames: import("classnames/types").ClassNamesExport;
2
2
  export { omit, pick } from "./common";
3
3
  export { HTMLElementRefOf, StrictProps } from "./react-utils";
4
- export { createPlasmicElementProxy, deriveRenderOpts, Flex, hasVariant, makeFragment, MultiChoiceArg, SingleBooleanChoiceArg, SingleChoiceArg, wrapWithClassName, } from "./render/elements";
4
+ export { createPlasmicElementProxy, deriveRenderOpts, Flex, hasVariant, makeFragment, mergeVariantsWithStates, MultiChoiceArg, SingleBooleanChoiceArg, SingleChoiceArg, wrapWithClassName, } from "./render/elements";
5
5
  export { ensureGlobalVariants } from "./render/global-variants";
6
6
  export { PlasmicHead, plasmicHeadMeta } from "./render/PlasmicHead";
7
7
  export { PlasmicIcon } from "./render/PlasmicIcon";
package/dist/index.d.ts CHANGED
@@ -10,4 +10,4 @@ export * from "./plume/switch";
10
10
  export * from "./plume/text-input";
11
11
  export * from "./plume/triggered-overlay";
12
12
  export * from "./states/helpers";
13
- export { default as useDollarState } from "./states/index";
13
+ export { $State, default as useDollarState, useCanvasDollarState, } from "./states/valtio";