@modern-js/plugin-garfish 2.19.0 → 2.20.0

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.
@@ -1,145 +1,7 @@
1
- function _array_like_to_array(arr, len) {
2
- if (len == null || len > arr.length)
3
- len = arr.length;
4
- for (var i = 0, arr2 = new Array(len); i < len; i++)
5
- arr2[i] = arr[i];
6
- return arr2;
7
- }
8
- function _array_with_holes(arr) {
9
- if (Array.isArray(arr))
10
- return arr;
11
- }
12
- function _define_property(obj, key, value) {
13
- if (key in obj) {
14
- Object.defineProperty(obj, key, {
15
- value: value,
16
- enumerable: true,
17
- configurable: true,
18
- writable: true
19
- });
20
- } else {
21
- obj[key] = value;
22
- }
23
- return obj;
24
- }
25
- function _iterable_to_array_limit(arr, i) {
26
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
27
- if (_i == null)
28
- return;
29
- var _arr = [];
30
- var _n = true;
31
- var _d = false;
32
- var _s, _e;
33
- try {
34
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
35
- _arr.push(_s.value);
36
- if (i && _arr.length === i)
37
- break;
38
- }
39
- } catch (err) {
40
- _d = true;
41
- _e = err;
42
- } finally {
43
- try {
44
- if (!_n && _i["return"] != null)
45
- _i["return"]();
46
- } finally {
47
- if (_d)
48
- throw _e;
49
- }
50
- }
51
- return _arr;
52
- }
53
- function _non_iterable_rest() {
54
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
55
- }
56
- function _object_spread(target) {
57
- for (var i = 1; i < arguments.length; i++) {
58
- var source = arguments[i] != null ? arguments[i] : {};
59
- var ownKeys2 = Object.keys(source);
60
- if (typeof Object.getOwnPropertySymbols === "function") {
61
- ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
62
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
63
- }));
64
- }
65
- ownKeys2.forEach(function(key) {
66
- _define_property(target, key, source[key]);
67
- });
68
- }
69
- return target;
70
- }
71
- function ownKeys(object, enumerableOnly) {
72
- var keys = Object.keys(object);
73
- if (Object.getOwnPropertySymbols) {
74
- var symbols = Object.getOwnPropertySymbols(object);
75
- if (enumerableOnly) {
76
- symbols = symbols.filter(function(sym) {
77
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
78
- });
79
- }
80
- keys.push.apply(keys, symbols);
81
- }
82
- return keys;
83
- }
84
- function _object_spread_props(target, source) {
85
- source = source != null ? source : {};
86
- if (Object.getOwnPropertyDescriptors) {
87
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
88
- } else {
89
- ownKeys(Object(source)).forEach(function(key) {
90
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
91
- });
92
- }
93
- return target;
94
- }
95
- function _object_without_properties(source, excluded) {
96
- if (source == null)
97
- return {};
98
- var target = _object_without_properties_loose(source, excluded);
99
- var key, i;
100
- if (Object.getOwnPropertySymbols) {
101
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
102
- for (i = 0; i < sourceSymbolKeys.length; i++) {
103
- key = sourceSymbolKeys[i];
104
- if (excluded.indexOf(key) >= 0)
105
- continue;
106
- if (!Object.prototype.propertyIsEnumerable.call(source, key))
107
- continue;
108
- target[key] = source[key];
109
- }
110
- }
111
- return target;
112
- }
113
- function _object_without_properties_loose(source, excluded) {
114
- if (source == null)
115
- return {};
116
- var target = {};
117
- var sourceKeys = Object.keys(source);
118
- var key, i;
119
- for (i = 0; i < sourceKeys.length; i++) {
120
- key = sourceKeys[i];
121
- if (excluded.indexOf(key) >= 0)
122
- continue;
123
- target[key] = source[key];
124
- }
125
- return target;
126
- }
127
- function _sliced_to_array(arr, i) {
128
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
129
- }
130
- function _unsupported_iterable_to_array(o, minLen) {
131
- if (!o)
132
- return;
133
- if (typeof o === "string")
134
- return _array_like_to_array(o, minLen);
135
- var n = Object.prototype.toString.call(o).slice(8, -1);
136
- if (n === "Object" && o.constructor)
137
- n = o.constructor.name;
138
- if (n === "Map" || n === "Set")
139
- return Array.from(n);
140
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
141
- return _array_like_to_array(o, minLen);
142
- }
1
+ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
+ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
+ import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
4
+ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
143
5
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
144
6
  import { useState, useEffect, useCallback } from "react";
145
7
  import { logger } from "../util";
@@ -1,345 +1,15 @@
1
- function _array_like_to_array(arr, len) {
2
- if (len == null || len > arr.length)
3
- len = arr.length;
4
- for (var i = 0, arr2 = new Array(len); i < len; i++)
5
- arr2[i] = arr[i];
6
- return arr2;
7
- }
8
- function _array_without_holes(arr) {
9
- if (Array.isArray(arr))
10
- return _array_like_to_array(arr);
11
- }
12
- function _assert_this_initialized(self) {
13
- if (self === void 0) {
14
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
15
- }
16
- return self;
17
- }
18
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
19
- try {
20
- var info = gen[key](arg);
21
- var value = info.value;
22
- } catch (error) {
23
- reject(error);
24
- return;
25
- }
26
- if (info.done) {
27
- resolve(value);
28
- } else {
29
- Promise.resolve(value).then(_next, _throw);
30
- }
31
- }
32
- function _async_to_generator(fn) {
33
- return function() {
34
- var self = this, args = arguments;
35
- return new Promise(function(resolve, reject) {
36
- var gen = fn.apply(self, args);
37
- function _next(value) {
38
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
39
- }
40
- function _throw(err) {
41
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
42
- }
43
- _next(void 0);
44
- });
45
- };
46
- }
47
- function _class_call_check(instance, Constructor) {
48
- if (!(instance instanceof Constructor)) {
49
- throw new TypeError("Cannot call a class as a function");
50
- }
51
- }
52
- function _defineProperties(target, props) {
53
- for (var i = 0; i < props.length; i++) {
54
- var descriptor = props[i];
55
- descriptor.enumerable = descriptor.enumerable || false;
56
- descriptor.configurable = true;
57
- if ("value" in descriptor)
58
- descriptor.writable = true;
59
- Object.defineProperty(target, descriptor.key, descriptor);
60
- }
61
- }
62
- function _create_class(Constructor, protoProps, staticProps) {
63
- if (protoProps)
64
- _defineProperties(Constructor.prototype, protoProps);
65
- if (staticProps)
66
- _defineProperties(Constructor, staticProps);
67
- return Constructor;
68
- }
69
- function _define_property(obj, key, value) {
70
- if (key in obj) {
71
- Object.defineProperty(obj, key, {
72
- value: value,
73
- enumerable: true,
74
- configurable: true,
75
- writable: true
76
- });
77
- } else {
78
- obj[key] = value;
79
- }
80
- return obj;
81
- }
82
- function _get_prototype_of(o) {
83
- _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o2) {
84
- return o2.__proto__ || Object.getPrototypeOf(o2);
85
- };
86
- return _get_prototype_of(o);
87
- }
88
- function _inherits(subClass, superClass) {
89
- if (typeof superClass !== "function" && superClass !== null) {
90
- throw new TypeError("Super expression must either be null or a function");
91
- }
92
- subClass.prototype = Object.create(superClass && superClass.prototype, {
93
- constructor: {
94
- value: subClass,
95
- writable: true,
96
- configurable: true
97
- }
98
- });
99
- if (superClass)
100
- _set_prototype_of(subClass, superClass);
101
- }
102
- function _iterable_to_array(iter) {
103
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
104
- return Array.from(iter);
105
- }
106
- function _non_iterable_spread() {
107
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
108
- }
109
- function _object_spread(target) {
110
- for (var i = 1; i < arguments.length; i++) {
111
- var source = arguments[i] != null ? arguments[i] : {};
112
- var ownKeys2 = Object.keys(source);
113
- if (typeof Object.getOwnPropertySymbols === "function") {
114
- ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
115
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
116
- }));
117
- }
118
- ownKeys2.forEach(function(key) {
119
- _define_property(target, key, source[key]);
120
- });
121
- }
122
- return target;
123
- }
124
- function ownKeys(object, enumerableOnly) {
125
- var keys = Object.keys(object);
126
- if (Object.getOwnPropertySymbols) {
127
- var symbols = Object.getOwnPropertySymbols(object);
128
- if (enumerableOnly) {
129
- symbols = symbols.filter(function(sym) {
130
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
131
- });
132
- }
133
- keys.push.apply(keys, symbols);
134
- }
135
- return keys;
136
- }
137
- function _object_spread_props(target, source) {
138
- source = source != null ? source : {};
139
- if (Object.getOwnPropertyDescriptors) {
140
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
141
- } else {
142
- ownKeys(Object(source)).forEach(function(key) {
143
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
144
- });
145
- }
146
- return target;
147
- }
148
- function _object_without_properties(source, excluded) {
149
- if (source == null)
150
- return {};
151
- var target = _object_without_properties_loose(source, excluded);
152
- var key, i;
153
- if (Object.getOwnPropertySymbols) {
154
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
155
- for (i = 0; i < sourceSymbolKeys.length; i++) {
156
- key = sourceSymbolKeys[i];
157
- if (excluded.indexOf(key) >= 0)
158
- continue;
159
- if (!Object.prototype.propertyIsEnumerable.call(source, key))
160
- continue;
161
- target[key] = source[key];
162
- }
163
- }
164
- return target;
165
- }
166
- function _object_without_properties_loose(source, excluded) {
167
- if (source == null)
168
- return {};
169
- var target = {};
170
- var sourceKeys = Object.keys(source);
171
- var key, i;
172
- for (i = 0; i < sourceKeys.length; i++) {
173
- key = sourceKeys[i];
174
- if (excluded.indexOf(key) >= 0)
175
- continue;
176
- target[key] = source[key];
177
- }
178
- return target;
179
- }
180
- function _possible_constructor_return(self, call) {
181
- if (call && (_type_of(call) === "object" || typeof call === "function")) {
182
- return call;
183
- }
184
- return _assert_this_initialized(self);
185
- }
186
- function _set_prototype_of(o, p) {
187
- _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o2, p2) {
188
- o2.__proto__ = p2;
189
- return o2;
190
- };
191
- return _set_prototype_of(o, p);
192
- }
193
- function _to_consumable_array(arr) {
194
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
195
- }
196
- function _type_of(obj) {
197
- "@swc/helpers - typeof";
198
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
199
- }
200
- function _unsupported_iterable_to_array(o, minLen) {
201
- if (!o)
202
- return;
203
- if (typeof o === "string")
204
- return _array_like_to_array(o, minLen);
205
- var n = Object.prototype.toString.call(o).slice(8, -1);
206
- if (n === "Object" && o.constructor)
207
- n = o.constructor.name;
208
- if (n === "Map" || n === "Set")
209
- return Array.from(n);
210
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
211
- return _array_like_to_array(o, minLen);
212
- }
213
- function _is_native_reflect_construct() {
214
- if (typeof Reflect === "undefined" || !Reflect.construct)
215
- return false;
216
- if (Reflect.construct.sham)
217
- return false;
218
- if (typeof Proxy === "function")
219
- return true;
220
- try {
221
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
222
- }));
223
- return true;
224
- } catch (e) {
225
- return false;
226
- }
227
- }
228
- function _create_super(Derived) {
229
- var hasNativeReflectConstruct = _is_native_reflect_construct();
230
- return function _createSuperInternal() {
231
- var Super = _get_prototype_of(Derived), result;
232
- if (hasNativeReflectConstruct) {
233
- var NewTarget = _get_prototype_of(this).constructor;
234
- result = Reflect.construct(Super, arguments, NewTarget);
235
- } else {
236
- result = Super.apply(this, arguments);
237
- }
238
- return _possible_constructor_return(this, result);
239
- };
240
- }
241
- var __generator = function(thisArg, body) {
242
- var f, y, t, g, _ = {
243
- label: 0,
244
- sent: function() {
245
- if (t[0] & 1)
246
- throw t[1];
247
- return t[1];
248
- },
249
- trys: [],
250
- ops: []
251
- };
252
- return g = {
253
- next: verb(0),
254
- "throw": verb(1),
255
- "return": verb(2)
256
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
257
- return this;
258
- }), g;
259
- function verb(n) {
260
- return function(v) {
261
- return step([
262
- n,
263
- v
264
- ]);
265
- };
266
- }
267
- function step(op) {
268
- if (f)
269
- throw new TypeError("Generator is already executing.");
270
- while (_)
271
- try {
272
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
273
- return t;
274
- if (y = 0, t)
275
- op = [
276
- op[0] & 2,
277
- t.value
278
- ];
279
- switch (op[0]) {
280
- case 0:
281
- case 1:
282
- t = op;
283
- break;
284
- case 4:
285
- _.label++;
286
- return {
287
- value: op[1],
288
- done: false
289
- };
290
- case 5:
291
- _.label++;
292
- y = op[1];
293
- op = [
294
- 0
295
- ];
296
- continue;
297
- case 7:
298
- op = _.ops.pop();
299
- _.trys.pop();
300
- continue;
301
- default:
302
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
303
- _ = 0;
304
- continue;
305
- }
306
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
307
- _.label = op[1];
308
- break;
309
- }
310
- if (op[0] === 6 && _.label < t[1]) {
311
- _.label = t[1];
312
- t = op;
313
- break;
314
- }
315
- if (t && _.label < t[2]) {
316
- _.label = t[2];
317
- _.ops.push(op);
318
- break;
319
- }
320
- if (t[2])
321
- _.ops.pop();
322
- _.trys.pop();
323
- continue;
324
- }
325
- op = body.call(thisArg, _);
326
- } catch (e) {
327
- op = [
328
- 6,
329
- e
330
- ];
331
- y = 0;
332
- } finally {
333
- f = t = 0;
334
- }
335
- if (op[0] & 5)
336
- throw op[1];
337
- return {
338
- value: op[0] ? op[1] : void 0,
339
- done: true
340
- };
341
- }
342
- };
1
+ import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
2
+ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
3
+ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
4
+ import { _ as _create_class } from "@swc/helpers/_/_create_class";
5
+ import { _ as _define_property } from "@swc/helpers/_/_define_property";
6
+ import { _ as _inherits } from "@swc/helpers/_/_inherits";
7
+ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
8
+ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
9
+ import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
10
+ import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
11
+ import { _ as _create_super } from "@swc/helpers/_/_create_super";
12
+ import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
343
13
  import { jsx as _jsx } from "react/jsx-runtime";
344
14
  import GarfishInstance from "garfish";
345
15
  import React from "react";
@@ -356,7 +26,7 @@ function _initOptions() {
356
26
  _initOptions = _async_to_generator(function() {
357
27
  var manifest, options, _window_modern_manifest, _window_modern_manifest1, apps, getAppList, _window_modern_manifest2;
358
28
  var _arguments = arguments;
359
- return __generator(this, function(_state) {
29
+ return _ts_generator(this, function(_state) {
360
30
  switch (_state.label) {
361
31
  case 0:
362
32
  manifest = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {}, options = _arguments.length > 1 ? _arguments[1] : void 0;
@@ -439,7 +109,7 @@ export default function(config) {
439
109
  var load = function() {
440
110
  var _ref = _async_to_generator(function() {
441
111
  var GarfishConfig, _generateApps, appInfoList, apps, MApp;
442
- return __generator(this, function(_state) {
112
+ return _ts_generator(this, function(_state) {
443
113
  switch (_state.label) {
444
114
  case 0:
445
115
  GarfishInstance.setOptions(_object_spread_props(_object_spread({}, options), {
@@ -1,31 +1,4 @@
1
- function _define_property(obj, key, value) {
2
- if (key in obj) {
3
- Object.defineProperty(obj, key, {
4
- value: value,
5
- enumerable: true,
6
- configurable: true,
7
- writable: true
8
- });
9
- } else {
10
- obj[key] = value;
11
- }
12
- return obj;
13
- }
14
- function _object_spread(target) {
15
- for (var i = 1; i < arguments.length; i++) {
16
- var source = arguments[i] != null ? arguments[i] : {};
17
- var ownKeys = Object.keys(source);
18
- if (typeof Object.getOwnPropertySymbols === "function") {
19
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
- }));
22
- }
23
- ownKeys.forEach(function(key) {
24
- _define_property(target, key, source[key]);
25
- });
26
- }
27
- return target;
28
- }
1
+ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
29
2
  import React, { useContext } from "react";
30
3
  import { logger } from "../util";
31
4
  import { GarfishContext } from "./utils/Context";