@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
- dataBlockApiKeyHandler: u,
216080
- exportDropdownOpen: l = !1,
216081
- commentData: c,
216082
- getCommentCellUI: f,
216083
- setExportDropdownOpen: d = () => {
216084
- },
216085
- dsheetId: h,
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: m,
216090
- ydocRef: v,
216091
- currentDataRef: g,
216092
- handleChange: y,
216093
- forceSheetRender: b,
216094
- setForceSheetRender: F,
216095
- syncStatus: w
216096
- } = XE(), { handleXLSXUpload: A } = Cwt({
216097
- sheetEditorRef: m,
216098
- ydocRef: v,
216099
- setForceSheetRender: F,
216100
- dsheetId: h,
216101
- currentDataRef: g
216102
- }), S = a ? n ? ["comment"] : [] : QY, x = a ? ["filter"] : eJ, N = a ? n ? ["filter", "comment"] : ["filter"] : JY;
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 D = `workbook-${h}-${b}`, j = g.current && g.current.length > 0 ? g.current : a ? [] : LE;
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: m,
216111
- data: j,
216112
- toolbarItems: N,
216113
- cellContextMenu: S,
216114
- headerContextMenu: x,
216115
- getCommentCellUI: f,
216116
- onChange: y,
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: d,
216124
+ setExportDropdownOpen: f,
216126
216125
  handleCSVUpload: N6t,
216127
- handleXLSXUpload: A,
216126
+ handleXLSXUpload: w,
216128
216127
  handleExportToXLSX: Awt,
216129
216128
  handleExportToCSV: Twt,
216130
216129
  handleExportToJSON: xwt,
216131
- sheetEditorRef: m,
216132
- ydocRef: v,
216133
- dsheetId: h,
216134
- currentDataRef: g,
216135
- setForceSheetRender: F,
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, k) => {
216141
- console.log("afterUpdateCell Old value", B);
216142
- const T = { current: m.current };
216139
+ afterUpdateCell: (j, O, E, B) => {
216140
+ console.log("afterUpdateCell Old value", E);
216141
+ const k = { current: p.current };
216143
216142
  E6t({
216144
- row: O,
216145
- column: E,
216146
- newValue: k,
216147
- sheetEditorRef: T,
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
- dataBlockApiKeyHandler: u,
216153
- storeApiKey: p,
216151
+ storeApiKey: h,
216154
216152
  setInputFetchURLDataBlock: e
216155
216153
  });
216156
216154
  }
216157
216155
  }
216158
216156
  },
216159
- D
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
- c,
216173
- w,
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
- dataBlockApiKeyHandler: s,
291103
- isTemplateOpen: u,
291104
- exportDropdownOpen: l,
291105
- setExportDropdownOpen: c,
291106
- dsheetId: f,
291107
- commentData: d,
291108
- getCommentCellUI: h,
291109
- selectedTemplate: p,
291110
- setFetchingURLData: m,
291111
- setInputFetchURLDataBlock: v,
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: y,
291116
- sheetEditorRef: b,
291117
- currentDataRef: F,
291118
- ydocRef: w,
291119
- setForceSheetRender: A
291111
+ loading: g,
291112
+ sheetEditorRef: y,
291113
+ currentDataRef: b,
291114
+ ydocRef: F,
291115
+ setForceSheetRender: w
291120
291116
  } = XE();
291121
291117
  Dwt({
291122
- selectedTemplate: p,
291123
- ydocRef: w,
291124
- dsheetId: f,
291125
- currentDataRef: F,
291126
- setForceSheetRender: A,
291127
- sheetEditorRef: b
291118
+ selectedTemplate: h,
291119
+ ydocRef: F,
291120
+ dsheetId: c,
291121
+ currentDataRef: b,
291122
+ setForceSheetRender: w,
291123
+ sheetEditorRef: y
291128
291124
  }), PZ({
291129
- exportDropdownOpen: l,
291130
- isTemplateOpen: u,
291125
+ exportDropdownOpen: u,
291126
+ isTemplateOpen: s,
291131
291127
  isReadOnly: t,
291132
- loading: y
291128
+ loading: g
291133
291129
  });
291134
- const S = {
291135
- sheetEditorRef: b,
291136
- currentDataRef: F,
291137
- ydocRef: w
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(S)
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: y, children: /* @__PURE__ */ cr.jsx(WZ, { isReadOnly: t }) }),
291168
- /* @__PURE__ */ cr.jsxs(yS, { show: !y, children: [
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: m,
291175
- setInputFetchURLDataBlock: v,
291176
- commentData: d,
291177
- getCommentCellUI: h,
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
- dataBlockApiKeyHandler: s,
291183
- exportDropdownOpen: l,
291184
- setExportDropdownOpen: c,
291185
- dsheetId: f,
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
- dataBlockApiKeyHandler: g,
291216
- setFetchingURLData: y,
291217
- setShowFetchURLModal: b,
291218
- setInputFetchURLDataBlock: F,
291219
- sheetEditorRef: w,
291220
- storeApiKey: A
291210
+ setFetchingURLData: g,
291211
+ setShowFetchURLModal: y,
291212
+ setInputFetchURLDataBlock: b,
291213
+ sheetEditorRef: F,
291214
+ storeApiKey: w
291221
291215
  }) => {
291222
- const [S, x] = _t(!1);
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: w,
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: y,
291243
- setShowFetchURLModal: b,
291244
- setInputFetchURLDataBlock: F,
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: S,
291252
- setExportDropdownOpen: x,
291244
+ exportDropdownOpen: A,
291245
+ setExportDropdownOpen: S,
291253
291246
  dsheetId: o,
291254
291247
  selectedTemplate: l,
291255
- storeApiKey: A,
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, DataBlockApiKeyHandlerType } from '../types';
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, dataBlockApiKeyHandler, setFetchingURLData, setShowFetchURLModal, setInputFetchURLDataBlock, sheetEditorRef: externalSheetEditorRef, storeApiKey, }: DsheetProps) => JSX.Element;
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;
@@ -1,4 +1,4 @@
1
- import { Sheet, Cell } from '@fileverse-dev/fortune-core';
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, DataBlockApiKeyHandlerType } from '../types';
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
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/dsheet",
3
3
  "private": false,
4
4
  "description": "DSheet",
5
- "version": "0.0.85",
5
+ "version": "0.0.86",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {