goatdee-canvas 0.0.72 → 0.0.73
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/ZHCanvasCore.wasm +0 -0
- package/dist/index.cjs +0 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -27
- package/dist/index.js +1 -38
- package/dist/index.js.map +1 -1
- package/dist/wasm-single/ZHCanvasCoreSingle.wasm +0 -0
- package/package.json +1 -1
package/dist/ZHCanvasCore.wasm
CHANGED
|
Binary file
|
package/dist/index.cjs
CHANGED
|
@@ -2491,39 +2491,6 @@ const unmark = (id, index) => {
|
|
|
2491
2491
|
console.warn("Canvas operation(unmark) failed:", error);
|
|
2492
2492
|
}
|
|
2493
2493
|
};
|
|
2494
|
-
/**
|
|
2495
|
-
* 获取当前激活态的标注信息。
|
|
2496
|
-
* 配合 `onAction("mark" | "activate mark")` 使用:事件触发后按需调用,避免 dispatch 时反复算屏幕坐标。
|
|
2497
|
-
* @category 对象操作
|
|
2498
|
-
* @returns 激活态标注信息;无激活时返回 null
|
|
2499
|
-
*/
|
|
2500
|
-
const getActiveMark = () => {
|
|
2501
|
-
try {
|
|
2502
|
-
const canvas = manager.getCanvas();
|
|
2503
|
-
const jsonStr = canvas.getActiveMark();
|
|
2504
|
-
return jsonStr ? JSON.parse(jsonStr) : null;
|
|
2505
|
-
}
|
|
2506
|
-
catch (error) {
|
|
2507
|
-
console.warn("Canvas operation(getActiveMark) failed:", error);
|
|
2508
|
-
return null;
|
|
2509
|
-
}
|
|
2510
|
-
};
|
|
2511
|
-
/**
|
|
2512
|
-
* 获取全部标注信息。
|
|
2513
|
-
* @category 对象操作
|
|
2514
|
-
* @returns 标注信息数组;无标注时返回 `[]`
|
|
2515
|
-
*/
|
|
2516
|
-
const getAllMarks = () => {
|
|
2517
|
-
try {
|
|
2518
|
-
const canvas = manager.getCanvas();
|
|
2519
|
-
const jsonStr = canvas.getAllMarks();
|
|
2520
|
-
return jsonStr ? JSON.parse(jsonStr) : [];
|
|
2521
|
-
}
|
|
2522
|
-
catch (error) {
|
|
2523
|
-
console.warn("Canvas operation(getAllMarks) failed:", error);
|
|
2524
|
-
return [];
|
|
2525
|
-
}
|
|
2526
|
-
};
|
|
2527
2494
|
/**
|
|
2528
2495
|
* 向画布添加对象到指定父容器下。
|
|
2529
2496
|
* @category 对象操作
|
|
@@ -3302,9 +3269,7 @@ var ManagerAPI = /*#__PURE__*/Object.freeze({
|
|
|
3302
3269
|
exportImages: exportImages,
|
|
3303
3270
|
exportToJSON: exportToJSON,
|
|
3304
3271
|
fitToScreen: fitToScreen,
|
|
3305
|
-
getActiveMark: getActiveMark,
|
|
3306
3272
|
getActiveObjects: getActiveObjects,
|
|
3307
|
-
getAllMarks: getAllMarks,
|
|
3308
3273
|
getBounds: getBounds,
|
|
3309
3274
|
getCrop: getCrop,
|
|
3310
3275
|
getGPUMemoryStats: getGPUMemoryStats,
|
|
@@ -4479,8 +4444,6 @@ function useCanvasImperativeHandle(ref, args) {
|
|
|
4479
4444
|
reportAction("unmark", { id, index });
|
|
4480
4445
|
unmark(id, index);
|
|
4481
4446
|
},
|
|
4482
|
-
getActiveMark: () => getActiveMark(),
|
|
4483
|
-
getAllMarks: () => getAllMarks(),
|
|
4484
4447
|
add: async (parentId, properties) => {
|
|
4485
4448
|
reportAction("add", { parentId, properties });
|
|
4486
4449
|
return add(parentId, properties);
|