@plasmicapp/react-web 0.2.140 → 0.2.142

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 (39) hide show
  1. package/dist/all.d.ts +29 -30
  2. package/dist/auth/PlasmicPageGuard.d.ts +6 -4
  3. package/dist/react-web.cjs.development.js +952 -114
  4. package/dist/react-web.cjs.development.js.map +1 -1
  5. package/dist/react-web.cjs.production.min.js +1 -1
  6. package/dist/react-web.cjs.production.min.js.map +1 -1
  7. package/dist/react-web.esm.js +952 -114
  8. package/dist/react-web.esm.js.map +1 -1
  9. package/dist/states/graph.d.ts +10 -4
  10. package/dist/states/helpers.d.ts +7 -9
  11. package/dist/states/valtio.d.ts +3 -1
  12. package/dist/stories/UseDollarState.stories.d.ts +7 -0
  13. package/package.json +2 -2
  14. package/skinny/dist/auth/PlasmicPageGuard.d.ts +6 -4
  15. package/skinny/dist/{collection-utils-43f97262.js → collection-utils-b5d4be02.js} +4 -4
  16. package/skinny/dist/{collection-utils-43f97262.js.map → collection-utils-b5d4be02.js.map} +1 -1
  17. package/skinny/dist/{common-9ebe374e.js → common-c2744215.js} +40 -2
  18. package/skinny/dist/{common-9ebe374e.js.map → common-c2744215.js.map} +1 -1
  19. package/skinny/dist/index.js +219 -90
  20. package/skinny/dist/index.js.map +1 -1
  21. package/skinny/dist/plume/button/index.js +2 -2
  22. package/skinny/dist/plume/checkbox/index.js +4 -4
  23. package/skinny/dist/plume/menu/index.js +5 -5
  24. package/skinny/dist/plume/menu-button/index.js +4 -4
  25. package/skinny/dist/plume/select/index.js +5 -5
  26. package/skinny/dist/plume/switch/index.js +4 -4
  27. package/skinny/dist/plume/text-input/index.js +2 -2
  28. package/skinny/dist/plume/triggered-overlay/index.js +4 -4
  29. package/skinny/dist/{plume-utils-d9811bf3.js → plume-utils-653f4b8a.js} +2 -2
  30. package/skinny/dist/{plume-utils-d9811bf3.js.map → plume-utils-653f4b8a.js.map} +1 -1
  31. package/skinny/dist/{props-utils-228208e6.js → props-utils-70c2d02a.js} +2 -2
  32. package/skinny/dist/{props-utils-228208e6.js.map → props-utils-70c2d02a.js.map} +1 -1
  33. package/skinny/dist/{react-utils-7bc53870.js → react-utils-76d05959.js} +2 -2
  34. package/skinny/dist/{react-utils-7bc53870.js.map → react-utils-76d05959.js.map} +1 -1
  35. package/skinny/dist/render/PlasmicImg/index.js +2 -2
  36. package/skinny/dist/states/graph.d.ts +10 -4
  37. package/skinny/dist/states/helpers.d.ts +7 -9
  38. package/skinny/dist/states/valtio.d.ts +3 -1
  39. package/skinny/dist/stories/UseDollarState.stories.d.ts +7 -0
package/dist/all.d.ts CHANGED
@@ -17,29 +17,13 @@ type Argument = Value | Mapping | Argument[];
17
17
 
18
18
  declare function classNames$1(...args: Argument[]): string;
19
19
 
20
- interface PlasmicDataSourceContextValue {
21
- userAuthToken?: string;
22
- isUserLoading?: boolean;
23
- user?: {
24
- id: string;
25
- email: string;
26
- roleId: string;
27
- properties: Record<string, unknown> | null;
28
- };
29
- }
30
- declare function useCurrentUser(): {
31
- id: string;
32
- email: string;
33
- roleId: string;
34
- properties: Record<string, unknown> | null;
35
- } | undefined;
36
- declare const PlasmicDataSourceContextProvider: React__default.Provider<PlasmicDataSourceContextValue | undefined>;
37
-
38
- declare function PlasmicPageGuard(props: {
20
+ interface PlasmicPageGuardProps {
21
+ appId: string;
22
+ authorizeEndpoint: string;
39
23
  children: React__default.ReactNode;
40
- dataSourceCtxValue: PlasmicDataSourceContextValue | undefined;
41
24
  validRoles: string[];
42
- }): {} | null | undefined;
25
+ }
26
+ declare function PlasmicPageGuard(props: PlasmicPageGuardProps): {} | null | undefined;
43
27
 
44
28
  declare function pick<T extends {}>(obj: T, ...keys: (string | number | symbol)[]): Partial<T>;
45
29
  declare function omit<T extends {}>(obj: T, ...keys: (keyof T)[]): Partial<T>;
@@ -52,6 +36,7 @@ declare type HTMLElementRefOf<T extends keyof JSX.IntrinsicElements> = Exclude<R
52
36
  declare function dlv(object: object, key: string | Array<string | number>, defaultValue?: any): any;
53
37
 
54
38
  declare type InitFunc<T> = ($props: Record<string, any>, $state: $State, $ctx: Record<string, any>, indexes?: number[]) => T;
39
+ declare type ObjectPath = (string | number)[];
55
40
  interface $StateSpec<T> {
56
41
  path: string;
57
42
  initFunc?: InitFunc<T>;
@@ -66,14 +51,8 @@ interface $State {
66
51
  registerInitFunc?: (path: string, f: InitFunc<any>, repetitonIndex?: number[]) => any;
67
52
  }
68
53
 
69
- declare function generateStateOnChangeProp($state: $State, stateName: string, dataReps: number[]): (val: any, path: (string | number)[]) => void;
70
- /**
71
- * This function generate the state value prop for repeated states
72
- * Example:
73
- * - parent[][].counter[].count
74
- * We need to pass `parent[index1][index2].counter to the child component
75
- */
76
- declare function generateStateValueProp($state: $State, path: (string | number)[]): any;
54
+ declare function generateStateOnChangeProp($state: $State, path: ObjectPath): (val: any) => void;
55
+ declare function generateStateValueProp($state: $State, path: ObjectPath): any;
77
56
  declare function isPlasmicStateProxy(obj: any): any;
78
57
  /**
79
58
  * Forked from https://github.com/lukeed/dset
@@ -81,7 +60,9 @@ declare function isPlasmicStateProxy(obj: any): any;
81
60
  */
82
61
  declare function set(obj: any, keys: any, val: any): void;
83
62
 
84
- declare function useDollarState(specs: $StateSpec<any>[], props: Record<string, any>, $ctx?: Record<string, any>): $State;
63
+ declare function useDollarState(specs: $StateSpec<any>[], props: Record<string, any>, $ctx?: Record<string, any>, opts?: {
64
+ inCanvas: boolean;
65
+ }): $State;
85
66
 
86
67
  interface Variants {
87
68
  [vg: string]: any;
@@ -311,6 +292,24 @@ declare function genTranslatableString(elt: React__default.ReactNode): {
311
292
  };
312
293
  declare function Trans({ transKey, children }: TransProps): React__default.ReactNode;
313
294
 
295
+ interface PlasmicDataSourceContextValue {
296
+ userAuthToken?: string;
297
+ isUserLoading?: boolean;
298
+ user?: {
299
+ id: string;
300
+ email: string;
301
+ roleId: string;
302
+ properties: Record<string, unknown> | null;
303
+ };
304
+ }
305
+ declare function useCurrentUser(): {
306
+ id: string;
307
+ email: string;
308
+ roleId: string;
309
+ properties: Record<string, unknown> | null;
310
+ } | undefined;
311
+ declare const PlasmicDataSourceContextProvider: React__default.Provider<PlasmicDataSourceContextValue | undefined>;
312
+
314
313
  interface PlasmicRootProviderProps {
315
314
  platform?: "nextjs" | "gatsby";
316
315
  children?: React.ReactNode;
@@ -1,7 +1,9 @@
1
- import { PlasmicDataSourceContextValue } from "@plasmicapp/data-sources-context";
2
1
  import React from "react";
3
- export declare function PlasmicPageGuard(props: {
2
+ interface PlasmicPageGuardProps {
3
+ appId: string;
4
+ authorizeEndpoint: string;
4
5
  children: React.ReactNode;
5
- dataSourceCtxValue: PlasmicDataSourceContextValue | undefined;
6
6
  validRoles: string[];
7
- }): {} | null | undefined;
7
+ }
8
+ export declare function PlasmicPageGuard(props: PlasmicPageGuardProps): {} | null | undefined;
9
+ export {};