@tatamicks/core 1.0.3 → 1.0.4

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 (35) hide show
  1. package/dist/PalettePanel-BTB1LkgU.cjs +9 -0
  2. package/dist/PalettePanel-BTB1LkgU.cjs.map +1 -0
  3. package/dist/{PalettePanel-N5Y1TJAk.js → PalettePanel-CrA2BGLq.js} +959 -942
  4. package/dist/PalettePanel-CrA2BGLq.js.map +1 -0
  5. package/dist/PalettePanel.css +1 -1
  6. package/dist/canvas.cjs +1 -1
  7. package/dist/canvas.mjs +4 -4
  8. package/dist/index.cjs +2 -2
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.css +1 -1
  11. package/dist/index.mjs +352 -343
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/{paperSettingsWidget-d93s3Gsr.js → paperSettingsWidget-CAIw_Ofm.js} +1582 -1535
  14. package/dist/paperSettingsWidget-CAIw_Ofm.js.map +1 -0
  15. package/dist/paperSettingsWidget-CIRKgnz4.cjs +2 -0
  16. package/dist/paperSettingsWidget-CIRKgnz4.cjs.map +1 -0
  17. package/dist/shell.cjs +1 -1
  18. package/dist/shell.mjs +2 -2
  19. package/dist/{sidebarPortal-B2Mk9Aba.js → sidebarPortal-Bigm11qq.js} +156 -151
  20. package/dist/sidebarPortal-Bigm11qq.js.map +1 -0
  21. package/dist/sidebarPortal-Dit8f3sD.cjs +3 -0
  22. package/dist/sidebarPortal-Dit8f3sD.cjs.map +1 -0
  23. package/dist/src/canvas.d.ts +4 -0
  24. package/dist/src/index.d.ts +5 -3
  25. package/dist/src/shell.d.ts +3 -1
  26. package/package.json +1 -1
  27. package/dist/PalettePanel-0cFP3tbA.cjs +0 -9
  28. package/dist/PalettePanel-0cFP3tbA.cjs.map +0 -1
  29. package/dist/PalettePanel-N5Y1TJAk.js.map +0 -1
  30. package/dist/paperSettingsWidget-CJ4QFjYK.cjs +0 -2
  31. package/dist/paperSettingsWidget-CJ4QFjYK.cjs.map +0 -1
  32. package/dist/paperSettingsWidget-d93s3Gsr.js.map +0 -1
  33. package/dist/sidebarPortal-B2Mk9Aba.js.map +0 -1
  34. package/dist/sidebarPortal-BCIVv4yO.cjs +0 -3
  35. package/dist/sidebarPortal-BCIVv4yO.cjs.map +0 -1
@@ -1,14 +1,14 @@
1
- import { jsxs as q, jsx as N } from "react/jsx-runtime";
1
+ import { jsxs as q, jsx as R } from "react/jsx-runtime";
2
2
  import { useMemo as A, useCallback as O } from "react";
3
3
  var Z = /* @__PURE__ */ ((t) => (t.left = "left", t.center = "center", t.right = "right", t))(Z || {}), Q = /* @__PURE__ */ ((t) => (t.top = "top", t.center = "center", t.bottom = "bottom", t))(Q || {});
4
- const Gt = {
4
+ const Ut = {
5
5
  kind: "alignment",
6
6
  defaultProps: {
7
7
  horizontal: "left",
8
8
  vertical: "center"
9
9
  /* center */
10
10
  }
11
- }, Ht = {
11
+ }, Wt = {
12
12
  kind: "checkboxStyle",
13
13
  defaultProps: {
14
14
  styleConfig: {
@@ -21,15 +21,15 @@ const Gt = {
21
21
  checkedBackgroundColor: "#ffffff"
22
22
  }
23
23
  }
24
- }, G = "application/x-tatamicks-block", S = "application/x-tatamicks-block-kind-";
25
- function Vt(t, e, r) {
24
+ }, U = "application/x-tatamicks-block", S = "application/x-tatamicks-block-kind-";
25
+ function Ft(t, e, r) {
26
26
  if (!t.dataTransfer) return;
27
27
  const n = { kind: e, defaultSize: r };
28
- t.dataTransfer.setData(G, JSON.stringify(n)), t.dataTransfer.setData(`${S}${e}`, ""), t.dataTransfer.effectAllowed = "copy";
28
+ t.dataTransfer.setData(U, JSON.stringify(n)), t.dataTransfer.setData(`${S}${e}`, ""), t.dataTransfer.effectAllowed = "copy";
29
29
  }
30
- function Wt(t) {
30
+ function Ht(t) {
31
31
  if (!t.dataTransfer) return null;
32
- const e = t.dataTransfer.getData(G);
32
+ const e = t.dataTransfer.getData(U);
33
33
  if (!e) return null;
34
34
  try {
35
35
  return JSON.parse(e);
@@ -37,7 +37,7 @@ function Wt(t) {
37
37
  return null;
38
38
  }
39
39
  }
40
- function Ft(t) {
40
+ function Vt(t) {
41
41
  if (!t.dataTransfer) return null;
42
42
  const e = Array.from(t.dataTransfer.types).find(
43
43
  (r) => r.startsWith(S)
@@ -106,17 +106,21 @@ const et = {
106
106
  EDIT_BLOCK: 24e5,
107
107
  BLOCK_SELECT_BORDER: 25e5,
108
108
  BLOCK_HANDLES: 26e5,
109
- SELECTION_ACTION_BAR: 265e4,
110
109
  GRID_GHOST: 27e5,
111
- DROPDOWN: 34e5
110
+ TOOLTIP: 33e5,
111
+ DROPDOWN: 34e5,
112
+ FLOATING_WIDGET: 37e5,
113
+ FLOATING_WIDGET_DRAGGING: 375e4
112
114
  }, Jt = {
113
115
  BG: 10,
114
116
  CONTENT: 50,
115
117
  GUIDE: 70,
116
118
  BORDER: 80,
117
119
  VALIDATION: 90
120
+ }, Yt = {
121
+ isolation: "isolate"
118
122
  };
119
- function Yt(t, e) {
123
+ function qt(t, e) {
120
124
  const r = t.match(/^(\d+(?:\.\d+)?)([a-zA-Z%]+)$/);
121
125
  if (!r)
122
126
  throw new Error(`Invalid dimension string: ${t}`);
@@ -125,12 +129,12 @@ function Yt(t, e) {
125
129
  throw new Error(`Invalid unit: ${o}`);
126
130
  return { value: n, unit: o };
127
131
  }
128
- function qt(t) {
132
+ function Zt(t) {
129
133
  return `${t.value}${t.unit}`;
130
134
  }
131
- const b = 96, nt = 10, H = 25.4, ot = 0.352778, at = H / b, h = {
135
+ const b = 96, nt = 10, W = 25.4, ot = 0.352778, at = W / b, h = {
132
136
  fromCm: (t) => t * nt,
133
- fromInch: (t) => t * H,
137
+ fromInch: (t) => t * W,
134
138
  fromPt: (t) => t * ot,
135
139
  fromPx: (t) => t * at,
136
140
  fromDim(t) {
@@ -201,7 +205,7 @@ const b = 96, nt = 10, H = 25.4, ot = 0.352778, at = H / b, h = {
201
205
  function ft(t) {
202
206
  return typeof t == "object" && t !== null && t.value === 1 && t.unit === "fr";
203
207
  }
204
- function j(t) {
208
+ function L(t) {
205
209
  const e = {};
206
210
  for (let r = 0; r < t.length; r++) {
207
211
  const n = t[r];
@@ -209,7 +213,7 @@ function j(t) {
209
213
  }
210
214
  return e;
211
215
  }
212
- function V(t) {
216
+ function F(t) {
213
217
  if (typeof t != "object" || t === null)
214
218
  throw new Error("grid must be an object");
215
219
  const e = t;
@@ -217,9 +221,9 @@ function V(t) {
217
221
  const r = e.cols, n = e.rows, o = {
218
222
  colCount: r.length,
219
223
  rowCount: n.length
220
- }, a = j(r);
224
+ }, a = L(r);
221
225
  Object.keys(a).length > 0 && (o.cols = a);
222
- const s = j(n);
226
+ const s = L(n);
223
227
  return Object.keys(s).length > 0 && (o.rows = s), o;
224
228
  }
225
229
  return t;
@@ -266,7 +270,7 @@ function gt(t) {
266
270
  }
267
271
  return e.border = r, e;
268
272
  }
269
- function W(t, e) {
273
+ function H(t, e) {
270
274
  if (typeof t != "object" || t === null) return t;
271
275
  const r = { ...t };
272
276
  "props" in r && (r.props = dt(r.props)), "style" in r && (r.style = gt(r.style));
@@ -281,7 +285,7 @@ function bt(t, e) {
281
285
  if (typeof t != "object" || t === null)
282
286
  throw new Error("page must be an object");
283
287
  const r = { ...t };
284
- return "grid" in r && (r.grid = V(r.grid)), Array.isArray(r.blocks) && (r.blocks = r.blocks.map((n) => W(n, e))), {
288
+ return "grid" in r && (r.grid = F(r.grid)), Array.isArray(r.blocks) && (r.blocks = r.blocks.map((n) => H(n, e))), {
285
289
  grid: r.grid,
286
290
  blocks: r.blocks,
287
291
  ...r.blockDefaults !== void 0 ? { blockDefaults: r.blockDefaults } : {},
@@ -308,9 +312,9 @@ function Et(t, e) {
308
312
  if (typeof t != "object" || t === null)
309
313
  throw new Error("Schema must be a JSON object");
310
314
  const r = { ...t }, n = {};
311
- if ("grid" in r && (n.grid = V(r.grid), delete r.grid), "blocks" in r) {
315
+ if ("grid" in r && (n.grid = F(r.grid), delete r.grid), "blocks" in r) {
312
316
  const s = r.blocks;
313
- Array.isArray(s) && (n.blocks = s.map((c) => W(c, e))), delete r.blocks;
317
+ Array.isArray(s) && (n.blocks = s.map((c) => H(c, e))), delete r.blocks;
314
318
  }
315
319
  "metaData" in r && (n.metaData = r.metaData, delete r.metaData);
316
320
  const o = {};
@@ -336,7 +340,7 @@ function vt(t, e) {
336
340
  形式 B(Book): トップレベルに 'pages' が必要`
337
341
  );
338
342
  }
339
- function I(t) {
343
+ function T(t) {
340
344
  if (t === null) return !0;
341
345
  switch (typeof t) {
342
346
  case "string":
@@ -344,35 +348,35 @@ function I(t) {
344
348
  case "boolean":
345
349
  return !0;
346
350
  case "object":
347
- return Array.isArray(t) ? t.every(I) : Object.getPrototypeOf(t) === Object.prototype ? Object.values(t).every(I) : !1;
351
+ return Array.isArray(t) ? t.every(T) : Object.getPrototypeOf(t) === Object.prototype ? Object.values(t).every(T) : !1;
348
352
  default:
349
353
  return !1;
350
354
  }
351
355
  }
352
- function T(t) {
356
+ function x(t) {
353
357
  if (t === null || typeof t != "object" || Array.isArray(t) || Object.getPrototypeOf(t) !== Object.prototype)
354
358
  throw new Error("values must be a plain object");
355
359
  const e = t;
356
360
  for (const [r, n] of Object.entries(e))
357
- if (!I(n))
361
+ if (!T(n))
358
362
  throw new Error(`values["${r}"] contains an invalid value`);
359
363
  return e;
360
364
  }
361
- function Zt(t) {
365
+ function Qt(t) {
362
366
  let e;
363
367
  try {
364
368
  e = JSON.parse(t);
365
369
  } catch {
366
370
  throw new SyntaxError("invalid JSON for values");
367
371
  }
368
- return T(e);
372
+ return x(e);
369
373
  }
370
374
  function kt(t) {
371
375
  if (typeof t != "object" || t === null) return !1;
372
376
  const e = t;
373
377
  return !(typeof e.colCount != "number" || e.colCount < 1 || typeof e.rowCount != "number" || e.rowCount < 1);
374
378
  }
375
- function yt(t) {
379
+ function Dt(t) {
376
380
  if (typeof t == "string") return !0;
377
381
  if (typeof t != "object" || t === null) return !1;
378
382
  const e = t;
@@ -380,7 +384,7 @@ function yt(t) {
380
384
  const r = (n) => n === null || typeof n == "string" || typeof n == "number" || typeof n == "boolean";
381
385
  return "eq" in e ? r(e.eq) : "neq" in e ? r(e.neq) : !1;
382
386
  }
383
- function Dt(t) {
387
+ function yt(t) {
384
388
  if (typeof t != "object" || t === null) return !1;
385
389
  const e = t;
386
390
  if (typeof e.id != "string" || typeof e.kind != "string" || typeof e.layout != "object" || e.layout === null) return !1;
@@ -388,13 +392,13 @@ function Dt(t) {
388
392
  if (typeof r.x != "number" || typeof r.y != "number" || typeof r.w != "number" || typeof r.h != "number" || typeof e.props != "object" || e.props === null || Array.isArray(e.props))
389
393
  return !1;
390
394
  try {
391
- T(e.props);
395
+ x(e.props);
392
396
  } catch {
393
397
  return !1;
394
398
  }
395
- return !("initValue" in e && !I(e.initValue) || "hiddenBinding" in e && !yt(e.hiddenBinding));
399
+ return !("initValue" in e && !T(e.initValue) || "hiddenBinding" in e && !Dt(e.hiddenBinding));
396
400
  }
397
- function F(t) {
401
+ function V(t) {
398
402
  if (typeof t != "object" || t === null)
399
403
  throw new Error("Page must be an object");
400
404
  const e = t;
@@ -404,13 +408,13 @@ function F(t) {
404
408
  throw new Error("Invalid grid definition");
405
409
  if (!Array.isArray(e.blocks))
406
410
  throw new Error("blocks must be an array");
407
- if (!e.blocks.every(Dt))
411
+ if (!e.blocks.every(yt))
408
412
  throw new Error("Invalid block definition in blocks array");
409
413
  if (e.metaData !== void 0) {
410
414
  if (typeof e.metaData != "object" || e.metaData === null)
411
415
  throw new Error("metaData must be an object if provided");
412
416
  try {
413
- T(e.metaData);
417
+ x(e.metaData);
414
418
  } catch (r) {
415
419
  throw new Error(
416
420
  `Invalid metaData: ${r instanceof Error ? r.message : String(r)}`
@@ -423,7 +427,7 @@ function F(t) {
423
427
  const r = e.blockDefaults;
424
428
  for (const [n, o] of Object.entries(r))
425
429
  try {
426
- T(o);
430
+ x(o);
427
431
  } catch (a) {
428
432
  throw new Error(
429
433
  `Invalid blockDefaults["${n}"]: ${a instanceof Error ? a.message : String(a)}`
@@ -440,7 +444,7 @@ function Pt(t) {
440
444
  throw new Error("Book must have at least one page in pages");
441
445
  if (e.pages.forEach((r, n) => {
442
446
  try {
443
- F(r);
447
+ V(r);
444
448
  } catch (o) {
445
449
  throw new Error(
446
450
  `Invalid Page at pages[${n}]: ${o instanceof Error ? o.message : String(o)}`
@@ -450,22 +454,22 @@ function Pt(t) {
450
454
  throw new Error("Book.paper is required and must be an object");
451
455
  return t;
452
456
  }
453
- function Qt(t) {
454
- return JSON.stringify(t);
455
- }
456
457
  function te(t) {
457
458
  return JSON.stringify(t);
458
459
  }
459
460
  function ee(t) {
461
+ return JSON.stringify(t);
462
+ }
463
+ function re(t) {
460
464
  let e;
461
465
  try {
462
466
  e = JSON.parse(t);
463
467
  } catch {
464
468
  throw new SyntaxError("invalid JSON for Page");
465
469
  }
466
- return F(e);
470
+ return V(e);
467
471
  }
468
- function re(t) {
472
+ function ne(t) {
469
473
  let e;
470
474
  try {
471
475
  e = JSON.parse(t);
@@ -474,7 +478,7 @@ function re(t) {
474
478
  }
475
479
  return Pt(vt(e));
476
480
  }
477
- function ne({
481
+ function oe({
478
482
  checked: t,
479
483
  styleConfig: e
480
484
  }) {
@@ -487,7 +491,7 @@ function ne({
487
491
  style: { width: "100%", height: "100%", display: "block" },
488
492
  "aria-hidden": "true",
489
493
  children: [
490
- /* @__PURE__ */ N(
494
+ /* @__PURE__ */ R(
491
495
  "rect",
492
496
  {
493
497
  x: "2",
@@ -501,7 +505,7 @@ function ne({
501
505
  strokeWidth: a
502
506
  }
503
507
  ),
504
- t && /* @__PURE__ */ N(
508
+ t && /* @__PURE__ */ R(
505
509
  "path",
506
510
  {
507
511
  d: "M3 11l4 4L17 4",
@@ -516,7 +520,7 @@ function ne({
516
520
  }
517
521
  );
518
522
  }
519
- var At = /* @__PURE__ */ ((t) => (t.SOLID = "solid", t.DASHED = "dashed", t.DOTTED = "dotted", t))(At || {}), _t = /* @__PURE__ */ ((t) => (t.FORM = "Form", t.EDIT = "Edit", t.VIEW = "View", t))(_t || {});
523
+ var At = /* @__PURE__ */ ((t) => (t.SOLID = "solid", t.DASHED = "dashed", t.DOTTED = "dotted", t))(At || {}), It = /* @__PURE__ */ ((t) => (t.FORM = "Form", t.EDIT = "Edit", t.VIEW = "View", t))(It || {});
520
524
  const i = {
521
525
  MM: "mm",
522
526
  CM: "cm",
@@ -525,7 +529,7 @@ const i = {
525
529
  PT: "pt",
526
530
  PX: "px",
527
531
  PERCENT: "%"
528
- }, oe = [
532
+ }, ae = [
529
533
  i.MM,
530
534
  i.CM,
531
535
  i.FR,
@@ -533,25 +537,25 @@ const i = {
533
537
  i.PT,
534
538
  i.PX,
535
539
  i.PERCENT
536
- ], ae = [
540
+ ], ie = [
537
541
  i.MM,
538
542
  i.CM,
539
543
  i.INCH,
540
544
  i.PT,
541
545
  i.PX
542
- ], ie = [i.MM, i.CM, i.INCH], se = [
546
+ ], se = [i.MM, i.CM, i.INCH], ce = [
543
547
  i.MM,
544
548
  i.CM,
545
549
  i.FR,
546
550
  i.INCH,
547
551
  i.PT,
548
552
  i.PX
549
- ], ce = [i.PX, i.PT, i.MM], ue = [i.PT, i.PX, i.MM], le = [
553
+ ], ue = [i.PX, i.PT, i.MM], le = [i.PT, i.PX, i.MM], fe = [
550
554
  i.MM,
551
555
  i.PT,
552
556
  i.PX,
553
557
  i.PERCENT
554
- ], fe = [
558
+ ], me = [
555
559
  i.MM,
556
560
  i.CM,
557
561
  i.INCH,
@@ -559,8 +563,8 @@ const i = {
559
563
  i.PX,
560
564
  i.PERCENT
561
565
  ];
562
- var xt = /* @__PURE__ */ ((t) => (t.normal = "normal", t.breakWord = "break-word", t.breakAll = "break-all", t))(xt || {}), It = /* @__PURE__ */ ((t) => (t.normal = "normal", t.nowrap = "nowrap", t.pre = "pre", t.preWrap = "pre-wrap", t.preLine = "pre-line", t))(It || {}), Tt = /* @__PURE__ */ ((t) => (t.text = "text", t.number = "number", t.email = "email", t.tel = "tel", t.url = "url", t.date = "date", t.password = "password", t))(Tt || {});
563
- const me = {
566
+ var _t = /* @__PURE__ */ ((t) => (t.normal = "normal", t.breakWord = "break-word", t.breakAll = "break-all", t))(_t || {}), Tt = /* @__PURE__ */ ((t) => (t.normal = "normal", t.nowrap = "nowrap", t.pre = "pre", t.preWrap = "pre-wrap", t.preLine = "pre-line", t))(Tt || {}), xt = /* @__PURE__ */ ((t) => (t.text = "text", t.number = "number", t.email = "email", t.tel = "tel", t.url = "url", t.date = "date", t.password = "password", t))(xt || {});
567
+ const he = {
564
568
  kind: "textBehavior",
565
569
  defaultProps: {
566
570
  lineHeight: 1.2,
@@ -569,29 +573,29 @@ const me = {
569
573
  whiteSpace: "normal"
570
574
  /* normal */
571
575
  }
572
- }, he = {
576
+ }, de = {
573
577
  kind: "textValidation",
574
578
  defaultProps: {
575
579
  inputType: "text"
576
580
  /* text */
577
581
  }
578
582
  };
579
- function de(t) {
583
+ function ge(t) {
580
584
  return `move-arrow-session-${t}`;
581
585
  }
582
- function ge(t, e) {
586
+ function be(t, e) {
583
587
  return `layout-${t}-${[...e].sort().join(",")}`;
584
588
  }
585
- function be(t) {
589
+ function pe(t) {
586
590
  return `binding-${t}`;
587
591
  }
588
- function pe(t) {
592
+ function we(t) {
589
593
  return `initValue-${t}`;
590
594
  }
591
- function we(t) {
595
+ function Me(t) {
592
596
  return `grid-size-${t}`;
593
597
  }
594
- function Me(t) {
598
+ function Ee(t) {
595
599
  return `resize-arrow-session-${t}`;
596
600
  }
597
601
  const K = { value: 1, unit: "fr" };
@@ -604,7 +608,7 @@ function Ot(t) {
604
608
  }
605
609
  );
606
610
  }
607
- function Rt(t) {
611
+ function Nt(t) {
608
612
  return Array.from(
609
613
  { length: t.rowCount },
610
614
  (e, r) => {
@@ -613,7 +617,7 @@ function Rt(t) {
613
617
  }
614
618
  );
615
619
  }
616
- function Ee(t) {
620
+ function ve(t) {
617
621
  const e = {};
618
622
  for (let r = 0; r < t.length; r++) {
619
623
  const n = t[r];
@@ -624,7 +628,7 @@ function Ee(t) {
624
628
  cols: Object.keys(e).length > 0 ? e : void 0
625
629
  };
626
630
  }
627
- function ve(t) {
631
+ function ke(t) {
628
632
  const e = {};
629
633
  for (let r = 0; r < t.length; r++) {
630
634
  const n = t[r];
@@ -636,10 +640,10 @@ function ve(t) {
636
640
  };
637
641
  }
638
642
  function St(t) {
639
- const e = A(() => Ot(t), [t]), r = A(() => Rt(t), [t]);
643
+ const e = A(() => Ot(t), [t]), r = A(() => Nt(t), [t]);
640
644
  return { expandedCols: e, expandedRows: r };
641
645
  }
642
- function Nt(t) {
646
+ function Rt(t) {
643
647
  if (t.length === 0) return [];
644
648
  const e = [];
645
649
  let r = 0;
@@ -649,12 +653,12 @@ function Nt(t) {
649
653
  }
650
654
  return e;
651
655
  }
652
- const jt = 8, Bt = 32, Ct = 64, Lt = 512, B = (t, e, r) => Math.min(Math.max(t, e), r);
653
- function C(t) {
654
- const e = t.length - 1, r = e >= 1 ? t[e] ?? 0 : 0, n = t.length >= 1 ? r / e : 0, o = B(Math.ceil(Math.log2(e + 1)), jt, Bt), a = B(n * 2, Ct, Lt);
656
+ const Lt = 8, jt = 32, Bt = 64, Ct = 512, j = (t, e, r) => Math.min(Math.max(t, e), r);
657
+ function B(t) {
658
+ const e = t.length - 1, r = e >= 1 ? t[e] ?? 0 : 0, n = t.length >= 1 ? r / e : 0, o = j(Math.ceil(Math.log2(e + 1)), Lt, jt), a = j(n * 2, Bt, Ct);
655
659
  return { step: o, windowPx: a };
656
660
  }
657
- function R(t, e) {
661
+ function N(t, e) {
658
662
  const r = e.length - 1;
659
663
  if (r <= 0 || e[0] === void 0 || t < e[0] || e[r] === void 0) return -1;
660
664
  if (t >= e[r]) return r - 1;
@@ -669,7 +673,7 @@ function R(t, e) {
669
673
  }
670
674
  return n - 1;
671
675
  }
672
- function L(t, e, r) {
676
+ function C(t, e, r) {
673
677
  const n = t.length - 1;
674
678
  let o = 0;
675
679
  return (a) => {
@@ -680,27 +684,27 @@ function L(t, e, r) {
680
684
  if (s <= a && a < c) return o;
681
685
  const g = s - r, v = c + r;
682
686
  if (a < g || a >= v)
683
- return o = R(a, t), o;
684
- let _ = 0;
685
- const x = t[o + 1];
686
- if (x !== void 0 && a >= x)
687
+ return o = N(a, t), o;
688
+ let I = 0;
689
+ const _ = t[o + 1];
690
+ if (_ !== void 0 && a >= _)
687
691
  for (; o + 1 < n; ) {
688
692
  const k = t[o + 1];
689
693
  if (k === void 0 || a < k) break;
690
- if (o++, ++_ > e)
691
- return o = R(a, t), o;
694
+ if (o++, ++I > e)
695
+ return o = N(a, t), o;
692
696
  }
693
697
  else
694
698
  for (; o > 0; ) {
695
699
  const k = t[o];
696
700
  if (k === void 0 || a >= k) break;
697
- if (o--, ++_ > e)
698
- return o = R(a, t), o;
701
+ if (o--, ++I > e)
702
+ return o = N(a, t), o;
699
703
  }
700
704
  return o;
701
705
  };
702
706
  }
703
- function $(t, e) {
707
+ function G(t, e) {
704
708
  if (t.length === 0) return [];
705
709
  let r = 0, n = 0;
706
710
  const o = t.map((c) => {
@@ -719,22 +723,22 @@ function $(t, e) {
719
723
  return v.value * s;
720
724
  });
721
725
  }
722
- function U(t, e = b) {
726
+ function $(t, e = b) {
723
727
  const r = t.map((n) => l.fromMm(n, e));
724
- return Nt(r);
728
+ return Rt(r);
725
729
  }
726
- function ke(t, e, r = b) {
730
+ function De(t, e, r = b) {
727
731
  const { expandedCols: n, expandedRows: o } = St(e), a = A(() => {
728
- var y;
729
- const d = t.orientation ? t.size.height : t.size.width, M = t.orientation ? t.size.width : t.size.height, p = h.fromDim(d), E = h.fromDim(M), f = t.margin.bulk && ((y = t.margin.all) != null && y.unit) ? h.fromDim(t.margin.all) : void 0, u = f ?? h.fromDim(t.margin.top), m = f ?? h.fromDim(t.margin.bottom), w = f ?? h.fromDim(t.margin.left), D = f ?? h.fromDim(t.margin.right);
732
+ var D;
733
+ const d = t.orientation ? t.size.height : t.size.width, M = t.orientation ? t.size.width : t.size.height, p = h.fromDim(d), E = h.fromDim(M), f = t.margin.bulk && ((D = t.margin.all) != null && D.unit) ? h.fromDim(t.margin.all) : void 0, u = f ?? h.fromDim(t.margin.top), m = f ?? h.fromDim(t.margin.bottom), w = f ?? h.fromDim(t.margin.left), y = f ?? h.fromDim(t.margin.right);
730
734
  return {
731
735
  canvasWidthMm: p,
732
736
  canvasHeightMm: E,
733
737
  marginTopMm: u,
734
738
  marginBottomMm: m,
735
739
  marginLeftMm: w,
736
- marginRightMm: D,
737
- contentWidthMm: Math.max(0, p - w - D),
740
+ marginRightMm: y,
741
+ contentWidthMm: Math.max(0, p - w - y),
738
742
  contentHeightMm: Math.max(
739
743
  0,
740
744
  E - u - m
@@ -768,22 +772,22 @@ function ke(t, e, r = b) {
768
772
  }
769
773
  };
770
774
  }, [a, r]), { gridPosPx: c, colIndexer: g, rowIndexer: v } = A(() => {
771
- const { contentWidthMm: d, contentHeightMm: M } = a, p = U($(n, d), r), E = U($(o, M), r), f = [0];
775
+ const { contentWidthMm: d, contentHeightMm: M } = a, p = $(G(n, d), r), E = $(G(o, M), r), f = [0];
772
776
  for (const P of p)
773
777
  f.push((f[f.length - 1] ?? 0) + P);
774
778
  const u = [0];
775
779
  for (const P of E)
776
780
  u.push((u[u.length - 1] ?? 0) + P);
777
- const { step: m, windowPx: w } = C(f), { step: D, windowPx: y } = C(u);
781
+ const { step: m, windowPx: w } = B(f), { step: y, windowPx: D } = B(u);
778
782
  return {
779
783
  gridPosPx: { cols: f, rows: u },
780
- colIndexer: L(f, m, w),
781
- rowIndexer: L(u, D, y)
784
+ colIndexer: C(f, m, w),
785
+ rowIndexer: C(u, y, D)
782
786
  };
783
- }, [a, n, o, r]), _ = O(
787
+ }, [a, n, o, r]), I = O(
784
788
  (d) => g(d - s.margin.left),
785
789
  [g, s]
786
- ), x = O(
790
+ ), _ = O(
787
791
  (d) => v(d - s.margin.top),
788
792
  [v, s]
789
793
  ), k = O(
@@ -791,7 +795,7 @@ function ke(t, e, r = b) {
791
795
  const { x: M, y: p, w: E, h: f } = d.layout, u = c.cols, m = c.rows;
792
796
  if (!u.length || !m.length)
793
797
  return { left: 0, top: 0, width: 0, height: 0 };
794
- const w = Math.min(Math.max(0, M), u.length - 1), D = Math.min(Math.max(0, M + E), u.length - 1), y = Math.min(Math.max(0, p), m.length - 1), P = Math.min(Math.max(0, p + f), m.length - 1), X = (u[w] ?? 0) + s.margin.left, z = (m[y] ?? 0) + s.margin.top, J = (u[D] ?? 0) - (u[w] ?? 0), Y = (m[P] ?? 0) - (m[y] ?? 0);
798
+ const w = Math.min(Math.max(0, M), u.length - 1), y = Math.min(Math.max(0, M + E), u.length - 1), D = Math.min(Math.max(0, p), m.length - 1), P = Math.min(Math.max(0, p + f), m.length - 1), X = (u[w] ?? 0) + s.margin.left, z = (m[D] ?? 0) + s.margin.top, J = (u[y] ?? 0) - (u[w] ?? 0), Y = (m[P] ?? 0) - (m[D] ?? 0);
795
799
  return { left: X, top: z, width: J, height: Y };
796
800
  },
797
801
  [c, s]
@@ -799,77 +803,78 @@ function ke(t, e, r = b) {
799
803
  return {
800
804
  paperPx: s,
801
805
  gridPosPx: c,
802
- getColIndex: _,
803
- getRowIndex: x,
806
+ getColIndex: I,
807
+ getRowIndex: _,
804
808
  getBlockRectPx: k
805
809
  };
806
810
  }
807
- const ye = '[data-sidebar="true"]', De = { "data-sidebar": "true" };
811
+ const ye = '[data-sidebar="true"]', Pe = { "data-sidebar": "true" };
808
812
  export {
809
- de as $,
810
- ae as A,
811
- ce as B,
812
- Vt as C,
813
+ Ee as $,
814
+ ie as A,
815
+ ue as B,
816
+ T as C,
813
817
  b as D,
814
- Yt as E,
815
- ue as F,
816
- se as G,
818
+ Ft as E,
819
+ le as F,
820
+ ce as G,
817
821
  Z as H,
818
- Tt as I,
819
- me as J,
822
+ xt as I,
823
+ qt as J,
820
824
  he as K,
821
825
  At as L,
822
- h as M,
823
- _t as N,
824
- l as O,
826
+ de as M,
827
+ It as N,
828
+ h as O,
825
829
  tt as P,
826
- F as Q,
827
- T as R,
828
- De as S,
829
- ne as T,
830
+ l as Q,
831
+ V as R,
832
+ Pe as S,
833
+ x as T,
830
834
  i as U,
831
835
  Q as V,
832
- It as W,
833
- be as X,
834
- Jt as Y,
836
+ Tt as W,
837
+ oe as X,
838
+ pe as Y,
835
839
  zt as Z,
836
- Me as _,
837
- Kt as a,
838
- pe as a0,
839
- St as a1,
840
- Ft as a2,
841
- G as a3,
842
- Wt as a4,
843
- Ee as a5,
840
+ Jt as _,
841
+ Yt as a,
842
+ ge as a0,
843
+ we as a1,
844
+ St as a2,
845
+ Vt as a3,
846
+ U as a4,
847
+ Ht as a5,
844
848
  ve as a6,
845
- ye as a7,
846
- Ot as a8,
847
- Rt as a9,
848
- ge as aa,
849
- we as ab,
850
- Xt as b,
851
- rt as c,
852
- et as d,
853
- re as e,
854
- ee as f,
855
- Zt as g,
856
- pt as h,
849
+ ke as a7,
850
+ ye as a8,
851
+ Ot as a9,
852
+ Nt as aa,
853
+ be as ab,
854
+ Me as ac,
855
+ Kt as b,
856
+ Xt as c,
857
+ rt as d,
858
+ et as e,
859
+ ne as f,
860
+ re as g,
861
+ Qt as h,
857
862
  wt as i,
858
- Mt as j,
859
- Et as k,
860
- bt as l,
863
+ pt as j,
864
+ Mt as k,
865
+ Et as l,
861
866
  vt as m,
862
- Qt as n,
863
- oe as o,
867
+ bt as n,
868
+ te as o,
864
869
  Pt as p,
865
- le as q,
866
- ie as r,
867
- te as s,
868
- fe as t,
869
- ke as u,
870
- xt as v,
871
- Gt as w,
872
- Ht as x,
873
- qt as y,
874
- I as z
870
+ ae as q,
871
+ fe as r,
872
+ ee as s,
873
+ se as t,
874
+ De as u,
875
+ me as v,
876
+ _t as w,
877
+ Ut as x,
878
+ Wt as y,
879
+ Zt as z
875
880
  };