@xom11/whiteboard 0.31.0 → 0.32.0
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/ai.d.mts +148 -27
- package/dist/ai.d.ts +148 -27
- package/dist/ai.js +2652 -430
- package/dist/ai.js.map +1 -1
- package/dist/ai.mjs +2482 -426
- package/dist/ai.mjs.map +1 -1
- package/dist/catalog.json +4 -4
- package/dist/{chunk-JJ4FPCBE.mjs → chunk-4EXRNZRX.mjs} +641 -75
- package/dist/chunk-4EXRNZRX.mjs.map +1 -0
- package/dist/{chunk-BMYC2ILT.mjs → chunk-DBG6DZ2V.mjs} +4 -4
- package/dist/{chunk-BMYC2ILT.mjs.map → chunk-DBG6DZ2V.mjs.map} +1 -1
- package/dist/{chunk-T3N4BSJV.mjs → chunk-DCFZTKFE.mjs} +13 -5
- package/dist/chunk-DCFZTKFE.mjs.map +1 -0
- package/dist/{chunk-DWIEVCGK.mjs → chunk-DJM5EWTT.mjs} +53 -3
- package/dist/chunk-DJM5EWTT.mjs.map +1 -0
- package/dist/{chunk-44JY2AKC.mjs → chunk-F42MZ745.mjs} +3 -3
- package/dist/{chunk-44JY2AKC.mjs.map → chunk-F42MZ745.mjs.map} +1 -1
- package/dist/{chunk-TMRFSOM7.mjs → chunk-FI2MGX5H.mjs} +4 -4
- package/dist/{chunk-TMRFSOM7.mjs.map → chunk-FI2MGX5H.mjs.map} +1 -1
- package/dist/{chunk-KOXOC2FI.mjs → chunk-KLGPAMJS.mjs} +10 -7
- package/dist/chunk-KLGPAMJS.mjs.map +1 -0
- package/dist/{chunk-73Q7ADVL.mjs → chunk-MNHOFOM5.mjs} +2 -2
- package/dist/{chunk-73Q7ADVL.mjs.map → chunk-MNHOFOM5.mjs.map} +1 -1
- package/dist/{chunk-K5BS2H56.mjs → chunk-MOAXHVKI.mjs} +4 -4
- package/dist/{chunk-K5BS2H56.mjs.map → chunk-MOAXHVKI.mjs.map} +1 -1
- package/dist/chunk-SUXIMLYN.mjs +238 -0
- package/dist/chunk-SUXIMLYN.mjs.map +1 -0
- package/dist/{chunk-LTLLQUMN.mjs → chunk-XSTGTEGP.mjs} +4 -4
- package/dist/{chunk-LTLLQUMN.mjs.map → chunk-XSTGTEGP.mjs.map} +1 -1
- package/dist/geometry-2d.js +883 -119
- package/dist/geometry-2d.js.map +1 -1
- package/dist/geometry-2d.mjs +4 -4
- package/dist/geometry-3d.js +3995 -471
- package/dist/geometry-3d.js.map +1 -1
- package/dist/geometry-3d.mjs +4 -4
- package/dist/graph-2d.js +706 -111
- package/dist/graph-2d.js.map +1 -1
- package/dist/graph-2d.mjs +4 -4
- package/dist/{handleExtractProblem-BrDY9ifM.d.ts → handleExtractProblem-mtJyhEw3.d.mts} +2 -0
- package/dist/{handleExtractProblem-BrDY9ifM.d.mts → handleExtractProblem-mtJyhEw3.d.ts} +2 -0
- package/dist/{host-KMWP7KBT.mjs → host-JNLJ5BVR.mjs} +8 -8
- package/dist/{host-KMWP7KBT.mjs.map → host-JNLJ5BVR.mjs.map} +1 -1
- package/dist/{host-4FIUNIDQ.mjs → host-VRWLQSMH.mjs} +7 -7
- package/dist/{host-4FIUNIDQ.mjs.map → host-VRWLQSMH.mjs.map} +1 -1
- package/dist/host-W4U6YCSX.mjs +4973 -0
- package/dist/host-W4U6YCSX.mjs.map +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4090 -392
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -21
- package/dist/index.mjs.map +1 -1
- package/dist/serialize-7UZWQQ4I.mjs +9 -0
- package/dist/{serialize-PGHQZEPV.mjs.map → serialize-7UZWQQ4I.mjs.map} +1 -1
- package/package.json +4 -1
- package/dist/chunk-DWIEVCGK.mjs.map +0 -1
- package/dist/chunk-JJ4FPCBE.mjs.map +0 -1
- package/dist/chunk-KOXOC2FI.mjs.map +0 -1
- package/dist/chunk-QK6OVDLC.mjs +0 -103
- package/dist/chunk-QK6OVDLC.mjs.map +0 -1
- package/dist/chunk-T3N4BSJV.mjs.map +0 -1
- package/dist/host-4ZB4XD4S.mjs +0 -2378
- package/dist/host-4ZB4XD4S.mjs.map +0 -1
- package/dist/serialize-PGHQZEPV.mjs +0 -9
package/dist/index.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './index.css';
|
|
3
|
-
import { geometryStamp } from './chunk-
|
|
4
|
-
export { geometryStamp } from './chunk-
|
|
5
|
-
import { geometry3dStamp } from './chunk-
|
|
6
|
-
export { geometry3dStamp } from './chunk-
|
|
7
|
-
import './chunk-
|
|
3
|
+
import { geometryStamp } from './chunk-DBG6DZ2V.mjs';
|
|
4
|
+
export { geometryStamp } from './chunk-DBG6DZ2V.mjs';
|
|
5
|
+
import { geometry3dStamp } from './chunk-FI2MGX5H.mjs';
|
|
6
|
+
export { geometry3dStamp } from './chunk-FI2MGX5H.mjs';
|
|
7
|
+
import './chunk-DCFZTKFE.mjs';
|
|
8
8
|
import { latexStamp } from './chunk-C76SOFXF.mjs';
|
|
9
9
|
export { latexStamp } from './chunk-C76SOFXF.mjs';
|
|
10
|
-
import { graph2dStamp } from './chunk-
|
|
11
|
-
export { graph2dStamp } from './chunk-
|
|
10
|
+
import { graph2dStamp } from './chunk-MOAXHVKI.mjs';
|
|
11
|
+
export { graph2dStamp } from './chunk-MOAXHVKI.mjs';
|
|
12
12
|
import './chunk-KWDBVLST.mjs';
|
|
13
13
|
import './chunk-O4WIZFRQ.mjs';
|
|
14
14
|
import './chunk-K7VJU7LQ.mjs';
|
|
15
|
-
import './chunk-
|
|
16
|
-
import './chunk-
|
|
15
|
+
import './chunk-F42MZ745.mjs';
|
|
16
|
+
import './chunk-KLGPAMJS.mjs';
|
|
17
17
|
import './chunk-R5FL6S7L.mjs';
|
|
18
18
|
import './chunk-IE2GGHNF.mjs';
|
|
19
19
|
import './chunk-ICR4CVOE.mjs';
|
|
20
|
-
import './chunk-
|
|
20
|
+
import './chunk-4EXRNZRX.mjs';
|
|
21
21
|
import './chunk-CH6SFONH.mjs';
|
|
22
|
-
export { handleExtractProblem } from './chunk-
|
|
23
|
-
import './chunk-
|
|
22
|
+
export { handleExtractProblem } from './chunk-SUXIMLYN.mjs';
|
|
23
|
+
import './chunk-MNHOFOM5.mjs';
|
|
24
24
|
import './chunk-B4NJJZFR.mjs';
|
|
25
25
|
import './chunk-X5R72SSJ.mjs';
|
|
26
26
|
import './chunk-QLQ4MJNO.mjs';
|
|
@@ -39,7 +39,7 @@ var STAMP_CATALOG = Object.freeze([
|
|
|
39
39
|
version: 1,
|
|
40
40
|
experimental: false,
|
|
41
41
|
runtimeDeps: ["jsxgraph"],
|
|
42
|
-
bundleSize: { js:
|
|
42
|
+
bundleSize: { js: 97.13, css: 0 }
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
id: "latex",
|
|
@@ -55,7 +55,7 @@ var STAMP_CATALOG = Object.freeze([
|
|
|
55
55
|
version: 2,
|
|
56
56
|
experimental: true,
|
|
57
57
|
runtimeDeps: ["jsxgraph"],
|
|
58
|
-
bundleSize: { js:
|
|
58
|
+
bundleSize: { js: 85.27, css: 0 }
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
id: "graph2d",
|
|
@@ -63,7 +63,7 @@ var STAMP_CATALOG = Object.freeze([
|
|
|
63
63
|
version: 2,
|
|
64
64
|
experimental: true,
|
|
65
65
|
runtimeDeps: ["jsxgraph"],
|
|
66
|
-
bundleSize: { js:
|
|
66
|
+
bundleSize: { js: 58.06, css: 0 }
|
|
67
67
|
}
|
|
68
68
|
]);
|
|
69
69
|
function findCatalogEntry(id) {
|
|
@@ -1768,17 +1768,17 @@ function useScenePersist(opts) {
|
|
|
1768
1768
|
try {
|
|
1769
1769
|
const latestScene = latestSceneRef.current;
|
|
1770
1770
|
if (!latestScene) return;
|
|
1771
|
-
const
|
|
1771
|
+
const liveElements2 = latestScene.elements.filter((e) => !e.isDeleted);
|
|
1772
1772
|
const liveAppState = pickSyncableAppState(latestScene.appState);
|
|
1773
1773
|
const hashFn = hashElementsVersionRef.current;
|
|
1774
|
-
const elementHash = hashFn ? hashFn(
|
|
1774
|
+
const elementHash = hashFn ? hashFn(liveElements2) : liveElements2.map((e) => e.id).join("|");
|
|
1775
1775
|
const sceneHash = `${elementHash}:${JSON.stringify(liveAppState)}`;
|
|
1776
1776
|
if (sceneHash === lastSceneHashRef.current) return;
|
|
1777
1777
|
lastSceneHashRef.current = sceneHash;
|
|
1778
|
-
onSceneChangeRef.current?.({ elements:
|
|
1778
|
+
onSceneChangeRef.current?.({ elements: liveElements2, appState: liveAppState });
|
|
1779
1779
|
if (persistEnabledRef.current) {
|
|
1780
1780
|
writeScene(persistKeyRef.current, {
|
|
1781
|
-
elements:
|
|
1781
|
+
elements: liveElements2,
|
|
1782
1782
|
appState: liveAppState
|
|
1783
1783
|
});
|
|
1784
1784
|
}
|
|
@@ -1786,13 +1786,18 @@ function useScenePersist(opts) {
|
|
|
1786
1786
|
console.warn("[whiteboard] flushScene th\u1EA5t b\u1EA1i:", err);
|
|
1787
1787
|
}
|
|
1788
1788
|
};
|
|
1789
|
+
const liveElements = () => {
|
|
1790
|
+
const latest = latestSceneRef.current?.elements;
|
|
1791
|
+
if (latest) return latest.filter((e) => !e.isDeleted);
|
|
1792
|
+
return apiRef.current?.getSceneElements?.() ?? [];
|
|
1793
|
+
};
|
|
1789
1794
|
const flushFilesRef = useRef(() => void 0);
|
|
1790
1795
|
flushFilesRef.current = () => {
|
|
1791
1796
|
try {
|
|
1792
1797
|
const pending = pendingFilesRef.current;
|
|
1793
1798
|
pendingFilesRef.current = {};
|
|
1794
1799
|
if (Object.keys(pending).length === 0) return;
|
|
1795
|
-
const currentElements =
|
|
1800
|
+
const currentElements = liveElements();
|
|
1796
1801
|
const stampIds = /* @__PURE__ */ new Set();
|
|
1797
1802
|
for (const el of currentElements) {
|
|
1798
1803
|
const fid = el.fileId;
|
|
@@ -1812,7 +1817,8 @@ function useScenePersist(opts) {
|
|
|
1812
1817
|
const flushPruneRef = useRef(() => void 0);
|
|
1813
1818
|
flushPruneRef.current = () => {
|
|
1814
1819
|
try {
|
|
1815
|
-
|
|
1820
|
+
if (!latestSceneRef.current) return;
|
|
1821
|
+
const currentElements = liveElements();
|
|
1816
1822
|
const keep = /* @__PURE__ */ new Set();
|
|
1817
1823
|
for (const el of currentElements) {
|
|
1818
1824
|
const fid = el.fileId;
|