@fileverse-dev/dsheet 4.1.18 → 4.1.20-subsheetLink-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 (32) hide show
  1. package/dist/editor/components/editor-workbook.d.ts +4 -0
  2. package/dist/editor/types/smart-contract.d.ts +3 -2
  3. package/dist/editor/types.d.ts +6 -0
  4. package/dist/editor/utils/activate-sheet-for-link.d.ts +3 -0
  5. package/dist/editor/utils/active-sheet-keeper.d.ts +21 -0
  6. package/dist/editor/utils/editor-handle.d.ts +1 -1
  7. package/dist/editor/utils/navigate-to-sheet.d.ts +22 -0
  8. package/dist/editor/utils/smart-contract/reading-utils.test.d.ts +1 -0
  9. package/dist/{es-S4GKlN-t.js → es-BlDQ6jCL.js} +1 -0
  10. package/dist/{executeStringFunction-B1_kGelH.js → executeStringFunction-BVMdxpT1.js} +5 -4
  11. package/dist/formula.js +1 -1
  12. package/dist/{hi-DMMTDTxZ.js → hi-CP0ta0Yk.js} +1 -0
  13. package/dist/{index-D1F86l4X.js → index-Dj8ENMMA.js} +13415 -13258
  14. package/dist/index.es.js +2 -2
  15. package/dist/sheet-engine/core/locale/en.d.ts +1 -0
  16. package/dist/sheet-engine/core/locale/es.d.ts +1 -0
  17. package/dist/sheet-engine/core/locale/hi.d.ts +1 -0
  18. package/dist/sheet-engine/core/locale/zh.d.ts +1 -0
  19. package/dist/sheet-engine/core/locale/zh_tw.d.ts +1 -0
  20. package/dist/sheet-engine/core/settings.d.ts +4 -0
  21. package/dist/sheet-engine/react/components/ContextMenu/sheet-tab-menu-items.d.ts +15 -0
  22. package/dist/sync-local/server-clock.d.ts +26 -0
  23. package/dist/sync-local/server-clock.test.d.ts +1 -0
  24. package/dist/sync-local/socketClient.d.ts +1 -1
  25. package/dist/sync-local/socketClient.server-time.test.d.ts +1 -0
  26. package/dist/{use-xlsx-import-impl-CVvAMSHb.js → use-xlsx-import-impl-DnLseev5.js} +4 -4
  27. package/dist/{xlsx-defined-names-CjllTwj9.js → xlsx-defined-names-gGzAt5fj.js} +2 -2
  28. package/dist/{xlsx-export-impl-DPiVn_D4.js → xlsx-export-impl-D4njWqtm.js} +4 -4
  29. package/dist/{xlsx-hyperlink-inline-BwKPvD2f.js → xlsx-hyperlink-inline-B7n51qW3.js} +2 -2
  30. package/dist/{zh-Bv4KIDiJ.js → zh-CmOCFd5t.js} +1 -0
  31. package/dist/{zh_tw-BdpsK45h.js → zh_tw-BqyRw1gX.js} +1 -0
  32. package/package.json +1 -1
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-D1F86l4X.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-B1_kGelH.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-Dj8ENMMA.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-BVMdxpT1.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 {
@@ -548,6 +548,7 @@ declare const _default: {
548
548
  cancelText: string;
549
549
  chooseText: string;
550
550
  focus: string;
551
+ copyLink: string;
551
552
  tipNameRepeat: string;
552
553
  noMoreSheet: string;
553
554
  confirmDelete: string;
@@ -700,6 +700,7 @@ declare const _default: {
700
700
  cancelText: string;
701
701
  chooseText: string;
702
702
  focus: string;
703
+ copyLink: string;
703
704
  tipNameRepeat: string;
704
705
  noMoreSheet: string;
705
706
  confirmDelete: string;
@@ -575,6 +575,7 @@ declare const _default: {
575
575
  cancelText: string;
576
576
  chooseText: string;
577
577
  focus: string;
578
+ copyLink: string;
578
579
  tipNameRepeat: string;
579
580
  noMoreSheet: string;
580
581
  confirmDelete: string;
@@ -593,6 +593,7 @@ declare const _default: {
593
593
  cancelText: string;
594
594
  chooseText: string;
595
595
  focus: string;
596
+ copyLink: string;
596
597
  tipNameRepeat: string;
597
598
  noMoreSheet: string;
598
599
  confirmDelete: string;
@@ -738,6 +738,7 @@ declare const _default: {
738
738
  cancelText: string;
739
739
  chooseText: string;
740
740
  focus: string;
741
+ copyLink: string;
741
742
  tipNameRepeat: string;
742
743
  noMoreSheet: string;
743
744
  confirmDelete: string;
@@ -83,6 +83,10 @@ export type Hooks = {
83
83
  afterDeleteSheet?: (id: string) => void;
84
84
  beforeUpdateSheetName?: (id: string, oldName: string, newName: string) => boolean;
85
85
  afterUpdateSheetName?: (id: string, oldName: string, newName: string) => void;
86
+ onCopySheetLink?: (args: {
87
+ sheetId: string;
88
+ sheetName: string;
89
+ }) => void;
86
90
  afterImagesChange?: () => void;
87
91
  afterIframesChange?: () => void;
88
92
  afterFrozenChange?: () => void;
@@ -0,0 +1,15 @@
1
+ export declare const COPY_SHEET_LINK_ITEM = "copy-link";
2
+ type ReadOnlyFlags = {
3
+ isFlvReadOnly?: boolean;
4
+ allowEdit?: boolean;
5
+ };
6
+ type CopyLinkHooks = {
7
+ onCopySheetLink?: unknown;
8
+ };
9
+ export declare function isSheetTabReadOnly(ctx: ReadOnlyFlags): boolean;
10
+ export declare function canOpenSheetTabMenu(ctx: ReadOnlyFlags, hooks: CopyLinkHooks): boolean;
11
+ export declare function getVisibleSheetTabMenuItems(items: string[], opts: {
12
+ readOnly: boolean;
13
+ hasCopyLink: boolean;
14
+ }): string[];
15
+ export {};
@@ -0,0 +1,26 @@
1
+ import type * as ucans from '@ucans/ucans';
2
+ /**
3
+ * The collab server's clock, learned from its handshake. The server checks auth UCAN nbf/exp
4
+ * against its own clock, so tokens built from a skewed device clock get a 401.
5
+ */
6
+ export declare class ServerClock {
7
+ private readonly wallNow;
8
+ private readonly monoNow;
9
+ private anchor;
10
+ constructor(wallNow?: () => number, monoNow?: (() => number) | null);
11
+ /**
12
+ * Time since the handshake is measured on the monotonic clock, so a device clock change
13
+ * mid-session cannot skew it. A missing or implausible stamp (older server) falls back to the
14
+ * device clock. Delivery delay and sleep only make the estimate trail the server, which the
15
+ * token window absorbs.
16
+ */
17
+ sync(serverTimeMs: unknown): void;
18
+ nowSeconds(): number;
19
+ ucanWindow(): {
20
+ notBefore: number;
21
+ expiration: number;
22
+ };
23
+ /** Whether a cached UCAN can still be presented: active, and not expiring within the margin. */
24
+ isUsable(ucan: ucans.Ucan): boolean;
25
+ private elapsedBase;
26
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -70,6 +70,7 @@ export declare class SocketClient {
70
70
  private contractAddress?;
71
71
  private ownerUcan?;
72
72
  private collaborationUcan?;
73
+ private serverClock;
73
74
  private ownerAddress?;
74
75
  private editLock?;
75
76
  private encryptedTitle?;
@@ -122,7 +123,6 @@ export declare class SocketClient {
122
123
  terminateSession: () => Promise<void>;
123
124
  flushBeacon(mergedUpdate: string): void;
124
125
  private getCollaborationKeyPair;
125
- private isUcanValid;
126
126
  private getOwnerToken;
127
127
  private buildSessionToken;
128
128
  private _authenticate;
@@ -0,0 +1 @@
1
+ export {};
@@ -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-D1F86l4X.js";
3
- import { g as sl } from "./executeStringFunction-B1_kGelH.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-Dj8ENMMA.js";
3
+ import { g as sl } from "./executeStringFunction-BVMdxpT1.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-BwKPvD2f.js";
7
- import { parseDefinedNamesFromXlsxBuffer as Sl, excelEntriesToDefinedNames as OZ } from "./xlsx-defined-names-CjllTwj9.js";
6
+ import { e as Jl, b as xl, n as Ml } from "./xlsx-hyperlink-inline-B7n51qW3.js";
7
+ import { parseDefinedNamesFromXlsxBuffer as Sl, excelEntriesToDefinedNames as OZ } from "./xlsx-defined-names-gGzAt5fj.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-B1_kGelH.js";
2
- import { J as x } from "./xlsx-hyperlink-inline-BwKPvD2f.js";
1
+ import { i as w } from "./executeStringFunction-BVMdxpT1.js";
2
+ import { J as x } from "./xlsx-hyperlink-inline-B7n51qW3.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-BwKPvD2f.js";
5
- import { b as gt } from "./executeStringFunction-B1_kGelH.js";
6
- import { e as bt } from "./index-D1F86l4X.js";
4
+ import { J as dt, c as X, g as ht, a as mt } from "./xlsx-hyperlink-inline-B7n51qW3.js";
5
+ import { b as gt } from "./executeStringFunction-BVMdxpT1.js";
6
+ import { e as bt } from "./index-Dj8ENMMA.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-CjllTwj9.js");
857
+ const { applyDefinedNamesToExcelWorkbook: ct } = await import("./xlsx-defined-names-gGzAt5fj.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-B1_kGelH.js";
2
- import { c as wt } from "./index-D1F86l4X.js";
1
+ import { g as Rt, c as yt } from "./executeStringFunction-BVMdxpT1.js";
2
+ import { c as wt } from "./index-Dj8ENMMA.js";
3
3
  function jt(J, nt) {
4
4
  const g = J.getImages();
5
5
  if (!g.length) return [];
@@ -12261,6 +12261,7 @@ field 可以是与 database 第一行中某个列标题对应的文本标签,
12261
12261
  cancelText: "取消",
12262
12262
  chooseText: "确定颜色",
12263
12263
  focus: "聚焦",
12264
+ copyLink: "复制工作表链接",
12264
12265
  tipNameRepeat: "标签页的名称不能重复!请重新修改",
12265
12266
  noMoreSheet: "工作薄内至少含有一张可视工作表。若需删除选定的工作表,请先插入一张新工作表或显示一张隐藏的工作表。",
12266
12267
  confirmDelete: "是否删除",
@@ -12240,6 +12240,7 @@ field可以是與database第一行中某個列標題對應的文字標籤,也可
12240
12240
  cancelText: "取消",
12241
12241
  chooseText: "確定顏色",
12242
12242
  focus: "聚焦",
12243
+ copyLink: "複製工作表連結",
12243
12244
  tipNameRepeat: "籤頁的名稱不能重複!請重新修改",
12244
12245
  noMoreSheet: "工作薄內至少含有一張可視工作表。若需删除選定的工作表,請先插入一張新工作表或顯示一張隱藏的工作表。。",
12245
12246
  confirmDelete: "是否删除",
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.18",
5
+ "version": "4.1.20-subsheetLink-1",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/fileverse/fileverse-dsheets.git"