@fileverse-dev/dsheet 4.1.8 → 4.1.9-cmt

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 (34) hide show
  1. package/dist/editor/components/export-menu-section.d.ts +2 -1
  2. package/dist/editor/components/import-button-ui.d.ts +3 -1
  3. package/dist/editor/components/read-only-export-button.d.ts +1 -1
  4. package/dist/editor/hooks/use-homepage-redirect.d.ts +2 -1
  5. package/dist/editor/hooks/use-xlsx-import.d.ts +4 -2
  6. package/dist/editor/utils/custom-toolbar-item.d.ts +5 -2
  7. package/dist/editor/utils/ods-export-sanitize.d.ts +9 -0
  8. package/dist/editor/utils/ods-export-sanitize.test.d.ts +1 -0
  9. package/dist/editor/utils/ods-to-xlsx.d.ts +6 -0
  10. package/dist/editor/utils/spreadsheet-import.d.ts +1 -1
  11. package/dist/editor/utils/xlsx-export-impl.d.ts +1 -0
  12. package/dist/editor/utils/xlsx-export.d.ts +1 -0
  13. package/dist/{es-BonrkVxY.js → es-yR2JIXsz.js} +8 -2
  14. package/dist/{executeStringFunction-V_hu5VRM.js → executeStringFunction-DMMvpc-I.js} +1385 -1374
  15. package/dist/formula.js +1 -1
  16. package/dist/{hi-Ca55EZ4A.js → hi-DRcLnrnZ.js} +8 -2
  17. package/dist/{index-GBqDuF2T.js → index-D-LWXwhT.js} +9657 -9505
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.es.js +44 -43
  20. package/dist/ods-to-xlsx-DeJAYBkD.js +19 -0
  21. package/dist/sheet-engine/core/locale/en.d.ts +1 -0
  22. package/dist/sheet-engine/core/locale/es.d.ts +1 -0
  23. package/dist/sheet-engine/core/locale/hi.d.ts +1 -0
  24. package/dist/sheet-engine/core/locale/zh.d.ts +1 -0
  25. package/dist/sheet-engine/core/locale/zh_tw.d.ts +1 -0
  26. package/dist/style.css +1 -1
  27. package/dist/{use-xlsx-import-impl-CkHRRbtb.js → use-xlsx-import-impl-D5I9O2H5.js} +4 -4
  28. package/dist/{xlsx-defined-names-CBoWA_1s.js → xlsx-defined-names--Q1w2nN5.js} +2 -2
  29. package/dist/xlsx-export-impl-s13TyH01.js +880 -0
  30. package/dist/{xlsx-hyperlink-inline-CY7B4A0C.js → xlsx-hyperlink-inline-lfx1jg1v.js} +2 -2
  31. package/dist/{zh-BfQYzoDQ.js → zh-B1KUs68q.js} +4 -2
  32. package/dist/{zh_tw-CINWHD2H.js → zh_tw-B9_7WgLO.js} +4 -2
  33. package/package.json +3 -2
  34. package/dist/xlsx-export-impl-YSSLVP-V.js +0 -835
@@ -1,5 +1,6 @@
1
1
  export type ExportHandlers = {
2
2
  handleExportToXLSX: () => void;
3
+ handleExportToODS: () => void;
3
4
  handleExportToCSV: () => void;
4
5
  handleExportToJSON: () => void;
5
6
  };
@@ -7,5 +8,5 @@ type ExportMenuSectionProps = ExportHandlers & {
7
8
  onItemClick?: () => void;
8
9
  testIdPrefix?: string;
9
10
  };
10
- export declare const ExportMenuSection: ({ handleExportToJSON, handleExportToXLSX, handleExportToCSV, onItemClick, testIdPrefix, }: ExportMenuSectionProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const ExportMenuSection: ({ handleExportToJSON, handleExportToXLSX, handleExportToODS, handleExportToCSV, onItemClick, testIdPrefix, }: ExportMenuSectionProps) => import("react/jsx-runtime").JSX.Element;
11
12
  export {};
@@ -1,10 +1,12 @@
1
1
  import { ChangeEventHandler } from 'react';
2
2
 
3
- export declare const CustomButton: ({ setExportDropdownOpen, handleCSVUpload, handleXLSXUpload, handleExportToXLSX, handleExportToCSV, handleExportToJSON, }: {
3
+ export declare const CustomButton: ({ setExportDropdownOpen, handleCSVUpload, handleXLSXUpload, handleODSUpload, handleExportToXLSX, handleExportToODS, handleExportToCSV, handleExportToJSON, }: {
4
4
  setExportDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;
5
5
  handleCSVUpload: (event: ChangeEventHandler<HTMLInputElement> | undefined, file: any, importType: string, separatorType: string) => void | Promise<void>;
6
6
  handleXLSXUpload: (event: ChangeEventHandler<HTMLInputElement> | undefined, file: any, importType: string) => void | Promise<void>;
7
+ handleODSUpload: (event: ChangeEventHandler<HTMLInputElement> | undefined, file: any, importType: string) => void | Promise<void>;
7
8
  handleExportToXLSX: () => void;
9
+ handleExportToODS: () => void;
8
10
  handleExportToCSV: () => void;
9
11
  handleExportToJSON: () => void;
10
12
  }) => import("react/jsx-runtime").JSX.Element;
@@ -3,5 +3,5 @@ import { ExportHandlers } from './export-menu-section';
3
3
  type ReadOnlyExportButtonProps = ExportHandlers & {
4
4
  setExportDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;
5
5
  };
6
- export declare const ReadOnlyExportButton: ({ setExportDropdownOpen, handleExportToXLSX, handleExportToCSV, handleExportToJSON, }: ReadOnlyExportButtonProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const ReadOnlyExportButton: ({ setExportDropdownOpen, handleExportToXLSX, handleExportToODS, handleExportToCSV, handleExportToJSON, }: ReadOnlyExportButtonProps) => import("react/jsx-runtime").JSX.Element;
7
7
  export {};
@@ -1,10 +1,11 @@
1
1
  import { WorkbookInstance } from '../../sheet-engine/react';
2
2
 
3
3
  import * as Y from 'yjs';
4
- export declare const usehandleHomepageRedirect: ({ setIsDataLoaded, setSelectedTemplate, handleXLSXUpload, handleCSVUpload, ydocRef, dsheetId, currentDataRef, setForceSheetRender, sheetEditorRef, updateDocumentTitle, }: {
4
+ export declare const usehandleHomepageRedirect: ({ setIsDataLoaded, setSelectedTemplate, handleXLSXUpload, handleODSUpload, handleCSVUpload, ydocRef, dsheetId, currentDataRef, setForceSheetRender, sheetEditorRef, updateDocumentTitle, }: {
5
5
  setIsDataLoaded: React.Dispatch<React.SetStateAction<boolean>>;
6
6
  setSelectedTemplate?: React.Dispatch<React.SetStateAction<string>>;
7
7
  handleXLSXUpload: any;
8
+ handleODSUpload: any;
8
9
  handleCSVUpload: any;
9
10
  ydocRef: React.RefObject<Y.Doc | null>;
10
11
  dsheetId: string;
@@ -4,8 +4,9 @@ import { WorkbookInstance } from '../../sheet-engine/react';
4
4
  import type * as Y from 'yjs';
5
5
  type ImportType = 'new-dsheet' | 'merge-current-dsheet' | 'new-current-dsheet';
6
6
  /**
7
- * XLSX import: keeps ~100k+ LOC (SSF, hyperlink helpers, exceljs/luckyexcel orchestration)
8
- * in a separate chunk until the user actually imports a file.
7
+ * XLSX / ODS import: keeps ~100k+ LOC (SSF, hyperlink helpers, exceljs/luckyexcel
8
+ * orchestration) in a separate chunk until the user actually imports a file.
9
+ * ODS is converted to XLSX first, then runs the same pipeline.
9
10
  */
10
11
  export declare const useXLSXImport: ({ sheetEditorRef, ydocRef, setForceSheetRender, dsheetId, currentDataRef, updateDocumentTitle, handleContentPortal, }: {
11
12
  sheetEditorRef: RefObject<WorkbookInstance | null>;
@@ -17,5 +18,6 @@ export declare const useXLSXImport: ({ sheetEditorRef, ydocRef, setForceSheetRen
17
18
  handleContentPortal?: () => void;
18
19
  }) => {
19
20
  handleXLSXUpload: (event: ChangeEvent<HTMLInputElement> | undefined, fileArg: File, importType?: ImportType) => Promise<void>;
21
+ handleODSUpload: (event: ChangeEvent<HTMLInputElement> | undefined, fileArg: File, importType?: ImportType) => Promise<void>;
20
22
  };
21
23
  export {};
@@ -2,7 +2,7 @@ import { default as React, ChangeEventHandler } from 'react';
2
2
  import { WorkbookInstance } from '../../sheet-engine/react';
3
3
 
4
4
  import * as Y from 'yjs';
5
- export declare const getCustomToolbarItems: ({ handleContentPortal, setShowSmartContractModal, setExportDropdownOpen, handleCSVUpload, handleXLSXUpload, handleExportToXLSX, handleExportToCSV, handleExportToJSON, sheetEditorRef, ydocRef, dsheetId, currentDataRef, setForceSheetRender, toggleTemplateSidebar, getDocumentTitle, updateDocumentTitle, }: {
5
+ export declare const getCustomToolbarItems: ({ handleContentPortal, setShowSmartContractModal, setExportDropdownOpen, handleCSVUpload, handleXLSXUpload, handleODSUpload, handleExportToXLSX, handleExportToODS, handleExportToCSV, handleExportToJSON, sheetEditorRef, ydocRef, dsheetId, currentDataRef, setForceSheetRender, toggleTemplateSidebar, getDocumentTitle, updateDocumentTitle, }: {
6
6
  handleContentPortal?: any;
7
7
  setShowSmartContractModal?: React.Dispatch<React.SetStateAction<boolean>>;
8
8
  getDocumentTitle?: (dsheetId: string) => Promise<string>;
@@ -10,7 +10,9 @@ export declare const getCustomToolbarItems: ({ handleContentPortal, setShowSmart
10
10
  setExportDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;
11
11
  handleCSVUpload: (event: ChangeEventHandler<HTMLInputElement> | undefined, ydocRef: Y.Doc | null, setForceSheetRender: React.Dispatch<React.SetStateAction<number>>, dsheetId: string, currentDataRef: React.MutableRefObject<object | null>, sheetEditorRef: React.RefObject<WorkbookInstance | null>, updateDocumentTitle?: (title: string) => void, file?: File, importType?: string, handleContentPortal?: any, separatorType?: string) => void | Promise<void>;
12
12
  handleXLSXUpload: (event: ChangeEventHandler<HTMLInputElement> | undefined, file?: File, importType?: string) => void | Promise<void>;
13
+ handleODSUpload: (event: ChangeEventHandler<HTMLInputElement> | undefined, file?: File, importType?: string) => void | Promise<void>;
13
14
  handleExportToXLSX: (sheetEditorRef: React.RefObject<WorkbookInstance | null>, ydocRef: React.RefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: (dsheetId: string) => Promise<string>) => void;
15
+ handleExportToODS: (sheetEditorRef: React.RefObject<WorkbookInstance | null>, ydocRef: React.RefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: (dsheetId: string) => Promise<string>) => void;
14
16
  handleExportToCSV: (sheetEditorRef: React.RefObject<WorkbookInstance | null>, ydocRef: React.RefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: (dsheetId: string) => Promise<string>) => void;
15
17
  handleExportToJSON: (sheetEditorRef: React.RefObject<WorkbookInstance | null>, ydocRef: React.RefObject<Y.Doc | null>, dsheetId: string) => void;
16
18
  sheetEditorRef: React.RefObject<WorkbookInstance | null>;
@@ -34,6 +36,7 @@ export declare const getCustomToolbarItems: ({ handleContentPortal, setShowSmart
34
36
  type ReadOnlyExportDeps = {
35
37
  setExportDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;
36
38
  handleExportToXLSX: (sheetEditorRef: React.RefObject<WorkbookInstance | null>, ydocRef: React.RefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: (dsheetId: string) => Promise<string>) => void;
39
+ handleExportToODS: (sheetEditorRef: React.RefObject<WorkbookInstance | null>, ydocRef: React.RefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: (dsheetId: string) => Promise<string>) => void;
37
40
  handleExportToCSV: (sheetEditorRef: React.RefObject<WorkbookInstance | null>, ydocRef: React.RefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: (dsheetId: string) => Promise<string>) => void;
38
41
  handleExportToJSON: (sheetEditorRef: React.RefObject<WorkbookInstance | null>, ydocRef: React.RefObject<Y.Doc | null>, dsheetId: string) => void;
39
42
  sheetEditorRef: React.RefObject<WorkbookInstance | null>;
@@ -41,7 +44,7 @@ type ReadOnlyExportDeps = {
41
44
  dsheetId: string;
42
45
  getDocumentTitle?: (dsheetId: string) => Promise<string>;
43
46
  };
44
- export declare const getReadOnlyCustomToolbarItems: ({ setExportDropdownOpen, handleExportToXLSX, handleExportToCSV, handleExportToJSON, sheetEditorRef, ydocRef, dsheetId, getDocumentTitle, }: ReadOnlyExportDeps) => {
47
+ export declare const getReadOnlyCustomToolbarItems: ({ setExportDropdownOpen, handleExportToXLSX, handleExportToODS, handleExportToCSV, handleExportToJSON, sheetEditorRef, ydocRef, dsheetId, getDocumentTitle, }: ReadOnlyExportDeps) => {
45
48
  key: string;
46
49
  tooltip: string;
47
50
  onClick: () => void;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Fortune uses ct.t = 'g' (general) for plain text. SheetJS / ODS only
3
+ * understand b|n|e|s|d|z|str. Writing 'g' drops those cells in Google Sheets
4
+ * and can NRE in .NET ODS readers when paired with xlsx-js-style `s` objects.
5
+ */
6
+ export declare function toSheetJsCellType(fortuneOrSheetType: unknown, value: unknown): 'b' | 'n' | 'e' | 's' | 'd' | 'z' | 'str';
7
+ /** Keep only fields the ODS writer handles; drop style blobs that crash parsers. */
8
+ export declare function sanitizeSheetJsCellForOds(cell: Record<string, unknown>): void;
9
+ export declare function sanitizeWorksheetForOds(worksheet: Record<string, unknown>): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Convert an ODS file to an XLSX File so we can reuse the existing LuckyExcel
3
+ * + ExcelJS import pipeline (XLSX-only). Values, formulas, and sheets are
4
+ * preserved; LibreOffice-specific styling may be reduced.
5
+ */
6
+ export declare function convertOdsFileToXlsxFile(file: File): Promise<File>;
@@ -1,4 +1,4 @@
1
- export type SpreadsheetImportFileType = 'xlsx' | 'csv';
1
+ export type SpreadsheetImportFileType = 'xlsx' | 'csv' | 'ods';
2
2
  export type ImportSpreadsheetFileOptions = {
3
3
  type: SpreadsheetImportFileType;
4
4
  separator?: 'auto' | 'tab' | 'comma' | string;
@@ -2,3 +2,4 @@ import { WorkbookInstance } from '../../sheet-engine/react';
2
2
  import { MutableRefObject } from 'react';
3
3
  import * as Y from 'yjs';
4
4
  export declare const handleExportToXLSX: (workbookRef: MutableRefObject<WorkbookInstance | null>, ydocRef: MutableRefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: (dsheetId: string) => Promise<string>) => Promise<void>;
5
+ export declare const handleExportToODS: (workbookRef: MutableRefObject<WorkbookInstance | null>, ydocRef: MutableRefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: (dsheetId: string) => Promise<string>) => Promise<void>;
@@ -6,3 +6,4 @@ import * as Y from 'yjs';
6
6
  * Keeps the main editor chunk smaller for consuming apps.
7
7
  */
8
8
  export declare const handleExportToXLSX: (workbookRef: MutableRefObject<WorkbookInstance | null>, ydocRef: MutableRefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: (dsheetId: string) => Promise<string>) => Promise<void>;
9
+ export declare const handleExportToODS: (workbookRef: MutableRefObject<WorkbookInstance | null>, ydocRef: MutableRefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: (dsheetId: string) => Promise<string>) => Promise<void>;
@@ -10844,8 +10844,14 @@ If the value is FALSE, return the accrued interest from the first interest accru
10844
10844
  fontFamily: {
10845
10845
  MicrosoftYaHei: "YaHei"
10846
10846
  },
10847
- fontarray: ["Times New Roman", "Arial", "Tahoma", "Verdana"],
10848
- fontjson: { "times new roman": 0, arial: 1, tahoma: 2, verdana: 3 },
10847
+ fontarray: ["Times New Roman", "Arial", "Tahoma", "Verdana", "Calibri"],
10848
+ fontjson: {
10849
+ "times new roman": 0,
10850
+ arial: 1,
10851
+ tahoma: 2,
10852
+ verdana: 3,
10853
+ calibri: 4
10854
+ },
10849
10855
  border: {
10850
10856
  borderTop: "borderTop",
10851
10857
  borderBottom: "borderBottom",