@reportwright/viewer 0.13.0 → 0.13.1

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 (85) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +4 -2
  3. package/THIRD-PARTY-NOTICES.md +1 -1
  4. package/dist/{chunk-DXHLIJEY.js → chunk-47ZAKRVN.js} +6 -6
  5. package/dist/{chunk-L6YEIVVD.js → chunk-B5ZCT3UK.js} +13 -13
  6. package/dist/chunk-CCH7CFU5.js +5026 -0
  7. package/dist/chunk-CCH7CFU5.js.map +6 -0
  8. package/dist/{chunk-CNDUJ7IV.js → chunk-ES2LYZ6S.js} +9 -6
  9. package/dist/chunk-ES2LYZ6S.js.map +6 -0
  10. package/dist/{chunk-BF7GCWZY.js → chunk-GOCWG6FG.js} +3 -3
  11. package/dist/{chunk-IFYCJZNS.js → chunk-GRYITZPG.js} +7 -7
  12. package/dist/{chunk-F5EPQTPF.js → chunk-H422SRD3.js} +8 -8
  13. package/dist/{chunk-FEM2QVOO.js → chunk-JD6EJ3LI.js} +4 -4
  14. package/dist/{chunk-QFLVVM3H.js → chunk-MS2LQC2O.js} +38 -28
  15. package/dist/chunk-MS2LQC2O.js.map +6 -0
  16. package/dist/{chunk-UHHURTSV.js → chunk-PF4RFKX2.js} +7 -7
  17. package/dist/{chunk-TZXEEVKE.js → chunk-PKXTMC4J.js} +87 -42
  18. package/dist/chunk-PKXTMC4J.js.map +6 -0
  19. package/dist/{chunk-UJL7C2AS.js → chunk-U2ZY2NPQ.js} +2 -2
  20. package/dist/{chunk-PQNM6ET7.js → chunk-WOBRKNIA.js} +12 -12
  21. package/dist/{chunk-YIX3OJXU.js → chunk-XXTAPZO4.js} +4 -4
  22. package/dist/{chunk-EK5CJY22.js → chunk-ZGRJJ6OW.js} +38 -23
  23. package/dist/{chunk-EK5CJY22.js.map → chunk-ZGRJJ6OW.js.map} +1 -1
  24. package/dist/designer.js +26 -19
  25. package/dist/designer.js.map +1 -1
  26. package/dist/engine.worker.bwip.js +51422 -0
  27. package/dist/engine.worker.bwip.js.map +6 -0
  28. package/dist/engine.worker.js +45327 -2482
  29. package/dist/engine.worker.js.map +3 -3
  30. package/dist/peer/{chunk-45GVDKP5.js → chunk-3EYYRJR4.js} +7 -7
  31. package/dist/peer/{chunk-VZHHNQYB.js → chunk-3XZY54LM.js} +87 -42
  32. package/dist/peer/chunk-3XZY54LM.js.map +6 -0
  33. package/dist/peer/{chunk-Z5II55QT.js → chunk-5RUNOIS7.js} +4 -4
  34. package/dist/peer/{chunk-2CD5COHN.js → chunk-7IP67PA6.js} +13 -13
  35. package/dist/peer/{chunk-LWXQX3NJ.js → chunk-A6UXBSTP.js} +8 -8
  36. package/dist/peer/{chunk-V42KN7HD.js → chunk-CFTFTV2O.js} +6 -6
  37. package/dist/peer/chunk-JQTRDHQP.js +866 -0
  38. package/dist/peer/chunk-JQTRDHQP.js.map +6 -0
  39. package/dist/peer/chunk-KD6CDYGE.js +5024 -0
  40. package/dist/peer/chunk-KD6CDYGE.js.map +6 -0
  41. package/dist/peer/chunk-MXR6JBMP.js +546 -0
  42. package/dist/peer/chunk-MXR6JBMP.js.map +6 -0
  43. package/dist/peer/chunk-N42DCZZA.js +378 -0
  44. package/dist/peer/chunk-N42DCZZA.js.map +6 -0
  45. package/dist/peer/{chunk-MKY3SDXU.js → chunk-RKFP7SDY.js} +9 -6
  46. package/dist/peer/chunk-RKFP7SDY.js.map +6 -0
  47. package/dist/peer/{chunk-3CBV5SAI.js → chunk-WABYQWMT.js} +12 -12
  48. package/dist/peer/chunk-WVQQCD4M.js +14211 -0
  49. package/dist/peer/chunk-WVQQCD4M.js.map +6 -0
  50. package/dist/peer/{chunk-S6LSPHSU.js → chunk-XHCRHVRK.js} +4 -4
  51. package/dist/peer/{chunk-YITWGAR4.js → chunk-ZS3J4WBH.js} +7 -7
  52. package/dist/peer/designer.js +26 -19
  53. package/dist/peer/designer.js.map +1 -1
  54. package/dist/peer/engine.worker.bwip.js +51422 -0
  55. package/dist/peer/engine.worker.bwip.js.map +6 -0
  56. package/dist/peer/engine.worker.js +45327 -2482
  57. package/dist/peer/engine.worker.js.map +3 -3
  58. package/dist/peer/viewer.js +6 -5
  59. package/dist/peer/viewer.js.map +1 -1
  60. package/dist/viewer.js +6 -5
  61. package/dist/viewer.js.map +1 -1
  62. package/package.json +1 -2
  63. package/dist/chunk-CNDUJ7IV.js.map +0 -6
  64. package/dist/chunk-QFLVVM3H.js.map +0 -6
  65. package/dist/chunk-TZXEEVKE.js.map +0 -6
  66. package/dist/peer/chunk-MKY3SDXU.js.map +0 -6
  67. package/dist/peer/chunk-VZHHNQYB.js.map +0 -6
  68. /package/dist/{chunk-DXHLIJEY.js.map → chunk-47ZAKRVN.js.map} +0 -0
  69. /package/dist/{chunk-L6YEIVVD.js.map → chunk-B5ZCT3UK.js.map} +0 -0
  70. /package/dist/{chunk-BF7GCWZY.js.map → chunk-GOCWG6FG.js.map} +0 -0
  71. /package/dist/{chunk-IFYCJZNS.js.map → chunk-GRYITZPG.js.map} +0 -0
  72. /package/dist/{chunk-F5EPQTPF.js.map → chunk-H422SRD3.js.map} +0 -0
  73. /package/dist/{chunk-FEM2QVOO.js.map → chunk-JD6EJ3LI.js.map} +0 -0
  74. /package/dist/{chunk-UHHURTSV.js.map → chunk-PF4RFKX2.js.map} +0 -0
  75. /package/dist/{chunk-UJL7C2AS.js.map → chunk-U2ZY2NPQ.js.map} +0 -0
  76. /package/dist/{chunk-PQNM6ET7.js.map → chunk-WOBRKNIA.js.map} +0 -0
  77. /package/dist/{chunk-YIX3OJXU.js.map → chunk-XXTAPZO4.js.map} +0 -0
  78. /package/dist/peer/{chunk-45GVDKP5.js.map → chunk-3EYYRJR4.js.map} +0 -0
  79. /package/dist/peer/{chunk-S6LSPHSU.js.map → chunk-5RUNOIS7.js.map} +0 -0
  80. /package/dist/peer/{chunk-2CD5COHN.js.map → chunk-7IP67PA6.js.map} +0 -0
  81. /package/dist/peer/{chunk-LWXQX3NJ.js.map → chunk-A6UXBSTP.js.map} +0 -0
  82. /package/dist/peer/{chunk-V42KN7HD.js.map → chunk-CFTFTV2O.js.map} +0 -0
  83. /package/dist/peer/{chunk-3CBV5SAI.js.map → chunk-WABYQWMT.js.map} +0 -0
  84. /package/dist/peer/{chunk-Z5II55QT.js.map → chunk-XHCRHVRK.js.map} +0 -0
  85. /package/dist/peer/{chunk-YITWGAR4.js.map → chunk-ZS3J4WBH.js.map} +0 -0
@@ -3,15 +3,15 @@ import {
3
3
  exportDocx,
4
4
  slices,
5
5
  writeDocx
6
- } from "../chunk-BF7GCWZY.js";
6
+ } from "./chunk-N42DCZZA.js";
7
7
  import "../chunk-D2NTLAKL.js";
8
8
  import "../chunk-F6RMRXIN.js";
9
- import "../chunk-UJL7C2AS.js";
10
- import "../chunk-QFLVVM3H.js";
9
+ import "./chunk-MXR6JBMP.js";
10
+ import "./chunk-JQTRDHQP.js";
11
11
  export {
12
12
  alignOf,
13
13
  exportDocx,
14
14
  slices,
15
15
  writeDocx
16
16
  };
17
- //# sourceMappingURL=chunk-S6LSPHSU.js.map
17
+ //# sourceMappingURL=chunk-XHCRHVRK.js.map
@@ -1,9 +1,6 @@
1
- import {
2
- safeUrl
3
- } from "../chunk-72S6DETS.js";
4
1
  import {
5
2
  alignOf
6
- } from "../chunk-BF7GCWZY.js";
3
+ } from "./chunk-N42DCZZA.js";
7
4
  import {
8
5
  withDeadline
9
6
  } from "../chunk-D2NTLAKL.js";
@@ -19,10 +16,13 @@ import {
19
16
  hexOrNull,
20
17
  parseColor,
21
18
  rasterize
22
- } from "../chunk-UJL7C2AS.js";
19
+ } from "./chunk-MXR6JBMP.js";
20
+ import {
21
+ safeUrl
22
+ } from "../chunk-72S6DETS.js";
23
23
  import {
24
24
  officeFamily
25
- } from "../chunk-QFLVVM3H.js";
25
+ } from "./chunk-JQTRDHQP.js";
26
26
 
27
27
  // src/exporters/pptx.js
28
28
  import { zipSync, strToU8 } from "fflate";
@@ -218,4 +218,4 @@ Lst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:so
218
218
  export {
219
219
  exportPptx
220
220
  };
221
- //# sourceMappingURL=chunk-YITWGAR4.js.map
221
+ //# sourceMappingURL=chunk-ZS3J4WBH.js.map
@@ -10,7 +10,7 @@ import {
10
10
  setShadowStyles,
11
11
  t,
12
12
  uiFontCss
13
- } from "./chunk-2CD5COHN.js";
13
+ } from "./chunk-7IP67PA6.js";
14
14
  import {
15
15
  customFonts,
16
16
  fontsBase,
@@ -21,7 +21,7 @@ import {
21
21
  setAssetBase,
22
22
  setFetchPolicy,
23
23
  setStandalone
24
- } from "./chunk-MKY3SDXU.js";
24
+ } from "./chunk-RKFP7SDY.js";
25
25
  import {
26
26
  BASE_STYLE,
27
27
  DEFAULT_THEME,
@@ -66,7 +66,7 @@ import {
66
66
  validate,
67
67
  withPartProps,
68
68
  xmlRowPaths
69
- } from "../chunk-EK5CJY22.js";
69
+ } from "./chunk-WVQQCD4M.js";
70
70
  import {
71
71
  PAGE_SIZES,
72
72
  fromPt,
@@ -74,23 +74,23 @@ import {
74
74
  resolvePage,
75
75
  toPt
76
76
  } from "../chunk-BR5K6SBL.js";
77
- import "../chunk-72S6DETS.js";
78
- import {
79
- currencyOf
80
- } from "../chunk-GJS242RR.js";
81
77
  import "../chunk-F6RMRXIN.js";
82
78
  import {
83
79
  fontFaceCss,
84
80
  fontFamilyCss,
85
81
  pageToSvg
86
- } from "../chunk-UJL7C2AS.js";
82
+ } from "./chunk-MXR6JBMP.js";
83
+ import "../chunk-72S6DETS.js";
87
84
  import {
88
85
  BUNDLED_FAMILIES,
89
86
  FONT_FAMILIES,
90
87
  allFontKeys,
91
88
  fallbackKeys,
92
89
  resolveFontKey
93
- } from "../chunk-QFLVVM3H.js";
90
+ } from "./chunk-JQTRDHQP.js";
91
+ import {
92
+ currencyOf
93
+ } from "../chunk-GJS242RR.js";
94
94
 
95
95
  // src/embed/designer.js
96
96
  import { createElement as createElement2 } from "react";
@@ -8278,8 +8278,7 @@ function duplicateSelection() {
8278
8278
  const f = findItem(d, id);
8279
8279
  if (!f) continue;
8280
8280
  const copy = cloneWithIds(f.item, used);
8281
- copy.x += PASTE_OFFSET;
8282
- copy.y += PASTE_OFFSET;
8281
+ offsetCopy(f.list, copy);
8283
8282
  growToFit(d, { ...f, item: copy });
8284
8283
  f.list.push(copy);
8285
8284
  newIds.push(copy.id);
@@ -8288,6 +8287,14 @@ function duplicateSelection() {
8288
8287
  if (newIds.length) S().select({ kind: "items", ids: newIds });
8289
8288
  }
8290
8289
  var PASTE_OFFSET = 12;
8290
+ function offsetCopy(list2, c) {
8291
+ for (const k of ["x", "y"]) if (!Number.isFinite(c[k])) c[k] = 0;
8292
+ for (let n = 0; n <= list2.length; n++) {
8293
+ c.x += PASTE_OFFSET;
8294
+ c.y += PASTE_OFFSET;
8295
+ if (!list2.some((i2) => i2 !== c && i2.x === c.x && i2.y === c.y)) return;
8296
+ }
8297
+ }
8291
8298
  var CLIP = "pagewright/items@1";
8292
8299
  async function copySelection() {
8293
8300
  const { sel, def } = S();
@@ -8319,9 +8326,8 @@ function pasteItems(section = "body", text = null) {
8319
8326
  const used = allNames(d);
8320
8327
  for (const it of data.items) {
8321
8328
  const c = cloneWithIds(it, used);
8322
- c.x += PASTE_OFFSET;
8323
- c.y += PASTE_OFFSET;
8324
8329
  if (c.type === "table" && !isBodyKey(section)) continue;
8330
+ offsetCopy(secOf(d, section).items, c);
8325
8331
  secOf(d, section).items.push(c);
8326
8332
  growToFit(d, { section, parent: null, item: c });
8327
8333
  ids.push(c.id);
@@ -33113,8 +33119,8 @@ function Outline() {
33113
33119
  const stop = keys.includes(cur2) ? cur2 : keys.find((k) => chosen.has(k) || sel.kind === "section" && k === `band:${sel.section}`) || keys[0];
33114
33120
  const roving = (k) => ({ tabIndex: k === stop ? 0 : -1, onFocus: () => setCur(k) });
33115
33121
  const nav2 = (e) => {
33116
- if (e.defaultPrevented || e.altKey || e.metaKey || e.ctrlKey || e.target.getAttribute("role") !== "option") return;
33117
- const all = [...e.currentTarget.querySelectorAll("[role=option]")];
33122
+ if (e.defaultPrevented || e.altKey || e.metaKey || e.ctrlKey || !e.target.hasAttribute("data-opt")) return;
33123
+ const all = [...e.currentTarget.querySelectorAll("[data-opt]")];
33118
33124
  const i2 = all.indexOf(e.target);
33119
33125
  const j = e.key === "ArrowDown" ? i2 + 1 : e.key === "ArrowUp" ? i2 - 1 : e.key === "Home" ? 0 : e.key === "End" ? all.length - 1 : null;
33120
33126
  if (j == null) return;
@@ -33235,7 +33241,7 @@ function Outline() {
33235
33241
  return /* @__PURE__ */ jsxs11("li", { role: "none", children: [
33236
33242
  /* @__PURE__ */ jsxs11("div", { className: `trow outline-row${chosen.has(it.id) ? " sel" : ""}${mark}`, style: { paddingInlineStart: depth * 14 }, "data-outline": it.name, "data-outline-id": it.id, ...dragProps(it, i2, parent, section), children: [
33237
33243
  !readOnly2 && /* @__PURE__ */ jsx14("span", { className: "grip", "aria-hidden": "true", children: "⠿" }),
33238
- /* @__PURE__ */ jsx14("button", { type: "button", role: "option", className: "linklike nm", onClick: (e) => pick(e, it.id), onKeyDown: (e) => onKey(e, it, list2, i2, parent), "aria-selected": chosen.has(it.id), "aria-describedby": readOnly2 ? "outline-nav" : "outline-nav outline-keys", ...roving(it.id), children: it.name }),
33244
+ /* @__PURE__ */ jsx14("button", { type: "button", "data-opt": "", className: "linklike nm", onClick: (e) => pick(e, it.id), onKeyDown: (e) => onKey(e, it, list2, i2, parent), "aria-pressed": chosen.has(it.id), "aria-describedby": readOnly2 ? "outline-nav" : "outline-nav outline-keys", ...roving(it.id), children: it.name }),
33239
33245
  /* @__PURE__ */ jsx14("span", { className: "ty", children: T(`item_${it.type}`) === `item_${it.type}` ? ITEMS[it.type]?.label || it.type : T(`item_${it.type}`) }),
33240
33246
  !readOnly2 && /* @__PURE__ */ jsxs11("span", { className: "act", style: { display: "inline-flex", gap: 2 }, children: [
33241
33247
  /* @__PURE__ */ jsx14("button", { type: "button", className: "btn sm ghost icon", tabIndex: -1, disabled: i2 === 0, onClick: () => reorderItem(it.id, -1), title: T("outlineBackward"), "aria-label": `${T("outlineBackward")}: ${it.name}`, children: "↑" }),
@@ -33249,10 +33255,10 @@ function Outline() {
33249
33255
  return /* @__PURE__ */ jsxs11("div", { className: "pane", "data-testid": "outline", children: [
33250
33256
  /* @__PURE__ */ jsx14("h4", { children: T("outline") }),
33251
33257
  /* @__PURE__ */ jsxs11("div", { className: "pane-body", ref: body, children: [
33252
- /* @__PURE__ */ jsx14("div", { role: "listbox", "aria-label": T("outline"), "aria-multiselectable": "true", onKeyDown: nav2, children: sectionList(def).map(({ key: key2, label }) => {
33258
+ /* @__PURE__ */ jsx14("div", { role: "group", "aria-label": T("outline"), onKeyDown: nav2, children: sectionList(def).map(({ key: key2, label }) => {
33253
33259
  const items = secOf(def, key2)?.items || [];
33254
33260
  return /* @__PURE__ */ jsxs11("div", { role: "group", "aria-label": label, className: `outline-sec${drop?.band === key2 ? " drop-band" : ""}`, "data-outline-band": key2, ...bandDrop(key2), children: [
33255
- /* @__PURE__ */ jsx14("button", { type: "button", role: "option", "aria-selected": sel.kind === "section" && sel.section === key2, "aria-describedby": "outline-nav", className: `linklike outline-band${sel.kind === "section" && sel.section === key2 ? " sel" : ""}`, onClick: () => useDesigner.getState().select({ kind: "section", section: key2 }), ...roving(`band:${key2}`), children: /* @__PURE__ */ jsx14(
33261
+ /* @__PURE__ */ jsx14("button", { type: "button", "data-opt": "", "aria-pressed": sel.kind === "section" && sel.section === key2, "aria-describedby": "outline-nav", className: `linklike outline-band${sel.kind === "section" && sel.section === key2 ? " sel" : ""}`, onClick: () => useDesigner.getState().select({ kind: "section", section: key2 }), ...roving(`band:${key2}`), children: /* @__PURE__ */ jsx14(
33256
33262
  "b", { children: label }) }),
33257
33263
  /* @__PURE__ */ jsx14("ul", { className: "tree", role: "none", children: items.length ? rows(items, null, 1, key2) : /* @__PURE__ */ jsx14("li", { className: "subtle", role: "none", children: T("outlineEmpty") }) })
33258
33264
  ] }, key2);
@@ -34355,7 +34361,7 @@ function LeftRail({ T, readOnly: readOnly2, embed }) {
34355
34361
  const el = body.current?.querySelector(`[data-rail="${id}"]`);
34356
34362
  if (el) {
34357
34363
  body.current.scrollTo({ top: el.offsetTop - body.current.offsetTop, behavior: "smooth" });
34358
- (el.querySelector('[role=listbox] [tabindex="0"]') || el.querySelector("button, input, select, textarea"))?.focus({ preventScroll: true });
34364
+ (el.querySelector('[data-opt][tabindex="0"]') || el.querySelector("button, input, select, textarea"))?.focus({ preventScroll: true });
34359
34365
  }
34360
34366
  setAt(id);
34361
34367
  };
@@ -35428,6 +35434,7 @@ a.cell-name:hover { color: var(--accent); }
35428
35434
  .outline-row.sel { background: var(--accent-soft); }
35429
35435
  .outline-row .linklike.nm, .outline-band { text-decoration: none; color: var(--ink); text-align: start; }
35430
35436
  .outline-row.sel .linklike.nm, .outline-band.sel { color: var(--accent); }
35437
+ .outline-row.sel .ty { color: var(--muted); } /* --faint is 4.38:1 on --accent-soft; --muted passes in both themes */
35431
35438
  .outline-row.sel .act, .outline-row:focus-within .act { opacity: 1; }
35432
35439
  .outline-row[draggable="true"] { cursor: grab; }
35433
35440
  .outline-row .grip { color: var(--faint); font-size: 10px; line-height: 1; margin-inline-start: -2px; opacity: .55; }