@myoc/common 0.19.520 → 0.19.522

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 (154) hide show
  1. package/dist/dev/index.js +62 -7
  2. package/dist/dev/index.js.map +2 -2
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/src/colors.d.ts +14 -0
  5. package/dist/types/common/src/constants.d.ts +3 -0
  6. package/dist/types/common/src/keys.d.ts +2 -0
  7. package/dist/types/common/src/points.d.ts +1 -1
  8. package/dist/types/common/src/utils.d.ts +1 -1
  9. package/dist/types/element/src/Scene.d.ts +1 -1
  10. package/dist/types/element/src/align.d.ts +2 -2
  11. package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
  12. package/dist/types/element/src/arrows/focus.d.ts +5 -2
  13. package/dist/types/element/src/binding.d.ts +17 -8
  14. package/dist/types/element/src/bounds.d.ts +5 -9
  15. package/dist/types/element/src/bucketFill.d.ts +110 -0
  16. package/dist/types/element/src/collision.d.ts +1 -1
  17. package/dist/types/element/src/comparisons.d.ts +4 -4
  18. package/dist/types/element/src/convertToShape.d.ts +23 -0
  19. package/dist/types/element/src/distribute.d.ts +2 -2
  20. package/dist/types/element/src/dragElements.d.ts +27 -0
  21. package/dist/types/element/src/duplicate.d.ts +3 -3
  22. package/dist/types/element/src/embeddable.d.ts +2 -2
  23. package/dist/types/element/src/flowchart.d.ts +7 -7
  24. package/dist/types/element/src/fractionalIndex.d.ts +2 -2
  25. package/dist/types/element/src/frame.d.ts +4 -4
  26. package/dist/types/element/src/groups.d.ts +9 -9
  27. package/dist/types/element/src/index.d.ts +4 -1
  28. package/dist/types/element/src/linearElementEditor.d.ts +17 -10
  29. package/dist/types/element/src/newElement.d.ts +13 -0
  30. package/dist/types/element/src/renderElement.d.ts +0 -3
  31. package/dist/types/element/src/resizeElements.d.ts +2 -2
  32. package/dist/types/element/src/selection.d.ts +5 -5
  33. package/dist/types/element/src/shape.d.ts +12 -0
  34. package/dist/types/element/src/sortElements.d.ts +10 -0
  35. package/dist/types/element/src/textElement.d.ts +12 -9
  36. package/dist/types/element/src/transform.d.ts +2 -2
  37. package/dist/types/element/src/typeChecks.d.ts +25 -25
  38. package/dist/types/element/src/types.d.ts +2 -1
  39. package/dist/types/element/src/zindex.d.ts +2 -2
  40. package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
  41. package/dist/types/excalidraw/actions/actionBoundText.d.ts +24 -8
  42. package/dist/types/excalidraw/actions/actionCanvas.d.ts +128 -961
  43. package/dist/types/excalidraw/actions/actionClipboard.d.ts +24 -8
  44. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +12 -4
  45. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +38 -13
  46. package/dist/types/excalidraw/actions/actionDeselect.d.ts +9 -4
  47. package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
  48. package/dist/types/excalidraw/actions/actionElementLink.d.ts +12 -4
  49. package/dist/types/excalidraw/actions/actionElementLock.d.ts +25 -9
  50. package/dist/types/excalidraw/actions/actionExport.d.ts +29 -13
  51. package/dist/types/excalidraw/actions/actionFrame.d.ts +47 -205
  52. package/dist/types/excalidraw/actions/actionGroup.d.ts +39 -23
  53. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +15 -6
  54. package/dist/types/excalidraw/actions/actionLink.d.ts +13 -5
  55. package/dist/types/excalidraw/actions/actionMenu.d.ts +12 -4
  56. package/dist/types/excalidraw/actions/actionProperties.d.ts +43 -24
  57. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +17 -9
  58. package/dist/types/excalidraw/actions/actionStyles.d.ts +12 -4
  59. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
  60. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +14 -6
  61. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +16 -9
  62. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +13 -5
  63. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +13 -5
  64. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +16 -9
  65. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +13 -5
  66. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +14 -6
  67. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +13 -5
  68. package/dist/types/excalidraw/actions/index.d.ts +1 -2
  69. package/dist/types/excalidraw/actions/manager.d.ts +1 -0
  70. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  71. package/dist/types/excalidraw/actions/types.d.ts +8 -4
  72. package/dist/types/excalidraw/appState.d.ts +11 -6
  73. package/dist/types/excalidraw/clipboard.d.ts +34 -0
  74. package/dist/types/excalidraw/components/Actions.d.ts +17 -12
  75. package/dist/types/excalidraw/components/App.arrowText.d.ts +72 -0
  76. package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
  77. package/dist/types/excalidraw/components/App.cursor.d.ts +30 -0
  78. package/dist/types/excalidraw/components/App.d.ts +384 -60
  79. package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
  80. package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
  81. package/dist/types/excalidraw/components/App.viewport.d.ts +73 -0
  82. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -3
  83. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
  84. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +3 -1
  85. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +9 -2
  86. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +4 -2
  87. package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
  88. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -1
  89. package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +31 -0
  90. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +1 -1
  91. package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
  92. package/dist/types/excalidraw/components/{ToolButton.d.ts → IconButton.d.ts} +16 -19
  93. package/dist/types/excalidraw/components/Island.d.ts +7 -0
  94. package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
  95. package/dist/types/excalidraw/components/LayerUI.d.ts +5 -2
  96. package/dist/types/excalidraw/components/LockButton.d.ts +9 -0
  97. package/dist/types/excalidraw/components/MobileMenu.d.ts +4 -4
  98. package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
  99. package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
  100. package/dist/types/excalidraw/components/Popover.d.ts +1 -3
  101. package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
  102. package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
  103. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
  104. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -2
  105. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
  106. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
  107. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
  108. package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
  109. package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
  110. package/dist/types/excalidraw/components/ToolPopover.d.ts +3 -6
  111. package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
  112. package/dist/types/excalidraw/components/Tools.d.ts +146 -0
  113. package/dist/types/excalidraw/components/UserList.d.ts +3 -2
  114. package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
  115. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -0
  116. package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
  117. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -2
  118. package/dist/types/excalidraw/components/icons.d.ts +4 -1
  119. package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
  120. package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
  121. package/dist/types/excalidraw/context/tunnels.d.ts +0 -1
  122. package/dist/types/excalidraw/data/blob.d.ts +17 -9
  123. package/dist/types/excalidraw/data/index.d.ts +4 -4
  124. package/dist/types/excalidraw/data/json.d.ts +23 -15
  125. package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
  126. package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
  127. package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
  128. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +10 -3
  129. package/dist/types/excalidraw/scene/Renderer.d.ts +11 -11
  130. package/dist/types/excalidraw/scene/export.d.ts +3 -3
  131. package/dist/types/excalidraw/scene/index.d.ts +1 -1
  132. package/dist/types/excalidraw/scene/types.d.ts +4 -3
  133. package/dist/types/excalidraw/snapping.d.ts +7 -7
  134. package/dist/types/excalidraw/types.d.ts +425 -27
  135. package/dist/types/excalidraw/viewport.d.ts +283 -0
  136. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +2 -3
  137. package/dist/types/laser-pointer/src/state.d.ts +1 -0
  138. package/dist/types/math/src/index.d.ts +1 -0
  139. package/dist/types/math/src/pca.d.ts +79 -0
  140. package/dist/types/math/src/polygon.d.ts +25 -1
  141. package/dist/types/utils/src/export.d.ts +3 -3
  142. package/package.json +1 -1
  143. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -180
  144. package/dist/types/excalidraw/actions/actionSmartZoom.d.ts +0 -16
  145. package/dist/types/excalidraw/components/DefaultSidebar.d.ts +0 -27
  146. package/dist/types/excalidraw/components/ElementCanvasButtons.d.ts +0 -7
  147. package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
  148. package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
  149. package/dist/types/excalidraw/components/MagicButton.d.ts +0 -10
  150. package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -12
  151. package/dist/types/excalidraw/cursor.d.ts +0 -5
  152. package/dist/types/excalidraw/scene/scroll.d.ts +0 -18
  153. package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
  154. package/dist/types/excalidraw/scroll.d.ts +0 -46
@@ -1,23 +1,26 @@
1
1
  import { type Radians } from "@excalidraw/math";
2
- import type { AppState } from "@excalidraw/excalidraw/types";
3
2
  import type { ExtractSetType } from "@excalidraw/common/utility-types";
4
3
  import type { Scene } from "./Scene";
5
4
  import type { MaybeTransformHandleType } from "./transformHandles";
6
- import type { ElementsMap, ExcalidrawElement, ExcalidrawElementType, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, NonDeletedExcalidrawElement } from "./types";
5
+ import type { ElementsMap, ExcalidrawElement, ExcalidrawElementType, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, NonDeleted } from "./types";
7
6
  export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null, scene: Scene) => void;
8
- export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement, scene: Scene, transformHandleType: MaybeTransformHandleType, shouldMaintainAspectRatio?: boolean) => void;
7
+ export declare const handleBindTextResize: (container: ExcalidrawElement, scene: Scene, transformHandleType: MaybeTransformHandleType, shouldMaintainAspectRatio?: boolean, shouldResizeFromCenter?: boolean) => void;
9
8
  export declare const computeBoundTextPosition: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer, elementsMap: ElementsMap) => {
10
9
  x: number;
11
10
  y: number;
12
11
  };
13
12
  export declare const getBoundTextElementId: (container: ExcalidrawElement | null) => string | null;
14
- export declare const getBoundTextElement: (element: ExcalidrawElement | null, elementsMap: ElementsMap) => ExcalidrawTextElementWithContainer | null;
15
- export declare const getContainerElement: (element: ExcalidrawTextElement | null, elementsMap: ElementsMap) => ExcalidrawTextContainer | null;
16
- export declare const getContainerCenter: (container: ExcalidrawElement, appState: AppState, elementsMap: ElementsMap) => {
13
+ export declare const getBoundTextElement: (element: ExcalidrawElement | null, elementsMap: ElementsMap) => NonDeleted<ExcalidrawTextElementWithContainer> | null;
14
+ export declare const getContainerElement: <T extends ExcalidrawTextElement, R extends ExcalidrawTextContainer>(element: T | null, elementsMap: ElementsMap) => R | null;
15
+ /**
16
+ * The point a text bound to this container centers on — and, for arrows, the
17
+ * point the text tool snaps a new label to.
18
+ */
19
+ export declare const getContainerCenter: (container: ExcalidrawElement, elementsMap: ElementsMap) => {
17
20
  x: number;
18
21
  y: number;
19
22
  };
20
- export declare const getContainerCoords: (container: NonDeletedExcalidrawElement) => {
23
+ export declare const getContainerCoords: (container: ExcalidrawElement) => {
21
24
  x: number;
22
25
  y: number;
23
26
  };
@@ -26,8 +29,8 @@ export declare const getBoundTextElementPosition: (container: ExcalidrawElement,
26
29
  x: number;
27
30
  y: number;
28
31
  } | undefined;
29
- export declare const shouldAllowVerticalAlign: (selectedElements: NonDeletedExcalidrawElement[], elementsMap: ElementsMap) => boolean;
30
- export declare const suppportsHorizontalAlign: (selectedElements: NonDeletedExcalidrawElement[], elementsMap: ElementsMap) => boolean;
32
+ export declare const shouldAllowVerticalAlign: (selectedElements: readonly ExcalidrawElement[], elementsMap: ElementsMap) => boolean;
33
+ export declare const suppportsHorizontalAlign: (selectedElements: readonly ExcalidrawElement[], elementsMap: ElementsMap) => boolean;
31
34
  declare const VALID_CONTAINER_TYPES: Set<string>;
32
35
  export declare const isValidTextContainer: (element: {
33
36
  type: ExcalidrawElementType;
@@ -1,6 +1,6 @@
1
1
  import type { MarkOptional } from "@excalidraw/common/utility-types";
2
2
  import { type ElementConstructorOpts } from "./newElement";
3
- import type { ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawFreeDrawElement, ExcalidrawGenericElement, ExcalidrawIframeLikeElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawMagicFrameElement, ExcalidrawSelectionElement, ExcalidrawTextElement, FileId, FontFamilyValues, TextAlign, VerticalAlign } from "./types";
3
+ import type { ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawFreeDrawElement, ExcalidrawGenericElement, ExcalidrawIframeLikeElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawMagicFrameElement, ExcalidrawSelectionElement, ExcalidrawTextElement, FileId, FontFamilyValues, NonDeletedExcalidrawElement, Ordered, TextAlign, VerticalAlign } from "./types";
4
4
  export type ValidLinearElement = {
5
5
  type: "arrow" | "line";
6
6
  x: number;
@@ -78,4 +78,4 @@ export type ExcalidrawElementSkeleton = Extract<Exclude<ExcalidrawElement, Excal
78
78
  } & Partial<ExcalidrawMagicFrameElement>);
79
79
  export declare const convertToExcalidrawElements: (elementsSkeleton: ExcalidrawElementSkeleton[] | null, opts?: {
80
80
  regenerateIds: boolean;
81
- }) => import("./types").OrderedExcalidrawElement[];
81
+ }) => Ordered<NonDeletedExcalidrawElement>[];
@@ -1,38 +1,38 @@
1
1
  import type { ElementOrToolType } from "@excalidraw/excalidraw/types";
2
2
  import type { MarkNonNullable } from "@excalidraw/common/utility-types";
3
3
  import type { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawEmbeddableElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeElement, ExcalidrawIframeLikeElement, ExcalidrawMagicFrameElement, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, ExcalidrawLineElement, ExcalidrawFlowchartNodeElement, ExcalidrawLinearElementSubType } from "./types";
4
- export declare const isInitializedImageElement: (element: ExcalidrawElement | null) => element is InitializedExcalidrawImageElement;
5
- export declare const isImageElement: (element: ExcalidrawElement | null) => element is ExcalidrawImageElement;
6
- export declare const isEmbeddableElement: (element: ExcalidrawElement | null | undefined) => element is ExcalidrawEmbeddableElement;
7
- export declare const isIframeElement: (element: ExcalidrawElement | null) => element is ExcalidrawIframeElement;
8
- export declare const isIframeLikeElement: (element: ExcalidrawElement | null) => element is ExcalidrawIframeLikeElement;
9
- export declare const isTextElement: (element: ExcalidrawElement | null) => element is ExcalidrawTextElement;
10
- export declare const isFrameElement: (element: ExcalidrawElement | null) => element is ExcalidrawFrameElement;
11
- export declare const isMagicFrameElement: (element: ExcalidrawElement | null) => element is ExcalidrawMagicFrameElement;
12
- export declare const isFrameLikeElement: (element: ExcalidrawElement | null) => element is ExcalidrawFrameLikeElement;
13
- export declare const isFreeDrawElement: (element?: ExcalidrawElement | null) => element is ExcalidrawFreeDrawElement;
4
+ export declare const isInitializedImageElement: <T extends ExcalidrawElement>(element: T | null) => element is T & InitializedExcalidrawImageElement;
5
+ export declare const isImageElement: <T extends ExcalidrawElement>(element: T | null) => element is T & ExcalidrawImageElement;
6
+ export declare const isEmbeddableElement: <T extends ExcalidrawElement>(element: T | null | undefined) => element is T & ExcalidrawEmbeddableElement;
7
+ export declare const isIframeElement: <T extends ExcalidrawElement>(element: T | null) => element is T & ExcalidrawIframeElement;
8
+ export declare const isIframeLikeElement: <T extends ExcalidrawElement>(element: T | null) => element is T & ExcalidrawIframeLikeElement;
9
+ export declare const isTextElement: <T extends ExcalidrawElement>(element: T | null) => element is T & ExcalidrawTextElement;
10
+ export declare const isFrameElement: <T extends ExcalidrawElement>(element: T | null) => element is T & ExcalidrawFrameElement;
11
+ export declare const isMagicFrameElement: <T extends ExcalidrawElement>(element: T | null) => element is T & ExcalidrawMagicFrameElement;
12
+ export declare const isFrameLikeElement: <T extends ExcalidrawElement>(element: T | null) => element is T & ExcalidrawFrameLikeElement;
13
+ export declare const isFreeDrawElement: <T extends ExcalidrawElement>(element?: T | null) => element is T & ExcalidrawFreeDrawElement;
14
14
  export declare const isFreeDrawElementType: (elementType: ExcalidrawElementType) => boolean;
15
- export declare const isLinearElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLinearElement;
16
- export declare const isLineElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLineElement;
17
- export declare const isArrowElement: (element?: ExcalidrawElement | null) => element is ExcalidrawArrowElement;
18
- export declare const isElbowArrow: (element?: ExcalidrawElement) => element is ExcalidrawElbowArrowElement;
15
+ export declare const isLinearElement: <T extends ExcalidrawElement>(element?: T | null) => element is T & ExcalidrawLinearElement;
16
+ export declare const isLineElement: <T extends ExcalidrawElement>(element?: T | null) => element is T & ExcalidrawLineElement;
17
+ export declare const isArrowElement: <T extends ExcalidrawElement>(element?: T | null) => element is T & ExcalidrawArrowElement;
18
+ export declare const isElbowArrow: <T extends ExcalidrawElement>(element?: T) => element is T & ExcalidrawElbowArrowElement;
19
19
  /**
20
20
  * sharp or curved arrow, but not elbow
21
21
  */
22
- export declare const isSimpleArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
23
- export declare const isSharpArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
24
- export declare const isCurvedArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
22
+ export declare const isSimpleArrow: <T extends ExcalidrawElement>(element?: T) => element is T & ExcalidrawArrowElement;
23
+ export declare const isSharpArrow: <T extends ExcalidrawElement>(element?: T) => element is T & ExcalidrawArrowElement;
24
+ export declare const isCurvedArrow: <T extends ExcalidrawElement>(element?: T) => element is T & ExcalidrawArrowElement;
25
25
  export declare const isLinearElementType: (elementType: ElementOrToolType) => boolean;
26
- export declare const isBindingElement: (element?: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawArrowElement;
26
+ export declare const isBindingElement: <T extends ExcalidrawElement>(element?: T | null, includeLocked?: boolean) => element is T & ExcalidrawArrowElement;
27
27
  export declare const isBindingElementType: (elementType: ElementOrToolType) => boolean;
28
- export declare const isBindableElement: (element: ExcalidrawElement | null | undefined, includeLocked?: boolean) => element is ExcalidrawBindableElement;
29
- export declare const isRectanguloidElement: (element?: ExcalidrawElement | null) => element is ExcalidrawBindableElement;
30
- export declare const isRectangularElement: (element?: ExcalidrawElement | null) => element is ExcalidrawBindableElement;
31
- export declare const isTextBindableContainer: (element: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawTextContainer;
28
+ export declare const isBindableElement: <T extends ExcalidrawElement>(element: T | null | undefined, includeLocked?: boolean) => element is T & ExcalidrawBindableElement;
29
+ export declare const isRectanguloidElement: <T extends ExcalidrawElement>(element?: T | null) => element is T & ExcalidrawBindableElement;
30
+ export declare const isRectangularElement: <T extends ExcalidrawElement>(element?: T | null) => element is T & ExcalidrawBindableElement;
31
+ export declare const isTextBindableContainer: <T extends ExcalidrawElement>(element: T | null, includeLocked?: boolean) => element is T & ExcalidrawTextContainer;
32
32
  export declare const isExcalidrawElement: (element: any) => element is ExcalidrawElement;
33
- export declare const isFlowchartNodeElement: (element: ExcalidrawElement) => element is ExcalidrawFlowchartNodeElement;
34
- export declare const hasBoundTextElement: (element: ExcalidrawElement | null) => element is MarkNonNullable<ExcalidrawBindableElement, "boundElements">;
35
- export declare const isBoundToContainer: (element: ExcalidrawElement | null) => element is ExcalidrawTextElementWithContainer;
33
+ export declare const isFlowchartNodeElement: <T extends ExcalidrawElement>(element: T) => element is T & ExcalidrawFlowchartNodeElement;
34
+ export declare const hasBoundTextElement: <T extends ExcalidrawElement>(element: T | null) => element is T & MarkNonNullable<ExcalidrawBindableElement, "boundElements">;
35
+ export declare const isBoundToContainer: <T extends ExcalidrawElement>(element: T | null) => element is T & ExcalidrawTextElementWithContainer;
36
36
  export declare const isArrowBoundToElement: (element: ExcalidrawArrowElement) => boolean;
37
37
  export declare const isUsingAdaptiveRadius: (type: string) => type is "rectangle" | "embeddable" | "iframe" | "image";
38
38
  export declare const isUsingProportionalRadius: (type: string) => type is "line" | "arrow" | "diamond";
@@ -167,7 +167,7 @@ export type Ordered<TElement extends ExcalidrawElement> = TElement & {
167
167
  };
168
168
  export type OrderedExcalidrawElement = Ordered<ExcalidrawElement>;
169
169
  export type NonDeleted<TElement extends ExcalidrawElement> = TElement & {
170
- isDeleted: boolean;
170
+ isDeleted: false;
171
171
  };
172
172
  export type NonDeletedExcalidrawElement = NonDeleted<ExcalidrawElement>;
173
173
  export type ExcalidrawTextElement = _ExcalidrawElementBase & Readonly<{
@@ -297,6 +297,7 @@ export type SceneElementsMap = Map<ExcalidrawElement["id"], Ordered<ExcalidrawEl
297
297
  export type NonDeletedSceneElementsMap = Map<ExcalidrawElement["id"], Ordered<NonDeletedExcalidrawElement>> & MakeBrand<"NonDeletedSceneElementsMap">;
298
298
  export type ElementsMapOrArray = readonly ExcalidrawElement[] | Readonly<ElementsMap>;
299
299
  export type ArrangeAlgorithms = "bin-packing" | "bin-packing-center" | "bin-packing-max-rects" | "bin-packing-binary-tree";
300
+ export type NonDeletedElementsMapOrArray = readonly NonDeletedExcalidrawElement[] | Readonly<NonDeletedElementsMap | NonDeletedSceneElementsMap>;
300
301
  export type ExcalidrawLinearElementSubType = "line" | "sharpArrow" | "curvedArrow" | "elbowArrow";
301
302
  export type ConvertibleGenericTypes = "rectangle" | "diamond" | "ellipse";
302
303
  export type ConvertibleLinearTypes = ExcalidrawLinearElementSubType;
@@ -1,12 +1,12 @@
1
1
  import type { AppState } from "@excalidraw/excalidraw/types";
2
2
  import type { GlobalPoint } from "@excalidraw/math";
3
3
  import type { Scene } from "./Scene";
4
- import type { ExcalidrawArrowElement, ExcalidrawElement, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap, Ordered, OrderedExcalidrawElement } from "./types";
4
+ import type { ExcalidrawArrowElement, ExcalidrawElement, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap, OrderedExcalidrawElement } from "./types";
5
5
  /**
6
6
  * Moves the arrow element above any bindable elements it intersects with or
7
7
  * hovers over.
8
8
  */
9
- export declare const moveArrowAboveBindable: (point: GlobalPoint, arrow: ExcalidrawArrowElement, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, scene: Scene, hit?: NonDeletedExcalidrawElement) => readonly OrderedExcalidrawElement[];
9
+ export declare const moveArrowAboveBindable: (point: GlobalPoint, arrow: ExcalidrawArrowElement, elements: readonly OrderedExcalidrawElement[], elementsMap: NonDeletedSceneElementsMap, scene: Scene, hit?: NonDeletedExcalidrawElement) => readonly OrderedExcalidrawElement[];
10
10
  export declare const moveOneLeft: (allElements: readonly ExcalidrawElement[], appState: AppState, scene: Scene) => readonly ExcalidrawElement[];
11
11
  export declare const moveOneRight: (allElements: readonly ExcalidrawElement[], appState: AppState, scene: Scene) => readonly ExcalidrawElement[];
12
12
  export declare const moveAllLeft: (allElements: readonly ExcalidrawElement[], appState: AppState) => readonly ExcalidrawElement[] | ExcalidrawElement[];
@@ -11,7 +11,7 @@ export declare const actionAlignTop: {
11
11
  predicate: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: import("../types").ExcalidrawProps, app: AppClassProperties) => boolean;
12
12
  perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: AppClassProperties) => {
13
13
  appState: Readonly<AppState>;
14
- elements: ExcalidrawElement[];
14
+ elements: (import("@excalidraw/element/types").ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawSelectionElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | import("@excalidraw/element/types").ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement)[];
15
15
  captureUpdate: "IMMEDIATELY";
16
16
  };
17
17
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
@@ -29,7 +29,7 @@ export declare const actionAlignBottom: {
29
29
  predicate: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: import("../types").ExcalidrawProps, app: AppClassProperties) => boolean;
30
30
  perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: AppClassProperties) => {
31
31
  appState: Readonly<AppState>;
32
- elements: ExcalidrawElement[];
32
+ elements: (import("@excalidraw/element/types").ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawSelectionElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | import("@excalidraw/element/types").ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement)[];
33
33
  captureUpdate: "IMMEDIATELY";
34
34
  };
35
35
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
@@ -47,7 +47,7 @@ export declare const actionAlignLeft: {
47
47
  predicate: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: import("../types").ExcalidrawProps, app: AppClassProperties) => boolean;
48
48
  perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: AppClassProperties) => {
49
49
  appState: Readonly<AppState>;
50
- elements: ExcalidrawElement[];
50
+ elements: (import("@excalidraw/element/types").ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawSelectionElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | import("@excalidraw/element/types").ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement)[];
51
51
  captureUpdate: "IMMEDIATELY";
52
52
  };
53
53
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
@@ -65,7 +65,7 @@ export declare const actionAlignRight: {
65
65
  predicate: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: import("../types").ExcalidrawProps, app: AppClassProperties) => boolean;
66
66
  perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: AppClassProperties) => {
67
67
  appState: Readonly<AppState>;
68
- elements: ExcalidrawElement[];
68
+ elements: (import("@excalidraw/element/types").ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawSelectionElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | import("@excalidraw/element/types").ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement)[];
69
69
  captureUpdate: "IMMEDIATELY";
70
70
  };
71
71
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
@@ -83,7 +83,7 @@ export declare const actionAlignVerticallyCentered: {
83
83
  predicate: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: import("../types").ExcalidrawProps, app: AppClassProperties) => boolean;
84
84
  perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: AppClassProperties) => {
85
85
  appState: Readonly<AppState>;
86
- elements: ExcalidrawElement[];
86
+ elements: (import("@excalidraw/element/types").ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawSelectionElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | import("@excalidraw/element/types").ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement)[];
87
87
  captureUpdate: "IMMEDIATELY";
88
88
  };
89
89
  PanelComponent: ({ elements, appState, updateData, app }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
@@ -100,7 +100,7 @@ export declare const actionAlignHorizontallyCentered: {
100
100
  predicate: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: import("../types").ExcalidrawProps, app: AppClassProperties) => boolean;
101
101
  perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: AppClassProperties) => {
102
102
  appState: Readonly<AppState>;
103
- elements: ExcalidrawElement[];
103
+ elements: (import("@excalidraw/element/types").ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawSelectionElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | import("@excalidraw/element/types").ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement)[];
104
104
  captureUpdate: "IMMEDIATELY";
105
105
  };
106
106
  PanelComponent: ({ elements, appState, updateData, app }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
@@ -65,6 +65,10 @@ export declare const actionBindText: {
65
65
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
66
66
  midPoint?: import("@excalidraw/math").GlobalPoint;
67
67
  } | null;
68
+ hoveredArrowTextAnchor: {
69
+ elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
70
+ anchor: "start" | "end" | "label";
71
+ } | null;
68
72
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
69
73
  frameRendering: {
70
74
  enabled: boolean;
@@ -72,8 +76,8 @@ export declare const actionBindText: {
72
76
  outline: boolean;
73
77
  clip: boolean;
74
78
  };
75
- editingFrame: string | null;
76
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
79
+ editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
80
+ elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
77
81
  editingTextElement: ExcalidrawTextElement | null;
78
82
  activeTool: {
79
83
  lastActiveTool: import("../types").ActiveTool | null;
@@ -109,6 +113,7 @@ export declare const actionBindText: {
109
113
  viewBackgroundColor: string;
110
114
  scrollX: number;
111
115
  scrollY: number;
116
+ scrollConstraints: import("../types").ScrollConstraints | null;
112
117
  cursorButton: "up" | "down";
113
118
  scrolledOutside: boolean;
114
119
  name: string | null;
@@ -177,8 +182,6 @@ export declare const actionBindText: {
177
182
  y: number;
178
183
  } | null;
179
184
  objectsSnapModeEnabled: boolean;
180
- userToFollow: import("../types").UserToFollow | null;
181
- followedBy: Set<import("../types").SocketId>;
182
185
  isCropping: boolean;
183
186
  croppingElementId: ExcalidrawElement["id"] | null;
184
187
  searchMatches: Readonly<{
@@ -190,6 +193,11 @@ export declare const actionBindText: {
190
193
  [groupId: string]: true;
191
194
  };
192
195
  bindMode: import("@excalidraw/element/types").BindMode;
196
+ colorTopPicks: {
197
+ elementStroke: readonly string[] | null;
198
+ elementBackground: readonly string[] | null;
199
+ bucketFill: readonly string[] | null;
200
+ };
193
201
  };
194
202
  captureUpdate: "IMMEDIATELY";
195
203
  };
@@ -245,6 +253,10 @@ export declare const actionWrapTextInContainer: {
245
253
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
246
254
  midPoint?: import("@excalidraw/math").GlobalPoint;
247
255
  } | null;
256
+ hoveredArrowTextAnchor: {
257
+ elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
258
+ anchor: "start" | "end" | "label";
259
+ } | null;
248
260
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
249
261
  frameRendering: {
250
262
  enabled: boolean;
@@ -252,8 +264,8 @@ export declare const actionWrapTextInContainer: {
252
264
  outline: boolean;
253
265
  clip: boolean;
254
266
  };
255
- editingFrame: string | null;
256
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
267
+ editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
268
+ elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
257
269
  editingTextElement: ExcalidrawTextElement | null;
258
270
  activeTool: {
259
271
  lastActiveTool: import("../types").ActiveTool | null;
@@ -289,6 +301,7 @@ export declare const actionWrapTextInContainer: {
289
301
  viewBackgroundColor: string;
290
302
  scrollX: number;
291
303
  scrollY: number;
304
+ scrollConstraints: import("../types").ScrollConstraints | null;
292
305
  cursorButton: "up" | "down";
293
306
  scrolledOutside: boolean;
294
307
  name: string | null;
@@ -357,8 +370,6 @@ export declare const actionWrapTextInContainer: {
357
370
  y: number;
358
371
  } | null;
359
372
  objectsSnapModeEnabled: boolean;
360
- userToFollow: import("../types").UserToFollow | null;
361
- followedBy: Set<import("../types").SocketId>;
362
373
  isCropping: boolean;
363
374
  croppingElementId: ExcalidrawElement["id"] | null;
364
375
  searchMatches: Readonly<{
@@ -370,6 +381,11 @@ export declare const actionWrapTextInContainer: {
370
381
  [groupId: string]: true;
371
382
  };
372
383
  bindMode: import("@excalidraw/element/types").BindMode;
384
+ colorTopPicks: {
385
+ elementStroke: readonly string[] | null;
386
+ elementBackground: readonly string[] | null;
387
+ bucketFill: readonly string[] | null;
388
+ };
373
389
  };
374
390
  captureUpdate: "IMMEDIATELY";
375
391
  };