@plasmicpkgs/plasmic-graphcms 0.0.62 → 0.0.63

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.
@@ -13,29 +13,24 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
13
13
  reject(error);
14
14
  return;
15
15
  }
16
-
17
16
  if (info.done) {
18
17
  resolve(value);
19
18
  } else {
20
19
  Promise.resolve(value).then(_next, _throw);
21
20
  }
22
21
  }
23
-
24
22
  function _asyncToGenerator(fn) {
25
23
  return function () {
26
24
  var self = this,
27
- args = arguments;
25
+ args = arguments;
28
26
  return new Promise(function (resolve, reject) {
29
27
  var gen = fn.apply(self, args);
30
-
31
28
  function _next(value) {
32
29
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
33
30
  }
34
-
35
31
  function _throw(err) {
36
32
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
37
33
  }
38
-
39
34
  _next(undefined);
40
35
  });
41
36
  };
@@ -52,17 +47,16 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
52
47
  * This source code is licensed under the MIT license found in the
53
48
  * LICENSE file in the root directory of this source tree.
54
49
  */
50
+
55
51
  var runtime = function (exports) {
56
52
 
57
53
  var Op = Object.prototype;
58
54
  var hasOwn = Op.hasOwnProperty;
59
55
  var undefined$1; // More compressible than void 0.
60
-
61
56
  var $Symbol = typeof Symbol === "function" ? Symbol : {};
62
57
  var iteratorSymbol = $Symbol.iterator || "@@iterator";
63
58
  var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
64
59
  var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
65
-
66
60
  function define(obj, key, value) {
67
61
  Object.defineProperty(obj, key, {
68
62
  value: value,
@@ -72,7 +66,6 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
72
66
  });
73
67
  return obj[key];
74
68
  }
75
-
76
69
  try {
77
70
  // IE 8 has a broken Object.defineProperty that only works on DOM objects.
78
71
  define({}, "");
@@ -81,19 +74,20 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
81
74
  return obj[key] = value;
82
75
  };
83
76
  }
84
-
85
77
  function wrap(innerFn, outerFn, self, tryLocsList) {
86
78
  // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
87
79
  var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
88
80
  var generator = Object.create(protoGenerator.prototype);
89
- var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
90
- // .throw, and .return methods.
81
+ var context = new Context(tryLocsList || []);
91
82
 
83
+ // The ._invoke method unifies the implementations of the .next,
84
+ // .throw, and .return methods.
92
85
  generator._invoke = makeInvokeMethod(innerFn, self, context);
93
86
  return generator;
94
87
  }
88
+ exports.wrap = wrap;
95
89
 
96
- exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
90
+ // Try/catch helper to minimize deoptimizations. Returns a completion
97
91
  // record like context.tryEntries[i].completion. This interface could
98
92
  // have been (and was previously) designed to take a closure to be
99
93
  // invoked without arguments, but in all the cases we care about we
@@ -103,7 +97,6 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
103
97
  // in every case, so we don't have to touch the arguments object. The
104
98
  // only additional allocation required is the completion record, which
105
99
  // has a stable shape and so hopefully should be cheap to allocate.
106
-
107
100
  function tryCatch(fn, obj, arg) {
108
101
  try {
109
102
  return {
@@ -117,46 +110,44 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
117
110
  };
118
111
  }
119
112
  }
120
-
121
113
  var GenStateSuspendedStart = "suspendedStart";
122
114
  var GenStateSuspendedYield = "suspendedYield";
123
115
  var GenStateExecuting = "executing";
124
- var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
116
+ var GenStateCompleted = "completed";
117
+
118
+ // Returning this object from the innerFn has the same effect as
125
119
  // breaking out of the dispatch switch statement.
120
+ var ContinueSentinel = {};
126
121
 
127
- var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
122
+ // Dummy constructor functions that we use as the .constructor and
128
123
  // .constructor.prototype properties for functions that return Generator
129
124
  // objects. For full spec compliance, you may wish to configure your
130
125
  // minifier not to mangle the names of these two functions.
131
-
132
126
  function Generator() {}
133
-
134
127
  function GeneratorFunction() {}
128
+ function GeneratorFunctionPrototype() {}
135
129
 
136
- function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
130
+ // This is a polyfill for %IteratorPrototype% for environments that
137
131
  // don't natively support it.
138
-
139
-
140
132
  var IteratorPrototype = {};
141
133
  define(IteratorPrototype, iteratorSymbol, function () {
142
134
  return this;
143
135
  });
144
136
  var getProto = Object.getPrototypeOf;
145
137
  var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
146
-
147
138
  if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
148
139
  // This environment has a native %IteratorPrototype%; use it instead
149
140
  // of the polyfill.
150
141
  IteratorPrototype = NativeIteratorPrototype;
151
142
  }
152
-
153
143
  var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
154
144
  GeneratorFunction.prototype = GeneratorFunctionPrototype;
155
145
  define(Gp, "constructor", GeneratorFunctionPrototype);
156
146
  define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
157
- GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
158
- // Iterator interface in terms of a single ._invoke method.
147
+ GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
159
148
 
149
+ // Helper for defining the .next, .throw, and .return methods of the
150
+ // Iterator interface in terms of a single ._invoke method.
160
151
  function defineIteratorMethods(prototype) {
161
152
  ["next", "throw", "return"].forEach(function (method) {
162
153
  define(prototype, method, function (arg) {
@@ -164,14 +155,13 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
164
155
  });
165
156
  });
166
157
  }
167
-
168
158
  exports.isGeneratorFunction = function (genFun) {
169
159
  var ctor = typeof genFun === "function" && genFun.constructor;
170
- return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
160
+ return ctor ? ctor === GeneratorFunction ||
161
+ // For the native GeneratorFunction constructor, the best we can
171
162
  // do is to check its .name property.
172
163
  (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
173
164
  };
174
-
175
165
  exports.mark = function (genFun) {
176
166
  if (Object.setPrototypeOf) {
177
167
  Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
@@ -179,31 +169,27 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
179
169
  genFun.__proto__ = GeneratorFunctionPrototype;
180
170
  define(genFun, toStringTagSymbol, "GeneratorFunction");
181
171
  }
182
-
183
172
  genFun.prototype = Object.create(Gp);
184
173
  return genFun;
185
- }; // Within the body of any async function, `await x` is transformed to
174
+ };
175
+
176
+ // Within the body of any async function, `await x` is transformed to
186
177
  // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
187
178
  // `hasOwn.call(value, "__await")` to determine if the yielded value is
188
179
  // meant to be awaited.
189
-
190
-
191
180
  exports.awrap = function (arg) {
192
181
  return {
193
182
  __await: arg
194
183
  };
195
184
  };
196
-
197
185
  function AsyncIterator(generator, PromiseImpl) {
198
186
  function invoke(method, arg, resolve, reject) {
199
187
  var record = tryCatch(generator[method], generator, arg);
200
-
201
188
  if (record.type === "throw") {
202
189
  reject(record.arg);
203
190
  } else {
204
191
  var result = record.arg;
205
192
  var value = result.value;
206
-
207
193
  if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
208
194
  return PromiseImpl.resolve(value.__await).then(function (value) {
209
195
  invoke("next", value, resolve, reject);
@@ -211,7 +197,6 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
211
197
  invoke("throw", err, resolve, reject);
212
198
  });
213
199
  }
214
-
215
200
  return PromiseImpl.resolve(value).then(function (unwrapped) {
216
201
  // When a yielded Promise is resolved, its final value becomes
217
202
  // the .value of the Promise<{value,done}> result for the
@@ -225,17 +210,15 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
225
210
  });
226
211
  }
227
212
  }
228
-
229
213
  var previousPromise;
230
-
231
214
  function enqueue(method, arg) {
232
215
  function callInvokeWithMethodAndArg() {
233
216
  return new PromiseImpl(function (resolve, reject) {
234
217
  invoke(method, arg, resolve, reject);
235
218
  });
236
219
  }
237
-
238
- return previousPromise = // If enqueue has been called before, then we want to wait until
220
+ return previousPromise =
221
+ // If enqueue has been called before, then we want to wait until
239
222
  // all previous Promises have been resolved before calling invoke,
240
223
  // so that results are always delivered in the correct order. If
241
224
  // enqueue has not been called before, then it is important to
@@ -247,24 +230,25 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
247
230
  // execute code before the first await. Since we implement simple
248
231
  // async functions in terms of async generators, it is especially
249
232
  // important to get this right, even though it requires care.
250
- previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
233
+ previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
234
+ // Avoid propagating failures to Promises returned by later
251
235
  // invocations of the iterator.
252
236
  callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
253
- } // Define the unified helper method that is used to implement .next,
254
- // .throw, and .return (see defineIteratorMethods).
255
-
237
+ }
256
238
 
239
+ // Define the unified helper method that is used to implement .next,
240
+ // .throw, and .return (see defineIteratorMethods).
257
241
  this._invoke = enqueue;
258
242
  }
259
-
260
243
  defineIteratorMethods(AsyncIterator.prototype);
261
244
  define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
262
245
  return this;
263
246
  });
264
- exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
247
+ exports.AsyncIterator = AsyncIterator;
248
+
249
+ // Note that simple async functions are implemented on top of
265
250
  // AsyncIterator objects; they just return a Promise for the value of
266
251
  // the final result produced by the iterator.
267
-
268
252
  exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
269
253
  if (PromiseImpl === void 0) PromiseImpl = Promise;
270
254
  var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
@@ -273,39 +257,32 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
273
257
  return result.done ? result.value : iter.next();
274
258
  });
275
259
  };
276
-
277
260
  function makeInvokeMethod(innerFn, self, context) {
278
261
  var state = GenStateSuspendedStart;
279
262
  return function invoke(method, arg) {
280
263
  if (state === GenStateExecuting) {
281
264
  throw new Error("Generator is already running");
282
265
  }
283
-
284
266
  if (state === GenStateCompleted) {
285
267
  if (method === "throw") {
286
268
  throw arg;
287
- } // Be forgiving, per 25.3.3.3.3 of the spec:
288
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
289
-
269
+ }
290
270
 
271
+ // Be forgiving, per 25.3.3.3.3 of the spec:
272
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
291
273
  return doneResult();
292
274
  }
293
-
294
275
  context.method = method;
295
276
  context.arg = arg;
296
-
297
277
  while (true) {
298
278
  var delegate = context.delegate;
299
-
300
279
  if (delegate) {
301
280
  var delegateResult = maybeInvokeDelegate(delegate, context);
302
-
303
281
  if (delegateResult) {
304
282
  if (delegateResult === ContinueSentinel) continue;
305
283
  return delegateResult;
306
284
  }
307
285
  }
308
-
309
286
  if (context.method === "next") {
310
287
  // Setting context._sent for legacy support of Babel's
311
288
  // function.sent implementation.
@@ -315,51 +292,44 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
315
292
  state = GenStateCompleted;
316
293
  throw context.arg;
317
294
  }
318
-
319
295
  context.dispatchException(context.arg);
320
296
  } else if (context.method === "return") {
321
297
  context.abrupt("return", context.arg);
322
298
  }
323
-
324
299
  state = GenStateExecuting;
325
300
  var record = tryCatch(innerFn, self, context);
326
-
327
301
  if (record.type === "normal") {
328
302
  // If an exception is thrown from innerFn, we leave state ===
329
303
  // GenStateExecuting and loop back for another invocation.
330
304
  state = context.done ? GenStateCompleted : GenStateSuspendedYield;
331
-
332
305
  if (record.arg === ContinueSentinel) {
333
306
  continue;
334
307
  }
335
-
336
308
  return {
337
309
  value: record.arg,
338
310
  done: context.done
339
311
  };
340
312
  } else if (record.type === "throw") {
341
- state = GenStateCompleted; // Dispatch the exception by looping back around to the
313
+ state = GenStateCompleted;
314
+ // Dispatch the exception by looping back around to the
342
315
  // context.dispatchException(context.arg) call above.
343
-
344
316
  context.method = "throw";
345
317
  context.arg = record.arg;
346
318
  }
347
319
  }
348
320
  };
349
- } // Call delegate.iterator[context.method](context.arg) and handle the
321
+ }
322
+
323
+ // Call delegate.iterator[context.method](context.arg) and handle the
350
324
  // result, either by returning a { value, done } result from the
351
325
  // delegate iterator, or by modifying context.method and context.arg,
352
326
  // setting context.delegate to null, and returning the ContinueSentinel.
353
-
354
-
355
327
  function maybeInvokeDelegate(delegate, context) {
356
328
  var method = delegate.iterator[context.method];
357
-
358
329
  if (method === undefined$1) {
359
330
  // A .throw or .return when the delegate iterator has no .throw
360
331
  // method always terminates the yield* loop.
361
332
  context.delegate = null;
362
-
363
333
  if (context.method === "throw") {
364
334
  // Note: ["return"] must be used for ES3 parsing compatibility.
365
335
  if (delegate.iterator["return"]) {
@@ -368,51 +338,45 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
368
338
  context.method = "return";
369
339
  context.arg = undefined$1;
370
340
  maybeInvokeDelegate(delegate, context);
371
-
372
341
  if (context.method === "throw") {
373
342
  // If maybeInvokeDelegate(context) changed context.method from
374
343
  // "return" to "throw", let that override the TypeError below.
375
344
  return ContinueSentinel;
376
345
  }
377
346
  }
378
-
379
347
  context.method = "throw";
380
348
  context.arg = new TypeError("The iterator does not provide a 'throw' method");
381
349
  }
382
-
383
350
  return ContinueSentinel;
384
351
  }
385
-
386
352
  var record = tryCatch(method, delegate.iterator, context.arg);
387
-
388
353
  if (record.type === "throw") {
389
354
  context.method = "throw";
390
355
  context.arg = record.arg;
391
356
  context.delegate = null;
392
357
  return ContinueSentinel;
393
358
  }
394
-
395
359
  var info = record.arg;
396
-
397
360
  if (!info) {
398
361
  context.method = "throw";
399
362
  context.arg = new TypeError("iterator result is not an object");
400
363
  context.delegate = null;
401
364
  return ContinueSentinel;
402
365
  }
403
-
404
366
  if (info.done) {
405
367
  // Assign the result of the finished delegate to the temporary
406
368
  // variable specified by delegate.resultName (see delegateYield).
407
- context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
369
+ context[delegate.resultName] = info.value;
408
370
 
409
- context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
371
+ // Resume execution at the desired location (see delegateYield).
372
+ context.next = delegate.nextLoc;
373
+
374
+ // If context.method was "throw" but the delegate handled the
410
375
  // exception, let the outer generator proceed normally. If
411
376
  // context.method was "next", forget context.arg since it has been
412
377
  // "consumed" by the delegate iterator. If context.method was
413
378
  // "return", allow the original .return call to continue in the
414
379
  // outer generator.
415
-
416
380
  if (context.method !== "return") {
417
381
  context.method = "next";
418
382
  context.arg = undefined$1;
@@ -420,54 +384,49 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
420
384
  } else {
421
385
  // Re-yield the result returned by the delegate method.
422
386
  return info;
423
- } // The delegate iterator is finished, so forget it and continue with
424
- // the outer generator.
425
-
387
+ }
426
388
 
389
+ // The delegate iterator is finished, so forget it and continue with
390
+ // the outer generator.
427
391
  context.delegate = null;
428
392
  return ContinueSentinel;
429
- } // Define Generator.prototype.{next,throw,return} in terms of the
430
- // unified ._invoke helper method.
431
-
393
+ }
432
394
 
395
+ // Define Generator.prototype.{next,throw,return} in terms of the
396
+ // unified ._invoke helper method.
433
397
  defineIteratorMethods(Gp);
434
- define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the
398
+ define(Gp, toStringTagSymbol, "Generator");
399
+
400
+ // A Generator should always return itself as the iterator object when the
435
401
  // @@iterator function is called on it. Some browsers' implementations of the
436
402
  // iterator prototype chain incorrectly implement this, causing the Generator
437
403
  // object to not be returned from this call. This ensures that doesn't happen.
438
404
  // See https://github.com/facebook/regenerator/issues/274 for more details.
439
-
440
405
  define(Gp, iteratorSymbol, function () {
441
406
  return this;
442
407
  });
443
408
  define(Gp, "toString", function () {
444
409
  return "[object Generator]";
445
410
  });
446
-
447
411
  function pushTryEntry(locs) {
448
412
  var entry = {
449
413
  tryLoc: locs[0]
450
414
  };
451
-
452
415
  if (1 in locs) {
453
416
  entry.catchLoc = locs[1];
454
417
  }
455
-
456
418
  if (2 in locs) {
457
419
  entry.finallyLoc = locs[2];
458
420
  entry.afterLoc = locs[3];
459
421
  }
460
-
461
422
  this.tryEntries.push(entry);
462
423
  }
463
-
464
424
  function resetTryEntry(entry) {
465
425
  var record = entry.completion || {};
466
426
  record.type = "normal";
467
427
  delete record.arg;
468
428
  entry.completion = record;
469
429
  }
470
-
471
430
  function Context(tryLocsList) {
472
431
  // The root entry object (effectively a try statement without a catch
473
432
  // or a finally block) gives us a place to store values thrown from
@@ -478,97 +437,84 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
478
437
  tryLocsList.forEach(pushTryEntry, this);
479
438
  this.reset(true);
480
439
  }
481
-
482
440
  exports.keys = function (object) {
483
441
  var keys = [];
484
-
485
442
  for (var key in object) {
486
443
  keys.push(key);
487
444
  }
445
+ keys.reverse();
488
446
 
489
- keys.reverse(); // Rather than returning an object with a next method, we keep
447
+ // Rather than returning an object with a next method, we keep
490
448
  // things simple and return the next function itself.
491
-
492
449
  return function next() {
493
450
  while (keys.length) {
494
451
  var key = keys.pop();
495
-
496
452
  if (key in object) {
497
453
  next.value = key;
498
454
  next.done = false;
499
455
  return next;
500
456
  }
501
- } // To avoid creating an additional object, we just hang the .value
457
+ }
458
+
459
+ // To avoid creating an additional object, we just hang the .value
502
460
  // and .done properties off the next function object itself. This
503
461
  // also ensures that the minifier will not anonymize the function.
504
-
505
-
506
462
  next.done = true;
507
463
  return next;
508
464
  };
509
465
  };
510
-
511
466
  function values(iterable) {
512
467
  if (iterable) {
513
468
  var iteratorMethod = iterable[iteratorSymbol];
514
-
515
469
  if (iteratorMethod) {
516
470
  return iteratorMethod.call(iterable);
517
471
  }
518
-
519
472
  if (typeof iterable.next === "function") {
520
473
  return iterable;
521
474
  }
522
-
523
475
  if (!isNaN(iterable.length)) {
524
476
  var i = -1,
525
- next = function next() {
526
- while (++i < iterable.length) {
527
- if (hasOwn.call(iterable, i)) {
528
- next.value = iterable[i];
529
- next.done = false;
530
- return next;
477
+ next = function next() {
478
+ while (++i < iterable.length) {
479
+ if (hasOwn.call(iterable, i)) {
480
+ next.value = iterable[i];
481
+ next.done = false;
482
+ return next;
483
+ }
531
484
  }
532
- }
533
-
534
- next.value = undefined$1;
535
- next.done = true;
536
- return next;
537
- };
538
-
485
+ next.value = undefined$1;
486
+ next.done = true;
487
+ return next;
488
+ };
539
489
  return next.next = next;
540
490
  }
541
- } // Return an iterator with no values.
542
-
491
+ }
543
492
 
493
+ // Return an iterator with no values.
544
494
  return {
545
495
  next: doneResult
546
496
  };
547
497
  }
548
-
549
498
  exports.values = values;
550
-
551
499
  function doneResult() {
552
500
  return {
553
501
  value: undefined$1,
554
502
  done: true
555
503
  };
556
504
  }
557
-
558
505
  Context.prototype = {
559
506
  constructor: Context,
560
507
  reset: function reset(skipTempReset) {
561
508
  this.prev = 0;
562
- this.next = 0; // Resetting context._sent for legacy support of Babel's
509
+ this.next = 0;
510
+ // Resetting context._sent for legacy support of Babel's
563
511
  // function.sent implementation.
564
-
565
512
  this.sent = this._sent = undefined$1;
566
513
  this.done = false;
567
514
  this.delegate = null;
568
515
  this.method = "next";
569
516
  this.arg = undefined$1;
570
517
  this.tryEntries.forEach(resetTryEntry);
571
-
572
518
  if (!skipTempReset) {
573
519
  for (var name in this) {
574
520
  // Not sure about the optimal order of these conditions:
@@ -582,50 +528,40 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
582
528
  this.done = true;
583
529
  var rootEntry = this.tryEntries[0];
584
530
  var rootRecord = rootEntry.completion;
585
-
586
531
  if (rootRecord.type === "throw") {
587
532
  throw rootRecord.arg;
588
533
  }
589
-
590
534
  return this.rval;
591
535
  },
592
536
  dispatchException: function dispatchException(exception) {
593
537
  if (this.done) {
594
538
  throw exception;
595
539
  }
596
-
597
540
  var context = this;
598
-
599
541
  function handle(loc, caught) {
600
542
  record.type = "throw";
601
543
  record.arg = exception;
602
544
  context.next = loc;
603
-
604
545
  if (caught) {
605
546
  // If the dispatched exception was caught by a catch block,
606
547
  // then let that catch block handle the exception normally.
607
548
  context.method = "next";
608
549
  context.arg = undefined$1;
609
550
  }
610
-
611
551
  return !!caught;
612
552
  }
613
-
614
553
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
615
554
  var entry = this.tryEntries[i];
616
555
  var record = entry.completion;
617
-
618
556
  if (entry.tryLoc === "root") {
619
557
  // Exception thrown outside of any try block that could handle
620
558
  // it, so set the completion value of the entire function to
621
559
  // throw the exception.
622
560
  return handle("end");
623
561
  }
624
-
625
562
  if (entry.tryLoc <= this.prev) {
626
563
  var hasCatch = hasOwn.call(entry, "catchLoc");
627
564
  var hasFinally = hasOwn.call(entry, "finallyLoc");
628
-
629
565
  if (hasCatch && hasFinally) {
630
566
  if (this.prev < entry.catchLoc) {
631
567
  return handle(entry.catchLoc, true);
@@ -649,36 +585,30 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
649
585
  abrupt: function abrupt(type, arg) {
650
586
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
651
587
  var entry = this.tryEntries[i];
652
-
653
588
  if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
654
589
  var finallyEntry = entry;
655
590
  break;
656
591
  }
657
592
  }
658
-
659
593
  if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
660
594
  // Ignore the finally entry if control is not jumping to a
661
595
  // location outside the try/catch block.
662
596
  finallyEntry = null;
663
597
  }
664
-
665
598
  var record = finallyEntry ? finallyEntry.completion : {};
666
599
  record.type = type;
667
600
  record.arg = arg;
668
-
669
601
  if (finallyEntry) {
670
602
  this.method = "next";
671
603
  this.next = finallyEntry.finallyLoc;
672
604
  return ContinueSentinel;
673
605
  }
674
-
675
606
  return this.complete(record);
676
607
  },
677
608
  complete: function complete(record, afterLoc) {
678
609
  if (record.type === "throw") {
679
610
  throw record.arg;
680
611
  }
681
-
682
612
  if (record.type === "break" || record.type === "continue") {
683
613
  this.next = record.arg;
684
614
  } else if (record.type === "return") {
@@ -688,13 +618,11 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
688
618
  } else if (record.type === "normal" && afterLoc) {
689
619
  this.next = afterLoc;
690
620
  }
691
-
692
621
  return ContinueSentinel;
693
622
  },
694
623
  finish: function finish(finallyLoc) {
695
624
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
696
625
  var entry = this.tryEntries[i];
697
-
698
626
  if (entry.finallyLoc === finallyLoc) {
699
627
  this.complete(entry.completion, entry.afterLoc);
700
628
  resetTryEntry(entry);
@@ -705,21 +633,18 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
705
633
  "catch": function _catch(tryLoc) {
706
634
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
707
635
  var entry = this.tryEntries[i];
708
-
709
636
  if (entry.tryLoc === tryLoc) {
710
637
  var record = entry.completion;
711
-
712
638
  if (record.type === "throw") {
713
639
  var thrown = record.arg;
714
640
  resetTryEntry(entry);
715
641
  }
716
-
717
642
  return thrown;
718
643
  }
719
- } // The context.catch method must only be called with a location
720
- // argument that corresponds to a known catch block.
721
-
644
+ }
722
645
 
646
+ // The context.catch method must only be called with a location
647
+ // argument that corresponds to a known catch block.
723
648
  throw new Error("illegal catch attempt");
724
649
  },
725
650
  delegateYield: function delegateYield(iterable, resultName, nextLoc) {
@@ -728,27 +653,26 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
728
653
  resultName: resultName,
729
654
  nextLoc: nextLoc
730
655
  };
731
-
732
656
  if (this.method === "next") {
733
657
  // Deliberately forget the last sent value so that we don't
734
658
  // accidentally pass it on to the delegate.
735
659
  this.arg = undefined$1;
736
660
  }
737
-
738
661
  return ContinueSentinel;
739
662
  }
740
- }; // Regardless of whether this script is executing as a CommonJS module
663
+ };
664
+
665
+ // Regardless of whether this script is executing as a CommonJS module
741
666
  // or not, return the runtime object so that we can declare the variable
742
667
  // regeneratorRuntime in the outer scope, which allows this module to be
743
668
  // injected easily by `bin/regenerator --include-runtime script.js`.
744
-
745
669
  return exports;
746
- }( // If this script is executing as a CommonJS module, use module.exports
670
+ }(
671
+ // If this script is executing as a CommonJS module, use module.exports
747
672
  // as the regeneratorRuntime namespace. Otherwise create a new empty
748
673
  // object. Either way, the resulting object will be used to initialize
749
674
  // the regeneratorRuntime variable at the top of this file.
750
675
  module.exports );
751
-
752
676
  try {
753
677
  regeneratorRuntime = runtime;
754
678
  } catch (accidentalStrictMode) {
@@ -803,8 +727,8 @@ var GraphCMSCredentialsProviderMeta = {
803
727
  };
804
728
  function GraphCMSCredentialsProvider(_ref) {
805
729
  var apiUrl = _ref.apiUrl,
806
- authToken = _ref.authToken,
807
- children = _ref.children;
730
+ authToken = _ref.authToken,
731
+ children = _ref.children;
808
732
  return React.createElement(CredentialsContext.Provider, {
809
733
  value: {
810
734
  apiUrl: apiUrl,
@@ -846,12 +770,10 @@ var GraphCMSFetcherMeta = {
846
770
  lang: "graphql",
847
771
  endpoint: function endpoint(props, ctx) {
848
772
  var _ctx$endpoint;
849
-
850
773
  return (_ctx$endpoint = ctx == null ? void 0 : ctx.endpoint) != null ? _ctx$endpoint : "";
851
774
  },
852
775
  headers: function headers(props, ctx) {
853
776
  var _ctx$headers;
854
-
855
777
  return (_ctx$headers = ctx == null ? void 0 : ctx.headers) != null ? _ctx$headers : "";
856
778
  }
857
779
  },
@@ -863,19 +785,17 @@ var GraphCMSFetcherMeta = {
863
785
  }
864
786
  }
865
787
  };
866
-
867
788
  function compact(arr) {
868
789
  return arr.filter(function (x) {
869
790
  return !!x;
870
791
  });
871
792
  }
872
-
873
793
  function GraphCMSFetcher(_ref2) {
874
794
  var query = _ref2.query,
875
- children = _ref2.children,
876
- className = _ref2.className,
877
- noLayout = _ref2.noLayout,
878
- setControlContextData = _ref2.setControlContextData;
795
+ children = _ref2.children,
796
+ className = _ref2.className,
797
+ noLayout = _ref2.noLayout,
798
+ setControlContextData = _ref2.setControlContextData;
879
799
  var creds = ensure(useContext(CredentialsContext));
880
800
  var cacheKey = JSON.stringify({
881
801
  query: query,
@@ -884,72 +804,59 @@ function GraphCMSFetcher(_ref2) {
884
804
  var headers = {
885
805
  Authorization: "Bearer " + creds.authToken
886
806
  };
887
-
888
807
  var _usePlasmicQueryData = usePlasmicQueryData(cacheKey, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
889
- var data;
890
- return runtime_1.wrap(function _callee$(_context) {
891
- while (1) {
892
- switch (_context.prev = _context.next) {
893
- case 0:
894
- if (query) {
895
- _context.next = 2;
896
- break;
897
- }
898
-
899
- return _context.abrupt("return", null);
900
-
901
- case 2:
902
- _context.next = 4;
903
- return fetch(creds.apiUrl, {
904
- method: "POST",
905
- headers: headers,
906
- body: JSON.stringify(query)
907
- });
908
-
909
- case 4:
910
- data = _context.sent;
911
- _context.next = 7;
912
- return data.json();
913
-
914
- case 7:
915
- return _context.abrupt("return", _context.sent);
916
-
917
- case 8:
918
- case "end":
919
- return _context.stop();
808
+ var data;
809
+ return runtime_1.wrap(function _callee$(_context) {
810
+ while (1) {
811
+ switch (_context.prev = _context.next) {
812
+ case 0:
813
+ if (query) {
814
+ _context.next = 2;
815
+ break;
816
+ }
817
+ return _context.abrupt("return", null);
818
+ case 2:
819
+ _context.next = 4;
820
+ return fetch(creds.apiUrl, {
821
+ method: "POST",
822
+ headers: headers,
823
+ body: JSON.stringify(query)
824
+ });
825
+ case 4:
826
+ data = _context.sent;
827
+ _context.next = 7;
828
+ return data.json();
829
+ case 7:
830
+ return _context.abrupt("return", _context.sent);
831
+ case 8:
832
+ case "end":
833
+ return _context.stop();
834
+ }
920
835
  }
921
- }
922
- }, _callee);
923
- }))),
924
- data = _usePlasmicQueryData.data,
925
- error = _usePlasmicQueryData.error,
926
- isLoading = _usePlasmicQueryData.isLoading;
927
-
836
+ }, _callee);
837
+ }))),
838
+ data = _usePlasmicQueryData.data,
839
+ error = _usePlasmicQueryData.error,
840
+ isLoading = _usePlasmicQueryData.isLoading;
928
841
  setControlContextData == null ? void 0 : setControlContextData({
929
842
  endpoint: creds.apiUrl,
930
843
  headers: headers
931
844
  });
932
-
933
845
  if (!query) {
934
846
  return React.createElement("div", null, "Please make a query in order to fetch data ");
935
847
  }
936
-
937
848
  if (!creds.apiUrl || !creds.authToken) {
938
849
  return React.createElement("div", null, "Please specify a valid API Credentials: API Url, Auth Token");
939
850
  }
940
-
941
851
  if (error) {
942
852
  return React.createElement("div", null, "Error: ", error.message);
943
853
  }
944
-
945
854
  if (isLoading) {
946
855
  return null;
947
856
  }
948
-
949
857
  if (!(data != null && data.data) || compact(Object.values(data == null ? void 0 : data.data)).length === 0) {
950
858
  return React.createElement("div", null, "Data not found");
951
859
  }
952
-
953
860
  var renderedData = Object.values(data == null ? void 0 : data.data).flatMap(function (model) {
954
861
  return Array.isArray(model) ? model : [model];
955
862
  }).map(function (item, i) {
@@ -973,7 +880,6 @@ var GraphCMSFieldMeta = {
973
880
  type: "dataSelector",
974
881
  data: function data(props, ctx) {
975
882
  var _ctx$data;
976
-
977
883
  return (_ctx$data = ctx == null ? void 0 : ctx.data) != null ? _ctx$data : {};
978
884
  },
979
885
  displayName: "Field",
@@ -983,31 +889,24 @@ var GraphCMSFieldMeta = {
983
889
  };
984
890
  function GraphCMSField(_ref4) {
985
891
  var _data$mimeType;
986
-
987
892
  var className = _ref4.className,
988
- path = _ref4.path,
989
- setControlContextData = _ref4.setControlContextData;
893
+ path = _ref4.path,
894
+ setControlContextData = _ref4.setControlContextData;
990
895
  var item = useSelector("graphCmsItem");
991
-
992
896
  if (!item) {
993
897
  return React.createElement("div", null, "GraphCMSField must be used within a GraphCMSFetcher ");
994
898
  }
995
-
996
899
  setControlContextData == null ? void 0 : setControlContextData({
997
900
  data: item
998
901
  });
999
-
1000
902
  if (!path) {
1001
903
  return React.createElement("div", null, "Please specify a valid path or select a field.");
1002
- } // We need to improve this check by making an introspection query
1003
-
1004
-
904
+ }
905
+ // We need to improve this check by making an introspection query
1005
906
  var isRichText = function isRichText(data) {
1006
907
  return "html" in data;
1007
908
  };
1008
-
1009
909
  var data = get(item, path);
1010
-
1011
910
  if (typeof data === "object" && (_data$mimeType = data.mimeType) != null && _data$mimeType.startsWith("image")) {
1012
911
  return React.createElement("img", {
1013
912
  src: data.url,
@@ -1039,15 +938,12 @@ function registerAll(loader) {
1039
938
  registerComponent(Component, defaultMeta);
1040
939
  }
1041
940
  };
1042
-
1043
941
  if (loader) {
1044
942
  loader.registerGlobalContext(GraphCMSCredentialsProvider, GraphCMSCredentialsProviderMeta);
1045
943
  } else {
1046
944
  registerGlobalContext(GraphCMSCredentialsProvider, GraphCMSCredentialsProviderMeta);
1047
945
  }
1048
-
1049
946
  _registerComponent(GraphCMSFetcher, GraphCMSFetcherMeta);
1050
-
1051
947
  _registerComponent(GraphCMSField, GraphCMSFieldMeta);
1052
948
  }
1053
949