@blocklet/pages-kit 0.4.127 → 0.4.128

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.
@@ -65,9 +65,6 @@ function ComponentRenderer({ renderCount = 0, blockletId, blockletTitle, compone
65
65
  });
66
66
  return result;
67
67
  }, [props?.props, component?.properties, component?.props]);
68
- if (component?.error) {
69
- throw component.error;
70
- }
71
68
  const renderComponentChildren = (Component) => {
72
69
  const children = (0, jsx_runtime_1.jsx)(Renderer, { renderCount: renderCount + 1, ...props, Component: Component, props: parsedProps });
73
70
  return ctx?.customRendererComponent ? ((0, jsx_runtime_1.jsx)(ctx.customRendererComponent, { Component: Component, children: children })) : (children);
@@ -82,6 +79,10 @@ function ComponentRenderer({ renderCount = 0, blockletId, blockletTitle, compone
82
79
  if (dev?.mode === 'draft' && dev && dev.components?.[props.componentId] === undefined) {
83
80
  return ((0, jsx_runtime_1.jsx)(ErrorComponent_1.ComponentError, { componentId: props.componentId, componentName: componentName, blockletId: blockletId, blockletTitle: blockletTitle, message: "Component not found in available components", showHints: true }));
84
81
  }
82
+ // 如果什么都没有,但是有错误,则抛出错误
83
+ if (component?.error) {
84
+ throw component.error;
85
+ }
85
86
  return null;
86
87
  }
87
88
  function Renderer({ renderCount, Component, locale, props, }) {
@@ -182,6 +182,7 @@ const customComponentStates = () => {
182
182
  components: Object.fromEntries(Object.entries({ ...PRELOAD_COMPONENTS_STATE?.components })
183
183
  .map(([componentId, preload]) => {
184
184
  let Component;
185
+ // umd 格式的逻辑,会走到这里
185
186
  if (preload.componentModuleGlobalVariable) {
186
187
  const m = window[preload.componentModuleGlobalVariable];
187
188
  // handle the global variable