@w100n/documents 0.19.1 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ import {
5
5
  pending,
6
6
  save,
7
7
  seed
8
- } from "./chunk-VG7UW2CQ.js";
8
+ } from "./chunk-2JGDV5HG.js";
9
9
 
10
10
  // src/editor/live.ts
11
11
  import { HocuspocusProvider } from "@hocuspocus/provider";
@@ -238,4 +238,4 @@ export {
238
238
  useLive,
239
239
  Swatches
240
240
  };
241
- //# sourceMappingURL=chunk-SJVSGMNK.js.map
241
+ //# sourceMappingURL=chunk-KIKKIOW6.js.map
package/dist/collab.cjs CHANGED
@@ -32,6 +32,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
32
32
  var collab_exports = {};
33
33
  __export(collab_exports, {
34
34
  Refusal: () => Refusal,
35
+ addSheet: () => addSheet,
35
36
  appendRows: () => appendRows,
36
37
  applyCells: () => applyCells,
37
38
  applySteps: () => applySteps,
@@ -45,7 +46,8 @@ __export(collab_exports, {
45
46
  parse: () => parse3,
46
47
  pending: () => pending,
47
48
  save: () => save,
48
- seed: () => seed
49
+ seed: () => seed,
50
+ where: () => where
49
51
  });
50
52
  module.exports = __toCommonJS(collab_exports);
51
53
  var import_core3 = require("@tiptap/core");
@@ -54,7 +56,7 @@ var import_y_tiptap2 = require("@tiptap/y-tiptap");
54
56
  var Y3 = __toESM(require("yjs"), 1);
55
57
 
56
58
  // package.json
57
- var version = "0.19.1";
59
+ var version = "0.20.0";
58
60
 
59
61
  // src/docx/xml.ts
60
62
  function parse(s) {
@@ -7487,6 +7489,23 @@ function clashes(doc, kind, seen, list) {
7487
7489
  old.destroy();
7488
7490
  return out;
7489
7491
  }
7492
+ function addSheet(doc, name, origin) {
7493
+ if (sheetId(doc, name)) return false;
7494
+ const { order: order2, sheets } = parts(doc);
7495
+ const sid = fresh("sheet");
7496
+ doc.transact(() => {
7497
+ sheets.set(sid, made({ id: sid, name }, { rows: Array.from({ length: 1e3 }, () => fresh("n")), cols: Array.from({ length: 26 }, () => fresh("n")) }));
7498
+ order2.push([sid]);
7499
+ }, origin);
7500
+ return true;
7501
+ }
7502
+ function where(doc, sheet, refs3) {
7503
+ const sid = sheetId(doc, sheet);
7504
+ const at3 = refs3.flatMap((r) => r.split(":")).map(cell).filter(([r]) => r >= 0);
7505
+ if (!sid || !at3.length) return null;
7506
+ const rows = at3.map((x) => x[0]), cols = at3.map((x) => x[1]);
7507
+ return { sheet: sid, range: span({ startRow: Math.min(...rows), endRow: Math.max(...rows), startColumn: Math.min(...cols), endColumn: Math.max(...cols) }) };
7508
+ }
7490
7509
  function appendRows(doc, sheet, lines2, origin) {
7491
7510
  const sid = sheetId(doc, sheet);
7492
7511
  if (!sid || !lines2.length) return null;
@@ -7728,6 +7747,7 @@ async function workbook(doc, kind, base, put, who, note) {
7728
7747
  // Annotate the CommonJS export names for ESM import in node:
7729
7748
  0 && (module.exports = {
7730
7749
  Refusal,
7750
+ addSheet,
7731
7751
  appendRows,
7732
7752
  applyCells,
7733
7753
  applySteps,
@@ -7741,6 +7761,7 @@ async function workbook(doc, kind, base, put, who, note) {
7741
7761
  parse,
7742
7762
  pending,
7743
7763
  save,
7744
- seed
7764
+ seed,
7765
+ where
7745
7766
  });
7746
7767
  //# sourceMappingURL=collab.cjs.map