x-star-design 0.0.136 → 0.0.138
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.
|
@@ -42,6 +42,8 @@ var ProgramConfigItem = function ProgramConfigItem(_ref) {
|
|
|
42
42
|
label: label,
|
|
43
43
|
value: value
|
|
44
44
|
};
|
|
45
|
+
}).filter(function (item) {
|
|
46
|
+
return tenant.name === 'xyd' ? item : item.value !== 'fpc' && item.value !== 'python2.7';
|
|
45
47
|
})
|
|
46
48
|
}) : /*#__PURE__*/React.createElement(TextValue, {
|
|
47
49
|
name: "lang"
|
|
@@ -8,9 +8,10 @@ export interface MicroAppProps {
|
|
|
8
8
|
microProps?: Record<string, unknown>;
|
|
9
9
|
fallback?: React.ReactNode;
|
|
10
10
|
suspense?: React.ReactNode;
|
|
11
|
+
afterMount?: () => void;
|
|
11
12
|
}
|
|
12
13
|
declare const MicroApp: {
|
|
13
|
-
({ className, style, name, entry, pathname, microProps, fallback, suspense, }: MicroAppProps): React.JSX.Element;
|
|
14
|
+
({ className, style, name, entry, pathname, microProps, fallback, suspense, afterMount, }: MicroAppProps): React.JSX.Element;
|
|
14
15
|
useGlobalState({ lang, setLang, }: {
|
|
15
16
|
lang: 'zh' | 'en';
|
|
16
17
|
setLang: (lang?: 'zh' | 'en') => void;
|
package/dist/micro-app/index.js
CHANGED
|
@@ -15,7 +15,8 @@ var MicroApp = function MicroApp(_ref) {
|
|
|
15
15
|
pathname = _ref.pathname,
|
|
16
16
|
microProps = _ref.microProps,
|
|
17
17
|
fallback = _ref.fallback,
|
|
18
|
-
suspense = _ref.suspense
|
|
18
|
+
suspense = _ref.suspense,
|
|
19
|
+
_afterMount = _ref.afterMount;
|
|
19
20
|
var microAppId = useMemo(function () {
|
|
20
21
|
return "microapp-".concat(randomString(8));
|
|
21
22
|
}, []);
|
|
@@ -68,6 +69,23 @@ var MicroApp = function MicroApp(_ref) {
|
|
|
68
69
|
return _beforeMount.apply(this, arguments);
|
|
69
70
|
}
|
|
70
71
|
return beforeMount;
|
|
72
|
+
}(),
|
|
73
|
+
afterMount: function () {
|
|
74
|
+
var _afterMount2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
75
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
76
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
77
|
+
case 0:
|
|
78
|
+
return _context3.abrupt("return", _afterMount === null || _afterMount === void 0 ? void 0 : _afterMount());
|
|
79
|
+
case 1:
|
|
80
|
+
case "end":
|
|
81
|
+
return _context3.stop();
|
|
82
|
+
}
|
|
83
|
+
}, _callee3);
|
|
84
|
+
}));
|
|
85
|
+
function afterMount() {
|
|
86
|
+
return _afterMount2.apply(this, arguments);
|
|
87
|
+
}
|
|
88
|
+
return afterMount;
|
|
71
89
|
}()
|
|
72
90
|
});
|
|
73
91
|
return function () {
|