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