@fileverse-dev/fortune-react 1.0.2-mod-102 → 1.0.2-mod-105

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.
@@ -1,7 +1,4 @@
1
- import { PROMOTED_CRYPTO_FUNCTIONS } from "@fileverse-dev/fortune-core";
2
- import { COMIMG_SOON_FUNCTIONS } from "../constants";
3
1
  import Workbook from "./Workbook";
4
2
  export { Workbook };
5
3
  export type { WorkbookInstance } from "./Workbook";
6
- export { COMIMG_SOON_FUNCTIONS, PROMOTED_CRYPTO_FUNCTIONS };
7
4
  export * from "@fileverse-dev/formulajs/crypto-constants";
@@ -1,2 +1 @@
1
1
  export declare const API_KEY_PLACEHOLDER: Record<string, string>;
2
- export declare const COMIMG_SOON_FUNCTIONS: string[];
package/dist/index.esm.js CHANGED
@@ -1,18 +1,11 @@
1
1
  import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fixPositionOnFrozenCells, colLocation, getFlowdata, isAllowEdit, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColFreezeHandleMouseDown, selectTitlesMap, selectTitlesRange, fixColumnStyleOverflowInFreeze, rowLocationByIndex, rowLocation, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleRowFreezeHandleMouseDown, handleContextMenu, fixRowStyleOverflowInFreeze, locale, getStyleByCell, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, moveToEnd, isShowHidenCR, getrangeseleciton, cancelNormalSelected, moveHighlightCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, normalizeSelection, scrollToHighlightCell, isLinkValid, goToLink, replaceHtml, removeHyperlink, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, getRangetxt, setConditionRules, mergeBorder, setDropdownValue, onIframeMoveStart, onIframeResizeStart, onIframeMove, onIframeMoveEnd, onIframeResize, onIframeResizeEnd, handleCellAreaMouseDown, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, insertRowCol, drawArrow, onCellsMoveStart, createDropCellRange, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel, getDataArr, updateMoreCell, getRegStr, getOptionValue, getSelectRange, applyLocation, updateItem, update, sanitizeDuneUrl, normalizedCellAttr, updateFormat, handleTextSize, handleHorizontalAlign, handleVerticalAlign, handleScreenShot, showImgChooser, insertImage, editComment, deleteComment, showHideComment, showHideAllComments, newComment, handleSum, autoSelectionFormula, handleMerge, handleBorder, handleFreeze, handleSort, createFilter, clearFilter, toolbarItemSelectedFunc, toolbarItemClickHandler, insertDuneChart, handleTextColor, handleTextBackground, getInlineStringNoStyle, rangeHightlightselected, updateCell, editSheetName, cancelActiveImgItem, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, api, getFreezeState, toggleFreeze, jfrefreshgrid, handleCopy, removeActiveImage, deleteSelectedCellText, deleteRowCol, hideSelected, showSelected, sortSelection, handleLink, handlePasteByClick, deleteSheet, opToPatch, setCaretPosition, orderbydatafiler, getFilterColumnValues, getFilterColumnColors, saveFilter, calcSelectionInfo, patchToOp, filterPatch, inverseRowColOptions, ensureSheetIndex, initSheetIndex, handleGlobalKeyDown, handlePaste, groupValuesRefresh } from '@fileverse-dev/fortune-core';
2
- export { PROMOTED_CRYPTO_FUNCTIONS } from '@fileverse-dev/fortune-core';
3
- import { SERVICE_API_KEY } from '@fileverse-dev/formulajs/crypto-constants';
4
- export * from '@fileverse-dev/formulajs/crypto-constants';
5
2
  import React, { useContext, useRef, useState, useMemo, useCallback, useEffect, useLayoutEffect, useImperativeHandle } from 'react';
6
3
  import produce, { applyPatches, enablePatches, produceWithPatches } from 'immer';
7
4
  import _ from 'lodash';
8
5
  import { Tooltip, LucideIcon, TextField, Button as Button$1, cn, IconButton, Checkbox, Divider as Divider$2, Table, TableHeader, TableRow, TableHead, TableBody, TableCell, Select as Select$1, SelectTrigger, SelectValue, SelectContent, SelectItem as SelectItem$1, Popover, PopoverTrigger, PopoverContent, RadioGroup, RadioGroupItem, Label } from '@fileverse/ui';
9
6
  import regeneratorRuntime from 'regenerator-runtime';
10
7
  import Tippy from '@tippyjs/react';
11
-
12
- var API_KEY_PLACEHOLDER = Object.fromEntries(Object.values(SERVICE_API_KEY).map(function (key) {
13
- return [key, "".concat(key.replace(/_/g, " ").replace(/\bAPI\b/, "API key"))];
14
- }));
15
- var COMIMG_SOON_FUNCTIONS = ["UNISWAP", "ARTEMIS", "AAVE", "AERODOME", "PENDLE"];
8
+ export * from '@fileverse-dev/formulajs/crypto-constants';
16
9
 
17
10
  function _arrayLikeToArray(r, a) {
18
11
  (null == a || a > r.length) && (a = r.length);
@@ -826,9 +819,6 @@ var FormulaSearch = function FormulaSearch(props) {
826
819
  useEffect(function () {
827
820
  calcuatePopUpPlacement();
828
821
  });
829
- var isComingSoon = function isComingSoon(name) {
830
- return COMIMG_SOON_FUNCTIONS.includes(name);
831
- };
832
822
  if (_.isEmpty(context.functionCandidates) && _.isEmpty(context.defaultCandidates)) return null;
833
823
  return /*#__PURE__*/React.createElement("div", _objectSpread2(_objectSpread2({}, props), {}, {
834
824
  ref: hintRef,
@@ -846,12 +836,12 @@ var FormulaSearch = function FormulaSearch(props) {
846
836
  className: "text-helper-sm-bold color-text-secondary"
847
837
  }, "Onchain functions"), /*#__PURE__*/React.createElement("p", {
848
838
  className: "text-helper-text-sm color-text-secondary"
849
- }, "What is data block description lorem ipsum dolor sit"))), context.defaultCandidates.length > 0 ? (/*#__PURE__*/React.createElement(React.Fragment, null, context.defaultCandidates.slice(0, 5).map(function (v, index) {
839
+ }, "A datablock is a native data structure allowing dSheets to read and structure any data coming from smart contracts or APIs. Anyone can contribute to datablocks to make new data sources supported on dSheets."))), context.defaultCandidates.length > 0 ? (/*#__PURE__*/React.createElement(React.Fragment, null, context.defaultCandidates.map(function (v, index) {
850
840
  return /*#__PURE__*/React.createElement("div", {
851
841
  key: v.n,
852
842
  "data-func": v.n,
853
843
  style: {
854
- cursor: isComingSoon(v.n) ? "not-allowed" : "pointer"
844
+ cursor: "pointer"
855
845
  },
856
846
  className: "luckysheet-formula-search-item ".concat(index === 0 ? "luckysheet-formula-search-item-active" : "")
857
847
  }, /*#__PURE__*/React.createElement("div", {
@@ -860,7 +850,7 @@ var FormulaSearch = function FormulaSearch(props) {
860
850
  justifyContent: "space-between"
861
851
  }
862
852
  }, /*#__PURE__*/React.createElement("div", {
863
- className: "luckysheet-formula-search-func ".concat(isComingSoon(v.n) ? "color-text-secondary" : "color-text-default", " text-body-sm")
853
+ className: "luckysheet-formula-search-func color-text-default text-body-sm"
864
854
  }, v.n), /*#__PURE__*/React.createElement("div", {
865
855
  style: {
866
856
  display: "flex",
@@ -893,57 +883,7 @@ var FormulaSearch = function FormulaSearch(props) {
893
883
  height: "12px"
894
884
  }
895
885
  })))))), /*#__PURE__*/React.createElement("div", {
896
- className: "luckysheet-formula-search-detail mt-1 text-helper-text-sm ".concat(isComingSoon(v.n) ? "color-text-secondary" : "color-text-default")
897
- }, isComingSoon(v.n) ? "Coming soon to dSheets" : v.d));
898
- }), /*#__PURE__*/React.createElement("p", {
899
- style: {
900
- padding: "10px"
901
- },
902
- className: "text-helper-text-sm-bold color-text-secondary"
903
- }, "Functions"), context.defaultCandidates.slice(5, context.defaultCandidates.length).map(function (v) {
904
- return /*#__PURE__*/React.createElement("div", {
905
- key: v.n,
906
- "data-func": v.n,
907
- className: "luckysheet-formula-search-item"
908
- }, /*#__PURE__*/React.createElement("div", {
909
- style: {
910
- display: "flex",
911
- justifyContent: "space-between"
912
- }
913
- }, /*#__PURE__*/React.createElement("div", {
914
- className: "luckysheet-formula-search-func color-text-default text-body-sm"
915
- }, v.n), /*#__PURE__*/React.createElement("div", {
916
- style: {
917
- display: "flex",
918
- justifyContent: "end",
919
- width: "68px",
920
- height: "20px",
921
- alignItems: "center",
922
- gap: "6px"
923
- }
924
- }, v.LOGO && (/*#__PURE__*/React.createElement("img", {
925
- src: v.LOGO,
926
- alt: "Service Logo",
927
- style: {
928
- width: "16px"
929
- }
930
- })), v.API_KEY && (/*#__PURE__*/React.createElement("div", {
931
- style: {
932
- borderRadius: "4px",
933
- backgroundColor: "".concat(localStorage.getItem(v.API_KEY) ? "#177E23" : "#e8ebec"),
934
- width: "16px",
935
- height: "16px"
936
- },
937
- className: "flex justify-center"
938
- }, /*#__PURE__*/React.createElement(LucideIcon, {
939
- name: "Key",
940
- style: {
941
- color: localStorage.getItem(v.API_KEY) ? "white" : "#77818A",
942
- width: "12px",
943
- height: "12px"
944
- }
945
- }))))), /*#__PURE__*/React.createElement("div", {
946
- className: "luckysheet-formula-search-detail mt-1 text-helper-text-sm color-text-secondary"
886
+ className: "luckysheet-formula-search-detail mt-1 text-helper-text-sm color-text-default"
947
887
  }, v.d));
948
888
  }))) : (/*#__PURE__*/React.createElement(React.Fragment, null, context.functionCandidates.map(function (v, index) {
949
889
  return /*#__PURE__*/React.createElement("div", {
@@ -12582,4 +12522,4 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
12582
12522
  })))));
12583
12523
  });
12584
12524
 
12585
- export { COMIMG_SOON_FUNCTIONS, Workbook };
12525
+ export { Workbook };
package/dist/index.js CHANGED
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var fortuneCore = require('@fileverse-dev/fortune-core');
6
- var cryptoConstants = require('@fileverse-dev/formulajs/crypto-constants');
7
6
  var React = require('react');
8
7
  var produce = require('immer');
9
8
  var _ = require('lodash');
10
9
  var ui = require('@fileverse/ui');
11
10
  var regeneratorRuntime = require('regenerator-runtime');
12
11
  var Tippy = require('@tippyjs/react');
12
+ var cryptoConstants = require('@fileverse-dev/formulajs/crypto-constants');
13
13
 
14
14
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
15
 
@@ -19,11 +19,6 @@ var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
19
19
  var regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(regeneratorRuntime);
20
20
  var Tippy__default = /*#__PURE__*/_interopDefaultLegacy(Tippy);
21
21
 
22
- var API_KEY_PLACEHOLDER = Object.fromEntries(Object.values(cryptoConstants.SERVICE_API_KEY).map(function (key) {
23
- return [key, "".concat(key.replace(/_/g, " ").replace(/\bAPI\b/, "API key"))];
24
- }));
25
- var COMIMG_SOON_FUNCTIONS = ["UNISWAP", "ARTEMIS", "AAVE", "AERODOME", "PENDLE"];
26
-
27
22
  function _arrayLikeToArray(r, a) {
28
23
  (null == a || a > r.length) && (a = r.length);
29
24
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
@@ -836,9 +831,6 @@ var FormulaSearch = function FormulaSearch(props) {
836
831
  React.useEffect(function () {
837
832
  calcuatePopUpPlacement();
838
833
  });
839
- var isComingSoon = function isComingSoon(name) {
840
- return COMIMG_SOON_FUNCTIONS.includes(name);
841
- };
842
834
  if (___default['default'].isEmpty(context.functionCandidates) && ___default['default'].isEmpty(context.defaultCandidates)) return null;
843
835
  return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread2(_objectSpread2({}, props), {}, {
844
836
  ref: hintRef,
@@ -856,12 +848,12 @@ var FormulaSearch = function FormulaSearch(props) {
856
848
  className: "text-helper-sm-bold color-text-secondary"
857
849
  }, "Onchain functions"), /*#__PURE__*/React__default['default'].createElement("p", {
858
850
  className: "text-helper-text-sm color-text-secondary"
859
- }, "What is data block description lorem ipsum dolor sit"))), context.defaultCandidates.length > 0 ? (/*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, context.defaultCandidates.slice(0, 5).map(function (v, index) {
851
+ }, "A datablock is a native data structure allowing dSheets to read and structure any data coming from smart contracts or APIs. Anyone can contribute to datablocks to make new data sources supported on dSheets."))), context.defaultCandidates.length > 0 ? (/*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, context.defaultCandidates.map(function (v, index) {
860
852
  return /*#__PURE__*/React__default['default'].createElement("div", {
861
853
  key: v.n,
862
854
  "data-func": v.n,
863
855
  style: {
864
- cursor: isComingSoon(v.n) ? "not-allowed" : "pointer"
856
+ cursor: "pointer"
865
857
  },
866
858
  className: "luckysheet-formula-search-item ".concat(index === 0 ? "luckysheet-formula-search-item-active" : "")
867
859
  }, /*#__PURE__*/React__default['default'].createElement("div", {
@@ -870,7 +862,7 @@ var FormulaSearch = function FormulaSearch(props) {
870
862
  justifyContent: "space-between"
871
863
  }
872
864
  }, /*#__PURE__*/React__default['default'].createElement("div", {
873
- className: "luckysheet-formula-search-func ".concat(isComingSoon(v.n) ? "color-text-secondary" : "color-text-default", " text-body-sm")
865
+ className: "luckysheet-formula-search-func color-text-default text-body-sm"
874
866
  }, v.n), /*#__PURE__*/React__default['default'].createElement("div", {
875
867
  style: {
876
868
  display: "flex",
@@ -903,57 +895,7 @@ var FormulaSearch = function FormulaSearch(props) {
903
895
  height: "12px"
904
896
  }
905
897
  })))))), /*#__PURE__*/React__default['default'].createElement("div", {
906
- className: "luckysheet-formula-search-detail mt-1 text-helper-text-sm ".concat(isComingSoon(v.n) ? "color-text-secondary" : "color-text-default")
907
- }, isComingSoon(v.n) ? "Coming soon to dSheets" : v.d));
908
- }), /*#__PURE__*/React__default['default'].createElement("p", {
909
- style: {
910
- padding: "10px"
911
- },
912
- className: "text-helper-text-sm-bold color-text-secondary"
913
- }, "Functions"), context.defaultCandidates.slice(5, context.defaultCandidates.length).map(function (v) {
914
- return /*#__PURE__*/React__default['default'].createElement("div", {
915
- key: v.n,
916
- "data-func": v.n,
917
- className: "luckysheet-formula-search-item"
918
- }, /*#__PURE__*/React__default['default'].createElement("div", {
919
- style: {
920
- display: "flex",
921
- justifyContent: "space-between"
922
- }
923
- }, /*#__PURE__*/React__default['default'].createElement("div", {
924
- className: "luckysheet-formula-search-func color-text-default text-body-sm"
925
- }, v.n), /*#__PURE__*/React__default['default'].createElement("div", {
926
- style: {
927
- display: "flex",
928
- justifyContent: "end",
929
- width: "68px",
930
- height: "20px",
931
- alignItems: "center",
932
- gap: "6px"
933
- }
934
- }, v.LOGO && (/*#__PURE__*/React__default['default'].createElement("img", {
935
- src: v.LOGO,
936
- alt: "Service Logo",
937
- style: {
938
- width: "16px"
939
- }
940
- })), v.API_KEY && (/*#__PURE__*/React__default['default'].createElement("div", {
941
- style: {
942
- borderRadius: "4px",
943
- backgroundColor: "".concat(localStorage.getItem(v.API_KEY) ? "#177E23" : "#e8ebec"),
944
- width: "16px",
945
- height: "16px"
946
- },
947
- className: "flex justify-center"
948
- }, /*#__PURE__*/React__default['default'].createElement(ui.LucideIcon, {
949
- name: "Key",
950
- style: {
951
- color: localStorage.getItem(v.API_KEY) ? "white" : "#77818A",
952
- width: "12px",
953
- height: "12px"
954
- }
955
- }))))), /*#__PURE__*/React__default['default'].createElement("div", {
956
- className: "luckysheet-formula-search-detail mt-1 text-helper-text-sm color-text-secondary"
898
+ className: "luckysheet-formula-search-detail mt-1 text-helper-text-sm color-text-default"
957
899
  }, v.d));
958
900
  }))) : (/*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, context.functionCandidates.map(function (v, index) {
959
901
  return /*#__PURE__*/React__default['default'].createElement("div", {
@@ -12600,11 +12542,4 @@ Object.keys(cryptoConstants).forEach(function (k) {
12600
12542
  }
12601
12543
  });
12602
12544
  });
12603
- Object.defineProperty(exports, 'PROMOTED_CRYPTO_FUNCTIONS', {
12604
- enumerable: true,
12605
- get: function () {
12606
- return fortuneCore.PROMOTED_CRYPTO_FUNCTIONS;
12607
- }
12608
- });
12609
- exports.COMIMG_SOON_FUNCTIONS = COMIMG_SOON_FUNCTIONS;
12610
12545
  exports.Workbook = Workbook;