@plasmicpkgs/plasmic-content-stack 0.0.115 → 0.0.117

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