@blocklet/pages-kit-block-studio 0.7.10 → 0.7.12

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.
@@ -46,7 +46,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
46
46
  const Session_1 = require("@arcblock/did-connect-react/lib/Session");
47
47
  const Config_1 = require("@arcblock/ux/lib/Config");
48
48
  const context_1 = require("@arcblock/ux/lib/Locale/context");
49
- const use_deep_compare_memo_1 = require("@blocklet/pages-kit/hooks/use-deep-compare-memo");
50
49
  const Toast_1 = __importStar(require("@arcblock/ux/lib/Toast"));
51
50
  const js_sdk_1 = require("@blocklet/js-sdk");
52
51
  const theme_1 = require("@blocklet/pages-kit-inner-components/theme");
@@ -413,7 +412,7 @@ function Layout({ loadState, loadedData }) {
413
412
  description: '',
414
413
  };
415
414
  };
416
- let mergedPropertiesValues = (0, use_deep_compare_memo_1.useDeepCompareMemo)(() => {
415
+ let mergedPropertiesValues = (0, react_1.useMemo)(() => {
417
416
  return Object.fromEntries(Object.values(state.metadata.properties ?? {}).map(({ data }) => {
418
417
  return [
419
418
  data.id,
@@ -426,7 +425,7 @@ function Layout({ loadState, loadedData }) {
426
425
  },
427
426
  ];
428
427
  }));
429
- }, [state.metadata.properties, state.propertiesValue]);
428
+ }, [JSON.stringify(state.metadata.properties), JSON.stringify(state.propertiesValue)]);
430
429
  // 添加防抖函数,延迟渲染
431
430
  const { run: triggerRerender } = (0, ahooks_1.useDebounceFn)(() => {
432
431
  // 发送消息到 iframe
@@ -459,9 +458,9 @@ function Layout({ loadState, loadedData }) {
459
458
  }
460
459
  }, { wait: 50 });
461
460
  // 当属性变化时触发重新渲染
462
- (0, ahooks_1.useDeepCompareEffect)(() => {
461
+ (0, react_1.useEffect)(() => {
463
462
  triggerRerender();
464
- }, [mergedPropertiesValues, mergedAllBlocks, state.metadata.id, locale]);
463
+ }, [JSON.stringify(mergedPropertiesValues), JSON.stringify(mergedAllBlocks), state.metadata.id, locale]);
465
464
  const DraggingSplitPlaceholder = (0, react_1.useMemo)(() => {
466
465
  return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
467
466
  p: 1.5,
@@ -666,7 +665,7 @@ function Layout({ loadState, loadedData }) {
666
665
  handleDeleteBlock,
667
666
  ]);
668
667
  // 修改 middlePanelContent - iframe 内部监听消息
669
- const middlePanelContent = (0, use_deep_compare_memo_1.useDeepCompareMemo)(() => {
668
+ const middlePanelContent = (0, react_1.useMemo)(() => {
670
669
  // 如果在iframe内部,添加消息接收逻辑
671
670
  if (isInsideIframe) {
672
671
  if (loadState.type === '404' || loadState.type === 'loading') {
@@ -859,12 +858,12 @@ function Layout({ loadState, loadedData }) {
859
858
  locale,
860
859
  mode,
861
860
  theme,
862
- state.metadata || {},
863
- mergedAllBlocks || [],
864
- mergedPropertiesValues || {},
861
+ JSON.stringify(state.metadata || {}),
862
+ JSON.stringify(mergedAllBlocks || []),
863
+ JSON.stringify(mergedPropertiesValues || {}),
865
864
  handleDeleteBlock,
866
865
  ]);
867
- const rightPanelContent = (0, use_deep_compare_memo_1.useDeepCompareMemo)(() => {
866
+ const rightPanelContent = (0, react_1.useMemo)(() => {
868
867
  if (state.draggingSplitPane) {
869
868
  return DraggingSplitPlaceholder;
870
869
  }
@@ -1028,11 +1027,11 @@ function Layout({ loadState, loadedData }) {
1028
1027
  };
1029
1028
  } }) }) }))] }));
1030
1029
  }, [
1031
- state.metadata || {},
1030
+ JSON.stringify(state.metadata || {}),
1032
1031
  locale,
1033
1032
  defaultLocale,
1034
- mergedAllBlocks || [],
1035
- mergedPropertiesValues || {},
1033
+ JSON.stringify(mergedAllBlocks || []),
1034
+ JSON.stringify(mergedPropertiesValues || {}),
1036
1035
  getStaticData,
1037
1036
  state.draggingSplitPane,
1038
1037
  mode,