@haoxin-web/excalidraw 1.0.23 → 1.0.24

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  define_import_meta_env_default
3
- } from "./chunk-NHZFLEMT.js";
3
+ } from "./chunk-QJETCZL3.js";
4
4
  import {
5
5
  __publicField
6
6
  } from "./chunk-XDFCUUT6.js";
@@ -5296,7 +5296,7 @@ var parseFileContents = async (blob) => {
5296
5296
  let contents;
5297
5297
  if (blob.type === MIME_TYPES6.png) {
5298
5298
  try {
5299
- return await (await import("./data/image-EFEZBK6B.js")).decodePngMetadata(blob);
5299
+ return await (await import("./data/image-UN6QNPQO.js")).decodePngMetadata(blob);
5300
5300
  } catch (error) {
5301
5301
  if (error.message === "INVALID") {
5302
5302
  throw new ImageSceneDataError(
@@ -5746,4 +5746,4 @@ export {
5746
5746
  createFile,
5747
5747
  normalizeFile
5748
5748
  };
5749
- //# sourceMappingURL=chunk-ITD5AOM3.js.map
5749
+ //# sourceMappingURL=chunk-LXPD2I2F.js.map
@@ -1,7 +1,7 @@
1
1
  // <define:import.meta.env>
2
- var define_import_meta_env_default = { MODE: "development", VITE_APP_BACKEND_V2_GET_URL: "https://json-dev.excalidraw.com/api/v2/", VITE_APP_BACKEND_V2_POST_URL: "https://json-dev.excalidraw.com/api/v2/post/", VITE_APP_LIBRARY_URL: "https://libraries.excalidraw.com", VITE_APP_LIBRARY_BACKEND: "https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries", VITE_APP_WS_SERVER_URL: "http://localhost:3002", VITE_APP_PLUS_LP: "https://plus.excalidraw.com", VITE_APP_PLUS_APP: "http://localhost:3000", VITE_APP_AI_BACKEND: "http://localhost:3015", VITE_APP_FIREBASE_CONFIG: '{"apiKey":"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8","authDomain":"excalidraw-oss-dev.firebaseapp.com","projectId":"excalidraw-oss-dev","storageBucket":"excalidraw-oss-dev.appspot.com","messagingSenderId":"664559512677","appId":"1:664559512677:web:a385181f2928d328a7aa8c"}', VITE_APP_DEV_DISABLE_LIVE_RELOAD: "", VITE_APP_ENABLE_TRACKING: "true", FAST_REFRESH: "false", VITE_APP_PORT: "3000", VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX: "", VITE_APP_COLLAPSE_OVERLAY: "true", VITE_APP_ENABLE_ESLINT: "true", VITE_APP_ENABLE_PWA: "false", VITE_APP_PLUS_EXPORT_PUBLIC_KEY: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\nHQIDAQAB", VITE_APP_DISABLE_PREVENT_UNLOAD: "", PKG_NAME: "@haoxin-web/excalidraw", PKG_VERSION: "1.0.23", DEV: true };
2
+ var define_import_meta_env_default = { MODE: "development", VITE_APP_BACKEND_V2_GET_URL: "https://json-dev.excalidraw.com/api/v2/", VITE_APP_BACKEND_V2_POST_URL: "https://json-dev.excalidraw.com/api/v2/post/", VITE_APP_LIBRARY_URL: "https://libraries.excalidraw.com", VITE_APP_LIBRARY_BACKEND: "https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries", VITE_APP_WS_SERVER_URL: "http://localhost:3002", VITE_APP_PLUS_LP: "https://plus.excalidraw.com", VITE_APP_PLUS_APP: "http://localhost:3000", VITE_APP_AI_BACKEND: "http://localhost:3015", VITE_APP_FIREBASE_CONFIG: '{"apiKey":"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8","authDomain":"excalidraw-oss-dev.firebaseapp.com","projectId":"excalidraw-oss-dev","storageBucket":"excalidraw-oss-dev.appspot.com","messagingSenderId":"664559512677","appId":"1:664559512677:web:a385181f2928d328a7aa8c"}', VITE_APP_DEV_DISABLE_LIVE_RELOAD: "", VITE_APP_ENABLE_TRACKING: "true", FAST_REFRESH: "false", VITE_APP_PORT: "3000", VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX: "", VITE_APP_COLLAPSE_OVERLAY: "true", VITE_APP_ENABLE_ESLINT: "true", VITE_APP_ENABLE_PWA: "false", VITE_APP_PLUS_EXPORT_PUBLIC_KEY: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\nHQIDAQAB", VITE_APP_DISABLE_PREVENT_UNLOAD: "", PKG_NAME: "@haoxin-web/excalidraw", PKG_VERSION: "1.0.24", DEV: true };
3
3
 
4
4
  export {
5
5
  define_import_meta_env_default
6
6
  };
7
- //# sourceMappingURL=chunk-NHZFLEMT.js.map
7
+ //# sourceMappingURL=chunk-QJETCZL3.js.map
@@ -2,12 +2,12 @@ import {
2
2
  decodePngMetadata,
3
3
  encodePngMetadata,
4
4
  getTEXtChunk
5
- } from "../chunk-ITD5AOM3.js";
6
- import "../chunk-NHZFLEMT.js";
5
+ } from "../chunk-LXPD2I2F.js";
6
+ import "../chunk-QJETCZL3.js";
7
7
  import "../chunk-XDFCUUT6.js";
8
8
  export {
9
9
  decodePngMetadata,
10
10
  encodePngMetadata,
11
11
  getTEXtChunk
12
12
  };
13
- //# sourceMappingURL=image-EFEZBK6B.js.map
13
+ //# sourceMappingURL=image-UN6QNPQO.js.map
package/dist/dev/index.js CHANGED
@@ -69,10 +69,10 @@ import {
69
69
  serializeLibraryAsJSON,
70
70
  strokeEllipseWithRotation,
71
71
  strokeRectWithRotation
72
- } from "./chunk-ITD5AOM3.js";
72
+ } from "./chunk-LXPD2I2F.js";
73
73
  import {
74
74
  define_import_meta_env_default
75
- } from "./chunk-NHZFLEMT.js";
75
+ } from "./chunk-QJETCZL3.js";
76
76
  import {
77
77
  en_default
78
78
  } from "./chunk-ZSSURRA2.js";
@@ -9223,7 +9223,7 @@ var exportCanvas = async (type, elements, appState, files, {
9223
9223
  let blob = canvasToBlob(tempCanvas);
9224
9224
  if (appState.exportEmbedScene) {
9225
9225
  blob = blob.then(
9226
- (blob2) => import("./data/image-EFEZBK6B.js").then(
9226
+ (blob2) => import("./data/image-UN6QNPQO.js").then(
9227
9227
  ({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
9228
9228
  blob: blob2,
9229
9229
  metadata: serializeAsJSON(elements, appState, files, "local")
@@ -23959,13 +23959,44 @@ import {
23959
23959
  import { mutateElement as mutateElement5 } from "@haoxin-web/excalidraw-element";
23960
23960
  import { ShapeCache as ShapeCache3 } from "@haoxin-web/excalidraw-element";
23961
23961
 
23962
+ // components/HandButton.tsx
23963
+ import clsx34 from "clsx";
23964
+ import { KEYS as KEYS45 } from "@haoxin-web/excalidraw-common";
23965
+ import { jsx as jsx83 } from "react/jsx-runtime";
23966
+ var HandButton = (props) => {
23967
+ if (props.visible === false) {
23968
+ return null;
23969
+ }
23970
+ const showKeyShortcut = props.showKeyShortcut !== false;
23971
+ const handTitle = props.title ?? t("toolBar.hand");
23972
+ const title = showKeyShortcut ? `${handTitle} \u2014 H` : handTitle;
23973
+ return /* @__PURE__ */ jsx83(
23974
+ ToolButton,
23975
+ {
23976
+ className: clsx34("Shape", { fillable: false }),
23977
+ type: "radio",
23978
+ icon: handIcon,
23979
+ name: "editor-current-shape",
23980
+ checked: props.checked,
23981
+ title,
23982
+ keyBindingLabel: showKeyShortcut && !props.isMobile ? KEYS45.H.toLocaleUpperCase() : void 0,
23983
+ "aria-label": title,
23984
+ "aria-keyshortcuts": showKeyShortcut ? KEYS45.H : void 0,
23985
+ "data-testid": `toolbar-hand`,
23986
+ onChange: () => props.onChange?.()
23987
+ }
23988
+ );
23989
+ };
23990
+
23962
23991
  // components/LeftMainToolbar.tsx
23963
23992
  import { TOOL_TYPE as TOOL_TYPE2 } from "@haoxin-web/excalidraw-common";
23964
- import { jsx as jsx83, jsxs as jsxs45 } from "react/jsx-runtime";
23993
+ import { jsx as jsx84, jsxs as jsxs45 } from "react/jsx-runtime";
23965
23994
  var LeftMainToolbar = ({
23966
23995
  appState,
23967
23996
  app,
23968
- visible = true
23997
+ visible = true,
23998
+ onHandToolToggle,
23999
+ showPanActions
23969
24000
  }) => {
23970
24001
  if (!visible) {
23971
24002
  return null;
@@ -24033,8 +24064,8 @@ var LeftMainToolbar = ({
24033
24064
  } catch {
24034
24065
  }
24035
24066
  };
24036
- return /* @__PURE__ */ jsx83(Island, { className: "App-toolbar App-toolbar--vertical", children: /* @__PURE__ */ jsxs45(Stack_default.Col, { align: "center", gap: 1, style: { padding: "4px 0" }, children: [
24037
- /* @__PURE__ */ jsx83(
24067
+ return /* @__PURE__ */ jsx84(Island, { className: "App-toolbar App-toolbar--vertical", children: /* @__PURE__ */ jsxs45(Stack_default.Col, { align: "center", gap: 1, style: { padding: "4px 0" }, children: [
24068
+ /* @__PURE__ */ jsx84(
24038
24069
  ToolButton,
24039
24070
  {
24040
24071
  "aria-label": "selection",
@@ -24046,7 +24077,18 @@ var LeftMainToolbar = ({
24046
24077
  onChange: () => app.setActiveTool({ type: TOOL_TYPE2.selection })
24047
24078
  }
24048
24079
  ),
24049
- /* @__PURE__ */ jsx83(
24080
+ /* @__PURE__ */ jsx84(
24081
+ HandButton,
24082
+ {
24083
+ checked: isHandToolActive(appState),
24084
+ onChange: () => onHandToolToggle?.(),
24085
+ title: t("toolBar.hand"),
24086
+ isMobile: true,
24087
+ showKeyShortcut: false,
24088
+ visible: showPanActions !== false
24089
+ }
24090
+ ),
24091
+ /* @__PURE__ */ jsx84(
24050
24092
  ToolButton,
24051
24093
  {
24052
24094
  "aria-label": "freedraw",
@@ -24059,7 +24101,7 @@ var LeftMainToolbar = ({
24059
24101
  onChange: () => app.setActiveTool({ type: TOOL_TYPE2.freedraw })
24060
24102
  }
24061
24103
  ),
24062
- /* @__PURE__ */ jsx83(
24104
+ /* @__PURE__ */ jsx84(
24063
24105
  ToolButton,
24064
24106
  {
24065
24107
  "aria-label": "line",
@@ -24072,7 +24114,7 @@ var LeftMainToolbar = ({
24072
24114
  onChange: () => app.setActiveTool({ type: TOOL_TYPE2.line })
24073
24115
  }
24074
24116
  ),
24075
- /* @__PURE__ */ jsx83(
24117
+ /* @__PURE__ */ jsx84(
24076
24118
  ToolButton,
24077
24119
  {
24078
24120
  "aria-label": "shapes",
@@ -24085,7 +24127,7 @@ var LeftMainToolbar = ({
24085
24127
  onChange: () => app.setActiveTool({ type: TOOL_TYPE2.rectangle })
24086
24128
  }
24087
24129
  ),
24088
- /* @__PURE__ */ jsx83(
24130
+ /* @__PURE__ */ jsx84(
24089
24131
  ToolButton,
24090
24132
  {
24091
24133
  "aria-label": "text",
@@ -24098,7 +24140,7 @@ var LeftMainToolbar = ({
24098
24140
  onChange: () => app.setActiveTool({ type: TOOL_TYPE2.text })
24099
24141
  }
24100
24142
  ),
24101
- /* @__PURE__ */ jsx83(
24143
+ /* @__PURE__ */ jsx84(
24102
24144
  ToolButton,
24103
24145
  {
24104
24146
  "aria-label": "eraser",
@@ -24115,10 +24157,10 @@ var LeftMainToolbar = ({
24115
24157
  var LeftMainToolbar_default = LeftMainToolbar;
24116
24158
 
24117
24159
  // components/LoadingMessage.tsx
24118
- import clsx34 from "clsx";
24160
+ import clsx35 from "clsx";
24119
24161
  import { useState as useState24, useEffect as useEffect30 } from "react";
24120
24162
  import { THEME as THEME13 } from "@haoxin-web/excalidraw-common";
24121
- import { jsx as jsx84, jsxs as jsxs46 } from "react/jsx-runtime";
24163
+ import { jsx as jsx85, jsxs as jsxs46 } from "react/jsx-runtime";
24122
24164
  var LoadingMessage = ({
24123
24165
  delay,
24124
24166
  theme
@@ -24139,12 +24181,12 @@ var LoadingMessage = ({
24139
24181
  return /* @__PURE__ */ jsxs46(
24140
24182
  "div",
24141
24183
  {
24142
- className: clsx34("LoadingMessage", {
24184
+ className: clsx35("LoadingMessage", {
24143
24185
  "LoadingMessage--dark": theme === THEME13.DARK
24144
24186
  }),
24145
24187
  children: [
24146
- /* @__PURE__ */ jsx84("div", { children: /* @__PURE__ */ jsx84(Spinner_default, {}) }),
24147
- /* @__PURE__ */ jsx84("div", { className: "LoadingMessage-text", children: t("labels.loadingScene") })
24188
+ /* @__PURE__ */ jsx85("div", { children: /* @__PURE__ */ jsx85(Spinner_default, {}) }),
24189
+ /* @__PURE__ */ jsx85("div", { className: "LoadingMessage-text", children: t("labels.loadingScene") })
24148
24190
  ]
24149
24191
  }
24150
24192
  );
@@ -24155,16 +24197,16 @@ import { useEffect as useEffect31 } from "react";
24155
24197
  import { showSelectedShapeActions as showSelectedShapeActions2 } from "@haoxin-web/excalidraw-element";
24156
24198
 
24157
24199
  // components/FixedSideContainer.tsx
24158
- import clsx35 from "clsx";
24159
- import { jsx as jsx85 } from "react/jsx-runtime";
24200
+ import clsx36 from "clsx";
24201
+ import { jsx as jsx86 } from "react/jsx-runtime";
24160
24202
  var FixedSideContainer = ({
24161
24203
  children,
24162
24204
  side,
24163
24205
  className
24164
- }) => /* @__PURE__ */ jsx85(
24206
+ }) => /* @__PURE__ */ jsx86(
24165
24207
  "div",
24166
24208
  {
24167
- className: clsx35(
24209
+ className: clsx36(
24168
24210
  "FixedSideContainer",
24169
24211
  `FixedSideContainer_side_${side}`,
24170
24212
  className
@@ -24173,32 +24215,6 @@ var FixedSideContainer = ({
24173
24215
  }
24174
24216
  );
24175
24217
 
24176
- // components/HandButton.tsx
24177
- import clsx36 from "clsx";
24178
- import { KEYS as KEYS45 } from "@haoxin-web/excalidraw-common";
24179
- import { jsx as jsx86 } from "react/jsx-runtime";
24180
- var HandButton = (props) => {
24181
- if (props.visible === false) {
24182
- return null;
24183
- }
24184
- return /* @__PURE__ */ jsx86(
24185
- ToolButton,
24186
- {
24187
- className: clsx36("Shape", { fillable: false }),
24188
- type: "radio",
24189
- icon: handIcon,
24190
- name: "editor-current-shape",
24191
- checked: props.checked,
24192
- title: `${props.title} \u2014 H`,
24193
- keyBindingLabel: !props.isMobile ? KEYS45.H.toLocaleUpperCase() : void 0,
24194
- "aria-label": `${props.title} \u2014 H`,
24195
- "aria-keyshortcuts": KEYS45.H,
24196
- "data-testid": `toolbar-hand`,
24197
- onChange: () => props.onChange?.()
24198
- }
24199
- );
24200
- };
24201
-
24202
24218
  // components/HintViewer.tsx
24203
24219
  import { CANVAS_SEARCH_TAB as CANVAS_SEARCH_TAB2, DEFAULT_SIDEBAR as DEFAULT_SIDEBAR4 } from "@haoxin-web/excalidraw-common";
24204
24220
  import {
@@ -32244,7 +32260,9 @@ var LayerUI = ({
32244
32260
  {
32245
32261
  appState,
32246
32262
  app,
32247
- visible: showToolBar
32263
+ visible: showToolBar,
32264
+ onHandToolToggle,
32265
+ showPanActions
32248
32266
  }
32249
32267
  ),
32250
32268
  isCollaborating && /* @__PURE__ */ jsx145(