@blocklet/pages-kit 0.2.201 → 0.2.203
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.
|
@@ -38,8 +38,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
38
38
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
39
|
const cache_1 = __importDefault(require("@emotion/cache"));
|
|
40
40
|
const react_1 = require("@emotion/react");
|
|
41
|
+
const react_2 = require("@iconify/react");
|
|
41
42
|
const material_1 = require("@mui/material");
|
|
42
|
-
const
|
|
43
|
+
const react_3 = __importStar(require("react"));
|
|
43
44
|
const client_1 = __importDefault(require("react-dom/client"));
|
|
44
45
|
const react_error_boundary_1 = require("react-error-boundary");
|
|
45
46
|
const react_frame_component_1 = require("react-frame-component");
|
|
@@ -50,9 +51,11 @@ const immer_1 = require("zustand/middleware/immer");
|
|
|
50
51
|
const win = window;
|
|
51
52
|
win.joinURL = ufo_1.joinURL;
|
|
52
53
|
win.withQuery = ufo_1.withQuery;
|
|
53
|
-
win.React =
|
|
54
|
+
win.React = react_3.default;
|
|
54
55
|
win.Box = material_1.Box;
|
|
55
56
|
win.Stack = material_1.Stack;
|
|
57
|
+
win.Button = material_1.Button;
|
|
58
|
+
win.IconifyIcon = react_2.Icon;
|
|
56
59
|
const CUSTOM_COMPONENT_RENDERER = 'custom-component-renderer';
|
|
57
60
|
const defineCustomElements = (win) => {
|
|
58
61
|
if (!win.customElements.get(CUSTOM_COMPONENT_RENDERER)) {
|
|
@@ -174,7 +177,7 @@ function CustomComponentRenderer({ id, componentId, components, properties, loca
|
|
|
174
177
|
customComponentState(component.id, { component }).setState({ component });
|
|
175
178
|
});
|
|
176
179
|
customComponentProperties(id, { properties }).setState({ properties });
|
|
177
|
-
(0,
|
|
180
|
+
(0, react_3.useEffect)(() => {
|
|
178
181
|
defineCustomElements(frame.window || window);
|
|
179
182
|
}, [frame]);
|
|
180
183
|
return ((0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { fallbackRender: E, children: (0, jsx_runtime_1.jsx)("custom-component-renderer", { "component-id": componentId, id: id, locale: locale, "default-locale": defaultLocale }) }));
|
|
@@ -10,7 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
import createCache from '@emotion/cache';
|
|
12
12
|
import { CacheProvider } from '@emotion/react';
|
|
13
|
-
import {
|
|
13
|
+
import { Icon as IconifyIcon } from '@iconify/react';
|
|
14
|
+
import { Alert, Box, Button, CssBaseline, Stack } from '@mui/material';
|
|
14
15
|
import React, { useEffect } from 'react';
|
|
15
16
|
import ReactDOM from 'react-dom/client';
|
|
16
17
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
@@ -25,6 +26,8 @@ win.withQuery = withQuery;
|
|
|
25
26
|
win.React = React;
|
|
26
27
|
win.Box = Box;
|
|
27
28
|
win.Stack = Stack;
|
|
29
|
+
win.Button = Button;
|
|
30
|
+
win.IconifyIcon = IconifyIcon;
|
|
28
31
|
const CUSTOM_COMPONENT_RENDERER = 'custom-component-renderer';
|
|
29
32
|
const defineCustomElements = (win) => {
|
|
30
33
|
if (!win.customElements.get(CUSTOM_COMPONENT_RENDERER)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/pages-kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.203",
|
|
4
4
|
"description": "Pages Kit components and utils",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@blocklet/sdk": "^1.16.22",
|
|
80
|
+
"@iconify/react": "^4.1.1",
|
|
80
81
|
"axios": "^1.6.5",
|
|
81
82
|
"lodash": "^4.17.21",
|
|
82
83
|
"nanoid": "^3.3.7",
|