@fileverse-dev/dsheet 0.0.85 → 0.0.86
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
|
@@ -216076,44 +216076,43 @@ const Cwt = ({
|
|
|
216076
216076
|
toggleTemplateSidebar: o,
|
|
216077
216077
|
onboardingComplete: i,
|
|
216078
216078
|
onboardingHandler: s,
|
|
216079
|
-
|
|
216080
|
-
|
|
216081
|
-
|
|
216082
|
-
|
|
216083
|
-
|
|
216084
|
-
|
|
216085
|
-
|
|
216086
|
-
storeApiKey: p
|
|
216079
|
+
exportDropdownOpen: u = !1,
|
|
216080
|
+
commentData: l,
|
|
216081
|
+
getCommentCellUI: c,
|
|
216082
|
+
setExportDropdownOpen: f = () => {
|
|
216083
|
+
},
|
|
216084
|
+
dsheetId: d,
|
|
216085
|
+
storeApiKey: h
|
|
216087
216086
|
}) => {
|
|
216088
216087
|
const {
|
|
216089
|
-
sheetEditorRef:
|
|
216090
|
-
ydocRef:
|
|
216091
|
-
currentDataRef:
|
|
216092
|
-
handleChange:
|
|
216093
|
-
forceSheetRender:
|
|
216094
|
-
setForceSheetRender:
|
|
216095
|
-
syncStatus:
|
|
216096
|
-
} = XE(), { handleXLSXUpload:
|
|
216097
|
-
sheetEditorRef:
|
|
216098
|
-
ydocRef:
|
|
216099
|
-
setForceSheetRender:
|
|
216100
|
-
dsheetId:
|
|
216101
|
-
currentDataRef:
|
|
216102
|
-
}),
|
|
216088
|
+
sheetEditorRef: p,
|
|
216089
|
+
ydocRef: m,
|
|
216090
|
+
currentDataRef: v,
|
|
216091
|
+
handleChange: g,
|
|
216092
|
+
forceSheetRender: y,
|
|
216093
|
+
setForceSheetRender: b,
|
|
216094
|
+
syncStatus: F
|
|
216095
|
+
} = XE(), { handleXLSXUpload: w } = Cwt({
|
|
216096
|
+
sheetEditorRef: p,
|
|
216097
|
+
ydocRef: m,
|
|
216098
|
+
setForceSheetRender: b,
|
|
216099
|
+
dsheetId: d,
|
|
216100
|
+
currentDataRef: v
|
|
216101
|
+
}), A = a ? n ? ["comment"] : [] : QY, S = a ? ["filter"] : eJ, x = a ? n ? ["filter", "comment"] : ["filter"] : JY;
|
|
216103
216102
|
return ta(() => {
|
|
216104
|
-
const
|
|
216103
|
+
const N = `workbook-${d}-${y}`, D = v.current && v.current.length > 0 ? v.current : a ? [] : LE;
|
|
216105
216104
|
return (
|
|
216106
216105
|
// @ts-ignore
|
|
216107
216106
|
/* @__PURE__ */ cr.jsx(
|
|
216108
216107
|
s6t,
|
|
216109
216108
|
{
|
|
216110
|
-
ref:
|
|
216111
|
-
data:
|
|
216112
|
-
toolbarItems:
|
|
216113
|
-
cellContextMenu:
|
|
216114
|
-
headerContextMenu:
|
|
216115
|
-
getCommentCellUI:
|
|
216116
|
-
onChange:
|
|
216109
|
+
ref: p,
|
|
216110
|
+
data: D,
|
|
216111
|
+
toolbarItems: x,
|
|
216112
|
+
cellContextMenu: A,
|
|
216113
|
+
headerContextMenu: S,
|
|
216114
|
+
getCommentCellUI: c,
|
|
216115
|
+
onChange: g,
|
|
216117
216116
|
showFormulaBar: !0,
|
|
216118
216117
|
showToolbar: !0,
|
|
216119
216118
|
lang: "en",
|
|
@@ -216122,56 +216121,54 @@ const Cwt = ({
|
|
|
216122
216121
|
defaultColWidth: 100,
|
|
216123
216122
|
defaultRowHeight: 21,
|
|
216124
216123
|
customToolbarItems: a ? [] : u6t({
|
|
216125
|
-
setExportDropdownOpen:
|
|
216124
|
+
setExportDropdownOpen: f,
|
|
216126
216125
|
handleCSVUpload: N6t,
|
|
216127
|
-
handleXLSXUpload:
|
|
216126
|
+
handleXLSXUpload: w,
|
|
216128
216127
|
handleExportToXLSX: Awt,
|
|
216129
216128
|
handleExportToCSV: Twt,
|
|
216130
216129
|
handleExportToJSON: xwt,
|
|
216131
|
-
sheetEditorRef:
|
|
216132
|
-
ydocRef:
|
|
216133
|
-
dsheetId:
|
|
216134
|
-
currentDataRef:
|
|
216135
|
-
setForceSheetRender:
|
|
216130
|
+
sheetEditorRef: p,
|
|
216131
|
+
ydocRef: m,
|
|
216132
|
+
dsheetId: d,
|
|
216133
|
+
currentDataRef: v,
|
|
216134
|
+
setForceSheetRender: b,
|
|
216136
216135
|
toggleTemplateSidebar: o,
|
|
216137
216136
|
setShowFetchURLModal: r
|
|
216138
216137
|
}),
|
|
216139
216138
|
hooks: {
|
|
216140
|
-
afterUpdateCell: (O, E, B
|
|
216141
|
-
console.log("afterUpdateCell Old value",
|
|
216142
|
-
const
|
|
216139
|
+
afterUpdateCell: (j, O, E, B) => {
|
|
216140
|
+
console.log("afterUpdateCell Old value", E);
|
|
216141
|
+
const k = { current: p.current };
|
|
216143
216142
|
E6t({
|
|
216144
|
-
row:
|
|
216145
|
-
column:
|
|
216146
|
-
newValue:
|
|
216147
|
-
sheetEditorRef:
|
|
216143
|
+
row: j,
|
|
216144
|
+
column: O,
|
|
216145
|
+
newValue: B,
|
|
216146
|
+
sheetEditorRef: k,
|
|
216148
216147
|
onboardingComplete: i,
|
|
216149
216148
|
// @ts-ignore
|
|
216150
216149
|
setFetchingURLData: t,
|
|
216151
216150
|
onboardingHandler: s,
|
|
216152
|
-
|
|
216153
|
-
storeApiKey: p,
|
|
216151
|
+
storeApiKey: h,
|
|
216154
216152
|
setInputFetchURLDataBlock: e
|
|
216155
216153
|
});
|
|
216156
216154
|
}
|
|
216157
216155
|
}
|
|
216158
216156
|
},
|
|
216159
|
-
|
|
216157
|
+
N
|
|
216160
216158
|
)
|
|
216161
216159
|
);
|
|
216162
216160
|
}, [
|
|
216163
|
-
b,
|
|
216164
|
-
a,
|
|
216165
216161
|
y,
|
|
216162
|
+
a,
|
|
216163
|
+
g,
|
|
216166
216164
|
o,
|
|
216167
216165
|
i,
|
|
216168
216166
|
s,
|
|
216167
|
+
d,
|
|
216169
216168
|
u,
|
|
216170
|
-
h,
|
|
216171
216169
|
l,
|
|
216172
|
-
|
|
216173
|
-
|
|
216174
|
-
g.current
|
|
216170
|
+
F,
|
|
216171
|
+
v.current
|
|
216175
216172
|
]);
|
|
216176
216173
|
}, Ewt = [
|
|
216177
216174
|
{
|
|
@@ -291099,42 +291096,41 @@ const Cwt = ({
|
|
|
291099
291096
|
toggleTemplateSidebar: n,
|
|
291100
291097
|
onboardingComplete: o,
|
|
291101
291098
|
onboardingHandler: i,
|
|
291102
|
-
|
|
291103
|
-
|
|
291104
|
-
|
|
291105
|
-
|
|
291106
|
-
|
|
291107
|
-
|
|
291108
|
-
|
|
291109
|
-
|
|
291110
|
-
|
|
291111
|
-
|
|
291112
|
-
storeApiKey: g
|
|
291099
|
+
isTemplateOpen: s,
|
|
291100
|
+
exportDropdownOpen: u,
|
|
291101
|
+
setExportDropdownOpen: l,
|
|
291102
|
+
dsheetId: c,
|
|
291103
|
+
commentData: f,
|
|
291104
|
+
getCommentCellUI: d,
|
|
291105
|
+
selectedTemplate: h,
|
|
291106
|
+
setFetchingURLData: p,
|
|
291107
|
+
setInputFetchURLDataBlock: m,
|
|
291108
|
+
storeApiKey: v
|
|
291113
291109
|
}) => {
|
|
291114
291110
|
const {
|
|
291115
|
-
loading:
|
|
291116
|
-
sheetEditorRef:
|
|
291117
|
-
currentDataRef:
|
|
291118
|
-
ydocRef:
|
|
291119
|
-
setForceSheetRender:
|
|
291111
|
+
loading: g,
|
|
291112
|
+
sheetEditorRef: y,
|
|
291113
|
+
currentDataRef: b,
|
|
291114
|
+
ydocRef: F,
|
|
291115
|
+
setForceSheetRender: w
|
|
291120
291116
|
} = XE();
|
|
291121
291117
|
Dwt({
|
|
291122
|
-
selectedTemplate:
|
|
291123
|
-
ydocRef:
|
|
291124
|
-
dsheetId:
|
|
291125
|
-
currentDataRef:
|
|
291126
|
-
setForceSheetRender:
|
|
291127
|
-
sheetEditorRef:
|
|
291118
|
+
selectedTemplate: h,
|
|
291119
|
+
ydocRef: F,
|
|
291120
|
+
dsheetId: c,
|
|
291121
|
+
currentDataRef: b,
|
|
291122
|
+
setForceSheetRender: w,
|
|
291123
|
+
sheetEditorRef: y
|
|
291128
291124
|
}), PZ({
|
|
291129
|
-
exportDropdownOpen:
|
|
291130
|
-
isTemplateOpen:
|
|
291125
|
+
exportDropdownOpen: u,
|
|
291126
|
+
isTemplateOpen: s,
|
|
291131
291127
|
isReadOnly: t,
|
|
291132
|
-
loading:
|
|
291128
|
+
loading: g
|
|
291133
291129
|
});
|
|
291134
|
-
const
|
|
291135
|
-
sheetEditorRef:
|
|
291136
|
-
currentDataRef:
|
|
291137
|
-
ydocRef:
|
|
291130
|
+
const A = {
|
|
291131
|
+
sheetEditorRef: y,
|
|
291132
|
+
currentDataRef: b,
|
|
291133
|
+
ydocRef: F
|
|
291138
291134
|
};
|
|
291139
291135
|
return /* @__PURE__ */ cr.jsxs(
|
|
291140
291136
|
"div",
|
|
@@ -291155,7 +291151,7 @@ const Cwt = ({
|
|
|
291155
291151
|
"translate-y-[-100%]": !1
|
|
291156
291152
|
}
|
|
291157
291153
|
),
|
|
291158
|
-
children: r(
|
|
291154
|
+
children: r(A)
|
|
291159
291155
|
}
|
|
291160
291156
|
),
|
|
291161
291157
|
/* @__PURE__ */ cr.jsxs(
|
|
@@ -291164,26 +291160,25 @@ const Cwt = ({
|
|
|
291164
291160
|
style: { height: "97.8%", marginTop: "44px" },
|
|
291165
291161
|
className: "relative overflow-hidden",
|
|
291166
291162
|
children: [
|
|
291167
|
-
/* @__PURE__ */ cr.jsx(yS, { show:
|
|
291168
|
-
/* @__PURE__ */ cr.jsxs(yS, { show: !
|
|
291163
|
+
/* @__PURE__ */ cr.jsx(yS, { show: g, children: /* @__PURE__ */ cr.jsx(WZ, { isReadOnly: t }) }),
|
|
291164
|
+
/* @__PURE__ */ cr.jsxs(yS, { show: !g, children: [
|
|
291169
291165
|
t && /* @__PURE__ */ cr.jsx("div", { className: "absolute top-2 right-4 z-20", children: /* @__PURE__ */ cr.jsx(Nwt, { allowComments: a || !1 }) }),
|
|
291170
291166
|
/* @__PURE__ */ cr.jsx(
|
|
291171
291167
|
Swt,
|
|
291172
291168
|
{
|
|
291173
291169
|
setShowFetchURLModal: e,
|
|
291174
|
-
setFetchingURLData:
|
|
291175
|
-
setInputFetchURLDataBlock:
|
|
291176
|
-
commentData:
|
|
291177
|
-
getCommentCellUI:
|
|
291170
|
+
setFetchingURLData: p,
|
|
291171
|
+
setInputFetchURLDataBlock: m,
|
|
291172
|
+
commentData: f,
|
|
291173
|
+
getCommentCellUI: d,
|
|
291178
291174
|
isReadOnly: t,
|
|
291179
291175
|
toggleTemplateSidebar: n,
|
|
291180
291176
|
onboardingComplete: o,
|
|
291181
291177
|
onboardingHandler: i,
|
|
291182
|
-
|
|
291183
|
-
|
|
291184
|
-
|
|
291185
|
-
|
|
291186
|
-
storeApiKey: g,
|
|
291178
|
+
exportDropdownOpen: u,
|
|
291179
|
+
setExportDropdownOpen: l,
|
|
291180
|
+
dsheetId: c,
|
|
291181
|
+
storeApiKey: v,
|
|
291187
291182
|
allowComments: a
|
|
291188
291183
|
}
|
|
291189
291184
|
)
|
|
@@ -291212,14 +291207,13 @@ const Cwt = ({
|
|
|
291212
291207
|
onboardingHandler: p,
|
|
291213
291208
|
commentData: m,
|
|
291214
291209
|
getCommentCellUI: v,
|
|
291215
|
-
|
|
291216
|
-
|
|
291217
|
-
|
|
291218
|
-
|
|
291219
|
-
|
|
291220
|
-
storeApiKey: A
|
|
291210
|
+
setFetchingURLData: g,
|
|
291211
|
+
setShowFetchURLModal: y,
|
|
291212
|
+
setInputFetchURLDataBlock: b,
|
|
291213
|
+
sheetEditorRef: F,
|
|
291214
|
+
storeApiKey: w
|
|
291221
291215
|
}) => {
|
|
291222
|
-
const [
|
|
291216
|
+
const [A, S] = _t(!1);
|
|
291223
291217
|
return /* @__PURE__ */ cr.jsx(
|
|
291224
291218
|
NJ,
|
|
291225
291219
|
{
|
|
@@ -291230,7 +291224,7 @@ const Cwt = ({
|
|
|
291230
291224
|
enableWebrtc: d,
|
|
291231
291225
|
isReadOnly: r,
|
|
291232
291226
|
onChange: s,
|
|
291233
|
-
externalEditorRef:
|
|
291227
|
+
externalEditorRef: F,
|
|
291234
291228
|
isCollaborative: e,
|
|
291235
291229
|
commentData: m,
|
|
291236
291230
|
children: /* @__PURE__ */ cr.jsx(
|
|
@@ -291239,20 +291233,19 @@ const Cwt = ({
|
|
|
291239
291233
|
commentData: m,
|
|
291240
291234
|
getCommentCellUI: v,
|
|
291241
291235
|
renderNavbar: a,
|
|
291242
|
-
setFetchingURLData:
|
|
291243
|
-
setShowFetchURLModal:
|
|
291244
|
-
setInputFetchURLDataBlock:
|
|
291236
|
+
setFetchingURLData: g,
|
|
291237
|
+
setShowFetchURLModal: y,
|
|
291238
|
+
setInputFetchURLDataBlock: b,
|
|
291245
291239
|
isReadOnly: r,
|
|
291246
291240
|
toggleTemplateSidebar: c,
|
|
291247
291241
|
onboardingComplete: h,
|
|
291248
291242
|
onboardingHandler: p,
|
|
291249
|
-
dataBlockApiKeyHandler: g,
|
|
291250
291243
|
isTemplateOpen: f,
|
|
291251
|
-
exportDropdownOpen:
|
|
291252
|
-
setExportDropdownOpen:
|
|
291244
|
+
exportDropdownOpen: A,
|
|
291245
|
+
setExportDropdownOpen: S,
|
|
291253
291246
|
dsheetId: o,
|
|
291254
291247
|
selectedTemplate: l,
|
|
291255
|
-
storeApiKey:
|
|
291248
|
+
storeApiKey: w,
|
|
291256
291249
|
allowComments: t
|
|
291257
291250
|
}
|
|
291258
291251
|
)
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { OnboardingHandlerType
|
|
2
|
+
import { OnboardingHandlerType } from '../types';
|
|
3
3
|
|
|
4
4
|
type OnboardingHandler = OnboardingHandlerType;
|
|
5
|
-
type DataBlockApiKeyHandler = DataBlockApiKeyHandlerType;
|
|
6
5
|
interface EditorWorkbookProps {
|
|
7
6
|
setShowFetchURLModal?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
8
7
|
setFetchingURLData?: (fetching: boolean) => void;
|
|
@@ -12,7 +11,6 @@ interface EditorWorkbookProps {
|
|
|
12
11
|
toggleTemplateSidebar?: () => void;
|
|
13
12
|
onboardingComplete?: boolean;
|
|
14
13
|
onboardingHandler?: OnboardingHandler;
|
|
15
|
-
dataBlockApiKeyHandler?: DataBlockApiKeyHandler;
|
|
16
14
|
exportDropdownOpen?: boolean;
|
|
17
15
|
commentData?: Object;
|
|
18
16
|
getCommentCellUI?: (row: number, column: number) => void;
|
|
@@ -7,5 +7,5 @@ import { DsheetProps } from './types';
|
|
|
7
7
|
* @param props - Component properties
|
|
8
8
|
* @returns The SpreadsheetEditor component
|
|
9
9
|
*/
|
|
10
|
-
declare const SpreadsheetEditor: ({ isCollaborative, isReadOnly, allowComments, renderNavbar, enableIndexeddbSync, dsheetId, portalContent, onChange, username, selectedTemplate, toggleTemplateSidebar, isTemplateOpen, enableWebrtc, onboardingComplete, onboardingHandler, commentData, getCommentCellUI,
|
|
10
|
+
declare const SpreadsheetEditor: ({ isCollaborative, isReadOnly, allowComments, renderNavbar, enableIndexeddbSync, dsheetId, portalContent, onChange, username, selectedTemplate, toggleTemplateSidebar, isTemplateOpen, enableWebrtc, onboardingComplete, onboardingHandler, commentData, getCommentCellUI, setFetchingURLData, setShowFetchURLModal, setInputFetchURLDataBlock, sheetEditorRef: externalSheetEditorRef, storeApiKey, }: DsheetProps) => JSX.Element;
|
|
11
11
|
export default SpreadsheetEditor;
|
package/dist/package/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Sheet
|
|
1
|
+
import { Sheet } from '@fileverse-dev/fortune-core';
|
|
2
2
|
import { RefObject } from 'react';
|
|
3
3
|
import { WorkbookInstance } from '@fileverse-dev/fortune-react';
|
|
4
4
|
|
|
@@ -19,21 +19,6 @@ export type OnboardingHandlerType = (params: {
|
|
|
19
19
|
row: number;
|
|
20
20
|
column: number;
|
|
21
21
|
};
|
|
22
|
-
export type DataBlockApiKeyHandlerType = (params: {
|
|
23
|
-
data: string;
|
|
24
|
-
sheetEditorRef: React.RefObject<WorkbookInstance | null>;
|
|
25
|
-
executeStringFunction: (functionCallString: string) => Promise<unknown>;
|
|
26
|
-
row: number;
|
|
27
|
-
column: number;
|
|
28
|
-
newValue: Cell;
|
|
29
|
-
formulaResponseUiSync: (params: {
|
|
30
|
-
row: number;
|
|
31
|
-
column: number;
|
|
32
|
-
newValue: Record<string, string>;
|
|
33
|
-
apiData: Array<Record<string, object>>;
|
|
34
|
-
sheetEditorRef: React.RefObject<WorkbookInstance | null>;
|
|
35
|
-
}) => void;
|
|
36
|
-
}) => void;
|
|
37
22
|
export interface DsheetProps {
|
|
38
23
|
setShowFetchURLModal?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
39
24
|
setFetchingURLData?: (fetching: boolean) => void;
|
|
@@ -51,7 +36,6 @@ export interface DsheetProps {
|
|
|
51
36
|
selectedTemplate?: string;
|
|
52
37
|
onboardingComplete?: boolean;
|
|
53
38
|
onboardingHandler?: OnboardingHandlerType;
|
|
54
|
-
dataBlockApiKeyHandler?: DataBlockApiKeyHandlerType;
|
|
55
39
|
setForceSheetRender?: React.Dispatch<React.SetStateAction<number>>;
|
|
56
40
|
getCommentCellUI?: (row: number, column: number) => void;
|
|
57
41
|
commentData?: Object;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Cell } from '@fileverse-dev/fortune-core';
|
|
2
2
|
import { WorkbookInstance } from '@fileverse-dev/fortune-react';
|
|
3
|
-
import { OnboardingHandlerType
|
|
3
|
+
import { OnboardingHandlerType } from '../types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Parameters for the afterUpdateCell function
|
|
@@ -13,7 +13,6 @@ interface AfterUpdateCellParams {
|
|
|
13
13
|
onboardingComplete: boolean | undefined;
|
|
14
14
|
setFetchingURLData: (fetching: boolean) => void;
|
|
15
15
|
onboardingHandler: OnboardingHandlerType | undefined;
|
|
16
|
-
dataBlockApiKeyHandler: DataBlockApiKeyHandlerType | undefined;
|
|
17
16
|
setInputFetchURLDataBlock: React.Dispatch<React.SetStateAction<string>> | undefined;
|
|
18
17
|
storeApiKey?: (apiKeyName: string) => void;
|
|
19
18
|
}
|