@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
package/dist/designer.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  setShadowStyles,
14
14
  t,
15
15
  uiFontCss
16
- } from "./chunk-L6YEIVVD.js";
16
+ } from "./chunk-B5ZCT3UK.js";
17
17
  import {
18
18
  customFonts,
19
19
  fontsBase,
@@ -24,7 +24,7 @@ import {
24
24
  setAssetBase,
25
25
  setFetchPolicy,
26
26
  setStandalone
27
- } from "./chunk-CNDUJ7IV.js";
27
+ } from "./chunk-ES2LYZ6S.js";
28
28
  import {
29
29
  BASE_STYLE,
30
30
  DEFAULT_THEME,
@@ -69,7 +69,7 @@ import {
69
69
  validate,
70
70
  withPartProps,
71
71
  xmlRowPaths
72
- } from "./chunk-EK5CJY22.js";
72
+ } from "./chunk-ZGRJJ6OW.js";
73
73
  import {
74
74
  PAGE_SIZES,
75
75
  fromPt,
@@ -77,23 +77,23 @@ import {
77
77
  resolvePage,
78
78
  toPt
79
79
  } from "./chunk-BR5K6SBL.js";
80
- import "./chunk-72S6DETS.js";
81
- import {
82
- currencyOf
83
- } from "./chunk-GJS242RR.js";
84
80
  import "./chunk-F6RMRXIN.js";
85
81
  import {
86
82
  fontFaceCss,
87
83
  fontFamilyCss,
88
84
  pageToSvg
89
- } from "./chunk-UJL7C2AS.js";
85
+ } from "./chunk-U2ZY2NPQ.js";
86
+ import "./chunk-72S6DETS.js";
90
87
  import {
91
88
  BUNDLED_FAMILIES,
92
89
  FONT_FAMILIES,
93
90
  allFontKeys,
94
91
  fallbackKeys,
95
92
  resolveFontKey
96
- } from "./chunk-QFLVVM3H.js";
93
+ } from "./chunk-MS2LQC2O.js";
94
+ import {
95
+ currencyOf
96
+ } from "./chunk-GJS242RR.js";
97
97
  import {
98
98
  __toESM
99
99
  } from "./chunk-OLLMACWA.js";
@@ -8284,8 +8284,7 @@ function duplicateSelection() {
8284
8284
  const f = findItem(d, id);
8285
8285
  if (!f) continue;
8286
8286
  const copy = cloneWithIds(f.item, used);
8287
- copy.x += PASTE_OFFSET;
8288
- copy.y += PASTE_OFFSET;
8287
+ offsetCopy(f.list, copy);
8289
8288
  growToFit(d, { ...f, item: copy });
8290
8289
  f.list.push(copy);
8291
8290
  newIds.push(copy.id);
@@ -8294,6 +8293,14 @@ function duplicateSelection() {
8294
8293
  if (newIds.length) S().select({ kind: "items", ids: newIds });
8295
8294
  }
8296
8295
  var PASTE_OFFSET = 12;
8296
+ function offsetCopy(list2, c) {
8297
+ for (const k of ["x", "y"]) if (!Number.isFinite(c[k])) c[k] = 0;
8298
+ for (let n = 0; n <= list2.length; n++) {
8299
+ c.x += PASTE_OFFSET;
8300
+ c.y += PASTE_OFFSET;
8301
+ if (!list2.some((i2) => i2 !== c && i2.x === c.x && i2.y === c.y)) return;
8302
+ }
8303
+ }
8297
8304
  var CLIP = "pagewright/items@1";
8298
8305
  async function copySelection() {
8299
8306
  const { sel, def } = S();
@@ -8325,9 +8332,8 @@ function pasteItems(section = "body", text = null) {
8325
8332
  const used = allNames(d);
8326
8333
  for (const it of data.items) {
8327
8334
  const c = cloneWithIds(it, used);
8328
- c.x += PASTE_OFFSET;
8329
- c.y += PASTE_OFFSET;
8330
8335
  if (c.type === "table" && !isBodyKey(section)) continue;
8336
+ offsetCopy(secOf(d, section).items, c);
8331
8337
  secOf(d, section).items.push(c);
8332
8338
  growToFit(d, { section, parent: null, item: c });
8333
8339
  ids.push(c.id);
@@ -33133,8 +33139,8 @@ function Outline() {
33133
33139
  const stop = keys.includes(cur2) ? cur2 : keys.find((k) => chosen.has(k) || sel.kind === "section" && k === `band:${sel.section}`) || keys[0];
33134
33140
  const roving = (k) => ({ tabIndex: k === stop ? 0 : -1, onFocus: () => setCur(k) });
33135
33141
  const nav2 = (e) => {
33136
- if (e.defaultPrevented || e.altKey || e.metaKey || e.ctrlKey || e.target.getAttribute("role") !== "option") return;
33137
- const all = [...e.currentTarget.querySelectorAll("[role=option]")];
33142
+ if (e.defaultPrevented || e.altKey || e.metaKey || e.ctrlKey || !e.target.hasAttribute("data-opt")) return;
33143
+ const all = [...e.currentTarget.querySelectorAll("[data-opt]")];
33138
33144
  const i2 = all.indexOf(e.target);
33139
33145
  const j = e.key === "ArrowDown" ? i2 + 1 : e.key === "ArrowUp" ? i2 - 1 : e.key === "Home" ? 0 : e.key === "End" ? all.length - 1 : null;
33140
33146
  if (j == null) return;
@@ -33255,7 +33261,7 @@ function Outline() {
33255
33261
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("li", { role: "none", children: [
33256
33262
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("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: [
33257
33263
  !readOnly2 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "grip", "aria-hidden": "true", children: "⠿" }),
33258
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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 }),
33264
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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 }),
33259
33265
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ty", children: T(`item_${it.type}`) === `item_${it.type}` ? ITEMS[it.type]?.label || it.type : T(`item_${it.type}`) }),
33260
33266
  !readOnly2 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "act", style: { display: "inline-flex", gap: 2 }, children: [
33261
33267
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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: "↑" }),
@@ -33269,10 +33275,10 @@ function Outline() {
33269
33275
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "pane", "data-testid": "outline", children: [
33270
33276
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h4", { children: T("outline") }),
33271
33277
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "pane-body", ref: body, children: [
33272
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { role: "listbox", "aria-label": T("outline"), "aria-multiselectable": "true", onKeyDown: nav2, children: sectionList(def).map(({ key: key2, label }) => {
33278
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { role: "group", "aria-label": T("outline"), onKeyDown: nav2, children: sectionList(def).map(({ key: key2, label }) => {
33273
33279
  const items = secOf(def, key2)?.items || [];
33274
33280
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { role: "group", "aria-label": label, className: `outline-sec${drop?.band === key2 ? " drop-band" : ""}`, "data-outline-band": key2, ...bandDrop(key2), children: [
33275
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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}`),
33281
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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}`),
33276
33282
  children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: label }) }),
33277
33283
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: "tree", role: "none", children: items.length ? rows(items, null, 1, key2) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { className: "subtle", role: "none", children: T("outlineEmpty") }) })
33278
33284
  ] }, key2);
@@ -34378,7 +34384,7 @@ function LeftRail({ T, readOnly: readOnly2, embed }) {
34378
34384
  const el = body.current?.querySelector(`[data-rail="${id}"]`);
34379
34385
  if (el) {
34380
34386
  body.current.scrollTo({ top: el.offsetTop - body.current.offsetTop, behavior: "smooth" });
34381
- (el.querySelector('[role=listbox] [tabindex="0"]') || el.querySelector("button, input, select, textarea"))?.focus({ preventScroll: true });
34387
+ (el.querySelector('[data-opt][tabindex="0"]') || el.querySelector("button, input, select, textarea"))?.focus({ preventScroll: true });
34382
34388
  }
34383
34389
  setAt(id);
34384
34390
  };
@@ -35452,6 +35458,7 @@ a.cell-name:hover { color: var(--accent); }
35452
35458
  .outline-row.sel { background: var(--accent-soft); }
35453
35459
  .outline-row .linklike.nm, .outline-band { text-decoration: none; color: var(--ink); text-align: start; }
35454
35460
  .outline-row.sel .linklike.nm, .outline-band.sel { color: var(--accent); }
35461
+ .outline-row.sel .ty { color: var(--muted); } /* --faint is 4.38:1 on --accent-soft; --muted passes in both themes */
35455
35462
  .outline-row.sel .act, .outline-row:focus-within .act { opacity: 1; }
35456
35463
  .outline-row[draggable="true"] { cursor: grab; }
35457
35464
  .outline-row .grip { color: var(--faint); font-size: 10px; line-height: 1; margin-inline-start: -2px; opacity: .55; }