@silurus/ooxml 0.76.1 → 0.76.2

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.
@@ -4695,7 +4695,7 @@ var Ha = class {
4695
4695
  anchorCell = null;
4696
4696
  activeCell = null;
4697
4697
  selectionMode = "cells";
4698
- dragActive = !1;
4698
+ dragPointerId = null;
4699
4699
  get anchor() {
4700
4700
  return this.anchorCell ? { ...this.anchorCell } : null;
4701
4701
  }
@@ -4706,7 +4706,10 @@ var Ha = class {
4706
4706
  return this.selectionMode;
4707
4707
  }
4708
4708
  get dragging() {
4709
- return this.dragActive;
4709
+ return this.dragPointerId !== null;
4710
+ }
4711
+ get draggingPointerId() {
4712
+ return this.dragPointerId;
4710
4713
  }
4711
4714
  setAnchor(e) {
4712
4715
  this.anchorCell = e ? { ...e } : null;
@@ -4717,11 +4720,14 @@ var Ha = class {
4717
4720
  setMode(e) {
4718
4721
  this.selectionMode = e;
4719
4722
  }
4720
- setDragging(e) {
4721
- this.dragActive = e;
4723
+ beginDrag(e) {
4724
+ this.dragPointerId = e;
4725
+ }
4726
+ endDrag(e) {
4727
+ (e === void 0 || e === this.dragPointerId) && (this.dragPointerId = null);
4722
4728
  }
4723
4729
  reset() {
4724
- this.anchorCell = null, this.activeCell = null, this.selectionMode = "cells", this.dragActive = !1;
4730
+ this.anchorCell = null, this.activeCell = null, this.selectionMode = "cells", this.dragPointerId = null;
4725
4731
  }
4726
4732
  select(e, t = "cells") {
4727
4733
  this.anchorCell = { ...e }, this.activeCell = { ...e }, this.selectionMode = t;
@@ -4866,32 +4872,51 @@ var Ha = class {
4866
4872
  showValidation(e, t) {
4867
4873
  this.validation.style.left = `${e}px`, this.validation.style.top = `${t}px`, this.validation.style.display = "block";
4868
4874
  }
4869
- }, qa = Symbol("XlsxViewer.borrowedWorkbook"), Ja = 150, Ya = 280, Xa = 200, Za = 240, Qa = 200, $a = 30, eo = 50, to = 1, no = 1, ro = .45, io = "data-xlsx-viewer-styles", ao = ".xlsx-tab-strip::-webkit-scrollbar{display:none}.xlsx-tab-nav{background:transparent;transition:background 0.1s;}.xlsx-tab-nav:hover{background:rgba(0,0,0,0.08);}.xlsx-zoom-slider{-webkit-appearance:none;appearance:none;background:transparent;height:15px;margin:0;}.xlsx-zoom-slider::-webkit-slider-runnable-track{height:4px;background:#c4c4c4;border-radius:2px;}.xlsx-zoom-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:12px;height:12px;margin-top:-4px;border-radius:50%;background:#808080;cursor:pointer;}.xlsx-zoom-slider:hover::-webkit-slider-thumb{background:#5f5f5f;}.xlsx-zoom-slider::-moz-range-track{height:4px;background:#c4c4c4;border-radius:2px;}.xlsx-zoom-slider::-moz-range-thumb{width:12px;height:12px;border:none;border-radius:50%;background:#808080;cursor:pointer;}";
4870
- function oo(e) {
4871
- if (!e.head || e.head.querySelector(`style[${io}]`)) return;
4875
+ };
4876
+ function qa(e, t) {
4877
+ if (t <= 0) return 0;
4878
+ let n = Math.min(40, t / 2);
4879
+ return e < n ? -900 * Math.min(1, Math.max(0, (n - e) / n)) : e > t - n ? 900 * Math.min(1, Math.max(0, (e - (t - n)) / n)) : 0;
4880
+ }
4881
+ function Ja(e, t, n, r) {
4882
+ if (r === "all") return {
4883
+ x: 0,
4884
+ y: 0
4885
+ };
4886
+ let i = r === "rows" ? 0 : qa(e.x, t.width), a = r === "cols" ? 0 : qa(e.y, t.height);
4887
+ return {
4888
+ x: n ? -i : i,
4889
+ y: a
4890
+ };
4891
+ }
4892
+ //#endregion
4893
+ //#region packages/xlsx/src/viewer.ts
4894
+ var Ya = Symbol("XlsxViewer.borrowedWorkbook"), Xa = 150, Za = 280, Qa = 200, $a = 240, eo = 200, to = 30, no = 50, ro = 1, io = 1, ao = .45, oo = "data-xlsx-viewer-styles", so = ".xlsx-tab-strip::-webkit-scrollbar{display:none}.xlsx-tab-nav{background:transparent;transition:background 0.1s;}.xlsx-tab-nav:hover{background:rgba(0,0,0,0.08);}.xlsx-zoom-slider{-webkit-appearance:none;appearance:none;background:transparent;height:15px;margin:0;}.xlsx-zoom-slider::-webkit-slider-runnable-track{height:4px;background:#c4c4c4;border-radius:2px;}.xlsx-zoom-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:12px;height:12px;margin-top:-4px;border-radius:50%;background:#808080;cursor:pointer;}.xlsx-zoom-slider:hover::-webkit-slider-thumb{background:#5f5f5f;}.xlsx-zoom-slider::-moz-range-track{height:4px;background:#c4c4c4;border-radius:2px;}.xlsx-zoom-slider::-moz-range-thumb{width:12px;height:12px;border:none;border-radius:50%;background:#808080;cursor:pointer;}";
4895
+ function co(e) {
4896
+ if (!e.head || e.head.querySelector(`style[${oo}]`)) return;
4872
4897
  let t = e.createElement("style");
4873
- t.setAttribute(io, ""), t.textContent = ao, e.head.appendChild(t);
4898
+ t.setAttribute(oo, ""), t.textContent = so, e.head.appendChild(t);
4874
4899
  }
4875
- var so = "#1a73e8", co = 4, lo = 5;
4876
- function uo(e, t, n, r) {
4900
+ var lo = "#1a73e8", uo = 4, fo = 5;
4901
+ function po(e, t, n, r) {
4877
4902
  for (let { index: i, edge: a } of t) if (!(a <= r) && Math.abs(e - a) <= n) return i;
4878
4903
  return null;
4879
4904
  }
4880
- function fo(e) {
4905
+ function mo(e) {
4881
4906
  return {
4882
4907
  border: `2px solid ${e}`,
4883
4908
  background: `color-mix(in srgb, ${e} 8%, transparent)`
4884
4909
  };
4885
4910
  }
4886
- var po = "color-mix(in srgb, #ffb300 8%, transparent)", mo = "color-mix(in srgb, #fb8c00 8%, transparent)";
4887
- function ho(e, t = {}) {
4888
- let n = e ? "#fb8c00" : "#ffb300", r = e ? t.active : t.match, i = r ?? (e ? mo : po);
4911
+ var ho = "color-mix(in srgb, #ffb300 8%, transparent)", go = "color-mix(in srgb, #fb8c00 8%, transparent)";
4912
+ function _o(e, t = {}) {
4913
+ let n = e ? "#fb8c00" : "#ffb300", r = e ? t.active : t.match, i = r ?? (e ? go : ho);
4889
4914
  return {
4890
4915
  border: `2px solid ${r ?? n}`,
4891
4916
  background: i
4892
4917
  };
4893
4918
  }
4894
- var go = class {
4919
+ var vo = class {
4895
4920
  hostDocument;
4896
4921
  hostWindow;
4897
4922
  acquisition = new Ba();
@@ -4914,7 +4939,7 @@ var go = class {
4914
4939
  stashedRowHeights = /* @__PURE__ */ new Map();
4915
4940
  stashedColWidths = /* @__PURE__ */ new Map();
4916
4941
  sizeOverrideStore = /* @__PURE__ */ new Map();
4917
- projectionId = no++;
4942
+ projectionId = io++;
4918
4943
  canvasArea;
4919
4944
  scrollHost;
4920
4945
  spacer;
@@ -4938,6 +4963,7 @@ var go = class {
4938
4963
  sheetViews = /* @__PURE__ */ new Map();
4939
4964
  opts;
4940
4965
  _mountKind;
4966
+ _nativeScrollbars;
4941
4967
  _mode;
4942
4968
  _borrowed = !1;
4943
4969
  preparedWorkbook = null;
@@ -4965,8 +4991,11 @@ var go = class {
4965
4991
  get isSelecting() {
4966
4992
  return this.selectionController.dragging;
4967
4993
  }
4968
- set isSelecting(e) {
4969
- this.selectionController.setDragging(e);
4994
+ get selectionPointerId() {
4995
+ return this.selectionController.draggingPointerId;
4996
+ }
4997
+ beginSelectionDrag(e) {
4998
+ this.pendingTap?.pointerId !== e && (this.pendingTap = null), this.pendingClick?.pointerId !== e && (this.pendingClick = null), this.selectionController.beginDrag(e);
4970
4999
  }
4971
5000
  _pendingZoomAnchor = null;
4972
5001
  selectionController = new Wa();
@@ -4977,6 +5006,9 @@ var go = class {
4977
5006
  pendingTap = null;
4978
5007
  pendingClick = null;
4979
5008
  resizeDrag = null;
5009
+ selectionAutoScrollPointer = null;
5010
+ selectionAutoScrollFrame = null;
5011
+ selectionAutoScrollLastTime = null;
4980
5012
  commentPopup;
4981
5013
  commentMap = /* @__PURE__ */ new Map();
4982
5014
  hyperlinkMap = /* @__PURE__ */ new Map();
@@ -4991,21 +5023,21 @@ var go = class {
4991
5023
  this.hostDocument = (n.kind === "sheet" ? n.canvas.ownerDocument : e.ownerDocument) ?? document;
4992
5024
  let r = this.hostDocument.defaultView;
4993
5025
  if (!r) throw Error("XlsxViewer requires a document with an active Window");
4994
- this.hostWindow = r, this.opts = t, this._mountKind = n.kind;
4995
- let i = t[qa];
5026
+ this.hostWindow = r, this.opts = t, this._mountKind = n.kind, this._nativeScrollbars = t.showScrollbars ?? !0;
5027
+ let i = t[Ya];
4996
5028
  this._borrowed = i !== void 0, this._mode = n.kind === "sheet" ? n.mode : we("XlsxViewer", t.mode, i), this._hiddenSheetMode = t.hiddenSheetMode ?? "show", this.viewport = new Ha(t.cellScale ?? 1), this.wrapper = this.hostDocument.createElement("div"), this.wrapper.style.cssText = `position:relative;width:100%;height:100%;background:${n.kind === "composite" ? "#fff" : "transparent"};box-sizing:border-box;font-family:sans-serif;display:flex;flex-direction:column;`, this.gridRegion = this.hostDocument.createElement("div"), this.gridRegion.style.cssText = "position:relative;flex:1;min-height:0;overflow:hidden;";
4997
5029
  let a = "position:absolute;top:0;left:0;z-index:3;display:none;background:#f5f5f5;";
4998
- if (this.cornerGutter = this.hostDocument.createElement("canvas"), this.cornerGutter.style.cssText = a, this.cornerGutter.setAttribute("data-xlsx-outline", "corner"), this.colGutter = this.hostDocument.createElement("canvas"), this.colGutter.style.cssText = a, this.colGutter.setAttribute("data-xlsx-outline", "col"), this.rowGutter = this.hostDocument.createElement("canvas"), this.rowGutter.style.cssText = a, this.rowGutter.setAttribute("data-xlsx-outline", "row"), this.canvasArea = this.hostDocument.createElement("div"), this.canvasArea.style.cssText = "position:absolute;inset:0;overflow:hidden;", this.canvas = n.kind === "sheet" ? n.canvas : this.hostDocument.createElement("canvas"), this.canvas.style.cssText = "position:absolute;top:0;left:0;z-index:0;display:block;", this.renderDispatcher = new Ua(this.canvas, this._mode === "worker", this.hostWindow), this.scrollHost = this.hostDocument.createElement("div"), this.scrollHost.setAttribute("data-xlsx-viewport-input", n.kind), this.scrollHost.style.cssText = `position:absolute;inset:0;overflow:${n.kind === "composite" ? "auto" : "clip"};z-index:2;background:transparent;`, this.spacer = this.hostDocument.createElement("div"), this.spacer.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;", n.kind === "composite" && this.scrollHost.appendChild(this.spacer), this.surface = new Ga(this.canvas, this.canvasArea, this.scrollHost), this.overlayHost = new Ka(this.canvasArea, this.canvas, this.scrollHost, {
4999
- commentMaxWidth: Ya,
5000
- commentMaxHeight: Xa,
5001
- validationMaxWidth: Za,
5002
- validationMaxHeight: Qa
5003
- }), this.selectionOverlay = this.overlayHost.selection, this.findOverlay = this.overlayHost.find, this.commentPopup = this.overlayHost.comment, this.validationPanel = this.overlayHost.validation, oo(this.hostDocument), n.kind === "composite") {
5004
- this.tabBar = this.hostDocument.createElement("div"), this.tabBar.style.cssText = `display:flex;align-items:flex-end;height:${$a}px;flex-shrink:0;background:#f0f0f0;border-top:1px solid #c8ccd0;`, this.navPrev = this.makeNavButton("◀", "Scroll tabs left", () => this.scrollTabs(-1)), this.navNext = this.makeNavButton("▶", "Scroll tabs right", () => this.scrollTabs(1)), this.navPrev.dataset.xlsxTabNav = "prev", this.navNext.dataset.xlsxTabNav = "next";
5030
+ if (this.cornerGutter = this.hostDocument.createElement("canvas"), this.cornerGutter.style.cssText = a, this.cornerGutter.setAttribute("data-xlsx-outline", "corner"), this.colGutter = this.hostDocument.createElement("canvas"), this.colGutter.style.cssText = a, this.colGutter.setAttribute("data-xlsx-outline", "col"), this.rowGutter = this.hostDocument.createElement("canvas"), this.rowGutter.style.cssText = a, this.rowGutter.setAttribute("data-xlsx-outline", "row"), this.canvasArea = this.hostDocument.createElement("div"), this.canvasArea.style.cssText = "position:absolute;inset:0;overflow:hidden;", this.canvas = n.kind === "sheet" ? n.canvas : this.hostDocument.createElement("canvas"), this.canvas.style.cssText = "position:absolute;top:0;left:0;z-index:0;display:block;", this.renderDispatcher = new Ua(this.canvas, this._mode === "worker", this.hostWindow), this.scrollHost = this.hostDocument.createElement("div"), this.scrollHost.setAttribute("data-xlsx-viewport-input", n.kind), this.scrollHost.style.cssText = `position:absolute;inset:0;overflow:${this._nativeScrollbars ? "auto" : "clip"};z-index:2;background:transparent;`, this.spacer = this.hostDocument.createElement("div"), this.spacer.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;", this._nativeScrollbars && this.scrollHost.appendChild(this.spacer), this.surface = new Ga(this.canvas, this.canvasArea, this.scrollHost), this.overlayHost = new Ka(this.canvasArea, this.canvas, this.scrollHost, {
5031
+ commentMaxWidth: Za,
5032
+ commentMaxHeight: Qa,
5033
+ validationMaxWidth: $a,
5034
+ validationMaxHeight: eo
5035
+ }), this.selectionOverlay = this.overlayHost.selection, this.findOverlay = this.overlayHost.find, this.commentPopup = this.overlayHost.comment, this.validationPanel = this.overlayHost.validation, co(this.hostDocument), n.kind === "composite") {
5036
+ this.tabBar = this.hostDocument.createElement("div"), this.tabBar.style.cssText = `display:flex;align-items:flex-end;height:${to}px;flex-shrink:0;background:#f0f0f0;border-top:1px solid #c8ccd0;`, this.navPrev = this.makeNavButton("◀", "Scroll tabs left", () => this.scrollTabs(-1)), this.navNext = this.makeNavButton("▶", "Scroll tabs right", () => this.scrollTabs(1)), this.navPrev.dataset.xlsxTabNav = "prev", this.navNext.dataset.xlsxTabNav = "next";
5005
5037
  let e = this.hostDocument.createElement("div");
5006
- e.style.cssText = `display:flex;flex-shrink:0;width:${eo}px;height:100%;`, e.appendChild(this.navPrev), e.appendChild(this.navNext), this.tabStrip = this.hostDocument.createElement("div"), this.tabStrip.style.cssText = `position:relative;display:block;flex:1;min-width:0;height:100%;margin-left:${to}px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;`, this.tabStrip.classList.add("xlsx-tab-strip"), this.tabStrip.addEventListener("scroll", () => this.updateNavButtons()), this.tabList = this.hostDocument.createElement("div"), this.tabList.style.cssText = `display:flex;align-items:flex-end;height:100%;gap:${to}px;box-sizing:border-box;`, this.tabList.style.width = "max-content", this.tabList.style.minWidth = "100%", this.tabStrip.appendChild(this.tabList), this.tabBar.appendChild(e), this.tabBar.appendChild(this.tabStrip), this.opts.showZoomSlider !== !1 && this.tabBar.appendChild(this.buildZoomControl());
5038
+ e.style.cssText = `display:flex;flex-shrink:0;width:${no}px;height:100%;`, e.appendChild(this.navPrev), e.appendChild(this.navNext), this.tabStrip = this.hostDocument.createElement("div"), this.tabStrip.style.cssText = `position:relative;display:block;flex:1;min-width:0;height:100%;margin-left:${ro}px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;`, this.tabStrip.classList.add("xlsx-tab-strip"), this.tabStrip.addEventListener("scroll", () => this.updateNavButtons()), this.tabList = this.hostDocument.createElement("div"), this.tabList.style.cssText = `display:flex;align-items:flex-end;height:100%;gap:${ro}px;box-sizing:border-box;`, this.tabList.style.width = "max-content", this.tabList.style.minWidth = "100%", this.tabStrip.appendChild(this.tabList), this.tabBar.appendChild(e), this.tabBar.appendChild(this.tabStrip), this.opts.showZoomSlider !== !1 && this.tabBar.appendChild(this.buildZoomControl());
5007
5039
  }
5008
- this.gridRegion.appendChild(this.canvasArea), this.wrapper.appendChild(this.gridRegion), n.kind === "composite" && this.wrapper.appendChild(this.tabBar), e.appendChild(this.wrapper), this.rowGutter.addEventListener("pointerdown", (e) => this.onGutterPointerDown(e, "row")), this.colGutter.addEventListener("pointerdown", (e) => this.onGutterPointerDown(e, "col")), n.kind === "composite" && this.surface.on("scroll", () => {
5040
+ this.gridRegion.appendChild(this.canvasArea), this.wrapper.appendChild(this.gridRegion), n.kind === "composite" && this.wrapper.appendChild(this.tabBar), e.appendChild(this.wrapper), this.rowGutter.addEventListener("pointerdown", (e) => this.onGutterPointerDown(e, "row")), this.colGutter.addEventListener("pointerdown", (e) => this.onGutterPointerDown(e, "col")), this._nativeScrollbars && this.surface.on("scroll", () => {
5009
5041
  if (this.pendingTap = null, this.hideCommentPopup(), this.hideValidationPanel(), this.scrollHost.clientWidth > 0) {
5010
5042
  let e = this.scrollHost.scrollLeft, t = this.isRtl ? this.maxScrollLeft - e : e;
5011
5043
  this.viewport.setViewportSize(this.scrollHost.clientWidth, this.scrollHost.clientHeight), this.viewport.setOffset(t, this.scrollHost.scrollTop);
@@ -5292,7 +5324,7 @@ var go = class {
5292
5324
  return this.currentWorksheet?.rightToLeft === !0;
5293
5325
  }
5294
5326
  updateFooterDirection() {
5295
- this._mountKind === "composite" && (this.tabBar.style.flexDirection = this.isRtl ? "row-reverse" : "row", this.tabStrip.style.marginLeft = this.isRtl ? "0" : `${to}px`, this.tabStrip.style.marginRight = this.isRtl ? `${to}px` : "0", this.tabList.style.flexDirection = this.isRtl ? "row-reverse" : "row");
5327
+ this._mountKind === "composite" && (this.tabBar.style.flexDirection = this.isRtl ? "row-reverse" : "row", this.tabStrip.style.marginLeft = this.isRtl ? "0" : `${ro}px`, this.tabStrip.style.marginRight = this.isRtl ? `${ro}px` : "0", this.tabList.style.flexDirection = this.isRtl ? "row-reverse" : "row");
5296
5328
  }
5297
5329
  get maxScrollLeft() {
5298
5330
  return this.syncNativeViewportExtent(), this.viewport.maxX;
@@ -5301,16 +5333,16 @@ var go = class {
5301
5333
  return this.syncNativeViewportExtent(), this.viewport.maxY;
5302
5334
  }
5303
5335
  syncNativeViewportExtent() {
5304
- this._mountKind === "composite" && (this.viewport.setViewportSize(this.scrollHost.clientWidth, this.scrollHost.clientHeight), this.viewport.ensureExtent(this.scrollHost.scrollWidth, this.scrollHost.scrollHeight));
5336
+ this._nativeScrollbars && (this.viewport.setViewportSize(this.scrollHost.clientWidth, this.scrollHost.clientHeight), this.viewport.ensureExtent(this.scrollHost.scrollWidth, this.scrollHost.scrollHeight));
5305
5337
  }
5306
5338
  get viewportTop() {
5307
- return this._mountKind === "composite" && (this.syncNativeViewportExtent(), this.viewport.adoptNativeOffset(this.viewport.x, this.scrollHost.scrollTop)), this.viewport.y;
5339
+ return this._nativeScrollbars && (this.syncNativeViewportExtent(), this.viewport.adoptNativeOffset(this.viewport.x, this.scrollHost.scrollTop)), this.viewport.y;
5308
5340
  }
5309
5341
  set viewportTop(e) {
5310
- this.viewport.setOffset(this.viewport.x, e), this._mountKind === "composite" && (this.scrollHost.scrollTop = this.viewport.y);
5342
+ this.viewport.setOffset(this.viewport.x, e), this._nativeScrollbars && (this.scrollHost.scrollTop = this.viewport.y);
5311
5343
  }
5312
5344
  get effectiveScrollLeft() {
5313
- if (this._mountKind === "composite") {
5345
+ if (this._nativeScrollbars) {
5314
5346
  this.syncNativeViewportExtent();
5315
5347
  let e = this.scrollHost.scrollLeft;
5316
5348
  this.viewport.adoptNativeOffset(this.isRtl ? this.maxScrollLeft - e : e, this.viewport.y);
@@ -5318,16 +5350,16 @@ var go = class {
5318
5350
  return this.viewport.x;
5319
5351
  }
5320
5352
  setViewportLeft(e) {
5321
- this.viewport.setOffset(e, this.viewport.y), this._mountKind === "composite" && (this.scrollHost.scrollLeft = this.isRtl ? Math.max(0, this.maxScrollLeft - this.viewport.x) : this.viewport.x);
5353
+ this.viewport.setOffset(e, this.viewport.y), this._nativeScrollbars && (this.scrollHost.scrollLeft = this.isRtl ? Math.max(0, this.maxScrollLeft - this.viewport.x) : this.viewport.x);
5322
5354
  }
5323
5355
  screenX(e, t) {
5324
5356
  return this.isRtl ? hr(e, t, this.canvasArea.clientWidth) : e;
5325
5357
  }
5326
5358
  resetHorizontalScroll() {
5327
- this.viewport.setOffset(0, this.viewport.y), this._mountKind === "composite" && (this.scrollHost.scrollLeft = this.isRtl ? this.maxScrollLeft : 0);
5359
+ this.viewport.setOffset(0, this.viewport.y), this._nativeScrollbars && (this.scrollHost.scrollLeft = this.isRtl ? this.maxScrollLeft : 0);
5328
5360
  }
5329
5361
  reanchorHorizontalScroll() {
5330
- if (this._mountKind === "sheet" || !this.isRtl || this.scrollHost.clientWidth === 0) return;
5362
+ if (!this._nativeScrollbars || !this.isRtl || this.scrollHost.clientWidth === 0) return;
5331
5363
  let e = Math.max(0, this.maxScrollLeft - this.viewport.x);
5332
5364
  Math.abs(this.scrollHost.scrollLeft - e) > 1 && (this.scrollHost.scrollLeft = e);
5333
5365
  }
@@ -5453,7 +5485,7 @@ var go = class {
5453
5485
  edge: t.x + t.w
5454
5486
  }));
5455
5487
  }
5456
- let o = uo(a, i, co, s);
5488
+ let o = po(a, i, uo, s);
5457
5489
  return o === null ? null : {
5458
5490
  kind: "col",
5459
5491
  index: o,
@@ -5473,7 +5505,7 @@ var go = class {
5473
5505
  edge: t.y + t.h
5474
5506
  }));
5475
5507
  }
5476
- let a = uo(o, i, co, c);
5508
+ let a = po(o, i, uo, c);
5477
5509
  return a === null ? null : {
5478
5510
  kind: "row",
5479
5511
  index: a,
@@ -5488,10 +5520,10 @@ var go = class {
5488
5520
  if (!n || !r) return;
5489
5521
  let i = this.viewport.scale, a = this.canvasArea.getBoundingClientRect();
5490
5522
  if (n.kind === "col") {
5491
- let t = this.screenX(e - a.left, 0), o = Math.max(lo, Math.round((t - n.originScaled) / i));
5523
+ let t = this.screenX(e - a.left, 0), o = Math.max(fo, Math.round((t - n.originScaled) / i));
5492
5524
  r.colWidths[n.index] = Qn(o, n.mdw), this.recordSizeOverride("col", n.index);
5493
5525
  } else {
5494
- let e = t - a.top, o = Math.max(lo, Math.round((e - n.originScaled) / i));
5526
+ let e = t - a.top, o = Math.max(fo, Math.round((e - n.originScaled) / i));
5495
5527
  r.rowHeights[n.index] = er(o), this.recordSizeOverride("row", n.index);
5496
5528
  }
5497
5529
  ir.invalidate(r), this.updateSpacerSize(r), this.updateSelectionOverlay(), this.scheduleRender();
@@ -5562,7 +5594,7 @@ var go = class {
5562
5594
  c < a && (u -= a - c, c = a), l < o && (d -= o - l, l = o);
5563
5595
  let m = a + s.width, h = o + s.height;
5564
5596
  if (p > r && c < m && (u -= m - c, c = m), f > n && l < h && (d -= h - l, l = h), u <= 0 || d <= 0) return;
5565
- let g = this.screenX(c, u), { border: _, background: v } = fo(this.opts.selectionColor ?? so), y = this.hostDocument.createElement("div");
5597
+ let g = this.screenX(c, u), { border: _, background: v } = mo(this.opts.selectionColor ?? lo), y = this.hostDocument.createElement("div");
5566
5598
  y.style.cssText = `position:absolute;left:${g}px;top:${l}px;width:${u}px;height:${d}px;box-sizing:border-box;border:${_};background:${v};pointer-events:none;`, this.overlayHost.appendSelection(y), this.maybeDrawValidationDropdown();
5567
5599
  }
5568
5600
  maybeDrawValidationDropdown() {
@@ -5587,7 +5619,7 @@ var go = class {
5587
5619
  this.overlayHost.clearFind();
5588
5620
  let e = this.currentWorksheet;
5589
5621
  if (!e) return;
5590
- let t = this.viewport.scale, n = (e) => Math.round(e * t), r = n(50), i = n(22), a = e.freezeRows ?? 0, o = e.freezeCols ?? 0, s = br(e).roundedFrozenExtent(t), c = r + s.width, l = i + s.height, u = ho(!1, this.opts.findHighlightColors), d = ho(!0, this.opts.findHighlightColors);
5622
+ let t = this.viewport.scale, n = (e) => Math.round(e * t), r = n(50), i = n(22), a = e.freezeRows ?? 0, o = e.freezeCols ?? 0, s = br(e).roundedFrozenExtent(t), c = r + s.width, l = i + s.height, u = _o(!1, this.opts.findHighlightColors), d = _o(!0, this.opts.findHighlightColors);
5591
5623
  for (let e of this._find.sheetHighlights(this.currentSheet)) {
5592
5624
  let t = this.getCellRect(e.row, e.col);
5593
5625
  if (!t) continue;
@@ -5760,7 +5792,7 @@ var go = class {
5760
5792
  }
5761
5793
  this.commentPopupKey !== t && (this.hideCommentPopup(), this.commentPopupKey = t, this.commentPopupTimer = setTimeout(() => {
5762
5794
  this.commentPopupTimer = null, this.renderCommentPopup(e, n);
5763
- }, Ja));
5795
+ }, Xa));
5764
5796
  }
5765
5797
  renderCommentPopup(e, t) {
5766
5798
  let n = this.getCellRect(e.row, e.col);
@@ -5804,7 +5836,7 @@ var go = class {
5804
5836
  }, this.activeCell = {
5805
5837
  row: 1,
5806
5838
  col: 1
5807
- }, this.isSelecting = !1) : a.kind === "row" ? n && this.anchorCell && this.selectionMode === "rows" ? this.selectionController.extend({
5839
+ }, this.selectionController.endDrag()) : a.kind === "row" ? n && this.anchorCell && this.selectionMode === "rows" ? this.selectionController.extend({
5808
5840
  row: a.row,
5809
5841
  col: 1
5810
5842
  }) : (this.selectionMode = "rows", this.anchorCell = {
@@ -5813,7 +5845,7 @@ var go = class {
5813
5845
  }, this.activeCell = {
5814
5846
  row: a.row,
5815
5847
  col: 1
5816
- }, i && (this.isSelecting = !0, this.scrollHost.setPointerCapture(r))) : n && this.anchorCell && this.selectionMode === "cols" ? this.selectionController.extend({
5848
+ }, i && (this.beginSelectionDrag(r), this.scrollHost.setPointerCapture(r))) : n && this.anchorCell && this.selectionMode === "cols" ? this.selectionController.extend({
5817
5849
  row: 1,
5818
5850
  col: a.col
5819
5851
  }) : (this.selectionMode = "cols", this.anchorCell = {
@@ -5822,15 +5854,102 @@ var go = class {
5822
5854
  }, this.activeCell = {
5823
5855
  row: 1,
5824
5856
  col: a.col
5825
- }, i && (this.isSelecting = !0, this.scrollHost.setPointerCapture(r))), this.updateSelectionOverlay(), this.renderCurrentSheet(), this.opts.onSelectionChange?.(this.selection);
5857
+ }, i && (this.beginSelectionDrag(r), this.scrollHost.setPointerCapture(r))), this.updateSelectionOverlay(), this.renderCurrentSheet(), this.opts.onSelectionChange?.(this.selection);
5826
5858
  return;
5827
5859
  }
5828
5860
  let o = this.getCellAt(e, t);
5829
- o && (n && this.anchorCell && this.selectionMode === "cells" ? this.selectionController.extend(o) : (this.selectionMode = "cells", this.anchorCell = o, this.activeCell = o), i && (this.isSelecting = !0, this.scrollHost.setPointerCapture(r)), this.updateSelectionOverlay(), this.wb && this.renderCurrentSheet().catch((e) => this._reportRenderError(e)), this.opts.onSelectionChange?.(this.selection));
5861
+ o && (n && this.anchorCell && this.selectionMode === "cells" ? this.selectionController.extend(o) : (this.selectionMode = "cells", this.anchorCell = o, this.activeCell = o), i && (this.beginSelectionDrag(r), this.scrollHost.setPointerCapture(r)), this.updateSelectionOverlay(), this.wb && this.renderCurrentSheet().catch((e) => this._reportRenderError(e)), this.opts.onSelectionChange?.(this.selection));
5862
+ }
5863
+ viewportInputBounds() {
5864
+ let e = this.canvasArea.getBoundingClientRect(), t = e.left + this.scrollHost.clientLeft, n = e.top + this.scrollHost.clientTop, r = Math.max(0, e.width - this.scrollHost.clientLeft), i = Math.max(0, e.height - this.scrollHost.clientTop);
5865
+ return {
5866
+ left: t,
5867
+ top: n,
5868
+ width: Math.min(r, this.scrollHost.clientWidth || r),
5869
+ height: Math.min(i, this.scrollHost.clientHeight || i)
5870
+ };
5871
+ }
5872
+ extendDragSelection(e, t, n) {
5873
+ let r = e, i = t, a = this.viewportInputBounds(), o = e < a.left || e >= a.left + a.width || t < a.top || t >= a.top + a.height;
5874
+ if (n || o) {
5875
+ let e = this.viewport.scale, t = Math.round(50 * e), n = Math.round(22 * e), o = a.left + (this.isRtl ? 0 : t), s = a.left + a.width - (this.isRtl ? t : 0);
5876
+ r = Math.min(s - 1, Math.max(o + 1, r)), i = Math.min(a.top + a.height - 1, Math.max(a.top + n + 1, i));
5877
+ }
5878
+ if (this.selectionMode === "rows") {
5879
+ let e = n ? null : this.getHeaderHit(r, i), t = e?.kind === "row" ? e.row : this.getCellAt(r, i)?.row;
5880
+ return !t || t === this.activeCell?.row ? !1 : (this.selectionController.extend({
5881
+ row: t,
5882
+ col: 1
5883
+ }), !0);
5884
+ }
5885
+ if (this.selectionMode === "cols") {
5886
+ let e = n ? null : this.getHeaderHit(r, i), t = e?.kind === "col" ? e.col : this.getCellAt(r, i)?.col;
5887
+ return !t || t === this.activeCell?.col ? !1 : (this.selectionController.extend({
5888
+ row: 1,
5889
+ col: t
5890
+ }), !0);
5891
+ }
5892
+ let s = this.getCellAt(r, i);
5893
+ return !s || s.row === this.activeCell?.row && s.col === this.activeCell?.col ? !1 : (this.selectionController.extend(s), !0);
5894
+ }
5895
+ selectionAutoScrollSpeed() {
5896
+ let e = this.selectionAutoScrollPointer;
5897
+ if (!e) return {
5898
+ x: 0,
5899
+ y: 0
5900
+ };
5901
+ let t = this.viewportInputBounds();
5902
+ return Ja({
5903
+ x: e.clientX - t.left,
5904
+ y: e.clientY - t.top
5905
+ }, {
5906
+ width: t.width,
5907
+ height: t.height
5908
+ }, this.isRtl, this.selectionMode);
5909
+ }
5910
+ trackSelectionAutoScroll(e) {
5911
+ if (e.pointerId !== this.selectionPointerId) return;
5912
+ this.selectionAutoScrollPointer = {
5913
+ clientX: e.clientX,
5914
+ clientY: e.clientY,
5915
+ pointerId: e.pointerId
5916
+ };
5917
+ let t = this.selectionAutoScrollSpeed();
5918
+ if (t.x === 0 && t.y === 0) {
5919
+ this.stopSelectionAutoScroll();
5920
+ return;
5921
+ }
5922
+ this.selectionAutoScrollFrame === null && (this.selectionAutoScrollLastTime = null, this.selectionAutoScrollFrame = this.hostWindow.requestAnimationFrame((e) => this.runSelectionAutoScroll(e)));
5923
+ }
5924
+ runSelectionAutoScroll(e) {
5925
+ this.selectionAutoScrollFrame = null;
5926
+ let t = this.selectionAutoScrollPointer;
5927
+ if (!t || t.pointerId !== this.selectionPointerId || !this.isSelecting || this._destroyed) {
5928
+ this.stopSelectionAutoScroll();
5929
+ return;
5930
+ }
5931
+ let n = this.selectionAutoScrollSpeed();
5932
+ if (n.x === 0 && n.y === 0) {
5933
+ this.stopSelectionAutoScroll();
5934
+ return;
5935
+ }
5936
+ let r = this.selectionAutoScrollLastTime, i = r === null ? 1 / 60 : Math.min(.05, Math.max(0, e - r) / 1e3);
5937
+ this.selectionAutoScrollLastTime = e;
5938
+ let a = this.effectiveScrollLeft, o = this.viewportTop;
5939
+ this.setViewportLeft(a + n.x * i), this.viewportTop = o + n.y * i;
5940
+ let s = this.effectiveScrollLeft !== a || this.viewportTop !== o, c = s && this.extendDragSelection(t.clientX, t.clientY, !0);
5941
+ if (s && (this.updateSelectionOverlay(), this.updateFindOverlay(), this.scheduleRender(), this.emitViewportChange(), c && this.opts.onSelectionChange?.(this.selection)), !s) {
5942
+ this.stopSelectionAutoScroll();
5943
+ return;
5944
+ }
5945
+ this.selectionAutoScrollFrame = this.hostWindow.requestAnimationFrame((e) => this.runSelectionAutoScroll(e));
5946
+ }
5947
+ stopSelectionAutoScroll() {
5948
+ this.selectionAutoScrollFrame !== null && (this.hostWindow.cancelAnimationFrame(this.selectionAutoScrollFrame), this.selectionAutoScrollFrame = null), this.selectionAutoScrollPointer = null, this.selectionAutoScrollLastTime = null;
5830
5949
  }
5831
5950
  setupSelectionEvents() {
5832
5951
  this.surface.on("pointerdown", (e) => {
5833
- if (e.button !== 0) return;
5952
+ if (e.button !== 0 || this.isSelecting && e.pointerId !== this.selectionPointerId) return;
5834
5953
  let t = this.opts.resizable ?? !0 ? this.getResizeTarget(e.clientX, e.clientY) : null;
5835
5954
  if (t) {
5836
5955
  e.preventDefault(), this.resizeDrag = {
@@ -5849,7 +5968,7 @@ var go = class {
5849
5968
  }
5850
5969
  let r = this.scrollHost.getBoundingClientRect(), i = e.clientX - r.left - this.scrollHost.clientLeft, a = e.clientY - r.top - this.scrollHost.clientTop;
5851
5970
  if (i >= this.scrollHost.clientWidth || a >= this.scrollHost.clientHeight) return;
5852
- let o = this._mountKind === "composite" && (this.scrollHost.scrollWidth > this.scrollHost.clientWidth && this.scrollHost.clientHeight - a <= 16 || this.scrollHost.scrollHeight > this.scrollHost.clientHeight && this.scrollHost.clientWidth - i <= 16);
5971
+ let o = this._nativeScrollbars && (this.scrollHost.scrollWidth > this.scrollHost.clientWidth && this.scrollHost.clientHeight - a <= 16 || this.scrollHost.scrollHeight > this.scrollHost.clientHeight && this.scrollHost.clientWidth - i <= 16);
5853
5972
  if (e.pointerType !== "mouse" || o) {
5854
5973
  this.pendingTap = {
5855
5974
  x: e.clientX,
@@ -5890,28 +6009,7 @@ var go = class {
5890
6009
  let t = this.getCellAt(e.clientX, e.clientY);
5891
6010
  t ? this.scheduleCommentPopup(t) : this.hideCommentPopup(), this.scrollHost.style.cursor = t && this.hyperlinkAtCell(t) ? "pointer" : "";
5892
6011
  }
5893
- if (this.isSelecting) {
5894
- if (this.selectionMode === "rows") {
5895
- let t = this.getHeaderHit(e.clientX, e.clientY), n = t?.kind === "row" ? t.row : this.getCellAt(e.clientX, e.clientY)?.row;
5896
- if (!n || n === this.activeCell?.row) return;
5897
- this.selectionController.extend({
5898
- row: n,
5899
- col: 1
5900
- });
5901
- } else if (this.selectionMode === "cols") {
5902
- let t = this.getHeaderHit(e.clientX, e.clientY), n = t?.kind === "col" ? t.col : this.getCellAt(e.clientX, e.clientY)?.col;
5903
- if (!n || n === this.activeCell?.col) return;
5904
- this.selectionController.extend({
5905
- row: 1,
5906
- col: n
5907
- });
5908
- } else {
5909
- let t = this.getCellAt(e.clientX, e.clientY);
5910
- if (!t || t.row === this.activeCell?.row && t.col === this.activeCell?.col) return;
5911
- this.selectionController.extend(t);
5912
- }
5913
- this.updateSelectionOverlay(), this.scheduleRender(), this.opts.onSelectionChange?.(this.selection);
5914
- }
6012
+ !this.isSelecting || e.pointerId !== this.selectionPointerId || (this.trackSelectionAutoScroll(e), this.extendDragSelection(e.clientX, e.clientY, !1) && (this.updateSelectionOverlay(), this.scheduleRender(), this.opts.onSelectionChange?.(this.selection)));
5915
6013
  }), this.surface.on("pointerup", (e) => {
5916
6014
  if (this.resizeDrag && this.resizeDrag.pointerId === e.pointerId) {
5917
6015
  this.scrollHost.releasePointerCapture(e.pointerId), this.resizeDrag = null;
@@ -5928,16 +6026,17 @@ var go = class {
5928
6026
  }
5929
6027
  this.pendingTap = null;
5930
6028
  }
5931
- if (this.pendingClick && this.pendingClick.pointerId === e.pointerId) {
6029
+ let t = e.pointerId === this.selectionPointerId;
6030
+ if (t && this.stopSelectionAutoScroll(), this.pendingClick && this.pendingClick.pointerId === e.pointerId) {
5932
6031
  let t = e.clientX - this.pendingClick.x, n = e.clientY - this.pendingClick.y, r = this.getCellAt(e.clientX, e.clientY);
5933
6032
  t * t + n * n <= 64 && r && r.row === this.pendingClick.cell.row && r.col === this.pendingClick.cell.col && this.dispatchHyperlink(this.pendingClick.cell), this.pendingClick = null;
5934
6033
  }
5935
- this.isSelecting = !1;
6034
+ t && this.selectionController.endDrag(e.pointerId);
5936
6035
  }), this.surface.on("pointercancel", (e) => {
5937
- this.resizeDrag && this.resizeDrag.pointerId === e.pointerId && (this.resizeDrag = null), this.pendingTap && this.pendingTap.pointerId === e.pointerId && (this.pendingTap = null), this.pendingClick && this.pendingClick.pointerId === e.pointerId && (this.pendingClick = null), this.isSelecting = !1;
6036
+ this.resizeDrag && this.resizeDrag.pointerId === e.pointerId && (this.resizeDrag = null), this.pendingTap && this.pendingTap.pointerId === e.pointerId && (this.pendingTap = null), this.pendingClick && this.pendingClick.pointerId === e.pointerId && (this.pendingClick = null), e.pointerId === this.selectionPointerId && (this.stopSelectionAutoScroll(), this.selectionController.endDrag(e.pointerId));
5938
6037
  }), this.surface.on("wheel", (e) => {
5939
6038
  if (!(e.ctrlKey || e.metaKey)) {
5940
- if (this._mountKind === "sheet") {
6039
+ if (!this._nativeScrollbars) {
5941
6040
  e.preventDefault();
5942
6041
  let t = e.deltaMode === WheelEvent.DOM_DELTA_LINE ? 16 : e.deltaMode === WheelEvent.DOM_DELTA_PAGE ? Math.max(1, this.scrollHost.clientHeight) : 1, n = (e.shiftKey ? e.deltaY : e.deltaX) * t, r = (e.shiftKey ? 0 : e.deltaY) * t;
5943
6042
  this.setViewportLeft(this.effectiveScrollLeft + n), this.viewportTop += r, this.scheduleRender(), this.updateSelectionOverlay(), this.updateFindOverlay(), this.emitViewportChange();
@@ -6003,12 +6102,12 @@ var go = class {
6003
6102
  this.updateNavButtons();
6004
6103
  }
6005
6104
  tabStyle(e, t) {
6006
- let n = $a - 2, r = $a - 5, i = t ? `box-shadow:inset 0 -${e ? 2 : 3}px 0 0 ${t};` : "";
6105
+ let n = to - 2, r = to - 5, i = t ? `box-shadow:inset 0 -${e ? 2 : 3}px 0 0 ${t};` : "";
6007
6106
  return e ? `display:inline-block;flex:none;padding:0 14px;position:relative;border:1px solid #c8ccd0;border-bottom:none;border-radius:3px 3px 0 0;cursor:pointer;white-space:nowrap;max-width:160px;overflow:hidden;text-overflow:ellipsis;outline:none;box-sizing:border-box;height:${n}px;font-size:13px;background:#fff;color:#000;border-bottom:1px solid #fff;font-weight:600;top:1px;` + i : `display:inline-block;flex:none;padding:0 14px;position:relative;border:1px solid #c8ccd0;border-bottom:none;border-radius:3px 3px 0 0;cursor:pointer;white-space:nowrap;max-width:160px;overflow:hidden;text-overflow:ellipsis;outline:none;box-sizing:border-box;height:${r}px;font-size:11px;background:#e0e0e0;color:#555;` + i;
6008
6107
  }
6009
6108
  tabCss(e, t) {
6010
6109
  let n = this.tabStyle(t, this.tabColors[e]);
6011
- return this._hiddenSheetMode !== "show" && this.wb?.isHidden(e) && (n += this._hiddenSheetMode === "skip" ? "display:none;" : `opacity:${ro};`), n;
6110
+ return this._hiddenSheetMode !== "show" && this.wb?.isHidden(e) && (n += this._hiddenSheetMode === "skip" ? "display:none;" : `opacity:${ao};`), n;
6012
6111
  }
6013
6112
  buildZoomControl() {
6014
6113
  let e = this.opts.zoomMin ?? .1, t = this.opts.zoomMax ?? 4, n = this.viewport.scale, r = this.hostDocument.createElement("div");
@@ -6157,7 +6256,7 @@ var go = class {
6157
6256
  }
6158
6257
  destroy() {
6159
6258
  if (this._destroyed) return;
6160
- this._destroyed = !0, this.sheetRequestGeneration++, this.resizeObserver?.disconnect(), this.renderDispatcher.destroy(), this.surface.destroy(), this.hideCommentPopup(), this.hideValidationPanel(), this._find.invalidate(), this.releaseHostFonts();
6259
+ this._destroyed = !0, this.stopSelectionAutoScroll(), this.sheetRequestGeneration++, this.resizeObserver?.disconnect(), this.renderDispatcher.destroy(), this.surface.destroy(), this.hideCommentPopup(), this.hideValidationPanel(), this._find.invalidate(), this.releaseHostFonts();
6161
6260
  let e = this.wb?.[Ta];
6162
6261
  typeof e == "function" && e.call(this.wb, this.projectionId), this.acquisition.destroy(), this.wrapper.remove();
6163
6262
  }
@@ -6167,17 +6266,17 @@ var go = class {
6167
6266
  destroyedError() {
6168
6267
  return /* @__PURE__ */ Error(this._mountKind === "sheet" ? "XlsxSheetViewer is destroyed" : "XlsxViewer is destroyed");
6169
6268
  }
6170
- }, _o = class e extends go {
6269
+ }, yo = class e extends vo {
6171
6270
  static fromWorkbook(t, n, r = {}) {
6172
6271
  return new e(t, {
6173
6272
  ...r,
6174
- [qa]: n
6273
+ [Ya]: n
6175
6274
  });
6176
6275
  }
6177
6276
  constructor(e, t = {}) {
6178
6277
  super(e, t, { kind: "composite" });
6179
6278
  }
6180
- }, vo = class e {
6279
+ }, bo = class e {
6181
6280
  engine;
6182
6281
  canvasMount;
6183
6282
  destroyed = !1;
@@ -6186,16 +6285,16 @@ var go = class {
6186
6285
  static fromWorkbook(t, n, r = {}) {
6187
6286
  return new e(t, {
6188
6287
  ...r,
6189
- [qa]: n
6288
+ [Ya]: n
6190
6289
  });
6191
6290
  }
6192
6291
  constructor(e, t = {}) {
6193
6292
  this.canvasElement = e;
6194
- let n = t[qa], r = we("XlsxSheetViewer", t.mode, n), i = e.getBoundingClientRect();
6293
+ let n = t[Ya], r = we("XlsxSheetViewer", t.mode, n), i = e.getBoundingClientRect();
6195
6294
  this.canvasMount = new De(e, {
6196
6295
  wrapperCssText: `position:relative;display:inline-block;vertical-align:top;overflow:hidden;width:${e.style.width || `${i.width || e.width}px`};height:${e.style.height || `${i.height || e.height}px`};`,
6197
6296
  restoreMode: "style-and-bitmap"
6198
- }), this.engine = new go(this.canvasMount.wrapper, {
6297
+ }), this.engine = new vo(this.canvasMount.wrapper, {
6199
6298
  ...t,
6200
6299
  onResourceMetrics: (e) => {
6201
6300
  this.lastMetrics = e, t.onResourceMetrics?.(e);
@@ -6346,12 +6445,12 @@ var go = class {
6346
6445
  destroyedError() {
6347
6446
  return /* @__PURE__ */ Error("XlsxSheetViewer is destroyed");
6348
6447
  }
6349
- }, yo = /* @__PURE__ */ e({
6448
+ }, xo = /* @__PURE__ */ e({
6350
6449
  OoxmlDecodedImageLimitError: () => d,
6351
6450
  OoxmlError: () => re,
6352
6451
  OoxmlResourceLimitError: () => te,
6353
- XlsxSheetViewer: () => vo,
6354
- XlsxViewer: () => _o,
6452
+ XlsxSheetViewer: () => bo,
6453
+ XlsxViewer: () => yo,
6355
6454
  XlsxWorkbook: () => Ea,
6356
6455
  autoResize: () => je,
6357
6456
  isOoxmlDecodedImageLimitError: () => m,
@@ -6359,4 +6458,4 @@ var go = class {
6359
6458
  resolveSharedStrings: () => Ue
6360
6459
  });
6361
6460
  //#endregion
6362
- export { Ea as i, vo as n, _o as r, yo as t };
6461
+ export { Ea as i, bo as n, yo as r, xo as t };
package/dist/xlsx.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { It as e, Lt as t, a as n, hn as r, mn as i } from "./line-metrics-BdCACYlq.js";
2
2
  import { y as a } from "./canvas-viewer-mechanics-CwVSOYke.js";
3
- import { i as o, n as s, r as c } from "./xlsx-BBmmZNQn.js";
3
+ import { i as o, n as s, r as c } from "./xlsx-EykJ9tPV.js";
4
4
  import { i as l } from "./worksheet-pull-client-YzjJMOns.js";
5
5
  export { e as OoxmlDecodedImageLimitError, i as OoxmlError, r as OoxmlResourceLimitError, s as XlsxSheetViewer, c as XlsxViewer, o as XlsxWorkbook, a as autoResize, t as isOoxmlDecodedImageLimitError, n as openExternalHyperlink, l as resolveSharedStrings };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silurus/ooxml",
3
- "version": "0.76.1",
3
+ "version": "0.76.2",
4
4
  "description": "Browser-based OOXML viewer (docx/xlsx/pptx) — Rust/WASM parser + Canvas renderer",
5
5
  "license": "MIT",
6
6
  "author": "Yuki Yokotani <silurus.dev@gmail.com>",
@@ -78,6 +78,7 @@
78
78
  "@storybook/html-vite": "^10.3.5",
79
79
  "@types/node": "^25.6.0",
80
80
  "mathjax": "^3.2.2",
81
+ "pngjs": "^7.0.0",
81
82
  "rolldown-plugin-dts": "^0.28.0",
82
83
  "rolldown": "^1.2.0",
83
84
  "storybook": "^10.3.5",
@@ -103,7 +104,7 @@
103
104
  "vrt:fidelity": "pnpm -r --workspace-concurrency=1 vrt:fidelity",
104
105
  "vrt:worker": "pnpm --workspace-concurrency=1 --filter @silurus/ooxml-pptx --filter @silurus/ooxml-docx --filter @silurus/ooxml-xlsx vrt:worker",
105
106
  "smoke": "playwright test --config tests/smoke/playwright.config.ts layouts",
106
- "test": "vitest run",
107
+ "test": "vitest run && node --test tests/visual/private-corpus.test.mjs",
107
108
  "check:no-inline-wasm": "node scripts/check-no-inline-wasm.mjs dist",
108
109
  "lint": "ast-grep scan",
109
110
  "lint:test": "ast-grep test --skip-snapshot-tests",