@plasmicapp/host 1.0.202 → 1.0.204

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 +7 -0
  2. package/dist/exports.d.ts +6 -6
  3. package/dist/host.esm.js +8 -2
  4. package/dist/host.esm.js.map +1 -1
  5. package/dist/index.cjs.js +9 -1
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/prop-types.d.ts +15 -0
  8. package/dist/registerComponent.d.ts +6 -12
  9. package/dist/version.d.ts +1 -1
  10. package/package.json +2 -2
  11. package/registerComponent/dist/canvas-host.d.ts +7 -0
  12. package/registerComponent/dist/exports.d.ts +6 -6
  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 +6 -12
  17. package/registerComponent/dist/version.d.ts +1 -1
  18. package/registerFunction/dist/canvas-host.d.ts +7 -0
  19. package/registerFunction/dist/exports.d.ts +6 -6
  20. package/registerFunction/dist/prop-types.d.ts +15 -0
  21. package/registerFunction/dist/registerComponent.d.ts +6 -12
  22. package/registerFunction/dist/version.d.ts +1 -1
  23. package/registerGlobalContext/dist/canvas-host.d.ts +7 -0
  24. package/registerGlobalContext/dist/exports.d.ts +6 -6
  25. package/registerGlobalContext/dist/prop-types.d.ts +15 -0
  26. package/registerGlobalContext/dist/registerComponent.d.ts +6 -12
  27. package/registerGlobalContext/dist/version.d.ts +1 -1
  28. package/registerToken/dist/canvas-host.d.ts +7 -0
  29. package/registerToken/dist/exports.d.ts +6 -6
  30. package/registerToken/dist/prop-types.d.ts +15 -0
  31. package/registerToken/dist/registerComponent.d.ts +6 -12
  32. package/registerToken/dist/version.d.ts +1 -1
  33. package/registerTrait/dist/canvas-host.d.ts +7 -0
  34. package/registerTrait/dist/exports.d.ts +6 -6
  35. package/registerTrait/dist/prop-types.d.ts +15 -0
  36. package/registerTrait/dist/registerComponent.d.ts +6 -12
  37. package/registerTrait/dist/version.d.ts +1 -1
@@ -402,6 +402,16 @@ export interface ModalProps {
402
402
  onClose: () => void;
403
403
  style?: CSSProperties;
404
404
  }
405
+ export interface StudioOps {
406
+ showModal: (modalProps: Omit<ModalProps, "onClose"> & {
407
+ onClose?: () => void;
408
+ }) => void;
409
+ refreshQueryData: () => void;
410
+ appendToSlot: (element: PlasmicElement, slotName: string) => void;
411
+ removeFromSlotAt: (pos: number, slotName: string) => void;
412
+ updateProps: (newValues: any) => void;
413
+ updateStates: (newValues: any) => void;
414
+ }
405
415
  export interface CustomControlProps<P> {
406
416
  componentProps: P;
407
417
  /**
@@ -410,6 +420,11 @@ export interface CustomControlProps<P> {
410
420
  * calls `setControlContextData`)
411
421
  */
412
422
  contextData: InferDataType<P> | null;
423
+ /**
424
+ * Operations available to the editor that allow modifying the entire component.
425
+ * Can be null if the custom prop is used in a global context.
426
+ */
427
+ studioOps: StudioOps | null;
413
428
  value: any;
414
429
  /**
415
430
  * Sets the value to be passed to the prop. Expects a JSON-compatible value.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { CodeComponentElement, CSSProperties, PlasmicElement } from "./element-types";
3
- import { ContextDependentConfig, InferDataType, ModalProps, PropType, RestrictPropType } from "./prop-types";
2
+ import { CodeComponentElement, CSSProperties } from "./element-types";
3
+ import { ContextDependentConfig, InferDataType, 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> {
@@ -11,16 +11,10 @@ export interface ActionProps<P> {
11
11
  * calls `setControlContextData`)
12
12
  */
13
13
  contextData: InferDataType<P> | null;
14
- studioOps: {
15
- showModal: (modalProps: Omit<ModalProps, "onClose"> & {
16
- onClose?: () => void;
17
- }) => void;
18
- refreshQueryData: () => void;
19
- appendToSlot: (element: PlasmicElement, slotName: string) => void;
20
- removeFromSlotAt: (pos: number, slotName: string) => void;
21
- updateProps: (newValues: any) => void;
22
- updateStates: (newValues: any) => void;
23
- };
14
+ /**
15
+ * Operations available to the editor that allow modifying the entire component.
16
+ */
17
+ studioOps: StudioOps;
24
18
  /**
25
19
  * The document that the component will be rendered into; instead of using
26
20
  * `document` directly (for, say, `document.querySelector()` etc.), you
@@ -1 +1 @@
1
- export declare const hostVersion = "1.0.202";
1
+ export declare const hostVersion = "1.0.204";
@@ -38,4 +38,11 @@ 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;
43
+ isSelected: boolean;
44
+ selectedSlotName: string | null;
45
+ }
46
+ export declare const PlasmicCanvasCodeComponentContext: React.Context<PlasmicCanvasCodeComponentContextValue | null>;
47
+ export declare const usePlasmicCanvasCodeComponentContext: () => PlasmicCanvasCodeComponentContextValue | null;
41
48
  export {};
@@ -1,13 +1,13 @@
1
- export { PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasContext, } from "./canvas-host";
1
+ export { PlasmicCanvasCodeComponentContext, PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasCodeComponentContext, 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
7
  export { ContextDependentConfig, PropType } from "./prop-types";
8
- export { Action, ActionProps, CodeComponentMeta, CodeComponentMode, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, StateHelpers, stateHelpersKeys, StateSpec, } from "./registerComponent";
9
- export { CustomFunctionMeta, CustomFunctionRegistration, default as registerFunction, ParamType, } from "./registerFunction";
10
- export { default as registerGlobalContext, GlobalContextMeta, GlobalContextRegistration, PropType as GlobalContextPropType, } from "./registerGlobalContext";
11
- export { default as registerToken, TokenRegistration, TokenType, } from "./registerToken";
12
- export { BasicTrait, ChoiceTrait, default as registerTrait, TraitMeta, TraitRegistration, } from "./registerTrait";
8
+ export { Action, ActionProps, CodeComponentMeta, CodeComponentMode, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, StateHelpers, StateSpec, default as registerComponent, stateHelpersKeys, } from "./registerComponent";
9
+ export { CustomFunctionMeta, CustomFunctionRegistration, ParamType, default as registerFunction, } from "./registerFunction";
10
+ export { GlobalContextMeta, PropType as GlobalContextPropType, GlobalContextRegistration, default as registerGlobalContext, } from "./registerGlobalContext";
11
+ export { TokenRegistration, TokenType, default as registerToken, } from "./registerToken";
12
+ export { BasicTrait, ChoiceTrait, TraitMeta, TraitRegistration, default as registerTrait, } from "./registerTrait";
13
13
  export { default as repeatedElement } from "./repeatedElement";
@@ -402,6 +402,16 @@ export interface ModalProps {
402
402
  onClose: () => void;
403
403
  style?: CSSProperties;
404
404
  }
405
+ export interface StudioOps {
406
+ showModal: (modalProps: Omit<ModalProps, "onClose"> & {
407
+ onClose?: () => void;
408
+ }) => void;
409
+ refreshQueryData: () => void;
410
+ appendToSlot: (element: PlasmicElement, slotName: string) => void;
411
+ removeFromSlotAt: (pos: number, slotName: string) => void;
412
+ updateProps: (newValues: any) => void;
413
+ updateStates: (newValues: any) => void;
414
+ }
405
415
  export interface CustomControlProps<P> {
406
416
  componentProps: P;
407
417
  /**
@@ -410,6 +420,11 @@ export interface CustomControlProps<P> {
410
420
  * calls `setControlContextData`)
411
421
  */
412
422
  contextData: InferDataType<P> | null;
423
+ /**
424
+ * Operations available to the editor that allow modifying the entire component.
425
+ * Can be null if the custom prop is used in a global context.
426
+ */
427
+ studioOps: StudioOps | null;
413
428
  value: any;
414
429
  /**
415
430
  * Sets the value to be passed to the prop. Expects a JSON-compatible value.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { CodeComponentElement, CSSProperties, PlasmicElement } from "./element-types";
3
- import { ContextDependentConfig, InferDataType, ModalProps, PropType, RestrictPropType } from "./prop-types";
2
+ import { CodeComponentElement, CSSProperties } from "./element-types";
3
+ import { ContextDependentConfig, InferDataType, 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> {
@@ -11,16 +11,10 @@ export interface ActionProps<P> {
11
11
  * calls `setControlContextData`)
12
12
  */
13
13
  contextData: InferDataType<P> | null;
14
- studioOps: {
15
- showModal: (modalProps: Omit<ModalProps, "onClose"> & {
16
- onClose?: () => void;
17
- }) => void;
18
- refreshQueryData: () => void;
19
- appendToSlot: (element: PlasmicElement, slotName: string) => void;
20
- removeFromSlotAt: (pos: number, slotName: string) => void;
21
- updateProps: (newValues: any) => void;
22
- updateStates: (newValues: any) => void;
23
- };
14
+ /**
15
+ * Operations available to the editor that allow modifying the entire component.
16
+ */
17
+ studioOps: StudioOps;
24
18
  /**
25
19
  * The document that the component will be rendered into; instead of using
26
20
  * `document` directly (for, say, `document.querySelector()` etc.), you
@@ -1 +1 @@
1
- export declare const hostVersion = "1.0.202";
1
+ export declare const hostVersion = "1.0.204";
@@ -38,4 +38,11 @@ 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;
43
+ isSelected: boolean;
44
+ selectedSlotName: string | null;
45
+ }
46
+ export declare const PlasmicCanvasCodeComponentContext: React.Context<PlasmicCanvasCodeComponentContextValue | null>;
47
+ export declare const usePlasmicCanvasCodeComponentContext: () => PlasmicCanvasCodeComponentContextValue | null;
41
48
  export {};
@@ -1,13 +1,13 @@
1
- export { PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasContext, } from "./canvas-host";
1
+ export { PlasmicCanvasCodeComponentContext, PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasCodeComponentContext, 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
7
  export { ContextDependentConfig, PropType } from "./prop-types";
8
- export { Action, ActionProps, CodeComponentMeta, CodeComponentMode, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, StateHelpers, stateHelpersKeys, StateSpec, } from "./registerComponent";
9
- export { CustomFunctionMeta, CustomFunctionRegistration, default as registerFunction, ParamType, } from "./registerFunction";
10
- export { default as registerGlobalContext, GlobalContextMeta, GlobalContextRegistration, PropType as GlobalContextPropType, } from "./registerGlobalContext";
11
- export { default as registerToken, TokenRegistration, TokenType, } from "./registerToken";
12
- export { BasicTrait, ChoiceTrait, default as registerTrait, TraitMeta, TraitRegistration, } from "./registerTrait";
8
+ export { Action, ActionProps, CodeComponentMeta, CodeComponentMode, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, StateHelpers, StateSpec, default as registerComponent, stateHelpersKeys, } from "./registerComponent";
9
+ export { CustomFunctionMeta, CustomFunctionRegistration, ParamType, default as registerFunction, } from "./registerFunction";
10
+ export { GlobalContextMeta, PropType as GlobalContextPropType, GlobalContextRegistration, default as registerGlobalContext, } from "./registerGlobalContext";
11
+ export { TokenRegistration, TokenType, default as registerToken, } from "./registerToken";
12
+ export { BasicTrait, ChoiceTrait, TraitMeta, TraitRegistration, default as registerTrait, } from "./registerTrait";
13
13
  export { default as repeatedElement } from "./repeatedElement";
@@ -402,6 +402,16 @@ export interface ModalProps {
402
402
  onClose: () => void;
403
403
  style?: CSSProperties;
404
404
  }
405
+ export interface StudioOps {
406
+ showModal: (modalProps: Omit<ModalProps, "onClose"> & {
407
+ onClose?: () => void;
408
+ }) => void;
409
+ refreshQueryData: () => void;
410
+ appendToSlot: (element: PlasmicElement, slotName: string) => void;
411
+ removeFromSlotAt: (pos: number, slotName: string) => void;
412
+ updateProps: (newValues: any) => void;
413
+ updateStates: (newValues: any) => void;
414
+ }
405
415
  export interface CustomControlProps<P> {
406
416
  componentProps: P;
407
417
  /**
@@ -410,6 +420,11 @@ export interface CustomControlProps<P> {
410
420
  * calls `setControlContextData`)
411
421
  */
412
422
  contextData: InferDataType<P> | null;
423
+ /**
424
+ * Operations available to the editor that allow modifying the entire component.
425
+ * Can be null if the custom prop is used in a global context.
426
+ */
427
+ studioOps: StudioOps | null;
413
428
  value: any;
414
429
  /**
415
430
  * Sets the value to be passed to the prop. Expects a JSON-compatible value.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { CodeComponentElement, CSSProperties, PlasmicElement } from "./element-types";
3
- import { ContextDependentConfig, InferDataType, ModalProps, PropType, RestrictPropType } from "./prop-types";
2
+ import { CodeComponentElement, CSSProperties } from "./element-types";
3
+ import { ContextDependentConfig, InferDataType, 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> {
@@ -11,16 +11,10 @@ export interface ActionProps<P> {
11
11
  * calls `setControlContextData`)
12
12
  */
13
13
  contextData: InferDataType<P> | null;
14
- studioOps: {
15
- showModal: (modalProps: Omit<ModalProps, "onClose"> & {
16
- onClose?: () => void;
17
- }) => void;
18
- refreshQueryData: () => void;
19
- appendToSlot: (element: PlasmicElement, slotName: string) => void;
20
- removeFromSlotAt: (pos: number, slotName: string) => void;
21
- updateProps: (newValues: any) => void;
22
- updateStates: (newValues: any) => void;
23
- };
14
+ /**
15
+ * Operations available to the editor that allow modifying the entire component.
16
+ */
17
+ studioOps: StudioOps;
24
18
  /**
25
19
  * The document that the component will be rendered into; instead of using
26
20
  * `document` directly (for, say, `document.querySelector()` etc.), you
@@ -1 +1 @@
1
- export declare const hostVersion = "1.0.202";
1
+ export declare const hostVersion = "1.0.204";
@@ -38,4 +38,11 @@ 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;
43
+ isSelected: boolean;
44
+ selectedSlotName: string | null;
45
+ }
46
+ export declare const PlasmicCanvasCodeComponentContext: React.Context<PlasmicCanvasCodeComponentContextValue | null>;
47
+ export declare const usePlasmicCanvasCodeComponentContext: () => PlasmicCanvasCodeComponentContextValue | null;
41
48
  export {};
@@ -1,13 +1,13 @@
1
- export { PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasContext, } from "./canvas-host";
1
+ export { PlasmicCanvasCodeComponentContext, PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasCodeComponentContext, 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
7
  export { ContextDependentConfig, PropType } from "./prop-types";
8
- export { Action, ActionProps, CodeComponentMeta, CodeComponentMode, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, StateHelpers, stateHelpersKeys, StateSpec, } from "./registerComponent";
9
- export { CustomFunctionMeta, CustomFunctionRegistration, default as registerFunction, ParamType, } from "./registerFunction";
10
- export { default as registerGlobalContext, GlobalContextMeta, GlobalContextRegistration, PropType as GlobalContextPropType, } from "./registerGlobalContext";
11
- export { default as registerToken, TokenRegistration, TokenType, } from "./registerToken";
12
- export { BasicTrait, ChoiceTrait, default as registerTrait, TraitMeta, TraitRegistration, } from "./registerTrait";
8
+ export { Action, ActionProps, CodeComponentMeta, CodeComponentMode, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, StateHelpers, StateSpec, default as registerComponent, stateHelpersKeys, } from "./registerComponent";
9
+ export { CustomFunctionMeta, CustomFunctionRegistration, ParamType, default as registerFunction, } from "./registerFunction";
10
+ export { GlobalContextMeta, PropType as GlobalContextPropType, GlobalContextRegistration, default as registerGlobalContext, } from "./registerGlobalContext";
11
+ export { TokenRegistration, TokenType, default as registerToken, } from "./registerToken";
12
+ export { BasicTrait, ChoiceTrait, TraitMeta, TraitRegistration, default as registerTrait, } from "./registerTrait";
13
13
  export { default as repeatedElement } from "./repeatedElement";
@@ -402,6 +402,16 @@ export interface ModalProps {
402
402
  onClose: () => void;
403
403
  style?: CSSProperties;
404
404
  }
405
+ export interface StudioOps {
406
+ showModal: (modalProps: Omit<ModalProps, "onClose"> & {
407
+ onClose?: () => void;
408
+ }) => void;
409
+ refreshQueryData: () => void;
410
+ appendToSlot: (element: PlasmicElement, slotName: string) => void;
411
+ removeFromSlotAt: (pos: number, slotName: string) => void;
412
+ updateProps: (newValues: any) => void;
413
+ updateStates: (newValues: any) => void;
414
+ }
405
415
  export interface CustomControlProps<P> {
406
416
  componentProps: P;
407
417
  /**
@@ -410,6 +420,11 @@ export interface CustomControlProps<P> {
410
420
  * calls `setControlContextData`)
411
421
  */
412
422
  contextData: InferDataType<P> | null;
423
+ /**
424
+ * Operations available to the editor that allow modifying the entire component.
425
+ * Can be null if the custom prop is used in a global context.
426
+ */
427
+ studioOps: StudioOps | null;
413
428
  value: any;
414
429
  /**
415
430
  * Sets the value to be passed to the prop. Expects a JSON-compatible value.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { CodeComponentElement, CSSProperties, PlasmicElement } from "./element-types";
3
- import { ContextDependentConfig, InferDataType, ModalProps, PropType, RestrictPropType } from "./prop-types";
2
+ import { CodeComponentElement, CSSProperties } from "./element-types";
3
+ import { ContextDependentConfig, InferDataType, 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> {
@@ -11,16 +11,10 @@ export interface ActionProps<P> {
11
11
  * calls `setControlContextData`)
12
12
  */
13
13
  contextData: InferDataType<P> | null;
14
- studioOps: {
15
- showModal: (modalProps: Omit<ModalProps, "onClose"> & {
16
- onClose?: () => void;
17
- }) => void;
18
- refreshQueryData: () => void;
19
- appendToSlot: (element: PlasmicElement, slotName: string) => void;
20
- removeFromSlotAt: (pos: number, slotName: string) => void;
21
- updateProps: (newValues: any) => void;
22
- updateStates: (newValues: any) => void;
23
- };
14
+ /**
15
+ * Operations available to the editor that allow modifying the entire component.
16
+ */
17
+ studioOps: StudioOps;
24
18
  /**
25
19
  * The document that the component will be rendered into; instead of using
26
20
  * `document` directly (for, say, `document.querySelector()` etc.), you
@@ -1 +1 @@
1
- export declare const hostVersion = "1.0.202";
1
+ export declare const hostVersion = "1.0.204";
@@ -38,4 +38,11 @@ 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;
43
+ isSelected: boolean;
44
+ selectedSlotName: string | null;
45
+ }
46
+ export declare const PlasmicCanvasCodeComponentContext: React.Context<PlasmicCanvasCodeComponentContextValue | null>;
47
+ export declare const usePlasmicCanvasCodeComponentContext: () => PlasmicCanvasCodeComponentContextValue | null;
41
48
  export {};
@@ -1,13 +1,13 @@
1
- export { PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasContext, } from "./canvas-host";
1
+ export { PlasmicCanvasCodeComponentContext, PlasmicCanvasContext, PlasmicCanvasHost, usePlasmicCanvasCodeComponentContext, 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
7
  export { ContextDependentConfig, PropType } from "./prop-types";
8
- export { Action, ActionProps, CodeComponentMeta, CodeComponentMode, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, StateHelpers, stateHelpersKeys, StateSpec, } from "./registerComponent";
9
- export { CustomFunctionMeta, CustomFunctionRegistration, default as registerFunction, ParamType, } from "./registerFunction";
10
- export { default as registerGlobalContext, GlobalContextMeta, GlobalContextRegistration, PropType as GlobalContextPropType, } from "./registerGlobalContext";
11
- export { default as registerToken, TokenRegistration, TokenType, } from "./registerToken";
12
- export { BasicTrait, ChoiceTrait, default as registerTrait, TraitMeta, TraitRegistration, } from "./registerTrait";
8
+ export { Action, ActionProps, CodeComponentMeta, CodeComponentMode, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, StateHelpers, StateSpec, default as registerComponent, stateHelpersKeys, } from "./registerComponent";
9
+ export { CustomFunctionMeta, CustomFunctionRegistration, ParamType, default as registerFunction, } from "./registerFunction";
10
+ export { GlobalContextMeta, PropType as GlobalContextPropType, GlobalContextRegistration, default as registerGlobalContext, } from "./registerGlobalContext";
11
+ export { TokenRegistration, TokenType, default as registerToken, } from "./registerToken";
12
+ export { BasicTrait, ChoiceTrait, TraitMeta, TraitRegistration, default as registerTrait, } from "./registerTrait";
13
13
  export { default as repeatedElement } from "./repeatedElement";
@@ -402,6 +402,16 @@ export interface ModalProps {
402
402
  onClose: () => void;
403
403
  style?: CSSProperties;
404
404
  }
405
+ export interface StudioOps {
406
+ showModal: (modalProps: Omit<ModalProps, "onClose"> & {
407
+ onClose?: () => void;
408
+ }) => void;
409
+ refreshQueryData: () => void;
410
+ appendToSlot: (element: PlasmicElement, slotName: string) => void;
411
+ removeFromSlotAt: (pos: number, slotName: string) => void;
412
+ updateProps: (newValues: any) => void;
413
+ updateStates: (newValues: any) => void;
414
+ }
405
415
  export interface CustomControlProps<P> {
406
416
  componentProps: P;
407
417
  /**
@@ -410,6 +420,11 @@ export interface CustomControlProps<P> {
410
420
  * calls `setControlContextData`)
411
421
  */
412
422
  contextData: InferDataType<P> | null;
423
+ /**
424
+ * Operations available to the editor that allow modifying the entire component.
425
+ * Can be null if the custom prop is used in a global context.
426
+ */
427
+ studioOps: StudioOps | null;
413
428
  value: any;
414
429
  /**
415
430
  * Sets the value to be passed to the prop. Expects a JSON-compatible value.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { CodeComponentElement, CSSProperties, PlasmicElement } from "./element-types";
3
- import { ContextDependentConfig, InferDataType, ModalProps, PropType, RestrictPropType } from "./prop-types";
2
+ import { CodeComponentElement, CSSProperties } from "./element-types";
3
+ import { ContextDependentConfig, InferDataType, 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> {
@@ -11,16 +11,10 @@ export interface ActionProps<P> {
11
11
  * calls `setControlContextData`)
12
12
  */
13
13
  contextData: InferDataType<P> | null;
14
- studioOps: {
15
- showModal: (modalProps: Omit<ModalProps, "onClose"> & {
16
- onClose?: () => void;
17
- }) => void;
18
- refreshQueryData: () => void;
19
- appendToSlot: (element: PlasmicElement, slotName: string) => void;
20
- removeFromSlotAt: (pos: number, slotName: string) => void;
21
- updateProps: (newValues: any) => void;
22
- updateStates: (newValues: any) => void;
23
- };
14
+ /**
15
+ * Operations available to the editor that allow modifying the entire component.
16
+ */
17
+ studioOps: StudioOps;
24
18
  /**
25
19
  * The document that the component will be rendered into; instead of using
26
20
  * `document` directly (for, say, `document.querySelector()` etc.), you
@@ -1 +1 @@
1
- export declare const hostVersion = "1.0.202";
1
+ export declare const hostVersion = "1.0.204";