@8btc/xcanvas 0.0.14-beta.7 → 0.0.14-beta.9
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.
- package/dist/index.js +12 -7
- package/dist/index.umd.cjs +12 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { atom, useAtom, useAtomValue, useSetAtom } from "jotai";
|
|
3
3
|
import { Excalidraw, convertToExcalidrawElements, exportToCanvas } from "@8btc/excalidraw";
|
|
4
4
|
import { useEffect } from "react";
|
|
5
|
-
const version = "0.0.14-beta.
|
|
5
|
+
const version = "0.0.14-beta.9";
|
|
6
6
|
const packageJson = {
|
|
7
7
|
version
|
|
8
8
|
};
|
|
@@ -319,6 +319,11 @@ function ApiFactory() {
|
|
|
319
319
|
if (selectedElements[0].fileId.startsWith("http")) {
|
|
320
320
|
return selectedElements[0].fileId;
|
|
321
321
|
}
|
|
322
|
+
if (/^([a-zA-Z]:[\\/]|\\\\[^\\/]+[\\/][^\\/]+)([^:*?"<>|\\/]+[\\/]?)*$/.test(
|
|
323
|
+
selectedElements[0].fileId
|
|
324
|
+
)) {
|
|
325
|
+
return selectedElements[0].fileId;
|
|
326
|
+
}
|
|
322
327
|
return files[selectedElements[0].fileId].dataURL;
|
|
323
328
|
}
|
|
324
329
|
const canvas = await exportToCanvas({
|
|
@@ -368,18 +373,18 @@ function ApiFactory() {
|
|
|
368
373
|
y: minY,
|
|
369
374
|
width: h,
|
|
370
375
|
height: h,
|
|
371
|
-
...customPos,
|
|
372
|
-
id: `loading-${Date.now()}`,
|
|
373
|
-
link: data.link ?? "https://www.google.com",
|
|
374
376
|
// 添加必需的基本样式属性
|
|
375
|
-
strokeColor: "#
|
|
377
|
+
strokeColor: "#ffffff00",
|
|
376
378
|
backgroundColor: "transparent",
|
|
377
379
|
fillStyle: "solid",
|
|
378
|
-
strokeWidth:
|
|
380
|
+
strokeWidth: 2,
|
|
379
381
|
strokeStyle: "solid",
|
|
380
382
|
roundness: null,
|
|
381
|
-
roughness:
|
|
383
|
+
roughness: 0,
|
|
382
384
|
opacity: 100,
|
|
385
|
+
...customPos,
|
|
386
|
+
id: `loading-${Date.now()}`,
|
|
387
|
+
link: data.link ?? "https://www.google.com",
|
|
383
388
|
// 添加必需的变换属性
|
|
384
389
|
angle: 0,
|
|
385
390
|
seed: Math.random(),
|
package/dist/index.umd.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("jotai"), require("@8btc/excalidraw"), require("react")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "jotai", "@8btc/excalidraw", "react"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.XCanvas = {}, global.jsxRuntime, global.Jotai, global.Excalidraw, global.React));
|
|
3
3
|
})(this, (function(exports2, jsxRuntime, jotai, excalidraw, react) {
|
|
4
4
|
"use strict";
|
|
5
|
-
const version = "0.0.14-beta.
|
|
5
|
+
const version = "0.0.14-beta.9";
|
|
6
6
|
const packageJson = {
|
|
7
7
|
version
|
|
8
8
|
};
|
|
@@ -319,6 +319,11 @@
|
|
|
319
319
|
if (selectedElements[0].fileId.startsWith("http")) {
|
|
320
320
|
return selectedElements[0].fileId;
|
|
321
321
|
}
|
|
322
|
+
if (/^([a-zA-Z]:[\\/]|\\\\[^\\/]+[\\/][^\\/]+)([^:*?"<>|\\/]+[\\/]?)*$/.test(
|
|
323
|
+
selectedElements[0].fileId
|
|
324
|
+
)) {
|
|
325
|
+
return selectedElements[0].fileId;
|
|
326
|
+
}
|
|
322
327
|
return files[selectedElements[0].fileId].dataURL;
|
|
323
328
|
}
|
|
324
329
|
const canvas = await excalidraw.exportToCanvas({
|
|
@@ -368,18 +373,18 @@
|
|
|
368
373
|
y: minY,
|
|
369
374
|
width: h,
|
|
370
375
|
height: h,
|
|
371
|
-
...customPos,
|
|
372
|
-
id: `loading-${Date.now()}`,
|
|
373
|
-
link: data.link ?? "https://www.google.com",
|
|
374
376
|
// 添加必需的基本样式属性
|
|
375
|
-
strokeColor: "#
|
|
377
|
+
strokeColor: "#ffffff00",
|
|
376
378
|
backgroundColor: "transparent",
|
|
377
379
|
fillStyle: "solid",
|
|
378
|
-
strokeWidth:
|
|
380
|
+
strokeWidth: 2,
|
|
379
381
|
strokeStyle: "solid",
|
|
380
382
|
roundness: null,
|
|
381
|
-
roughness:
|
|
383
|
+
roughness: 0,
|
|
382
384
|
opacity: 100,
|
|
385
|
+
...customPos,
|
|
386
|
+
id: `loading-${Date.now()}`,
|
|
387
|
+
link: data.link ?? "https://www.google.com",
|
|
383
388
|
// 添加必需的变换属性
|
|
384
389
|
angle: 0,
|
|
385
390
|
seed: Math.random(),
|