@plasmicpkgs/plasmic-cms 0.0.212 → 0.0.214

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.
@@ -12,6 +12,307 @@ var dayjs = _interopDefault(require('dayjs'));
12
12
  var React = require('react');
13
13
  var React__default = _interopDefault(React);
14
14
 
15
+ function _regeneratorRuntime() {
16
+ _regeneratorRuntime = function () {
17
+ return e;
18
+ };
19
+ var t,
20
+ e = {},
21
+ r = Object.prototype,
22
+ n = r.hasOwnProperty,
23
+ o = Object.defineProperty || function (t, e, r) {
24
+ t[e] = r.value;
25
+ },
26
+ i = "function" == typeof Symbol ? Symbol : {},
27
+ a = i.iterator || "@@iterator",
28
+ c = i.asyncIterator || "@@asyncIterator",
29
+ u = i.toStringTag || "@@toStringTag";
30
+ function define(t, e, r) {
31
+ return Object.defineProperty(t, e, {
32
+ value: r,
33
+ enumerable: !0,
34
+ configurable: !0,
35
+ writable: !0
36
+ }), t[e];
37
+ }
38
+ try {
39
+ define({}, "");
40
+ } catch (t) {
41
+ define = function (t, e, r) {
42
+ return t[e] = r;
43
+ };
44
+ }
45
+ function wrap(t, e, r, n) {
46
+ var i = e && e.prototype instanceof Generator ? e : Generator,
47
+ a = Object.create(i.prototype),
48
+ c = new Context(n || []);
49
+ return o(a, "_invoke", {
50
+ value: makeInvokeMethod(t, r, c)
51
+ }), a;
52
+ }
53
+ function tryCatch(t, e, r) {
54
+ try {
55
+ return {
56
+ type: "normal",
57
+ arg: t.call(e, r)
58
+ };
59
+ } catch (t) {
60
+ return {
61
+ type: "throw",
62
+ arg: t
63
+ };
64
+ }
65
+ }
66
+ e.wrap = wrap;
67
+ var h = "suspendedStart",
68
+ l = "suspendedYield",
69
+ f = "executing",
70
+ s = "completed",
71
+ y = {};
72
+ function Generator() {}
73
+ function GeneratorFunction() {}
74
+ function GeneratorFunctionPrototype() {}
75
+ var p = {};
76
+ define(p, a, function () {
77
+ return this;
78
+ });
79
+ var d = Object.getPrototypeOf,
80
+ v = d && d(d(values([])));
81
+ v && v !== r && n.call(v, a) && (p = v);
82
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
83
+ function defineIteratorMethods(t) {
84
+ ["next", "throw", "return"].forEach(function (e) {
85
+ define(t, e, function (t) {
86
+ return this._invoke(e, t);
87
+ });
88
+ });
89
+ }
90
+ function AsyncIterator(t, e) {
91
+ function invoke(r, o, i, a) {
92
+ var c = tryCatch(t[r], t, o);
93
+ if ("throw" !== c.type) {
94
+ var u = c.arg,
95
+ h = u.value;
96
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
97
+ invoke("next", t, i, a);
98
+ }, function (t) {
99
+ invoke("throw", t, i, a);
100
+ }) : e.resolve(h).then(function (t) {
101
+ u.value = t, i(u);
102
+ }, function (t) {
103
+ return invoke("throw", t, i, a);
104
+ });
105
+ }
106
+ a(c.arg);
107
+ }
108
+ var r;
109
+ o(this, "_invoke", {
110
+ value: function (t, n) {
111
+ function callInvokeWithMethodAndArg() {
112
+ return new e(function (e, r) {
113
+ invoke(t, n, e, r);
114
+ });
115
+ }
116
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
117
+ }
118
+ });
119
+ }
120
+ function makeInvokeMethod(e, r, n) {
121
+ var o = h;
122
+ return function (i, a) {
123
+ if (o === f) throw new Error("Generator is already running");
124
+ if (o === s) {
125
+ if ("throw" === i) throw a;
126
+ return {
127
+ value: t,
128
+ done: !0
129
+ };
130
+ }
131
+ for (n.method = i, n.arg = a;;) {
132
+ var c = n.delegate;
133
+ if (c) {
134
+ var u = maybeInvokeDelegate(c, n);
135
+ if (u) {
136
+ if (u === y) continue;
137
+ return u;
138
+ }
139
+ }
140
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
141
+ if (o === h) throw o = s, n.arg;
142
+ n.dispatchException(n.arg);
143
+ } else "return" === n.method && n.abrupt("return", n.arg);
144
+ o = f;
145
+ var p = tryCatch(e, r, n);
146
+ if ("normal" === p.type) {
147
+ if (o = n.done ? s : l, p.arg === y) continue;
148
+ return {
149
+ value: p.arg,
150
+ done: n.done
151
+ };
152
+ }
153
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
154
+ }
155
+ };
156
+ }
157
+ function maybeInvokeDelegate(e, r) {
158
+ var n = r.method,
159
+ o = e.iterator[n];
160
+ 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;
161
+ var i = tryCatch(o, e.iterator, r.arg);
162
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
163
+ var a = i.arg;
164
+ 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);
165
+ }
166
+ function pushTryEntry(t) {
167
+ var e = {
168
+ tryLoc: t[0]
169
+ };
170
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
171
+ }
172
+ function resetTryEntry(t) {
173
+ var e = t.completion || {};
174
+ e.type = "normal", delete e.arg, t.completion = e;
175
+ }
176
+ function Context(t) {
177
+ this.tryEntries = [{
178
+ tryLoc: "root"
179
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
180
+ }
181
+ function values(e) {
182
+ if (e || "" === e) {
183
+ var r = e[a];
184
+ if (r) return r.call(e);
185
+ if ("function" == typeof e.next) return e;
186
+ if (!isNaN(e.length)) {
187
+ var o = -1,
188
+ i = function next() {
189
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
190
+ return next.value = t, next.done = !0, next;
191
+ };
192
+ return i.next = i;
193
+ }
194
+ }
195
+ throw new TypeError(typeof e + " is not iterable");
196
+ }
197
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
198
+ value: GeneratorFunctionPrototype,
199
+ configurable: !0
200
+ }), o(GeneratorFunctionPrototype, "constructor", {
201
+ value: GeneratorFunction,
202
+ configurable: !0
203
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
204
+ var e = "function" == typeof t && t.constructor;
205
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
206
+ }, e.mark = function (t) {
207
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
208
+ }, e.awrap = function (t) {
209
+ return {
210
+ __await: t
211
+ };
212
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
213
+ return this;
214
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
215
+ void 0 === i && (i = Promise);
216
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
217
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
218
+ return t.done ? t.value : a.next();
219
+ });
220
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
221
+ return this;
222
+ }), define(g, "toString", function () {
223
+ return "[object Generator]";
224
+ }), e.keys = function (t) {
225
+ var e = Object(t),
226
+ r = [];
227
+ for (var n in e) r.push(n);
228
+ return r.reverse(), function next() {
229
+ for (; r.length;) {
230
+ var t = r.pop();
231
+ if (t in e) return next.value = t, next.done = !1, next;
232
+ }
233
+ return next.done = !0, next;
234
+ };
235
+ }, e.values = values, Context.prototype = {
236
+ constructor: Context,
237
+ reset: function (e) {
238
+ 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);
239
+ },
240
+ stop: function () {
241
+ this.done = !0;
242
+ var t = this.tryEntries[0].completion;
243
+ if ("throw" === t.type) throw t.arg;
244
+ return this.rval;
245
+ },
246
+ dispatchException: function (e) {
247
+ if (this.done) throw e;
248
+ var r = this;
249
+ function handle(n, o) {
250
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
251
+ }
252
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
253
+ var i = this.tryEntries[o],
254
+ a = i.completion;
255
+ if ("root" === i.tryLoc) return handle("end");
256
+ if (i.tryLoc <= this.prev) {
257
+ var c = n.call(i, "catchLoc"),
258
+ u = n.call(i, "finallyLoc");
259
+ if (c && u) {
260
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
261
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
262
+ } else if (c) {
263
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
264
+ } else {
265
+ if (!u) throw new Error("try statement without catch or finally");
266
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
267
+ }
268
+ }
269
+ }
270
+ },
271
+ abrupt: function (t, e) {
272
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
273
+ var o = this.tryEntries[r];
274
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
275
+ var i = o;
276
+ break;
277
+ }
278
+ }
279
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
280
+ var a = i ? i.completion : {};
281
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
282
+ },
283
+ complete: function (t, e) {
284
+ if ("throw" === t.type) throw t.arg;
285
+ 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;
286
+ },
287
+ finish: function (t) {
288
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
289
+ var r = this.tryEntries[e];
290
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
291
+ }
292
+ },
293
+ catch: function (t) {
294
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
295
+ var r = this.tryEntries[e];
296
+ if (r.tryLoc === t) {
297
+ var n = r.completion;
298
+ if ("throw" === n.type) {
299
+ var o = n.arg;
300
+ resetTryEntry(r);
301
+ }
302
+ return o;
303
+ }
304
+ }
305
+ throw new Error("illegal catch attempt");
306
+ },
307
+ delegateYield: function (e, r, n) {
308
+ return this.delegate = {
309
+ iterator: values(e),
310
+ resultName: r,
311
+ nextLoc: n
312
+ }, "next" === this.method && (this.arg = t), y;
313
+ }
314
+ }, e;
315
+ }
15
316
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
16
317
  try {
17
318
  var info = gen[key](arg);
@@ -142,664 +443,6 @@ function _objectWithoutPropertiesLoose(source, excluded) {
142
443
  return target;
143
444
  }
144
445
 
145
- function createCommonjsModule(fn, module) {
146
- return module = { exports: {} }, fn(module, module.exports), module.exports;
147
- }
148
-
149
- var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
150
- /**
151
- * Copyright (c) 2014-present, Facebook, Inc.
152
- *
153
- * This source code is licensed under the MIT license found in the
154
- * LICENSE file in the root directory of this source tree.
155
- */
156
-
157
- var runtime = function (exports) {
158
-
159
- var Op = Object.prototype;
160
- var hasOwn = Op.hasOwnProperty;
161
- var undefined$1; // More compressible than void 0.
162
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
163
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
164
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
165
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
166
- function define(obj, key, value) {
167
- Object.defineProperty(obj, key, {
168
- value: value,
169
- enumerable: true,
170
- configurable: true,
171
- writable: true
172
- });
173
- return obj[key];
174
- }
175
- try {
176
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
177
- define({}, "");
178
- } catch (err) {
179
- define = function define(obj, key, value) {
180
- return obj[key] = value;
181
- };
182
- }
183
- function wrap(innerFn, outerFn, self, tryLocsList) {
184
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
185
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
186
- var generator = Object.create(protoGenerator.prototype);
187
- var context = new Context(tryLocsList || []);
188
-
189
- // The ._invoke method unifies the implementations of the .next,
190
- // .throw, and .return methods.
191
- generator._invoke = makeInvokeMethod(innerFn, self, context);
192
- return generator;
193
- }
194
- exports.wrap = wrap;
195
-
196
- // Try/catch helper to minimize deoptimizations. Returns a completion
197
- // record like context.tryEntries[i].completion. This interface could
198
- // have been (and was previously) designed to take a closure to be
199
- // invoked without arguments, but in all the cases we care about we
200
- // already have an existing method we want to call, so there's no need
201
- // to create a new function object. We can even get away with assuming
202
- // the method takes exactly one argument, since that happens to be true
203
- // in every case, so we don't have to touch the arguments object. The
204
- // only additional allocation required is the completion record, which
205
- // has a stable shape and so hopefully should be cheap to allocate.
206
- function tryCatch(fn, obj, arg) {
207
- try {
208
- return {
209
- type: "normal",
210
- arg: fn.call(obj, arg)
211
- };
212
- } catch (err) {
213
- return {
214
- type: "throw",
215
- arg: err
216
- };
217
- }
218
- }
219
- var GenStateSuspendedStart = "suspendedStart";
220
- var GenStateSuspendedYield = "suspendedYield";
221
- var GenStateExecuting = "executing";
222
- var GenStateCompleted = "completed";
223
-
224
- // Returning this object from the innerFn has the same effect as
225
- // breaking out of the dispatch switch statement.
226
- var ContinueSentinel = {};
227
-
228
- // Dummy constructor functions that we use as the .constructor and
229
- // .constructor.prototype properties for functions that return Generator
230
- // objects. For full spec compliance, you may wish to configure your
231
- // minifier not to mangle the names of these two functions.
232
- function Generator() {}
233
- function GeneratorFunction() {}
234
- function GeneratorFunctionPrototype() {}
235
-
236
- // This is a polyfill for %IteratorPrototype% for environments that
237
- // don't natively support it.
238
- var IteratorPrototype = {};
239
- define(IteratorPrototype, iteratorSymbol, function () {
240
- return this;
241
- });
242
- var getProto = Object.getPrototypeOf;
243
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
244
- if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
245
- // This environment has a native %IteratorPrototype%; use it instead
246
- // of the polyfill.
247
- IteratorPrototype = NativeIteratorPrototype;
248
- }
249
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
250
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
251
- define(Gp, "constructor", GeneratorFunctionPrototype);
252
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
253
- GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
254
-
255
- // Helper for defining the .next, .throw, and .return methods of the
256
- // Iterator interface in terms of a single ._invoke method.
257
- function defineIteratorMethods(prototype) {
258
- ["next", "throw", "return"].forEach(function (method) {
259
- define(prototype, method, function (arg) {
260
- return this._invoke(method, arg);
261
- });
262
- });
263
- }
264
- exports.isGeneratorFunction = function (genFun) {
265
- var ctor = typeof genFun === "function" && genFun.constructor;
266
- return ctor ? ctor === GeneratorFunction ||
267
- // For the native GeneratorFunction constructor, the best we can
268
- // do is to check its .name property.
269
- (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
270
- };
271
- exports.mark = function (genFun) {
272
- if (Object.setPrototypeOf) {
273
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
274
- } else {
275
- genFun.__proto__ = GeneratorFunctionPrototype;
276
- define(genFun, toStringTagSymbol, "GeneratorFunction");
277
- }
278
- genFun.prototype = Object.create(Gp);
279
- return genFun;
280
- };
281
-
282
- // Within the body of any async function, `await x` is transformed to
283
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
284
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
285
- // meant to be awaited.
286
- exports.awrap = function (arg) {
287
- return {
288
- __await: arg
289
- };
290
- };
291
- function AsyncIterator(generator, PromiseImpl) {
292
- function invoke(method, arg, resolve, reject) {
293
- var record = tryCatch(generator[method], generator, arg);
294
- if (record.type === "throw") {
295
- reject(record.arg);
296
- } else {
297
- var result = record.arg;
298
- var value = result.value;
299
- if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
300
- return PromiseImpl.resolve(value.__await).then(function (value) {
301
- invoke("next", value, resolve, reject);
302
- }, function (err) {
303
- invoke("throw", err, resolve, reject);
304
- });
305
- }
306
- return PromiseImpl.resolve(value).then(function (unwrapped) {
307
- // When a yielded Promise is resolved, its final value becomes
308
- // the .value of the Promise<{value,done}> result for the
309
- // current iteration.
310
- result.value = unwrapped;
311
- resolve(result);
312
- }, function (error) {
313
- // If a rejected Promise was yielded, throw the rejection back
314
- // into the async generator function so it can be handled there.
315
- return invoke("throw", error, resolve, reject);
316
- });
317
- }
318
- }
319
- var previousPromise;
320
- function enqueue(method, arg) {
321
- function callInvokeWithMethodAndArg() {
322
- return new PromiseImpl(function (resolve, reject) {
323
- invoke(method, arg, resolve, reject);
324
- });
325
- }
326
- return previousPromise =
327
- // If enqueue has been called before, then we want to wait until
328
- // all previous Promises have been resolved before calling invoke,
329
- // so that results are always delivered in the correct order. If
330
- // enqueue has not been called before, then it is important to
331
- // call invoke immediately, without waiting on a callback to fire,
332
- // so that the async generator function has the opportunity to do
333
- // any necessary setup in a predictable way. This predictability
334
- // is why the Promise constructor synchronously invokes its
335
- // executor callback, and why async functions synchronously
336
- // execute code before the first await. Since we implement simple
337
- // async functions in terms of async generators, it is especially
338
- // important to get this right, even though it requires care.
339
- previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
340
- // Avoid propagating failures to Promises returned by later
341
- // invocations of the iterator.
342
- callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
343
- }
344
-
345
- // Define the unified helper method that is used to implement .next,
346
- // .throw, and .return (see defineIteratorMethods).
347
- this._invoke = enqueue;
348
- }
349
- defineIteratorMethods(AsyncIterator.prototype);
350
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
351
- return this;
352
- });
353
- exports.AsyncIterator = AsyncIterator;
354
-
355
- // Note that simple async functions are implemented on top of
356
- // AsyncIterator objects; they just return a Promise for the value of
357
- // the final result produced by the iterator.
358
- exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
359
- if (PromiseImpl === void 0) PromiseImpl = Promise;
360
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
361
- return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
362
- : iter.next().then(function (result) {
363
- return result.done ? result.value : iter.next();
364
- });
365
- };
366
- function makeInvokeMethod(innerFn, self, context) {
367
- var state = GenStateSuspendedStart;
368
- return function invoke(method, arg) {
369
- if (state === GenStateExecuting) {
370
- throw new Error("Generator is already running");
371
- }
372
- if (state === GenStateCompleted) {
373
- if (method === "throw") {
374
- throw arg;
375
- }
376
-
377
- // Be forgiving, per 25.3.3.3.3 of the spec:
378
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
379
- return doneResult();
380
- }
381
- context.method = method;
382
- context.arg = arg;
383
- while (true) {
384
- var delegate = context.delegate;
385
- if (delegate) {
386
- var delegateResult = maybeInvokeDelegate(delegate, context);
387
- if (delegateResult) {
388
- if (delegateResult === ContinueSentinel) continue;
389
- return delegateResult;
390
- }
391
- }
392
- if (context.method === "next") {
393
- // Setting context._sent for legacy support of Babel's
394
- // function.sent implementation.
395
- context.sent = context._sent = context.arg;
396
- } else if (context.method === "throw") {
397
- if (state === GenStateSuspendedStart) {
398
- state = GenStateCompleted;
399
- throw context.arg;
400
- }
401
- context.dispatchException(context.arg);
402
- } else if (context.method === "return") {
403
- context.abrupt("return", context.arg);
404
- }
405
- state = GenStateExecuting;
406
- var record = tryCatch(innerFn, self, context);
407
- if (record.type === "normal") {
408
- // If an exception is thrown from innerFn, we leave state ===
409
- // GenStateExecuting and loop back for another invocation.
410
- state = context.done ? GenStateCompleted : GenStateSuspendedYield;
411
- if (record.arg === ContinueSentinel) {
412
- continue;
413
- }
414
- return {
415
- value: record.arg,
416
- done: context.done
417
- };
418
- } else if (record.type === "throw") {
419
- state = GenStateCompleted;
420
- // Dispatch the exception by looping back around to the
421
- // context.dispatchException(context.arg) call above.
422
- context.method = "throw";
423
- context.arg = record.arg;
424
- }
425
- }
426
- };
427
- }
428
-
429
- // Call delegate.iterator[context.method](context.arg) and handle the
430
- // result, either by returning a { value, done } result from the
431
- // delegate iterator, or by modifying context.method and context.arg,
432
- // setting context.delegate to null, and returning the ContinueSentinel.
433
- function maybeInvokeDelegate(delegate, context) {
434
- var method = delegate.iterator[context.method];
435
- if (method === undefined$1) {
436
- // A .throw or .return when the delegate iterator has no .throw
437
- // method always terminates the yield* loop.
438
- context.delegate = null;
439
- if (context.method === "throw") {
440
- // Note: ["return"] must be used for ES3 parsing compatibility.
441
- if (delegate.iterator["return"]) {
442
- // If the delegate iterator has a return method, give it a
443
- // chance to clean up.
444
- context.method = "return";
445
- context.arg = undefined$1;
446
- maybeInvokeDelegate(delegate, context);
447
- if (context.method === "throw") {
448
- // If maybeInvokeDelegate(context) changed context.method from
449
- // "return" to "throw", let that override the TypeError below.
450
- return ContinueSentinel;
451
- }
452
- }
453
- context.method = "throw";
454
- context.arg = new TypeError("The iterator does not provide a 'throw' method");
455
- }
456
- return ContinueSentinel;
457
- }
458
- var record = tryCatch(method, delegate.iterator, context.arg);
459
- if (record.type === "throw") {
460
- context.method = "throw";
461
- context.arg = record.arg;
462
- context.delegate = null;
463
- return ContinueSentinel;
464
- }
465
- var info = record.arg;
466
- if (!info) {
467
- context.method = "throw";
468
- context.arg = new TypeError("iterator result is not an object");
469
- context.delegate = null;
470
- return ContinueSentinel;
471
- }
472
- if (info.done) {
473
- // Assign the result of the finished delegate to the temporary
474
- // variable specified by delegate.resultName (see delegateYield).
475
- context[delegate.resultName] = info.value;
476
-
477
- // Resume execution at the desired location (see delegateYield).
478
- context.next = delegate.nextLoc;
479
-
480
- // If context.method was "throw" but the delegate handled the
481
- // exception, let the outer generator proceed normally. If
482
- // context.method was "next", forget context.arg since it has been
483
- // "consumed" by the delegate iterator. If context.method was
484
- // "return", allow the original .return call to continue in the
485
- // outer generator.
486
- if (context.method !== "return") {
487
- context.method = "next";
488
- context.arg = undefined$1;
489
- }
490
- } else {
491
- // Re-yield the result returned by the delegate method.
492
- return info;
493
- }
494
-
495
- // The delegate iterator is finished, so forget it and continue with
496
- // the outer generator.
497
- context.delegate = null;
498
- return ContinueSentinel;
499
- }
500
-
501
- // Define Generator.prototype.{next,throw,return} in terms of the
502
- // unified ._invoke helper method.
503
- defineIteratorMethods(Gp);
504
- define(Gp, toStringTagSymbol, "Generator");
505
-
506
- // A Generator should always return itself as the iterator object when the
507
- // @@iterator function is called on it. Some browsers' implementations of the
508
- // iterator prototype chain incorrectly implement this, causing the Generator
509
- // object to not be returned from this call. This ensures that doesn't happen.
510
- // See https://github.com/facebook/regenerator/issues/274 for more details.
511
- define(Gp, iteratorSymbol, function () {
512
- return this;
513
- });
514
- define(Gp, "toString", function () {
515
- return "[object Generator]";
516
- });
517
- function pushTryEntry(locs) {
518
- var entry = {
519
- tryLoc: locs[0]
520
- };
521
- if (1 in locs) {
522
- entry.catchLoc = locs[1];
523
- }
524
- if (2 in locs) {
525
- entry.finallyLoc = locs[2];
526
- entry.afterLoc = locs[3];
527
- }
528
- this.tryEntries.push(entry);
529
- }
530
- function resetTryEntry(entry) {
531
- var record = entry.completion || {};
532
- record.type = "normal";
533
- delete record.arg;
534
- entry.completion = record;
535
- }
536
- function Context(tryLocsList) {
537
- // The root entry object (effectively a try statement without a catch
538
- // or a finally block) gives us a place to store values thrown from
539
- // locations where there is no enclosing try statement.
540
- this.tryEntries = [{
541
- tryLoc: "root"
542
- }];
543
- tryLocsList.forEach(pushTryEntry, this);
544
- this.reset(true);
545
- }
546
- exports.keys = function (object) {
547
- var keys = [];
548
- for (var key in object) {
549
- keys.push(key);
550
- }
551
- keys.reverse();
552
-
553
- // Rather than returning an object with a next method, we keep
554
- // things simple and return the next function itself.
555
- return function next() {
556
- while (keys.length) {
557
- var key = keys.pop();
558
- if (key in object) {
559
- next.value = key;
560
- next.done = false;
561
- return next;
562
- }
563
- }
564
-
565
- // To avoid creating an additional object, we just hang the .value
566
- // and .done properties off the next function object itself. This
567
- // also ensures that the minifier will not anonymize the function.
568
- next.done = true;
569
- return next;
570
- };
571
- };
572
- function values(iterable) {
573
- if (iterable) {
574
- var iteratorMethod = iterable[iteratorSymbol];
575
- if (iteratorMethod) {
576
- return iteratorMethod.call(iterable);
577
- }
578
- if (typeof iterable.next === "function") {
579
- return iterable;
580
- }
581
- if (!isNaN(iterable.length)) {
582
- var i = -1,
583
- next = function next() {
584
- while (++i < iterable.length) {
585
- if (hasOwn.call(iterable, i)) {
586
- next.value = iterable[i];
587
- next.done = false;
588
- return next;
589
- }
590
- }
591
- next.value = undefined$1;
592
- next.done = true;
593
- return next;
594
- };
595
- return next.next = next;
596
- }
597
- }
598
-
599
- // Return an iterator with no values.
600
- return {
601
- next: doneResult
602
- };
603
- }
604
- exports.values = values;
605
- function doneResult() {
606
- return {
607
- value: undefined$1,
608
- done: true
609
- };
610
- }
611
- Context.prototype = {
612
- constructor: Context,
613
- reset: function reset(skipTempReset) {
614
- this.prev = 0;
615
- this.next = 0;
616
- // Resetting context._sent for legacy support of Babel's
617
- // function.sent implementation.
618
- this.sent = this._sent = undefined$1;
619
- this.done = false;
620
- this.delegate = null;
621
- this.method = "next";
622
- this.arg = undefined$1;
623
- this.tryEntries.forEach(resetTryEntry);
624
- if (!skipTempReset) {
625
- for (var name in this) {
626
- // Not sure about the optimal order of these conditions:
627
- if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
628
- this[name] = undefined$1;
629
- }
630
- }
631
- }
632
- },
633
- stop: function stop() {
634
- this.done = true;
635
- var rootEntry = this.tryEntries[0];
636
- var rootRecord = rootEntry.completion;
637
- if (rootRecord.type === "throw") {
638
- throw rootRecord.arg;
639
- }
640
- return this.rval;
641
- },
642
- dispatchException: function dispatchException(exception) {
643
- if (this.done) {
644
- throw exception;
645
- }
646
- var context = this;
647
- function handle(loc, caught) {
648
- record.type = "throw";
649
- record.arg = exception;
650
- context.next = loc;
651
- if (caught) {
652
- // If the dispatched exception was caught by a catch block,
653
- // then let that catch block handle the exception normally.
654
- context.method = "next";
655
- context.arg = undefined$1;
656
- }
657
- return !!caught;
658
- }
659
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
660
- var entry = this.tryEntries[i];
661
- var record = entry.completion;
662
- if (entry.tryLoc === "root") {
663
- // Exception thrown outside of any try block that could handle
664
- // it, so set the completion value of the entire function to
665
- // throw the exception.
666
- return handle("end");
667
- }
668
- if (entry.tryLoc <= this.prev) {
669
- var hasCatch = hasOwn.call(entry, "catchLoc");
670
- var hasFinally = hasOwn.call(entry, "finallyLoc");
671
- if (hasCatch && hasFinally) {
672
- if (this.prev < entry.catchLoc) {
673
- return handle(entry.catchLoc, true);
674
- } else if (this.prev < entry.finallyLoc) {
675
- return handle(entry.finallyLoc);
676
- }
677
- } else if (hasCatch) {
678
- if (this.prev < entry.catchLoc) {
679
- return handle(entry.catchLoc, true);
680
- }
681
- } else if (hasFinally) {
682
- if (this.prev < entry.finallyLoc) {
683
- return handle(entry.finallyLoc);
684
- }
685
- } else {
686
- throw new Error("try statement without catch or finally");
687
- }
688
- }
689
- }
690
- },
691
- abrupt: function abrupt(type, arg) {
692
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
693
- var entry = this.tryEntries[i];
694
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
695
- var finallyEntry = entry;
696
- break;
697
- }
698
- }
699
- if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
700
- // Ignore the finally entry if control is not jumping to a
701
- // location outside the try/catch block.
702
- finallyEntry = null;
703
- }
704
- var record = finallyEntry ? finallyEntry.completion : {};
705
- record.type = type;
706
- record.arg = arg;
707
- if (finallyEntry) {
708
- this.method = "next";
709
- this.next = finallyEntry.finallyLoc;
710
- return ContinueSentinel;
711
- }
712
- return this.complete(record);
713
- },
714
- complete: function complete(record, afterLoc) {
715
- if (record.type === "throw") {
716
- throw record.arg;
717
- }
718
- if (record.type === "break" || record.type === "continue") {
719
- this.next = record.arg;
720
- } else if (record.type === "return") {
721
- this.rval = this.arg = record.arg;
722
- this.method = "return";
723
- this.next = "end";
724
- } else if (record.type === "normal" && afterLoc) {
725
- this.next = afterLoc;
726
- }
727
- return ContinueSentinel;
728
- },
729
- finish: function finish(finallyLoc) {
730
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
731
- var entry = this.tryEntries[i];
732
- if (entry.finallyLoc === finallyLoc) {
733
- this.complete(entry.completion, entry.afterLoc);
734
- resetTryEntry(entry);
735
- return ContinueSentinel;
736
- }
737
- }
738
- },
739
- "catch": function _catch(tryLoc) {
740
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
741
- var entry = this.tryEntries[i];
742
- if (entry.tryLoc === tryLoc) {
743
- var record = entry.completion;
744
- if (record.type === "throw") {
745
- var thrown = record.arg;
746
- resetTryEntry(entry);
747
- }
748
- return thrown;
749
- }
750
- }
751
-
752
- // The context.catch method must only be called with a location
753
- // argument that corresponds to a known catch block.
754
- throw new Error("illegal catch attempt");
755
- },
756
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
757
- this.delegate = {
758
- iterator: values(iterable),
759
- resultName: resultName,
760
- nextLoc: nextLoc
761
- };
762
- if (this.method === "next") {
763
- // Deliberately forget the last sent value so that we don't
764
- // accidentally pass it on to the delegate.
765
- this.arg = undefined$1;
766
- }
767
- return ContinueSentinel;
768
- }
769
- };
770
-
771
- // Regardless of whether this script is executing as a CommonJS module
772
- // or not, return the runtime object so that we can declare the variable
773
- // regeneratorRuntime in the outer scope, which allows this module to be
774
- // injected easily by `bin/regenerator --include-runtime script.js`.
775
- return exports;
776
- }(
777
- // If this script is executing as a CommonJS module, use module.exports
778
- // as the regeneratorRuntime namespace. Otherwise create a new empty
779
- // object. Either way, the resulting object will be used to initialize
780
- // the regeneratorRuntime variable at the top of this file.
781
- module.exports );
782
- try {
783
- regeneratorRuntime = runtime;
784
- } catch (accidentalStrictMode) {
785
- // This module should not be running in strict mode, so the above
786
- // assignment should always work unless something is misconfigured. Just
787
- // in case runtime.js accidentally runs in strict mode, in modern engines
788
- // we can explicitly access globalThis. In older engines we can escape
789
- // strict mode using a global Function call. This could conceivably fail
790
- // if a Content Security Policy forbids using Function, but in that case
791
- // the proper solution is to fix the accidental strict mode problem. If
792
- // you've misconfigured your bundler to force strict mode and applied a
793
- // CSP to forbid Function, and you're not willing to fix either of those
794
- // problems, please detail your unique predicament in a GitHub issue.
795
- if (typeof globalThis === "object") {
796
- globalThis.regeneratorRuntime = runtime;
797
- } else {
798
- Function("r", "regeneratorRuntime = r")(runtime);
799
- }
800
- }
801
- });
802
-
803
446
  function queryParamsToApi(params) {
804
447
  return {
805
448
  where: params.where,
@@ -820,133 +463,115 @@ var HttpError = /*#__PURE__*/function (_Error) {
820
463
  }
821
464
  return HttpError;
822
465
  }( /*#__PURE__*/_wrapNativeSuper(Error));
823
- var API = /*#__PURE__*/function () {
466
+ var API = /*#__PURE__*/function (_get, _fetchTables, _query) {
824
467
  function API(config) {
825
468
  this.config = config;
826
469
  }
827
470
  var _proto = API.prototype;
828
- _proto.get = /*#__PURE__*/function () {
829
- var _get = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(endpoint, params) {
471
+ _proto.get = function get(_x, _x2) {
472
+ return (_get = _get || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(endpoint, params) {
830
473
  var url, response, message, _json$error, json;
831
- return runtime_1.wrap(function _callee$(_context) {
832
- while (1) {
833
- switch (_context.prev = _context.next) {
834
- case 0:
835
- if (params === void 0) {
836
- params = {};
837
- }
838
- url = new URL(this.config.host + "/api/v1/cms/databases/" + this.config.databaseId + endpoint);
839
- url.search = new URLSearchParams(params).toString();
840
- _context.next = 5;
841
- return fetch(url.toString(), {
842
- method: "GET",
843
- headers: {
844
- accept: "*/*",
845
- "x-plasmic-api-cms-tokens": this.config.databaseId + ":" + this.config.databaseToken
846
- },
847
- mode: "cors"
848
- });
849
- case 5:
850
- response = _context.sent;
851
- if (!(response.status !== 200)) {
852
- _context.next = 12;
853
- break;
474
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
475
+ while (1) switch (_context.prev = _context.next) {
476
+ case 0:
477
+ if (params === void 0) {
478
+ params = {};
479
+ }
480
+ url = new URL(this.config.host + "/api/v1/cms/databases/" + this.config.databaseId + endpoint);
481
+ url.search = new URLSearchParams(params).toString();
482
+ _context.next = 5;
483
+ return fetch(url.toString(), {
484
+ method: "GET",
485
+ headers: {
486
+ accept: "*/*",
487
+ "x-plasmic-api-cms-tokens": this.config.databaseId + ":" + this.config.databaseToken
488
+ },
489
+ mode: "cors"
490
+ });
491
+ case 5:
492
+ response = _context.sent;
493
+ if (!(response.status !== 200)) {
494
+ _context.next = 12;
495
+ break;
496
+ }
497
+ _context.next = 9;
498
+ return response.text();
499
+ case 9:
500
+ message = _context.sent;
501
+ try {
502
+ json = JSON.parse(message);
503
+ if ((_json$error = json.error) != null && _json$error.message) {
504
+ message = json.error.message;
854
505
  }
855
- _context.next = 9;
856
- return response.text();
857
- case 9:
858
- message = _context.sent;
859
- try {
860
- json = JSON.parse(message);
861
- if ((_json$error = json.error) != null && _json$error.message) {
862
- message = json.error.message;
863
- }
864
- } catch (_unused) {}
865
- throw new HttpError(response.status, message);
866
- case 12:
867
- _context.next = 14;
868
- return response.json();
869
- case 14:
870
- return _context.abrupt("return", _context.sent);
871
- case 15:
872
- case "end":
873
- return _context.stop();
874
- }
506
+ } catch (_unused) {}
507
+ throw new HttpError(response.status, message);
508
+ case 12:
509
+ _context.next = 14;
510
+ return response.json();
511
+ case 14:
512
+ return _context.abrupt("return", _context.sent);
513
+ case 15:
514
+ case "end":
515
+ return _context.stop();
875
516
  }
876
517
  }, _callee, this);
877
- }));
878
- function get(_x, _x2) {
879
- return _get.apply(this, arguments);
880
- }
881
- return get;
882
- }();
883
- _proto.fetchTables = /*#__PURE__*/function () {
884
- var _fetchTables = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
518
+ }))).apply(this, arguments);
519
+ };
520
+ _proto.fetchTables = function fetchTables() {
521
+ return (_fetchTables = _fetchTables || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
885
522
  var response;
886
- return runtime_1.wrap(function _callee2$(_context2) {
887
- while (1) {
888
- switch (_context2.prev = _context2.next) {
889
- case 0:
890
- _context2.prev = 0;
891
- _context2.next = 3;
892
- return this.get("");
893
- case 3:
894
- response = _context2.sent;
895
- return _context2.abrupt("return", response.tables);
896
- case 7:
897
- _context2.prev = 7;
898
- _context2.t0 = _context2["catch"](0);
899
- console.error(_context2.t0);
900
- throw _context2.t0;
901
- case 11:
902
- case "end":
903
- return _context2.stop();
904
- }
523
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
524
+ while (1) switch (_context2.prev = _context2.next) {
525
+ case 0:
526
+ _context2.prev = 0;
527
+ _context2.next = 3;
528
+ return this.get("");
529
+ case 3:
530
+ response = _context2.sent;
531
+ return _context2.abrupt("return", response.tables);
532
+ case 7:
533
+ _context2.prev = 7;
534
+ _context2.t0 = _context2["catch"](0);
535
+ console.error(_context2.t0);
536
+ throw _context2.t0;
537
+ case 11:
538
+ case "end":
539
+ return _context2.stop();
905
540
  }
906
541
  }, _callee2, this, [[0, 7]]);
907
- }));
908
- function fetchTables() {
909
- return _fetchTables.apply(this, arguments);
910
- }
911
- return fetchTables;
912
- }();
913
- _proto.query = /*#__PURE__*/function () {
914
- var _query = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(table, params) {
542
+ }))).apply(this, arguments);
543
+ };
544
+ _proto.query = function query(_x3, _x4) {
545
+ return (_query = _query || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(table, params) {
915
546
  var response;
916
- return runtime_1.wrap(function _callee3$(_context3) {
917
- while (1) {
918
- switch (_context3.prev = _context3.next) {
919
- case 0:
920
- if (params === void 0) {
921
- params = {};
922
- }
923
- _context3.prev = 1;
924
- _context3.next = 4;
925
- return this.get("/tables/" + table + "/query", {
926
- q: JSON.stringify(queryParamsToApi(params)),
927
- draft: Number(params.useDraft),
928
- locale: this.config.locale
929
- });
930
- case 4:
931
- response = _context3.sent;
932
- return _context3.abrupt("return", response.rows);
933
- case 8:
934
- _context3.prev = 8;
935
- _context3.t0 = _context3["catch"](1);
936
- console.error(_context3.t0);
937
- throw _context3.t0;
938
- case 12:
939
- case "end":
940
- return _context3.stop();
941
- }
547
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
548
+ while (1) switch (_context3.prev = _context3.next) {
549
+ case 0:
550
+ if (params === void 0) {
551
+ params = {};
552
+ }
553
+ _context3.prev = 1;
554
+ _context3.next = 4;
555
+ return this.get("/tables/" + table + "/query", {
556
+ q: JSON.stringify(queryParamsToApi(params)),
557
+ draft: Number(params.useDraft),
558
+ locale: this.config.locale
559
+ });
560
+ case 4:
561
+ response = _context3.sent;
562
+ return _context3.abrupt("return", response.rows);
563
+ case 8:
564
+ _context3.prev = 8;
565
+ _context3.t0 = _context3["catch"](1);
566
+ console.error(_context3.t0);
567
+ throw _context3.t0;
568
+ case 12:
569
+ case "end":
570
+ return _context3.stop();
942
571
  }
943
572
  }, _callee3, this, [[1, 8]]);
944
- }));
945
- function query(_x3, _x4) {
946
- return _query.apply(this, arguments);
947
- }
948
- return query;
949
- }();
573
+ }))).apply(this, arguments);
574
+ };
950
575
  return API;
951
576
  }();
952
577
  function mkApi(config) {
@@ -1179,25 +804,23 @@ function TablesFetcher(_ref2) {
1179
804
  component: "TablesFetcher",
1180
805
  databaseConfig: databaseConfig
1181
806
  });
1182
- var maybeData = query.usePlasmicQueryData(cacheKey, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
1183
- return runtime_1.wrap(function _callee$(_context) {
1184
- while (1) {
1185
- switch (_context.prev = _context.next) {
1186
- case 0:
1187
- if (isDatabaseConfigured(databaseConfig)) {
1188
- _context.next = 2;
1189
- break;
1190
- }
1191
- return _context.abrupt("return", []);
1192
- case 2:
1193
- _context.next = 4;
1194
- return mkApi(databaseConfig).fetchTables();
1195
- case 4:
1196
- return _context.abrupt("return", _context.sent);
1197
- case 5:
1198
- case "end":
1199
- return _context.stop();
1200
- }
807
+ var maybeData = query.usePlasmicQueryData(cacheKey, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
808
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
809
+ while (1) switch (_context.prev = _context.next) {
810
+ case 0:
811
+ if (isDatabaseConfigured(databaseConfig)) {
812
+ _context.next = 2;
813
+ break;
814
+ }
815
+ return _context.abrupt("return", []);
816
+ case 2:
817
+ _context.next = 4;
818
+ return mkApi(databaseConfig).fetchTables();
819
+ case 4:
820
+ return _context.abrupt("return", _context.sent);
821
+ case 5:
822
+ case "end":
823
+ return _context.stop();
1201
824
  }
1202
825
  }, _callee);
1203
826
  })));
@@ -1379,41 +1002,39 @@ function CmsQueryRepeater(_ref5) {
1379
1002
  });
1380
1003
  if (tables) {
1381
1004
  // TODO: Only include table if __plasmic_cms_row_{table} exists.
1382
- setControlContextData == null ? void 0 : setControlContextData({
1005
+ setControlContextData == null || setControlContextData({
1383
1006
  tables: tables,
1384
1007
  table: table
1385
1008
  });
1386
1009
  }
1387
- var maybeData = query.usePlasmicQueryData(cacheKey, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
1388
- return runtime_1.wrap(function _callee2$(_context2) {
1389
- while (1) {
1390
- switch (_context2.prev = _context2.next) {
1391
- case 0:
1392
- if (isDatabaseConfigured(databaseConfig)) {
1393
- _context2.next = 2;
1394
- break;
1395
- }
1396
- throw new Error("You must specify a CMS ID and API key");
1397
- case 2:
1398
- if (table) {
1399
- _context2.next = 6;
1400
- break;
1401
- }
1402
- throw new Error("You must select a model to query");
1403
- case 6:
1404
- if (!(tables && !tables.find(function (t) {
1405
- return t.identifier === table;
1406
- }))) {
1407
- _context2.next = 10;
1408
- break;
1409
- }
1410
- throw new Error("There is no model called \"" + table + "\"");
1411
- case 10:
1412
- return _context2.abrupt("return", mkApi(databaseConfig).query(table, params));
1413
- case 11:
1414
- case "end":
1415
- return _context2.stop();
1416
- }
1010
+ var maybeData = query.usePlasmicQueryData(cacheKey, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
1011
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1012
+ while (1) switch (_context2.prev = _context2.next) {
1013
+ case 0:
1014
+ if (isDatabaseConfigured(databaseConfig)) {
1015
+ _context2.next = 2;
1016
+ break;
1017
+ }
1018
+ throw new Error("You must specify a CMS ID and API key");
1019
+ case 2:
1020
+ if (table) {
1021
+ _context2.next = 6;
1022
+ break;
1023
+ }
1024
+ throw new Error("You must select a model to query");
1025
+ case 6:
1026
+ if (!(tables && !tables.find(function (t) {
1027
+ return t.identifier === table;
1028
+ }))) {
1029
+ _context2.next = 10;
1030
+ break;
1031
+ }
1032
+ throw new Error("There is no model called \"" + table + "\"");
1033
+ case 10:
1034
+ return _context2.abrupt("return", mkApi(databaseConfig).query(table, params));
1035
+ case 11:
1036
+ case "end":
1037
+ return _context2.stop();
1417
1038
  }
1418
1039
  }, _callee2);
1419
1040
  })));
@@ -1450,7 +1071,7 @@ var cmsRowFieldMeta = {
1450
1071
  displayName: "Model",
1451
1072
  hidden: function hidden(props, ctx) {
1452
1073
  var _ctx$tables$length, _ctx$tables;
1453
- return ((_ctx$tables$length = ctx == null ? void 0 : (_ctx$tables = ctx.tables) == null ? void 0 : _ctx$tables.length) != null ? _ctx$tables$length : 0) <= 1 && !props.table;
1074
+ return ((_ctx$tables$length = ctx == null || (_ctx$tables = ctx.tables) == null ? void 0 : _ctx$tables.length) != null ? _ctx$tables$length : 0) <= 1 && !props.table;
1454
1075
  },
1455
1076
  helpText: "Pick model from a CMS Data Fetcher",
1456
1077
  description: "Usually not used! Only with multiple CMS Data Loaders, use this to choose which to show. Otherwise, go select the CMS Data Loader if you want to load different data.",
@@ -1472,7 +1093,7 @@ var cmsRowFieldMeta = {
1472
1093
  },
1473
1094
  defaultValueHint: function defaultValueHint(_, ctx) {
1474
1095
  var _ctx$fieldMeta, _ctx$fieldMeta2;
1475
- return (ctx == null ? void 0 : (_ctx$fieldMeta = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta.name) || (ctx == null ? void 0 : (_ctx$fieldMeta2 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta2.identifier);
1096
+ return (ctx == null || (_ctx$fieldMeta = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta.name) || (ctx == null || (_ctx$fieldMeta2 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta2.identifier);
1476
1097
  }
1477
1098
  },
1478
1099
  dateFormat: {
@@ -1566,7 +1187,7 @@ function CmsRowField(_ref9) {
1566
1187
  }) : undefined;
1567
1188
  if (tables) {
1568
1189
  // TODO: Only include table if __plasmic_cms_row_{table} exists.
1569
- setControlContextData == null ? void 0 : setControlContextData(_extends({
1190
+ setControlContextData == null || setControlContextData(_extends({
1570
1191
  tables: tables
1571
1192
  }, res && res.row ? {
1572
1193
  table: res.table,
@@ -1604,7 +1225,7 @@ function deriveInferredTableField(opts) {
1604
1225
  field = opts.field,
1605
1226
  typeFilters = opts.typeFilters;
1606
1227
  if (!table) return undefined;
1607
- var schema = tables == null ? void 0 : (_tables$find = tables.find(function (t) {
1228
+ var schema = tables == null || (_tables$find = tables.find(function (t) {
1608
1229
  return t.identifier === table;
1609
1230
  })) == null ? void 0 : _tables$find.schema;
1610
1231
  var fieldMeta = field ? schema == null ? void 0 : schema.fields.find(function (f) {
@@ -1675,7 +1296,7 @@ var cmsRowLinkMeta = {
1675
1296
  displayName: "Model",
1676
1297
  hidden: function hidden(props, ctx) {
1677
1298
  var _ctx$tables$length2, _ctx$tables2;
1678
- return ((_ctx$tables$length2 = ctx == null ? void 0 : (_ctx$tables2 = ctx.tables) == null ? void 0 : _ctx$tables2.length) != null ? _ctx$tables$length2 : 0) <= 1 && !props.table;
1299
+ return ((_ctx$tables$length2 = ctx == null || (_ctx$tables2 = ctx.tables) == null ? void 0 : _ctx$tables2.length) != null ? _ctx$tables$length2 : 0) <= 1 && !props.table;
1679
1300
  },
1680
1301
  helpText: "Pick model from a CMS Data Fetcher",
1681
1302
  description: "Usually not used! Only with multiple CMS Data Loaders, use this to choose which to show. Otherwise, go select the CMS Data Loader if you want to load different data.",
@@ -1697,7 +1318,7 @@ var cmsRowLinkMeta = {
1697
1318
  },
1698
1319
  defaultValueHint: function defaultValueHint(_, ctx) {
1699
1320
  var _ctx$fieldMeta3, _ctx$fieldMeta4;
1700
- return (ctx == null ? void 0 : (_ctx$fieldMeta3 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta3.name) || (ctx == null ? void 0 : (_ctx$fieldMeta4 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta4.identifier);
1321
+ return (ctx == null || (_ctx$fieldMeta3 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta3.name) || (ctx == null || (_ctx$fieldMeta4 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta4.identifier);
1701
1322
  }
1702
1323
  },
1703
1324
  hrefProp: {
@@ -1712,7 +1333,7 @@ var cmsRowLinkMeta = {
1712
1333
  description: "Prefix to prepend to prop value.",
1713
1334
  hidden: function hidden(_, ctx) {
1714
1335
  var _ctx$fieldMeta5;
1715
- return (ctx == null ? void 0 : (_ctx$fieldMeta5 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta5.type) === "file";
1336
+ return (ctx == null || (_ctx$fieldMeta5 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta5.type) === "file";
1716
1337
  }
1717
1338
  },
1718
1339
  suffix: {
@@ -1721,7 +1342,7 @@ var cmsRowLinkMeta = {
1721
1342
  description: "Suffix to append to prop value.",
1722
1343
  hidden: function hidden(_, ctx) {
1723
1344
  var _ctx$fieldMeta6;
1724
- return (ctx == null ? void 0 : (_ctx$fieldMeta6 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta6.type) === "file";
1345
+ return (ctx == null || (_ctx$fieldMeta6 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta6.type) === "file";
1725
1346
  }
1726
1347
  }
1727
1348
  }
@@ -1748,7 +1369,7 @@ function CmsRowLink(_ref11) {
1748
1369
  });
1749
1370
  if (tables) {
1750
1371
  // TODO: Only include table if __plasmic_cms_row_{table} exists.
1751
- setControlContextData == null ? void 0 : setControlContextData({
1372
+ setControlContextData == null || setControlContextData({
1752
1373
  tables: tables,
1753
1374
  table: res.table,
1754
1375
  row: res.row,
@@ -1789,7 +1410,7 @@ var cmsRowImageMeta = {
1789
1410
  displayName: "Model",
1790
1411
  hidden: function hidden(props, ctx) {
1791
1412
  var _ctx$tables$length3, _ctx$tables3;
1792
- return ((_ctx$tables$length3 = ctx == null ? void 0 : (_ctx$tables3 = ctx.tables) == null ? void 0 : _ctx$tables3.length) != null ? _ctx$tables$length3 : 0) <= 1 && !props.table;
1413
+ return ((_ctx$tables$length3 = ctx == null || (_ctx$tables3 = ctx.tables) == null ? void 0 : _ctx$tables3.length) != null ? _ctx$tables$length3 : 0) <= 1 && !props.table;
1793
1414
  },
1794
1415
  helpText: "Pick model from a CMS Data Fetcher",
1795
1416
  description: "Usually not used! Only with multiple CMS Data Loaders, use this to choose which to show. Otherwise, go select the CMS Data Loader if you want to load different data.",
@@ -1811,7 +1432,7 @@ var cmsRowImageMeta = {
1811
1432
  },
1812
1433
  defaultValueHint: function defaultValueHint(_, ctx) {
1813
1434
  var _ctx$fieldMeta7, _ctx$fieldMeta8;
1814
- return (ctx == null ? void 0 : (_ctx$fieldMeta7 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta7.name) || (ctx == null ? void 0 : (_ctx$fieldMeta8 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta8.identifier);
1435
+ return (ctx == null || (_ctx$fieldMeta7 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta7.name) || (ctx == null || (_ctx$fieldMeta8 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta8.identifier);
1815
1436
  }
1816
1437
  },
1817
1438
  srcProp: {
@@ -1842,7 +1463,7 @@ function CmsRowImage(_ref13) {
1842
1463
  });
1843
1464
  if (tables) {
1844
1465
  // TODO: Only include table if __plasmic_cms_row_{table} exists.
1845
- setControlContextData == null ? void 0 : setControlContextData({
1466
+ setControlContextData == null || setControlContextData({
1846
1467
  tables: tables,
1847
1468
  table: res.table,
1848
1469
  row: res.row,
@@ -1884,7 +1505,7 @@ var cmsRowFieldValueMeta = {
1884
1505
  displayName: "Model",
1885
1506
  hidden: function hidden(props, ctx) {
1886
1507
  var _ctx$tables$length4, _ctx$tables4;
1887
- return ((_ctx$tables$length4 = ctx == null ? void 0 : (_ctx$tables4 = ctx.tables) == null ? void 0 : _ctx$tables4.length) != null ? _ctx$tables$length4 : 0) <= 1 && !props.table;
1508
+ return ((_ctx$tables$length4 = ctx == null || (_ctx$tables4 = ctx.tables) == null ? void 0 : _ctx$tables4.length) != null ? _ctx$tables$length4 : 0) <= 1 && !props.table;
1888
1509
  },
1889
1510
  helpText: "Pick model from a CMS Data Fetcher",
1890
1511
  description: "Usually not used! Only with multiple CMS Data Loaders, use this to choose which to show. Otherwise, go select the CMS Data Loader if you want to load different data.",
@@ -1906,7 +1527,7 @@ var cmsRowFieldValueMeta = {
1906
1527
  },
1907
1528
  defaultValueHint: function defaultValueHint(_, ctx) {
1908
1529
  var _ctx$fieldMeta9, _ctx$fieldMeta10;
1909
- return (ctx == null ? void 0 : (_ctx$fieldMeta9 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta9.name) || (ctx == null ? void 0 : (_ctx$fieldMeta10 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta10.identifier);
1530
+ return (ctx == null || (_ctx$fieldMeta9 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta9.name) || (ctx == null || (_ctx$fieldMeta10 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta10.identifier);
1910
1531
  }
1911
1532
  },
1912
1533
  valueProp: {
@@ -1938,7 +1559,7 @@ function CmsRowFieldValue(_ref15) {
1938
1559
  });
1939
1560
  if (tables) {
1940
1561
  // TODO: Only include table if __plasmic_cms_row_{table} exists.
1941
- setControlContextData == null ? void 0 : setControlContextData({
1562
+ setControlContextData == null || setControlContextData({
1942
1563
  tables: tables,
1943
1564
  table: res.table,
1944
1565
  row: res.row,