@myoc/common 0.19.532 → 0.19.534

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 (44) hide show
  1. package/dist/dev/index.js +4 -1
  2. package/dist/dev/index.js.map +2 -2
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/src/constants.d.ts +1 -0
  5. package/dist/types/element/src/gif.d.ts +29 -0
  6. package/dist/types/element/src/image.d.ts +6 -1
  7. package/dist/types/element/src/index.d.ts +2 -0
  8. package/dist/types/element/src/newElement.d.ts +1 -0
  9. package/dist/types/element/src/renderGif.d.ts +5 -0
  10. package/dist/types/element/src/types.d.ts +12 -0
  11. package/dist/types/excalidraw/actions/actionBoundText.d.ts +2 -2
  12. package/dist/types/excalidraw/actions/actionCanvas.d.ts +6 -6
  13. package/dist/types/excalidraw/actions/actionClipboard.d.ts +2 -2
  14. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -1
  15. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -3
  16. package/dist/types/excalidraw/actions/actionDeselect.d.ts +1 -1
  17. package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -2
  18. package/dist/types/excalidraw/actions/actionExport.d.ts +2 -2
  19. package/dist/types/excalidraw/actions/actionFrame.d.ts +4 -3
  20. package/dist/types/excalidraw/actions/actionGroup.d.ts +2 -2
  21. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +2 -1
  22. package/dist/types/excalidraw/actions/actionLink.d.ts +1 -1
  23. package/dist/types/excalidraw/actions/actionProperties.d.ts +2 -2
  24. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
  25. package/dist/types/excalidraw/actions/actionStyles.d.ts +1 -1
  26. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +1 -1
  27. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
  28. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +1 -1
  29. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
  30. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +1 -1
  31. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
  32. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
  33. package/dist/types/excalidraw/components/App.d.ts +8 -1
  34. package/dist/types/excalidraw/components/App.gif.d.ts +18 -0
  35. package/dist/types/excalidraw/components/GifPlaybackControls.d.ts +10 -0
  36. package/dist/types/excalidraw/components/icons.d.ts +4 -0
  37. package/dist/types/excalidraw/data/blob.d.ts +2 -2
  38. package/dist/types/excalidraw/data/json.d.ts +1 -1
  39. package/dist/types/excalidraw/data/restoreGif.d.ts +4 -0
  40. package/dist/types/excalidraw/scene/Renderer.d.ts +1 -0
  41. package/dist/types/excalidraw/scene/types.d.ts +2 -1
  42. package/dist/types/excalidraw/types.d.ts +12 -2
  43. package/dist/types/excalidraw/viewport.d.ts +1 -1
  44. package/package.json +1 -1
@@ -180,7 +180,7 @@ export declare const actionLoadScene: {
180
180
  isRotating: boolean;
181
181
  zoom: import("../types").Zoom;
182
182
  openMenu: "canvas" | null;
183
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
183
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
184
184
  openSidebar: {
185
185
  name: import("../types").SidebarName;
186
186
  tab?: import("../types").SidebarTabName;
@@ -348,7 +348,7 @@ export declare const actionLoadScene: {
348
348
  isRotating: boolean;
349
349
  zoom: import("../types").Zoom;
350
350
  openMenu: "canvas" | null;
351
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
351
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
352
352
  openSidebar: {
353
353
  name: import("../types").SidebarName;
354
354
  tab?: import("../types").SidebarTabName;
@@ -102,7 +102,7 @@ export declare const actionSelectAllElementsInFrame: {
102
102
  isRotating: boolean;
103
103
  zoom: import("../types").Zoom;
104
104
  openMenu: "canvas" | null;
105
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
105
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
106
106
  openSidebar: {
107
107
  name: import("../types").SidebarName;
108
108
  tab?: import("../types").SidebarTabName;
@@ -294,7 +294,7 @@ export declare const actionRemoveAllElementsFromFrame: {
294
294
  isRotating: boolean;
295
295
  zoom: import("../types").Zoom;
296
296
  openMenu: "canvas" | null;
297
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
297
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
298
298
  openSidebar: {
299
299
  name: import("../types").SidebarName;
300
300
  tab?: import("../types").SidebarTabName;
@@ -484,7 +484,7 @@ export declare const actionupdateFrameRendering: {
484
484
  isRotating: boolean;
485
485
  zoom: import("../types").Zoom;
486
486
  openMenu: "canvas" | null;
487
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
487
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
488
488
  openSidebar: {
489
489
  name: import("../types").SidebarName;
490
490
  tab?: import("../types").SidebarTabName;
@@ -863,6 +863,7 @@ export declare const actionWrapSelectionInFrame: {
863
863
  status: "pending" | "saved" | "error";
864
864
  scale: [number, number];
865
865
  crop: import("@excalidraw/element/types").ImageCrop | null;
866
+ gifPlayback: import("@excalidraw/element/types").ExcalidrawGifPlayback | null;
866
867
  }> & {
867
868
  index: import("@excalidraw/element/types").FractionalIndex;
868
869
  }) | (Readonly<{
@@ -108,7 +108,7 @@ export declare const actionGroup: {
108
108
  isRotating: boolean;
109
109
  zoom: import("../types").Zoom;
110
110
  openMenu: "canvas" | null;
111
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
111
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
112
112
  openSidebar: {
113
113
  name: import("../types").SidebarName;
114
114
  tab?: import("../types").SidebarTabName;
@@ -299,7 +299,7 @@ export declare const actionUngroup: {
299
299
  isRotating: boolean;
300
300
  zoom: import("../types").Zoom;
301
301
  openMenu: "canvas" | null;
302
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
302
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
303
303
  openSidebar: {
304
304
  name: import("../types").SidebarName;
305
305
  tab?: import("../types").SidebarTabName;
@@ -135,7 +135,7 @@ export declare const actionToggleLinearEditor: {
135
135
  isRotating: boolean;
136
136
  zoom: import("../types").Zoom;
137
137
  openMenu: "canvas" | null;
138
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
138
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
139
139
  openSidebar: {
140
140
  name: import("../types").SidebarName;
141
141
  tab?: import("../types").SidebarTabName;
@@ -515,6 +515,7 @@ export declare const actionTogglePolygon: {
515
515
  status: "pending" | "saved" | "error";
516
516
  scale: [number, number];
517
517
  crop: import("@excalidraw/element/types").ImageCrop | null;
518
+ gifPlayback: import("@excalidraw/element/types").ExcalidrawGifPlayback | null;
518
519
  }> & {
519
520
  index: import("@excalidraw/element/types").FractionalIndex;
520
521
  }) | (Readonly<{
@@ -98,7 +98,7 @@ export declare const actionLink: {
98
98
  isResizing: boolean;
99
99
  isRotating: boolean;
100
100
  zoom: import("../types").Zoom;
101
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
101
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
102
102
  openSidebar: {
103
103
  name: import("../types").SidebarName;
104
104
  tab?: import("../types").SidebarTabName;
@@ -139,7 +139,7 @@ export declare const actionDecreaseFontSize: {
139
139
  isRotating: boolean;
140
140
  zoom: import("../types").Zoom;
141
141
  openMenu: "canvas" | null;
142
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
142
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
143
143
  openSidebar: {
144
144
  name: import("../types").SidebarName;
145
145
  tab?: import("../types").SidebarTabName;
@@ -326,7 +326,7 @@ export declare const actionIncreaseFontSize: {
326
326
  isRotating: boolean;
327
327
  zoom: import("../types").Zoom;
328
328
  openMenu: "canvas" | null;
329
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
329
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
330
330
  openSidebar: {
331
331
  name: import("../types").SidebarName;
332
332
  tab?: import("../types").SidebarTabName;
@@ -106,7 +106,7 @@ export declare const actionSelectAll: {
106
106
  isRotating: boolean;
107
107
  zoom: import("../types").Zoom;
108
108
  openMenu: "canvas" | null;
109
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
109
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
110
110
  openSidebar: {
111
111
  name: import("../types").SidebarName;
112
112
  tab?: import("../types").SidebarTabName;
@@ -104,7 +104,7 @@ export declare const actionCopyStyles: {
104
104
  isRotating: boolean;
105
105
  zoom: import("../types").Zoom;
106
106
  openMenu: "canvas" | null;
107
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
107
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
108
108
  openSidebar: {
109
109
  name: import("../types").SidebarName;
110
110
  tab?: import("../types").SidebarTabName;
@@ -100,7 +100,7 @@ export declare const actionToggleArrowBinding: {
100
100
  isRotating: boolean;
101
101
  zoom: import("../types").Zoom;
102
102
  openMenu: "canvas" | null;
103
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
103
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
104
104
  openSidebar: {
105
105
  name: import("../types").SidebarName;
106
106
  tab?: import("../types").SidebarTabName;
@@ -104,7 +104,7 @@ export declare const actionToggleGridMode: {
104
104
  isRotating: boolean;
105
105
  zoom: import("../types").Zoom;
106
106
  openMenu: "canvas" | null;
107
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
107
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
108
108
  openSidebar: {
109
109
  name: import("../types").SidebarName;
110
110
  tab?: import("../types").SidebarTabName;
@@ -100,7 +100,7 @@ export declare const actionToggleMidpointSnapping: {
100
100
  isRotating: boolean;
101
101
  zoom: import("../types").Zoom;
102
102
  openMenu: "canvas" | null;
103
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
103
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
104
104
  openSidebar: {
105
105
  name: import("../types").SidebarName;
106
106
  tab?: import("../types").SidebarTabName;
@@ -103,7 +103,7 @@ export declare const actionToggleObjectsSnapMode: {
103
103
  isRotating: boolean;
104
104
  zoom: import("../types").Zoom;
105
105
  openMenu: "canvas" | null;
106
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
106
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
107
107
  openSidebar: {
108
108
  name: import("../types").SidebarName;
109
109
  tab?: import("../types").SidebarTabName;
@@ -108,7 +108,7 @@ export declare const actionToggleSearchMenu: {
108
108
  isRotating: boolean;
109
109
  zoom: import("../types").Zoom;
110
110
  openMenu: "canvas" | null;
111
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
111
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
112
112
  defaultSidebarDockedPreference: boolean;
113
113
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
114
114
  selectedElementIds: Readonly<{
@@ -105,7 +105,7 @@ export declare const actionToggleStats: {
105
105
  isRotating: boolean;
106
106
  zoom: import("../types").Zoom;
107
107
  openMenu: "canvas" | null;
108
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
108
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
109
109
  openSidebar: {
110
110
  name: import("../types").SidebarName;
111
111
  tab?: import("../types").SidebarTabName;
@@ -102,7 +102,7 @@ export declare const actionToggleViewMode: {
102
102
  isRotating: boolean;
103
103
  zoom: import("../types").Zoom;
104
104
  openMenu: "canvas" | null;
105
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
105
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
106
106
  openSidebar: {
107
107
  name: import("../types").SidebarName;
108
108
  tab?: import("../types").SidebarTabName;
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { AppEventBus, type EXPORT_IMAGE_TYPES, Emitter, type EditorInterface, type StylesPanelMode } from "@excalidraw/common";
3
3
  import { LinearElementEditor, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
4
4
  import type { LocalPoint, Radians } from "@excalidraw/math";
5
- import type { ExcalidrawElement, ExcalidrawTextElement, NonDeleted, FileId, NonDeletedExcalidrawElement, ExcalidrawTextContainer, ExcalidrawFrameLikeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
5
+ import type { ExcalidrawElement, ExcalidrawTextElement, NonDeleted, ExcalidrawImageElement, FileId, NonDeletedExcalidrawElement, ExcalidrawTextContainer, ExcalidrawFrameLikeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
6
6
  import type { Mutable } from "@excalidraw/common/utility-types";
7
7
  import { ActionManager } from "../actions/manager";
8
8
  import { History } from "../history";
@@ -124,6 +124,7 @@ declare class App extends React.Component<AppProps, AppState> {
124
124
  bucketFill: AppBucketFill;
125
125
  flowchart: AppFlowchart;
126
126
  cursor: AppCursor;
127
+ private gifPlayback;
127
128
  private zDragZoom;
128
129
  arrowText: AppArrowText;
129
130
  viewport: AppViewport;
@@ -400,6 +401,7 @@ declare class App extends React.Component<AppProps, AppState> {
400
401
  dismissLinearEditor: () => void;
401
402
  syncActionResult: (actionResult: ActionResult) => void;
402
403
  scheduleCapture: () => void;
404
+ scheduleUpdate: () => void;
403
405
  private onBlur;
404
406
  private onUnload;
405
407
  private disableEvent;
@@ -890,7 +892,12 @@ declare class App extends React.Component<AppProps, AppState> {
890
892
  private getImageNaturalDimensions;
891
893
  /** updates image cache, refreshing updated elements and/or setting status
892
894
  to error for images that fail during <img> element creation */
895
+ private handleImageCacheUpdate;
893
896
  private updateImageCache;
897
+ ensureGifPlaybackLoop: () => void;
898
+ loadDeferredGif: (fileId: FileId) => Promise<void>;
899
+ getGifPlaybackFrameIndex: (element: ExcalidrawImageElement) => number | undefined;
900
+ setGifPlaybackFrameIndex: (element: ExcalidrawImageElement, frameIndex: number) => void;
894
901
  /** adds new images to imageCache and re-renders if needed */
895
902
  private addNewImagesToImageCache;
896
903
  /** generally you should use `addNewImagesToImageCache()` directly if you need
@@ -0,0 +1,18 @@
1
+ import type { ExcalidrawImageElement, FileId, InitializedExcalidrawImageElement, NonDeleted } from "@excalidraw/element/types";
2
+ import type App from "./App";
3
+ export declare class AppGifPlayback {
4
+ private app;
5
+ private playbackRaf;
6
+ private runtimeState;
7
+ constructor(app: App);
8
+ stop: () => void;
9
+ getFrameIndex: (element: ExcalidrawImageElement) => number | undefined;
10
+ setFrameIndex: (element: ExcalidrawImageElement, frameIndex: number) => void;
11
+ ensureLoop: () => void;
12
+ createPlaceholderDecodeState: (placeholderImageElement: ExcalidrawImageElement, imageFile: File) => FileId | null;
13
+ ensureElementPlaybackMetadata: (element: NonDeleted<InitializedExcalidrawImageElement>, opts?: {
14
+ playing?: boolean;
15
+ }) => NonDeleted<InitializedExcalidrawImageElement>;
16
+ removePlaceholderDecodeState: (placeholderGifFileId: FileId | null) => void;
17
+ private tick;
18
+ }
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import "./GifPlaybackControls.scss";
3
+ import type { AppClassProperties, AppState, BinaryFiles } from "../types";
4
+ type GifPlaybackControlsProps = {
5
+ app: AppClassProperties;
6
+ files: BinaryFiles;
7
+ setAppState: React.Component<any, AppState>["setState"];
8
+ };
9
+ export declare const GifPlaybackControls: ({ app, files, setAppState, }: GifPlaybackControlsProps) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -9,6 +9,7 @@ type Opts = {
9
9
  export declare const createIcon: (d: string | React.ReactNode, opts?: number | Opts) => import("react/jsx-runtime").JSX.Element;
10
10
  export declare const PlusPromoIcon: import("react/jsx-runtime").JSX.Element;
11
11
  export declare const PlusIcon: import("react/jsx-runtime").JSX.Element;
12
+ export declare const CirclePauseIcon: import("react/jsx-runtime").JSX.Element;
12
13
  export declare const DotsIcon: import("react/jsx-runtime").JSX.Element;
13
14
  export declare const DotsHorizontalIcon: import("react/jsx-runtime").JSX.Element;
14
15
  export declare const PinIcon: import("react/jsx-runtime").JSX.Element;
@@ -194,6 +195,9 @@ export declare const cutIcon: import("react/jsx-runtime").JSX.Element;
194
195
  export declare const helpIcon: import("react/jsx-runtime").JSX.Element;
195
196
  export declare const playerPlayIcon: import("react/jsx-runtime").JSX.Element;
196
197
  export declare const playerStopFilledIcon: import("react/jsx-runtime").JSX.Element;
198
+ export declare const prevFrame: import("react/jsx-runtime").JSX.Element;
199
+ export declare const nextFrame: import("react/jsx-runtime").JSX.Element;
200
+ export declare const frames: import("react/jsx-runtime").JSX.Element;
197
201
  export declare const tablerCheckIcon: import("react/jsx-runtime").JSX.Element;
198
202
  export declare const alertTriangleIcon: import("react/jsx-runtime").JSX.Element;
199
203
  export declare const eyeDropperIconSvgPaths: readonly ["M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z", "M11 7l6 6"];
@@ -4,7 +4,7 @@ import type { ExcalidrawElement, FileId } from "@excalidraw/element/types";
4
4
  import type { AppState, CompressImageFile, DataURL } from "../types";
5
5
  export declare const getMimeType: (blob: Blob | string) => string;
6
6
  export declare const getFileHandleType: (handle: FileSystemFileHandle | null) => string | null;
7
- export declare const isImageFileHandleType: (type: string | null) => type is "png" | "svg";
7
+ export declare const isImageFileHandleType: (type: string | null) => type is "png" | "svg" | "gif";
8
8
  export declare const isImageFileHandle: (handle: FileSystemFileHandle | null) => handle is FileSystemFileHandle;
9
9
  export declare const isSupportedImageFileType: (type: string | null | undefined) => boolean;
10
10
  export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
@@ -115,7 +115,7 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
115
115
  isRotating: boolean;
116
116
  zoom: import("../types").Zoom;
117
117
  openMenu: "canvas" | null;
118
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
118
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
119
119
  openSidebar: {
120
120
  name: import("../types").SidebarName;
121
121
  tab?: import("../types").SidebarTabName;
@@ -116,7 +116,7 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
116
116
  isRotating: boolean;
117
117
  zoom: import("../types").Zoom;
118
118
  openMenu: "canvas" | null;
119
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
119
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
120
120
  openSidebar: {
121
121
  name: import("../types").SidebarName;
122
122
  tab?: import("../types").SidebarTabName;
@@ -0,0 +1,4 @@
1
+ import type { ExcalidrawGifPlayback } from "@excalidraw/element/types";
2
+ type RestorableGifPlayback = Partial<ExcalidrawGifPlayback> | null | undefined;
3
+ export declare const restoreGifPlayback: (gifPlayback: RestorableGifPlayback) => ExcalidrawGifPlayback | null;
4
+ export {};
@@ -276,6 +276,7 @@ export declare class Renderer {
276
276
  status: "pending" | "saved" | "error";
277
277
  scale: [number, number];
278
278
  crop: import("@excalidraw/element/types").ImageCrop | null;
279
+ gifPlayback: import("@excalidraw/element/types").ExcalidrawGifPlayback | null;
279
280
  }> & {
280
281
  isDeleted: false;
281
282
  }) | (Readonly<{
@@ -1,5 +1,5 @@
1
1
  import type { UserIdleState, EditorInterface } from "@excalidraw/common";
2
- import type { ExcalidrawElement, NonDeletedElementsMap, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
2
+ import type { ExcalidrawElement, ExcalidrawImageElement, NonDeletedElementsMap, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
3
3
  import type { MakeBrand } from "@excalidraw/common/utility-types";
4
4
  import type { AppClassProperties, AppState, EmbedsValidationStatus, ElementsPendingErasure, InteractiveCanvasAppState, StaticCanvasAppState, SocketId, PendingExcalidrawElements } from "../types";
5
5
  import type { RoughCanvas } from "roughjs/bin/canvas";
@@ -8,6 +8,7 @@ export type RenderableElementsMap = NonDeletedElementsMap & MakeBrand<"Renderabl
8
8
  export type StaticCanvasRenderConfig = {
9
9
  canvasBackgroundColor: AppState["viewBackgroundColor"];
10
10
  imageCache: AppClassProperties["imageCache"];
11
+ getGifFrameIndex?: (element: ExcalidrawImageElement) => number | undefined;
11
12
  imageTransitionDuration?: number;
12
13
  renderGrid: boolean;
13
14
  /** whether to render link icons on elements with links (never rendered
@@ -1,7 +1,7 @@
1
1
  import type { IMAGE_MIME_TYPES, UserIdleState, throttleRAF, MIME_TYPES, ColorTuple, EditorInterface, StrokeWidthKey } from "@excalidraw/common";
2
2
  import type { LinearElementEditor } from "@excalidraw/element";
3
3
  import type { MaybeTransformHandleType } from "@excalidraw/element";
4
- import type { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, ExcalidrawArrowElement, Arrowhead, FontFamilyValues, FileId, Theme, StrokeRoundness, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeLikeElement, OrderedExcalidrawElement, ExcalidrawNonSelectionElement, ArrangeAlgorithms, BindMode, ExcalidrawTextElement, StrokeVariability } from "@excalidraw/element/types";
4
+ import type { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, ExcalidrawArrowElement, Arrowhead, FontFamilyValues, FileId, Theme, StrokeRoundness, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeLikeElement, OrderedExcalidrawElement, ExcalidrawNonSelectionElement, ArrangeAlgorithms, BindMode, ExcalidrawTextElement, StrokeVariability, ExcalidrawGifCache } from "@excalidraw/element/types";
5
5
  import type { Merge, MaybePromise, ValueOf, MakeBrand } from "@excalidraw/common/utility-types";
6
6
  import type { CaptureUpdateActionType, DurableIncrement, EphemeralIncrement } from "@excalidraw/element";
7
7
  import type { GlobalPoint } from "@excalidraw/math";
@@ -406,7 +406,7 @@ export interface AppState {
406
406
  isRotating: boolean;
407
407
  zoom: Zoom;
408
408
  openMenu: "canvas" | null;
409
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
409
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
410
410
  openSidebar: {
411
411
  name: SidebarName;
412
412
  tab?: SidebarTabName;
@@ -913,6 +913,8 @@ export type ExportOpts = {
913
913
  export type ImageOptions = Partial<{
914
914
  maxWidthOrHeight: number;
915
915
  maxFileSizeBytes: number;
916
+ /** GIF files larger than this are inserted as static images until manually loaded */
917
+ gifAutoDecodeMaxFileSizeBytes: number;
916
918
  /** duration of the placeholder-to-full-image crossfade in milliseconds */
917
919
  placeholderTransitionDuration: number;
918
920
  }>;
@@ -973,6 +975,8 @@ export type AppClassProperties = {
973
975
  isPlaceholder?: boolean;
974
976
  placeholderImage?: HTMLImageElement;
975
977
  transitionStart?: number;
978
+ gifDecodeStatus?: "pending" | "success" | "error" | "deferred";
979
+ gif?: ExcalidrawGifCache;
976
980
  }>;
977
981
  imageLoadingProgress: App["imageLoadingProgress"];
978
982
  imageLoadingProgressEmitter: App["imageLoadingProgressEmitter"];
@@ -993,6 +997,12 @@ export type AppClassProperties = {
993
997
  scrollToViewport: App["scrollToViewport"];
994
998
  scrollToContent: App["scrollToContent"];
995
999
  addFiles: App["addFiles"];
1000
+ scheduleCapture: App["scheduleCapture"];
1001
+ scheduleUpdate: App["scheduleUpdate"];
1002
+ ensureGifPlaybackLoop: App["ensureGifPlaybackLoop"];
1003
+ loadDeferredGif: App["loadDeferredGif"];
1004
+ getGifPlaybackFrameIndex: App["getGifPlaybackFrameIndex"];
1005
+ setGifPlaybackFrameIndex: App["setGifPlaybackFrameIndex"];
996
1006
  addElementsFromPaste: App["addElementsFromPaste"];
997
1007
  togglePenMode: App["togglePenMode"];
998
1008
  toggleLock: App["toggleLock"];
@@ -183,7 +183,7 @@ export declare const zoomToFitBounds: ({ bounds, appState, canvasOffsets, fit, m
183
183
  isResizing: boolean;
184
184
  isRotating: boolean;
185
185
  openMenu: "canvas" | null;
186
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
186
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
187
187
  openSidebar: {
188
188
  name: import("./types").SidebarName;
189
189
  tab?: import("./types").SidebarTabName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myoc/common",
3
- "version": "0.19.532",
3
+ "version": "0.19.534",
4
4
  "type": "module",
5
5
  "types": "./dist/types/common/src/index.d.ts",
6
6
  "main": "./dist/prod/index.js",