@plasmicapp/react-web 0.2.197 → 0.2.199
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/index.cjs.js +3845 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/plume/button/index.d.ts +4 -4
- package/dist/plume/checkbox/index.d.ts +1 -1
- package/dist/plume/collection-utils.d.ts +7 -7
- package/dist/plume/collection-utils.spec.d.ts +1 -0
- package/dist/plume/menu/menu.d.ts +1 -1
- package/dist/plume/menu-button/menu-button.d.ts +1 -1
- package/dist/plume/menu-button/menu-trigger.d.ts +1 -1
- package/dist/plume/plume-utils.d.ts +13 -13
- package/dist/plume/select/select-option.d.ts +1 -1
- package/dist/plume/select/select.d.ts +1 -1
- package/dist/plume/switch/index.d.ts +1 -1
- package/dist/plume/text-input/index.d.ts +1 -1
- package/dist/plume/triggered-overlay/triggered-overlay.d.ts +1 -1
- package/dist/react-utils.d.ts +3 -3
- package/dist/react-utils.spec.d.ts +1 -0
- package/dist/react-web.esm.js +3615 -4538
- package/dist/react-web.esm.js.map +1 -1
- package/dist/render/PlasmicHead/index.d.ts +2 -2
- package/dist/render/PlasmicImg/index.d.ts +1 -1
- package/dist/render/Stack.d.ts +1 -1
- package/dist/render/elements.d.ts +12 -12
- package/dist/render/screen-variants.d.ts +1 -1
- package/dist/render/translation.d.ts +2 -2
- package/dist/render/triggers.d.ts +1 -1
- package/dist/states/helpers.d.ts +1 -1
- package/dist/states/types.d.ts +6 -6
- package/dist/stories/PlasmicImg.stories.d.ts +3 -2
- package/dist/stories/UseDollarState.stories.d.ts +23 -22
- package/package.json +15 -42
- package/dist/all.d.ts +0 -13357
- package/dist/index.js +0 -8
- package/dist/react-web.cjs.development.js +0 -4737
- package/dist/react-web.cjs.development.js.map +0 -1
- package/dist/react-web.cjs.production.min.js +0 -2
- package/dist/react-web.cjs.production.min.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export declare const PlasmicHeadContext: React.Context<React.
|
|
3
|
-
|
|
2
|
+
export declare const PlasmicHeadContext: React.Context<React.ComponentType<any> | undefined>;
|
|
3
|
+
type PlasmicHeadProps = {
|
|
4
4
|
title?: string;
|
|
5
5
|
description?: string;
|
|
6
6
|
image?: string;
|
|
@@ -11,7 +11,7 @@ export interface ImageLoader {
|
|
|
11
11
|
format?: "webp";
|
|
12
12
|
}) => string;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
type ImgTagProps = Omit<React.ComponentProps<"img">, "src" | "srcSet" | "ref" | "style">;
|
|
15
15
|
export interface PlasmicImgProps extends ImgTagProps {
|
|
16
16
|
/**
|
|
17
17
|
* Either an object with the src string, and its full width and height,
|
package/dist/render/Stack.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export declare const Stack: (<T extends
|
|
2
|
+
export declare const Stack: (<T extends keyof JSX.IntrinsicElements = "div">(props: {
|
|
3
3
|
as?: T | undefined;
|
|
4
4
|
hasGap?: boolean | undefined;
|
|
5
5
|
} & React.ComponentProps<T>) => React.ReactElement) & {
|
|
@@ -3,33 +3,33 @@ import { $State } from "../states";
|
|
|
3
3
|
interface Variants {
|
|
4
4
|
[vg: string]: any;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
6
|
+
export type MultiChoiceArg<M extends string> = M | M[] | {
|
|
7
7
|
[v in M]?: boolean;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
10
|
-
export
|
|
9
|
+
export type SingleChoiceArg<M extends string> = M;
|
|
10
|
+
export type SingleBooleanChoiceArg<M extends string> = M | boolean;
|
|
11
11
|
interface OverrideTwiddle {
|
|
12
12
|
wrapChildren?: (children: React.ReactNode) => React.ReactNode;
|
|
13
13
|
wrap?: (node: React.ReactNode) => React.ReactNode;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type DefaultOverride<C extends React.ElementType> = {
|
|
16
16
|
type: "default";
|
|
17
17
|
props?: Partial<React.ComponentProps<C>>;
|
|
18
18
|
} & OverrideTwiddle;
|
|
19
|
-
export
|
|
19
|
+
export type AsOverride<C extends React.ElementType> = {
|
|
20
20
|
type: "as";
|
|
21
21
|
as: C;
|
|
22
22
|
props?: Partial<React.ComponentProps<C>>;
|
|
23
23
|
} & OverrideTwiddle;
|
|
24
|
-
export
|
|
24
|
+
export type RenderOverride<C extends React.ElementType> = {
|
|
25
25
|
type: "render";
|
|
26
26
|
render: (props: React.ComponentProps<C>, Comp: C) => React.ReactNode;
|
|
27
27
|
props?: Partial<React.ComponentProps<C>>;
|
|
28
28
|
} & OverrideTwiddle;
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
export
|
|
29
|
+
export type Override<DefaultElementType extends React.ElementType> = DefaultOverride<DefaultElementType> | AsOverride<any> | RenderOverride<DefaultElementType>;
|
|
30
|
+
export type Overrides = Record<string, Flex<any>>;
|
|
31
|
+
export type Args = Record<string, any>;
|
|
32
|
+
export type Flex<DefaultElementType extends React.ElementType> = (Omit<DefaultOverride<DefaultElementType>, "type"> & {
|
|
33
33
|
as?: never;
|
|
34
34
|
render?: never;
|
|
35
35
|
}) | Omit<AsOverride<any>, "type"> | (Omit<RenderOverride<DefaultElementType>, "type"> & {
|
|
@@ -45,13 +45,13 @@ export declare function hasVariant<V extends Variants>(variants: V | undefined,
|
|
|
45
45
|
export declare function wrapFlexContainerChildren(children: React.ReactNode, hasGap: boolean): React.DetailedReactHTMLElement<{
|
|
46
46
|
className: string;
|
|
47
47
|
}, HTMLElement> | null;
|
|
48
|
-
export declare function createPlasmicElementProxy<DefaultElementType extends React.ElementType>(defaultElement: DefaultElementType, props: Partial<React.ComponentProps<DefaultElementType>>, ...children: React.ReactNode[]):
|
|
48
|
+
export declare function createPlasmicElementProxy<DefaultElementType extends React.ElementType>(defaultElement: DefaultElementType, props: Partial<React.ComponentProps<DefaultElementType>>, ...children: React.ReactNode[]): React.ReactNode;
|
|
49
49
|
export declare function makeFragment(...children: React.ReactNode[]): React.FunctionComponentElement<{
|
|
50
50
|
children?: React.ReactNode;
|
|
51
51
|
}>;
|
|
52
52
|
export declare const UNSET: unique symbol;
|
|
53
53
|
export declare function wrapWithClassName(element: React.ReactNode, className: string): React.DetailedReactHTMLElement<{
|
|
54
|
-
key:
|
|
54
|
+
key: React.Key | undefined;
|
|
55
55
|
className: string;
|
|
56
56
|
style: {
|
|
57
57
|
display: "grid";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export
|
|
2
|
+
export type PlasmicTranslator = (str: string, opts?: {
|
|
3
3
|
components?: {
|
|
4
4
|
[key: string]: React.ReactElement;
|
|
5
5
|
};
|
|
@@ -12,7 +12,7 @@ export interface TransProps {
|
|
|
12
12
|
export declare function genTranslatableString(elt: React.ReactNode): {
|
|
13
13
|
str: string;
|
|
14
14
|
components: {
|
|
15
|
-
[key: string]: React.ReactElement<any, string |
|
|
15
|
+
[key: string]: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
16
16
|
};
|
|
17
17
|
componentsCount: number;
|
|
18
18
|
};
|
|
@@ -27,7 +27,7 @@ declare const TRIGGER_TO_HOOK: {
|
|
|
27
27
|
readonly useFocusVisibleWithin: typeof useFocusVisibleWithin;
|
|
28
28
|
readonly usePressed: typeof usePressed;
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
type TriggerType = keyof typeof TRIGGER_TO_HOOK;
|
|
31
31
|
interface TriggerOpts {
|
|
32
32
|
isTextInput?: boolean;
|
|
33
33
|
}
|
package/dist/states/helpers.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export declare function shallowEqual<T>(a1: T[], a2: T[]): boolean;
|
|
|
33
33
|
*/
|
|
34
34
|
export declare function arrayEq(xs: ReadonlyArray<any>, ys: ReadonlyArray<any>): boolean;
|
|
35
35
|
export declare function isNum(value: string | number | symbol): value is number;
|
|
36
|
-
|
|
36
|
+
type StringGen = string | (() => string);
|
|
37
37
|
export declare function assert<T>(cond: T, msg?: StringGen): asserts cond;
|
|
38
38
|
/**
|
|
39
39
|
* Forked from https://github.com/lukeed/dset
|
package/dist/states/types.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { StateSpecNode } from "./graph";
|
|
2
|
-
export
|
|
2
|
+
export type InitFuncEnv = {
|
|
3
3
|
$props: Record<string, any>;
|
|
4
4
|
$state: Record<string, any>;
|
|
5
5
|
$queries?: Record<string, any>;
|
|
6
6
|
$ctx?: Record<string, any>;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type DollarStateEnv = Omit<InitFuncEnv, "$state">;
|
|
9
|
+
export type NoUndefinedField<T> = {
|
|
10
10
|
[P in keyof T]-?: T[P];
|
|
11
11
|
};
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
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
15
|
export interface $StateSpec<T> {
|
|
16
16
|
path: string;
|
|
17
17
|
initFunc?: InitFunc<T>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import "../styles/plasmic.css";
|
|
3
|
-
export declare const Base:
|
|
4
|
-
declare const _default:
|
|
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>>>;
|
|
5
6
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Story } from "@storybook/react";
|
|
1
2
|
import React from "react";
|
|
2
3
|
declare const _default: {
|
|
3
4
|
title: string;
|
|
@@ -12,66 +13,66 @@ interface CounterArgs {
|
|
|
12
13
|
"data-testid"?: string;
|
|
13
14
|
title?: React.ReactNode;
|
|
14
15
|
}
|
|
15
|
-
export declare const PrivateCounter:
|
|
16
|
-
export declare const ReadonlyCounter:
|
|
16
|
+
export declare const PrivateCounter: Story<CounterArgs>;
|
|
17
|
+
export declare const ReadonlyCounter: Story<{
|
|
17
18
|
counterStateType?: "readonly" | "writable" | undefined;
|
|
18
19
|
}>;
|
|
19
|
-
export declare const WritableCounter:
|
|
20
|
+
export declare const WritableCounter: Story<{
|
|
20
21
|
counterStateType?: "readonly" | "writable" | undefined;
|
|
21
22
|
}>;
|
|
22
|
-
export declare const DynamicInitCount:
|
|
23
|
-
export declare const ResetInput:
|
|
23
|
+
export declare const DynamicInitCount: Story<import("@storybook/react").Args>;
|
|
24
|
+
export declare const ResetInput: Story<{
|
|
24
25
|
peopleList: {
|
|
25
26
|
firstName: string;
|
|
26
27
|
lastName: string;
|
|
27
28
|
}[];
|
|
28
29
|
}>;
|
|
29
|
-
export declare const RepeatedStates:
|
|
30
|
+
export declare const RepeatedStates: Story<{
|
|
30
31
|
size: number;
|
|
31
32
|
}>;
|
|
32
|
-
export declare const NestedRepeatedCounter:
|
|
33
|
-
export declare const MatrixRepeatedCounter:
|
|
34
|
-
export declare const InitFuncFromInternalContextData:
|
|
33
|
+
export declare const NestedRepeatedCounter: Story<{}>;
|
|
34
|
+
export declare const MatrixRepeatedCounter: Story<{}>;
|
|
35
|
+
export declare const InitFuncFromInternalContextData: Story<{
|
|
35
36
|
products: {
|
|
36
37
|
price: number;
|
|
37
38
|
name: string;
|
|
38
39
|
}[];
|
|
39
40
|
}>;
|
|
40
|
-
export declare const InitFuncFromRootContextData:
|
|
41
|
+
export declare const InitFuncFromRootContextData: Story<{
|
|
41
42
|
products: {
|
|
42
43
|
price: number;
|
|
43
44
|
name: string;
|
|
44
45
|
}[];
|
|
45
46
|
}>;
|
|
46
|
-
export declare const InitFuncFromInternalContextDataWithDelay:
|
|
47
|
+
export declare const InitFuncFromInternalContextDataWithDelay: Story<{
|
|
47
48
|
products: {
|
|
48
49
|
price: number;
|
|
49
50
|
name: string;
|
|
50
51
|
}[];
|
|
51
52
|
}>;
|
|
52
|
-
export declare const RepeatedImplicitState:
|
|
53
|
+
export declare const RepeatedImplicitState: Story<{}>;
|
|
53
54
|
interface Person {
|
|
54
55
|
firstName: string;
|
|
55
56
|
lastName: string;
|
|
56
57
|
nicknames: string[];
|
|
57
58
|
}
|
|
58
|
-
export declare const FormBuilder:
|
|
59
|
+
export declare const FormBuilder: Story<{
|
|
59
60
|
people: Person[];
|
|
60
61
|
}>;
|
|
61
|
-
export declare const FormBuilderImplicitStates:
|
|
62
|
+
export declare const FormBuilderImplicitStates: Story<{
|
|
62
63
|
people: Person[];
|
|
63
64
|
}>;
|
|
64
|
-
export declare const StateCellIsArray:
|
|
65
|
+
export declare const StateCellIsArray: Story<{
|
|
65
66
|
people: Person[];
|
|
66
67
|
}>;
|
|
67
|
-
export declare const StateCellIsMatrix:
|
|
68
|
+
export declare const StateCellIsMatrix: Story<{
|
|
68
69
|
board: number[][];
|
|
69
70
|
}>;
|
|
70
|
-
export declare const IsOnChangePropImmediatelyFired:
|
|
71
|
-
export declare const ImmutableStateCells:
|
|
71
|
+
export declare const IsOnChangePropImmediatelyFired: Story<{}>;
|
|
72
|
+
export declare const ImmutableStateCells: Story<{
|
|
72
73
|
people: Person[];
|
|
73
74
|
}>;
|
|
74
|
-
export declare const InCanvasDollarState:
|
|
75
|
-
export declare const AddDeleteSpecsInCanvas:
|
|
76
|
-
export declare const TodoApp:
|
|
77
|
-
export declare const CycleInStateInitialization:
|
|
75
|
+
export declare const InCanvasDollarState: Story<{}>;
|
|
76
|
+
export declare const AddDeleteSpecsInCanvas: Story<{}>;
|
|
77
|
+
export declare const TodoApp: Story<{}>;
|
|
78
|
+
export declare const CycleInStateInitialization: Story<{}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/react-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.199",
|
|
4
4
|
"description": "plasmic library for rendering in the presentational style",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,60 +20,33 @@
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
-
"size-limit": [
|
|
24
|
-
{
|
|
25
|
-
"path": "dist/react-web.cjs.production.min.js",
|
|
26
|
-
"limit": "10 KB"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"path": "dist/react-web.esm.js",
|
|
30
|
-
"limit": "10 KB"
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
23
|
"exports": {
|
|
34
24
|
".": {
|
|
35
25
|
"import": "./dist/react-web.esm.js",
|
|
36
|
-
"require": "./dist/index.js"
|
|
26
|
+
"require": "./dist/index.cjs.js",
|
|
27
|
+
"types": "./dist/index.d.ts"
|
|
37
28
|
},
|
|
38
29
|
"./lib/host": {
|
|
39
30
|
"import": "./lib/host/index.js",
|
|
40
|
-
"require": "./lib/host/index.cjs.js"
|
|
31
|
+
"require": "./lib/host/index.cjs.js",
|
|
32
|
+
"types": "./lib/host/index.d.ts"
|
|
41
33
|
},
|
|
42
34
|
"./lib/data-sources": {
|
|
43
35
|
"import": "./lib/data-sources/index.js",
|
|
44
|
-
"require": "./lib/data-sources/index.cjs.js"
|
|
36
|
+
"require": "./lib/data-sources/index.cjs.js",
|
|
37
|
+
"types": "./lib/data-sources/index.d.ts"
|
|
45
38
|
},
|
|
46
39
|
"./lib/query": {
|
|
47
40
|
"import": "./lib/query/index.js",
|
|
48
|
-
"require": "./lib/query/index.cjs.js"
|
|
41
|
+
"require": "./lib/query/index.cjs.js",
|
|
42
|
+
"types": "./lib/query/index.d.ts"
|
|
49
43
|
},
|
|
50
44
|
"./lib/plasmic.css": "./lib/plasmic.css",
|
|
51
45
|
"./skinny": {
|
|
52
46
|
"import": "./skinny/dist/index.js"
|
|
53
47
|
},
|
|
54
|
-
"./skinny/dist/plume
|
|
55
|
-
"import": "./skinny/dist/plume
|
|
56
|
-
},
|
|
57
|
-
"./skinny/dist/plume/checkbox": {
|
|
58
|
-
"import": "./skinny/dist/plume/checkbox/index.js"
|
|
59
|
-
},
|
|
60
|
-
"./skinny/dist/plume/menu": {
|
|
61
|
-
"import": "./skinny/dist/plume/menu/index.js"
|
|
62
|
-
},
|
|
63
|
-
"./skinny/dist/plume/menu-button": {
|
|
64
|
-
"import": "./skinny/dist/plume/menu-button/index.js"
|
|
65
|
-
},
|
|
66
|
-
"./skinny/dist/plume/select": {
|
|
67
|
-
"import": "./skinny/dist/plume/select/index.js"
|
|
68
|
-
},
|
|
69
|
-
"./skinny/dist/plume/switch": {
|
|
70
|
-
"import": "./skinny/dist/plume/switch/index.js"
|
|
71
|
-
},
|
|
72
|
-
"./skinny/dist/plume/text-input": {
|
|
73
|
-
"import": "./skinny/dist/plume/text-input/index.js"
|
|
74
|
-
},
|
|
75
|
-
"./skinny/dist/plume/triggered-overlay": {
|
|
76
|
-
"import": "./skinny/dist/plume/triggered-overlay/index.js"
|
|
48
|
+
"./skinny/dist/plume/*": {
|
|
49
|
+
"import": "./skinny/dist/plume/*/index.js"
|
|
77
50
|
}
|
|
78
51
|
},
|
|
79
52
|
"files": [
|
|
@@ -82,7 +55,7 @@
|
|
|
82
55
|
"skinny"
|
|
83
56
|
],
|
|
84
57
|
"scripts": {
|
|
85
|
-
"build": "
|
|
58
|
+
"build": "rollup -c && mkdir -p lib && cp src/styles/plasmic.css lib/",
|
|
86
59
|
"start": "tsdx watch",
|
|
87
60
|
"test": "tsdx test --passWithNoTests",
|
|
88
61
|
"lint": "tsdx lint",
|
|
@@ -101,9 +74,9 @@
|
|
|
101
74
|
},
|
|
102
75
|
"prettier": {},
|
|
103
76
|
"dependencies": {
|
|
104
|
-
"@plasmicapp/data-sources": "0.1.
|
|
77
|
+
"@plasmicapp/data-sources": "0.1.69",
|
|
105
78
|
"@plasmicapp/data-sources-context": "0.1.10",
|
|
106
|
-
"@plasmicapp/host": "1.0.
|
|
79
|
+
"@plasmicapp/host": "1.0.130",
|
|
107
80
|
"@plasmicapp/query": "0.1.62",
|
|
108
81
|
"@react-aria/checkbox": "^3.5.0",
|
|
109
82
|
"@react-aria/focus": "^3.7.0",
|
|
@@ -170,5 +143,5 @@
|
|
|
170
143
|
"react": ">=16.8.0",
|
|
171
144
|
"react-dom": ">=16.8.0"
|
|
172
145
|
},
|
|
173
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "1d9faacaaac15e87767697dbdc4215504a358d02"
|
|
174
147
|
}
|