@plasmicapp/react-web 0.2.136 → 0.2.138
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.
- package/dist/all.d.ts +49 -46
- package/dist/auth/PlasmicPageGuard.d.ts +7 -0
- package/dist/index-common.d.ts +2 -3
- package/dist/react-web.cjs.development.js +708 -1087
- package/dist/react-web.cjs.development.js.map +1 -1
- package/dist/react-web.cjs.production.min.js +1 -1
- package/dist/react-web.cjs.production.min.js.map +1 -1
- package/dist/react-web.esm.js +710 -1086
- package/dist/react-web.esm.js.map +1 -1
- package/dist/render/translation.d.ts +2 -1
- package/dist/states/graph.d.ts +23 -2
- package/dist/states/helpers.d.ts +7 -6
- package/dist/states/index.d.ts +4 -24
- package/dist/states/types.d.ts +24 -0
- package/dist/states/valtio.d.ts +2 -3
- package/dist/stories/UseDollarState.stories.d.ts +1 -0
- package/package.json +5 -6
- package/skinny/dist/auth/PlasmicPageGuard.d.ts +7 -0
- package/skinny/dist/index-common.d.ts +2 -3
- package/skinny/dist/index.js +393 -319
- package/skinny/dist/index.js.map +1 -1
- package/skinny/dist/plume/checkbox/index.js +1 -1
- package/skinny/dist/plume/menu/index.js +1 -1
- package/skinny/dist/plume/menu-button/index.js +1 -1
- package/skinny/dist/plume/select/index.js +1 -1
- package/skinny/dist/plume/switch/index.js +1 -1
- package/skinny/dist/render/translation.d.ts +2 -1
- package/skinny/dist/{ssr-b16a1854.js → ssr-f6caec06.js} +7 -6
- package/skinny/dist/ssr-f6caec06.js.map +1 -0
- package/skinny/dist/states/graph.d.ts +23 -2
- package/skinny/dist/states/helpers.d.ts +7 -6
- package/skinny/dist/states/index.d.ts +4 -24
- package/skinny/dist/states/types.d.ts +24 -0
- package/skinny/dist/states/valtio.d.ts +2 -3
- package/skinny/dist/stories/UseDollarState.stories.d.ts +1 -0
- package/skinny/dist/ssr-b16a1854.js.map +0 -1
|
@@ -6,6 +6,7 @@ export declare type PlasmicTranslator = (str: string, opts?: {
|
|
|
6
6
|
}) => React.ReactNode;
|
|
7
7
|
export declare const PlasmicTranslatorContext: React.Context<PlasmicTranslator | undefined>;
|
|
8
8
|
export interface TransProps {
|
|
9
|
+
transKey?: string;
|
|
9
10
|
children?: React.ReactNode;
|
|
10
11
|
}
|
|
11
12
|
export declare function genTranslatableString(elt: React.ReactNode): {
|
|
@@ -15,4 +16,4 @@ export declare function genTranslatableString(elt: React.ReactNode): {
|
|
|
15
16
|
};
|
|
16
17
|
componentsCount: number;
|
|
17
18
|
};
|
|
18
|
-
export declare function Trans({ children }: TransProps): React.ReactNode;
|
|
19
|
+
export declare function Trans({ transKey, children }: TransProps): React.ReactNode;
|
package/dist/states/graph.d.ts
CHANGED
|
@@ -1,15 +1,36 @@
|
|
|
1
|
-
import { $StateSpec, Internal$StateSpec } from "
|
|
1
|
+
import { $StateSpec, InitFunc, Internal$StateSpec, ObjectPath } from "./types";
|
|
2
|
+
export interface StateCell<T> {
|
|
3
|
+
initialValue?: T | Symbol;
|
|
4
|
+
path: ObjectPath;
|
|
5
|
+
registeredInitFunc?: InitFunc<T>;
|
|
6
|
+
listeners: (() => void)[];
|
|
7
|
+
}
|
|
2
8
|
export declare class StateSpecNode<T> {
|
|
3
9
|
private specs;
|
|
4
10
|
private edges;
|
|
11
|
+
private state;
|
|
5
12
|
constructor(specs: Internal$StateSpec<T>[]);
|
|
6
13
|
hasEdge(key: string | symbol): boolean;
|
|
7
14
|
addEdge(key: string | symbol, node: StateSpecNode<any>): void;
|
|
15
|
+
children(): IterableIterator<StateSpecNode<any>>;
|
|
8
16
|
makeTransition(key: string | symbol | number): StateSpecNode<any> | undefined;
|
|
9
17
|
isLeaf(): boolean;
|
|
10
18
|
hasArrayTransition(): boolean;
|
|
11
19
|
getSpec(): Internal$StateSpec<T>;
|
|
12
20
|
getAllSpecs(): Internal$StateSpec<T>[];
|
|
21
|
+
getState(path: ObjectPath): StateCell<T>;
|
|
22
|
+
clearStates(): void;
|
|
23
|
+
states(): StateCell<T>[];
|
|
24
|
+
hasState(path: ObjectPath): boolean;
|
|
25
|
+
createStateCell(path: ObjectPath): void;
|
|
26
|
+
setInitialValue(path: ObjectPath, value: any): void;
|
|
27
|
+
getInitialValue(path: ObjectPath): Symbol | T | undefined;
|
|
28
|
+
addListener(path: ObjectPath, f: () => void): void;
|
|
13
29
|
}
|
|
14
30
|
export declare const transformPathStringToObj: (str: string) => (string | symbol)[];
|
|
15
|
-
export declare function
|
|
31
|
+
export declare function buildTree(specs: $StateSpec<any>[]): StateSpecNode<any>;
|
|
32
|
+
export declare function getLeaves(root: StateSpecNode<any>): StateSpecNode<any>[];
|
|
33
|
+
export declare function findStateCell(root: StateSpecNode<any>, pathStr: string, repetitionIndex?: number[]): {
|
|
34
|
+
node: StateSpecNode<any>;
|
|
35
|
+
realPath: ObjectPath;
|
|
36
|
+
};
|
package/dist/states/helpers.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import get from "dlv";
|
|
2
1
|
import { useLayoutEffect } from "react";
|
|
3
|
-
import { $State } from "
|
|
2
|
+
import { $State } from "./types";
|
|
4
3
|
export declare function generateStateOnChangeProp($state: $State, stateName: string, dataReps: number[]): (val: any, path: (string | number)[]) => void;
|
|
5
4
|
/**
|
|
6
5
|
* This function generate the state value prop for repeated states
|
|
@@ -9,12 +8,14 @@ export declare function generateStateOnChangeProp($state: $State, stateName: str
|
|
|
9
8
|
* We need to pass `parent[index1][index2].counter to the child component
|
|
10
9
|
*/
|
|
11
10
|
export declare function generateStateValueProp($state: $State, path: (string | number)[]): any;
|
|
11
|
+
export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
|
|
12
|
+
export declare function shallowEqual<T>(a1: T[], a2: T[]): boolean;
|
|
13
|
+
export declare function isNum(value: string | number | symbol): value is number;
|
|
14
|
+
declare type StringGen = string | (() => string);
|
|
15
|
+
export declare function assert<T>(cond: T, msg?: StringGen): asserts cond;
|
|
12
16
|
/**
|
|
13
17
|
* Forked from https://github.com/lukeed/dset
|
|
14
18
|
* Changes: fixed setting a deep value to a proxy object
|
|
15
19
|
*/
|
|
16
20
|
export declare function set(obj: any, keys: any, val: any): void;
|
|
17
|
-
export
|
|
18
|
-
export declare function shallowEqual<T>(a1: T[], a2: T[]): boolean;
|
|
19
|
-
export declare function isNum(value: string | number | symbol): value is number;
|
|
20
|
-
export { get };
|
|
21
|
+
export {};
|
package/dist/states/index.d.ts
CHANGED
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
initFunc?: InitFunc<T>;
|
|
6
|
-
initVal?: T;
|
|
7
|
-
type: "private" | "readonly" | "writable";
|
|
8
|
-
valueProp?: string;
|
|
9
|
-
onChangeProp?: string;
|
|
10
|
-
isImmutable?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface $State {
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
registerInitFunc?: (path: string, f: InitFunc<any>) => any;
|
|
15
|
-
}
|
|
16
|
-
export declare const ARRAY_SYMBOL: unique symbol;
|
|
17
|
-
export interface Internal$StateSpec<T> extends $StateSpec<T> {
|
|
18
|
-
isRepeated: boolean;
|
|
19
|
-
pathObj: (string | symbol)[];
|
|
20
|
-
}
|
|
21
|
-
export interface Internal$StateInstance {
|
|
22
|
-
path: ObjectPath;
|
|
23
|
-
specKey: string;
|
|
24
|
-
}
|
|
1
|
+
export { default as get } from "dlv";
|
|
2
|
+
export { generateStateOnChangeProp, generateStateValueProp, set, } from "./helpers";
|
|
3
|
+
export { $State } from "./types";
|
|
4
|
+
export { useDollarState } from "./valtio";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare type InitFunc<T> = ($props: Record<string, any>, $state: $State, $ctx: Record<string, any>, indexes?: number[]) => T;
|
|
2
|
+
export declare type ObjectPath = (string | number)[];
|
|
3
|
+
export interface $StateSpec<T> {
|
|
4
|
+
path: string;
|
|
5
|
+
initFunc?: InitFunc<T>;
|
|
6
|
+
initVal?: T;
|
|
7
|
+
type: "private" | "readonly" | "writable";
|
|
8
|
+
valueProp?: string;
|
|
9
|
+
onChangeProp?: string;
|
|
10
|
+
isImmutable?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface $State {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
registerInitFunc?: (path: string, f: InitFunc<any>, repetitonIndex?: number[]) => any;
|
|
15
|
+
}
|
|
16
|
+
export declare const ARRAY_SYMBOL: unique symbol;
|
|
17
|
+
export interface Internal$StateSpec<T> extends $StateSpec<T> {
|
|
18
|
+
isRepeated: boolean;
|
|
19
|
+
pathObj: (string | symbol)[];
|
|
20
|
+
}
|
|
21
|
+
export interface Internal$StateInstance {
|
|
22
|
+
path: ObjectPath;
|
|
23
|
+
specKey: string;
|
|
24
|
+
}
|
package/dist/states/valtio.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { $StateSpec } from "
|
|
2
|
-
export declare function useDollarState(specs: $StateSpec<any>[], props: Record<string, any>, $ctx?: Record<string, any>):
|
|
1
|
+
import { $State, $StateSpec } from "./types";
|
|
2
|
+
export declare function useDollarState(specs: $StateSpec<any>[], props: Record<string, any>, $ctx?: Record<string, any>): $State;
|
|
3
3
|
export default useDollarState;
|
|
4
|
-
export declare function useCanvasDollarState(specs: $StateSpec<any>[], props: Record<string, any>, $ctx?: Record<string, any>): {};
|
|
@@ -58,6 +58,7 @@ export declare const StateCellIsArray: import("@storybook/csf").AnnotatedStoryFn
|
|
|
58
58
|
export declare const StateCellIsMatrix: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, {
|
|
59
59
|
board: number[][];
|
|
60
60
|
}>;
|
|
61
|
+
export declare const IsOnChangePropImmediatelyFired: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, {}>;
|
|
61
62
|
export declare const ImmutableStateCells: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, {
|
|
62
63
|
people: Person[];
|
|
63
64
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/react-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.138",
|
|
4
4
|
"description": "plasmic library for rendering in the presentational style",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
},
|
|
41
41
|
"prettier": {},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@plasmicapp/data-sources": "0.1.
|
|
44
|
-
"@plasmicapp/data-sources-context": "0.1.
|
|
45
|
-
"@plasmicapp/host": "1.0.
|
|
43
|
+
"@plasmicapp/data-sources": "0.1.23",
|
|
44
|
+
"@plasmicapp/data-sources-context": "0.1.3",
|
|
45
|
+
"@plasmicapp/host": "1.0.93",
|
|
46
46
|
"@plasmicapp/query": "0.1.58",
|
|
47
47
|
"@react-aria/checkbox": "^3.5.0",
|
|
48
48
|
"@react-aria/focus": "^3.7.0",
|
|
@@ -65,7 +65,6 @@
|
|
|
65
65
|
"classnames": "^2.2.6",
|
|
66
66
|
"clone": "^2.1.2",
|
|
67
67
|
"dlv": "^1.1.3",
|
|
68
|
-
"dset": "^3.1.2",
|
|
69
68
|
"fast-deep-equal": "^3.1.3",
|
|
70
69
|
"valtio": "^1.6.3"
|
|
71
70
|
},
|
|
@@ -110,5 +109,5 @@
|
|
|
110
109
|
"react": ">=16.8.0",
|
|
111
110
|
"react-dom": ">=16.8.0"
|
|
112
111
|
},
|
|
113
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "29e95851972acf14bf3ff15462022d322f4c6b57"
|
|
114
113
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PlasmicDataSourceContextValue } from "@plasmicapp/data-sources-context";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export declare function PlasmicPageGuard(props: {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
dataSourceCtxValue: PlasmicDataSourceContextValue | undefined;
|
|
6
|
+
validRoles: string[];
|
|
7
|
+
}): React.ReactNode;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _classNames from "classnames";
|
|
2
|
+
export { PlasmicPageGuard } from "./auth/PlasmicPageGuard";
|
|
2
3
|
export { omit, pick } from "./common";
|
|
3
4
|
export { HTMLElementRefOf, StrictProps } from "./react-utils";
|
|
4
5
|
export { createPlasmicElementProxy, deriveRenderOpts, Flex, hasVariant, makeFragment, mergeVariantsWithStates, MultiChoiceArg, SingleBooleanChoiceArg, SingleChoiceArg, wrapWithClassName, } from "./render/elements";
|
|
@@ -13,7 +14,5 @@ export { PlasmicDataSourceContextProvider, PlasmicRootProvider, useCurrentUser,
|
|
|
13
14
|
export { Stack } from "./render/Stack";
|
|
14
15
|
export { genTranslatableString, Trans } from "./render/translation";
|
|
15
16
|
export { useTrigger } from "./render/triggers";
|
|
16
|
-
export
|
|
17
|
-
export * from "./states/helpers";
|
|
18
|
-
export { default as useDollarState, useCanvasDollarState, } from "./states/valtio";
|
|
17
|
+
export * from "./states";
|
|
19
18
|
export declare const classNames: typeof _classNames;
|