@plasmicpkgs/plasmic-contentful 0.0.10 → 0.0.13

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.
@@ -951,7 +951,8 @@ function ContentfulFetcher(_ref2) {
951
951
  }
952
952
  }, _callee);
953
953
  }))),
954
- contentTypes = _usePlasmicQueryData.data;
954
+ contentTypes = _usePlasmicQueryData.data,
955
+ contentTypesError = _usePlasmicQueryData.error;
955
956
 
956
957
  var _usePlasmicQueryData2 = query.usePlasmicQueryData(cacheKey + "/entriesData", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
957
958
  var response;
@@ -985,7 +986,8 @@ function ContentfulFetcher(_ref2) {
985
986
  }
986
987
  }, _callee2);
987
988
  }))),
988
- entriesData = _usePlasmicQueryData2.data;
989
+ entriesData = _usePlasmicQueryData2.data,
990
+ entriesDataError = _usePlasmicQueryData2.error;
989
991
 
990
992
  var _usePlasmicQueryData3 = query.usePlasmicQueryData(cacheKey + "/entry", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
991
993
  var response;
@@ -1015,7 +1017,8 @@ function ContentfulFetcher(_ref2) {
1015
1017
  }
1016
1018
  }, _callee3);
1017
1019
  }))),
1018
- entryData = _usePlasmicQueryData3.data;
1020
+ entryData = _usePlasmicQueryData3.data,
1021
+ entryDataError = _usePlasmicQueryData3.error;
1019
1022
 
1020
1023
  setControlContextData == null ? void 0 : setControlContextData({
1021
1024
  types: contentTypes == null ? void 0 : contentTypes.items,
@@ -1026,6 +1029,22 @@ function ContentfulFetcher(_ref2) {
1026
1029
  return React__default.createElement("div", null, "Please specify a valid API Credentials: Space, Access Token and Environment");
1027
1030
  }
1028
1031
 
1032
+ if (contentTypesError || entriesDataError || entryDataError) {
1033
+ if (contentTypesError) {
1034
+ return React__default.createElement("div", {
1035
+ className: className
1036
+ }, "Error: ", contentTypesError.message);
1037
+ } else if (entriesDataError) {
1038
+ return React__default.createElement("div", {
1039
+ className: className
1040
+ }, "Error: ", entriesDataError.message);
1041
+ } else {
1042
+ return React__default.createElement("div", {
1043
+ className: className
1044
+ }, "Error: ", entriesDataError.message);
1045
+ }
1046
+ }
1047
+
1029
1048
  var renderedData;
1030
1049
 
1031
1050
  if (contentType && entryID) {
@@ -1034,9 +1053,15 @@ function ContentfulFetcher(_ref2) {
1034
1053
  data: entryData
1035
1054
  }, children);
1036
1055
  } else if (contentType) {
1037
- var _entriesData$items;
1056
+ var _entriesData$items, _entriesData$items2;
1057
+
1058
+ if ((entriesData == null ? void 0 : (_entriesData$items = entriesData.items) == null ? void 0 : _entriesData$items.length) === 0) {
1059
+ return React__default.createElement("div", {
1060
+ className: className
1061
+ }, contentType, " is empty");
1062
+ }
1038
1063
 
1039
- renderedData = entriesData == null ? void 0 : (_entriesData$items = entriesData.items) == null ? void 0 : _entriesData$items.map(function (item, index) {
1064
+ renderedData = entriesData == null ? void 0 : (_entriesData$items2 = entriesData.items) == null ? void 0 : _entriesData$items2.map(function (item, index) {
1040
1065
  var _item$sys;
1041
1066
 
1042
1067
  return React__default.createElement(host.DataProvider, {
@@ -1 +1 @@
1
- {"version":3,"file":"plasmic-contentful.cjs.development.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/contentful.tsx","../src/index.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","import { documentToHtmlString } from \"@contentful/rich-text-html-renderer\";\nimport {\n ComponentMeta,\n DataProvider,\n GlobalContextMeta,\n repeatedElement,\n useSelector,\n} from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\nimport * as Contentful from \"contentful\";\nimport L from \"lodash\";\nimport React, { ReactNode, useContext } from \"react\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-contentful\";\n\ninterface ContentfulCredentialsProviderProps {\n space: string;\n accessToken: string;\n environment?: string;\n}\n\nconst CredentialsContext = React.createContext<\n ContentfulCredentialsProviderProps | undefined\n>(undefined);\n\nexport const ContentfulCredentialsProviderMeta: GlobalContextMeta<ContentfulCredentialsProviderProps> = {\n name: \"Contentful CredentialsProvider\",\n displayName: \"Contentful Credentials Provider\",\n description:\n \"Any client requesting content from the CDA needs to provide an access token that has access to the environment you're requesting content from. Learn how to [get your API key](https://www.contentful.com/developers/docs/references/authentication/).\",\n importName: \"ContentfulCredentialsProvider\",\n importPath: modulePath,\n props: {\n space: {\n type: \"string\",\n displayName: \"Space\",\n description: \"Name of your space\",\n defaultValue: \"lmfbwqzbh93n\",\n },\n accessToken: {\n type: \"string\",\n displayName: \"Access Token \",\n description: \"Access Token\",\n defaultValue: \"aWvf6oSLTuqxKCxSUpokajdQr84hGQFE6zoJG7DVVLg\",\n },\n environment: {\n type: \"string\",\n displayName: \"Environment\",\n defaultValue: \"master\",\n },\n },\n};\n\nexport function ContentfulCredentialsProvider({\n accessToken,\n space,\n environment,\n children,\n}: React.PropsWithChildren<ContentfulCredentialsProviderProps>) {\n return (\n <CredentialsContext.Provider value={{ space, accessToken, environment }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface ContentfulFetcherProps {\n entryID?: string;\n contentType?: string;\n children?: ReactNode;\n className?: string;\n limit?: number;\n order?: string;\n noLayout?: boolean;\n setControlContextData?: (data: {\n types?: { name: string; id: string }[];\n entries?: { id: string }[];\n }) => void;\n}\n\nexport const ContentfulFetcherMeta: ComponentMeta<ContentfulFetcherProps> = {\n name: \"ContentfulFetcher\",\n displayName: \"Contentful Fetcher\",\n importName: \"ContentfulFetcher\",\n importPath: modulePath,\n providesData: true,\n description:\n \"Fetches Contentful data and repeats content of children once for every row fetched. \",\n defaultStyles: {\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr 1fr 1fr\",\n gridRowGap: \"8px\",\n gridColumnGap: \"8px\",\n padding: \"8px\",\n maxWidth: \"100%\",\n },\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n styles: {\n padding: \"8px\",\n },\n children: {\n type: \"component\",\n name: \"ContentfulField\",\n },\n },\n },\n contentType: {\n type: \"choice\",\n options: (props, ctx) =>\n ctx?.types?.map((type: any) => ({\n label: type?.name,\n value: type?.sys?.id,\n })) ?? [],\n displayName: \"Content type\",\n description: \"Content type to be queried.\",\n },\n entryID: {\n type: \"choice\",\n options: (props, ctx) =>\n ctx?.entries?.map((entry: any) => ({\n label: entry?.sys?.id,\n value: entry?.sys?.id,\n })) ?? [],\n displayName: \"Entry ID\",\n description: \"Query in Content Type.\",\n defaultValueHint: \"all\",\n },\n limit: {\n type: \"number\",\n displayName: \"Limit\",\n description: \"Limit the number of entries that are returned.\",\n defaultValue: 1000,\n },\n order: {\n type: \"string\",\n displayName: \"Order\",\n description: \"Order entries with a specific attribute.\",\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description:\n \"When set, Contentful Fetcher will not layout its children; instead, the layout set on its parent element will be used. Useful if you want to set flex gap or control container tag type.\",\n defaultValue: false,\n },\n },\n};\n\nexport function ContentfulFetcher({\n entryID,\n contentType,\n children,\n className,\n limit,\n noLayout,\n order,\n setControlContextData,\n}: ContentfulFetcherProps) {\n const creds = ensure(useContext(CredentialsContext));\n const cacheKey = JSON.stringify({\n creds,\n contentType,\n entryID,\n });\n const client = Contentful.createClient({\n space: creds.space,\n accessToken: creds.accessToken,\n });\n\n const { data: contentTypes } = usePlasmicQueryData<any | null>(\n `${cacheKey}/contentTypes`,\n async () => {\n const response = await client.getContentTypes();\n return response;\n }\n );\n\n const { data: entriesData } = usePlasmicQueryData<any | null>(\n `${cacheKey}/entriesData`,\n async () => {\n if (!contentType) {\n return undefined;\n }\n const response = await client.getEntries({\n content_type: `${contentType?.toString()}`,\n limit,\n order,\n });\n return response;\n }\n );\n\n const { data: entryData } = usePlasmicQueryData<any | null>(\n `${cacheKey}/entry`,\n async () => {\n if (!entryID) {\n return undefined;\n }\n const response = await client.getEntry(`${entryID}`);\n return response;\n }\n );\n\n setControlContextData?.({\n types: contentTypes?.items,\n entries: entriesData?.items,\n });\n\n if (!creds.space || !creds.accessToken) {\n return (\n <div>\n Please specify a valid API Credentials: Space, Access Token and\n Environment\n </div>\n );\n }\n\n let renderedData;\n if (contentType && entryID) {\n renderedData = (\n <DataProvider name={\"contentfulItem\"} data={entryData}>\n {children}\n </DataProvider>\n );\n } else if (contentType) {\n renderedData = entriesData?.items?.map((item: any, index: number) => (\n <DataProvider key={item?.sys?.id} name={\"contentfulItem\"} data={item}>\n {repeatedElement(index, children)}\n </DataProvider>\n ));\n } else {\n return <div> Please choose the Content Type</div>;\n }\n\n return noLayout ? (\n <> {renderedData} </>\n ) : (\n <div className={className}> {renderedData} </div>\n );\n}\n\ninterface ContentfulFieldProps {\n className?: string;\n objectPath?: (string | number)[];\n setControlContextData?: (data: { data: object }) => void;\n}\n\nexport const ContentfulFieldMeta: ComponentMeta<ContentfulFieldProps> = {\n name: \"ContentfulField\",\n displayName: \"Contentful Field\",\n importName: \"ContentfulField\",\n importPath: modulePath,\n props: {\n objectPath: {\n type: \"dataSelector\",\n data: (props, ctx) => ctx?.data ?? {},\n displayName: \"Field\",\n description: \"Field to be displayed.\",\n },\n },\n};\n\nexport function ContentfulField({\n className,\n objectPath,\n setControlContextData,\n}: ContentfulFieldProps) {\n const item = useSelector(\"contentfulItem\")?.fields;\n if (!item) {\n return <div>ContentfulField must be used within a ContentfulFetcher </div>;\n }\n setControlContextData?.({\n data: item,\n });\n if (!objectPath) {\n return <div>Please specify a valid path or select a field.</div>;\n }\n\n const data = L.get(item, objectPath);\n if (\n typeof data === \"object\" &&\n \"nodeType\" in data &&\n data.nodeType === \"document\"\n ) {\n return (\n <div\n className={className}\n dangerouslySetInnerHTML={{ __html: documentToHtmlString(data) }}\n />\n );\n } else if (\n typeof data === \"object\" &&\n \"contentType\" in data &&\n data.contentType.includes(\"image\")\n ) {\n return <img className={className} src={data.url} />;\n } else if (!data) {\n return <div>Please specify a valid field.</div>;\n } else if (typeof data !== \"object\") {\n return <div className={className}>{data}</div>;\n } else {\n return <div className={className}>{data.toString()}</div>;\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta,\n ContentfulFetcher,\n ContentfulFetcherMeta,\n ContentfulField,\n ContentfulFieldMeta,\n} from \"./contentful\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: ComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n if (loader) {\n loader.registerGlobalContext(\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta\n );\n } else {\n registerGlobalContext(\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta\n );\n }\n\n _registerComponent(ContentfulFetcher, ContentfulFetcherMeta);\n _registerComponent(ContentfulField, ContentfulFieldMeta);\n}\n\nexport * from \"./contentful\";\n"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","undefined","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","makeInvokeMethod","tryCatch","fn","arg","type","call","GenStateSuspendedStart","GenStateSuspendedYield","GenStateExecuting","GenStateCompleted","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","displayName","defineIteratorMethods","forEach","method","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","__await","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","then","unwrapped","error","previousPromise","enqueue","callInvokeWithMethodAndArg","async","Promise","iter","next","done","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","info","resultName","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","keys","object","reverse","length","pop","iterable","iteratorMethod","isNaN","i","skipTempReset","prev","charAt","slice","stop","rootEntry","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","ensure","x","modulePath","CredentialsContext","React","createContext","ContentfulCredentialsProviderMeta","description","importName","importPath","props","space","defaultValue","accessToken","environment","ContentfulCredentialsProvider","children","Provider","ContentfulFetcherMeta","providesData","defaultStyles","display","gridTemplateColumns","gridRowGap","gridColumnGap","padding","maxWidth","styles","contentType","options","ctx","types","map","label","sys","id","entryID","entries","defaultValueHint","limit","order","noLayout","ContentfulFetcher","className","setControlContextData","creds","useContext","cacheKey","JSON","stringify","client","Contentful","usePlasmicQueryData","getContentTypes","response","contentTypes","data","getEntries","content_type","toString","entriesData","getEntry","entryData","items","renderedData","DataProvider","item","index","repeatedElement","ContentfulFieldMeta","objectPath","ContentfulField","useSelector","fields","L","get","nodeType","dangerouslySetInnerHTML","__html","documentToHtmlString","includes","src","url","registerAll","loader","_registerComponent","Component","defaultMeta","registerComponent","registerGlobalContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAIA,OAAO,GAAI,UAAUC,OAAV,EAAmB;;AAGhC,QAAIC,EAAE,GAAGC,MAA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P;AACD,GAFM,MAEA,IAAI,OAAOoD,IAAP,KAAgB,QAApB,EAA8B;AACnC,WAAOpD,4BAAA,MAAA;AAAKuC,MAAAA,SAAS,EAAEA;KAAhB,EAA4Ba,IAA5B,CAAP;AACD,GAFM,MAEA;AACL,WAAOpD,4BAAA,MAAA;AAAKuC,MAAAA,SAAS,EAAEA;KAAhB,EAA4Ba,IAAI,CAACG,QAAL,EAA5B,CAAP;AACD;AACF;;SC/SewB,YAAYC;AAI1B,MAAMC,kBAAkB,GAAG,SAArBA,kBAAqB,CACzBC,SADyB,EAEzBC,WAFyB;AAIzB,QAAIH,MAAJ,EAAY;AACVA,MAAAA,MAAM,CAACI,iBAAP,CAAyBF,SAAzB,EAAoCC,WAApC;AACD,KAFD,MAEO;AACLC,MAAAA,iBAAiB,CAACF,SAAD,EAAYC,WAAZ,CAAjB;AACD;AACF,GATD;;AAWA,MAAIH,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACK,qBAAP,CACE1E,6BADF,EAEET,iCAFF;AAID,GALD,MAKO;AACLmF,IAAAA,qBAAqB,CACnB1E,6BADmB,EAEnBT,iCAFmB,CAArB;AAID;;AAED+E,EAAAA,kBAAkB,CAAC3C,iBAAD,EAAoBxB,qBAApB,CAAlB;;AACAmE,EAAAA,kBAAkB,CAACd,eAAD,EAAkBF,mBAAlB,CAAlB;AACD;;;;;;;;;;;"}
1
+ {"version":3,"file":"plasmic-contentful.cjs.development.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/contentful.tsx","../src/index.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","import { documentToHtmlString } from \"@contentful/rich-text-html-renderer\";\nimport {\n ComponentMeta,\n DataProvider,\n GlobalContextMeta,\n repeatedElement,\n useSelector,\n} from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\nimport * as Contentful from \"contentful\";\nimport L from \"lodash\";\nimport React, { ReactNode, useContext } from \"react\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-contentful\";\n\ninterface ContentfulCredentialsProviderProps {\n space: string;\n accessToken: string;\n environment?: string;\n}\n\nconst CredentialsContext = React.createContext<\n ContentfulCredentialsProviderProps | undefined\n>(undefined);\n\nexport const ContentfulCredentialsProviderMeta: GlobalContextMeta<ContentfulCredentialsProviderProps> = {\n name: \"Contentful CredentialsProvider\",\n displayName: \"Contentful Credentials Provider\",\n description:\n \"Any client requesting content from the CDA needs to provide an access token that has access to the environment you're requesting content from. Learn how to [get your API key](https://www.contentful.com/developers/docs/references/authentication/).\",\n importName: \"ContentfulCredentialsProvider\",\n importPath: modulePath,\n props: {\n space: {\n type: \"string\",\n displayName: \"Space\",\n description: \"Name of your space\",\n defaultValue: \"lmfbwqzbh93n\",\n },\n accessToken: {\n type: \"string\",\n displayName: \"Access Token \",\n description: \"Access Token\",\n defaultValue: \"aWvf6oSLTuqxKCxSUpokajdQr84hGQFE6zoJG7DVVLg\",\n },\n environment: {\n type: \"string\",\n displayName: \"Environment\",\n defaultValue: \"master\",\n },\n },\n};\n\nexport function ContentfulCredentialsProvider({\n accessToken,\n space,\n environment,\n children,\n}: React.PropsWithChildren<ContentfulCredentialsProviderProps>) {\n return (\n <CredentialsContext.Provider value={{ space, accessToken, environment }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface ContentfulFetcherProps {\n entryID?: string;\n contentType?: string;\n children?: ReactNode;\n className?: string;\n limit?: number;\n order?: string;\n noLayout?: boolean;\n setControlContextData?: (data: {\n types?: { name: string; id: string }[];\n entries?: { id: string }[];\n }) => void;\n}\n\nexport const ContentfulFetcherMeta: ComponentMeta<ContentfulFetcherProps> = {\n name: \"ContentfulFetcher\",\n displayName: \"Contentful Fetcher\",\n importName: \"ContentfulFetcher\",\n importPath: modulePath,\n providesData: true,\n description:\n \"Fetches Contentful data and repeats content of children once for every row fetched. \",\n defaultStyles: {\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr 1fr 1fr\",\n gridRowGap: \"8px\",\n gridColumnGap: \"8px\",\n padding: \"8px\",\n maxWidth: \"100%\",\n },\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n styles: {\n padding: \"8px\",\n },\n children: {\n type: \"component\",\n name: \"ContentfulField\",\n },\n },\n },\n contentType: {\n type: \"choice\",\n options: (props, ctx) =>\n ctx?.types?.map((type: any) => ({\n label: type?.name,\n value: type?.sys?.id,\n })) ?? [],\n displayName: \"Content type\",\n description: \"Content type to be queried.\",\n },\n entryID: {\n type: \"choice\",\n options: (props, ctx) =>\n ctx?.entries?.map((entry: any) => ({\n label: entry?.sys?.id,\n value: entry?.sys?.id,\n })) ?? [],\n displayName: \"Entry ID\",\n description: \"Query in Content Type.\",\n defaultValueHint: \"all\",\n },\n limit: {\n type: \"number\",\n displayName: \"Limit\",\n description: \"Limit the number of entries that are returned.\",\n defaultValue: 1000,\n },\n order: {\n type: \"string\",\n displayName: \"Order\",\n description: \"Order entries with a specific attribute.\",\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description:\n \"When set, Contentful Fetcher will not layout its children; instead, the layout set on its parent element will be used. Useful if you want to set flex gap or control container tag type.\",\n defaultValue: false,\n },\n },\n};\n\nexport function ContentfulFetcher({\n entryID,\n contentType,\n children,\n className,\n limit,\n noLayout,\n order,\n setControlContextData,\n}: ContentfulFetcherProps) {\n const creds = ensure(useContext(CredentialsContext));\n const cacheKey = JSON.stringify({\n creds,\n contentType,\n entryID,\n });\n const client = Contentful.createClient({\n space: creds.space,\n accessToken: creds.accessToken,\n });\n\n const { data: contentTypes, error: contentTypesError } = usePlasmicQueryData<\n any | null\n >(`${cacheKey}/contentTypes`, async () => {\n const response = await client.getContentTypes();\n return response;\n });\n\n const { data: entriesData, error: entriesDataError } = usePlasmicQueryData<\n any | null\n >(`${cacheKey}/entriesData`, async () => {\n if (!contentType) {\n return undefined;\n }\n const response = await client.getEntries({\n content_type: `${contentType?.toString()}`,\n limit,\n order,\n });\n return response;\n });\n\n const { data: entryData, error: entryDataError } = usePlasmicQueryData<\n any | null\n >(`${cacheKey}/entry`, async () => {\n if (!entryID) {\n return undefined;\n }\n const response = await client.getEntry(`${entryID}`);\n return response;\n });\n\n setControlContextData?.({\n types: contentTypes?.items,\n entries: entriesData?.items,\n });\n\n if (!creds.space || !creds.accessToken) {\n return (\n <div>\n Please specify a valid API Credentials: Space, Access Token and\n Environment\n </div>\n );\n }\n\n if (contentTypesError || entriesDataError || entryDataError) {\n if (contentTypesError) {\n return (\n <div className={className}>Error: {contentTypesError.message}</div>\n );\n } else if (entriesDataError) {\n return <div className={className}>Error: {entriesDataError.message}</div>;\n } else {\n return (\n <div className={className}>Error: {entriesDataError!.message}</div>\n );\n }\n }\n\n let renderedData;\n if (contentType && entryID) {\n renderedData = (\n <DataProvider name={\"contentfulItem\"} data={entryData}>\n {children}\n </DataProvider>\n );\n } else if (contentType) {\n if (entriesData?.items?.length === 0) {\n return <div className={className}>{contentType} is empty</div>;\n }\n renderedData = entriesData?.items?.map((item: any, index: number) => (\n <DataProvider key={item?.sys?.id} name={\"contentfulItem\"} data={item}>\n {repeatedElement(index, children)}\n </DataProvider>\n ));\n } else {\n return <div> Please choose the Content Type</div>;\n }\n\n return noLayout ? (\n <> {renderedData} </>\n ) : (\n <div className={className}> {renderedData} </div>\n );\n}\n\ninterface ContentfulFieldProps {\n className?: string;\n objectPath?: (string | number)[];\n setControlContextData?: (data: { data: object }) => void;\n}\n\nexport const ContentfulFieldMeta: ComponentMeta<ContentfulFieldProps> = {\n name: \"ContentfulField\",\n displayName: \"Contentful Field\",\n importName: \"ContentfulField\",\n importPath: modulePath,\n props: {\n objectPath: {\n type: \"dataSelector\",\n data: (props, ctx) => ctx?.data ?? {},\n displayName: \"Field\",\n description: \"Field to be displayed.\",\n },\n },\n};\n\nexport function ContentfulField({\n className,\n objectPath,\n setControlContextData,\n}: ContentfulFieldProps) {\n const item = useSelector(\"contentfulItem\")?.fields;\n if (!item) {\n return <div>ContentfulField must be used within a ContentfulFetcher </div>;\n }\n setControlContextData?.({\n data: item,\n });\n if (!objectPath) {\n return <div>Please specify a valid path or select a field.</div>;\n }\n\n const data = L.get(item, objectPath);\n if (\n typeof data === \"object\" &&\n \"nodeType\" in data &&\n data.nodeType === \"document\"\n ) {\n return (\n <div\n className={className}\n dangerouslySetInnerHTML={{ __html: documentToHtmlString(data) }}\n />\n );\n } else if (\n typeof data === \"object\" &&\n \"contentType\" in data &&\n data.contentType.includes(\"image\")\n ) {\n return <img className={className} src={data.url} />;\n } else if (!data) {\n return <div>Please specify a valid field.</div>;\n } else if (typeof data !== \"object\") {\n return <div className={className}>{data}</div>;\n } else {\n return <div className={className}>{data.toString()}</div>;\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta,\n ContentfulFetcher,\n ContentfulFetcherMeta,\n ContentfulField,\n ContentfulFieldMeta,\n} from \"./contentful\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: ComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n if (loader) {\n loader.registerGlobalContext(\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta\n );\n } else {\n registerGlobalContext(\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta\n );\n }\n\n _registerComponent(ContentfulFetcher, ContentfulFetcherMeta);\n _registerComponent(ContentfulField, ContentfulFieldMeta);\n}\n\nexport * from \"./contentful\";\n"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","undefined","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","makeInvokeMethod","tryCatch","fn","arg","type","call","GenStateSuspendedStart","GenStateSuspendedYield","GenStateExecuting","GenStateCompleted","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","displayName","defineIteratorMethods","forEach","method","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","__await","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","then","unwrapped","error","previousPromise","enqueue","callInvokeWithMethodAndArg","async","Promise","iter","next","done","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","info","resultName","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","keys","object","reverse","length","pop","iterable","iteratorMethod","isNaN","i","skipTempReset","prev","charAt","slice","stop","rootEntry","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","ensure","x","modulePath","CredentialsContext","React","createContext","ContentfulCredentialsProviderMeta","description","importName","importPath","props","space","defaultValue","accessToken","environment","ContentfulCredentialsProvider","children","Provider","ContentfulFetcherMeta","providesData","defaultStyles","display","gridTemplateColumns","gridRowGap","gridColumnGap","padding","maxWidth","styles","contentType","options","ctx","types","map","label","sys","id","entryID","entries","defaultValueHint","limit","order","noLayout","ContentfulFetcher","className","setControlContextData","creds","useContext","cacheKey","JSON","stringify","client","Contentful","usePlasmicQueryData","getContentTypes","response","contentTypes","data","contentTypesError","getEntries","content_type","toString","entriesData","entriesDataError","getEntry","entryData","entryDataError","items","message","renderedData","DataProvider","item","index","repeatedElement","ContentfulFieldMeta","objectPath","ContentfulField","useSelector","fields","L","get","nodeType","dangerouslySetInnerHTML","__html","documentToHtmlString","includes","src","url","registerAll","loader","_registerComponent","Component","defaultMeta","registerComponent","registerGlobalContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAIA,OAAO,GAAI,UAAUC,OAAV,EAAmB;;AAGhC,QAAIC,EAAE,GAAGC,MAAM,CAACC,SAAhB;AACA,QAAIC,MAAM,GAAGH,EAAE,CAACI,cAAhB;AACA,QAAIC,WAAJ,CALgC;;AAMhC,QAAIC,OAAO,GAAG,OAAOC,MAAP,KAAkB,UAAlB,GAA+BA,MAA/B,GAAwC,EAAtD;AACA,QAAIC,cAAc,GAAGF,OAAO,CAACG,QAAR,IAAoB,YAAzC;AACA,QAAIC,mBAAmB,GAAGJ,OAAO,CAACK,aAAR,IAAyB,iBAAnD;AACA,QAAIC,iBAAiB,GAAGN,OAAO,CAACO,WAAR,IAAuB,eAA/C;;AAEA,aAASC,MAAT,CAAgBC,GAAhB,EAAqBC,GAArB,EAA0BC,KAA1B,EAAiC;AAC/BhB,MAAAA,MAAM,CAACiB,cAAP,CAAsBH,GAAtB,EAA2BC,GAA3B,EAAgC;AAC9BC,QAAAA,KAAK,EAAEA,KADuB;AAE9BE,QAAAA,UAAU,EAAE,IAFkB;AAG9BC,QAAAA,YAAY,EAAE,IAHgB;AAI9BC,QAAAA,QAAQ,EAAE;AAJoB,OAAhC;AAMA,aAAON,GAAG,CAACC,GAAD,CAAV;AACD;;AACD,QAAI;;AAEFF,MAAAA,MAAM,CAAC,EAAD,EAAK,EAAL,CAAN;AACD,KAHD,CAGE,OAAOQ,GAAP,EAAY;AACZR,MAAAA,MAAM,GAAG,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I,OAAOoD,IAAP,KAAgB,QAApB,EAA8B;AACnC,WAAOpD,4BAAA,MAAA;AAAKuC,MAAAA,SAAS,EAAEA;KAAhB,EAA4Ba,IAA5B,CAAP;AACD,GAFM,MAEA;AACL,WAAOpD,4BAAA,MAAA;AAAKuC,MAAAA,SAAS,EAAEA;KAAhB,EAA4Ba,IAAI,CAACI,QAAL,EAA5B,CAAP;AACD;AACF;;SC7Te2B,YAAYC;AAI1B,MAAMC,kBAAkB,GAAG,SAArBA,kBAAqB,CACzBC,SADyB,EAEzBC,WAFyB;AAIzB,QAAIH,MAAJ,EAAY;AACVA,MAAAA,MAAM,CAACI,iBAAP,CAAyBF,SAAzB,EAAoCC,WAApC;AACD,KAFD,MAEO;AACLC,MAAAA,iBAAiB,CAACF,SAAD,EAAYC,WAAZ,CAAjB;AACD;AACF,GATD;;AAWA,MAAIH,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACK,qBAAP,CACE9E,6BADF,EAEET,iCAFF;AAID,GALD,MAKO;AACLuF,IAAAA,qBAAqB,CACnB9E,6BADmB,EAEnBT,iCAFmB,CAArB;AAID;;AAEDmF,EAAAA,kBAAkB,CAAC/C,iBAAD,EAAoBxB,qBAApB,CAAlB;;AACAuE,EAAAA,kBAAkB,CAACd,eAAD,EAAkBF,mBAAlB,CAAlB;AACD;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@plasmicapp/host/registerComponent")),r=e(require("@plasmicapp/host/registerGlobalContext")),n=require("@contentful/rich-text-html-renderer"),o=require("@plasmicapp/host"),i=require("@plasmicapp/query"),a=require("contentful"),l=e(require("lodash")),u=require("react"),c=e(u);function s(e,t,r,n,o,i,a){try{var l=e[i](a),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).then(n,o)}function p(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){s(i,n,o,a,l,"next",e)}function l(e){s(i,n,o,a,l,"throw",e)}a(void 0)}))}}function f(e,t){return e(t={exports:{}},t.exports),t.exports}var d=f((function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var o=Object.create((t&&t.prototype instanceof p?t:p).prototype),i=new E(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var l=x(a,r);if(l){if(l===s)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=c(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,i),o}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var s={};function p(){}function f(){}function d(){}var h={};l(h,o,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(L([])));m&&m!==t&&r.call(m,o)&&(h=m);var v=d.prototype=p.prototype=Object.create(h);function g(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var n;this._invoke=function(o,i){function a(){return new t((function(n,a){!function n(o,i,a,l){var u=c(e[o],e,i);if("throw"!==u.type){var s=u.arg,p=s.value;return p&&"object"==typeof p&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,a,l)}),(function(e){n("throw",e,a,l)})):t.resolve(p).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,l)}))}l(u.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function x(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return s;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,s;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,s):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function b(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:N}}function N(){return{value:void 0,done:!0}}return f.prototype=d,l(v,"constructor",d),l(d,"constructor",f),f.displayName=l(d,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,l(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},g(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(v),l(v,a,"Generator"),l(v,o,(function(){return this})),l(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=L,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),s},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),s}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}));function h(e){if(null==e)throw new Error("Value must not be undefined or null");return e}var y="@plasmicpkgs/plasmic-contentful",m=c.createContext(void 0),v={name:"Contentful CredentialsProvider",displayName:"Contentful Credentials Provider",description:"Any client requesting content from the CDA needs to provide an access token that has access to the environment you're requesting content from. Learn how to [get your API key](https://www.contentful.com/developers/docs/references/authentication/).",importName:"ContentfulCredentialsProvider",importPath:y,props:{space:{type:"string",displayName:"Space",description:"Name of your space",defaultValue:"lmfbwqzbh93n"},accessToken:{type:"string",displayName:"Access Token ",description:"Access Token",defaultValue:"aWvf6oSLTuqxKCxSUpokajdQr84hGQFE6zoJG7DVVLg"},environment:{type:"string",displayName:"Environment",defaultValue:"master"}}};function g(e){return c.createElement(m.Provider,{value:{space:e.space,accessToken:e.accessToken,environment:e.environment}},e.children)}var w={name:"ContentfulFetcher",displayName:"Contentful Fetcher",importName:"ContentfulFetcher",importPath:y,providesData:!0,description:"Fetches Contentful data and repeats content of children once for every row fetched. ",defaultStyles:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr 1fr",gridRowGap:"8px",gridColumnGap:"8px",padding:"8px",maxWidth:"100%"},props:{children:{type:"slot",defaultValue:{type:"vbox",styles:{padding:"8px"},children:{type:"component",name:"ContentfulField"}}},contentType:{type:"choice",options:function(e,t){var r,n;return null!=(r=null==t||null==(n=t.types)?void 0:n.map((function(e){var t;return{label:null==e?void 0:e.name,value:null==e||null==(t=e.sys)?void 0:t.id}})))?r:[]},displayName:"Content type",description:"Content type to be queried."},entryID:{type:"choice",options:function(e,t){var r,n;return null!=(r=null==t||null==(n=t.entries)?void 0:n.map((function(e){var t,r;return{label:null==e||null==(t=e.sys)?void 0:t.id,value:null==e||null==(r=e.sys)?void 0:r.id}})))?r:[]},displayName:"Entry ID",description:"Query in Content Type.",defaultValueHint:"all"},limit:{type:"number",displayName:"Limit",description:"Limit the number of entries that are returned.",defaultValue:1e3},order:{type:"string",displayName:"Order",description:"Order entries with a specific attribute."},noLayout:{type:"boolean",displayName:"No layout",description:"When set, Contentful Fetcher will not layout its children; instead, the layout set on its parent element will be used. Useful if you want to set flex gap or control container tag type.",defaultValue:!1}}};function x(e){var t,r=e.entryID,n=e.contentType,l=e.children,s=e.className,f=e.limit,y=e.noLayout,v=e.order,g=e.setControlContextData,w=h(u.useContext(m)),x=JSON.stringify({creds:w,contentType:n,entryID:r}),b=a.createClient({space:w.space,accessToken:w.accessToken}),C=i.usePlasmicQueryData(x+"/contentTypes",p(d.mark((function e(){return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.getContentTypes();case 2:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})))).data,E=i.usePlasmicQueryData(x+"/entriesData",p(d.mark((function e(){return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return",void 0);case 2:return e.next=4,b.getEntries({content_type:""+(null==n?void 0:n.toString()),limit:f,order:v});case 4:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).data,L=i.usePlasmicQueryData(x+"/entry",p(d.mark((function e(){return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",void 0);case 2:return e.next=4,b.getEntry(""+r);case 4:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).data;if(null==g||g({types:null==C?void 0:C.items,entries:null==E?void 0:E.items}),!w.space||!w.accessToken)return c.createElement("div",null,"Please specify a valid API Credentials: Space, Access Token and Environment");if(n&&r)t=c.createElement(o.DataProvider,{name:"contentfulItem",data:L},l);else{if(!n)return c.createElement("div",null," Please choose the Content Type");var N;t=null==E||null==(N=E.items)?void 0:N.map((function(e,t){var r;return c.createElement(o.DataProvider,{key:null==e||null==(r=e.sys)?void 0:r.id,name:"contentfulItem",data:e},o.repeatedElement(t,l))}))}return y?c.createElement(c.Fragment,null," ",t," "):c.createElement("div",{className:s}," ",t," ")}var b={name:"ContentfulField",displayName:"Contentful Field",importName:"ContentfulField",importPath:y,props:{objectPath:{type:"dataSelector",data:function(e,t){var r;return null!=(r=null==t?void 0:t.data)?r:{}},displayName:"Field",description:"Field to be displayed."}}};function C(e){var t,r=e.className,i=e.objectPath,a=e.setControlContextData,u=null==(t=o.useSelector("contentfulItem"))?void 0:t.fields;if(!u)return c.createElement("div",null,"ContentfulField must be used within a ContentfulFetcher ");if(null==a||a({data:u}),!i)return c.createElement("div",null,"Please specify a valid path or select a field.");var s=l.get(u,i);return"object"==typeof s&&"nodeType"in s&&"document"===s.nodeType?c.createElement("div",{className:r,dangerouslySetInnerHTML:{__html:n.documentToHtmlString(s)}}):"object"==typeof s&&"contentType"in s&&s.contentType.includes("image")?c.createElement("img",{className:r,src:s.url}):s?c.createElement("div",{className:r},"object"!=typeof s?s:s.toString()):c.createElement("div",null,"Please specify a valid field.")}exports.ContentfulCredentialsProvider=g,exports.ContentfulCredentialsProviderMeta=v,exports.ContentfulFetcher=x,exports.ContentfulFetcherMeta=w,exports.ContentfulField=C,exports.ContentfulFieldMeta=b,exports.ensure=h,exports.registerAll=function(e){var n=function(r,n){e?e.registerComponent(r,n):t(r,n)};e?e.registerGlobalContext(g,v):r(g,v),n(x,w),n(C,b)};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@plasmicapp/host/registerComponent")),r=e(require("@plasmicapp/host/registerGlobalContext")),n=require("@contentful/rich-text-html-renderer"),o=require("@plasmicapp/host"),i=require("@plasmicapp/query"),a=require("contentful"),l=e(require("lodash")),u=require("react"),c=e(u);function s(e,t,r,n,o,i,a){try{var l=e[i](a),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).then(n,o)}function p(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){s(i,n,o,a,l,"next",e)}function l(e){s(i,n,o,a,l,"throw",e)}a(void 0)}))}}function f(e,t){return e(t={exports:{}},t.exports),t.exports}var d=f((function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var o=Object.create((t&&t.prototype instanceof p?t:p).prototype),i=new E(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var l=x(a,r);if(l){if(l===s)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=c(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,i),o}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var s={};function p(){}function f(){}function d(){}var h={};l(h,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(L([])));y&&y!==t&&r.call(y,o)&&(h=y);var v=d.prototype=p.prototype=Object.create(h);function g(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var n;this._invoke=function(o,i){function a(){return new t((function(n,a){!function n(o,i,a,l){var u=c(e[o],e,i);if("throw"!==u.type){var s=u.arg,p=s.value;return p&&"object"==typeof p&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,a,l)}),(function(e){n("throw",e,a,l)})):t.resolve(p).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,l)}))}l(u.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function x(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return s;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,s;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,s):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function b(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:N}}function N(){return{value:void 0,done:!0}}return f.prototype=d,l(v,"constructor",d),l(d,"constructor",f),f.displayName=l(d,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,l(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},g(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(v),l(v,a,"Generator"),l(v,o,(function(){return this})),l(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=L,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),s},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),s}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}));function h(e){if(null==e)throw new Error("Value must not be undefined or null");return e}var m="@plasmicpkgs/plasmic-contentful",y=c.createContext(void 0),v={name:"Contentful CredentialsProvider",displayName:"Contentful Credentials Provider",description:"Any client requesting content from the CDA needs to provide an access token that has access to the environment you're requesting content from. Learn how to [get your API key](https://www.contentful.com/developers/docs/references/authentication/).",importName:"ContentfulCredentialsProvider",importPath:m,props:{space:{type:"string",displayName:"Space",description:"Name of your space",defaultValue:"lmfbwqzbh93n"},accessToken:{type:"string",displayName:"Access Token ",description:"Access Token",defaultValue:"aWvf6oSLTuqxKCxSUpokajdQr84hGQFE6zoJG7DVVLg"},environment:{type:"string",displayName:"Environment",defaultValue:"master"}}};function g(e){return c.createElement(y.Provider,{value:{space:e.space,accessToken:e.accessToken,environment:e.environment}},e.children)}var w={name:"ContentfulFetcher",displayName:"Contentful Fetcher",importName:"ContentfulFetcher",importPath:m,providesData:!0,description:"Fetches Contentful data and repeats content of children once for every row fetched. ",defaultStyles:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr 1fr",gridRowGap:"8px",gridColumnGap:"8px",padding:"8px",maxWidth:"100%"},props:{children:{type:"slot",defaultValue:{type:"vbox",styles:{padding:"8px"},children:{type:"component",name:"ContentfulField"}}},contentType:{type:"choice",options:function(e,t){var r,n;return null!=(r=null==t||null==(n=t.types)?void 0:n.map((function(e){var t;return{label:null==e?void 0:e.name,value:null==e||null==(t=e.sys)?void 0:t.id}})))?r:[]},displayName:"Content type",description:"Content type to be queried."},entryID:{type:"choice",options:function(e,t){var r,n;return null!=(r=null==t||null==(n=t.entries)?void 0:n.map((function(e){var t,r;return{label:null==e||null==(t=e.sys)?void 0:t.id,value:null==e||null==(r=e.sys)?void 0:r.id}})))?r:[]},displayName:"Entry ID",description:"Query in Content Type.",defaultValueHint:"all"},limit:{type:"number",displayName:"Limit",description:"Limit the number of entries that are returned.",defaultValue:1e3},order:{type:"string",displayName:"Order",description:"Order entries with a specific attribute."},noLayout:{type:"boolean",displayName:"No layout",description:"When set, Contentful Fetcher will not layout its children; instead, the layout set on its parent element will be used. Useful if you want to set flex gap or control container tag type.",defaultValue:!1}}};function x(e){var t,r=e.entryID,n=e.contentType,l=e.children,s=e.className,f=e.limit,m=e.noLayout,v=e.order,g=e.setControlContextData,w=h(u.useContext(y)),x=JSON.stringify({creds:w,contentType:n,entryID:r}),b=a.createClient({space:w.space,accessToken:w.accessToken}),C=i.usePlasmicQueryData(x+"/contentTypes",p(d.mark((function e(){return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.getContentTypes();case 2:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})))),E=C.data,L=C.error,N=i.usePlasmicQueryData(x+"/entriesData",p(d.mark((function e(){return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return",void 0);case 2:return e.next=4,b.getEntries({content_type:""+(null==n?void 0:n.toString()),limit:f,order:v});case 4:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))),P=N.data,T=N.error,k=i.usePlasmicQueryData(x+"/entry",p(d.mark((function e(){return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",void 0);case 2:return e.next=4,b.getEntry(""+r);case 4:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))),F=k.data,j=k.error;if(null==g||g({types:null==E?void 0:E.items,entries:null==P?void 0:P.items}),!w.space||!w.accessToken)return c.createElement("div",null,"Please specify a valid API Credentials: Space, Access Token and Environment");if(L||T||j)return c.createElement("div",{className:s},"Error: ",L?L.message:T.message);if(n&&r)t=c.createElement(o.DataProvider,{name:"contentfulItem",data:F},l);else{if(!n)return c.createElement("div",null," Please choose the Content Type");var _,S;if(0===(null==P||null==(_=P.items)?void 0:_.length))return c.createElement("div",{className:s},n," is empty");t=null==P||null==(S=P.items)?void 0:S.map((function(e,t){var r;return c.createElement(o.DataProvider,{key:null==e||null==(r=e.sys)?void 0:r.id,name:"contentfulItem",data:e},o.repeatedElement(t,l))}))}return m?c.createElement(c.Fragment,null," ",t," "):c.createElement("div",{className:s}," ",t," ")}var b={name:"ContentfulField",displayName:"Contentful Field",importName:"ContentfulField",importPath:m,props:{objectPath:{type:"dataSelector",data:function(e,t){var r;return null!=(r=null==t?void 0:t.data)?r:{}},displayName:"Field",description:"Field to be displayed."}}};function C(e){var t,r=e.className,i=e.objectPath,a=e.setControlContextData,u=null==(t=o.useSelector("contentfulItem"))?void 0:t.fields;if(!u)return c.createElement("div",null,"ContentfulField must be used within a ContentfulFetcher ");if(null==a||a({data:u}),!i)return c.createElement("div",null,"Please specify a valid path or select a field.");var s=l.get(u,i);return"object"==typeof s&&"nodeType"in s&&"document"===s.nodeType?c.createElement("div",{className:r,dangerouslySetInnerHTML:{__html:n.documentToHtmlString(s)}}):"object"==typeof s&&"contentType"in s&&s.contentType.includes("image")?c.createElement("img",{className:r,src:s.url}):s?c.createElement("div",{className:r},"object"!=typeof s?s:s.toString()):c.createElement("div",null,"Please specify a valid field.")}exports.ContentfulCredentialsProvider=g,exports.ContentfulCredentialsProviderMeta=v,exports.ContentfulFetcher=x,exports.ContentfulFetcherMeta=w,exports.ContentfulField=C,exports.ContentfulFieldMeta=b,exports.ensure=h,exports.registerAll=function(e){var n=function(r,n){e?e.registerComponent(r,n):t(r,n)};e?e.registerGlobalContext(g,v):r(g,v),n(x,w),n(C,b)};
2
2
  //# sourceMappingURL=plasmic-contentful.cjs.production.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plasmic-contentful.cjs.production.min.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/contentful.tsx","../src/index.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","import { documentToHtmlString } from \"@contentful/rich-text-html-renderer\";\nimport {\n ComponentMeta,\n DataProvider,\n GlobalContextMeta,\n repeatedElement,\n useSelector,\n} from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\nimport * as Contentful from \"contentful\";\nimport L from \"lodash\";\nimport React, { ReactNode, useContext } from \"react\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-contentful\";\n\ninterface ContentfulCredentialsProviderProps {\n space: string;\n accessToken: string;\n environment?: string;\n}\n\nconst CredentialsContext = React.createContext<\n ContentfulCredentialsProviderProps | undefined\n>(undefined);\n\nexport const ContentfulCredentialsProviderMeta: GlobalContextMeta<ContentfulCredentialsProviderProps> = {\n name: \"Contentful CredentialsProvider\",\n displayName: \"Contentful Credentials Provider\",\n description:\n \"Any client requesting content from the CDA needs to provide an access token that has access to the environment you're requesting content from. Learn how to [get your API key](https://www.contentful.com/developers/docs/references/authentication/).\",\n importName: \"ContentfulCredentialsProvider\",\n importPath: modulePath,\n props: {\n space: {\n type: \"string\",\n displayName: \"Space\",\n description: \"Name of your space\",\n defaultValue: \"lmfbwqzbh93n\",\n },\n accessToken: {\n type: \"string\",\n displayName: \"Access Token \",\n description: \"Access Token\",\n defaultValue: \"aWvf6oSLTuqxKCxSUpokajdQr84hGQFE6zoJG7DVVLg\",\n },\n environment: {\n type: \"string\",\n displayName: \"Environment\",\n defaultValue: \"master\",\n },\n },\n};\n\nexport function ContentfulCredentialsProvider({\n accessToken,\n space,\n environment,\n children,\n}: React.PropsWithChildren<ContentfulCredentialsProviderProps>) {\n return (\n <CredentialsContext.Provider value={{ space, accessToken, environment }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface ContentfulFetcherProps {\n entryID?: string;\n contentType?: string;\n children?: ReactNode;\n className?: string;\n limit?: number;\n order?: string;\n noLayout?: boolean;\n setControlContextData?: (data: {\n types?: { name: string; id: string }[];\n entries?: { id: string }[];\n }) => void;\n}\n\nexport const ContentfulFetcherMeta: ComponentMeta<ContentfulFetcherProps> = {\n name: \"ContentfulFetcher\",\n displayName: \"Contentful Fetcher\",\n importName: \"ContentfulFetcher\",\n importPath: modulePath,\n providesData: true,\n description:\n \"Fetches Contentful data and repeats content of children once for every row fetched. \",\n defaultStyles: {\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr 1fr 1fr\",\n gridRowGap: \"8px\",\n gridColumnGap: \"8px\",\n padding: \"8px\",\n maxWidth: \"100%\",\n },\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n styles: {\n padding: \"8px\",\n },\n children: {\n type: \"component\",\n name: \"ContentfulField\",\n },\n },\n },\n contentType: {\n type: \"choice\",\n options: (props, ctx) =>\n ctx?.types?.map((type: any) => ({\n label: type?.name,\n value: type?.sys?.id,\n })) ?? [],\n displayName: \"Content type\",\n description: \"Content type to be queried.\",\n },\n entryID: {\n type: \"choice\",\n options: (props, ctx) =>\n ctx?.entries?.map((entry: any) => ({\n label: entry?.sys?.id,\n value: entry?.sys?.id,\n })) ?? [],\n displayName: \"Entry ID\",\n description: \"Query in Content Type.\",\n defaultValueHint: \"all\",\n },\n limit: {\n type: \"number\",\n displayName: \"Limit\",\n description: \"Limit the number of entries that are returned.\",\n defaultValue: 1000,\n },\n order: {\n type: \"string\",\n displayName: \"Order\",\n description: \"Order entries with a specific attribute.\",\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description:\n \"When set, Contentful Fetcher will not layout its children; instead, the layout set on its parent element will be used. Useful if you want to set flex gap or control container tag type.\",\n defaultValue: false,\n },\n },\n};\n\nexport function ContentfulFetcher({\n entryID,\n contentType,\n children,\n className,\n limit,\n noLayout,\n order,\n setControlContextData,\n}: ContentfulFetcherProps) {\n const creds = ensure(useContext(CredentialsContext));\n const cacheKey = JSON.stringify({\n creds,\n contentType,\n entryID,\n });\n const client = Contentful.createClient({\n space: creds.space,\n accessToken: creds.accessToken,\n });\n\n const { data: contentTypes } = usePlasmicQueryData<any | null>(\n `${cacheKey}/contentTypes`,\n async () => {\n const response = await client.getContentTypes();\n return response;\n }\n );\n\n const { data: entriesData } = usePlasmicQueryData<any | null>(\n `${cacheKey}/entriesData`,\n async () => {\n if (!contentType) {\n return undefined;\n }\n const response = await client.getEntries({\n content_type: `${contentType?.toString()}`,\n limit,\n order,\n });\n return response;\n }\n );\n\n const { data: entryData } = usePlasmicQueryData<any | null>(\n `${cacheKey}/entry`,\n async () => {\n if (!entryID) {\n return undefined;\n }\n const response = await client.getEntry(`${entryID}`);\n return response;\n }\n );\n\n setControlContextData?.({\n types: contentTypes?.items,\n entries: entriesData?.items,\n });\n\n if (!creds.space || !creds.accessToken) {\n return (\n <div>\n Please specify a valid API Credentials: Space, Access Token and\n Environment\n </div>\n );\n }\n\n let renderedData;\n if (contentType && entryID) {\n renderedData = (\n <DataProvider name={\"contentfulItem\"} data={entryData}>\n {children}\n </DataProvider>\n );\n } else if (contentType) {\n renderedData = entriesData?.items?.map((item: any, index: number) => (\n <DataProvider key={item?.sys?.id} name={\"contentfulItem\"} data={item}>\n {repeatedElement(index, children)}\n </DataProvider>\n ));\n } else {\n return <div> Please choose the Content Type</div>;\n }\n\n return noLayout ? (\n <> {renderedData} </>\n ) : (\n <div className={className}> {renderedData} </div>\n );\n}\n\ninterface ContentfulFieldProps {\n className?: string;\n objectPath?: (string | number)[];\n setControlContextData?: (data: { data: object }) => void;\n}\n\nexport const ContentfulFieldMeta: ComponentMeta<ContentfulFieldProps> = {\n name: \"ContentfulField\",\n displayName: \"Contentful Field\",\n importName: \"ContentfulField\",\n importPath: modulePath,\n props: {\n objectPath: {\n type: \"dataSelector\",\n data: (props, ctx) => ctx?.data ?? {},\n displayName: \"Field\",\n description: \"Field to be displayed.\",\n },\n },\n};\n\nexport function ContentfulField({\n className,\n objectPath,\n setControlContextData,\n}: ContentfulFieldProps) {\n const item = useSelector(\"contentfulItem\")?.fields;\n if (!item) {\n return <div>ContentfulField must be used within a ContentfulFetcher </div>;\n }\n setControlContextData?.({\n data: item,\n });\n if (!objectPath) {\n return <div>Please specify a valid path or select a field.</div>;\n }\n\n const data = L.get(item, objectPath);\n if (\n typeof data === \"object\" &&\n \"nodeType\" in data &&\n data.nodeType === \"document\"\n ) {\n return (\n <div\n className={className}\n dangerouslySetInnerHTML={{ __html: documentToHtmlString(data) }}\n />\n );\n } else if (\n typeof data === \"object\" &&\n \"contentType\" in data &&\n data.contentType.includes(\"image\")\n ) {\n return <img className={className} src={data.url} />;\n } else if (!data) {\n return <div>Please specify a valid field.</div>;\n } else if (typeof data !== \"object\") {\n return <div className={className}>{data}</div>;\n } else {\n return <div className={className}>{data.toString()}</div>;\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta,\n ContentfulFetcher,\n ContentfulFetcherMeta,\n ContentfulField,\n ContentfulFieldMeta,\n} from \"./contentful\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: ComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n if (loader) {\n loader.registerGlobalContext(\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta\n );\n } else {\n registerGlobalContext(\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta\n );\n }\n\n _registerComponent(ContentfulFetcher, ContentfulFetcherMeta);\n _registerComponent(ContentfulField, ContentfulFieldMeta);\n}\n\nexport * from \"./contentful\";\n"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","generator","create","Generator","context","Context","_invoke","state","method","arg","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","ensure","x","modulePath","CredentialsContext","React","createContext","ContentfulCredentialsProviderMeta","description","importName","importPath","props","space","defaultValue","accessToken","environment","ContentfulCredentialsProvider","Provider","children","ContentfulFetcherMeta","providesData","defaultStyles","display","gridTemplateColumns","gridRowGap","gridColumnGap","padding","maxWidth","styles","contentType","options","ctx","types","_ctx$types","map","label","sys","_type$sys","id","entryID","entries","_ctx$entries","_entry$sys","_entry$sys2","defaultValueHint","limit","order","noLayout","ContentfulFetcher","renderedData","className","setControlContextData","creds","useContext","cacheKey","JSON","stringify","client","Contentful","contentTypes","usePlasmicQueryData","getContentTypes","data","entriesData","getEntries","content_type","toString","entryData","getEntry","items","DataProvider","_entriesData$items","item","index","_item$sys","repeatedElement","ContentfulFieldMeta","objectPath","ContentfulField","useSelector","_useSelector","fields","L","get","nodeType","dangerouslySetInnerHTML","__html","documentToHtmlString","includes","src","url","loader","_registerComponent","Component","defaultMeta","registerComponent","registerGlobalContext"],"mappings":"i0BAOIA,EAAW,SAAUC,OAGnBC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,GAClDC,EAAiBF,EAAQG,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,kBAC/CC,EAAoBN,EAAQO,aAAe,yBAEtCC,EAAOC,EAAKC,EAAKC,UACxBf,OAAOgB,eAAeH,EAAKC,EAAK,CAC9BC,MAAOA,EACPE,YAAY,EACZC,cAAc,EACdC,UAAU,IAELN,EAAIC,OAIXF,EAAO,G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AAY,0BAAZC,EAA+BC,WACvCT,SACInE,gGAET8C,GAAAA,EAAwB,CACtBW,KAAMU,KAEHK,SACIxE,iFAGHyD,EAAOoB,EAAEC,IAAIX,EAAMK,SAEP,iBAATf,GACP,aAAcA,GACI,aAAlBA,EAAKsB,SAGH/E,uBACE6C,UAAWA,EACXmC,wBAAyB,CAAEC,OAAQC,uBAAqBzB,MAI5C,iBAATA,GACP,gBAAiBA,GACjBA,EAAKjC,YAAY2D,SAAS,SAEnBnF,uBAAK6C,UAAWA,EAAWuC,IAAK3B,EAAK4B,MAClC5B,EAGHzD,uBAAK6C,UAAWA,GADE,iBAATY,EACmBA,EAEAA,EAAKI,YAJjC7D,kTCzSiBsF,OAIpBC,EAAqB,SACzBC,EACAC,GAEIH,EACFA,EAAOI,kBAAkBF,EAAWC,GAEpCC,EAAkBF,EAAWC,IAI7BH,EACFA,EAAOK,sBACLhF,EACAT,GAGFyF,EACEhF,EACAT,GAIJqF,EAAmB5C,EAAmB7B,GACtCyE,EAAmBd,EAAiBF"}
1
+ {"version":3,"file":"plasmic-contentful.cjs.production.min.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/contentful.tsx","../src/index.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","import { documentToHtmlString } from \"@contentful/rich-text-html-renderer\";\nimport {\n ComponentMeta,\n DataProvider,\n GlobalContextMeta,\n repeatedElement,\n useSelector,\n} from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\nimport * as Contentful from \"contentful\";\nimport L from \"lodash\";\nimport React, { ReactNode, useContext } from \"react\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-contentful\";\n\ninterface ContentfulCredentialsProviderProps {\n space: string;\n accessToken: string;\n environment?: string;\n}\n\nconst CredentialsContext = React.createContext<\n ContentfulCredentialsProviderProps | undefined\n>(undefined);\n\nexport const ContentfulCredentialsProviderMeta: GlobalContextMeta<ContentfulCredentialsProviderProps> = {\n name: \"Contentful CredentialsProvider\",\n displayName: \"Contentful Credentials Provider\",\n description:\n \"Any client requesting content from the CDA needs to provide an access token that has access to the environment you're requesting content from. Learn how to [get your API key](https://www.contentful.com/developers/docs/references/authentication/).\",\n importName: \"ContentfulCredentialsProvider\",\n importPath: modulePath,\n props: {\n space: {\n type: \"string\",\n displayName: \"Space\",\n description: \"Name of your space\",\n defaultValue: \"lmfbwqzbh93n\",\n },\n accessToken: {\n type: \"string\",\n displayName: \"Access Token \",\n description: \"Access Token\",\n defaultValue: \"aWvf6oSLTuqxKCxSUpokajdQr84hGQFE6zoJG7DVVLg\",\n },\n environment: {\n type: \"string\",\n displayName: \"Environment\",\n defaultValue: \"master\",\n },\n },\n};\n\nexport function ContentfulCredentialsProvider({\n accessToken,\n space,\n environment,\n children,\n}: React.PropsWithChildren<ContentfulCredentialsProviderProps>) {\n return (\n <CredentialsContext.Provider value={{ space, accessToken, environment }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface ContentfulFetcherProps {\n entryID?: string;\n contentType?: string;\n children?: ReactNode;\n className?: string;\n limit?: number;\n order?: string;\n noLayout?: boolean;\n setControlContextData?: (data: {\n types?: { name: string; id: string }[];\n entries?: { id: string }[];\n }) => void;\n}\n\nexport const ContentfulFetcherMeta: ComponentMeta<ContentfulFetcherProps> = {\n name: \"ContentfulFetcher\",\n displayName: \"Contentful Fetcher\",\n importName: \"ContentfulFetcher\",\n importPath: modulePath,\n providesData: true,\n description:\n \"Fetches Contentful data and repeats content of children once for every row fetched. \",\n defaultStyles: {\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr 1fr 1fr\",\n gridRowGap: \"8px\",\n gridColumnGap: \"8px\",\n padding: \"8px\",\n maxWidth: \"100%\",\n },\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n styles: {\n padding: \"8px\",\n },\n children: {\n type: \"component\",\n name: \"ContentfulField\",\n },\n },\n },\n contentType: {\n type: \"choice\",\n options: (props, ctx) =>\n ctx?.types?.map((type: any) => ({\n label: type?.name,\n value: type?.sys?.id,\n })) ?? [],\n displayName: \"Content type\",\n description: \"Content type to be queried.\",\n },\n entryID: {\n type: \"choice\",\n options: (props, ctx) =>\n ctx?.entries?.map((entry: any) => ({\n label: entry?.sys?.id,\n value: entry?.sys?.id,\n })) ?? [],\n displayName: \"Entry ID\",\n description: \"Query in Content Type.\",\n defaultValueHint: \"all\",\n },\n limit: {\n type: \"number\",\n displayName: \"Limit\",\n description: \"Limit the number of entries that are returned.\",\n defaultValue: 1000,\n },\n order: {\n type: \"string\",\n displayName: \"Order\",\n description: \"Order entries with a specific attribute.\",\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description:\n \"When set, Contentful Fetcher will not layout its children; instead, the layout set on its parent element will be used. Useful if you want to set flex gap or control container tag type.\",\n defaultValue: false,\n },\n },\n};\n\nexport function ContentfulFetcher({\n entryID,\n contentType,\n children,\n className,\n limit,\n noLayout,\n order,\n setControlContextData,\n}: ContentfulFetcherProps) {\n const creds = ensure(useContext(CredentialsContext));\n const cacheKey = JSON.stringify({\n creds,\n contentType,\n entryID,\n });\n const client = Contentful.createClient({\n space: creds.space,\n accessToken: creds.accessToken,\n });\n\n const { data: contentTypes, error: contentTypesError } = usePlasmicQueryData<\n any | null\n >(`${cacheKey}/contentTypes`, async () => {\n const response = await client.getContentTypes();\n return response;\n });\n\n const { data: entriesData, error: entriesDataError } = usePlasmicQueryData<\n any | null\n >(`${cacheKey}/entriesData`, async () => {\n if (!contentType) {\n return undefined;\n }\n const response = await client.getEntries({\n content_type: `${contentType?.toString()}`,\n limit,\n order,\n });\n return response;\n });\n\n const { data: entryData, error: entryDataError } = usePlasmicQueryData<\n any | null\n >(`${cacheKey}/entry`, async () => {\n if (!entryID) {\n return undefined;\n }\n const response = await client.getEntry(`${entryID}`);\n return response;\n });\n\n setControlContextData?.({\n types: contentTypes?.items,\n entries: entriesData?.items,\n });\n\n if (!creds.space || !creds.accessToken) {\n return (\n <div>\n Please specify a valid API Credentials: Space, Access Token and\n Environment\n </div>\n );\n }\n\n if (contentTypesError || entriesDataError || entryDataError) {\n if (contentTypesError) {\n return (\n <div className={className}>Error: {contentTypesError.message}</div>\n );\n } else if (entriesDataError) {\n return <div className={className}>Error: {entriesDataError.message}</div>;\n } else {\n return (\n <div className={className}>Error: {entriesDataError!.message}</div>\n );\n }\n }\n\n let renderedData;\n if (contentType && entryID) {\n renderedData = (\n <DataProvider name={\"contentfulItem\"} data={entryData}>\n {children}\n </DataProvider>\n );\n } else if (contentType) {\n if (entriesData?.items?.length === 0) {\n return <div className={className}>{contentType} is empty</div>;\n }\n renderedData = entriesData?.items?.map((item: any, index: number) => (\n <DataProvider key={item?.sys?.id} name={\"contentfulItem\"} data={item}>\n {repeatedElement(index, children)}\n </DataProvider>\n ));\n } else {\n return <div> Please choose the Content Type</div>;\n }\n\n return noLayout ? (\n <> {renderedData} </>\n ) : (\n <div className={className}> {renderedData} </div>\n );\n}\n\ninterface ContentfulFieldProps {\n className?: string;\n objectPath?: (string | number)[];\n setControlContextData?: (data: { data: object }) => void;\n}\n\nexport const ContentfulFieldMeta: ComponentMeta<ContentfulFieldProps> = {\n name: \"ContentfulField\",\n displayName: \"Contentful Field\",\n importName: \"ContentfulField\",\n importPath: modulePath,\n props: {\n objectPath: {\n type: \"dataSelector\",\n data: (props, ctx) => ctx?.data ?? {},\n displayName: \"Field\",\n description: \"Field to be displayed.\",\n },\n },\n};\n\nexport function ContentfulField({\n className,\n objectPath,\n setControlContextData,\n}: ContentfulFieldProps) {\n const item = useSelector(\"contentfulItem\")?.fields;\n if (!item) {\n return <div>ContentfulField must be used within a ContentfulFetcher </div>;\n }\n setControlContextData?.({\n data: item,\n });\n if (!objectPath) {\n return <div>Please specify a valid path or select a field.</div>;\n }\n\n const data = L.get(item, objectPath);\n if (\n typeof data === \"object\" &&\n \"nodeType\" in data &&\n data.nodeType === \"document\"\n ) {\n return (\n <div\n className={className}\n dangerouslySetInnerHTML={{ __html: documentToHtmlString(data) }}\n />\n );\n } else if (\n typeof data === \"object\" &&\n \"contentType\" in data &&\n data.contentType.includes(\"image\")\n ) {\n return <img className={className} src={data.url} />;\n } else if (!data) {\n return <div>Please specify a valid field.</div>;\n } else if (typeof data !== \"object\") {\n return <div className={className}>{data}</div>;\n } else {\n return <div className={className}>{data.toString()}</div>;\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta,\n ContentfulFetcher,\n ContentfulFetcherMeta,\n ContentfulField,\n ContentfulFieldMeta,\n} from \"./contentful\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: ComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n if (loader) {\n loader.registerGlobalContext(\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta\n );\n } else {\n registerGlobalContext(\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta\n );\n }\n\n _registerComponent(ContentfulFetcher, ContentfulFetcherMeta);\n _registerComponent(ContentfulField, ContentfulFieldMeta);\n}\n\nexport * from \"./contentful\";\n"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","generator","create","Generator","context","Context","_invoke","state","method","arg","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","ensure","x","modulePath","CredentialsContext","React","createContext","ContentfulCredentialsProviderMeta","description","importName","importPath","props","space","defaultValue","accessToken","environment","ContentfulCredentialsProvider","Provider","children","ContentfulFetcherMeta","providesData","defaultStyles","display","gridTemplateColumns","gridRowGap","gridColumnGap","padding","maxWidth","styles","contentType","options","ctx","types","_ctx$types","map","label","sys","_type$sys","id","entryID","entries","_ctx$entries","_entry$sys","_entry$sys2","defaultValueHint","limit","order","noLayout","ContentfulFetcher","renderedData","className","setControlContextData","creds","useContext","cacheKey","JSON","stringify","client","Contentful","usePlasmicQueryData","getContentTypes","contentTypes","data","contentTypesError","getEntries","content_type","toString","entriesData","entriesDataError","getEntry","entryData","entryDataError","items","message","DataProvider","_entriesData$items2","item","index","_item$sys","repeatedElement","ContentfulFieldMeta","objectPath","ContentfulField","useSelector","_useSelector","fields","L","get","nodeType","dangerouslySetInnerHTML","__html","documentToHtmlString","includes","src","url","loader","_registerComponent","Component","defaultMeta","registerComponent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AAiBF"}
@@ -944,7 +944,8 @@ function ContentfulFetcher(_ref2) {
944
944
  }
945
945
  }, _callee);
946
946
  }))),
947
- contentTypes = _usePlasmicQueryData.data;
947
+ contentTypes = _usePlasmicQueryData.data,
948
+ contentTypesError = _usePlasmicQueryData.error;
948
949
 
949
950
  var _usePlasmicQueryData2 = usePlasmicQueryData(cacheKey + "/entriesData", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
950
951
  var response;
@@ -978,7 +979,8 @@ function ContentfulFetcher(_ref2) {
978
979
  }
979
980
  }, _callee2);
980
981
  }))),
981
- entriesData = _usePlasmicQueryData2.data;
982
+ entriesData = _usePlasmicQueryData2.data,
983
+ entriesDataError = _usePlasmicQueryData2.error;
982
984
 
983
985
  var _usePlasmicQueryData3 = usePlasmicQueryData(cacheKey + "/entry", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
984
986
  var response;
@@ -1008,7 +1010,8 @@ function ContentfulFetcher(_ref2) {
1008
1010
  }
1009
1011
  }, _callee3);
1010
1012
  }))),
1011
- entryData = _usePlasmicQueryData3.data;
1013
+ entryData = _usePlasmicQueryData3.data,
1014
+ entryDataError = _usePlasmicQueryData3.error;
1012
1015
 
1013
1016
  setControlContextData == null ? void 0 : setControlContextData({
1014
1017
  types: contentTypes == null ? void 0 : contentTypes.items,
@@ -1019,6 +1022,22 @@ function ContentfulFetcher(_ref2) {
1019
1022
  return React.createElement("div", null, "Please specify a valid API Credentials: Space, Access Token and Environment");
1020
1023
  }
1021
1024
 
1025
+ if (contentTypesError || entriesDataError || entryDataError) {
1026
+ if (contentTypesError) {
1027
+ return React.createElement("div", {
1028
+ className: className
1029
+ }, "Error: ", contentTypesError.message);
1030
+ } else if (entriesDataError) {
1031
+ return React.createElement("div", {
1032
+ className: className
1033
+ }, "Error: ", entriesDataError.message);
1034
+ } else {
1035
+ return React.createElement("div", {
1036
+ className: className
1037
+ }, "Error: ", entriesDataError.message);
1038
+ }
1039
+ }
1040
+
1022
1041
  var renderedData;
1023
1042
 
1024
1043
  if (contentType && entryID) {
@@ -1027,9 +1046,15 @@ function ContentfulFetcher(_ref2) {
1027
1046
  data: entryData
1028
1047
  }, children);
1029
1048
  } else if (contentType) {
1030
- var _entriesData$items;
1049
+ var _entriesData$items, _entriesData$items2;
1050
+
1051
+ if ((entriesData == null ? void 0 : (_entriesData$items = entriesData.items) == null ? void 0 : _entriesData$items.length) === 0) {
1052
+ return React.createElement("div", {
1053
+ className: className
1054
+ }, contentType, " is empty");
1055
+ }
1031
1056
 
1032
- renderedData = entriesData == null ? void 0 : (_entriesData$items = entriesData.items) == null ? void 0 : _entriesData$items.map(function (item, index) {
1057
+ renderedData = entriesData == null ? void 0 : (_entriesData$items2 = entriesData.items) == null ? void 0 : _entriesData$items2.map(function (item, index) {
1033
1058
  var _item$sys;
1034
1059
 
1035
1060
  return React.createElement(DataProvider, {
@@ -1 +1 @@
1
- {"version":3,"file":"plasmic-contentful.esm.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/contentful.tsx","../src/index.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","import { documentToHtmlString } from \"@contentful/rich-text-html-renderer\";\nimport {\n ComponentMeta,\n DataProvider,\n GlobalContextMeta,\n repeatedElement,\n useSelector,\n} from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\nimport * as Contentful from \"contentful\";\nimport L from \"lodash\";\nimport React, { ReactNode, useContext } from \"react\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-contentful\";\n\ninterface ContentfulCredentialsProviderProps {\n space: string;\n accessToken: string;\n environment?: string;\n}\n\nconst CredentialsContext = React.createContext<\n ContentfulCredentialsProviderProps | undefined\n>(undefined);\n\nexport const ContentfulCredentialsProviderMeta: GlobalContextMeta<ContentfulCredentialsProviderProps> = {\n name: \"Contentful CredentialsProvider\",\n displayName: \"Contentful Credentials Provider\",\n description:\n \"Any client requesting content from the CDA needs to provide an access token that has access to the environment you're requesting content from. Learn how to [get your API key](https://www.contentful.com/developers/docs/references/authentication/).\",\n importName: \"ContentfulCredentialsProvider\",\n importPath: modulePath,\n props: {\n space: {\n type: \"string\",\n displayName: \"Space\",\n description: \"Name of your space\",\n defaultValue: \"lmfbwqzbh93n\",\n },\n accessToken: {\n type: \"string\",\n displayName: \"Access Token \",\n description: \"Access Token\",\n defaultValue: \"aWvf6oSLTuqxKCxSUpokajdQr84hGQFE6zoJG7DVVLg\",\n },\n environment: {\n type: \"string\",\n displayName: \"Environment\",\n defaultValue: \"master\",\n },\n },\n};\n\nexport function ContentfulCredentialsProvider({\n accessToken,\n space,\n environment,\n children,\n}: React.PropsWithChildren<ContentfulCredentialsProviderProps>) {\n return (\n <CredentialsContext.Provider value={{ space, accessToken, environment }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface ContentfulFetcherProps {\n entryID?: string;\n contentType?: string;\n children?: ReactNode;\n className?: string;\n limit?: number;\n order?: string;\n noLayout?: boolean;\n setControlContextData?: (data: {\n types?: { name: string; id: string }[];\n entries?: { id: string }[];\n }) => void;\n}\n\nexport const ContentfulFetcherMeta: ComponentMeta<ContentfulFetcherProps> = {\n name: \"ContentfulFetcher\",\n displayName: \"Contentful Fetcher\",\n importName: \"ContentfulFetcher\",\n importPath: modulePath,\n providesData: true,\n description:\n \"Fetches Contentful data and repeats content of children once for every row fetched. \",\n defaultStyles: {\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr 1fr 1fr\",\n gridRowGap: \"8px\",\n gridColumnGap: \"8px\",\n padding: \"8px\",\n maxWidth: \"100%\",\n },\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n styles: {\n padding: \"8px\",\n },\n children: {\n type: \"component\",\n name: \"ContentfulField\",\n },\n },\n },\n contentType: {\n type: \"choice\",\n options: (props, ctx) =>\n ctx?.types?.map((type: any) => ({\n label: type?.name,\n value: type?.sys?.id,\n })) ?? [],\n displayName: \"Content type\",\n description: \"Content type to be queried.\",\n },\n entryID: {\n type: \"choice\",\n options: (props, ctx) =>\n ctx?.entries?.map((entry: any) => ({\n label: entry?.sys?.id,\n value: entry?.sys?.id,\n })) ?? [],\n displayName: \"Entry ID\",\n description: \"Query in Content Type.\",\n defaultValueHint: \"all\",\n },\n limit: {\n type: \"number\",\n displayName: \"Limit\",\n description: \"Limit the number of entries that are returned.\",\n defaultValue: 1000,\n },\n order: {\n type: \"string\",\n displayName: \"Order\",\n description: \"Order entries with a specific attribute.\",\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description:\n \"When set, Contentful Fetcher will not layout its children; instead, the layout set on its parent element will be used. Useful if you want to set flex gap or control container tag type.\",\n defaultValue: false,\n },\n },\n};\n\nexport function ContentfulFetcher({\n entryID,\n contentType,\n children,\n className,\n limit,\n noLayout,\n order,\n setControlContextData,\n}: ContentfulFetcherProps) {\n const creds = ensure(useContext(CredentialsContext));\n const cacheKey = JSON.stringify({\n creds,\n contentType,\n entryID,\n });\n const client = Contentful.createClient({\n space: creds.space,\n accessToken: creds.accessToken,\n });\n\n const { data: contentTypes } = usePlasmicQueryData<any | null>(\n `${cacheKey}/contentTypes`,\n async () => {\n const response = await client.getContentTypes();\n return response;\n }\n );\n\n const { data: entriesData } = usePlasmicQueryData<any | null>(\n `${cacheKey}/entriesData`,\n async () => {\n if (!contentType) {\n return undefined;\n }\n const response = await client.getEntries({\n content_type: `${contentType?.toString()}`,\n limit,\n order,\n });\n return response;\n }\n );\n\n const { data: entryData } = usePlasmicQueryData<any | null>(\n `${cacheKey}/entry`,\n async () => {\n if (!entryID) {\n return undefined;\n }\n const response = await client.getEntry(`${entryID}`);\n return response;\n }\n );\n\n setControlContextData?.({\n types: contentTypes?.items,\n entries: entriesData?.items,\n });\n\n if (!creds.space || !creds.accessToken) {\n return (\n <div>\n Please specify a valid API Credentials: Space, Access Token and\n Environment\n </div>\n );\n }\n\n let renderedData;\n if (contentType && entryID) {\n renderedData = (\n <DataProvider name={\"contentfulItem\"} data={entryData}>\n {children}\n </DataProvider>\n );\n } else if (contentType) {\n renderedData = entriesData?.items?.map((item: any, index: number) => (\n <DataProvider key={item?.sys?.id} name={\"contentfulItem\"} data={item}>\n {repeatedElement(index, children)}\n </DataProvider>\n ));\n } else {\n return <div> Please choose the Content Type</div>;\n }\n\n return noLayout ? (\n <> {renderedData} </>\n ) : (\n <div className={className}> {renderedData} </div>\n );\n}\n\ninterface ContentfulFieldProps {\n className?: string;\n objectPath?: (string | number)[];\n setControlContextData?: (data: { data: object }) => void;\n}\n\nexport const ContentfulFieldMeta: ComponentMeta<ContentfulFieldProps> = {\n name: \"ContentfulField\",\n displayName: \"Contentful Field\",\n importName: \"ContentfulField\",\n importPath: modulePath,\n props: {\n objectPath: {\n type: \"dataSelector\",\n data: (props, ctx) => ctx?.data ?? {},\n displayName: \"Field\",\n description: \"Field to be displayed.\",\n },\n },\n};\n\nexport function ContentfulField({\n className,\n objectPath,\n setControlContextData,\n}: ContentfulFieldProps) {\n const item = useSelector(\"contentfulItem\")?.fields;\n if (!item) {\n return <div>ContentfulField must be used within a ContentfulFetcher </div>;\n }\n setControlContextData?.({\n data: item,\n });\n if (!objectPath) {\n return <div>Please specify a valid path or select a field.</div>;\n }\n\n const data = L.get(item, objectPath);\n if (\n typeof data === \"object\" &&\n \"nodeType\" in data &&\n data.nodeType === \"document\"\n ) {\n return (\n <div\n className={className}\n dangerouslySetInnerHTML={{ __html: documentToHtmlString(data) }}\n />\n );\n } else if (\n typeof data === \"object\" &&\n \"contentType\" in data &&\n data.contentType.includes(\"image\")\n ) {\n return <img className={className} src={data.url} />;\n } else if (!data) {\n return <div>Please specify a valid field.</div>;\n } else if (typeof data !== \"object\") {\n return <div className={className}>{data}</div>;\n } else {\n return <div className={className}>{data.toString()}</div>;\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta,\n ContentfulFetcher,\n ContentfulFetcherMeta,\n ContentfulField,\n ContentfulFieldMeta,\n} from \"./contentful\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: ComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n if (loader) {\n loader.registerGlobalContext(\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta\n );\n } else {\n registerGlobalContext(\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta\n );\n }\n\n _registerComponent(ContentfulFetcher, ContentfulFetcherMeta);\n _registerComponent(ContentfulField, ContentfulFieldMeta);\n}\n\nexport * from \"./contentful\";\n"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","undefined","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","makeInvokeMethod","tryCatch","fn","arg","type","call","GenStateSuspendedStart","GenStateSuspendedYield","GenStateExecuting","GenStateCompleted","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","displayName","defineIteratorMethods","forEach","method","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","__await","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","then","unwrapped","error","previousPromise","enqueue","callInvokeWithMethodAndArg","async","Promise","iter","next","done","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","info","resultName","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","keys","object","reverse","length","pop","iterable","iteratorMethod","isNaN","i","skipTempReset","prev","charAt","slice","stop","rootEntry","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","ensure","x","modulePath","CredentialsContext","React","createContext","ContentfulCredentialsProviderMeta","description","importName","importPath","props","space","defaultValue","accessToken","environment","ContentfulCredentialsProvider","children","Provider","ContentfulFetcherMeta","providesData","defaultStyles","display","gridTemplateColumns","gridRowGap","gridColumnGap","padding","maxWidth","styles","contentType","options","ctx","types","map","label","sys","id","entryID","entries","defaultValueHint","limit","order","noLayout","ContentfulFetcher","className","setControlContextData","creds","useContext","cacheKey","JSON","stringify","client","Contentful","usePlasmicQueryData","getContentTypes","response","contentTypes","data","getEntries","content_type","toString","entriesData","getEntry","entryData","items","renderedData","DataProvider","item","index","repeatedElement","ContentfulFieldMeta","objectPath","ContentfulField","useSelector","fields","L","get","nodeType","dangerouslySetInnerHTML","__html","documentToHtmlString","includes","src","url","registerAll","loader","_registerComponent","Component","defaultMeta","registerComponent","registerGlobalContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAIA,OAAO,GAAI,UAAUC,OAAV,EAAmB;;AAGhC,QAAIC,EAAE,GAAGC,MAAM,CAACC,SAAhB;AACA,QAAIC,MAAM,GAAGH,EAAE,CAACI,cAAhB;AACA,QAAIC,WAAJ,CALgC;;AAMhC,QAAIC,OAAO,GAAG,OAAOC,MAAP,KAAkB,UAAlB,GAA+B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M,MAEA;AACL,WAAOpD,mBAAA,MAAA;AAAKuC,MAAAA,SAAS,EAAEA;KAAhB,EAA4Ba,IAAI,CAACG,QAAL,EAA5B,CAAP;AACD;AACF;;SC/SewB,YAAYC;AAI1B,MAAMC,kBAAkB,GAAG,SAArBA,kBAAqB,CACzBC,SADyB,EAEzBC,WAFyB;AAIzB,QAAIH,MAAJ,EAAY;AACVA,MAAAA,MAAM,CAACI,iBAAP,CAAyBF,SAAzB,EAAoCC,WAApC;AACD,KAFD,MAEO;AACLC,MAAAA,iBAAiB,CAACF,SAAD,EAAYC,WAAZ,CAAjB;AACD;AACF,GATD;;AAWA,MAAIH,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACK,qBAAP,CACE1E,6BADF,EAEET,iCAFF;AAID,GALD,MAKO;AACLmF,IAAAA,qBAAqB,CACnB1E,6BADmB,EAEnBT,iCAFmB,CAArB;AAID;;AAED+E,EAAAA,kBAAkB,CAAC3C,iBAAD,EAAoBxB,qBAApB,CAAlB;;AACAmE,EAAAA,kBAAkB,CAACd,eAAD,EAAkBF,mBAAlB,CAAlB;AACD;;;;"}
1
+ {"version":3,"file":"plasmic-contentful.esm.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/contentful.tsx","../src/index.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","import { documentToHtmlString } from \"@contentful/rich-text-html-renderer\";\nimport {\n ComponentMeta,\n DataProvider,\n GlobalContextMeta,\n repeatedElement,\n useSelector,\n} from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\nimport * as Contentful from \"contentful\";\nimport L from \"lodash\";\nimport React, { ReactNode, useContext } from \"react\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-contentful\";\n\ninterface ContentfulCredentialsProviderProps {\n space: string;\n accessToken: string;\n environment?: string;\n}\n\nconst CredentialsContext = React.createContext<\n ContentfulCredentialsProviderProps | undefined\n>(undefined);\n\nexport const ContentfulCredentialsProviderMeta: GlobalContextMeta<ContentfulCredentialsProviderProps> = {\n name: \"Contentful CredentialsProvider\",\n displayName: \"Contentful Credentials Provider\",\n description:\n \"Any client requesting content from the CDA needs to provide an access token that has access to the environment you're requesting content from. Learn how to [get your API key](https://www.contentful.com/developers/docs/references/authentication/).\",\n importName: \"ContentfulCredentialsProvider\",\n importPath: modulePath,\n props: {\n space: {\n type: \"string\",\n displayName: \"Space\",\n description: \"Name of your space\",\n defaultValue: \"lmfbwqzbh93n\",\n },\n accessToken: {\n type: \"string\",\n displayName: \"Access Token \",\n description: \"Access Token\",\n defaultValue: \"aWvf6oSLTuqxKCxSUpokajdQr84hGQFE6zoJG7DVVLg\",\n },\n environment: {\n type: \"string\",\n displayName: \"Environment\",\n defaultValue: \"master\",\n },\n },\n};\n\nexport function ContentfulCredentialsProvider({\n accessToken,\n space,\n environment,\n children,\n}: React.PropsWithChildren<ContentfulCredentialsProviderProps>) {\n return (\n <CredentialsContext.Provider value={{ space, accessToken, environment }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface ContentfulFetcherProps {\n entryID?: string;\n contentType?: string;\n children?: ReactNode;\n className?: string;\n limit?: number;\n order?: string;\n noLayout?: boolean;\n setControlContextData?: (data: {\n types?: { name: string; id: string }[];\n entries?: { id: string }[];\n }) => void;\n}\n\nexport const ContentfulFetcherMeta: ComponentMeta<ContentfulFetcherProps> = {\n name: \"ContentfulFetcher\",\n displayName: \"Contentful Fetcher\",\n importName: \"ContentfulFetcher\",\n importPath: modulePath,\n providesData: true,\n description:\n \"Fetches Contentful data and repeats content of children once for every row fetched. \",\n defaultStyles: {\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr 1fr 1fr\",\n gridRowGap: \"8px\",\n gridColumnGap: \"8px\",\n padding: \"8px\",\n maxWidth: \"100%\",\n },\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n styles: {\n padding: \"8px\",\n },\n children: {\n type: \"component\",\n name: \"ContentfulField\",\n },\n },\n },\n contentType: {\n type: \"choice\",\n options: (props, ctx) =>\n ctx?.types?.map((type: any) => ({\n label: type?.name,\n value: type?.sys?.id,\n })) ?? [],\n displayName: \"Content type\",\n description: \"Content type to be queried.\",\n },\n entryID: {\n type: \"choice\",\n options: (props, ctx) =>\n ctx?.entries?.map((entry: any) => ({\n label: entry?.sys?.id,\n value: entry?.sys?.id,\n })) ?? [],\n displayName: \"Entry ID\",\n description: \"Query in Content Type.\",\n defaultValueHint: \"all\",\n },\n limit: {\n type: \"number\",\n displayName: \"Limit\",\n description: \"Limit the number of entries that are returned.\",\n defaultValue: 1000,\n },\n order: {\n type: \"string\",\n displayName: \"Order\",\n description: \"Order entries with a specific attribute.\",\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description:\n \"When set, Contentful Fetcher will not layout its children; instead, the layout set on its parent element will be used. Useful if you want to set flex gap or control container tag type.\",\n defaultValue: false,\n },\n },\n};\n\nexport function ContentfulFetcher({\n entryID,\n contentType,\n children,\n className,\n limit,\n noLayout,\n order,\n setControlContextData,\n}: ContentfulFetcherProps) {\n const creds = ensure(useContext(CredentialsContext));\n const cacheKey = JSON.stringify({\n creds,\n contentType,\n entryID,\n });\n const client = Contentful.createClient({\n space: creds.space,\n accessToken: creds.accessToken,\n });\n\n const { data: contentTypes, error: contentTypesError } = usePlasmicQueryData<\n any | null\n >(`${cacheKey}/contentTypes`, async () => {\n const response = await client.getContentTypes();\n return response;\n });\n\n const { data: entriesData, error: entriesDataError } = usePlasmicQueryData<\n any | null\n >(`${cacheKey}/entriesData`, async () => {\n if (!contentType) {\n return undefined;\n }\n const response = await client.getEntries({\n content_type: `${contentType?.toString()}`,\n limit,\n order,\n });\n return response;\n });\n\n const { data: entryData, error: entryDataError } = usePlasmicQueryData<\n any | null\n >(`${cacheKey}/entry`, async () => {\n if (!entryID) {\n return undefined;\n }\n const response = await client.getEntry(`${entryID}`);\n return response;\n });\n\n setControlContextData?.({\n types: contentTypes?.items,\n entries: entriesData?.items,\n });\n\n if (!creds.space || !creds.accessToken) {\n return (\n <div>\n Please specify a valid API Credentials: Space, Access Token and\n Environment\n </div>\n );\n }\n\n if (contentTypesError || entriesDataError || entryDataError) {\n if (contentTypesError) {\n return (\n <div className={className}>Error: {contentTypesError.message}</div>\n );\n } else if (entriesDataError) {\n return <div className={className}>Error: {entriesDataError.message}</div>;\n } else {\n return (\n <div className={className}>Error: {entriesDataError!.message}</div>\n );\n }\n }\n\n let renderedData;\n if (contentType && entryID) {\n renderedData = (\n <DataProvider name={\"contentfulItem\"} data={entryData}>\n {children}\n </DataProvider>\n );\n } else if (contentType) {\n if (entriesData?.items?.length === 0) {\n return <div className={className}>{contentType} is empty</div>;\n }\n renderedData = entriesData?.items?.map((item: any, index: number) => (\n <DataProvider key={item?.sys?.id} name={\"contentfulItem\"} data={item}>\n {repeatedElement(index, children)}\n </DataProvider>\n ));\n } else {\n return <div> Please choose the Content Type</div>;\n }\n\n return noLayout ? (\n <> {renderedData} </>\n ) : (\n <div className={className}> {renderedData} </div>\n );\n}\n\ninterface ContentfulFieldProps {\n className?: string;\n objectPath?: (string | number)[];\n setControlContextData?: (data: { data: object }) => void;\n}\n\nexport const ContentfulFieldMeta: ComponentMeta<ContentfulFieldProps> = {\n name: \"ContentfulField\",\n displayName: \"Contentful Field\",\n importName: \"ContentfulField\",\n importPath: modulePath,\n props: {\n objectPath: {\n type: \"dataSelector\",\n data: (props, ctx) => ctx?.data ?? {},\n displayName: \"Field\",\n description: \"Field to be displayed.\",\n },\n },\n};\n\nexport function ContentfulField({\n className,\n objectPath,\n setControlContextData,\n}: ContentfulFieldProps) {\n const item = useSelector(\"contentfulItem\")?.fields;\n if (!item) {\n return <div>ContentfulField must be used within a ContentfulFetcher </div>;\n }\n setControlContextData?.({\n data: item,\n });\n if (!objectPath) {\n return <div>Please specify a valid path or select a field.</div>;\n }\n\n const data = L.get(item, objectPath);\n if (\n typeof data === \"object\" &&\n \"nodeType\" in data &&\n data.nodeType === \"document\"\n ) {\n return (\n <div\n className={className}\n dangerouslySetInnerHTML={{ __html: documentToHtmlString(data) }}\n />\n );\n } else if (\n typeof data === \"object\" &&\n \"contentType\" in data &&\n data.contentType.includes(\"image\")\n ) {\n return <img className={className} src={data.url} />;\n } else if (!data) {\n return <div>Please specify a valid field.</div>;\n } else if (typeof data !== \"object\") {\n return <div className={className}>{data}</div>;\n } else {\n return <div className={className}>{data.toString()}</div>;\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta,\n ContentfulFetcher,\n ContentfulFetcherMeta,\n ContentfulField,\n ContentfulFieldMeta,\n} from \"./contentful\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: ComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n if (loader) {\n loader.registerGlobalContext(\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta\n );\n } else {\n registerGlobalContext(\n ContentfulCredentialsProvider,\n ContentfulCredentialsProviderMeta\n );\n }\n\n _registerComponent(ContentfulFetcher, ContentfulFetcherMeta);\n _registerComponent(ContentfulField, ContentfulFieldMeta);\n}\n\nexport * from \"./contentful\";\n"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","undefined","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","makeInvokeMethod","tryCatch","fn","arg","type","call","GenStateSuspendedStart","GenStateSuspendedYield","GenStateExecuting","GenStateCompleted","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","displayName","defineIteratorMethods","forEach","method","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","__await","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","then","unwrapped","error","previousPromise","enqueue","callInvokeWithMethodAndArg","async","Promise","iter","next","done","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","info","resultName","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","keys","object","reverse","length","pop","iterable","iteratorMethod","isNaN","i","skipTempReset","prev","charAt","slice","stop","rootEntry","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","ensure","x","modulePath","CredentialsContext","React","createContext","ContentfulCredentialsProviderMeta","description","importName","importPath","props","space","defaultValue","accessToken","environment","ContentfulCredentialsProvider","children","Provider","ContentfulFetcherMeta","providesData","defaultStyles","display","gridTemplateColumns","gridRowGap","gridColumnGap","padding","maxWidth","styles","contentType","options","ctx","types","map","label","sys","id","entryID","entries","defaultValueHint","limit","order","noLayout","ContentfulFetcher","className","setControlContextData","creds","useContext","cacheKey","JSON","stringify","client","Contentful","usePlasmicQueryData","getContentTypes","response","contentTypes","data","contentTypesError","getEntries","content_type","toString","entriesData","entriesDataError","getEntry","entryData","entryDataError","items","message","renderedData","DataProvider","item","index","repeatedElement","ContentfulFieldMeta","objectPath","ContentfulField","useSelector","fields","L","get","nodeType","dangerouslySetInnerHTML","__html","documentToHtmlString","includes","src","url","registerAll","loader","_registerComponent","Component","defaultMeta","registerComponent","registerGlobalContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAIA,OAAO,GAAI,UAAUC,OAAV,EAAmB;;AAGhC,QAAIC,EAAE,GAAGC,MAAM,CAACC,SAAhB;AACA,QAAIC,MAAM,GAAGH,EAAE,CAACI,cAAhB;AACA,QAAIC,WAAJ,CALgC;;AAMhC,QAAIC,OAAO,GAAG,OAAOC,MAAP,KAAkB,UAAlB,GAA+BA,MAA/B,GAAwC,EAAtD;AACA,QAAIC,cAAc,GAAGF,OAAO,CAACG,QAAR,IAAoB,YAAzC;AACA,QAAIC,mBAAmB,GAAGJ,OAAO,CAACK,aAAR,IAAyB,iBAAnD;AACA,QAAIC,iBAAiB,GAAGN,OAAO,CAACO,WAAR,IAAuB,eAA/C;;AAEA,aAASC,MAAT,CAAgBC,GAAhB,EAAqBC,GAArB,EAA0BC,KAA1B,EAAiC;AAC/BhB,MAAAA,MAAM,CAACiB,cAAP,CAAsBH,GAAtB,EAA2BC,GAA3B,EAAgC;AAC9BC,QAAAA,KAAK,EAAEA,KADuB;AAE9BE,QAAAA,UAAU,EAAE,IAFkB;AAG9BC,QAAAA,YAAY,EAAE,IAHgB;AAI9BC,QAAAA,QAAQ,EAAE;AAJoB,OAAhC;AAMA,aAAON,GAAG,CAACC,GAAD,CAAV;AACD;;AACD,QAAI;;AAEFF,MAAAA,MAAM,CAAC,EAAD,EAAK,EAAL,CAAN;AACD,KAHD,CAGE,OAAOQ,GAAP,EAAY;AACZR,MAAAA,MAAM,GAAG,gBAASC,GAAT,EAAcC,GAAd,EAAmBC,KAAnB,EAA0B;AACjC,eAAOF,GAAG,CAACC,GAAD,CAAH,GAAWC,KAAlB;AACD,OAFD;AAGD;;AAED,aAASM,IAAT,CAAcC,OAAd,EAAuBC,OAAvB,EAAgCC,IA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AAS,EAAEA;KAAhB,EAA4Ba,IAAI,CAACI,QAAL,EAA5B,CAAP;AACD;AACF;;SC7Te2B,YAAYC;AAI1B,MAAMC,kBAAkB,GAAG,SAArBA,kBAAqB,CACzBC,SADyB,EAEzBC,WAFyB;AAIzB,QAAIH,MAAJ,EAAY;AACVA,MAAAA,MAAM,CAACI,iBAAP,CAAyBF,SAAzB,EAAoCC,WAApC;AACD,KAFD,MAEO;AACLC,MAAAA,iBAAiB,CAACF,SAAD,EAAYC,WAAZ,CAAjB;AACD;AACF,GATD;;AAWA,MAAIH,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACK,qBAAP,CACE9E,6BADF,EAEET,iCAFF;AAID,GALD,MAKO;AACLuF,IAAAA,qBAAqB,CACnB9E,6BADmB,EAEnBT,iCAFmB,CAArB;AAID;;AAEDmF,EAAAA,kBAAkB,CAAC/C,iBAAD,EAAoBxB,qBAApB,CAAlB;;AACAuE,EAAAA,kBAAkB,CAACd,eAAD,EAAkBF,mBAAlB,CAAlB;AACD;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicpkgs/plasmic-contentful",
3
- "version": "0.0.10",
3
+ "version": "0.0.13",
4
4
  "description": "Plasmic Contentful components.",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -48,12 +48,12 @@
48
48
  "dependencies": {
49
49
  "@contentful/rich-text-html-renderer": "^15.13.1",
50
50
  "@contentful/rich-text-react-renderer": "^15.12.1",
51
- "@plasmicapp/host": "1.0.63",
51
+ "@plasmicapp/host": "1.0.65",
52
52
  "@plasmicapp/query": "0.1.50",
53
53
  "@types/lodash-es": "^4.17.6",
54
54
  "contentful": "^9.1.28",
55
55
  "lodash": "^4.17.21",
56
56
  "lodash-es": "^4.17.21"
57
57
  },
58
- "gitHead": "fe572ead8a86796247533292cbb3cf85682515c3"
58
+ "gitHead": "220db7147a238ffb36754b299164a4c9f14c7912"
59
59
  }