@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
@@ -21,6 +21,10 @@ interface EditorWorkbookProps {
21
21
  dsheetId: string;
22
22
  onDuneChartEmbed?: () => void;
23
23
  onSheetCountChange?: (sheetCount: number) => void;
24
+ onCopySheetLink?: (args: {
25
+ sheetId: string;
26
+ sheetName: string;
27
+ }) => void;
24
28
  sidebarActivePanel?: string | null;
25
29
  sidebarPortalRegistry?: SidebarPortalRegistryHandle | null;
26
30
  sidebarPortalRenderers?: Record<string, SidebarPortalRenderer>;
@@ -33,7 +33,7 @@ export interface SmartContractConfig {
33
33
  contracts?: ContractConfig[];
34
34
  /** RPC URL per chain. Falls back to bundled defaults when omitted. */
35
35
  rpcConfig?: Partial<Record<SupportedChain, string>>;
36
- /** Resolve ABI from stored reference (e.g. IPFS hash). Required for user-saved contracts with abiHash. */
36
+ /** Resolve ABI from stored reference (e.g. an IPFS CID or a Swarm reference — opaque to the package). Required for user-saved contracts with abiHash. */
37
37
  resolveAbi?: (abiHash: string) => Promise<Abi>;
38
38
  /** Persist a new contract. When omitted, package keeps it in session memory only. */
39
39
  onAddContract?: (input: NewContractInput) => Promise<void>;
@@ -52,7 +52,8 @@ export interface CallerParams {
52
52
  export interface FetchAbiParams {
53
53
  contractAddress: Hex;
54
54
  chain: import('viem').Chain;
55
- ipfsHash?: string;
55
+ /** Stored ABI reference (`ContractConfig.abiHash`), resolved via `resolveAbi`. */
56
+ abiRef?: string;
56
57
  }
57
58
  export type ParsedFunction = {
58
59
  functionName: string;
@@ -7,6 +7,7 @@ import { SmartContractConfig } from './types/smart-contract';
7
7
  import { ApiKeyStorage } from './utils/api-key-storage';
8
8
  import { ThemeKey } from '../sheet-engine/core/theme';
9
9
  import { DSheetContentSnapshot } from '../persistence';
10
+ import { NavigateToSheetOptions } from './utils/navigate-to-sheet';
10
11
 
11
12
  import * as Y from 'yjs';
12
13
  export type { ThemeKey } from '../sheet-engine/core/theme';
@@ -31,6 +32,7 @@ export type DSheetEditorHandle = WorkbookInstance & {
31
32
  encryptedTitle: string;
32
33
  documentTitle: string;
33
34
  }) => void;
35
+ navigateToSheet: (sheetId: string, opts?: NavigateToSheetOptions) => Promise<boolean>;
34
36
  };
35
37
  export interface PanelConfig {
36
38
  id: string;
@@ -112,6 +114,10 @@ export interface DsheetProps {
112
114
  onDataBlockEvent?: (event: DataBlockEvent) => void;
113
115
  onDuneChartEmbed?: () => void;
114
116
  onSheetCountChange?: (sheetCount: number) => void;
117
+ onCopySheetLink?: (args: {
118
+ sheetId: string;
119
+ sheetName: string;
120
+ }) => void;
115
121
  /** Fires whenever local content-sync status changes. Host apps should gate
116
122
  * collab start/resume on 'synced' — starting before local content is fully
117
123
  * synced is what let the RTC layer bind to a stale doc in the past. */
@@ -0,0 +1,3 @@
1
+ import { Context } from '../../sheet-engine/core';
2
+
3
+ export declare function activateSheetForLink(draft: Context, sheetId: string): void;
@@ -0,0 +1,21 @@
1
+ import { WorkbookInstance } from '../../sheet-engine/react';
2
+
3
+ export type ActiveSheetKeeper = {
4
+ /**
5
+ * Call on every Workbook ref attach. `mountKey` must change whenever the
6
+ * Workbook is remounted (i.e. mirror the Workbook's React `key`).
7
+ */
8
+ onAttach: (workbook: WorkbookInstance | null, mountKey: unknown) => void;
9
+ };
10
+ /**
11
+ * Fortune remounts the Workbook whenever the editor bumps its render key
12
+ * (collab rehydration, template apply, imports), and a fresh mount resets the
13
+ * active sheet to the first visible one. Remember the active sheet across
14
+ * attaches and restore it once per mount, as soon as the new mount has sheets.
15
+ *
16
+ * The restore runs synchronously inside the ref callback (React commit phase).
17
+ * That only enqueues a Workbook state update (same as setState in
18
+ * useLayoutEffect), and it goes through the same setContext path as clicking a
19
+ * sheet tab.
20
+ */
21
+ export declare function createActiveSheetKeeper(): ActiveSheetKeeper;
@@ -2,7 +2,7 @@ import { Ref } from 'react';
2
2
  import { WorkbookInstance } from '../../sheet-engine/react';
3
3
  import { DSheetEditorHandle } from '../types';
4
4
 
5
- export type DSheetEditorMethods = Pick<DSheetEditorHandle, "refreshIndexedDB" | "terminateSession" | "updateCollaboratorName" | "updateSessionTitle">;
5
+ export type DSheetEditorMethods = Pick<DSheetEditorHandle, "refreshIndexedDB" | "terminateSession" | "updateCollaboratorName" | "updateSessionTitle" | "navigateToSheet">;
6
6
  /**
7
7
  * Compose Fortune's regenerated imperative handle with dSheet lifecycle methods.
8
8
  * React callback refs invoke this again after every Workbook remount, so both
@@ -0,0 +1,22 @@
1
+ export type NavigableContext = {
2
+ currentSheetId?: string;
3
+ luckysheetfile?: Array<{
4
+ id?: string;
5
+ hide?: number;
6
+ } | null | undefined>;
7
+ };
8
+ export type NavigableEditor = {
9
+ getWorkbookContext?: () => NavigableContext | null | undefined;
10
+ getWorkbookSetContext?: () => ((recipe: (draft: unknown) => void) => void) | null | undefined;
11
+ };
12
+ export type NavigateToSheetOptions = {
13
+ /** How long to wait for the workbook and sheet to load. Default 10s. */
14
+ timeoutMs?: number;
15
+ };
16
+ /**
17
+ * Wait until the workbook has loaded a sheet with `sheetId`, then switch to it.
18
+ * Resolves `false` (never throws) when the sheet is missing after the timeout,
19
+ * hidden, or the switch fails. `getEditor` must return the latest instance on
20
+ * every call because Fortune regenerates its handle on each context change.
21
+ */
22
+ export declare function navigateToSheet<TDraft>(getEditor: () => NavigableEditor | null | undefined, sheetId: string, activate: (draft: TDraft, sheetId: string) => void, { timeoutMs }?: NavigateToSheetOptions): Promise<boolean>;
@@ -11198,6 +11198,7 @@ If the value is FALSE, return the accrued interest from the first interest accru
11198
11198
  cancelText: "Cancelar",
11199
11199
  chooseText: "Confirmar color",
11200
11200
  focus: "Enfocar",
11201
+ copyLink: "Copiar enlace a la hoja",
11201
11202
  tipNameRepeat: "¡El nombre de la página de la pestaña no se puede repetir! Revísalo",
11202
11203
  noMoreSheet: "El libro de trabajo contiene al menos una hoja de trabajo visual. Para eliminar la hoja de trabajo seleccionada, inserta una nueva hoja de trabajo o muestra una hoja de trabajo oculta",
11203
11204
  confirmDelete: "¿Estás seguro de eliminar",
@@ -30,10 +30,10 @@ function Ug(e) {
30
30
  }
31
31
  const Tr = {}, Qa = {
32
32
  en: () => Promise.resolve().then(() => kf),
33
- zh: () => import("./zh-Bv4KIDiJ.js"),
34
- es: () => import("./es-S4GKlN-t.js"),
35
- hi: () => import("./hi-DMMTDTxZ.js"),
36
- "zh-TW": () => import("./zh_tw-BdpsK45h.js")
33
+ zh: () => import("./zh-CmOCFd5t.js"),
34
+ es: () => import("./es-BlDQ6jCL.js"),
35
+ hi: () => import("./hi-CP0ta0Yk.js"),
36
+ "zh-TW": () => import("./zh_tw-BqyRw1gX.js")
37
37
  };
38
38
  async function zg(e) {
39
39
  const t = e in Qa ? e : e.split("-")[0], n = t in Qa ? t : "en";
@@ -12425,6 +12425,7 @@ If the value is FALSE, return the accrued interest from the first interest accru
12425
12425
  cancelText: "Cancel",
12426
12426
  chooseText: "Confirm color",
12427
12427
  focus: "Focus",
12428
+ copyLink: "Copy link to sheet",
12428
12429
  tipNameRepeat: "The name of the tab page cannot be repeated! Please revise",
12429
12430
  noMoreSheet: "The workbook contains at least one visual worksheet. To delete the selected worksheet, please insert a new worksheet or show a hidden worksheet.",
12430
12431
  confirmDelete: "Are you sure you want to delete this sheet?",
package/dist/formula.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { FLVURL as r } from "@fileverse-dev/formulajs";
2
- import { e as t, f } from "./executeStringFunction-B1_kGelH.js";
2
+ import { e as t, f } from "./executeStringFunction-BVMdxpT1.js";
3
3
  export {
4
4
  r as FLVURL,
5
5
  t as executeStringFunction,
@@ -11248,6 +11248,7 @@ If the value is FALSE, return the accrued interest from the first interest accru
11248
11248
  cancelText: "रद्द करें",
11249
11249
  chooseText: "रंग की पुष्टि करें",
11250
11250
  focus: "फोकस करें",
11251
+ copyLink: "शीट का लिंक कॉपी करें",
11251
11252
  tipNameRepeat: "टैब पृष्ठ का नाम दोहराया नहीं जा सकता! कृपया संशोधित करें",
11252
11253
  noMoreSheet: "वर्कबुक में कम से कम एक दृश्य वर्कशीट होनी चाहिए। चयनित वर्कशीट को हटाने के लिए, कृपया एक नई वर्कशीट जोड़ें या एक छुपी हुई वर्कशीट दिखाएं।",
11253
11254
  confirmDelete: "क्या आप वाकई हटाना चाहते हैं",