@plasmicapp/host 2.0.2 → 2.0.4
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/data.d.ts +6 -1
- package/dist/data.test.d.ts +1 -0
- package/dist/exports.d.ts +1 -1
- package/dist/history.d.ts +1 -0
- package/dist/host.esm.js +77 -4
- package/dist/host.esm.js.map +1 -1
- package/dist/index.cjs.js +76 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/types/function-types.d.ts +7 -1
- package/dist/types/shared-controls.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +7 -4
- package/registerComponent/dist/data.d.ts +6 -1
- package/registerComponent/dist/data.test.d.ts +1 -0
- package/registerComponent/dist/exports.d.ts +1 -1
- package/registerComponent/dist/history.d.ts +1 -0
- package/registerComponent/dist/types/function-types.d.ts +7 -1
- package/registerComponent/dist/types/shared-controls.d.ts +1 -1
- package/registerComponent/dist/version.d.ts +1 -1
- package/registerFunction/dist/data.d.ts +6 -1
- package/registerFunction/dist/data.test.d.ts +1 -0
- package/registerFunction/dist/exports.d.ts +1 -1
- package/registerFunction/dist/history.d.ts +1 -0
- package/registerFunction/dist/types/function-types.d.ts +7 -1
- package/registerFunction/dist/types/shared-controls.d.ts +1 -1
- package/registerFunction/dist/version.d.ts +1 -1
- package/registerGlobalContext/dist/data.d.ts +6 -1
- package/registerGlobalContext/dist/data.test.d.ts +1 -0
- package/registerGlobalContext/dist/exports.d.ts +1 -1
- package/registerGlobalContext/dist/history.d.ts +1 -0
- package/registerGlobalContext/dist/types/function-types.d.ts +7 -1
- package/registerGlobalContext/dist/types/shared-controls.d.ts +1 -1
- package/registerGlobalContext/dist/version.d.ts +1 -1
- package/registerToken/dist/data.d.ts +6 -1
- package/registerToken/dist/data.test.d.ts +1 -0
- package/registerToken/dist/exports.d.ts +1 -1
- package/registerToken/dist/history.d.ts +1 -0
- package/registerToken/dist/types/function-types.d.ts +7 -1
- package/registerToken/dist/types/shared-controls.d.ts +1 -1
- package/registerToken/dist/version.d.ts +1 -1
- package/registerTrait/dist/data.d.ts +6 -1
- package/registerTrait/dist/data.test.d.ts +1 -0
- package/registerTrait/dist/exports.d.ts +1 -1
- package/registerTrait/dist/history.d.ts +1 -0
- package/registerTrait/dist/types/function-types.d.ts +7 -1
- package/registerTrait/dist/types/shared-controls.d.ts +1 -1
- package/registerTrait/dist/version.d.ts +1 -1
|
@@ -51,8 +51,13 @@ export interface PageParamsProviderProps {
|
|
|
51
51
|
* Page query params (e.g. { q: "search term" })
|
|
52
52
|
*/
|
|
53
53
|
query?: Record<string, string | string[] | undefined>;
|
|
54
|
+
/**
|
|
55
|
+
* Defaults to false. If true, query params are derived from `location.search` sync
|
|
56
|
+
* with client-side history changes. `query` prop is used as a fallback during SSR.
|
|
57
|
+
*/
|
|
58
|
+
trackQueryParams?: boolean;
|
|
54
59
|
}
|
|
55
|
-
export declare function PageParamsProvider({ children, route, params, query, }: PageParamsProviderProps): React.JSX.Element;
|
|
60
|
+
export declare function PageParamsProvider({ children, route, params, query, trackQueryParams, }: PageParamsProviderProps): React.JSX.Element;
|
|
56
61
|
export declare function DataCtxReader({ children, }: {
|
|
57
62
|
children: ($ctx: DataDict | undefined) => ReactNode;
|
|
58
63
|
}): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,7 +5,7 @@ export * from "./global-actions";
|
|
|
5
5
|
export * from "./link";
|
|
6
6
|
export { ChoiceObject, ChoiceOptions, ChoiceValue, ComponentContextConfig, ComponentControlContext, ContextDependentConfig, ControlExtras, CustomControlProps, ProjectData, PropType, StudioOps, } from "./prop-types";
|
|
7
7
|
export { Action, ActionProps, CodeComponentMeta, CodeComponentMode, ComponentHelpers, ComponentRegistration, ComponentTemplates, StateHelpers, StateSpec, default as registerComponent, stateHelpersKeys, } from "./registerComponent";
|
|
8
|
-
export { CustomFunctionMeta, CustomFunctionRegistration, FunctionContextConfig, FunctionControlContext, ParamType, default as registerFunction, } from "./registerFunction";
|
|
8
|
+
export { CustomFunctionMeta, CustomFunctionRegistration, FunctionContextConfig, FunctionControlContext, FunctionControlExtras, ParamType, default as registerFunction, } from "./registerFunction";
|
|
9
9
|
export { GlobalContextMeta, PropType as GlobalContextPropType, GlobalContextRegistration, default as registerGlobalContext, } from "./registerGlobalContext";
|
|
10
10
|
export { TokenRegistration, TokenType, default as registerToken, } from "./registerToken";
|
|
11
11
|
export { BasicTrait, ChoiceTrait, TraitMeta, TraitRegistration, default as registerTrait, } from "./registerTrait";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useBrowserQueryParams(enabled: boolean): Record<string, string | string[] | undefined> | undefined;
|
|
@@ -11,8 +11,14 @@ import { Nullish } from "./type-utils";
|
|
|
11
11
|
export type PartialParams<P extends any[]> = {
|
|
12
12
|
[K in keyof P]: P[K] | undefined;
|
|
13
13
|
};
|
|
14
|
+
export interface FunctionControlExtras {
|
|
15
|
+
path: (string | number)[];
|
|
16
|
+
item?: any;
|
|
17
|
+
mode?: "query" | "mutation";
|
|
18
|
+
}
|
|
14
19
|
export type FunctionControlContext<P extends any[]> = GenericContext<PartialParams<P>, // Function params, each may be undefined
|
|
15
|
-
any
|
|
20
|
+
any, // Data from fnContext
|
|
21
|
+
FunctionControlExtras>;
|
|
16
22
|
export type FunctionContextConfig<P extends any[], R> = ContextDependentConfig<FunctionControlContext<P>, R>;
|
|
17
23
|
export interface TypeBaseDefault<Ctx extends any[], T> extends CommonTypeBase, Defaultable<Ctx, T> {
|
|
18
24
|
displayName?: string;
|
|
@@ -41,7 +41,7 @@ export interface Defaultable<Ctx extends any[], T> {
|
|
|
41
41
|
/**
|
|
42
42
|
* Default value to set for this prop when the component is instantiated
|
|
43
43
|
*/
|
|
44
|
-
defaultValue?: T
|
|
44
|
+
defaultValue?: T | ContextDependentConfig<Ctx, T | undefined>;
|
|
45
45
|
/**
|
|
46
46
|
* Specify that default when no prop/param is provided,
|
|
47
47
|
* so the Plasmic user can see it in the studio UI
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "2.0.
|
|
1
|
+
export declare const hostVersion = "2.0.4";
|
|
@@ -51,8 +51,13 @@ export interface PageParamsProviderProps {
|
|
|
51
51
|
* Page query params (e.g. { q: "search term" })
|
|
52
52
|
*/
|
|
53
53
|
query?: Record<string, string | string[] | undefined>;
|
|
54
|
+
/**
|
|
55
|
+
* Defaults to false. If true, query params are derived from `location.search` sync
|
|
56
|
+
* with client-side history changes. `query` prop is used as a fallback during SSR.
|
|
57
|
+
*/
|
|
58
|
+
trackQueryParams?: boolean;
|
|
54
59
|
}
|
|
55
|
-
export declare function PageParamsProvider({ children, route, params, query, }: PageParamsProviderProps): React.JSX.Element;
|
|
60
|
+
export declare function PageParamsProvider({ children, route, params, query, trackQueryParams, }: PageParamsProviderProps): React.JSX.Element;
|
|
56
61
|
export declare function DataCtxReader({ children, }: {
|
|
57
62
|
children: ($ctx: DataDict | undefined) => ReactNode;
|
|
58
63
|
}): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,7 +5,7 @@ export * from "./global-actions";
|
|
|
5
5
|
export * from "./link";
|
|
6
6
|
export { ChoiceObject, ChoiceOptions, ChoiceValue, ComponentContextConfig, ComponentControlContext, ContextDependentConfig, ControlExtras, CustomControlProps, ProjectData, PropType, StudioOps, } from "./prop-types";
|
|
7
7
|
export { Action, ActionProps, CodeComponentMeta, CodeComponentMode, ComponentHelpers, ComponentRegistration, ComponentTemplates, StateHelpers, StateSpec, default as registerComponent, stateHelpersKeys, } from "./registerComponent";
|
|
8
|
-
export { CustomFunctionMeta, CustomFunctionRegistration, FunctionContextConfig, FunctionControlContext, ParamType, default as registerFunction, } from "./registerFunction";
|
|
8
|
+
export { CustomFunctionMeta, CustomFunctionRegistration, FunctionContextConfig, FunctionControlContext, FunctionControlExtras, ParamType, default as registerFunction, } from "./registerFunction";
|
|
9
9
|
export { GlobalContextMeta, PropType as GlobalContextPropType, GlobalContextRegistration, default as registerGlobalContext, } from "./registerGlobalContext";
|
|
10
10
|
export { TokenRegistration, TokenType, default as registerToken, } from "./registerToken";
|
|
11
11
|
export { BasicTrait, ChoiceTrait, TraitMeta, TraitRegistration, default as registerTrait, } from "./registerTrait";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useBrowserQueryParams(enabled: boolean): Record<string, string | string[] | undefined> | undefined;
|
|
@@ -11,8 +11,14 @@ import { Nullish } from "./type-utils";
|
|
|
11
11
|
export type PartialParams<P extends any[]> = {
|
|
12
12
|
[K in keyof P]: P[K] | undefined;
|
|
13
13
|
};
|
|
14
|
+
export interface FunctionControlExtras {
|
|
15
|
+
path: (string | number)[];
|
|
16
|
+
item?: any;
|
|
17
|
+
mode?: "query" | "mutation";
|
|
18
|
+
}
|
|
14
19
|
export type FunctionControlContext<P extends any[]> = GenericContext<PartialParams<P>, // Function params, each may be undefined
|
|
15
|
-
any
|
|
20
|
+
any, // Data from fnContext
|
|
21
|
+
FunctionControlExtras>;
|
|
16
22
|
export type FunctionContextConfig<P extends any[], R> = ContextDependentConfig<FunctionControlContext<P>, R>;
|
|
17
23
|
export interface TypeBaseDefault<Ctx extends any[], T> extends CommonTypeBase, Defaultable<Ctx, T> {
|
|
18
24
|
displayName?: string;
|
|
@@ -41,7 +41,7 @@ export interface Defaultable<Ctx extends any[], T> {
|
|
|
41
41
|
/**
|
|
42
42
|
* Default value to set for this prop when the component is instantiated
|
|
43
43
|
*/
|
|
44
|
-
defaultValue?: T
|
|
44
|
+
defaultValue?: T | ContextDependentConfig<Ctx, T | undefined>;
|
|
45
45
|
/**
|
|
46
46
|
* Specify that default when no prop/param is provided,
|
|
47
47
|
* so the Plasmic user can see it in the studio UI
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "2.0.
|
|
1
|
+
export declare const hostVersion = "2.0.4";
|