@blocklet/pages-kit 0.4.128 → 0.4.130
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.
- package/lib/cjs/components/CustomComponentRenderer/ErrorComponent.js +24 -2
- package/lib/cjs/components/CustomComponentRenderer/index.js +4 -2
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/types/builtin.js +2 -1
- package/lib/cjs/utils/inject-global-components.js +9 -5
- package/lib/esm/components/CustomComponentRenderer/ErrorComponent.js +24 -2
- package/lib/esm/components/CustomComponentRenderer/index.js +4 -2
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/types/builtin.js +1 -0
- package/lib/esm/utils/inject-global-components.js +10 -6
- package/lib/types/components/CustomComponentRenderer/ErrorComponent.d.ts +3 -1
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/lib/types/types/builtin.d.ts +1 -0
- package/package.json +1 -1
package/lib/esm/types/builtin.js
CHANGED
|
@@ -29,7 +29,7 @@ import * as utils from '../builtin/utils';
|
|
|
29
29
|
import * as zustand from '../builtin/zustand';
|
|
30
30
|
import * as zustandMiddlewareImmer from '../builtin/zustand/middleware/immer';
|
|
31
31
|
import CustomComponentRenderer from '../components/CustomComponentRenderer';
|
|
32
|
-
import { BuiltinModulesGlobalVariableName, ChunksMountPointGlobalVariableName } from '../types/builtin';
|
|
32
|
+
import { BuiltinModulesGlobalVariableName, ChunksMountPointGlobalVariableName, RelativeModulesGlobalVariableName, } from '../types/builtin';
|
|
33
33
|
import { isRelativeModule } from './typescript/builtin-module-transformer';
|
|
34
34
|
const { getComponentMountPoint } = utils;
|
|
35
35
|
// Initialize ES Module Shims before any imports
|
|
@@ -46,6 +46,7 @@ export function injectGlobalComponents() {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
win.React = React;
|
|
49
|
+
win[RelativeModulesGlobalVariableName] = {};
|
|
49
50
|
// create module map
|
|
50
51
|
const modules = {
|
|
51
52
|
React: react,
|
|
@@ -110,12 +111,15 @@ export function injectGlobalComponents() {
|
|
|
110
111
|
window?.blocklet?.prefix ||
|
|
111
112
|
'/';
|
|
112
113
|
const fullUrl = joinURL(window.location.origin, relativeChunksMountPoint, 'chunks', fileName);
|
|
113
|
-
if (
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
if (!win[RelativeModulesGlobalVariableName][fullUrl]) {
|
|
115
|
+
if (enableShim) {
|
|
116
|
+
win[RelativeModulesGlobalVariableName][fullUrl] = window.importShim(/* @vite-ignore */ fullUrl);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
win[RelativeModulesGlobalVariableName][fullUrl] = import(/* @vite-ignore */ fullUrl);
|
|
120
|
+
}
|
|
116
121
|
}
|
|
117
|
-
|
|
118
|
-
return mod;
|
|
122
|
+
return win[RelativeModulesGlobalVariableName][fullUrl];
|
|
119
123
|
}
|
|
120
124
|
return null;
|
|
121
125
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface ComponentErrorProps {
|
|
3
3
|
title?: string;
|
|
4
|
-
message
|
|
4
|
+
message?: string;
|
|
5
5
|
componentId?: string;
|
|
6
6
|
componentName?: string;
|
|
7
7
|
blockletId?: string;
|
|
@@ -9,6 +9,8 @@ interface ComponentErrorProps {
|
|
|
9
9
|
showHints?: boolean;
|
|
10
10
|
error?: Error;
|
|
11
11
|
resetErrorBoundary?: () => void;
|
|
12
|
+
delay?: number;
|
|
13
|
+
shouldShow?: () => boolean;
|
|
12
14
|
}
|
|
13
15
|
export declare const ComponentError: React.FC<ComponentErrorProps>;
|
|
14
16
|
export {};
|