@plasmicpkgs/plasmic-graphcms 0.0.132 → 0.0.134

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