unlayer-types 1.438.0 → 1.440.0

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 (2) hide show
  1. package/embed.d.ts +10 -10
  2. package/package.json +1 -1
package/embed.d.ts CHANGED
@@ -1418,7 +1418,7 @@ declare module "packages/editor/src/engine/config/optionGroups" {
1418
1418
  }
1419
1419
  declare module "packages/editor/src/state/types/types" {
1420
1420
  import * as Ariakit from '@ariakit/react';
1421
- import { MutableRefObject, ReactInstance } from 'react';
1421
+ import { MutableRefObject } from 'react';
1422
1422
  import { z } from 'zod';
1423
1423
  import type { AICopilotDataType } from '@libs/ai/types/types';
1424
1424
  import { DisplayConditionZodSchema } from '@libs/schemas/common/schemas';
@@ -1706,7 +1706,7 @@ declare module "packages/editor/src/state/types/types" {
1706
1706
  selectedAt: number | null;
1707
1707
  }
1708
1708
  export interface LayerGroup {
1709
- elementRef: MutableRefObject<ReactInstance | undefined> | null | undefined;
1709
+ elementRef: MutableRefObject<Element | null | undefined> | null | undefined;
1710
1710
  layerCollection: Location['collection'];
1711
1711
  layerIndex?: Placeholder['index'];
1712
1712
  parentCollection: Location['collection'];
@@ -1714,8 +1714,9 @@ declare module "packages/editor/src/state/types/types" {
1714
1714
  placeholders: Partial<Record<NonNullable<Placeholder['index']>, Placeholder | undefined>>;
1715
1715
  }
1716
1716
  export interface Placeholder {
1717
- elementRef: MutableRefObject<ReactInstance | undefined> | null | undefined;
1717
+ elementRef: MutableRefObject<Element | null | undefined> | null | undefined;
1718
1718
  active?: boolean;
1719
+ collection?: Location['collection'];
1719
1720
  index: number | 'first' | 'last' | undefined;
1720
1721
  layerGroupParentLocation: Location | undefined;
1721
1722
  }
@@ -3087,7 +3088,7 @@ declare module "packages/editor/src/engine/config/tabs" {
3087
3088
  }
3088
3089
  declare module "packages/editor/src/engine/config/createPanel" {
3089
3090
  import React, { RefObject } from 'react';
3090
- export type PanelMountFn = (node: RefObject<HTMLDivElement> | null) => void;
3091
+ export type PanelMountFn = (node: RefObject<HTMLDivElement | null> | null) => void;
3091
3092
  export type PanelRenderFn = () => string;
3092
3093
  export interface PanelConfig {
3093
3094
  mount: PanelMountFn;
@@ -3129,9 +3130,6 @@ declare module "packages/editor/src/engine/config/createViewer" {
3129
3130
  forceUpdate(callback?: () => void): void;
3130
3131
  readonly props: Readonly<ViewerProps>;
3131
3132
  state: Readonly<{}>;
3132
- refs: {
3133
- [key: string]: React.ReactInstance;
3134
- };
3135
3133
  componentWillUnmount?(): void;
3136
3134
  componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
3137
3135
  getSnapshotBeforeUpdate?(prevProps: Readonly<ViewerProps>, prevState: Readonly<{}>): any;
@@ -3154,9 +3152,6 @@ declare module "packages/editor/src/engine/config/createViewer" {
3154
3152
  forceUpdate(callback?: () => void): void;
3155
3153
  readonly props: Readonly<ViewerProps>;
3156
3154
  state: Readonly<{}>;
3157
- refs: {
3158
- [key: string]: React.ReactInstance;
3159
- };
3160
3155
  componentWillUnmount?(): void;
3161
3156
  componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
3162
3157
  getSnapshotBeforeUpdate?(prevProps: Readonly<ViewerProps>, prevState: Readonly<{}>): any;
@@ -3168,6 +3163,7 @@ declare module "packages/editor/src/engine/config/createViewer" {
3168
3163
  UNSAFE_componentWillUpdate?(nextProps: Readonly<ViewerProps>, nextState: Readonly<{}>, nextContext: any): void;
3169
3164
  };
3170
3165
  contextType?: React.Context<any> | undefined;
3166
+ propTypes?: any;
3171
3167
  };
3172
3168
  }
3173
3169
  declare module "packages/editor/src/engine/config/createWidget" {
@@ -3444,6 +3440,10 @@ declare module "packages/editor/src/state/types/callbacks" {
3444
3440
  height?: number;
3445
3441
  id?: number | string;
3446
3442
  filename?: string;
3443
+ /** Abort the in-progress upload and silently reset the state back to its default ("Upload Image"), with no error shown. */
3444
+ abort?: boolean;
3445
+ /** Reset the upload state and show the "Upload Failed" state. Pass a string for a custom message. */
3446
+ error?: boolean | string;
3447
3447
  }) => void) => void;
3448
3448
  selectImage: (data: Record<string, any>, done: (result: {
3449
3449
  url: string;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "unlayer-types",
3
- "version": "1.438.0",
3
+ "version": "1.440.0",
4
4
  "license": "MIT"
5
5
  }