@xom11/whiteboard 0.32.0 → 0.33.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 +1 -1
- package/dist/ai.d.ts +1 -1
- package/dist/ai.mjs +2 -2
- package/dist/catalog.json +4 -4
- package/dist/{chunk-FI2MGX5H.mjs → chunk-4NJUTCFF.mjs} +3 -3
- package/dist/{chunk-FI2MGX5H.mjs.map → chunk-4NJUTCFF.mjs.map} +1 -1
- package/dist/{chunk-XSTGTEGP.mjs → chunk-BZZ5BROM.mjs} +4 -5
- package/dist/chunk-BZZ5BROM.mjs.map +1 -0
- package/dist/{host-JNLJ5BVR.mjs → chunk-C3RDFBQ5.mjs} +17 -32
- package/dist/chunk-C3RDFBQ5.mjs.map +1 -0
- package/dist/chunk-C7C66BAV.mjs +11 -0
- package/dist/chunk-C7C66BAV.mjs.map +1 -0
- package/dist/{chunk-DBG6DZ2V.mjs → chunk-FOPZOVI3.mjs} +5 -4
- package/dist/chunk-FOPZOVI3.mjs.map +1 -0
- package/dist/{chunk-MOAXHVKI.mjs → chunk-GKDQ5IV7.mjs} +3 -3
- package/dist/{chunk-MOAXHVKI.mjs.map → chunk-GKDQ5IV7.mjs.map} +1 -1
- package/dist/{chunk-KLGPAMJS.mjs → chunk-NBMYET5H.mjs} +3 -10
- package/dist/{chunk-KLGPAMJS.mjs.map → chunk-NBMYET5H.mjs.map} +1 -1
- package/dist/{chunk-DJM5EWTT.mjs → chunk-NTFG7ZRN.mjs} +2 -2
- package/dist/{chunk-DJM5EWTT.mjs.map → chunk-NTFG7ZRN.mjs.map} +1 -1
- package/dist/{chunk-C76SOFXF.mjs → chunk-QCK3Z5WN.mjs} +3 -3
- package/dist/{chunk-C76SOFXF.mjs.map → chunk-QCK3Z5WN.mjs.map} +1 -1
- package/dist/geometry-2d.d.mts +1 -1
- package/dist/geometry-2d.d.ts +1 -1
- package/dist/geometry-2d.js +146 -115
- package/dist/geometry-2d.js.map +1 -1
- package/dist/geometry-2d.mjs +4 -3
- package/dist/geometry-3d.d.mts +1 -1
- package/dist/geometry-3d.d.ts +1 -1
- package/dist/geometry-3d.js +6 -4
- package/dist/geometry-3d.js.map +1 -1
- package/dist/geometry-3d.mjs +2 -2
- package/dist/graph-2d.d.mts +1 -1
- package/dist/graph-2d.d.ts +1 -1
- package/dist/graph-2d.js +6 -4
- package/dist/graph-2d.js.map +1 -1
- package/dist/graph-2d.mjs +2 -2
- package/dist/host-6WTLCXUE.mjs +62 -0
- package/dist/host-6WTLCXUE.mjs.map +1 -0
- package/dist/{host-H2IGOKJU.mjs → host-BWIXT5TR.mjs} +3 -3
- package/dist/{host-H2IGOKJU.mjs.map → host-BWIXT5TR.mjs.map} +1 -1
- package/dist/{host-VRWLQSMH.mjs → host-QDVRULJV.mjs} +10 -7
- package/dist/host-QDVRULJV.mjs.map +1 -0
- package/dist/{host-W4U6YCSX.mjs → host-USOIVTQB.mjs} +10 -7
- package/dist/host-USOIVTQB.mjs.map +1 -0
- package/dist/index.d.mts +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +173 -119
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -16
- package/dist/index.mjs.map +1 -1
- package/dist/latex.d.mts +1 -1
- package/dist/latex.d.ts +1 -1
- package/dist/latex.mjs +1 -1
- package/dist/studio.d.mts +35 -0
- package/dist/studio.d.ts +35 -0
- package/dist/studio.js +10883 -0
- package/dist/studio.js.map +1 -0
- package/dist/studio.mjs +28 -0
- package/dist/studio.mjs.map +1 -0
- package/dist/{types-tePd94vW.d.mts → types-eEEEVsLF.d.mts} +1 -1
- package/dist/{types-tePd94vW.d.ts → types-eEEEVsLF.d.ts} +1 -1
- package/package.json +9 -2
- package/dist/chunk-DBG6DZ2V.mjs.map +0 -1
- package/dist/chunk-XSTGTEGP.mjs.map +0 -1
- package/dist/host-JNLJ5BVR.mjs.map +0 -1
- package/dist/host-VRWLQSMH.mjs.map +0 -1
- package/dist/host-W4U6YCSX.mjs.map +0 -1
package/dist/latex.d.mts
CHANGED
package/dist/latex.d.ts
CHANGED
package/dist/latex.mjs
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { G as GenerateGeometryFigure, a as GeometryDraftPreview, c as StampHostHandle, d as State } from './types-eEEEVsLF.mjs';
|
|
3
|
+
import '@excalidraw/excalidraw/element/types';
|
|
4
|
+
|
|
5
|
+
interface GeometryStudioProps {
|
|
6
|
+
/** Seed store lúc mount. Vắng = board trống. */
|
|
7
|
+
initialJsonState?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Thay cho insertStampImage. Editor gọi khi user bấm "Chèn".
|
|
10
|
+
* Trả `false` nghĩa là CHƯA commit (vd Excalidraw api chưa sẵn sàng) →
|
|
11
|
+
* GeometryStudio giữ panel mở để user thử lại. Mọi giá trị khác = đã commit.
|
|
12
|
+
*/
|
|
13
|
+
onCommit: (jsonState: string, svgString: string) => boolean | void | Promise<boolean | void>;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
isDark?: boolean;
|
|
16
|
+
/** Chỉ để EditorPanel đọc viewport khi dựng draft. Vắng = bỏ qua draft. */
|
|
17
|
+
api?: unknown;
|
|
18
|
+
generateGeometryFigure?: GenerateGeometryFigure;
|
|
19
|
+
onGeometryDraft?: (draft: GeometryDraftPreview | null) => void;
|
|
20
|
+
}
|
|
21
|
+
declare const GeometryStudio: react.ForwardRefExoticComponent<GeometryStudioProps & react.RefAttributes<StampHostHandle>>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* `State` → chuỗi `jsonState` dùng được cho `deserializeBoard`,
|
|
25
|
+
* `renderGeometrySvgFromState`, `GeometryStudio.initialJsonState` và
|
|
26
|
+
* `insertGeometryStampIntoScene`.
|
|
27
|
+
*
|
|
28
|
+
* Tồn tại vì `serializeBoard` đòi thêm `View2D` mà consumer (trang landing,
|
|
29
|
+
* chỉ có `state` từ `handleGenerateFigure`) không cầm sẵn.
|
|
30
|
+
*/
|
|
31
|
+
declare function geometryStateToJsonState(state: State): string;
|
|
32
|
+
|
|
33
|
+
declare function renderGeometrySvgFromState(jsonState: string): Promise<string>;
|
|
34
|
+
|
|
35
|
+
export { GeometryStudio, type GeometryStudioProps, geometryStateToJsonState, renderGeometrySvgFromState };
|
package/dist/studio.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { G as GenerateGeometryFigure, a as GeometryDraftPreview, c as StampHostHandle, d as State } from './types-eEEEVsLF.js';
|
|
3
|
+
import '@excalidraw/excalidraw/element/types';
|
|
4
|
+
|
|
5
|
+
interface GeometryStudioProps {
|
|
6
|
+
/** Seed store lúc mount. Vắng = board trống. */
|
|
7
|
+
initialJsonState?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Thay cho insertStampImage. Editor gọi khi user bấm "Chèn".
|
|
10
|
+
* Trả `false` nghĩa là CHƯA commit (vd Excalidraw api chưa sẵn sàng) →
|
|
11
|
+
* GeometryStudio giữ panel mở để user thử lại. Mọi giá trị khác = đã commit.
|
|
12
|
+
*/
|
|
13
|
+
onCommit: (jsonState: string, svgString: string) => boolean | void | Promise<boolean | void>;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
isDark?: boolean;
|
|
16
|
+
/** Chỉ để EditorPanel đọc viewport khi dựng draft. Vắng = bỏ qua draft. */
|
|
17
|
+
api?: unknown;
|
|
18
|
+
generateGeometryFigure?: GenerateGeometryFigure;
|
|
19
|
+
onGeometryDraft?: (draft: GeometryDraftPreview | null) => void;
|
|
20
|
+
}
|
|
21
|
+
declare const GeometryStudio: react.ForwardRefExoticComponent<GeometryStudioProps & react.RefAttributes<StampHostHandle>>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* `State` → chuỗi `jsonState` dùng được cho `deserializeBoard`,
|
|
25
|
+
* `renderGeometrySvgFromState`, `GeometryStudio.initialJsonState` và
|
|
26
|
+
* `insertGeometryStampIntoScene`.
|
|
27
|
+
*
|
|
28
|
+
* Tồn tại vì `serializeBoard` đòi thêm `View2D` mà consumer (trang landing,
|
|
29
|
+
* chỉ có `state` từ `handleGenerateFigure`) không cầm sẵn.
|
|
30
|
+
*/
|
|
31
|
+
declare function geometryStateToJsonState(state: State): string;
|
|
32
|
+
|
|
33
|
+
declare function renderGeometrySvgFromState(jsonState: string): Promise<string>;
|
|
34
|
+
|
|
35
|
+
export { GeometryStudio, type GeometryStudioProps, geometryStateToJsonState, renderGeometrySvgFromState };
|