@blocklet/pages-kit 0.4.126 → 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.
@@ -45,9 +45,6 @@ function ComponentRenderer({ renderCount = 0, blockletId, blockletTitle, compone
45
45
  });
46
46
  return result;
47
47
  }, [props?.props, component?.properties, component?.props]);
48
- if (component?.error) {
49
- throw component.error;
50
- }
51
48
  const renderComponentChildren = (Component) => {
52
49
  const children = _jsx(Renderer, { renderCount: renderCount + 1, ...props, Component: Component, props: parsedProps });
53
50
  return ctx?.customRendererComponent ? (_jsx(ctx.customRendererComponent, { Component: Component, children: children })) : (children);
@@ -62,6 +59,10 @@ function ComponentRenderer({ renderCount = 0, blockletId, blockletTitle, compone
62
59
  if (dev?.mode === 'draft' && dev && dev.components?.[props.componentId] === undefined) {
63
60
  return (_jsx(ComponentError, { componentId: props.componentId, componentName: componentName, blockletId: blockletId, blockletTitle: blockletTitle, message: "Component not found in available components", showHints: true }));
64
61
  }
62
+ // 如果什么都没有,但是有错误,则抛出错误
63
+ if (component?.error) {
64
+ throw component.error;
65
+ }
65
66
  return null;
66
67
  }
67
68
  function Renderer({ renderCount, Component, locale, props, }) {
@@ -150,6 +150,7 @@ export const customComponentStates = () => {
150
150
  components: Object.fromEntries(Object.entries({ ...PRELOAD_COMPONENTS_STATE?.components })
151
151
  .map(([componentId, preload]) => {
152
152
  let Component;
153
+ // umd 格式的逻辑,会走到这里
153
154
  if (preload.componentModuleGlobalVariable) {
154
155
  const m = window[preload.componentModuleGlobalVariable];
155
156
  // handle the global variable