@myoc/excalidraw 0.19.532 → 0.19.533

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 (65) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/dist/dev/{chunk-ASAPRLCW.js → chunk-5CVRJMG3.js} +2 -2
  3. package/dist/dev/{chunk-ITMOGRAW.js → chunk-AR7I2OPB.js} +23 -8
  4. package/dist/dev/chunk-AR7I2OPB.js.map +7 -0
  5. package/dist/dev/data/{image-S7APFFV6.js → image-XXT3R6SF.js} +3 -3
  6. package/dist/dev/index.css +239 -0
  7. package/dist/dev/index.css.map +3 -3
  8. package/dist/dev/index.js +1294 -591
  9. package/dist/dev/index.js.map +4 -4
  10. package/dist/dev/subset-shared.chunk.js +1 -1
  11. package/dist/dev/subset-worker.chunk.js +1 -1
  12. package/dist/prod/{chunk-GSRXJLOQ.js → chunk-6D6KWUBN.js} +1 -1
  13. package/dist/prod/chunk-AS35EYHE.js +4 -0
  14. package/dist/prod/data/image-6PNCNKLO.js +1 -0
  15. package/dist/prod/index.css +1 -1
  16. package/dist/prod/index.js +13 -13
  17. package/dist/prod/subset-shared.chunk.js +1 -1
  18. package/dist/prod/subset-worker.chunk.js +1 -1
  19. package/dist/types/common/src/constants.d.ts +1 -0
  20. package/dist/types/element/src/gif.d.ts +29 -0
  21. package/dist/types/element/src/image.d.ts +6 -1
  22. package/dist/types/element/src/index.d.ts +2 -0
  23. package/dist/types/element/src/newElement.d.ts +1 -0
  24. package/dist/types/element/src/renderGif.d.ts +5 -0
  25. package/dist/types/element/src/types.d.ts +12 -0
  26. package/dist/types/excalidraw/actions/actionBoundText.d.ts +2 -2
  27. package/dist/types/excalidraw/actions/actionCanvas.d.ts +6 -6
  28. package/dist/types/excalidraw/actions/actionClipboard.d.ts +2 -2
  29. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -1
  30. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -3
  31. package/dist/types/excalidraw/actions/actionDeselect.d.ts +1 -1
  32. package/dist/types/excalidraw/actions/actionElementLink.d.ts +1 -1
  33. package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -2
  34. package/dist/types/excalidraw/actions/actionExport.d.ts +2 -2
  35. package/dist/types/excalidraw/actions/actionFrame.d.ts +4 -3
  36. package/dist/types/excalidraw/actions/actionGroup.d.ts +2 -2
  37. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +2 -1
  38. package/dist/types/excalidraw/actions/actionLink.d.ts +1 -1
  39. package/dist/types/excalidraw/actions/actionProperties.d.ts +2 -2
  40. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
  41. package/dist/types/excalidraw/actions/actionStyles.d.ts +1 -1
  42. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +1 -1
  43. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
  44. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +1 -1
  45. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
  46. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +1 -1
  47. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
  48. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
  49. package/dist/types/excalidraw/components/App.d.ts +8 -1
  50. package/dist/types/excalidraw/components/App.gif.d.ts +18 -0
  51. package/dist/types/excalidraw/components/GifPlaybackControls.d.ts +10 -0
  52. package/dist/types/excalidraw/components/icons.d.ts +4 -0
  53. package/dist/types/excalidraw/data/blob.d.ts +2 -2
  54. package/dist/types/excalidraw/data/json.d.ts +1 -1
  55. package/dist/types/excalidraw/data/restoreGif.d.ts +4 -0
  56. package/dist/types/excalidraw/scene/Renderer.d.ts +1 -0
  57. package/dist/types/excalidraw/scene/types.d.ts +2 -1
  58. package/dist/types/excalidraw/types.d.ts +12 -2
  59. package/dist/types/excalidraw/viewport.d.ts +1 -1
  60. package/package.json +5 -5
  61. package/dist/dev/chunk-ITMOGRAW.js.map +0 -7
  62. package/dist/prod/chunk-U3WBDUKM.js +0 -4
  63. package/dist/prod/data/image-MWFLMJV7.js +0 -1
  64. /package/dist/dev/{chunk-ASAPRLCW.js.map → chunk-5CVRJMG3.js.map} +0 -0
  65. /package/dist/dev/data/{image-S7APFFV6.js.map → image-XXT3R6SF.js.map} +0 -0
@@ -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 & {
@@ -152,7 +152,7 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
152
152
  scrolledOutside: boolean;
153
153
  isResizing: boolean;
154
154
  openMenu: "canvas" | null;
155
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
155
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
156
156
  openSidebar: {
157
157
  name: import("../types").SidebarName;
158
158
  tab?: import("../types").SidebarTabName;
@@ -153,7 +153,7 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
153
153
  scrolledOutside: boolean;
154
154
  isResizing: boolean;
155
155
  openMenu: "canvas" | null;
156
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
156
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
157
157
  openSidebar: {
158
158
  name: import("../types").SidebarName;
159
159
  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/excalidraw",
3
- "version": "0.19.532",
3
+ "version": "0.19.533",
4
4
  "type": "module",
5
5
  "types": "./dist/types/excalidraw/index.d.ts",
6
6
  "main": "./dist/prod/index.js",
@@ -82,7 +82,10 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@braintree/sanitize-url": "6.0.2",
85
+ "@excalidraw/common": "npm:@myoc/common@0.19.533",
86
+ "@excalidraw/element": "npm:@myoc/element@0.19.533",
85
87
  "@excalidraw/laser-pointer": "1.3.1",
88
+ "@excalidraw/math": "npm:@myoc/math@0.19.533",
86
89
  "@excalidraw/random-username": "1.1.0",
87
90
  "@lezer/highlight": "^1.0.0",
88
91
  "browser-fs-access": "0.38.0",
@@ -107,10 +110,7 @@
107
110
  "radix-ui": "1.4.3",
108
111
  "roughjs": "4.6.4",
109
112
  "sass": "1.51.0",
110
- "tunnel-rat": "0.1.2",
111
- "@excalidraw/common": "npm:@myoc/common@0.19.532",
112
- "@excalidraw/math": "npm:@myoc/math@0.19.532",
113
- "@excalidraw/element": "npm:@myoc/element@0.19.532"
113
+ "tunnel-rat": "0.1.2"
114
114
  },
115
115
  "devDependencies": {
116
116
  "@size-limit/preset-big-lib": "9.0.0",