@modern-js/plugin-garfish 2.0.0-beta.4 → 2.0.0-beta.5

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.
@@ -44,6 +44,7 @@ import {
44
44
  setRuntimeConfig,
45
45
  generateAsyncEntry
46
46
  } from "./utils";
47
+ import "./types";
47
48
  const externals = { "react-dom": "react-dom", react: "react" };
48
49
  function getDefaultMicroFrontedConfig(microFrontend) {
49
50
  if (microFrontend === true) {
@@ -181,10 +182,12 @@ var cli_default = ({
181
182
  };
182
183
  },
183
184
  addRuntimeExports() {
184
- const addExportStatement = `export { default as garfish, default as masterApp, hoistNonReactStatics } from '${pluginName}'`;
185
+ const addExportStatement = `export { default as garfish, default as masterApp, hoistNonReactStatics } from '${pluginName}/runtime'`;
185
186
  logger("exportStatement", addExportStatement);
186
187
  pluginsExportsUtils.addExport(addExportStatement);
187
- runtimeExportsUtils.addExport(`export * from '${mfPackagePath}'`);
188
+ runtimeExportsUtils.addExport(
189
+ `export * from '${mfPackagePath}/runtime'`
190
+ );
188
191
  },
189
192
  modifyEntryImports({ entrypoint, imports }) {
190
193
  const config = useResolvedConfigContext();
File without changes
@@ -140,7 +140,7 @@ var plugin_default = (config) => ({
140
140
  logger("GarfishProvider state", this.state);
141
141
  return /* @__PURE__ */ jsx(GarfishProvider, {
142
142
  value: this.state,
143
- children: /* @__PURE__ */ jsx(App, __spreadValues(__spreadValues({}, this.props), this.state))
143
+ children: /* @__PURE__ */ jsx(App, __spreadValues({}, this.props))
144
144
  });
145
145
  }
146
146
  }
@@ -50,147 +50,160 @@ var __async = (__this, __arguments, generator) => {
50
50
  });
51
51
  };
52
52
  import { Fragment, jsx } from "react/jsx-runtime";
53
- import path from "path";
54
- import React from "react";
53
+ import { useContext, useState, useEffect, useRef } from "react";
54
+ import { RuntimeReactContext } from "@modern-js/runtime";
55
55
  import Garfish from "garfish";
56
- import { withRouter } from "@modern-js/plugin-router-legacy";
57
56
  import { logger, generateSubAppContainerKey } from "../../util";
58
57
  import { Loadable } from "../loadable";
58
+ function pathJoin(...args) {
59
+ const res = args.reduce((res2, path) => {
60
+ let nPath = path;
61
+ if (!nPath || typeof nPath !== "string") {
62
+ return res2;
63
+ }
64
+ if (nPath[0] !== "/") {
65
+ nPath = `/${nPath}`;
66
+ }
67
+ const lastIndex = path.length - 1;
68
+ if (nPath[lastIndex] === "/") {
69
+ nPath = nPath.substring(0, lastIndex);
70
+ }
71
+ return res2 + nPath;
72
+ }, "");
73
+ return res || "/";
74
+ }
59
75
  function getAppInstance(options, appInfo, manifest) {
60
76
  let locationHref = "";
61
- class MicroApp extends React.Component {
62
- constructor() {
63
- super(...arguments);
64
- this.state = {
65
- appInstance: null,
66
- domId: generateSubAppContainerKey(appInfo),
67
- SubModuleComponent: void 0
68
- };
69
- this.unregisterHistoryListener = () => {
70
- };
77
+ function MicroApp(props) {
78
+ var _a, _b, _c, _d, _e, _f;
79
+ const appRef = useRef(null);
80
+ const domId = generateSubAppContainerKey(appInfo);
81
+ const [SubModuleComponent, setSubModuleComponent] = useState();
82
+ const context = useContext(RuntimeReactContext);
83
+ const match = (_b = (_a = context == null ? void 0 : context.router) == null ? void 0 : _a.useRouteMatch) == null ? void 0 : _b.call(_a);
84
+ const matchs = (_d = (_c = context == null ? void 0 : context.router) == null ? void 0 : _c.useMatches) == null ? void 0 : _d.call(_c);
85
+ const location = (_f = (_e = context == null ? void 0 : context.router) == null ? void 0 : _e.useLocation) == null ? void 0 : _f.call(_e);
86
+ let basename = (options == null ? void 0 : options.basename) || "/";
87
+ if (matchs && matchs.length > 0) {
88
+ basename = pathJoin(basename, matchs[matchs.length - 1].pathname || "/");
89
+ } else if (match) {
90
+ basename = pathJoin(basename, (match == null ? void 0 : match.path) || "/");
71
91
  }
72
- componentDidMount() {
73
- return __async(this, null, function* () {
74
- const _a = this.props, { match, history, setLoadingState } = _a, userProps = __objRest(_a, ["match", "history", "setLoadingState"]);
75
- const { domId } = this.state;
76
- const loadAppOptions = __spreadProps(__spreadValues({}, appInfo), {
77
- insulationVariable: [
78
- ...appInfo.insulationVariable || [],
79
- "_SERVER_DATA"
80
- ],
81
- domGetter: `#${domId}`,
82
- basename: path.join((options == null ? void 0 : options.basename) || "/", (match == null ? void 0 : match.path) || "/"),
83
- cache: true,
84
- props: __spreadValues(__spreadValues({}, appInfo.props), userProps),
85
- customLoader: (provider) => {
86
- const {
87
- render,
88
- destroy,
89
- SubModuleComponent,
90
- jupiter_submodule_app_key
91
- } = provider;
92
- const componetRenderMode = (manifest == null ? void 0 : manifest.componentRender) && (SubModuleComponent || jupiter_submodule_app_key);
93
- return {
94
- mount: (...props) => {
95
- if (componetRenderMode) {
96
- this.setState({
97
- SubModuleComponent: SubModuleComponent != null ? SubModuleComponent : jupiter_submodule_app_key
98
- });
99
- return void 0;
100
- } else {
101
- logger("MicroApp customer render", props);
102
- return render == null ? void 0 : render.apply(provider, props);
103
- }
104
- },
105
- unmount(...props) {
106
- if (componetRenderMode) {
107
- return void 0;
108
- }
109
- logger("MicroApp customer destroy", props);
110
- return destroy == null ? void 0 : destroy.apply(provider, props);
92
+ useEffect(() => {
93
+ if (location && locationHref !== location.pathname) {
94
+ locationHref = location.pathname;
95
+ const popStateEvent = new PopStateEvent("popstate");
96
+ popStateEvent.garfish = true;
97
+ dispatchEvent(popStateEvent);
98
+ logger(`MicroApp Garfish.loadApp popstate`);
99
+ }
100
+ }, [location]);
101
+ useEffect(() => {
102
+ const _a2 = props, { setLoadingState } = _a2, userProps = __objRest(_a2, ["setLoadingState"]);
103
+ const loadAppOptions = __spreadProps(__spreadValues({}, appInfo), {
104
+ insulationVariable: [
105
+ ...appInfo.insulationVariable || [],
106
+ "_SERVER_DATA"
107
+ ],
108
+ domGetter: `#${domId}`,
109
+ basename,
110
+ cache: true,
111
+ props: __spreadValues(__spreadValues({}, appInfo.props), userProps),
112
+ customLoader: (provider) => {
113
+ const {
114
+ render,
115
+ destroy,
116
+ SubModuleComponent: SubModuleComponent2,
117
+ jupiter_submodule_app_key
118
+ } = provider;
119
+ const componetRenderMode = (manifest == null ? void 0 : manifest.componentRender) && (SubModuleComponent2 || jupiter_submodule_app_key);
120
+ return {
121
+ mount: (...props2) => {
122
+ if (componetRenderMode) {
123
+ setSubModuleComponent(SubModuleComponent2);
124
+ return void 0;
125
+ } else {
126
+ logger("MicroApp customer render", props2);
127
+ return render == null ? void 0 : render.apply(provider, props2);
111
128
  }
112
- };
113
- }
114
- });
115
- setLoadingState({
116
- isLoading: true,
117
- error: null
118
- });
119
- logger(`MicroApp Garfish.loadApp "${appInfo.name}"`, {
120
- loadAppOptions
121
- });
122
- try {
123
- const appInstance = yield Garfish.loadApp(appInfo.name, loadAppOptions);
124
- if (!appInstance) {
125
- throw new Error(
126
- `MicroApp Garfish.loadApp "${appInfo.name}" result is null`
129
+ },
130
+ unmount(...props2) {
131
+ if (componetRenderMode) {
132
+ return void 0;
133
+ }
134
+ logger("MicroApp customer destroy", props2);
135
+ return destroy == null ? void 0 : destroy.apply(provider, props2);
136
+ }
137
+ };
138
+ }
139
+ });
140
+ setLoadingState({
141
+ isLoading: true,
142
+ error: null
143
+ });
144
+ logger(`MicroApp Garfish.loadApp "${appInfo.name}"`, {
145
+ loadAppOptions
146
+ });
147
+ function renderApp() {
148
+ return __async(this, null, function* () {
149
+ try {
150
+ const appInstance = yield Garfish.loadApp(
151
+ appInfo.name,
152
+ loadAppOptions
127
153
  );
128
- }
129
- this.setState({
130
- appInstance
131
- });
132
- setLoadingState({
133
- isLoading: false
134
- });
135
- if (appInstance.mounted && appInstance.appInfo.cache) {
136
- logger(`MicroApp Garfish.loadApp "${appInfo.name}" show`, {
137
- appInfo: appInstance.appInfo,
138
- appInstance
154
+ if (!appInstance) {
155
+ throw new Error(
156
+ `MicroApp Garfish.loadApp "${appInfo.name}" result is null`
157
+ );
158
+ }
159
+ appRef.current = appInstance;
160
+ setLoadingState({
161
+ isLoading: false
139
162
  });
140
- yield appInstance == null ? void 0 : appInstance.show();
141
- } else {
142
- logger(`MicroApp Garfish.loadApp "${appInfo.name}" mount`, {
143
- appInfo: appInstance.appInfo,
144
- appInstance
163
+ if (appInstance.mounted && appInstance.appInfo.cache) {
164
+ logger(`MicroApp Garfish.loadApp "${appInfo.name}" show`, {
165
+ appInfo: appInstance.appInfo,
166
+ appInstance
167
+ });
168
+ yield appInstance == null ? void 0 : appInstance.show();
169
+ } else {
170
+ logger(`MicroApp Garfish.loadApp "${appInfo.name}" mount`, {
171
+ appInfo: appInstance.appInfo,
172
+ appInstance
173
+ });
174
+ yield appInstance == null ? void 0 : appInstance.mount();
175
+ }
176
+ } catch (error) {
177
+ setLoadingState({
178
+ isLoading: true,
179
+ error
145
180
  });
146
- yield appInstance == null ? void 0 : appInstance.mount();
147
181
  }
148
- this.unregisterHistoryListener = history == null ? void 0 : history.listen(() => {
149
- if (locationHref !== history.location.pathname) {
150
- locationHref = history.location.pathname;
151
- const popStateEvent = new PopStateEvent("popstate");
152
- dispatchEvent(popStateEvent);
153
- logger(`MicroApp Garfish.loadApp popstate`);
154
- }
155
- });
156
- } catch (error) {
157
- setLoadingState({
158
- isLoading: true,
159
- error
160
- });
161
- }
162
- });
163
- }
164
- componentWillUnmount() {
165
- return __async(this, null, function* () {
166
- var _a;
167
- const { appInstance } = this.state;
168
- (_a = this.unregisterHistoryListener) == null ? void 0 : _a.call(this);
169
- if (appInstance) {
170
- const { appInfo: appInfo2 } = appInstance;
182
+ });
183
+ }
184
+ renderApp();
185
+ return () => {
186
+ var _a3, _b2;
187
+ if (appRef.current) {
188
+ const { appInfo: appInfo2 } = appRef.current;
171
189
  if (appInfo2.cache) {
172
190
  logger(`MicroApp Garfish.loadApp "${appInfo2.name}" hide`);
173
- appInstance == null ? void 0 : appInstance.hide();
191
+ (_a3 = appRef.current) == null ? void 0 : _a3.hide();
174
192
  } else {
175
193
  logger(`MicroApp Garfish.loadApp "${appInfo2.name}" unmount`);
176
- appInstance == null ? void 0 : appInstance.unmount();
194
+ (_b2 = appRef.current) == null ? void 0 : _b2.unmount();
177
195
  }
178
196
  }
179
- });
180
- }
181
- render() {
182
- const { domId, SubModuleComponent } = this.state;
183
- return /* @__PURE__ */ jsx(Fragment, {
184
- children: /* @__PURE__ */ jsx("div", {
185
- id: domId,
186
- children: SubModuleComponent && /* @__PURE__ */ jsx(SubModuleComponent, {})
187
- })
188
- });
189
- }
197
+ };
198
+ }, []);
199
+ return /* @__PURE__ */ jsx(Fragment, {
200
+ children: /* @__PURE__ */ jsx("div", {
201
+ id: domId,
202
+ children: SubModuleComponent && /* @__PURE__ */ jsx(SubModuleComponent, {})
203
+ })
204
+ });
190
205
  }
191
- return Loadable(withRouter(MicroApp))(
192
- manifest == null ? void 0 : manifest.loadable
193
- );
206
+ return Loadable(MicroApp)(manifest == null ? void 0 : manifest.loadable);
194
207
  }
195
208
  function generateApps(options, manifest) {
196
209
  var _a;
@@ -203,5 +216,6 @@ function generateApps(options, manifest) {
203
216
  return { apps, appInfoList: options.apps || [] };
204
217
  }
205
218
  export {
206
- generateApps
219
+ generateApps,
220
+ pathJoin
207
221
  };
@@ -2,8 +2,22 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
6
  var __getProtoOf = Object.getPrototypeOf;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __spreadValues = (a, b) => {
11
+ for (var prop in b || (b = {}))
12
+ if (__hasOwnProp.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ if (__getOwnPropSymbols)
15
+ for (var prop of __getOwnPropSymbols(b)) {
16
+ if (__propIsEnum.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ }
19
+ return a;
20
+ };
7
21
  var __export = (target, all) => {
8
22
  for (var name in all)
9
23
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -21,33 +35,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
35
  mod
22
36
  ));
23
37
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
- var stdin_exports = {};
25
- __export(stdin_exports, {
26
- default: () => cli_default,
27
- externals: () => externals,
28
- getDefaultMicroFrontedConfig: () => getDefaultMicroFrontedConfig
29
- });
30
- module.exports = __toCommonJS(stdin_exports);
31
- var import_path = __toESM(require("path"));
32
- var import_utils = require("@modern-js/utils");
33
- var import_util = require("../util");
34
- var import_utils2 = require("./utils");
35
- var __defProp2 = Object.defineProperty;
36
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
37
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
38
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
39
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
40
- var __spreadValues = (a, b) => {
41
- for (var prop in b || (b = {}))
42
- if (__hasOwnProp2.call(b, prop))
43
- __defNormalProp(a, prop, b[prop]);
44
- if (__getOwnPropSymbols)
45
- for (var prop of __getOwnPropSymbols(b)) {
46
- if (__propIsEnum.call(b, prop))
47
- __defNormalProp(a, prop, b[prop]);
48
- }
49
- return a;
50
- };
51
38
  var __async = (__this, __arguments, generator) => {
52
39
  return new Promise((resolve, reject) => {
53
40
  var fulfilled = (value) => {
@@ -68,6 +55,18 @@ var __async = (__this, __arguments, generator) => {
68
55
  step((generator = generator.apply(__this, __arguments)).next());
69
56
  });
70
57
  };
58
+ var cli_exports = {};
59
+ __export(cli_exports, {
60
+ default: () => cli_default,
61
+ externals: () => externals,
62
+ getDefaultMicroFrontedConfig: () => getDefaultMicroFrontedConfig
63
+ });
64
+ module.exports = __toCommonJS(cli_exports);
65
+ var import_path = __toESM(require("path"));
66
+ var import_utils = require("@modern-js/utils");
67
+ var import_util = require("../util");
68
+ var import_utils2 = require("./utils");
69
+ var import_types = require("./types");
71
70
  const externals = { "react-dom": "react-dom", react: "react" };
72
71
  function getDefaultMicroFrontedConfig(microFrontend) {
73
72
  if (microFrontend === true) {
@@ -205,10 +204,12 @@ var cli_default = ({
205
204
  };
206
205
  },
207
206
  addRuntimeExports() {
208
- const addExportStatement = `export { default as garfish, default as masterApp, hoistNonReactStatics } from '${pluginName}'`;
207
+ const addExportStatement = `export { default as garfish, default as masterApp, hoistNonReactStatics } from '${pluginName}/runtime'`;
209
208
  (0, import_util.logger)("exportStatement", addExportStatement);
210
209
  pluginsExportsUtils.addExport(addExportStatement);
211
- runtimeExportsUtils.addExport(`export * from '${mfPackagePath}'`);
210
+ runtimeExportsUtils.addExport(
211
+ `export * from '${mfPackagePath}/runtime'`
212
+ );
212
213
  },
213
214
  modifyEntryImports({ entrypoint, imports }) {
214
215
  const config = useResolvedConfigContext();
@@ -313,3 +314,8 @@ var cli_default = ({
313
314
  };
314
315
  }
315
316
  });
317
+ // Annotate the CommonJS export names for ESM import in node:
318
+ 0 && (module.exports = {
319
+ externals,
320
+ getDefaultMicroFrontedConfig
321
+ });
File without changes
@@ -15,15 +15,15 @@ var __copyProps = (to, from, except, desc) => {
15
15
  return to;
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var stdin_exports = {};
19
- __export(stdin_exports, {
18
+ var utils_exports = {};
19
+ __export(utils_exports, {
20
20
  generateAsyncEntry: () => generateAsyncEntry,
21
21
  getRuntimeConfig: () => getRuntimeConfig,
22
22
  makeProvider: () => makeProvider,
23
23
  makeRenderFunction: () => makeRenderFunction,
24
24
  setRuntimeConfig: () => setRuntimeConfig
25
25
  });
26
- module.exports = __toCommonJS(stdin_exports);
26
+ module.exports = __toCommonJS(utils_exports);
27
27
  const makeProvider = () => `
28
28
  export const provider = function ({basename, dom}) {
29
29
  return {
@@ -148,3 +148,11 @@ const generateAsyncEntry = (code) => {
148
148
  ${transformCode}
149
149
  `;
150
150
  };
151
+ // Annotate the CommonJS export names for ESM import in node:
152
+ 0 && (module.exports = {
153
+ generateAsyncEntry,
154
+ getRuntimeConfig,
155
+ makeProvider,
156
+ makeRenderFunction,
157
+ setRuntimeConfig
158
+ });
@@ -22,10 +22,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  mod
23
23
  ));
24
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
- var stdin_exports = {};
26
- __export(stdin_exports, {
25
+ var src_exports = {};
26
+ __export(src_exports, {
27
27
  default: () => import_runtime.default
28
28
  });
29
- module.exports = __toCommonJS(stdin_exports);
29
+ module.exports = __toCommonJS(src_exports);
30
30
  var import_runtime = __toESM(require("./runtime"));
31
- __reExport(stdin_exports, require("./runtime"), module.exports);
31
+ __reExport(src_exports, require("./runtime"), module.exports);
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {});
@@ -21,8 +21,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  mod
22
22
  ));
23
23
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
- var stdin_exports = {};
25
- __export(stdin_exports, {
24
+ var runtime_exports = {};
25
+ __export(runtime_exports, {
26
26
  Garfish: () => import_garfish.default,
27
27
  default: () => import_plugin.default,
28
28
  garfish: () => import_garfish.default,
@@ -30,8 +30,16 @@ __export(stdin_exports, {
30
30
  useModuleApp: () => import_useModuleApps.useModuleApp,
31
31
  useModuleApps: () => import_useModuleApps.useModuleApps
32
32
  });
33
- module.exports = __toCommonJS(stdin_exports);
33
+ module.exports = __toCommonJS(runtime_exports);
34
34
  var import_plugin = __toESM(require("./plugin"));
35
35
  var import_useModuleApps = require("./useModuleApps");
36
36
  var import_garfish = __toESM(require("garfish"));
37
37
  var import_hoist_non_react_statics = __toESM(require("hoist-non-react-statics"));
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ Garfish,
41
+ garfish,
42
+ hoistNonReactStatics,
43
+ useModuleApp,
44
+ useModuleApps
45
+ });
@@ -1,38 +1,15 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var stdin_exports = {};
19
- __export(stdin_exports, {
20
- Loadable: () => Loadable
21
- });
22
- module.exports = __toCommonJS(stdin_exports);
23
- var import_jsx_runtime = require("react/jsx-runtime");
24
- var import_react = require("react");
25
- var import_util = require("../util");
26
- var __defProp2 = Object.defineProperty;
27
2
  var __defProps = Object.defineProperties;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
28
4
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
29
6
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
30
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
31
8
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
32
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
33
10
  var __spreadValues = (a, b) => {
34
11
  for (var prop in b || (b = {}))
35
- if (__hasOwnProp2.call(b, prop))
12
+ if (__hasOwnProp.call(b, prop))
36
13
  __defNormalProp(a, prop, b[prop]);
37
14
  if (__getOwnPropSymbols)
38
15
  for (var prop of __getOwnPropSymbols(b)) {
@@ -45,7 +22,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
45
22
  var __objRest = (source, exclude) => {
46
23
  var target = {};
47
24
  for (var prop in source)
48
- if (__hasOwnProp2.call(source, prop) && exclude.indexOf(prop) < 0)
25
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
49
26
  target[prop] = source[prop];
50
27
  if (source != null && __getOwnPropSymbols)
51
28
  for (var prop of __getOwnPropSymbols(source)) {
@@ -54,6 +31,27 @@ var __objRest = (source, exclude) => {
54
31
  }
55
32
  return target;
56
33
  };
34
+ var __export = (target, all) => {
35
+ for (var name in all)
36
+ __defProp(target, name, { get: all[name], enumerable: true });
37
+ };
38
+ var __copyProps = (to, from, except, desc) => {
39
+ if (from && typeof from === "object" || typeof from === "function") {
40
+ for (let key of __getOwnPropNames(from))
41
+ if (!__hasOwnProp.call(to, key) && key !== except)
42
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
43
+ }
44
+ return to;
45
+ };
46
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
47
+ var loadable_exports = {};
48
+ __export(loadable_exports, {
49
+ Loadable: () => Loadable
50
+ });
51
+ module.exports = __toCommonJS(loadable_exports);
52
+ var import_jsx_runtime = require("react/jsx-runtime");
53
+ var import_react = require("react");
54
+ var import_util = require("../util");
57
55
  const DEFAULT_LOADABLE = {
58
56
  delay: 200,
59
57
  timeout: 1e4,
@@ -150,3 +148,7 @@ function Loadable(WrapComponent) {
150
148
  };
151
149
  };
152
150
  }
151
+ // Annotate the CommonJS export names for ESM import in node:
152
+ 0 && (module.exports = {
153
+ Loadable
154
+ });