@xom11/whiteboard 0.27.0 → 0.28.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.
Files changed (60) hide show
  1. package/dist/ai.d.mts +1 -1
  2. package/dist/ai.d.ts +1 -1
  3. package/dist/ai.js +54 -23
  4. package/dist/ai.js.map +1 -1
  5. package/dist/ai.mjs +54 -23
  6. package/dist/ai.mjs.map +1 -1
  7. package/dist/catalog.json +4 -4
  8. package/dist/{chunk-D5JLJ3PT.mjs → chunk-5JM35CXV.mjs} +4 -4
  9. package/dist/{chunk-D5JLJ3PT.mjs.map → chunk-5JM35CXV.mjs.map} +1 -1
  10. package/dist/{chunk-KYMBUTPO.mjs → chunk-BU5KLO3P.mjs} +3 -3
  11. package/dist/{chunk-KYMBUTPO.mjs.map → chunk-BU5KLO3P.mjs.map} +1 -1
  12. package/dist/{chunk-AYJPOHCI.mjs → chunk-H22OZYTW.mjs} +3 -3
  13. package/dist/{chunk-AYJPOHCI.mjs.map → chunk-H22OZYTW.mjs.map} +1 -1
  14. package/dist/{chunk-I3L56GVH.mjs → chunk-OQIQNKPQ.mjs} +3 -3
  15. package/dist/{chunk-I3L56GVH.mjs.map → chunk-OQIQNKPQ.mjs.map} +1 -1
  16. package/dist/{chunk-KZGPSTZI.mjs → chunk-QCZVFEN4.mjs} +4 -4
  17. package/dist/{chunk-KZGPSTZI.mjs.map → chunk-QCZVFEN4.mjs.map} +1 -1
  18. package/dist/{chunk-4ETJ4CDY.mjs → chunk-QRUAEXLR.mjs} +4 -4
  19. package/dist/{chunk-4ETJ4CDY.mjs.map → chunk-QRUAEXLR.mjs.map} +1 -1
  20. package/dist/{chunk-HLAOGXEK.mjs → chunk-V3YJ6JFL.mjs} +3 -3
  21. package/dist/{chunk-HLAOGXEK.mjs.map → chunk-V3YJ6JFL.mjs.map} +1 -1
  22. package/dist/{chunk-D5LWSN2Y.mjs → chunk-ZTQBUKLJ.mjs} +30 -13
  23. package/dist/chunk-ZTQBUKLJ.mjs.map +1 -0
  24. package/dist/geometry-2d.d.mts +1 -1
  25. package/dist/geometry-2d.d.ts +1 -1
  26. package/dist/geometry-2d.js +143 -33
  27. package/dist/geometry-2d.js.map +1 -1
  28. package/dist/geometry-2d.mjs +3 -3
  29. package/dist/geometry-3d.d.mts +1 -1
  30. package/dist/geometry-3d.d.ts +1 -1
  31. package/dist/geometry-3d.js +28 -11
  32. package/dist/geometry-3d.js.map +1 -1
  33. package/dist/geometry-3d.mjs +3 -3
  34. package/dist/graph-2d.d.mts +1 -1
  35. package/dist/graph-2d.d.ts +1 -1
  36. package/dist/graph-2d.js +28 -11
  37. package/dist/graph-2d.js.map +1 -1
  38. package/dist/graph-2d.mjs +3 -3
  39. package/dist/{host-M26FS244.mjs → host-2ISGVO7O.mjs} +5 -5
  40. package/dist/{host-M26FS244.mjs.map → host-2ISGVO7O.mjs.map} +1 -1
  41. package/dist/{host-HAYCJJ2T.mjs → host-4P766V4J.mjs} +110 -27
  42. package/dist/host-4P766V4J.mjs.map +1 -0
  43. package/dist/{host-LTJHAY5A.mjs → host-HOSJHQ5H.mjs} +6 -6
  44. package/dist/{host-LTJHAY5A.mjs.map → host-HOSJHQ5H.mjs.map} +1 -1
  45. package/dist/index.d.mts +9 -4
  46. package/dist/index.d.ts +9 -4
  47. package/dist/index.js +147 -35
  48. package/dist/index.js.map +1 -1
  49. package/dist/index.mjs +17 -15
  50. package/dist/index.mjs.map +1 -1
  51. package/dist/latex.d.mts +1 -1
  52. package/dist/latex.d.ts +1 -1
  53. package/dist/serialize-N4G6RFBB.mjs +9 -0
  54. package/dist/{serialize-C3LSUMSA.mjs.map → serialize-N4G6RFBB.mjs.map} +1 -1
  55. package/dist/{types-zc_Pa0mp.d.mts → types-BHYC2Fiw.d.mts} +25 -1
  56. package/dist/{types-zc_Pa0mp.d.ts → types-BHYC2Fiw.d.ts} +25 -1
  57. package/package.json +1 -1
  58. package/dist/chunk-D5LWSN2Y.mjs.map +0 -1
  59. package/dist/host-HAYCJJ2T.mjs.map +0 -1
  60. package/dist/serialize-C3LSUMSA.mjs +0 -9
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- export { geometryStamp } from './chunk-KZGPSTZI.mjs';
3
- import './chunk-AYJPOHCI.mjs';
2
+ export { geometryStamp } from './chunk-QCZVFEN4.mjs';
3
+ import './chunk-H22OZYTW.mjs';
4
4
  import './chunk-R5FL6S7L.mjs';
5
5
  import './chunk-SZDAS7LK.mjs';
6
6
  import './chunk-ICR4CVOE.mjs';
7
- import './chunk-D5LWSN2Y.mjs';
7
+ import './chunk-ZTQBUKLJ.mjs';
8
8
  import './chunk-IHUFOV7L.mjs';
9
9
  import './chunk-73Q7ADVL.mjs';
10
10
  import './chunk-B4NJJZFR.mjs';
@@ -1,4 +1,4 @@
1
- import { B as BaseStampCustomData, S as StampType } from './types-zc_Pa0mp.mjs';
1
+ import { B as BaseStampCustomData, S as StampType } from './types-BHYC2Fiw.mjs';
2
2
  import 'zod';
3
3
  import 'react';
4
4
  import '@excalidraw/excalidraw/element/types';
@@ -1,4 +1,4 @@
1
- import { B as BaseStampCustomData, S as StampType } from './types-zc_Pa0mp.js';
1
+ import { B as BaseStampCustomData, S as StampType } from './types-BHYC2Fiw.js';
2
2
  import 'zod';
3
3
  import 'react';
4
4
  import '@excalidraw/excalidraw/element/types';
@@ -2287,9 +2287,11 @@ var init_circle = __esm({
2287
2287
  },
2288
2288
  render: (obj, ctx) => {
2289
2289
  const board = ctx.jxg;
2290
+ const isCenterLabel = (l) => /^[A-Z]['′]?\d*$/u.test(l);
2291
+ const isCenter = isCenterLabel(obj.label);
2290
2292
  const baseOpts = {
2291
2293
  name: obj.label,
2292
- withLabel: obj.attrs.showLabel ?? false,
2294
+ withLabel: isCenter ? obj.attrs.showLabel ?? false : true,
2293
2295
  strokeColor: obj.attrs.color ?? "#0f172a",
2294
2296
  strokeWidth: obj.attrs.width ?? 2,
2295
2297
  dash: obj.attrs.dash ?? 0,
@@ -2302,22 +2304,37 @@ var init_circle = __esm({
2302
2304
  const p1 = ctx.resolveRef(c.p1);
2303
2305
  const p2 = ctx.resolveRef(c.p2);
2304
2306
  const p3 = ctx.resolveRef(c.p3);
2307
+ if (isCenter) {
2308
+ const center2 = board.create("circumcenter", [p1, p2, p3], {
2309
+ visible: obj.visible,
2310
+ withLabel: true,
2311
+ fixed: true,
2312
+ name: obj.label
2313
+ });
2314
+ const circ = board.create("circumcircle", [p1, p2, p3], { ...baseOpts, withLabel: false });
2315
+ circ.center = circ.center ?? center2;
2316
+ circ._helpers = [center2];
2317
+ return circ;
2318
+ }
2305
2319
  return board.create("circumcircle", [p1, p2, p3], baseOpts);
2306
2320
  }
2307
2321
  if (c?.kind === "incircle") {
2308
2322
  const p1 = ctx.resolveRef(c.p1);
2309
2323
  const p2 = ctx.resolveRef(c.p2);
2310
2324
  const p3 = ctx.resolveRef(c.p3);
2311
- const center2 = board.create("incenter", [p1, p2, p3], {
2312
- visible: obj.visible,
2313
- withLabel: true,
2314
- fixed: true,
2315
- name: obj.label
2316
- });
2317
- const circ = board.create("incircle", [p1, p2, p3], baseOpts);
2318
- circ.center = circ.center ?? center2;
2319
- circ._helpers = [center2];
2320
- return circ;
2325
+ if (isCenter) {
2326
+ const center2 = board.create("incenter", [p1, p2, p3], {
2327
+ visible: obj.visible,
2328
+ withLabel: true,
2329
+ fixed: true,
2330
+ name: obj.label
2331
+ });
2332
+ const circ = board.create("incircle", [p1, p2, p3], { ...baseOpts, withLabel: false });
2333
+ circ.center = circ.center ?? center2;
2334
+ circ._helpers = [center2];
2335
+ return circ;
2336
+ }
2337
+ return board.create("incircle", [p1, p2, p3], baseOpts);
2321
2338
  }
2322
2339
  if (c?.kind === "excircle") {
2323
2340
  const P = [ctx.resolveRef(c.p1), ctx.resolveRef(c.p2), ctx.resolveRef(c.p3)];