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