@plasmicapp/host 1.0.204 → 1.0.206

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 (37) hide show
  1. package/dist/canvas-host.d.ts +3 -6
  2. package/dist/exports.d.ts +2 -2
  3. package/dist/host.esm.js +22 -8
  4. package/dist/host.esm.js.map +1 -1
  5. package/dist/index.cjs.js +22 -9
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/prop-types.d.ts +15 -0
  8. package/dist/registerComponent.d.ts +5 -1
  9. package/dist/version.d.ts +1 -1
  10. package/package.json +2 -2
  11. package/registerComponent/dist/canvas-host.d.ts +3 -6
  12. package/registerComponent/dist/exports.d.ts +2 -2
  13. package/registerComponent/dist/index.cjs.js.map +1 -1
  14. package/registerComponent/dist/index.esm.js.map +1 -1
  15. package/registerComponent/dist/prop-types.d.ts +15 -0
  16. package/registerComponent/dist/registerComponent.d.ts +5 -1
  17. package/registerComponent/dist/version.d.ts +1 -1
  18. package/registerFunction/dist/canvas-host.d.ts +3 -6
  19. package/registerFunction/dist/exports.d.ts +2 -2
  20. package/registerFunction/dist/prop-types.d.ts +15 -0
  21. package/registerFunction/dist/registerComponent.d.ts +5 -1
  22. package/registerFunction/dist/version.d.ts +1 -1
  23. package/registerGlobalContext/dist/canvas-host.d.ts +3 -6
  24. package/registerGlobalContext/dist/exports.d.ts +2 -2
  25. package/registerGlobalContext/dist/prop-types.d.ts +15 -0
  26. package/registerGlobalContext/dist/registerComponent.d.ts +5 -1
  27. package/registerGlobalContext/dist/version.d.ts +1 -1
  28. package/registerToken/dist/canvas-host.d.ts +3 -6
  29. package/registerToken/dist/exports.d.ts +2 -2
  30. package/registerToken/dist/prop-types.d.ts +15 -0
  31. package/registerToken/dist/registerComponent.d.ts +5 -1
  32. package/registerToken/dist/version.d.ts +1 -1
  33. package/registerTrait/dist/canvas-host.d.ts +3 -6
  34. package/registerTrait/dist/exports.d.ts +2 -2
  35. package/registerTrait/dist/prop-types.d.ts +15 -0
  36. package/registerTrait/dist/registerComponent.d.ts +5 -1
  37. package/registerTrait/dist/version.d.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { CodeComponentElement, CSSProperties } from "./element-types";
3
- import { ContextDependentConfig, InferDataType, PropType, RestrictPropType, StudioOps } from "./prop-types";
3
+ import { ContextDependentConfig, InferDataType, ProjectData, PropType, RestrictPropType, StudioOps } from "./prop-types";
4
4
  import { TupleUnion } from "./type-utils";
5
5
  export type * from "./prop-types";
6
6
  export interface ActionProps<P> {
@@ -15,6 +15,10 @@ export interface ActionProps<P> {
15
15
  * Operations available to the editor that allow modifying the entire component.
16
16
  */
17
17
  studioOps: StudioOps;
18
+ /**
19
+ * Metadata from the studio project.
20
+ */
21
+ projectData: ProjectData;
18
22
  /**
19
23
  * The document that the component will be rendered into; instead of using
20
24
  * `document` directly (for, say, `document.querySelector()` etc.), you
@@ -1 +1 @@
1
- export declare const hostVersion = "1.0.204";
1
+ export declare const hostVersion = "1.0.206";
@@ -38,11 +38,8 @@ interface PlasmicCanvasHostProps {
38
38
  export declare const PlasmicCanvasHost: React.FunctionComponent<PlasmicCanvasHostProps>;
39
39
  type RenderErrorListener = (err: Error) => void;
40
40
  export declare function registerRenderErrorListener(listener: RenderErrorListener): () => void;
41
- interface PlasmicCanvasCodeComponentContextValue {
42
- id: string;
41
+ export declare function usePlasmicCanvasComponentInfo(props: any): {
43
42
  isSelected: boolean;
44
- selectedSlotName: string | null;
45
- }
46
- export declare const PlasmicCanvasCodeComponentContext: React.Context<PlasmicCanvasCodeComponentContextValue | null>;
47
- export declare const usePlasmicCanvasCodeComponentContext: () => PlasmicCanvasCodeComponentContextValue | null;
43
+ selectedSlotName: string | undefined;
44
+ } | null;
48
45
  export {};
@@ -1,10 +1,10 @@
1
- export { PlasmicCanvasCodeComponentContext, PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasCodeComponentContext, usePlasmicCanvasContext, } from "./canvas-host";
1
+ export { PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasComponentInfo, usePlasmicCanvasContext, } from "./canvas-host";
2
2
  export * from "./data";
3
3
  export { PlasmicElement } from "./element-types";
4
4
  export { registerFetcher as unstable_registerFetcher } from "./fetcher";
5
5
  export * from "./global-actions";
6
6
  export * from "./link";
7
- export { ContextDependentConfig, PropType } from "./prop-types";
7
+ export { ContextDependentConfig, CustomControlProps, ProjectData, PropType, StudioOps, } from "./prop-types";
8
8
  export { Action, ActionProps, CodeComponentMeta, CodeComponentMode, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, StateHelpers, StateSpec, default as registerComponent, stateHelpersKeys, } from "./registerComponent";
9
9
  export { CustomFunctionMeta, CustomFunctionRegistration, ParamType, default as registerFunction, } from "./registerFunction";
10
10
  export { GlobalContextMeta, PropType as GlobalContextPropType, GlobalContextRegistration, default as registerGlobalContext, } from "./registerGlobalContext";
@@ -412,6 +412,17 @@ export interface StudioOps {
412
412
  updateProps: (newValues: any) => void;
413
413
  updateStates: (newValues: any) => void;
414
414
  }
415
+ export interface ProjectData {
416
+ components: {
417
+ name: string;
418
+ }[];
419
+ pages: {
420
+ name: string;
421
+ pageMeta: {
422
+ path: string;
423
+ };
424
+ }[];
425
+ }
415
426
  export interface CustomControlProps<P> {
416
427
  componentProps: P;
417
428
  /**
@@ -425,6 +436,10 @@ export interface CustomControlProps<P> {
425
436
  * Can be null if the custom prop is used in a global context.
426
437
  */
427
438
  studioOps: StudioOps | null;
439
+ /**
440
+ * Metadata from the studio project.
441
+ */
442
+ projectData: ProjectData;
428
443
  value: any;
429
444
  /**
430
445
  * Sets the value to be passed to the prop. Expects a JSON-compatible value.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { CodeComponentElement, CSSProperties } from "./element-types";
3
- import { ContextDependentConfig, InferDataType, PropType, RestrictPropType, StudioOps } from "./prop-types";
3
+ import { ContextDependentConfig, InferDataType, ProjectData, PropType, RestrictPropType, StudioOps } from "./prop-types";
4
4
  import { TupleUnion } from "./type-utils";
5
5
  export type * from "./prop-types";
6
6
  export interface ActionProps<P> {
@@ -15,6 +15,10 @@ export interface ActionProps<P> {
15
15
  * Operations available to the editor that allow modifying the entire component.
16
16
  */
17
17
  studioOps: StudioOps;
18
+ /**
19
+ * Metadata from the studio project.
20
+ */
21
+ projectData: ProjectData;
18
22
  /**
19
23
  * The document that the component will be rendered into; instead of using
20
24
  * `document` directly (for, say, `document.querySelector()` etc.), you
@@ -1 +1 @@
1
- export declare const hostVersion = "1.0.204";
1
+ export declare const hostVersion = "1.0.206";
@@ -38,11 +38,8 @@ interface PlasmicCanvasHostProps {
38
38
  export declare const PlasmicCanvasHost: React.FunctionComponent<PlasmicCanvasHostProps>;
39
39
  type RenderErrorListener = (err: Error) => void;
40
40
  export declare function registerRenderErrorListener(listener: RenderErrorListener): () => void;
41
- interface PlasmicCanvasCodeComponentContextValue {
42
- id: string;
41
+ export declare function usePlasmicCanvasComponentInfo(props: any): {
43
42
  isSelected: boolean;
44
- selectedSlotName: string | null;
45
- }
46
- export declare const PlasmicCanvasCodeComponentContext: React.Context<PlasmicCanvasCodeComponentContextValue | null>;
47
- export declare const usePlasmicCanvasCodeComponentContext: () => PlasmicCanvasCodeComponentContextValue | null;
43
+ selectedSlotName: string | undefined;
44
+ } | null;
48
45
  export {};
@@ -1,10 +1,10 @@
1
- export { PlasmicCanvasCodeComponentContext, PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasCodeComponentContext, usePlasmicCanvasContext, } from "./canvas-host";
1
+ export { PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasComponentInfo, usePlasmicCanvasContext, } from "./canvas-host";
2
2
  export * from "./data";
3
3
  export { PlasmicElement } from "./element-types";
4
4
  export { registerFetcher as unstable_registerFetcher } from "./fetcher";
5
5
  export * from "./global-actions";
6
6
  export * from "./link";
7
- export { ContextDependentConfig, PropType } from "./prop-types";
7
+ export { ContextDependentConfig, CustomControlProps, ProjectData, PropType, StudioOps, } from "./prop-types";
8
8
  export { Action, ActionProps, CodeComponentMeta, CodeComponentMode, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, StateHelpers, StateSpec, default as registerComponent, stateHelpersKeys, } from "./registerComponent";
9
9
  export { CustomFunctionMeta, CustomFunctionRegistration, ParamType, default as registerFunction, } from "./registerFunction";
10
10
  export { GlobalContextMeta, PropType as GlobalContextPropType, GlobalContextRegistration, default as registerGlobalContext, } from "./registerGlobalContext";
@@ -412,6 +412,17 @@ export interface StudioOps {
412
412
  updateProps: (newValues: any) => void;
413
413
  updateStates: (newValues: any) => void;
414
414
  }
415
+ export interface ProjectData {
416
+ components: {
417
+ name: string;
418
+ }[];
419
+ pages: {
420
+ name: string;
421
+ pageMeta: {
422
+ path: string;
423
+ };
424
+ }[];
425
+ }
415
426
  export interface CustomControlProps<P> {
416
427
  componentProps: P;
417
428
  /**
@@ -425,6 +436,10 @@ export interface CustomControlProps<P> {
425
436
  * Can be null if the custom prop is used in a global context.
426
437
  */
427
438
  studioOps: StudioOps | null;
439
+ /**
440
+ * Metadata from the studio project.
441
+ */
442
+ projectData: ProjectData;
428
443
  value: any;
429
444
  /**
430
445
  * Sets the value to be passed to the prop. Expects a JSON-compatible value.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { CodeComponentElement, CSSProperties } from "./element-types";
3
- import { ContextDependentConfig, InferDataType, PropType, RestrictPropType, StudioOps } from "./prop-types";
3
+ import { ContextDependentConfig, InferDataType, ProjectData, PropType, RestrictPropType, StudioOps } from "./prop-types";
4
4
  import { TupleUnion } from "./type-utils";
5
5
  export type * from "./prop-types";
6
6
  export interface ActionProps<P> {
@@ -15,6 +15,10 @@ export interface ActionProps<P> {
15
15
  * Operations available to the editor that allow modifying the entire component.
16
16
  */
17
17
  studioOps: StudioOps;
18
+ /**
19
+ * Metadata from the studio project.
20
+ */
21
+ projectData: ProjectData;
18
22
  /**
19
23
  * The document that the component will be rendered into; instead of using
20
24
  * `document` directly (for, say, `document.querySelector()` etc.), you
@@ -1 +1 @@
1
- export declare const hostVersion = "1.0.204";
1
+ export declare const hostVersion = "1.0.206";
@@ -38,11 +38,8 @@ interface PlasmicCanvasHostProps {
38
38
  export declare const PlasmicCanvasHost: React.FunctionComponent<PlasmicCanvasHostProps>;
39
39
  type RenderErrorListener = (err: Error) => void;
40
40
  export declare function registerRenderErrorListener(listener: RenderErrorListener): () => void;
41
- interface PlasmicCanvasCodeComponentContextValue {
42
- id: string;
41
+ export declare function usePlasmicCanvasComponentInfo(props: any): {
43
42
  isSelected: boolean;
44
- selectedSlotName: string | null;
45
- }
46
- export declare const PlasmicCanvasCodeComponentContext: React.Context<PlasmicCanvasCodeComponentContextValue | null>;
47
- export declare const usePlasmicCanvasCodeComponentContext: () => PlasmicCanvasCodeComponentContextValue | null;
43
+ selectedSlotName: string | undefined;
44
+ } | null;
48
45
  export {};
@@ -1,10 +1,10 @@
1
- export { PlasmicCanvasCodeComponentContext, PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasCodeComponentContext, usePlasmicCanvasContext, } from "./canvas-host";
1
+ export { PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasComponentInfo, usePlasmicCanvasContext, } from "./canvas-host";
2
2
  export * from "./data";
3
3
  export { PlasmicElement } from "./element-types";
4
4
  export { registerFetcher as unstable_registerFetcher } from "./fetcher";
5
5
  export * from "./global-actions";
6
6
  export * from "./link";
7
- export { ContextDependentConfig, PropType } from "./prop-types";
7
+ export { ContextDependentConfig, CustomControlProps, ProjectData, PropType, StudioOps, } from "./prop-types";
8
8
  export { Action, ActionProps, CodeComponentMeta, CodeComponentMode, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, StateHelpers, StateSpec, default as registerComponent, stateHelpersKeys, } from "./registerComponent";
9
9
  export { CustomFunctionMeta, CustomFunctionRegistration, ParamType, default as registerFunction, } from "./registerFunction";
10
10
  export { GlobalContextMeta, PropType as GlobalContextPropType, GlobalContextRegistration, default as registerGlobalContext, } from "./registerGlobalContext";
@@ -412,6 +412,17 @@ export interface StudioOps {
412
412
  updateProps: (newValues: any) => void;
413
413
  updateStates: (newValues: any) => void;
414
414
  }
415
+ export interface ProjectData {
416
+ components: {
417
+ name: string;
418
+ }[];
419
+ pages: {
420
+ name: string;
421
+ pageMeta: {
422
+ path: string;
423
+ };
424
+ }[];
425
+ }
415
426
  export interface CustomControlProps<P> {
416
427
  componentProps: P;
417
428
  /**
@@ -425,6 +436,10 @@ export interface CustomControlProps<P> {
425
436
  * Can be null if the custom prop is used in a global context.
426
437
  */
427
438
  studioOps: StudioOps | null;
439
+ /**
440
+ * Metadata from the studio project.
441
+ */
442
+ projectData: ProjectData;
428
443
  value: any;
429
444
  /**
430
445
  * Sets the value to be passed to the prop. Expects a JSON-compatible value.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { CodeComponentElement, CSSProperties } from "./element-types";
3
- import { ContextDependentConfig, InferDataType, PropType, RestrictPropType, StudioOps } from "./prop-types";
3
+ import { ContextDependentConfig, InferDataType, ProjectData, PropType, RestrictPropType, StudioOps } from "./prop-types";
4
4
  import { TupleUnion } from "./type-utils";
5
5
  export type * from "./prop-types";
6
6
  export interface ActionProps<P> {
@@ -15,6 +15,10 @@ export interface ActionProps<P> {
15
15
  * Operations available to the editor that allow modifying the entire component.
16
16
  */
17
17
  studioOps: StudioOps;
18
+ /**
19
+ * Metadata from the studio project.
20
+ */
21
+ projectData: ProjectData;
18
22
  /**
19
23
  * The document that the component will be rendered into; instead of using
20
24
  * `document` directly (for, say, `document.querySelector()` etc.), you
@@ -1 +1 @@
1
- export declare const hostVersion = "1.0.204";
1
+ export declare const hostVersion = "1.0.206";
@@ -38,11 +38,8 @@ interface PlasmicCanvasHostProps {
38
38
  export declare const PlasmicCanvasHost: React.FunctionComponent<PlasmicCanvasHostProps>;
39
39
  type RenderErrorListener = (err: Error) => void;
40
40
  export declare function registerRenderErrorListener(listener: RenderErrorListener): () => void;
41
- interface PlasmicCanvasCodeComponentContextValue {
42
- id: string;
41
+ export declare function usePlasmicCanvasComponentInfo(props: any): {
43
42
  isSelected: boolean;
44
- selectedSlotName: string | null;
45
- }
46
- export declare const PlasmicCanvasCodeComponentContext: React.Context<PlasmicCanvasCodeComponentContextValue | null>;
47
- export declare const usePlasmicCanvasCodeComponentContext: () => PlasmicCanvasCodeComponentContextValue | null;
43
+ selectedSlotName: string | undefined;
44
+ } | null;
48
45
  export {};
@@ -1,10 +1,10 @@
1
- export { PlasmicCanvasCodeComponentContext, PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasCodeComponentContext, usePlasmicCanvasContext, } from "./canvas-host";
1
+ export { PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasComponentInfo, usePlasmicCanvasContext, } from "./canvas-host";
2
2
  export * from "./data";
3
3
  export { PlasmicElement } from "./element-types";
4
4
  export { registerFetcher as unstable_registerFetcher } from "./fetcher";
5
5
  export * from "./global-actions";
6
6
  export * from "./link";
7
- export { ContextDependentConfig, PropType } from "./prop-types";
7
+ export { ContextDependentConfig, CustomControlProps, ProjectData, PropType, StudioOps, } from "./prop-types";
8
8
  export { Action, ActionProps, CodeComponentMeta, CodeComponentMode, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, StateHelpers, StateSpec, default as registerComponent, stateHelpersKeys, } from "./registerComponent";
9
9
  export { CustomFunctionMeta, CustomFunctionRegistration, ParamType, default as registerFunction, } from "./registerFunction";
10
10
  export { GlobalContextMeta, PropType as GlobalContextPropType, GlobalContextRegistration, default as registerGlobalContext, } from "./registerGlobalContext";
@@ -412,6 +412,17 @@ export interface StudioOps {
412
412
  updateProps: (newValues: any) => void;
413
413
  updateStates: (newValues: any) => void;
414
414
  }
415
+ export interface ProjectData {
416
+ components: {
417
+ name: string;
418
+ }[];
419
+ pages: {
420
+ name: string;
421
+ pageMeta: {
422
+ path: string;
423
+ };
424
+ }[];
425
+ }
415
426
  export interface CustomControlProps<P> {
416
427
  componentProps: P;
417
428
  /**
@@ -425,6 +436,10 @@ export interface CustomControlProps<P> {
425
436
  * Can be null if the custom prop is used in a global context.
426
437
  */
427
438
  studioOps: StudioOps | null;
439
+ /**
440
+ * Metadata from the studio project.
441
+ */
442
+ projectData: ProjectData;
428
443
  value: any;
429
444
  /**
430
445
  * Sets the value to be passed to the prop. Expects a JSON-compatible value.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { CodeComponentElement, CSSProperties } from "./element-types";
3
- import { ContextDependentConfig, InferDataType, PropType, RestrictPropType, StudioOps } from "./prop-types";
3
+ import { ContextDependentConfig, InferDataType, ProjectData, PropType, RestrictPropType, StudioOps } from "./prop-types";
4
4
  import { TupleUnion } from "./type-utils";
5
5
  export type * from "./prop-types";
6
6
  export interface ActionProps<P> {
@@ -15,6 +15,10 @@ export interface ActionProps<P> {
15
15
  * Operations available to the editor that allow modifying the entire component.
16
16
  */
17
17
  studioOps: StudioOps;
18
+ /**
19
+ * Metadata from the studio project.
20
+ */
21
+ projectData: ProjectData;
18
22
  /**
19
23
  * The document that the component will be rendered into; instead of using
20
24
  * `document` directly (for, say, `document.querySelector()` etc.), you
@@ -1 +1 @@
1
- export declare const hostVersion = "1.0.204";
1
+ export declare const hostVersion = "1.0.206";