@plasmicpkgs/plasmic-strapi 0.1.108 → 0.1.110

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.
@@ -7,6 +7,307 @@ import get from 'dlv';
7
7
  import { pascalCase } from 'change-case';
8
8
  import React, { useContext } from 'react';
9
9
 
10
+ function _regeneratorRuntime() {
11
+ _regeneratorRuntime = function () {
12
+ return e;
13
+ };
14
+ var t,
15
+ e = {},
16
+ r = Object.prototype,
17
+ n = r.hasOwnProperty,
18
+ o = Object.defineProperty || function (t, e, r) {
19
+ t[e] = r.value;
20
+ },
21
+ i = "function" == typeof Symbol ? Symbol : {},
22
+ a = i.iterator || "@@iterator",
23
+ c = i.asyncIterator || "@@asyncIterator",
24
+ u = i.toStringTag || "@@toStringTag";
25
+ function define(t, e, r) {
26
+ return Object.defineProperty(t, e, {
27
+ value: r,
28
+ enumerable: !0,
29
+ configurable: !0,
30
+ writable: !0
31
+ }), t[e];
32
+ }
33
+ try {
34
+ define({}, "");
35
+ } catch (t) {
36
+ define = function (t, e, r) {
37
+ return t[e] = r;
38
+ };
39
+ }
40
+ function wrap(t, e, r, n) {
41
+ var i = e && e.prototype instanceof Generator ? e : Generator,
42
+ a = Object.create(i.prototype),
43
+ c = new Context(n || []);
44
+ return o(a, "_invoke", {
45
+ value: makeInvokeMethod(t, r, c)
46
+ }), a;
47
+ }
48
+ function tryCatch(t, e, r) {
49
+ try {
50
+ return {
51
+ type: "normal",
52
+ arg: t.call(e, r)
53
+ };
54
+ } catch (t) {
55
+ return {
56
+ type: "throw",
57
+ arg: t
58
+ };
59
+ }
60
+ }
61
+ e.wrap = wrap;
62
+ var h = "suspendedStart",
63
+ l = "suspendedYield",
64
+ f = "executing",
65
+ s = "completed",
66
+ y = {};
67
+ function Generator() {}
68
+ function GeneratorFunction() {}
69
+ function GeneratorFunctionPrototype() {}
70
+ var p = {};
71
+ define(p, a, function () {
72
+ return this;
73
+ });
74
+ var d = Object.getPrototypeOf,
75
+ v = d && d(d(values([])));
76
+ v && v !== r && n.call(v, a) && (p = v);
77
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
78
+ function defineIteratorMethods(t) {
79
+ ["next", "throw", "return"].forEach(function (e) {
80
+ define(t, e, function (t) {
81
+ return this._invoke(e, t);
82
+ });
83
+ });
84
+ }
85
+ function AsyncIterator(t, e) {
86
+ function invoke(r, o, i, a) {
87
+ var c = tryCatch(t[r], t, o);
88
+ if ("throw" !== c.type) {
89
+ var u = c.arg,
90
+ h = u.value;
91
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
92
+ invoke("next", t, i, a);
93
+ }, function (t) {
94
+ invoke("throw", t, i, a);
95
+ }) : e.resolve(h).then(function (t) {
96
+ u.value = t, i(u);
97
+ }, function (t) {
98
+ return invoke("throw", t, i, a);
99
+ });
100
+ }
101
+ a(c.arg);
102
+ }
103
+ var r;
104
+ o(this, "_invoke", {
105
+ value: function (t, n) {
106
+ function callInvokeWithMethodAndArg() {
107
+ return new e(function (e, r) {
108
+ invoke(t, n, e, r);
109
+ });
110
+ }
111
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
112
+ }
113
+ });
114
+ }
115
+ function makeInvokeMethod(e, r, n) {
116
+ var o = h;
117
+ return function (i, a) {
118
+ if (o === f) throw new Error("Generator is already running");
119
+ if (o === s) {
120
+ if ("throw" === i) throw a;
121
+ return {
122
+ value: t,
123
+ done: !0
124
+ };
125
+ }
126
+ for (n.method = i, n.arg = a;;) {
127
+ var c = n.delegate;
128
+ if (c) {
129
+ var u = maybeInvokeDelegate(c, n);
130
+ if (u) {
131
+ if (u === y) continue;
132
+ return u;
133
+ }
134
+ }
135
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
136
+ if (o === h) throw o = s, n.arg;
137
+ n.dispatchException(n.arg);
138
+ } else "return" === n.method && n.abrupt("return", n.arg);
139
+ o = f;
140
+ var p = tryCatch(e, r, n);
141
+ if ("normal" === p.type) {
142
+ if (o = n.done ? s : l, p.arg === y) continue;
143
+ return {
144
+ value: p.arg,
145
+ done: n.done
146
+ };
147
+ }
148
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
149
+ }
150
+ };
151
+ }
152
+ function maybeInvokeDelegate(e, r) {
153
+ var n = r.method,
154
+ o = e.iterator[n];
155
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
156
+ var i = tryCatch(o, e.iterator, r.arg);
157
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
158
+ var a = i.arg;
159
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
160
+ }
161
+ function pushTryEntry(t) {
162
+ var e = {
163
+ tryLoc: t[0]
164
+ };
165
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
166
+ }
167
+ function resetTryEntry(t) {
168
+ var e = t.completion || {};
169
+ e.type = "normal", delete e.arg, t.completion = e;
170
+ }
171
+ function Context(t) {
172
+ this.tryEntries = [{
173
+ tryLoc: "root"
174
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
175
+ }
176
+ function values(e) {
177
+ if (e || "" === e) {
178
+ var r = e[a];
179
+ if (r) return r.call(e);
180
+ if ("function" == typeof e.next) return e;
181
+ if (!isNaN(e.length)) {
182
+ var o = -1,
183
+ i = function next() {
184
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
185
+ return next.value = t, next.done = !0, next;
186
+ };
187
+ return i.next = i;
188
+ }
189
+ }
190
+ throw new TypeError(typeof e + " is not iterable");
191
+ }
192
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
193
+ value: GeneratorFunctionPrototype,
194
+ configurable: !0
195
+ }), o(GeneratorFunctionPrototype, "constructor", {
196
+ value: GeneratorFunction,
197
+ configurable: !0
198
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
199
+ var e = "function" == typeof t && t.constructor;
200
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
201
+ }, e.mark = function (t) {
202
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
203
+ }, e.awrap = function (t) {
204
+ return {
205
+ __await: t
206
+ };
207
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
208
+ return this;
209
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
210
+ void 0 === i && (i = Promise);
211
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
212
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
213
+ return t.done ? t.value : a.next();
214
+ });
215
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
216
+ return this;
217
+ }), define(g, "toString", function () {
218
+ return "[object Generator]";
219
+ }), e.keys = function (t) {
220
+ var e = Object(t),
221
+ r = [];
222
+ for (var n in e) r.push(n);
223
+ return r.reverse(), function next() {
224
+ for (; r.length;) {
225
+ var t = r.pop();
226
+ if (t in e) return next.value = t, next.done = !1, next;
227
+ }
228
+ return next.done = !0, next;
229
+ };
230
+ }, e.values = values, Context.prototype = {
231
+ constructor: Context,
232
+ reset: function (e) {
233
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
234
+ },
235
+ stop: function () {
236
+ this.done = !0;
237
+ var t = this.tryEntries[0].completion;
238
+ if ("throw" === t.type) throw t.arg;
239
+ return this.rval;
240
+ },
241
+ dispatchException: function (e) {
242
+ if (this.done) throw e;
243
+ var r = this;
244
+ function handle(n, o) {
245
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
246
+ }
247
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
248
+ var i = this.tryEntries[o],
249
+ a = i.completion;
250
+ if ("root" === i.tryLoc) return handle("end");
251
+ if (i.tryLoc <= this.prev) {
252
+ var c = n.call(i, "catchLoc"),
253
+ u = n.call(i, "finallyLoc");
254
+ if (c && u) {
255
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
256
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
257
+ } else if (c) {
258
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
259
+ } else {
260
+ if (!u) throw new Error("try statement without catch or finally");
261
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
262
+ }
263
+ }
264
+ }
265
+ },
266
+ abrupt: function (t, e) {
267
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
268
+ var o = this.tryEntries[r];
269
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
270
+ var i = o;
271
+ break;
272
+ }
273
+ }
274
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
275
+ var a = i ? i.completion : {};
276
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
277
+ },
278
+ complete: function (t, e) {
279
+ if ("throw" === t.type) throw t.arg;
280
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
281
+ },
282
+ finish: function (t) {
283
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
284
+ var r = this.tryEntries[e];
285
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
286
+ }
287
+ },
288
+ catch: function (t) {
289
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
290
+ var r = this.tryEntries[e];
291
+ if (r.tryLoc === t) {
292
+ var n = r.completion;
293
+ if ("throw" === n.type) {
294
+ var o = n.arg;
295
+ resetTryEntry(r);
296
+ }
297
+ return o;
298
+ }
299
+ }
300
+ throw new Error("illegal catch attempt");
301
+ },
302
+ delegateYield: function (e, r, n) {
303
+ return this.delegate = {
304
+ iterator: values(e),
305
+ resultName: r,
306
+ nextLoc: n
307
+ }, "next" === this.method && (this.arg = t), y;
308
+ }
309
+ }, e;
310
+ }
10
311
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
11
312
  try {
12
313
  var info = gen[key](arg);
@@ -52,664 +353,6 @@ function _extends() {
52
353
  return _extends.apply(this, arguments);
53
354
  }
54
355
 
55
- function createCommonjsModule(fn, module) {
56
- return module = { exports: {} }, fn(module, module.exports), module.exports;
57
- }
58
-
59
- var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
60
- /**
61
- * Copyright (c) 2014-present, Facebook, Inc.
62
- *
63
- * This source code is licensed under the MIT license found in the
64
- * LICENSE file in the root directory of this source tree.
65
- */
66
-
67
- var runtime = function (exports) {
68
-
69
- var Op = Object.prototype;
70
- var hasOwn = Op.hasOwnProperty;
71
- var undefined$1; // More compressible than void 0.
72
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
73
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
74
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
75
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
76
- function define(obj, key, value) {
77
- Object.defineProperty(obj, key, {
78
- value: value,
79
- enumerable: true,
80
- configurable: true,
81
- writable: true
82
- });
83
- return obj[key];
84
- }
85
- try {
86
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
87
- define({}, "");
88
- } catch (err) {
89
- define = function define(obj, key, value) {
90
- return obj[key] = value;
91
- };
92
- }
93
- function wrap(innerFn, outerFn, self, tryLocsList) {
94
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
95
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
96
- var generator = Object.create(protoGenerator.prototype);
97
- var context = new Context(tryLocsList || []);
98
-
99
- // The ._invoke method unifies the implementations of the .next,
100
- // .throw, and .return methods.
101
- generator._invoke = makeInvokeMethod(innerFn, self, context);
102
- return generator;
103
- }
104
- exports.wrap = wrap;
105
-
106
- // Try/catch helper to minimize deoptimizations. Returns a completion
107
- // record like context.tryEntries[i].completion. This interface could
108
- // have been (and was previously) designed to take a closure to be
109
- // invoked without arguments, but in all the cases we care about we
110
- // already have an existing method we want to call, so there's no need
111
- // to create a new function object. We can even get away with assuming
112
- // the method takes exactly one argument, since that happens to be true
113
- // in every case, so we don't have to touch the arguments object. The
114
- // only additional allocation required is the completion record, which
115
- // has a stable shape and so hopefully should be cheap to allocate.
116
- function tryCatch(fn, obj, arg) {
117
- try {
118
- return {
119
- type: "normal",
120
- arg: fn.call(obj, arg)
121
- };
122
- } catch (err) {
123
- return {
124
- type: "throw",
125
- arg: err
126
- };
127
- }
128
- }
129
- var GenStateSuspendedStart = "suspendedStart";
130
- var GenStateSuspendedYield = "suspendedYield";
131
- var GenStateExecuting = "executing";
132
- var GenStateCompleted = "completed";
133
-
134
- // Returning this object from the innerFn has the same effect as
135
- // breaking out of the dispatch switch statement.
136
- var ContinueSentinel = {};
137
-
138
- // Dummy constructor functions that we use as the .constructor and
139
- // .constructor.prototype properties for functions that return Generator
140
- // objects. For full spec compliance, you may wish to configure your
141
- // minifier not to mangle the names of these two functions.
142
- function Generator() {}
143
- function GeneratorFunction() {}
144
- function GeneratorFunctionPrototype() {}
145
-
146
- // This is a polyfill for %IteratorPrototype% for environments that
147
- // don't natively support it.
148
- var IteratorPrototype = {};
149
- define(IteratorPrototype, iteratorSymbol, function () {
150
- return this;
151
- });
152
- var getProto = Object.getPrototypeOf;
153
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
154
- if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
155
- // This environment has a native %IteratorPrototype%; use it instead
156
- // of the polyfill.
157
- IteratorPrototype = NativeIteratorPrototype;
158
- }
159
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
160
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
161
- define(Gp, "constructor", GeneratorFunctionPrototype);
162
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
163
- GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
164
-
165
- // Helper for defining the .next, .throw, and .return methods of the
166
- // Iterator interface in terms of a single ._invoke method.
167
- function defineIteratorMethods(prototype) {
168
- ["next", "throw", "return"].forEach(function (method) {
169
- define(prototype, method, function (arg) {
170
- return this._invoke(method, arg);
171
- });
172
- });
173
- }
174
- exports.isGeneratorFunction = function (genFun) {
175
- var ctor = typeof genFun === "function" && genFun.constructor;
176
- return ctor ? ctor === GeneratorFunction ||
177
- // For the native GeneratorFunction constructor, the best we can
178
- // do is to check its .name property.
179
- (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
180
- };
181
- exports.mark = function (genFun) {
182
- if (Object.setPrototypeOf) {
183
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
184
- } else {
185
- genFun.__proto__ = GeneratorFunctionPrototype;
186
- define(genFun, toStringTagSymbol, "GeneratorFunction");
187
- }
188
- genFun.prototype = Object.create(Gp);
189
- return genFun;
190
- };
191
-
192
- // Within the body of any async function, `await x` is transformed to
193
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
194
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
195
- // meant to be awaited.
196
- exports.awrap = function (arg) {
197
- return {
198
- __await: arg
199
- };
200
- };
201
- function AsyncIterator(generator, PromiseImpl) {
202
- function invoke(method, arg, resolve, reject) {
203
- var record = tryCatch(generator[method], generator, arg);
204
- if (record.type === "throw") {
205
- reject(record.arg);
206
- } else {
207
- var result = record.arg;
208
- var value = result.value;
209
- if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
210
- return PromiseImpl.resolve(value.__await).then(function (value) {
211
- invoke("next", value, resolve, reject);
212
- }, function (err) {
213
- invoke("throw", err, resolve, reject);
214
- });
215
- }
216
- return PromiseImpl.resolve(value).then(function (unwrapped) {
217
- // When a yielded Promise is resolved, its final value becomes
218
- // the .value of the Promise<{value,done}> result for the
219
- // current iteration.
220
- result.value = unwrapped;
221
- resolve(result);
222
- }, function (error) {
223
- // If a rejected Promise was yielded, throw the rejection back
224
- // into the async generator function so it can be handled there.
225
- return invoke("throw", error, resolve, reject);
226
- });
227
- }
228
- }
229
- var previousPromise;
230
- function enqueue(method, arg) {
231
- function callInvokeWithMethodAndArg() {
232
- return new PromiseImpl(function (resolve, reject) {
233
- invoke(method, arg, resolve, reject);
234
- });
235
- }
236
- return previousPromise =
237
- // If enqueue has been called before, then we want to wait until
238
- // all previous Promises have been resolved before calling invoke,
239
- // so that results are always delivered in the correct order. If
240
- // enqueue has not been called before, then it is important to
241
- // call invoke immediately, without waiting on a callback to fire,
242
- // so that the async generator function has the opportunity to do
243
- // any necessary setup in a predictable way. This predictability
244
- // is why the Promise constructor synchronously invokes its
245
- // executor callback, and why async functions synchronously
246
- // execute code before the first await. Since we implement simple
247
- // async functions in terms of async generators, it is especially
248
- // important to get this right, even though it requires care.
249
- previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
250
- // Avoid propagating failures to Promises returned by later
251
- // invocations of the iterator.
252
- callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
253
- }
254
-
255
- // Define the unified helper method that is used to implement .next,
256
- // .throw, and .return (see defineIteratorMethods).
257
- this._invoke = enqueue;
258
- }
259
- defineIteratorMethods(AsyncIterator.prototype);
260
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
261
- return this;
262
- });
263
- exports.AsyncIterator = AsyncIterator;
264
-
265
- // Note that simple async functions are implemented on top of
266
- // AsyncIterator objects; they just return a Promise for the value of
267
- // the final result produced by the iterator.
268
- exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
269
- if (PromiseImpl === void 0) PromiseImpl = Promise;
270
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
271
- return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
272
- : iter.next().then(function (result) {
273
- return result.done ? result.value : iter.next();
274
- });
275
- };
276
- function makeInvokeMethod(innerFn, self, context) {
277
- var state = GenStateSuspendedStart;
278
- return function invoke(method, arg) {
279
- if (state === GenStateExecuting) {
280
- throw new Error("Generator is already running");
281
- }
282
- if (state === GenStateCompleted) {
283
- if (method === "throw") {
284
- throw arg;
285
- }
286
-
287
- // Be forgiving, per 25.3.3.3.3 of the spec:
288
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
289
- return doneResult();
290
- }
291
- context.method = method;
292
- context.arg = arg;
293
- while (true) {
294
- var delegate = context.delegate;
295
- if (delegate) {
296
- var delegateResult = maybeInvokeDelegate(delegate, context);
297
- if (delegateResult) {
298
- if (delegateResult === ContinueSentinel) continue;
299
- return delegateResult;
300
- }
301
- }
302
- if (context.method === "next") {
303
- // Setting context._sent for legacy support of Babel's
304
- // function.sent implementation.
305
- context.sent = context._sent = context.arg;
306
- } else if (context.method === "throw") {
307
- if (state === GenStateSuspendedStart) {
308
- state = GenStateCompleted;
309
- throw context.arg;
310
- }
311
- context.dispatchException(context.arg);
312
- } else if (context.method === "return") {
313
- context.abrupt("return", context.arg);
314
- }
315
- state = GenStateExecuting;
316
- var record = tryCatch(innerFn, self, context);
317
- if (record.type === "normal") {
318
- // If an exception is thrown from innerFn, we leave state ===
319
- // GenStateExecuting and loop back for another invocation.
320
- state = context.done ? GenStateCompleted : GenStateSuspendedYield;
321
- if (record.arg === ContinueSentinel) {
322
- continue;
323
- }
324
- return {
325
- value: record.arg,
326
- done: context.done
327
- };
328
- } else if (record.type === "throw") {
329
- state = GenStateCompleted;
330
- // Dispatch the exception by looping back around to the
331
- // context.dispatchException(context.arg) call above.
332
- context.method = "throw";
333
- context.arg = record.arg;
334
- }
335
- }
336
- };
337
- }
338
-
339
- // Call delegate.iterator[context.method](context.arg) and handle the
340
- // result, either by returning a { value, done } result from the
341
- // delegate iterator, or by modifying context.method and context.arg,
342
- // setting context.delegate to null, and returning the ContinueSentinel.
343
- function maybeInvokeDelegate(delegate, context) {
344
- var method = delegate.iterator[context.method];
345
- if (method === undefined$1) {
346
- // A .throw or .return when the delegate iterator has no .throw
347
- // method always terminates the yield* loop.
348
- context.delegate = null;
349
- if (context.method === "throw") {
350
- // Note: ["return"] must be used for ES3 parsing compatibility.
351
- if (delegate.iterator["return"]) {
352
- // If the delegate iterator has a return method, give it a
353
- // chance to clean up.
354
- context.method = "return";
355
- context.arg = undefined$1;
356
- maybeInvokeDelegate(delegate, context);
357
- if (context.method === "throw") {
358
- // If maybeInvokeDelegate(context) changed context.method from
359
- // "return" to "throw", let that override the TypeError below.
360
- return ContinueSentinel;
361
- }
362
- }
363
- context.method = "throw";
364
- context.arg = new TypeError("The iterator does not provide a 'throw' method");
365
- }
366
- return ContinueSentinel;
367
- }
368
- var record = tryCatch(method, delegate.iterator, context.arg);
369
- if (record.type === "throw") {
370
- context.method = "throw";
371
- context.arg = record.arg;
372
- context.delegate = null;
373
- return ContinueSentinel;
374
- }
375
- var info = record.arg;
376
- if (!info) {
377
- context.method = "throw";
378
- context.arg = new TypeError("iterator result is not an object");
379
- context.delegate = null;
380
- return ContinueSentinel;
381
- }
382
- if (info.done) {
383
- // Assign the result of the finished delegate to the temporary
384
- // variable specified by delegate.resultName (see delegateYield).
385
- context[delegate.resultName] = info.value;
386
-
387
- // Resume execution at the desired location (see delegateYield).
388
- context.next = delegate.nextLoc;
389
-
390
- // If context.method was "throw" but the delegate handled the
391
- // exception, let the outer generator proceed normally. If
392
- // context.method was "next", forget context.arg since it has been
393
- // "consumed" by the delegate iterator. If context.method was
394
- // "return", allow the original .return call to continue in the
395
- // outer generator.
396
- if (context.method !== "return") {
397
- context.method = "next";
398
- context.arg = undefined$1;
399
- }
400
- } else {
401
- // Re-yield the result returned by the delegate method.
402
- return info;
403
- }
404
-
405
- // The delegate iterator is finished, so forget it and continue with
406
- // the outer generator.
407
- context.delegate = null;
408
- return ContinueSentinel;
409
- }
410
-
411
- // Define Generator.prototype.{next,throw,return} in terms of the
412
- // unified ._invoke helper method.
413
- defineIteratorMethods(Gp);
414
- define(Gp, toStringTagSymbol, "Generator");
415
-
416
- // A Generator should always return itself as the iterator object when the
417
- // @@iterator function is called on it. Some browsers' implementations of the
418
- // iterator prototype chain incorrectly implement this, causing the Generator
419
- // object to not be returned from this call. This ensures that doesn't happen.
420
- // See https://github.com/facebook/regenerator/issues/274 for more details.
421
- define(Gp, iteratorSymbol, function () {
422
- return this;
423
- });
424
- define(Gp, "toString", function () {
425
- return "[object Generator]";
426
- });
427
- function pushTryEntry(locs) {
428
- var entry = {
429
- tryLoc: locs[0]
430
- };
431
- if (1 in locs) {
432
- entry.catchLoc = locs[1];
433
- }
434
- if (2 in locs) {
435
- entry.finallyLoc = locs[2];
436
- entry.afterLoc = locs[3];
437
- }
438
- this.tryEntries.push(entry);
439
- }
440
- function resetTryEntry(entry) {
441
- var record = entry.completion || {};
442
- record.type = "normal";
443
- delete record.arg;
444
- entry.completion = record;
445
- }
446
- function Context(tryLocsList) {
447
- // The root entry object (effectively a try statement without a catch
448
- // or a finally block) gives us a place to store values thrown from
449
- // locations where there is no enclosing try statement.
450
- this.tryEntries = [{
451
- tryLoc: "root"
452
- }];
453
- tryLocsList.forEach(pushTryEntry, this);
454
- this.reset(true);
455
- }
456
- exports.keys = function (object) {
457
- var keys = [];
458
- for (var key in object) {
459
- keys.push(key);
460
- }
461
- keys.reverse();
462
-
463
- // Rather than returning an object with a next method, we keep
464
- // things simple and return the next function itself.
465
- return function next() {
466
- while (keys.length) {
467
- var key = keys.pop();
468
- if (key in object) {
469
- next.value = key;
470
- next.done = false;
471
- return next;
472
- }
473
- }
474
-
475
- // To avoid creating an additional object, we just hang the .value
476
- // and .done properties off the next function object itself. This
477
- // also ensures that the minifier will not anonymize the function.
478
- next.done = true;
479
- return next;
480
- };
481
- };
482
- function values(iterable) {
483
- if (iterable) {
484
- var iteratorMethod = iterable[iteratorSymbol];
485
- if (iteratorMethod) {
486
- return iteratorMethod.call(iterable);
487
- }
488
- if (typeof iterable.next === "function") {
489
- return iterable;
490
- }
491
- if (!isNaN(iterable.length)) {
492
- var i = -1,
493
- next = function next() {
494
- while (++i < iterable.length) {
495
- if (hasOwn.call(iterable, i)) {
496
- next.value = iterable[i];
497
- next.done = false;
498
- return next;
499
- }
500
- }
501
- next.value = undefined$1;
502
- next.done = true;
503
- return next;
504
- };
505
- return next.next = next;
506
- }
507
- }
508
-
509
- // Return an iterator with no values.
510
- return {
511
- next: doneResult
512
- };
513
- }
514
- exports.values = values;
515
- function doneResult() {
516
- return {
517
- value: undefined$1,
518
- done: true
519
- };
520
- }
521
- Context.prototype = {
522
- constructor: Context,
523
- reset: function reset(skipTempReset) {
524
- this.prev = 0;
525
- this.next = 0;
526
- // Resetting context._sent for legacy support of Babel's
527
- // function.sent implementation.
528
- this.sent = this._sent = undefined$1;
529
- this.done = false;
530
- this.delegate = null;
531
- this.method = "next";
532
- this.arg = undefined$1;
533
- this.tryEntries.forEach(resetTryEntry);
534
- if (!skipTempReset) {
535
- for (var name in this) {
536
- // Not sure about the optimal order of these conditions:
537
- if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
538
- this[name] = undefined$1;
539
- }
540
- }
541
- }
542
- },
543
- stop: function stop() {
544
- this.done = true;
545
- var rootEntry = this.tryEntries[0];
546
- var rootRecord = rootEntry.completion;
547
- if (rootRecord.type === "throw") {
548
- throw rootRecord.arg;
549
- }
550
- return this.rval;
551
- },
552
- dispatchException: function dispatchException(exception) {
553
- if (this.done) {
554
- throw exception;
555
- }
556
- var context = this;
557
- function handle(loc, caught) {
558
- record.type = "throw";
559
- record.arg = exception;
560
- context.next = loc;
561
- if (caught) {
562
- // If the dispatched exception was caught by a catch block,
563
- // then let that catch block handle the exception normally.
564
- context.method = "next";
565
- context.arg = undefined$1;
566
- }
567
- return !!caught;
568
- }
569
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
570
- var entry = this.tryEntries[i];
571
- var record = entry.completion;
572
- if (entry.tryLoc === "root") {
573
- // Exception thrown outside of any try block that could handle
574
- // it, so set the completion value of the entire function to
575
- // throw the exception.
576
- return handle("end");
577
- }
578
- if (entry.tryLoc <= this.prev) {
579
- var hasCatch = hasOwn.call(entry, "catchLoc");
580
- var hasFinally = hasOwn.call(entry, "finallyLoc");
581
- if (hasCatch && hasFinally) {
582
- if (this.prev < entry.catchLoc) {
583
- return handle(entry.catchLoc, true);
584
- } else if (this.prev < entry.finallyLoc) {
585
- return handle(entry.finallyLoc);
586
- }
587
- } else if (hasCatch) {
588
- if (this.prev < entry.catchLoc) {
589
- return handle(entry.catchLoc, true);
590
- }
591
- } else if (hasFinally) {
592
- if (this.prev < entry.finallyLoc) {
593
- return handle(entry.finallyLoc);
594
- }
595
- } else {
596
- throw new Error("try statement without catch or finally");
597
- }
598
- }
599
- }
600
- },
601
- abrupt: function abrupt(type, arg) {
602
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
603
- var entry = this.tryEntries[i];
604
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
605
- var finallyEntry = entry;
606
- break;
607
- }
608
- }
609
- if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
610
- // Ignore the finally entry if control is not jumping to a
611
- // location outside the try/catch block.
612
- finallyEntry = null;
613
- }
614
- var record = finallyEntry ? finallyEntry.completion : {};
615
- record.type = type;
616
- record.arg = arg;
617
- if (finallyEntry) {
618
- this.method = "next";
619
- this.next = finallyEntry.finallyLoc;
620
- return ContinueSentinel;
621
- }
622
- return this.complete(record);
623
- },
624
- complete: function complete(record, afterLoc) {
625
- if (record.type === "throw") {
626
- throw record.arg;
627
- }
628
- if (record.type === "break" || record.type === "continue") {
629
- this.next = record.arg;
630
- } else if (record.type === "return") {
631
- this.rval = this.arg = record.arg;
632
- this.method = "return";
633
- this.next = "end";
634
- } else if (record.type === "normal" && afterLoc) {
635
- this.next = afterLoc;
636
- }
637
- return ContinueSentinel;
638
- },
639
- finish: function finish(finallyLoc) {
640
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
641
- var entry = this.tryEntries[i];
642
- if (entry.finallyLoc === finallyLoc) {
643
- this.complete(entry.completion, entry.afterLoc);
644
- resetTryEntry(entry);
645
- return ContinueSentinel;
646
- }
647
- }
648
- },
649
- "catch": function _catch(tryLoc) {
650
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
651
- var entry = this.tryEntries[i];
652
- if (entry.tryLoc === tryLoc) {
653
- var record = entry.completion;
654
- if (record.type === "throw") {
655
- var thrown = record.arg;
656
- resetTryEntry(entry);
657
- }
658
- return thrown;
659
- }
660
- }
661
-
662
- // The context.catch method must only be called with a location
663
- // argument that corresponds to a known catch block.
664
- throw new Error("illegal catch attempt");
665
- },
666
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
667
- this.delegate = {
668
- iterator: values(iterable),
669
- resultName: resultName,
670
- nextLoc: nextLoc
671
- };
672
- if (this.method === "next") {
673
- // Deliberately forget the last sent value so that we don't
674
- // accidentally pass it on to the delegate.
675
- this.arg = undefined$1;
676
- }
677
- return ContinueSentinel;
678
- }
679
- };
680
-
681
- // Regardless of whether this script is executing as a CommonJS module
682
- // or not, return the runtime object so that we can declare the variable
683
- // regeneratorRuntime in the outer scope, which allows this module to be
684
- // injected easily by `bin/regenerator --include-runtime script.js`.
685
- return exports;
686
- }(
687
- // If this script is executing as a CommonJS module, use module.exports
688
- // as the regeneratorRuntime namespace. Otherwise create a new empty
689
- // object. Either way, the resulting object will be used to initialize
690
- // the regeneratorRuntime variable at the top of this file.
691
- module.exports );
692
- try {
693
- regeneratorRuntime = runtime;
694
- } catch (accidentalStrictMode) {
695
- // This module should not be running in strict mode, so the above
696
- // assignment should always work unless something is misconfigured. Just
697
- // in case runtime.js accidentally runs in strict mode, in modern engines
698
- // we can explicitly access globalThis. In older engines we can escape
699
- // strict mode using a global Function call. This could conceivably fail
700
- // if a Content Security Policy forbids using Function, but in that case
701
- // the proper solution is to fix the accidental strict mode problem. If
702
- // you've misconfigured your bundler to force strict mode and applied a
703
- // CSP to forbid Function, and you're not willing to fix either of those
704
- // problems, please detail your unique predicament in a GitHub issue.
705
- if (typeof globalThis === "object") {
706
- globalThis.regeneratorRuntime = runtime;
707
- } else {
708
- Function("r", "regeneratorRuntime = r")(runtime);
709
- }
710
- }
711
- });
712
-
713
356
  var queryParameters = [{
714
357
  value: '$eq',
715
358
  label: 'Equal'
@@ -901,41 +544,39 @@ function StrapiCollection(_ref2) {
901
544
  filterValue: filterValue,
902
545
  filterParameter: filterParameter
903
546
  });
904
- var data = usePlasmicQueryData(cacheKey, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
547
+ var data = usePlasmicQueryData(cacheKey, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
905
548
  var _filterField, _filters;
906
549
  var requestInit, queryParams, resp;
907
- return runtime_1.wrap(function _callee$(_context) {
908
- while (1) {
909
- switch (_context.prev = _context.next) {
910
- case 0:
911
- if (query) {
912
- _context.next = 2;
913
- break;
914
- }
915
- return _context.abrupt("return", null);
916
- case 2:
917
- requestInit = {
918
- method: "GET"
550
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
551
+ while (1) switch (_context.prev = _context.next) {
552
+ case 0:
553
+ if (query) {
554
+ _context.next = 2;
555
+ break;
556
+ }
557
+ return _context.abrupt("return", null);
558
+ case 2:
559
+ requestInit = {
560
+ method: "GET"
561
+ };
562
+ if (creds.token) {
563
+ requestInit.headers = {
564
+ Authorization: "Bearer " + creds.token
919
565
  };
920
- if (creds.token) {
921
- requestInit.headers = {
922
- Authorization: "Bearer " + creds.token
923
- };
924
- }
925
- queryParams = stringify(_extends({}, filterField && filterParameter && filterValue ? {
926
- filters: (_filters = {}, _filters[filterField] = (_filterField = {}, _filterField[filterParameter] = filterValue, _filterField), _filters)
927
- } : {}, {
928
- populate: "*"
929
- }));
930
- _context.next = 7;
931
- return fetch(query + "?" + queryParams, requestInit);
932
- case 7:
933
- resp = _context.sent;
934
- return _context.abrupt("return", resp.json());
935
- case 9:
936
- case "end":
937
- return _context.stop();
938
- }
566
+ }
567
+ queryParams = stringify(_extends({}, filterField && filterParameter && filterValue ? {
568
+ filters: (_filters = {}, _filters[filterField] = (_filterField = {}, _filterField[filterParameter] = filterValue, _filterField), _filters)
569
+ } : {}, {
570
+ populate: "*"
571
+ }));
572
+ _context.next = 7;
573
+ return fetch(query + "?" + queryParams, requestInit);
574
+ case 7:
575
+ resp = _context.sent;
576
+ return _context.abrupt("return", resp.json());
577
+ case 9:
578
+ case "end":
579
+ return _context.stop();
939
580
  }
940
581
  }, _callee);
941
582
  })));
@@ -949,14 +590,14 @@ function StrapiCollection(_ref2) {
949
590
  var filterFieds = collectionData.flatMap(function (item) {
950
591
  var attributes = get(item, ["attributes"]);
951
592
  var displayableFields = Object.keys(attributes).filter(function (field) {
952
- var _value$data, _value$data$attribute;
593
+ var _value$data;
953
594
  var value = attributes[field];
954
- var maybeMime = value == null ? void 0 : (_value$data = value.data) == null ? void 0 : (_value$data$attribute = _value$data.attributes) == null ? void 0 : _value$data$attribute.mime;
595
+ var maybeMime = value == null || (_value$data = value.data) == null || (_value$data = _value$data.attributes) == null ? void 0 : _value$data.mime;
955
596
  return typeof value !== "object" || typeof maybeMime === "string" && maybeMime.startsWith("image");
956
597
  });
957
598
  return displayableFields;
958
599
  });
959
- setControlContextData == null ? void 0 : setControlContextData({
600
+ setControlContextData == null || setControlContextData({
960
601
  strapiFields: uniq(filterFieds != null ? filterFieds : [])
961
602
  });
962
603
  if (filterParameter && !filterValue && !filterField) {
@@ -1017,7 +658,7 @@ var strapiFieldMeta = {
1017
658
  }
1018
659
  };
1019
660
  function StrapiField(_ref4) {
1020
- var _data$data, _data$data$attributes;
661
+ var _data$data;
1021
662
  var className = _ref4.className,
1022
663
  path = _ref4.path,
1023
664
  setControlContextData = _ref4.setControlContextData;
@@ -1028,12 +669,12 @@ function StrapiField(_ref4) {
1028
669
  // Getting only fields that aren't objects
1029
670
  var attributes = get(item, ["attributes"]);
1030
671
  var displayableFields = Object.keys(attributes).filter(function (field) {
1031
- var _value$data2, _value$data2$attribut;
672
+ var _value$data2;
1032
673
  var value = attributes[field];
1033
- var maybeMime = (_value$data2 = value.data) == null ? void 0 : (_value$data2$attribut = _value$data2.attributes) == null ? void 0 : _value$data2$attribut.mime;
674
+ var maybeMime = (_value$data2 = value.data) == null || (_value$data2 = _value$data2.attributes) == null ? void 0 : _value$data2.mime;
1034
675
  return typeof value !== "object" || typeof maybeMime === "string" && maybeMime.startsWith("image");
1035
676
  });
1036
- setControlContextData == null ? void 0 : setControlContextData({
677
+ setControlContextData == null || setControlContextData({
1037
678
  fields: displayableFields,
1038
679
  isImage: false
1039
680
  });
@@ -1041,8 +682,8 @@ function StrapiField(_ref4) {
1041
682
  return React.createElement("div", null, "StrapiField must specify a field name.");
1042
683
  }
1043
684
  var data = get(item, ["attributes", path]);
1044
- var maybeMime = data == null ? void 0 : (_data$data = data.data) == null ? void 0 : (_data$data$attributes = _data$data.attributes) == null ? void 0 : _data$data$attributes.mime;
1045
- setControlContextData == null ? void 0 : setControlContextData({
685
+ var maybeMime = data == null || (_data$data = data.data) == null || (_data$data = _data$data.attributes) == null ? void 0 : _data$data.mime;
686
+ setControlContextData == null || setControlContextData({
1046
687
  fields: displayableFields,
1047
688
  isImage: typeof maybeMime === "string" && maybeMime.startsWith("image")
1048
689
  });