@plasmicpkgs/plasmic-contentful 0.0.97 → 0.0.99
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.
- package/dist/contentful.d.ts +2 -1
- package/dist/plasmic-contentful.cjs.development.js +18 -8
- package/dist/plasmic-contentful.cjs.development.js.map +1 -1
- package/dist/plasmic-contentful.cjs.production.min.js +1 -1
- package/dist/plasmic-contentful.cjs.production.min.js.map +1 -1
- package/dist/plasmic-contentful.esm.js +18 -8
- package/dist/plasmic-contentful.esm.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plasmic-contentful.cjs.production.min.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/utils.ts","../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","export const searchParameters = [\n {\n value: \"[lt]\",\n label: \"Less than\",\n },\n {\n value: \"[lte]\",\n label: \"Less than or equal\",\n },\n {\n value: \"[gt]\",\n label: \"Greater than\",\n },\n {\n value: \"[gte]\",\n label: \"Greater than or equal \",\n },\n];\n\nexport const uniq = <T>(xs: Array<T>): T[] => Array.from(new Set(xs));\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 { pascalCase } from \"change-case\";\nimport get from \"dlv\";\nimport React, { ReactNode, useContext } from \"react\";\nimport { searchParameters, uniq } from \"./utils\";\nimport { Entry } from \"./types\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\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\nconst makeDataProviderName = (contentType: string) =>\n `currentContentful${pascalCase(contentType)}Item`;\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 {\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 contentType: string;\n children?: ReactNode;\n className?: string;\n limit?: number;\n order?: string;\n filterField?: string;\n searchParameter?: string;\n filterValue?: string | number;\n noAutoRepeat?: boolean;\n noLayout?: boolean;\n setControlContextData?: (data: {\n types?: { name: string; id: string }[];\n fields?: string[];\n queryOptions?: [];\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\n filterField: {\n type: \"choice\",\n displayName: \"Filter field\",\n description: \"Field (from Collection) to filter by.\",\n options: (props, ctx) => ctx?.fields ?? [],\n hidden: (props, ctx) => !props.contentType,\n },\n searchParameter: {\n type: \"choice\",\n displayName: \"Search Parameter\",\n description:\n \"Search Parameter to filter by (see Contentful Content Delivery API documentation for details).\",\n options: (props, ctx) => ctx?.queryOptions ?? [],\n hidden: (props, ctx) => !props.filterField,\n },\n filterValue: {\n type: \"string\",\n displayName: \"Filter value\",\n description: \"Value to filter by, should be of filter field type.\",\n hidden: (props, ctx) => !props.searchParameter,\n },\n limit: {\n type: \"number\",\n displayName: \"Limit\",\n description: \"Limit the number of entries that are returned.\",\n },\n noAutoRepeat: {\n type: \"boolean\",\n displayName: \"No auto-repeat\",\n description: \"Do not automatically repeat children for every entry.\",\n defaultValue: false,\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 filterField,\n filterValue,\n searchParameter,\n noAutoRepeat,\n contentType,\n children,\n className,\n limit,\n noLayout,\n setControlContextData,\n}: ContentfulFetcherProps) {\n const creds = ensure(useContext(CredentialsContext));\n const cacheKey = JSON.stringify({\n limit,\n filterField,\n filterValue,\n searchParameter,\n creds,\n });\n\n const baseUrl = \"https://cdn.contentful.com\";\n\n const { data: contentTypes } = usePlasmicQueryData<any | null>(\n `${cacheKey}/contentTypes`,\n async () => {\n const resp = await fetch(\n `${baseUrl}/spaces/${creds.space}/environments/${creds.environment}/content_types?access_token=${creds.accessToken}`\n );\n return resp.json();\n }\n );\n setControlContextData?.({\n types: contentTypes?.items ?? [],\n });\n\n const { data: entriesData } = usePlasmicQueryData<any | null>(\n contentType ? `${cacheKey}/${contentType}/entriesData` : null,\n async () => {\n const url = `/spaces/${creds.space}/environments/${creds.environment}/entries?access_token=${creds.accessToken}&content_type=${contentType}`;\n let query;\n\n if (limit) {\n query = `${url}&limit=${limit}`;\n } else {\n query = url;\n }\n const resp = await fetch(`${baseUrl}${query}`);\n return resp.json();\n }\n );\n\n const { data: filteredData } = usePlasmicQueryData<any | null>(\n contentType && filterField && filterValue\n ? `${cacheKey}/${contentType}/filteredData`\n : null,\n async () => {\n const queryPath = `/spaces/${creds.space}/environments/${creds.environment}/entries?access_token=${creds.accessToken}&content_type=${contentType}&fields.${filterField}${searchParameter}=${filterValue}`;\n const resp = await fetch(`${baseUrl}${queryPath}`);\n return resp.json();\n }\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 (!contentTypes) {\n return <div>Please configure the Contentful credentials</div>;\n }\n\n if (!entriesData) {\n return <div>Please select a content type</div>;\n }\n\n const filterFields: string[] = entriesData?.items.flatMap((item: any) => {\n const fields = Object.keys(item.fields).filter((field) => {\n const value = get(item, field);\n return typeof value !== \"object\" && field !== \"photos\";\n });\n return fields;\n });\n\n let operators;\n const matchedFields = Object.values(entriesData.items).map((item: any) => {\n const fields = Object.entries(item.fields).find(\n (el) => el[0] === filterField\n );\n return fields;\n });\n\n Object.values(matchedFields)\n .map((model: any) => (Array.isArray(model) ? model : [model]))\n .map((item: any) => {\n if (typeof item[1] === \"number\" && typeof item[1] !== \"object\") {\n operators = searchParameters;\n } else if (\n typeof item[1] !== \"number\" &&\n typeof item[1] !== \"object\" &&\n typeof item[1] === \"string\"\n ) {\n operators = [\n {\n value: \"[match]\",\n label: \"Full text search\",\n },\n ];\n }\n });\n\n setControlContextData?.({\n queryOptions: operators ?? [],\n types: contentTypes?.items ?? [],\n fields: uniq(filterFields ?? []),\n });\n\n if (filterField && !searchParameter) {\n return <div>Please specify a Search Parameter</div>;\n }\n if (searchParameter && !filterValue) {\n return <div>Please specify a Filter value</div>;\n }\n\n function denormalizeData(data: any | null) {\n if (!data?.items || !data?.includes || !data?.includes.Asset) {\n return data; // Return the original data if the required properties are missing\n }\n const itemsWithDenormalizedFields: Entry[] = data.items.map((item: any) => {\n const updatedFields: { [fieldName: string]: unknown | unknown[] } = {};\n\n for (const fieldName in item.fields) {\n const fieldValue = item.fields[fieldName];\n\n if (Array.isArray(fieldValue)) {\n const updatedArray = fieldValue.map((arrayItem) => {\n if (\n arrayItem &&\n typeof arrayItem === \"object\" &&\n \"sys\" in arrayItem &&\n arrayItem.sys.linkType === \"Asset\"\n ) {\n const fieldId = arrayItem.sys.id;\n const asset = data.includes.Asset.find(\n (asset: any) => asset.sys.id === fieldId\n );\n if (asset) {\n return {\n ...arrayItem,\n url: \"https:\" + asset.fields?.file?.url,\n };\n } else {\n console.log(`Asset URL not found for ID: ${fieldId}`);\n }\n }\n return arrayItem;\n });\n updatedFields[fieldName] = updatedArray;\n } else if (\n fieldValue &&\n typeof fieldValue === \"object\" &&\n \"sys\" in fieldValue &&\n fieldValue.sys.linkType === \"Asset\"\n ) {\n const fieldId = fieldValue.sys.id;\n const asset = data.includes.Asset.find(\n (asset: any) => asset.sys.id === fieldId\n );\n if (asset) {\n updatedFields[fieldName] = {\n ...fieldValue,\n url: \"https:\" + asset.fields?.file?.url,\n };\n } else {\n console.log(`Asset URL not found for ID: ${fieldId}`);\n }\n } else {\n updatedFields[fieldName] = fieldValue;\n }\n }\n return {\n ...item,\n fields: updatedFields,\n };\n });\n return {\n ...data,\n items: itemsWithDenormalizedFields,\n };\n }\n\n let renderedData;\n\n if (filteredData) {\n if (filteredData?.items?.length === 0) {\n return <div className={className}>No published entry found</div>;\n }\n\n renderedData = noAutoRepeat\n ? children\n : denormalizeData(filteredData)?.items?.map(\n (item: any, index: number) => (\n <DataProvider\n key={item?.sys?.id}\n name={\"contentfulItem\"}\n data={item}\n hidden={true}\n >\n <DataProvider\n name={makeDataProviderName(contentType)}\n data={item}\n >\n {repeatedElement(index, children)}\n </DataProvider>\n </DataProvider>\n )\n );\n } else {\n if (entriesData?.items?.length === 0) {\n return <div className={className}>{contentType} is empty</div>;\n }\n\n renderedData = noAutoRepeat\n ? children\n : denormalizeData(entriesData)?.items?.map((item: any, index: number) => (\n <DataProvider\n key={item?.sys?.id}\n name={\"contentfulItem\"}\n data={item}\n hidden={true}\n >\n <DataProvider name={makeDataProviderName(contentType)} data={item}>\n {repeatedElement(index, children)}\n </DataProvider>\n </DataProvider>\n ));\n }\n\n return (\n <DataProvider name=\"contentfulItems\" data={entriesData?.items}>\n {noLayout ? (\n <> {renderedData} </>\n ) : (\n <div className={className}> {renderedData} </div>\n )}\n </DataProvider>\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 = 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 data.sys.linkType === \"Asset\" &&\n data.url\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 _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","catch","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","searchParameters","label","ensure","x","modulePath","makeDataProviderName","contentType","pascalCase","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","options","ctx","types","_ctx$types","map","sys","_type$sys","id","filterField","fields","hidden","searchParameter","queryOptions","filterValue","limit","noAutoRepeat","noLayout","ContentfulFetcher","className","setControlContextData","creds","useContext","cacheKey","JSON","stringify","baseUrl","contentTypes","usePlasmicQueryData","_context","fetch","json","data","items","entriesData","url","query","_context2","filteredData","queryPath","_context3","operators","xs","renderedData","filterFields","flatMap","item","filter","field","get","matchedFields","entries","find","el","model","Array","isArray","from","Set","denormalizeData","includes","Asset","itemsWithDenormalizedFields","updatedFields","fieldName","fieldValue","updatedArray","arrayItem","linkType","fieldId","asset","_asset$fields","file","_asset$fields$file","console","log","_asset$fields2","_asset$fields2$file","_filteredData$items","_denormalizeData","_denormalizeData$item","index","DataProvider","_item$sys","repeatedElement","_entriesData$items","_denormalizeData2","_denormalizeData2$ite","_item$sys2","ContentfulFieldMeta","objectPath","ContentfulField","useSelector","_useSelector","nodeType","dangerouslySetInnerHTML","__html","documentToHtmlString","src","toString","loader","_registerComponent","Component","defaultMeta","registerComponent","registerGlobalContext"],"mappings":"8hCAOA,IAAIA,EAAW,SAAUC,GAGvB,IAAIC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,GAClDC,EAAiBF,EAAQG,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,kBAC/CC,EAAoBN,EAAQO,aAAe,gBAE/C,SAASC,EAAOC,EAAKC,EAAKC,GAOxB,OANAf,OAAOgB,eAAeH,EAAKC,EAAK,CAC9BC,MAAOA,EACPE,YAAY,EACZC,cAAc,EACdC,UAAU,IAELN,EAAIC,GAEb,IAEEF,EAAO,GAAI,IACX,MAAOQ,GACPR,EAAS,SAASC,EAAKC,EAAKC,GAC1B,OAAOF,EAAIC,GAAOC,GAItB,SAASM,EAAKC,EAASC,EAASC,EAAMC,GAEpC,IACIC,EAAY1B,OAAO2B,QADFJ,GAAWA,EAAQtB,qBAAqB2B,EAAYL,EAAUK,GACtC3B,WACzC4B,EAAU,IAAIC,EAAQL,GAAe,IAMzC,OAFAC,EAAUK,QAuMZ,SAA0BT,EAASE,EAAMK,GACvC,IAAIG,EAhLuB,iBAkL3B,OAAO,SAAgBC,EAAQC,GAC7B,GAjLoB,cAiLhBF,EACF,MAAM,IAAIG,MAAM,gCAGlB,GApLoB,cAoLhBH,EAA6B,CAC/B,GAAe,UAAXC,EACF,MAAMC,EAKR,MAoQG,CAAEnB,WA1fPqB,EA0fyBC,MAAM,GA9P/B,IAHAR,EAAQI,OAASA,EACjBJ,EAAQK,IAAMA,IAED,CACX,IAAII,EAAWT,EAAQS,SACvB,GAAIA,EAAU,CACZ,IAAIC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C,kBAAgBH,EAAO3F,QAMpC,OACEb,gBAACyG,gBAAatJ,KAAK,kBAAkBoG,WAAME,SAAAA,EAAaD,OACrDhB,EACCxC,oCAAIkE,OAEJlE,uBAAK0C,UAAWA,OAAawB,QAWrC,IAAa8C,EAA2D,CACtE7J,KAAM,kBACNL,YAAa,mBACbsD,WAAY,kBACZC,WAAYV,EACZW,MAAO,CACL2G,WAAY,CACVrN,KAAM,eACN2J,KAAM,SAACjD,EAAOmB,GAAG,MAAA,sBAAKA,SAAAA,EAAK8B,QAAQ,IACnCzG,YAAa,QACbqD,YAAa,qCAKH+G,WACdxE,IAAAA,UACAuE,IAAAA,WACAtE,IAAAA,sBAEM0B,WAAO8C,cAAY,0BAAZC,EAA+BnF,OAC5C,IAAKoC,EACH,OAAOrE,uFAKT,SAHA2C,GAAAA,EAAwB,CACtBY,KAAMc,KAEH4C,EACH,OAAOjH,6EAGT,IAAMuD,EAAOiB,EAAIH,EAAM4C,GACvB,MACkB,iBAAT1D,GACP,aAAcA,GACI,aAAlBA,EAAK8D,SAGHrH,uBACE0C,UAAWA,EACX4E,wBAAyB,CAAEC,OAAQC,uBAAqBjE,MAI5C,iBAATA,GACe,UAAtBA,EAAK1B,IAAI8D,UACTpC,EAAKG,IAEE1D,uBAAK0C,UAAWA,EAAW+E,IAAKlE,EAAKG,MAClCH,EAGHvD,uBAAK0C,UAAWA,GADE,iBAATa,EACmBA,EAEAA,EAAKmE,YAJjC1H,kTC5diB2H,GAI1B,IAAMC,EAAqB,SACzBC,EACAC,GAEIH,EACFA,EAAOI,kBAAkBF,EAAWC,GAEpCC,EAAkBF,EAAWC,IAI7BH,EACFA,EAAOK,sBACLrH,EACAT,GAGF8H,EACErH,EACAT,GAGJ0H,EAAmBnF,EAAmB3B,GACtC8G,EAAmBV,EAAiBF"}
|
|
1
|
+
{"version":3,"file":"plasmic-contentful.cjs.production.min.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/utils.ts","../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","export const searchParameters = [\n {\n value: \"[lt]\",\n label: \"Less than\",\n },\n {\n value: \"[lte]\",\n label: \"Less than or equal\",\n },\n {\n value: \"[gt]\",\n label: \"Greater than\",\n },\n {\n value: \"[gte]\",\n label: \"Greater than or equal \",\n },\n];\n\nexport const uniq = <T>(xs: Array<T>): T[] => Array.from(new Set(xs));\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 { pascalCase } from \"change-case\";\nimport get from \"dlv\";\nimport React, { ReactNode, useContext } from \"react\";\nimport { searchParameters, uniq } from \"./utils\";\nimport { Entry } from \"./types\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\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\nconst makeDataProviderName = (contentType: string) =>\n `currentContentful${pascalCase(contentType)}Item`;\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 {\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 contentType: string;\n children?: ReactNode;\n className?: string;\n limit?: number;\n include?: number;\n order?: string;\n filterField?: string;\n searchParameter?: string;\n filterValue?: string | number;\n noAutoRepeat?: boolean;\n noLayout?: boolean;\n setControlContextData?: (data: {\n types?: { name: string; id: string }[];\n fields?: string[];\n queryOptions?: [];\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\n filterField: {\n type: \"choice\",\n displayName: \"Filter field\",\n description: \"Field (from Collection) to filter by.\",\n options: (props, ctx) => ctx?.fields ?? [],\n hidden: (props, ctx) => !props.contentType,\n },\n searchParameter: {\n type: \"choice\",\n displayName: \"Search Parameter\",\n description:\n \"Search Parameter to filter by (see Contentful Content Delivery API documentation for details).\",\n options: (props, ctx) => ctx?.queryOptions ?? [],\n hidden: (props, ctx) => !props.filterField,\n },\n filterValue: {\n type: \"string\",\n displayName: \"Filter value\",\n description: \"Value to filter by, should be of filter field type.\",\n hidden: (props, ctx) => !props.searchParameter,\n },\n limit: {\n type: \"number\",\n displayName: \"Limit\",\n description: \"Limit the number of entries that are returned.\",\n },\n include: {\n type: \"number\",\n displayName: \"Linked items depth\",\n defaultValueHint: 1,\n description:\n \"When you have related content (e.g. entries with links to image assets) it's possible to include both search results and related data in a single request. Using the include parameter, you can specify the number of levels to resolve.\",\n max: 10,\n min: 0,\n },\n noAutoRepeat: {\n type: \"boolean\",\n displayName: \"No auto-repeat\",\n description: \"Do not automatically repeat children for every entry.\",\n defaultValue: false,\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 filterField,\n filterValue,\n searchParameter,\n noAutoRepeat,\n contentType,\n children,\n className,\n limit,\n include,\n noLayout,\n setControlContextData,\n}: ContentfulFetcherProps) {\n const creds = ensure(useContext(CredentialsContext));\n const cacheKey = JSON.stringify({\n limit,\n filterField,\n filterValue,\n searchParameter,\n creds,\n });\n\n const baseUrl = \"https://cdn.contentful.com\";\n\n const { data: contentTypes } = usePlasmicQueryData<any | null>(\n `${cacheKey}/contentTypes`,\n async () => {\n const resp = await fetch(\n `${baseUrl}/spaces/${creds.space}/environments/${creds.environment}/content_types?access_token=${creds.accessToken}`\n );\n return resp.json();\n }\n );\n setControlContextData?.({\n types: contentTypes?.items ?? [],\n });\n\n const { data: entriesData } = usePlasmicQueryData<any | null>(\n contentType ? `${cacheKey}/${contentType}/entriesData` : null,\n async () => {\n let query = `/spaces/${creds.space}/environments/${creds.environment}/entries?access_token=${creds.accessToken}&content_type=${contentType}`;\n if (limit) {\n query = `${query}&limit=${limit}`;\n }\n if (include) {\n query = `${query}&include=${include}`;\n }\n const resp = await fetch(`${baseUrl}${query}`);\n return resp.json();\n }\n );\n\n const { data: filteredData } = usePlasmicQueryData<any | null>(\n contentType && filterField && filterValue\n ? `${cacheKey}/${contentType}/filteredData`\n : null,\n async () => {\n const queryPath = `/spaces/${creds.space}/environments/${creds.environment}/entries?access_token=${creds.accessToken}&content_type=${contentType}&fields.${filterField}${searchParameter}=${filterValue}`;\n const resp = await fetch(`${baseUrl}${queryPath}`);\n return resp.json();\n }\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 (!contentTypes) {\n return <div>Please configure the Contentful credentials</div>;\n }\n\n if (!entriesData) {\n return <div>Please select a content type</div>;\n }\n\n const filterFields: string[] = entriesData?.items.flatMap((item: any) => {\n const fields = Object.keys(item.fields).filter((field) => {\n const value = get(item, field);\n return typeof value !== \"object\" && field !== \"photos\";\n });\n return fields;\n });\n\n let operators;\n const matchedFields = Object.values(entriesData.items).map((item: any) => {\n const fields = Object.entries(item.fields).find(\n (el) => el[0] === filterField\n );\n return fields;\n });\n\n Object.values(matchedFields)\n .map((model: any) => (Array.isArray(model) ? model : [model]))\n .map((item: any) => {\n if (typeof item[1] === \"number\" && typeof item[1] !== \"object\") {\n operators = searchParameters;\n } else if (\n typeof item[1] !== \"number\" &&\n typeof item[1] !== \"object\" &&\n typeof item[1] === \"string\"\n ) {\n operators = [\n {\n value: \"[match]\",\n label: \"Full text search\",\n },\n ];\n }\n });\n\n setControlContextData?.({\n queryOptions: operators ?? [],\n types: contentTypes?.items ?? [],\n fields: uniq(filterFields ?? []),\n });\n\n if (filterField && !searchParameter) {\n return <div>Please specify a Search Parameter</div>;\n }\n if (searchParameter && !filterValue) {\n return <div>Please specify a Filter value</div>;\n }\n\n function denormalizeData(data: any | null) {\n if (!data?.items || !data?.includes || !data?.includes.Asset) {\n return data; // Return the original data if the required properties are missing\n }\n const itemsWithDenormalizedFields: Entry[] = data.items.map((item: any) => {\n const updatedFields: { [fieldName: string]: unknown | unknown[] } = {};\n\n for (const fieldName in item.fields) {\n const fieldValue = item.fields[fieldName];\n\n if (Array.isArray(fieldValue)) {\n const updatedArray = fieldValue.map((arrayItem) => {\n if (\n arrayItem &&\n typeof arrayItem === \"object\" &&\n \"sys\" in arrayItem &&\n arrayItem.sys.linkType === \"Asset\"\n ) {\n const fieldId = arrayItem.sys.id;\n const asset = data.includes.Asset.find(\n (asset: any) => asset.sys.id === fieldId\n );\n if (asset) {\n return {\n ...arrayItem,\n url: \"https:\" + asset.fields?.file?.url,\n };\n } else {\n console.log(`Asset URL not found for ID: ${fieldId}`);\n }\n }\n return arrayItem;\n });\n updatedFields[fieldName] = updatedArray;\n } else if (\n fieldValue &&\n typeof fieldValue === \"object\" &&\n \"sys\" in fieldValue &&\n fieldValue.sys.linkType === \"Asset\"\n ) {\n const fieldId = fieldValue.sys.id;\n const asset = data.includes.Asset.find(\n (asset: any) => asset.sys.id === fieldId\n );\n if (asset) {\n updatedFields[fieldName] = {\n ...fieldValue,\n url: \"https:\" + asset.fields?.file?.url,\n };\n } else {\n console.log(`Asset URL not found for ID: ${fieldId}`);\n }\n } else {\n updatedFields[fieldName] = fieldValue;\n }\n }\n return {\n ...item,\n fields: updatedFields,\n };\n });\n return {\n ...data,\n items: itemsWithDenormalizedFields,\n };\n }\n\n let renderedData;\n\n if (filteredData) {\n if (filteredData?.items?.length === 0) {\n return <div className={className}>No published entry found</div>;\n }\n\n renderedData = noAutoRepeat\n ? children\n : denormalizeData(filteredData)?.items?.map(\n (item: any, index: number) => (\n <DataProvider\n key={item?.sys?.id}\n name={\"contentfulItem\"}\n data={item}\n hidden={true}\n >\n <DataProvider\n name={makeDataProviderName(contentType)}\n data={item}\n >\n {repeatedElement(index, children)}\n </DataProvider>\n </DataProvider>\n )\n );\n } else {\n if (entriesData?.items?.length === 0) {\n return <div className={className}>{contentType} is empty</div>;\n }\n\n renderedData = noAutoRepeat\n ? children\n : denormalizeData(entriesData)?.items?.map((item: any, index: number) => (\n <DataProvider\n key={item?.sys?.id}\n name={\"contentfulItem\"}\n data={item}\n hidden={true}\n >\n <DataProvider name={makeDataProviderName(contentType)} data={item}>\n {repeatedElement(index, children)}\n </DataProvider>\n </DataProvider>\n ));\n }\n\n return (\n <DataProvider name=\"contentfulItems\" data={entriesData?.items}>\n {noLayout ? (\n <> {renderedData} </>\n ) : (\n <div className={className}> {renderedData} </div>\n )}\n </DataProvider>\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 = 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 data.sys.linkType === \"Asset\" &&\n data.url\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 _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","catch","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","searchParameters","label","ensure","x","modulePath","makeDataProviderName","contentType","pascalCase","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","options","ctx","types","_ctx$types","map","sys","_type$sys","id","filterField","fields","hidden","searchParameter","queryOptions","filterValue","limit","include","defaultValueHint","max","min","noAutoRepeat","noLayout","ContentfulFetcher","className","setControlContextData","creds","useContext","cacheKey","JSON","stringify","baseUrl","contentTypes","usePlasmicQueryData","_context","fetch","json","data","items","entriesData","query","_context2","filteredData","queryPath","_context3","operators","xs","renderedData","filterFields","flatMap","item","filter","field","get","matchedFields","entries","find","el","model","Array","isArray","from","Set","denormalizeData","includes","Asset","itemsWithDenormalizedFields","updatedFields","fieldName","fieldValue","updatedArray","arrayItem","linkType","fieldId","asset","url","_asset$fields","file","_asset$fields$file","console","log","_asset$fields2","_asset$fields2$file","_filteredData$items","_denormalizeData","_denormalizeData$item","index","DataProvider","_item$sys","repeatedElement","_entriesData$items","_denormalizeData2","_denormalizeData2$ite","_item$sys2","ContentfulFieldMeta","objectPath","ContentfulField","useSelector","_useSelector","nodeType","dangerouslySetInnerHTML","__html","documentToHtmlString","src","toString","loader","_registerComponent","Component","defaultMeta","registerComponent","registerGlobalContext"],"mappings":"8hCAOA,IAAIA,EAAW,SAAUC,GAGvB,IAAIC,EAAKC,OAAOC,UACZ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,CACtEjK,KAAM,kBACNL,YAAa,mBACbsD,WAAY,kBACZC,WAAYV,EACZW,MAAO,CACL+G,WAAY,CACVzN,KAAM,eACN+J,KAAM,SAACrD,EAAOmB,GAAG,MAAA,sBAAKA,SAAAA,EAAKkC,QAAQ,IACnC7G,YAAa,QACbqD,YAAa,qCAKHmH,WACdxE,IAAAA,UACAuE,IAAAA,WACAtE,IAAAA,sBAEMyB,WAAO+C,cAAY,0BAAZC,EAA+BvF,OAC5C,IAAKuC,EACH,OAAOxE,uFAKT,SAHA+C,GAAAA,EAAwB,CACtBY,KAAMa,KAEH6C,EACH,OAAOrH,6EAGT,IAAM2D,EAAOgB,EAAIH,EAAM6C,GACvB,MACkB,iBAAT1D,GACP,aAAcA,GACI,aAAlBA,EAAK8D,SAGHzH,uBACE8C,UAAWA,EACX4E,wBAAyB,CAAEC,OAAQC,uBAAqBjE,MAI5C,iBAATA,GACe,UAAtBA,EAAK9B,IAAIiE,UACTnC,EAAKsC,IAEEjG,uBAAK8C,UAAWA,EAAW+E,IAAKlE,EAAKsC,MAClCtC,EAGH3D,uBAAK8C,UAAWA,GADE,iBAATa,EACmBA,EAEAA,EAAKmE,YAJjC9H,kTCteiB+H,GAI1B,IAAMC,EAAqB,SACzBC,EACAC,GAEIH,EACFA,EAAOI,kBAAkBF,EAAWC,GAEpCC,EAAkBF,EAAWC,IAI7BH,EACFA,EAAOK,sBACLzH,EACAT,GAGFkI,EACEzH,EACAT,GAGJ8H,EAAmBnF,EAAmB/B,GACtCkH,EAAmBV,EAAiBF"}
|
|
@@ -859,6 +859,14 @@ var ContentfulFetcherMeta = {
|
|
|
859
859
|
displayName: "Limit",
|
|
860
860
|
description: "Limit the number of entries that are returned."
|
|
861
861
|
},
|
|
862
|
+
include: {
|
|
863
|
+
type: "number",
|
|
864
|
+
displayName: "Linked items depth",
|
|
865
|
+
defaultValueHint: 1,
|
|
866
|
+
description: "When you have related content (e.g. entries with links to image assets) it's possible to include both search results and related data in a single request. Using the include parameter, you can specify the number of levels to resolve.",
|
|
867
|
+
max: 10,
|
|
868
|
+
min: 0
|
|
869
|
+
},
|
|
862
870
|
noAutoRepeat: {
|
|
863
871
|
type: "boolean",
|
|
864
872
|
displayName: "No auto-repeat",
|
|
@@ -883,6 +891,7 @@ function ContentfulFetcher(_ref2) {
|
|
|
883
891
|
children = _ref2.children,
|
|
884
892
|
className = _ref2.className,
|
|
885
893
|
limit = _ref2.limit,
|
|
894
|
+
include = _ref2.include,
|
|
886
895
|
noLayout = _ref2.noLayout,
|
|
887
896
|
setControlContextData = _ref2.setControlContextData;
|
|
888
897
|
var creds = ensure(useContext(CredentialsContext));
|
|
@@ -917,23 +926,24 @@ function ContentfulFetcher(_ref2) {
|
|
|
917
926
|
types: (_contentTypes$items = contentTypes == null ? void 0 : contentTypes.items) != null ? _contentTypes$items : []
|
|
918
927
|
});
|
|
919
928
|
var _usePlasmicQueryData2 = usePlasmicQueryData(contentType ? cacheKey + "/" + contentType + "/entriesData" : null, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
920
|
-
var
|
|
929
|
+
var query, resp;
|
|
921
930
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
922
931
|
while (1) {
|
|
923
932
|
switch (_context2.prev = _context2.next) {
|
|
924
933
|
case 0:
|
|
925
|
-
|
|
934
|
+
query = "/spaces/" + creds.space + "/environments/" + creds.environment + "/entries?access_token=" + creds.accessToken + "&content_type=" + contentType;
|
|
926
935
|
if (limit) {
|
|
927
|
-
query =
|
|
928
|
-
} else {
|
|
929
|
-
query = url;
|
|
936
|
+
query = query + "&limit=" + limit;
|
|
930
937
|
}
|
|
931
|
-
|
|
938
|
+
if (include) {
|
|
939
|
+
query = query + "&include=" + include;
|
|
940
|
+
}
|
|
941
|
+
_context2.next = 5;
|
|
932
942
|
return fetch("" + baseUrl + query);
|
|
933
|
-
case
|
|
943
|
+
case 5:
|
|
934
944
|
resp = _context2.sent;
|
|
935
945
|
return _context2.abrupt("return", resp.json());
|
|
936
|
-
case
|
|
946
|
+
case 7:
|
|
937
947
|
case "end":
|
|
938
948
|
return _context2.stop();
|
|
939
949
|
}
|