@fileverse-dev/fortune-react 1.0.81-patch-3 → 1.0.81-patch-4

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.
@@ -16,8 +16,9 @@ import WorkbookContext from "../../../context";
16
16
  import "./index.css";
17
17
  var FormulaSearch = function FormulaSearch(props) {
18
18
  var _a;
19
- var context = useContext(WorkbookContext).context;
20
- var isAuthorized = true;
19
+ var _b = useContext(WorkbookContext),
20
+ context = _b.context,
21
+ isAuthorized = _b.settings.isAuthorized;
21
22
  var authedFunction = ["COINGECKO", "ETHERSCAN", "DEFILLAMA", "GNOSIS", "BASE", "EOA", "PNL", "SAFE", "BLOCKSCOUT", "GNOSIS", "LENS", "FARCASTER", "Ethereum", "SMARTCONTRACT"];
22
23
  var filteredDefaultCandidates = context.defaultCandidates.filter(function (item) {
23
24
  return !authedFunction.includes(item.n);
@@ -31,9 +32,9 @@ var FormulaSearch = function FormulaSearch(props) {
31
32
  });
32
33
  var firstSelection = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0];
33
34
  var hintRef = useRef(null);
34
- var _b = useState(0),
35
- top = _b[0],
36
- setTop = _b[1];
35
+ var _c = useState(0),
36
+ top = _c[0],
37
+ setTop = _c[1];
37
38
  var calcuatePopUpPlacement = function calcuatePopUpPlacement() {
38
39
  var _a, _b, _c;
39
40
  if (!((_a = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.top) === null || _a === void 0 ? void 0 : _a.toString()) || !((_b = firstSelection.height_move) === null || _b === void 0 ? void 0 : _b.toString()) || !hintRef.current) return;
@@ -1622,7 +1622,17 @@ var Toolbar = function Toolbar(_a) {
1622
1622
  onClose: onMoreToolbarItemsClose
1623
1623
  }, moreToolbarItems))), /*#__PURE__*/React.createElement("div", {
1624
1624
  className: "fortune-toolbar-right"
1625
- }, settings.customToolbarItems.length > 0 && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
1625
+ }, settings.customToolbarItems.length > 0 && (/*#__PURE__*/React.createElement(React.Fragment, null, settings.customToolbarItems.filter(function (t) {
1626
+ return t.key === "Smart Contract";
1627
+ }).map(function (n) {
1628
+ return /*#__PURE__*/React.createElement(CustomButton, {
1629
+ tooltip: n.tooltip,
1630
+ onClick: n.onClick,
1631
+ key: n.key,
1632
+ icon: n.icon,
1633
+ iconName: n.iconName
1634
+ }, n.children);
1635
+ }), /*#__PURE__*/React.createElement(Button, {
1626
1636
  iconId: "dune",
1627
1637
  tooltip: "Insert Dune Chart",
1628
1638
  key: "dune-charts",
@@ -1648,7 +1658,7 @@ var Toolbar = function Toolbar(_a) {
1648
1658
  borderRadius: "8px"
1649
1659
  }
1650
1660
  }))))), settings.customToolbarItems.filter(function (n) {
1651
- return n.key !== "import-export";
1661
+ return n.key !== "import-export" && n.key !== "Smart Contract";
1652
1662
  }).map(function (n) {
1653
1663
  return /*#__PURE__*/React.createElement(CustomButton, {
1654
1664
  tooltip: n.tooltip,
@@ -25,8 +25,9 @@ var __assign = void 0 && (void 0).__assign || function () {
25
25
  };
26
26
  var FormulaSearch = function FormulaSearch(props) {
27
27
  var _a;
28
- var context = (0, _react.useContext)(_context.default).context;
29
- var isAuthorized = true;
28
+ var _b = (0, _react.useContext)(_context.default),
29
+ context = _b.context,
30
+ isAuthorized = _b.settings.isAuthorized;
30
31
  var authedFunction = ["COINGECKO", "ETHERSCAN", "DEFILLAMA", "GNOSIS", "BASE", "EOA", "PNL", "SAFE", "BLOCKSCOUT", "GNOSIS", "LENS", "FARCASTER", "Ethereum", "SMARTCONTRACT"];
31
32
  var filteredDefaultCandidates = context.defaultCandidates.filter(function (item) {
32
33
  return !authedFunction.includes(item.n);
@@ -40,9 +41,9 @@ var FormulaSearch = function FormulaSearch(props) {
40
41
  });
41
42
  var firstSelection = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0];
42
43
  var hintRef = (0, _react.useRef)(null);
43
- var _b = (0, _react.useState)(0),
44
- top = _b[0],
45
- setTop = _b[1];
44
+ var _c = (0, _react.useState)(0),
45
+ top = _c[0],
46
+ setTop = _c[1];
46
47
  var calcuatePopUpPlacement = function calcuatePopUpPlacement() {
47
48
  var _a, _b, _c;
48
49
  if (!((_a = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.top) === null || _a === void 0 ? void 0 : _a.toString()) || !((_b = firstSelection.height_move) === null || _b === void 0 ? void 0 : _b.toString()) || !hintRef.current) return;
@@ -1631,7 +1631,17 @@ var Toolbar = function Toolbar(_a) {
1631
1631
  onClose: onMoreToolbarItemsClose
1632
1632
  }, moreToolbarItems))), /*#__PURE__*/_react.default.createElement("div", {
1633
1633
  className: "fortune-toolbar-right"
1634
- }, settings.customToolbarItems.length > 0 && (/*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
1634
+ }, settings.customToolbarItems.length > 0 && (/*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, settings.customToolbarItems.filter(function (t) {
1635
+ return t.key === "Smart Contract";
1636
+ }).map(function (n) {
1637
+ return /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
1638
+ tooltip: n.tooltip,
1639
+ onClick: n.onClick,
1640
+ key: n.key,
1641
+ icon: n.icon,
1642
+ iconName: n.iconName
1643
+ }, n.children);
1644
+ }), /*#__PURE__*/_react.default.createElement(_Button.default, {
1635
1645
  iconId: "dune",
1636
1646
  tooltip: "Insert Dune Chart",
1637
1647
  key: "dune-charts",
@@ -1657,7 +1667,7 @@ var Toolbar = function Toolbar(_a) {
1657
1667
  borderRadius: "8px"
1658
1668
  }
1659
1669
  }))))), settings.customToolbarItems.filter(function (n) {
1660
- return n.key !== "import-export";
1670
+ return n.key !== "import-export" && n.key !== "Smart Contract";
1661
1671
  }).map(function (n) {
1662
1672
  return /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
1663
1673
  tooltip: n.tooltip,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.0.81-patch-3",
3
+ "version": "1.0.81-patch-4",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "module": "es/index.js",
@@ -16,7 +16,7 @@
16
16
  "tsc": "tsc"
17
17
  },
18
18
  "dependencies": {
19
- "@fileverse-dev/fortune-core": "1.0.81-patch-3",
19
+ "@fileverse-dev/fortune-core": "1.0.81-patch-4",
20
20
  "@fileverse/ui": "^4.1.7-patch-21",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",