@fileverse-dev/dsheet 4.1.12-d → 4.1.13-a

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.
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { C as s, d as o, f as t, S as r, g as l, h as n, j as d, T as S, k as c, l as i, n as m, o as h, p, q as C, t as u, u as E, v as F, w as g, x, z as R, A, B as f, D as I, E as L, F as T, G as w, H as y, I as v, J as D, K as M, L as b, M as k, N as z, O, P } from "./index-Do3ORCP6.js";
2
- import { cy as G, cz as K, cA as U, cG as X, bs as _, e as j, f as B, l as H, a as J, dj as N, dk as q, bb as Y, dl as Z, dm as Q, dr as W, ds as $, du as ee, I as ae, dJ as se, eg as oe, b4 as te } from "./executeStringFunction-DDohtIgJ.js";
1
+ import { C as s, d as o, f as t, S as r, g as l, h as n, j as d, T as S, k as c, l as i, n as m, o as h, p, q as C, t as u, u as E, v as F, w as g, x, z as R, A, B as f, D as I, E as L, F as T, G as w, H as y, I as v, J as D, K as M, L as b, M as k, N as z, O, P } from "./index-C2bF_Npd.js";
2
+ import { cy as G, cz as K, cA as U, cG as X, bs as _, e as j, f as B, l as H, a as J, dj as N, dk as q, bb as Y, dl as Z, dm as Q, dr as W, ds as $, du as ee, I as ae, dJ as se, eg as oe, b4 as te } from "./executeStringFunction-D1IXrBP2.js";
3
3
  import { FLVURL as le } from "@fileverse-dev/formulajs";
4
4
  import { E as de, S as Se } from "./constants-8Ij49Lxv.js";
5
5
  export {
@@ -4,6 +4,7 @@ import { Sheet } from '../types';
4
4
  export { filterPatch, patchToOp, opToPatch, inverseRowColOptions, extractFormulaCellOps, } from './patch';
5
5
  export type { PatchOptions, ChangedSheet } from './patch';
6
6
  export { getFreezeState, getFrozenPixelBounds, toggleFreeze } from './freeze';
7
+ export { sheetNameNeedsQuotes, formatSheetNameForFormula, quoteSheetNamesInFormula, } from './sheet-name-ref';
7
8
  export type { FreezeType } from './freeze';
8
9
  export declare function generateRandomSheetName(file: Sheet[], isPivotTable: boolean, ctx: Context): any;
9
10
  export declare function rgbToHex(color: string): string;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Helpers for sheet-qualified references in formulas (`Sheet1!A1`,
3
+ * `'Finance - 1'!A1`, `'It''s'!A1`).
4
+ *
5
+ * Like Google Sheets / Excel, a sheet name can only appear bare when it is a
6
+ * plain identifier. Anything else (spaces, `-`, punctuation, a leading digit,
7
+ * a name that looks like a cell such as `A1`, non-Latin scripts) must be
8
+ * wrapped in single quotes, with embedded `'` doubled.
9
+ */
10
+ export declare function sheetNameNeedsQuotes(name: string): boolean;
11
+ /** `Sheet1` -> `Sheet1`, `Finance - 1` -> `'Finance - 1'`, `It's` -> `'It''s'`. */
12
+ export declare function formatSheetNameForFormula(name: string): string;
13
+ /**
14
+ * Wraps bare references to existing sheets whose names need quoting, e.g.
15
+ * `=SUM(Sheet-4!H6,B2:C2)` -> `=SUM('Sheet-4'!H6,B2:C2)`.
16
+ *
17
+ * Only exact (case-insensitive) matches of an existing sheet name immediately
18
+ * followed by `!` are rewritten; text inside "strings" and already-quoted
19
+ * '...' names is left untouched.
20
+ */
21
+ export declare function quoteSheetNamesInFormula(formula: string, sheetNames: string[]): string;
@@ -0,0 +1,14 @@
1
+ import { RefObject } from 'react';
2
+
3
+ /**
4
+ * Remembers the last caret position (text offset) inside a formula editor.
5
+ *
6
+ * Clicking a sheet tab moves the DOM selection out of the editor, so by the
7
+ * time the sheet switch finishes the caret is gone. The value kept here lets
8
+ * the editor put the caret back exactly where the user left it (e.g. after the
9
+ * `,` in `=SUM('Sheet - 2'!B2,`) instead of guessing.
10
+ *
11
+ * The offset counts characters across text nodes, matching
12
+ * `setCursorPosition`. It resets to `null` when the edit session ends.
13
+ */
14
+ export declare function useLastFormulaCaretOffset(editorRef: RefObject<HTMLDivElement | null>, editSessionActive: boolean): RefObject<number | null>;
@@ -1,10 +1,10 @@
1
1
  import * as BZ from "yjs";
2
- import { i as Yl, a as hl, s as eZ, r as ul, y as Il, b as pl, m as Rl } from "./index-Do3ORCP6.js";
3
- import { g as sl } from "./executeStringFunction-DDohtIgJ.js";
2
+ import { i as Yl, a as hl, s as eZ, r as ul, y as Il, b as pl, m as Rl } from "./index-C2bF_Npd.js";
3
+ import { g as sl } from "./executeStringFunction-D1IXrBP2.js";
4
4
  import { Workbook as al } from "exceljs";
5
5
  import Kl from "luckyexcel";
6
- import { e as Jl, b as xl, n as Ml } from "./xlsx-hyperlink-inline-Q7OJiRv1.js";
7
- import { parseDefinedNamesFromXlsxBuffer as Sl, excelEntriesToDefinedNames as OZ } from "./xlsx-defined-names-CVyBLew_.js";
6
+ import { e as Jl, b as xl, n as Ml } from "./xlsx-hyperlink-inline-BqwlPUEK.js";
7
+ import { parseDefinedNamesFromXlsxBuffer as Sl, excelEntriesToDefinedNames as OZ } from "./xlsx-defined-names-AmoE3FGc.js";
8
8
  import { toast as fZ } from "@fileverse/ui";
9
9
  var Zl = { exports: {} };
10
10
  (function(m) {
@@ -1,5 +1,5 @@
1
- import { i as w } from "./executeStringFunction-DDohtIgJ.js";
2
- import { J as x } from "./xlsx-hyperlink-inline-Q7OJiRv1.js";
1
+ import { i as w } from "./executeStringFunction-D1IXrBP2.js";
2
+ import { J as x } from "./xlsx-hyperlink-inline-BqwlPUEK.js";
3
3
  function g(o) {
4
4
  return o.startsWith("_xlnm.");
5
5
  }
@@ -1,9 +1,9 @@
1
1
  import { utils as S, write as nt } from "xlsx-js-style";
2
2
  import { Workbook as pt } from "exceljs";
3
3
  import { toast as rt } from "@fileverse/ui";
4
- import { J as dt, c as X, g as ht, a as mt } from "./xlsx-hyperlink-inline-Q7OJiRv1.js";
5
- import { b as gt } from "./executeStringFunction-DDohtIgJ.js";
6
- import { e as bt } from "./index-Do3ORCP6.js";
4
+ import { J as dt, c as X, g as ht, a as mt } from "./xlsx-hyperlink-inline-BqwlPUEK.js";
5
+ import { b as gt } from "./executeStringFunction-D1IXrBP2.js";
6
+ import { e as bt } from "./index-C2bF_Npd.js";
7
7
  const xt = {
8
8
  1: "thin",
9
9
  2: "hair",
@@ -854,7 +854,7 @@ const Z = (t) => {
854
854
  O
855
855
  );
856
856
  });
857
- const { applyDefinedNamesToExcelWorkbook: ct } = await import("./xlsx-defined-names-CVyBLew_.js");
857
+ const { applyDefinedNamesToExcelWorkbook: ct } = await import("./xlsx-defined-names-AmoE3FGc.js");
858
858
  ct(
859
859
  B,
860
860
  (k = (C = (s = t.current).getWorkbookContext) == null ? void 0 : C.call(s)) == null ? void 0 : k.definedNames,
@@ -1,5 +1,5 @@
1
- import { g as Rt, c as yt } from "./executeStringFunction-DDohtIgJ.js";
2
- import { c as wt } from "./index-Do3ORCP6.js";
1
+ import { g as Rt, c as yt } from "./executeStringFunction-D1IXrBP2.js";
2
+ import { c as wt } from "./index-C2bF_Npd.js";
3
3
  function jt(J, nt) {
4
4
  const g = J.getImages();
5
5
  if (!g.length) return [];
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/dsheet",
3
3
  "private": false,
4
4
  "description": "DSheet",
5
- "version": "4.1.12-d",
5
+ "version": "4.1.13-a",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/fileverse/fileverse-dsheets.git"