@plasmicapp/host 1.0.130 → 1.0.131
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/canvas-host.d.ts +41 -41
- package/dist/common.d.ts +1 -1
- package/dist/data.d.ts +43 -43
- package/dist/element-types.d.ts +115 -115
- package/dist/exports.d.ts +10 -10
- package/dist/fetcher.d.ts +40 -40
- package/dist/global-actions.d.ts +9 -9
- package/dist/host.esm.js +377 -383
- package/dist/host.esm.js.map +1 -1
- package/dist/index.cjs.js +377 -383
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/lang-utils.d.ts +3 -3
- package/dist/registerComponent.d.ts +590 -589
- package/dist/registerGlobalContext.d.ts +75 -75
- package/dist/registerToken.d.ts +13 -13
- package/dist/registerTrait.d.ts +20 -20
- package/dist/repeatedElement.d.ts +15 -15
- package/dist/useForceUpdate.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +5 -6
- package/registerComponent/dist/element-types.d.ts +115 -115
- package/registerComponent/dist/index.cjs.js +12 -12
- package/registerComponent/dist/index.esm.js +12 -12
- package/registerComponent/dist/registerComponent.d.ts +590 -589
- package/registerGlobalContext/dist/element-types.d.ts +115 -115
- package/registerGlobalContext/dist/index.cjs.js +12 -12
- package/registerGlobalContext/dist/index.esm.js +12 -12
- package/registerGlobalContext/dist/registerComponent.d.ts +590 -589
- package/registerGlobalContext/dist/registerGlobalContext.d.ts +75 -75
- package/registerToken/dist/index.cjs.js +6 -6
- package/registerToken/dist/index.esm.js +6 -6
- package/registerToken/dist/registerToken.d.ts +13 -13
- package/registerTrait/dist/index.cjs.js +9 -9
- package/registerTrait/dist/index.esm.js +9 -9
- package/registerTrait/dist/registerTrait.d.ts +20 -20
package/dist/canvas-host.d.ts
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
__PlasmicHostVersion: string;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
export declare function setPlasmicRootNode(node: React.ReactElement | null): void;
|
|
8
|
-
export interface PlasmicCanvasContextValue {
|
|
9
|
-
componentName: string | null;
|
|
10
|
-
globalVariants: Record<string, string>;
|
|
11
|
-
interactive?: boolean;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* React context to detect whether the component is rendered on Plasmic editor.
|
|
15
|
-
* If not, return false.
|
|
16
|
-
* If so, return an object with more information about the component
|
|
17
|
-
*/
|
|
18
|
-
export declare const PlasmicCanvasContext: React.Context<false | PlasmicCanvasContextValue>;
|
|
19
|
-
export declare const usePlasmicCanvasContext: () => false | PlasmicCanvasContextValue;
|
|
20
|
-
interface PlasmicCanvasHostProps {
|
|
21
|
-
/**
|
|
22
|
-
* Webpack hmr uses EventSource to listen to hot reloads, but that
|
|
23
|
-
* resultsin a persistent connection from each window. In Plasmic
|
|
24
|
-
* Studio, if a project is configured to use app-hosting with a
|
|
25
|
-
* nextjs or gatsby server running in dev mode, each artboard will
|
|
26
|
-
* be holding a persistent connection to the dev server.
|
|
27
|
-
* Because browsers have a limit to how many connections can
|
|
28
|
-
* be held at a time by domain, this means after X artboards, new
|
|
29
|
-
* artboards will freeze and not load.
|
|
30
|
-
*
|
|
31
|
-
* By default, <PlasmicCanvasHost /> will globally mutate
|
|
32
|
-
* window.EventSource to avoid using EventSource for HMR, which you
|
|
33
|
-
* typically don't need for your custom host page. If you do still
|
|
34
|
-
* want to retain HRM, then youc an pass enableWebpackHmr={true}.
|
|
35
|
-
*/
|
|
36
|
-
enableWebpackHmr?: boolean;
|
|
37
|
-
}
|
|
38
|
-
export declare const PlasmicCanvasHost: React.FunctionComponent<PlasmicCanvasHostProps>;
|
|
39
|
-
|
|
40
|
-
export declare function registerRenderErrorListener(listener: RenderErrorListener): () => void;
|
|
41
|
-
export {};
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
__PlasmicHostVersion: string;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export declare function setPlasmicRootNode(node: React.ReactElement | null): void;
|
|
8
|
+
export interface PlasmicCanvasContextValue {
|
|
9
|
+
componentName: string | null;
|
|
10
|
+
globalVariants: Record<string, string>;
|
|
11
|
+
interactive?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* React context to detect whether the component is rendered on Plasmic editor.
|
|
15
|
+
* If not, return false.
|
|
16
|
+
* If so, return an object with more information about the component
|
|
17
|
+
*/
|
|
18
|
+
export declare const PlasmicCanvasContext: React.Context<false | PlasmicCanvasContextValue>;
|
|
19
|
+
export declare const usePlasmicCanvasContext: () => false | PlasmicCanvasContextValue;
|
|
20
|
+
interface PlasmicCanvasHostProps {
|
|
21
|
+
/**
|
|
22
|
+
* Webpack hmr uses EventSource to listen to hot reloads, but that
|
|
23
|
+
* resultsin a persistent connection from each window. In Plasmic
|
|
24
|
+
* Studio, if a project is configured to use app-hosting with a
|
|
25
|
+
* nextjs or gatsby server running in dev mode, each artboard will
|
|
26
|
+
* be holding a persistent connection to the dev server.
|
|
27
|
+
* Because browsers have a limit to how many connections can
|
|
28
|
+
* be held at a time by domain, this means after X artboards, new
|
|
29
|
+
* artboards will freeze and not load.
|
|
30
|
+
*
|
|
31
|
+
* By default, <PlasmicCanvasHost /> will globally mutate
|
|
32
|
+
* window.EventSource to avoid using EventSource for HMR, which you
|
|
33
|
+
* typically don't need for your custom host page. If you do still
|
|
34
|
+
* want to retain HRM, then youc an pass enableWebpackHmr={true}.
|
|
35
|
+
*/
|
|
36
|
+
enableWebpackHmr?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare const PlasmicCanvasHost: React.FunctionComponent<PlasmicCanvasHostProps>;
|
|
39
|
+
type RenderErrorListener = (err: Error) => void;
|
|
40
|
+
export declare function registerRenderErrorListener(listener: RenderErrorListener): () => void;
|
|
41
|
+
export {};
|
package/dist/common.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const tuple: <T extends any[]>(...args: T) => T;
|
|
1
|
+
export declare const tuple: <T extends any[]>(...args: T) => T;
|
package/dist/data.d.ts
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
2
|
-
export
|
|
3
|
-
export declare const DataContext: React.Context<
|
|
4
|
-
export
|
|
5
|
-
hidden?: boolean;
|
|
6
|
-
label?: string;
|
|
7
|
-
};
|
|
8
|
-
export declare function mkMetaName(name: string): string;
|
|
9
|
-
export declare function mkMetaValue(meta: Partial<DataMeta>): DataMeta;
|
|
10
|
-
export declare function applySelector(rawData: DataDict | undefined, selector: string | undefined): any;
|
|
11
|
-
export
|
|
12
|
-
export declare function useSelector(selector: string | undefined): any;
|
|
13
|
-
export declare function useSelectors(selectors?: SelectorDict): any;
|
|
14
|
-
export declare function useDataEnv():
|
|
15
|
-
export interface DataProviderProps {
|
|
16
|
-
/**
|
|
17
|
-
* Key to set in data context.
|
|
18
|
-
*/
|
|
19
|
-
name?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Value to set for `name` in data context.
|
|
22
|
-
*/
|
|
23
|
-
data?: any;
|
|
24
|
-
/**
|
|
25
|
-
* If true, hide this entry in studio (data binding).
|
|
26
|
-
*/
|
|
27
|
-
hidden?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Label to be shown in the studio data picker for easier navigation (data binding).
|
|
30
|
-
*/
|
|
31
|
-
label?: string;
|
|
32
|
-
children?: ReactNode;
|
|
33
|
-
}
|
|
34
|
-
export declare function DataProvider({ name, data, hidden, label, children, }: DataProviderProps): JSX.Element;
|
|
35
|
-
export interface PageParamsProviderProps {
|
|
36
|
-
params?: Record<string, string | string[] | undefined>;
|
|
37
|
-
query?: Record<string, string | string[] | undefined>;
|
|
38
|
-
children?: ReactNode;
|
|
39
|
-
}
|
|
40
|
-
export declare function PageParamsProvider({ children, params, query, }: PageParamsProviderProps): JSX.Element;
|
|
41
|
-
export declare function DataCtxReader({ children, }: {
|
|
42
|
-
children: ($ctx: DataDict | undefined) => ReactNode;
|
|
43
|
-
}): React.ReactElement<any, string |
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
export type DataDict = Record<string, any>;
|
|
3
|
+
export declare const DataContext: React.Context<DataDict | undefined>;
|
|
4
|
+
export type DataMeta = {
|
|
5
|
+
hidden?: boolean;
|
|
6
|
+
label?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function mkMetaName(name: string): string;
|
|
9
|
+
export declare function mkMetaValue(meta: Partial<DataMeta>): DataMeta;
|
|
10
|
+
export declare function applySelector(rawData: DataDict | undefined, selector: string | undefined): any;
|
|
11
|
+
export type SelectorDict = Record<string, string | undefined>;
|
|
12
|
+
export declare function useSelector(selector: string | undefined): any;
|
|
13
|
+
export declare function useSelectors(selectors?: SelectorDict): any;
|
|
14
|
+
export declare function useDataEnv(): DataDict | undefined;
|
|
15
|
+
export interface DataProviderProps {
|
|
16
|
+
/**
|
|
17
|
+
* Key to set in data context.
|
|
18
|
+
*/
|
|
19
|
+
name?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Value to set for `name` in data context.
|
|
22
|
+
*/
|
|
23
|
+
data?: any;
|
|
24
|
+
/**
|
|
25
|
+
* If true, hide this entry in studio (data binding).
|
|
26
|
+
*/
|
|
27
|
+
hidden?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Label to be shown in the studio data picker for easier navigation (data binding).
|
|
30
|
+
*/
|
|
31
|
+
label?: string;
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
export declare function DataProvider({ name, data, hidden, label, children, }: DataProviderProps): JSX.Element;
|
|
35
|
+
export interface PageParamsProviderProps {
|
|
36
|
+
params?: Record<string, string | string[] | undefined>;
|
|
37
|
+
query?: Record<string, string | string[] | undefined>;
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
}
|
|
40
|
+
export declare function PageParamsProvider({ children, params, query, }: PageParamsProviderProps): JSX.Element;
|
|
41
|
+
export declare function DataCtxReader({ children, }: {
|
|
42
|
+
children: ($ctx: DataDict | undefined) => ReactNode;
|
|
43
|
+
}): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
package/dist/element-types.d.ts
CHANGED
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
import type { Properties } from "csstype";
|
|
2
|
-
export
|
|
3
|
-
layout?: "vbox" | "hbox" | "box" | "page-section";
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export interface PictureElement {
|
|
14
|
-
type: "img";
|
|
15
|
-
src: string;
|
|
16
|
-
styles?: CSSProperties;
|
|
17
|
-
attrs?: Attrs<PictureAttrKeys>;
|
|
18
|
-
}
|
|
19
|
-
export
|
|
20
|
-
interface LinkTextElement {
|
|
21
|
-
type: "text";
|
|
22
|
-
tag: "a";
|
|
23
|
-
value: string;
|
|
24
|
-
styles?: CSSProperties;
|
|
25
|
-
attrs?: Attrs<LinkAttrKeys>;
|
|
26
|
-
}
|
|
27
|
-
interface ButtonTextElement {
|
|
28
|
-
type: "text";
|
|
29
|
-
tag: "button";
|
|
30
|
-
value: string;
|
|
31
|
-
styles?: CSSProperties;
|
|
32
|
-
attrs?: Attrs<ButtonAttrKeys>;
|
|
33
|
-
}
|
|
34
|
-
interface GenericTextElement {
|
|
35
|
-
type: "text";
|
|
36
|
-
/**
|
|
37
|
-
* Default: "div"
|
|
38
|
-
*/
|
|
39
|
-
tag?: Exclude<ContainerTags, "a" | "button">;
|
|
40
|
-
value: string;
|
|
41
|
-
styles?: CSSProperties;
|
|
42
|
-
attrs?: Attrs<CommonAttrKeys>;
|
|
43
|
-
}
|
|
44
|
-
export
|
|
45
|
-
interface LinkContainerElement {
|
|
46
|
-
type: "box" | "vbox" | "hbox";
|
|
47
|
-
tag: "a";
|
|
48
|
-
children?: PlasmicElement | PlasmicElement[];
|
|
49
|
-
styles?: CSSProperties;
|
|
50
|
-
attrs?: Attrs<LinkAttrKeys>;
|
|
51
|
-
}
|
|
52
|
-
interface ButtonContainerElement {
|
|
53
|
-
type: "box" | "vbox" | "hbox";
|
|
54
|
-
tag: "button";
|
|
55
|
-
children?: PlasmicElement | PlasmicElement[];
|
|
56
|
-
styles?: CSSProperties;
|
|
57
|
-
attrs?: Attrs<ButtonAttrKeys>;
|
|
58
|
-
}
|
|
59
|
-
interface GenericContainerElement {
|
|
60
|
-
type: "box" | "vbox" | "hbox" | "page-section";
|
|
61
|
-
/**
|
|
62
|
-
* Default: "div"
|
|
63
|
-
*/
|
|
64
|
-
tag?: Exclude<ContainerTags, "a" | "button">;
|
|
65
|
-
children?: PlasmicElement | PlasmicElement[];
|
|
66
|
-
styles?: CSSProperties;
|
|
67
|
-
attrs?: Attrs<CommonAttrKeys>;
|
|
68
|
-
}
|
|
69
|
-
export
|
|
70
|
-
export interface ButtonElement {
|
|
71
|
-
type: "button";
|
|
72
|
-
value: string;
|
|
73
|
-
styles?: CSSProperties;
|
|
74
|
-
attrs?: Attrs<ButtonAttrKeys>;
|
|
75
|
-
}
|
|
76
|
-
interface InputElement {
|
|
77
|
-
type: "input" | "password";
|
|
78
|
-
styles?: CSSProperties;
|
|
79
|
-
attrs?: Attrs<InputAttrKeys>;
|
|
80
|
-
}
|
|
81
|
-
interface TextAreaElement {
|
|
82
|
-
type: "textarea";
|
|
83
|
-
styles?: CSSProperties;
|
|
84
|
-
attrs?: Attrs<TextAreaAttrKeys>;
|
|
85
|
-
}
|
|
86
|
-
export
|
|
87
|
-
interface JsonElement {
|
|
88
|
-
type: "json";
|
|
89
|
-
value: any;
|
|
90
|
-
}
|
|
91
|
-
export interface DefaultComponentElement<P> {
|
|
92
|
-
type: "default-component";
|
|
93
|
-
kind: "button" | "text-input";
|
|
94
|
-
props?: {
|
|
95
|
-
[prop in keyof Partial<P>]: number | string | boolean | null | undefined | JsonElement | PlasmicElement | PlasmicElement[];
|
|
96
|
-
} & {
|
|
97
|
-
[prop: string]: number | string | boolean | null | undefined | JsonElement | PlasmicElement | PlasmicElement[];
|
|
98
|
-
};
|
|
99
|
-
styles?: CSSProperties;
|
|
100
|
-
}
|
|
101
|
-
export interface CodeComponentElement<P> {
|
|
102
|
-
type: "component";
|
|
103
|
-
/**
|
|
104
|
-
* The registered component name
|
|
105
|
-
*/
|
|
106
|
-
name: string;
|
|
107
|
-
styles?: CSSProperties;
|
|
108
|
-
props?: {
|
|
109
|
-
[prop in keyof Partial<P>]: number | string | boolean | null | undefined | JsonElement | PlasmicElement | PlasmicElement[];
|
|
110
|
-
} & {
|
|
111
|
-
[prop: string]: number | string | boolean | null | undefined | JsonElement | PlasmicElement | PlasmicElement[];
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
export
|
|
115
|
-
export {};
|
|
1
|
+
import type { Properties } from "csstype";
|
|
2
|
+
export type CSSProperties = Properties<string | number> & {
|
|
3
|
+
layout?: "vbox" | "hbox" | "box" | "page-section";
|
|
4
|
+
};
|
|
5
|
+
type ContainerTags = "a" | "address" | "article" | "aside" | "blockquote" | "button" | "code" | "dd" | "div" | "dl" | "dt" | "form" | "footer" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "header" | "hgroup" | "label" | "li" | "main" | "nav" | "ol" | "p" | "pre" | "section" | "span" | "ul";
|
|
6
|
+
type CommonAttrKeys = "title" | "tabIndex" | "className" | "id" | "aria-label" | "aria-hidden" | "aria-labelledby" | "aria-describedby" | "role";
|
|
7
|
+
type PictureAttrKeys = "alt" | "loading" | CommonAttrKeys;
|
|
8
|
+
type LinkAttrKeys = "href" | "target" | CommonAttrKeys;
|
|
9
|
+
type TextAreaAttrKeys = "disabled" | "value" | "cols" | "rows" | "placeholder" | CommonAttrKeys;
|
|
10
|
+
type InputAttrKeys = "disabled" | "value" | "defaultValue" | "name" | "autoComplete" | "checked" | "placeholder" | CommonAttrKeys;
|
|
11
|
+
type ButtonAttrKeys = "disabled" | CommonAttrKeys;
|
|
12
|
+
type Attrs<Keys extends string> = Partial<Record<Keys, string>>;
|
|
13
|
+
export interface PictureElement {
|
|
14
|
+
type: "img";
|
|
15
|
+
src: string;
|
|
16
|
+
styles?: CSSProperties;
|
|
17
|
+
attrs?: Attrs<PictureAttrKeys>;
|
|
18
|
+
}
|
|
19
|
+
export type ImageElement = PictureElement;
|
|
20
|
+
interface LinkTextElement {
|
|
21
|
+
type: "text";
|
|
22
|
+
tag: "a";
|
|
23
|
+
value: string;
|
|
24
|
+
styles?: CSSProperties;
|
|
25
|
+
attrs?: Attrs<LinkAttrKeys>;
|
|
26
|
+
}
|
|
27
|
+
interface ButtonTextElement {
|
|
28
|
+
type: "text";
|
|
29
|
+
tag: "button";
|
|
30
|
+
value: string;
|
|
31
|
+
styles?: CSSProperties;
|
|
32
|
+
attrs?: Attrs<ButtonAttrKeys>;
|
|
33
|
+
}
|
|
34
|
+
interface GenericTextElement {
|
|
35
|
+
type: "text";
|
|
36
|
+
/**
|
|
37
|
+
* Default: "div"
|
|
38
|
+
*/
|
|
39
|
+
tag?: Exclude<ContainerTags, "a" | "button">;
|
|
40
|
+
value: string;
|
|
41
|
+
styles?: CSSProperties;
|
|
42
|
+
attrs?: Attrs<CommonAttrKeys>;
|
|
43
|
+
}
|
|
44
|
+
export type TextElement = string | LinkTextElement | ButtonTextElement | GenericTextElement;
|
|
45
|
+
interface LinkContainerElement {
|
|
46
|
+
type: "box" | "vbox" | "hbox";
|
|
47
|
+
tag: "a";
|
|
48
|
+
children?: PlasmicElement | PlasmicElement[];
|
|
49
|
+
styles?: CSSProperties;
|
|
50
|
+
attrs?: Attrs<LinkAttrKeys>;
|
|
51
|
+
}
|
|
52
|
+
interface ButtonContainerElement {
|
|
53
|
+
type: "box" | "vbox" | "hbox";
|
|
54
|
+
tag: "button";
|
|
55
|
+
children?: PlasmicElement | PlasmicElement[];
|
|
56
|
+
styles?: CSSProperties;
|
|
57
|
+
attrs?: Attrs<ButtonAttrKeys>;
|
|
58
|
+
}
|
|
59
|
+
interface GenericContainerElement {
|
|
60
|
+
type: "box" | "vbox" | "hbox" | "page-section";
|
|
61
|
+
/**
|
|
62
|
+
* Default: "div"
|
|
63
|
+
*/
|
|
64
|
+
tag?: Exclude<ContainerTags, "a" | "button">;
|
|
65
|
+
children?: PlasmicElement | PlasmicElement[];
|
|
66
|
+
styles?: CSSProperties;
|
|
67
|
+
attrs?: Attrs<CommonAttrKeys>;
|
|
68
|
+
}
|
|
69
|
+
export type ContainerElement = LinkContainerElement | ButtonContainerElement | GenericContainerElement;
|
|
70
|
+
export interface ButtonElement {
|
|
71
|
+
type: "button";
|
|
72
|
+
value: string;
|
|
73
|
+
styles?: CSSProperties;
|
|
74
|
+
attrs?: Attrs<ButtonAttrKeys>;
|
|
75
|
+
}
|
|
76
|
+
interface InputElement {
|
|
77
|
+
type: "input" | "password";
|
|
78
|
+
styles?: CSSProperties;
|
|
79
|
+
attrs?: Attrs<InputAttrKeys>;
|
|
80
|
+
}
|
|
81
|
+
interface TextAreaElement {
|
|
82
|
+
type: "textarea";
|
|
83
|
+
styles?: CSSProperties;
|
|
84
|
+
attrs?: Attrs<TextAreaAttrKeys>;
|
|
85
|
+
}
|
|
86
|
+
export type TextInputElement = InputElement | TextAreaElement;
|
|
87
|
+
interface JsonElement {
|
|
88
|
+
type: "json";
|
|
89
|
+
value: any;
|
|
90
|
+
}
|
|
91
|
+
export interface DefaultComponentElement<P> {
|
|
92
|
+
type: "default-component";
|
|
93
|
+
kind: "button" | "text-input";
|
|
94
|
+
props?: {
|
|
95
|
+
[prop in keyof Partial<P>]: number | string | boolean | null | undefined | JsonElement | PlasmicElement | PlasmicElement[];
|
|
96
|
+
} & {
|
|
97
|
+
[prop: string]: number | string | boolean | null | undefined | JsonElement | PlasmicElement | PlasmicElement[];
|
|
98
|
+
};
|
|
99
|
+
styles?: CSSProperties;
|
|
100
|
+
}
|
|
101
|
+
export interface CodeComponentElement<P> {
|
|
102
|
+
type: "component";
|
|
103
|
+
/**
|
|
104
|
+
* The registered component name
|
|
105
|
+
*/
|
|
106
|
+
name: string;
|
|
107
|
+
styles?: CSSProperties;
|
|
108
|
+
props?: {
|
|
109
|
+
[prop in keyof Partial<P>]: number | string | boolean | null | undefined | JsonElement | PlasmicElement | PlasmicElement[];
|
|
110
|
+
} & {
|
|
111
|
+
[prop: string]: number | string | boolean | null | undefined | JsonElement | PlasmicElement | PlasmicElement[];
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
export type PlasmicElement = ImageElement | TextElement | ContainerElement | ButtonElement | TextInputElement | CodeComponentElement<{}> | DefaultComponentElement<{}>;
|
|
115
|
+
export {};
|
package/dist/exports.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasContext, } from "./canvas-host";
|
|
2
|
-
export * from "./data";
|
|
3
|
-
export { PlasmicElement } from "./element-types";
|
|
4
|
-
export { registerFetcher as unstable_registerFetcher } from "./fetcher";
|
|
5
|
-
export * from "./global-actions";
|
|
6
|
-
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, ContextDependentConfig, default as registerComponent, DefaultValueOrExpr, PrimitiveType, PropType, PropTypeBase, StateHelpers, StateSpec, } from "./registerComponent";
|
|
7
|
-
export { default as registerGlobalContext, GlobalContextMeta, GlobalContextRegistration, PropType as GlobalContextPropType, } from "./registerGlobalContext";
|
|
8
|
-
export { default as registerToken, TokenRegistration, TokenType, } from "./registerToken";
|
|
9
|
-
export { BasicTrait, ChoiceTrait, default as registerTrait, TraitMeta, TraitRegistration, } from "./registerTrait";
|
|
10
|
-
export { default as repeatedElement } from "./repeatedElement";
|
|
1
|
+
export { PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasContext, } from "./canvas-host";
|
|
2
|
+
export * from "./data";
|
|
3
|
+
export { PlasmicElement } from "./element-types";
|
|
4
|
+
export { registerFetcher as unstable_registerFetcher } from "./fetcher";
|
|
5
|
+
export * from "./global-actions";
|
|
6
|
+
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, ContextDependentConfig, default as registerComponent, DefaultValueOrExpr, PrimitiveType, PropType, PropTypeBase, StateHelpers, StateSpec, } from "./registerComponent";
|
|
7
|
+
export { default as registerGlobalContext, GlobalContextMeta, GlobalContextRegistration, PropType as GlobalContextPropType, } from "./registerGlobalContext";
|
|
8
|
+
export { default as registerToken, TokenRegistration, TokenType, } from "./registerToken";
|
|
9
|
+
export { BasicTrait, ChoiceTrait, default as registerTrait, TraitMeta, TraitRegistration, } from "./registerTrait";
|
|
10
|
+
export { default as repeatedElement } from "./repeatedElement";
|
package/dist/fetcher.d.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { PrimitiveType } from "./registerComponent";
|
|
2
|
-
export
|
|
3
|
-
export interface FetcherMeta {
|
|
4
|
-
/**
|
|
5
|
-
* Any unique identifying string for this fetcher.
|
|
6
|
-
*/
|
|
7
|
-
name: string;
|
|
8
|
-
/**
|
|
9
|
-
* The Studio-user-friendly display name.
|
|
10
|
-
*/
|
|
11
|
-
displayName?: string;
|
|
12
|
-
/**
|
|
13
|
-
* The symbol to import from the importPath.
|
|
14
|
-
*/
|
|
15
|
-
importName?: string;
|
|
16
|
-
args: {
|
|
17
|
-
name: string;
|
|
18
|
-
type: PrimitiveType;
|
|
19
|
-
}[];
|
|
20
|
-
returns: PrimitiveType;
|
|
21
|
-
/**
|
|
22
|
-
* Either the path to the fetcher relative to `rootDir` or the npm
|
|
23
|
-
* package name
|
|
24
|
-
*/
|
|
25
|
-
importPath: string;
|
|
26
|
-
/**
|
|
27
|
-
* Whether it's a default export or named export
|
|
28
|
-
*/
|
|
29
|
-
isDefaultExport?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface FetcherRegistration {
|
|
32
|
-
fetcher: Fetcher;
|
|
33
|
-
meta: FetcherMeta;
|
|
34
|
-
}
|
|
35
|
-
declare global {
|
|
36
|
-
interface Window {
|
|
37
|
-
__PlasmicFetcherRegistry: FetcherRegistration[];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export declare function registerFetcher(fetcher: Fetcher, meta: FetcherMeta): void;
|
|
1
|
+
import { PrimitiveType } from "./registerComponent";
|
|
2
|
+
export type Fetcher = (...args: any[]) => Promise<any>;
|
|
3
|
+
export interface FetcherMeta {
|
|
4
|
+
/**
|
|
5
|
+
* Any unique identifying string for this fetcher.
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* The Studio-user-friendly display name.
|
|
10
|
+
*/
|
|
11
|
+
displayName?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The symbol to import from the importPath.
|
|
14
|
+
*/
|
|
15
|
+
importName?: string;
|
|
16
|
+
args: {
|
|
17
|
+
name: string;
|
|
18
|
+
type: PrimitiveType;
|
|
19
|
+
}[];
|
|
20
|
+
returns: PrimitiveType;
|
|
21
|
+
/**
|
|
22
|
+
* Either the path to the fetcher relative to `rootDir` or the npm
|
|
23
|
+
* package name
|
|
24
|
+
*/
|
|
25
|
+
importPath: string;
|
|
26
|
+
/**
|
|
27
|
+
* Whether it's a default export or named export
|
|
28
|
+
*/
|
|
29
|
+
isDefaultExport?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface FetcherRegistration {
|
|
32
|
+
fetcher: Fetcher;
|
|
33
|
+
meta: FetcherMeta;
|
|
34
|
+
}
|
|
35
|
+
declare global {
|
|
36
|
+
interface Window {
|
|
37
|
+
__PlasmicFetcherRegistry: FetcherRegistration[];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export declare function registerFetcher(fetcher: Fetcher, meta: FetcherMeta): void;
|
package/dist/global-actions.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export
|
|
3
|
-
export declare const GlobalActionsContext: React.Context<
|
|
4
|
-
export declare function GlobalActionsProvider(props: {
|
|
5
|
-
contextName: string;
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
actions: GlobalActionDict;
|
|
8
|
-
}): JSX.Element;
|
|
9
|
-
export declare function useGlobalActions():
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type GlobalActionDict = Record<string, Function>;
|
|
3
|
+
export declare const GlobalActionsContext: React.Context<GlobalActionDict | undefined>;
|
|
4
|
+
export declare function GlobalActionsProvider(props: {
|
|
5
|
+
contextName: string;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
actions: GlobalActionDict;
|
|
8
|
+
}): JSX.Element;
|
|
9
|
+
export declare function useGlobalActions(): GlobalActionDict;
|