@plasmicpkgs/plasmic-strapi 0.1.2 → 0.1.6
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/plasmic-strapi.cjs.development.js +41 -15
- package/dist/plasmic-strapi.cjs.development.js.map +1 -1
- package/dist/plasmic-strapi.cjs.production.min.js +1 -1
- package/dist/plasmic-strapi.cjs.production.min.js.map +1 -1
- package/dist/plasmic-strapi.esm.js +41 -15
- package/dist/plasmic-strapi.esm.js.map +1 -1
- package/dist/strapi.d.ts +4 -1
- package/package.json +2 -2
|
@@ -789,26 +789,30 @@ var CredentialsContext = /*#__PURE__*/React__default.createContext(undefined);
|
|
|
789
789
|
var strapiCredentialsProviderMeta = {
|
|
790
790
|
name: "StrapiCredentialsProvider",
|
|
791
791
|
displayName: "Strapi Credentials Provider",
|
|
792
|
+
description: "API token is needed only if data is not publicly readable. Learn how to [get your API token](https://docs.strapi.io/user-docs/latest/settings/managing-global-settings.html#managing-api-tokens).",
|
|
792
793
|
importName: "StrapiCredentialsProvider",
|
|
793
794
|
importPath: modulePath,
|
|
794
795
|
props: {
|
|
795
796
|
host: {
|
|
796
797
|
type: "string",
|
|
797
798
|
displayName: "Host",
|
|
798
|
-
defaultValueHint: "
|
|
799
|
+
defaultValueHint: "https://strapi-plasmic.herokuapp.com",
|
|
799
800
|
description: "Server where you application is hosted."
|
|
800
801
|
},
|
|
801
802
|
token: {
|
|
802
803
|
type: "string",
|
|
803
804
|
displayName: "API Token",
|
|
804
|
-
description: "API Token (generated in http://yourhost
|
|
805
|
+
description: "API Token (generated in http://yourhost/admin/settings/api-tokens) (or leave blank for unauthenticated usage)."
|
|
805
806
|
}
|
|
806
807
|
}
|
|
807
808
|
};
|
|
808
809
|
function StrapiCredentialsProvider(_ref) {
|
|
810
|
+
var _host;
|
|
811
|
+
|
|
809
812
|
var host = _ref.host,
|
|
810
813
|
token = _ref.token,
|
|
811
814
|
children = _ref.children;
|
|
815
|
+
host = ((_host = host) == null ? void 0 : _host.slice(-1)) === "/" ? host.slice(0, -1) : host;
|
|
812
816
|
return React__default.createElement(CredentialsContext.Provider, {
|
|
813
817
|
value: {
|
|
814
818
|
host: host,
|
|
@@ -858,7 +862,7 @@ function StrapiCollection(_ref2) {
|
|
|
858
862
|
return React__default.createElement("div", null, "Please specify a host.");
|
|
859
863
|
}
|
|
860
864
|
|
|
861
|
-
var query$1 =
|
|
865
|
+
var query$1 = creds.host + "/api/" + name + "?populate=*";
|
|
862
866
|
var cacheKey = JSON.stringify({
|
|
863
867
|
creds: creds,
|
|
864
868
|
name: name
|
|
@@ -878,12 +882,12 @@ function StrapiCollection(_ref2) {
|
|
|
878
882
|
|
|
879
883
|
case 2:
|
|
880
884
|
requestInit = {
|
|
881
|
-
method:
|
|
885
|
+
method: "GET"
|
|
882
886
|
};
|
|
883
887
|
|
|
884
888
|
if (creds.token) {
|
|
885
889
|
requestInit.headers = {
|
|
886
|
-
Authorization:
|
|
890
|
+
Authorization: "Bearer " + creds.token
|
|
887
891
|
};
|
|
888
892
|
}
|
|
889
893
|
|
|
@@ -902,8 +906,12 @@ function StrapiCollection(_ref2) {
|
|
|
902
906
|
}, _callee);
|
|
903
907
|
})));
|
|
904
908
|
|
|
905
|
-
if (!(data != null && data.data)
|
|
906
|
-
return React__default.createElement("div", null, "Please
|
|
909
|
+
if (!(data != null && data.data)) {
|
|
910
|
+
return React__default.createElement("div", null, "Please configure the Strapi provider with a valid host and token.");
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
if (!L.get(data.data, ["data"])) {
|
|
914
|
+
return React__default.createElement("div", null, "Please specify a valid collection.");
|
|
907
915
|
}
|
|
908
916
|
|
|
909
917
|
var collection = L.get(data.data, ["data"]);
|
|
@@ -925,10 +933,14 @@ var strapiFieldMeta = {
|
|
|
925
933
|
importPath: modulePath,
|
|
926
934
|
props: {
|
|
927
935
|
path: {
|
|
928
|
-
type: "
|
|
936
|
+
type: "choice",
|
|
937
|
+
options: function options(props, ctx) {
|
|
938
|
+
var _ctx$fields;
|
|
939
|
+
|
|
940
|
+
return (_ctx$fields = ctx == null ? void 0 : ctx.fields) != null ? _ctx$fields : [];
|
|
941
|
+
},
|
|
929
942
|
displayName: "Field",
|
|
930
|
-
description: "Field name"
|
|
931
|
-
defaultValueHint: "description"
|
|
943
|
+
description: "Field name"
|
|
932
944
|
}
|
|
933
945
|
}
|
|
934
946
|
};
|
|
@@ -936,12 +948,25 @@ function StrapiField(_ref4) {
|
|
|
936
948
|
var _data$data, _data$data$attributes;
|
|
937
949
|
|
|
938
950
|
var className = _ref4.className,
|
|
939
|
-
path = _ref4.path
|
|
951
|
+
path = _ref4.path,
|
|
952
|
+
setControlContextData = _ref4.setControlContextData;
|
|
940
953
|
var item = host.useSelector("strapiItem");
|
|
941
954
|
|
|
942
955
|
if (!item) {
|
|
943
956
|
return React__default.createElement("div", null, "StrapiField must be used within a StrapiCollection");
|
|
944
|
-
}
|
|
957
|
+
} // Getting only fields that aren't objects
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
var attributes = L.get(item, ["attributes"]);
|
|
961
|
+
var displayableFields = Object.keys(attributes).filter(function (field) {
|
|
962
|
+
var _value$data, _value$data$attribute;
|
|
963
|
+
|
|
964
|
+
var value = attributes[field];
|
|
965
|
+
return typeof value !== "object" || ((_value$data = value.data) == null ? void 0 : (_value$data$attribute = _value$data.attributes) == null ? void 0 : _value$data$attribute.mime.startsWith("image"));
|
|
966
|
+
});
|
|
967
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
968
|
+
fields: displayableFields
|
|
969
|
+
});
|
|
945
970
|
|
|
946
971
|
if (!path) {
|
|
947
972
|
return React__default.createElement("div", null, "StrapiField must specify a field name.");
|
|
@@ -953,9 +978,10 @@ function StrapiField(_ref4) {
|
|
|
953
978
|
return React__default.createElement("div", null, "Please specify a valid field name.");
|
|
954
979
|
} else if (data != null && (_data$data = data.data) != null && (_data$data$attributes = _data$data.attributes) != null && _data$data$attributes.mime.startsWith("image")) {
|
|
955
980
|
var creds = ensure(React.useContext(CredentialsContext));
|
|
956
|
-
var
|
|
957
|
-
var
|
|
958
|
-
var
|
|
981
|
+
var attrs = data.data.attributes;
|
|
982
|
+
var img_url = attrs.url.startsWith("http") ? attrs.url : creds.host + attrs.url;
|
|
983
|
+
var img_width = attrs.width;
|
|
984
|
+
var img_height = attrs.height;
|
|
959
985
|
return React__default.createElement("img", {
|
|
960
986
|
src: img_url,
|
|
961
987
|
width: 300,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plasmic-strapi.cjs.development.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/strapi.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 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 = Gp.constructor = GeneratorFunctionPrototype;\n 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 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 Gp[iteratorSymbol] = function() {\n return this;\n };\n\n 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, 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 Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","import { ComponentMeta, DataProvider, GlobalContextMeta, repeatedElement, useSelector } from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\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-strapi\";\n\ninterface StrapiCredentialsProviderProps {\n host?: string;\n token?: string;\n}\n\nconst CredentialsContext = React.createContext<\n StrapiCredentialsProviderProps | undefined\n>(undefined);\n\nexport const strapiCredentialsProviderMeta: GlobalContextMeta<StrapiCredentialsProviderProps> = {\n name: \"StrapiCredentialsProvider\",\n displayName: \"Strapi Credentials Provider\",\n importName: \"StrapiCredentialsProvider\",\n importPath: modulePath,\n props: {\n host: {\n type: \"string\",\n displayName: \"Host\",\n defaultValueHint: \"localhost:1337\",\n description: \"Server where you application is hosted.\",\n },\n token: {\n type: \"string\",\n displayName: \"API Token\",\n description: \"API Token (generated in http://yourhost:1337/admin/settings/api-tokens) (or leave blank for unauthenticated usage).\",\n },\n },\n};\n\nexport function StrapiCredentialsProvider({\n host,\n token,\n children,\n}: React.PropsWithChildren<StrapiCredentialsProviderProps>) {\n return (\n <CredentialsContext.Provider value={{ host, token }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface StrapiCollectionProps {\n name?: string;\n children?: ReactNode;\n className?: string;\n noLayout?: boolean;\n}\n\nexport const strapiCollectionMeta: ComponentMeta<StrapiCollectionProps> = {\n name: \"StrapiCollection\",\n displayName: \"Strapi Collection\",\n importName: \"StrapiCollection\",\n importPath: modulePath,\n description: \"Fetches Strapi data of a given collection and repeats content of children once for every row fetched.\",\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n children: {\n type: \"component\",\n name: \"StrapiField\",\n },\n },\n },\n name: {\n type: \"string\",\n displayName: \"Name\",\n description: \"Name of the collection to be fetched.\",\n defaultValueHint: \"restaurants\",\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description: \"When set, Strapi Collection 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 StrapiCollection({\n name,\n children,\n className,\n noLayout,\n}: StrapiCollectionProps) {\n const creds = ensure(useContext(CredentialsContext));\n\n if (!creds.host) {\n return <div>Please specify a host.</div>;\n }\n\n const query = 'http://' + creds.host + '/api/' + name + '?populate=*';\n const cacheKey = JSON.stringify({\n creds,\n name,\n });\n\n const data = usePlasmicQueryData<any[] | null>(\n cacheKey,\n async () => {\n if (!query) {\n return null;\n }\n\n const requestInit: any = { method: 'GET' };\n if (creds.token) {\n requestInit.headers = { Authorization: 'Bearer ' + creds.token };\n }\n\n const resp = await fetch(query, requestInit);\n return resp.json();\n }\n );\n\n if (!data?.data || !L.get(data.data, [\"data\"])) {\n return <div>Please specify valid host, token (if necessary) and collection name.</div>;\n }\n\n const collection = L.get(data.data, [\"data\"]) as any[];\n\n const repElements = collection.map((item, index) => (\n <DataProvider key={item.id} name={\"strapiItem\"} data={item}>\n {repeatedElement(index === 0, children)}\n </DataProvider>\n ))\n\n return noLayout ? <> {repElements} </> : <div className={className}> {repElements} </div>;\n}\n\ninterface StrapiFieldProps {\n className?: string;\n path?: string;\n}\n\nexport const strapiFieldMeta: ComponentMeta<StrapiFieldProps> = {\n name: \"StrapiField\",\n displayName: \"Strapi Field\",\n importName: \"StrapiField\",\n importPath: modulePath,\n props: {\n path: {\n type: \"string\",\n displayName: \"Field\",\n description: \"Field name\",\n defaultValueHint: \"description\",\n },\n },\n};\n\nexport function StrapiField({\n className,\n path,\n}: StrapiFieldProps) {\n const item = useSelector(\"strapiItem\");\n if (!item) {\n return <div>StrapiField must be used within a StrapiCollection</div>;\n }\n if (!path) {\n return <div>StrapiField must specify a field name.</div>;\n }\n\n const data = L.get(item, [\"attributes\", path]);\n if (!data) {\n return <div>Please specify a valid field name.</div>\n } else if (data?.data?.attributes?.mime.startsWith(\"image\")) {\n const creds = ensure(useContext(CredentialsContext));\n const img_url = 'http://' + creds.host + data.data.attributes.url;\n const img_width = data.data.attributes.width;\n const img_height = data.data.attributes.height;\n return (\n <img\n src={img_url}\n width={300}\n height={300*img_height/img_width}\n />\n );\n } else {\n return <div className={className}>{data}</div>;\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n StrapiCredentialsProvider,\n strapiCredentialsProviderMeta,\n StrapiCollection,\n strapiCollectionMeta,\n StrapiField,\n strapiFieldMeta,\n} from \"./strapi\";\n\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(StrapiCredentialsProvider, strapiCredentialsProviderMeta);\n } else {\n registerGlobalContext(StrapiCredentialsProvider, strapiCredentialsProviderMeta);\n }\n\n _registerComponent(StrapiCollection, strapiCollectionMeta);\n _registerComponent(StrapiField, strapiFieldMeta);\n}\n\nexport * from \"./strapi\";"],"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","constructor","displayName","defineIteratorMethods","forEach","method","isGeneratorFunction","genFun","ctor","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","toString","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","Function","ensure","x","modulePath","CredentialsContext","React","createContext","strapiCredentialsProviderMeta","importName","importPath","props","host","defaultValueHint","description","token","StrapiCredentialsProvider","children","Provider","strapiCollectionMeta","defaultValue","noLayout","StrapiCollection","className","creds","useContext","query","cacheKey","JSON","stringify","data","usePlasmicQueryData","requestInit","headers","Authorization","fetch","resp","json","L","get","collection","repElements","map","item","index","DataProvider","id","repeatedElement","strapiFieldMeta","path","StrapiField","useSelector","attributes","mime","startsWith","img_url","url","img_width","width","img_height","height","src","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,IAAh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AAP,CAA6BpD,yBAA7B,EAAwDR,6BAAxD;AACD,GAFD,MAEO;AACL4D,IAAAA,qBAAqB,CAACpD,yBAAD,EAA4BR,6BAA5B,CAArB;AACD;;AAEDwD,EAAAA,kBAAkB,CAAC1C,gBAAD,EAAmBH,oBAAnB,CAAlB;;AACA6C,EAAAA,kBAAkB,CAACd,WAAD,EAAcF,eAAd,CAAlB;AACD;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plasmic-strapi.cjs.development.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/strapi.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 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 = Gp.constructor = GeneratorFunctionPrototype;\n 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 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 Gp[iteratorSymbol] = function() {\n return this;\n };\n\n 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, 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 Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","import {\n ComponentMeta,\n DataProvider,\n GlobalContextMeta,\n repeatedElement,\n useSelector,\n} from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\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-strapi\";\n\ninterface StrapiCredentialsProviderProps {\n host?: string;\n token?: string;\n}\n\nconst CredentialsContext = React.createContext<\n StrapiCredentialsProviderProps | undefined\n>(undefined);\n\nexport const strapiCredentialsProviderMeta: GlobalContextMeta<StrapiCredentialsProviderProps> = {\n name: \"StrapiCredentialsProvider\",\n displayName: \"Strapi Credentials Provider\",\n description:\n \"API token is needed only if data is not publicly readable. Learn how to [get your API token](https://docs.strapi.io/user-docs/latest/settings/managing-global-settings.html#managing-api-tokens).\",\n importName: \"StrapiCredentialsProvider\",\n importPath: modulePath,\n props: {\n host: {\n type: \"string\",\n displayName: \"Host\",\n defaultValueHint: \"https://strapi-plasmic.herokuapp.com\",\n description: \"Server where you application is hosted.\",\n },\n token: {\n type: \"string\",\n displayName: \"API Token\",\n description:\n \"API Token (generated in http://yourhost/admin/settings/api-tokens) (or leave blank for unauthenticated usage).\",\n },\n },\n};\n\nexport function StrapiCredentialsProvider({\n host,\n token,\n children,\n}: React.PropsWithChildren<StrapiCredentialsProviderProps>) {\n host = host?.slice(-1) === \"/\" ? host.slice(0, -1) : host;\n return (\n <CredentialsContext.Provider value={{ host, token }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface StrapiCollectionProps {\n name?: string;\n children?: ReactNode;\n className?: string;\n noLayout?: boolean;\n}\n\nexport const strapiCollectionMeta: ComponentMeta<StrapiCollectionProps> = {\n name: \"StrapiCollection\",\n displayName: \"Strapi Collection\",\n importName: \"StrapiCollection\",\n importPath: modulePath,\n description:\n \"Fetches Strapi data of a given collection and repeats content of children once for every row fetched.\",\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n children: {\n type: \"component\",\n name: \"StrapiField\",\n },\n },\n },\n name: {\n type: \"string\",\n displayName: \"Name\",\n description: \"Name of the collection to be fetched.\",\n defaultValueHint: \"restaurants\",\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description:\n \"When set, Strapi Collection 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 StrapiCollection({\n name,\n children,\n className,\n noLayout,\n}: StrapiCollectionProps) {\n const creds = ensure(useContext(CredentialsContext));\n\n if (!creds.host) {\n return <div>Please specify a host.</div>;\n }\n\n const query = creds.host + \"/api/\" + name + \"?populate=*\";\n\n const cacheKey = JSON.stringify({\n creds,\n name,\n });\n\n const data = usePlasmicQueryData<any[] | null>(cacheKey, async () => {\n if (!query) {\n return null;\n }\n\n const requestInit: any = { method: \"GET\" };\n if (creds.token) {\n requestInit.headers = { Authorization: \"Bearer \" + creds.token };\n }\n\n const resp = await fetch(query, requestInit);\n return resp.json();\n });\n\n if (!data?.data) {\n return (\n <div>\n Please configure the Strapi provider with a valid host and token.\n </div>\n );\n }\n\n if (!L.get(data.data, [\"data\"])) {\n return <div>Please specify a valid collection.</div>;\n }\n\n const collection = L.get(data.data, [\"data\"]) as any[];\n\n const repElements = collection.map((item, index) => (\n <DataProvider key={item.id} name={\"strapiItem\"} data={item}>\n {repeatedElement(index === 0, children)}\n </DataProvider>\n ));\n\n return noLayout ? (\n <> {repElements} </>\n ) : (\n <div className={className}> {repElements} </div>\n );\n}\n\ninterface StrapiFieldProps {\n className?: string;\n path?: string;\n setControlContextData?: (data: { fields: string[] }) => void;\n}\n\nexport const strapiFieldMeta: ComponentMeta<StrapiFieldProps> = {\n name: \"StrapiField\",\n displayName: \"Strapi Field\",\n importName: \"StrapiField\",\n importPath: modulePath,\n props: {\n path: {\n type: \"choice\",\n options: (props, ctx) => {\n return ctx?.fields ?? [];\n },\n displayName: \"Field\",\n description: \"Field name\",\n },\n },\n};\n\nexport function StrapiField({\n className,\n path,\n setControlContextData,\n}: StrapiFieldProps) {\n const item = useSelector(\"strapiItem\");\n if (!item) {\n return <div>StrapiField must be used within a StrapiCollection</div>;\n }\n\n // Getting only fields that aren't objects\n const attributes = L.get(item, [\"attributes\"]);\n const displayableFields = Object.keys(attributes).filter((field) => {\n const value = attributes[field];\n return (\n typeof value !== \"object\" ||\n value.data?.attributes?.mime.startsWith(\"image\")\n );\n });\n\n setControlContextData?.({\n fields: displayableFields,\n });\n\n if (!path) {\n return <div>StrapiField must specify a field name.</div>;\n }\n\n const data = L.get(item, [\"attributes\", path]);\n if (!data) {\n return <div>Please specify a valid field name.</div>;\n } else if (data?.data?.attributes?.mime.startsWith(\"image\")) {\n const creds = ensure(useContext(CredentialsContext));\n const attrs = data.data.attributes;\n const img_url = attrs.url.startsWith(\"http\")\n ? attrs.url\n : creds.host + attrs.url;\n const img_width = attrs.width;\n const img_height = attrs.height;\n return (\n <img src={img_url} width={300} height={(300 * img_height) / img_width} />\n );\n } else {\n return <div className={className}>{data}</div>;\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n StrapiCredentialsProvider,\n strapiCredentialsProviderMeta,\n StrapiCollection,\n strapiCollectionMeta,\n StrapiField,\n strapiFieldMeta,\n} from \"./strapi\";\n\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(StrapiCredentialsProvider, strapiCredentialsProviderMeta);\n } else {\n registerGlobalContext(StrapiCredentialsProvider, strapiCredentialsProviderMeta);\n }\n\n _registerComponent(StrapiCollection, strapiCollectionMeta);\n _registerComponent(StrapiField, strapiFieldMeta);\n}\n\nexport * from \"./strapi\";"],"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","constructor","displayName","defineIteratorMethods","forEach","method","isGeneratorFunction","genFun","ctor","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","toString","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","Function","ensure","x","modulePath","CredentialsContext","React","createContext","strapiCredentialsProviderMeta","description","importName","importPath","props","host","defaultValueHint","token","StrapiCredentialsProvider","children","Provider","strapiCollectionMeta","defaultValue","noLayout","StrapiCollection","className","creds","useContext","query","cacheKey","JSON","stringify","data","usePlasmicQueryData","requestInit","headers","Authorization","fetch","resp","json","L","get","collection","repElements","map","item","index","DataProvider","id","repeatedElement","strapiFieldMeta","path","options","ctx","fields","StrapiField","setControlContextData","useSelector","attributes","displayableFields","filter","field","mime","startsWith","attrs","img_url","url","img_width","width","img_height","height","src","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,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,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,CAA6B5D,yBAA7B,EAAwDR,6BAAxD;AACD,GAFD,MAEO;AACLoE,IAAAA,qBAAqB,CAAC5D,yBAAD,EAA4BR,6BAA5B,CAArB;AACD;;AAEDgE,EAAAA,kBAAkB,CAAClD,gBAAD,EAAmBH,oBAAnB,CAAlB;;AACAqD,EAAAA,kBAAkB,CAACnB,WAAD,EAAcL,eAAd,CAAlB;AACD;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("@plasmicapp/host/registerComponent")),r=t(require("@plasmicapp/host/registerGlobalContext")),n=require("@plasmicapp/host"),o=require("@plasmicapp/query"),i=t(require("lodash")),a=require("react"),l=t(a);function c(t,e,r,n,o,i,a){try{var l=t[i](a),c=l.value}catch(t){return void r(t)}l.done?e(c):Promise.resolve(c).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){c(i,n,o,a,l,"next",t)}function l(t){c(i,n,o,a,l,"throw",t)}a(void 0)}))}}function s(t,e){return t(e={exports:{}},e.exports),e.exports}var p=s((function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=Object.create((e&&e.prototype instanceof p?e:p).prototype),i=new L(n||[]);return o._invoke=function(t,e,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 c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===s)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var s={};function p(){}function h(){}function f(){}var d={};d[o]=function(){return this};var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==e&&r.call(m,o)&&(d=m);var y=f.prototype=p.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,l){var c=u(t[o],t,i);if("throw"!==c.type){var s=c.arg,p=s.value;return p&&"object"==typeof p&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,a,l)}),(function(t){n("throw",t,a,l)})):e.resolve(p).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,l)}))}l(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:N}}function N(){return{value:void 0,done:!0}}return h.prototype=y.constructor=f,f.constructor=h,h.displayName=l(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,l(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(w.prototype),w.prototype[i]=function(){return this},t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),l(y,a,"Generator"),y[o]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,L.prototype={constructor:L,reset:function(t){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(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.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"),c=r.call(i,"finallyLoc");if(l&&c){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(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){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"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}));function h(t){if(null==t)throw new Error("Value must not be undefined or null");return t}var f="@plasmicpkgs/plasmic-strapi",d=l.createContext(void 0),v={name:"StrapiCredentialsProvider",displayName:"Strapi Credentials Provider",importName:"StrapiCredentialsProvider",importPath:f,props:{host:{type:"string",displayName:"Host",defaultValueHint:"localhost:1337",description:"Server where you application is hosted."},token:{type:"string",displayName:"API Token",description:"API Token (generated in http://yourhost:1337/admin/settings/api-tokens) (or leave blank for unauthenticated usage)."}}};function m(t){return l.createElement(d.Provider,{value:{host:t.host,token:t.token}},t.children)}var y={name:"StrapiCollection",displayName:"Strapi Collection",importName:"StrapiCollection",importPath:f,description:"Fetches Strapi data of a given collection and repeats content of children once for every row fetched.",props:{children:{type:"slot",defaultValue:{type:"vbox",children:{type:"component",name:"StrapiField"}}},name:{type:"string",displayName:"Name",description:"Name of the collection to be fetched.",defaultValueHint:"restaurants"},noLayout:{type:"boolean",displayName:"No layout",description:"When set, Strapi Collection 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 g(t){var e=t.name,r=t.children,c=t.className,s=t.noLayout,f=h(a.useContext(d));if(!f.host)return l.createElement("div",null,"Please specify a host.");var v="http://"+f.host+"/api/"+e+"?populate=*",m=JSON.stringify({creds:f,name:e}),y=o.usePlasmicQueryData(m,u(p.mark((function t(){var e;return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(v){t.next=2;break}return t.abrupt("return",null);case 2:return e={method:"GET"},f.token&&(e.headers={Authorization:"Bearer "+f.token}),t.next=6,fetch(v,e);case 6:return t.abrupt("return",t.sent.json());case 8:case"end":return t.stop()}}),t)}))));if(null==y||!y.data||!i.get(y.data,["data"]))return l.createElement("div",null,"Please specify valid host, token (if necessary) and collection name.");var g=i.get(y.data,["data"]).map((function(t,e){return l.createElement(n.DataProvider,{key:t.id,name:"strapiItem",data:t},n.repeatedElement(0===e,r))}));return s?l.createElement(l.Fragment,null," ",g," "):l.createElement("div",{className:c}," ",g," ")}var w={name:"StrapiField",displayName:"Strapi Field",importName:"StrapiField",importPath:f,props:{path:{type:"string",displayName:"Field",description:"Field name",defaultValueHint:"description"}}};function x(t){var e,r,o=t.className,c=t.path,u=n.useSelector("strapiItem");if(!u)return l.createElement("div",null,"StrapiField must be used within a StrapiCollection");if(!c)return l.createElement("div",null,"StrapiField must specify a field name.");var s=i.get(u,["attributes",c]);if(s){if(null!=s&&null!=(e=s.data)&&null!=(r=e.attributes)&&r.mime.startsWith("image")){var p=h(a.useContext(d));return l.createElement("img",{src:"http://"+p.host+s.data.attributes.url,width:300,height:300*s.data.attributes.height/s.data.attributes.width})}return l.createElement("div",{className:o},s)}return l.createElement("div",null,"Please specify a valid field name.")}exports.StrapiCollection=g,exports.StrapiCredentialsProvider=m,exports.StrapiField=x,exports.ensure=h,exports.registerAll=function(t){var n=function(r,n){t?t.registerComponent(r,n):e(r,n)};t?t.registerGlobalContext(m,v):r(m,v),n(g,y),n(x,w)},exports.strapiCollectionMeta=y,exports.strapiCredentialsProviderMeta=v,exports.strapiFieldMeta=w;
|
|
1
|
+
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("@plasmicapp/host/registerComponent")),r=t(require("@plasmicapp/host/registerGlobalContext")),n=require("@plasmicapp/host"),o=require("@plasmicapp/query"),i=t(require("lodash")),a=require("react"),l=t(a);function u(t,e,r,n,o,i,a){try{var l=t[i](a),u=l.value}catch(t){return void r(t)}l.done?e(u):Promise.resolve(u).then(n,o)}function s(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){u(i,n,o,a,l,"next",t)}function l(t){u(i,n,o,a,l,"throw",t)}a(void 0)}))}}function c(t,e){return t(e={exports:{}},e.exports),e.exports}var p=c((function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof p?e:p).prototype),i=new L(n||[]);return o._invoke=function(t,e,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===c)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=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var c={};function p(){}function h(){}function f(){}var d={};d[o]=function(){return this};var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==e&&r.call(m,o)&&(d=m);var y=f.prototype=p.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,l){var u=s(t[o],t,i);if("throw"!==u.type){var c=u.arg,p=c.value;return p&&"object"==typeof p&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,a,l)}),(function(t){n("throw",t,a,l)})):e.resolve(p).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,l)}))}l(u.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,c;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return h.prototype=y.constructor=f,f.constructor=h,h.displayName=l(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,l(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(w.prototype),w.prototype[i]=function(){return this},t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),l(y,a,"Generator"),y[o]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,L.prototype={constructor:L,reset:function(t){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(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.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(t,e){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"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,c):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),c},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}));function h(t){if(null==t)throw new Error("Value must not be undefined or null");return t}var f="@plasmicpkgs/plasmic-strapi",d=l.createContext(void 0),v={name:"StrapiCredentialsProvider",displayName:"Strapi Credentials Provider",description:"API token is needed only if data is not publicly readable. Learn how to [get your API token](https://docs.strapi.io/user-docs/latest/settings/managing-global-settings.html#managing-api-tokens).",importName:"StrapiCredentialsProvider",importPath:f,props:{host:{type:"string",displayName:"Host",defaultValueHint:"https://strapi-plasmic.herokuapp.com",description:"Server where you application is hosted."},token:{type:"string",displayName:"API Token",description:"API Token (generated in http://yourhost/admin/settings/api-tokens) (or leave blank for unauthenticated usage)."}}};function m(t){var e,r=t.host,n=t.token,o=t.children;return r="/"===(null==(e=r)?void 0:e.slice(-1))?r.slice(0,-1):r,l.createElement(d.Provider,{value:{host:r,token:n}},o)}var y={name:"StrapiCollection",displayName:"Strapi Collection",importName:"StrapiCollection",importPath:f,description:"Fetches Strapi data of a given collection and repeats content of children once for every row fetched.",props:{children:{type:"slot",defaultValue:{type:"vbox",children:{type:"component",name:"StrapiField"}}},name:{type:"string",displayName:"Name",description:"Name of the collection to be fetched.",defaultValueHint:"restaurants"},noLayout:{type:"boolean",displayName:"No layout",description:"When set, Strapi Collection 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 g(t){var e=t.name,r=t.children,u=t.className,c=t.noLayout,f=h(a.useContext(d));if(!f.host)return l.createElement("div",null,"Please specify a host.");var v=f.host+"/api/"+e+"?populate=*",m=JSON.stringify({creds:f,name:e}),y=o.usePlasmicQueryData(m,s(p.mark((function t(){var e;return p.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(v){t.next=2;break}return t.abrupt("return",null);case 2:return e={method:"GET"},f.token&&(e.headers={Authorization:"Bearer "+f.token}),t.next=6,fetch(v,e);case 6:return t.abrupt("return",t.sent.json());case 8:case"end":return t.stop()}}),t)}))));if(null==y||!y.data)return l.createElement("div",null,"Please configure the Strapi provider with a valid host and token.");if(!i.get(y.data,["data"]))return l.createElement("div",null,"Please specify a valid collection.");var g=i.get(y.data,["data"]).map((function(t,e){return l.createElement(n.DataProvider,{key:t.id,name:"strapiItem",data:t},n.repeatedElement(0===e,r))}));return c?l.createElement(l.Fragment,null," ",g," "):l.createElement("div",{className:u}," ",g," ")}var w={name:"StrapiField",displayName:"Strapi Field",importName:"StrapiField",importPath:f,props:{path:{type:"choice",options:function(t,e){var r;return null!=(r=null==e?void 0:e.fields)?r:[]},displayName:"Field",description:"Field name"}}};function x(t){var e,r,o=t.className,u=t.path,s=t.setControlContextData,c=n.useSelector("strapiItem");if(!c)return l.createElement("div",null,"StrapiField must be used within a StrapiCollection");var p=i.get(c,["attributes"]),f=Object.keys(p).filter((function(t){var e,r,n=p[t];return"object"!=typeof n||(null==(e=n.data)||null==(r=e.attributes)?void 0:r.mime.startsWith("image"))}));if(null==s||s({fields:f}),!u)return l.createElement("div",null,"StrapiField must specify a field name.");var v=i.get(c,["attributes",u]);if(v){if(null!=v&&null!=(e=v.data)&&null!=(r=e.attributes)&&r.mime.startsWith("image")){var m=h(a.useContext(d)),y=v.data.attributes,g=y.url.startsWith("http")?y.url:m.host+y.url;return l.createElement("img",{src:g,width:300,height:300*y.height/y.width})}return l.createElement("div",{className:o},v)}return l.createElement("div",null,"Please specify a valid field name.")}exports.StrapiCollection=g,exports.StrapiCredentialsProvider=m,exports.StrapiField=x,exports.ensure=h,exports.registerAll=function(t){var n=function(r,n){t?t.registerComponent(r,n):e(r,n)};t?t.registerGlobalContext(m,v):r(m,v),n(g,y),n(x,w)},exports.strapiCollectionMeta=y,exports.strapiCredentialsProviderMeta=v,exports.strapiFieldMeta=w;
|
|
2
2
|
//# sourceMappingURL=plasmic-strapi.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plasmic-strapi.cjs.production.min.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/strapi.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 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 = Gp.constructor = GeneratorFunctionPrototype;\n 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 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 Gp[iteratorSymbol] = function() {\n return this;\n };\n\n 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, 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 Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","import { ComponentMeta, DataProvider, GlobalContextMeta, repeatedElement, useSelector } from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\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-strapi\";\n\ninterface StrapiCredentialsProviderProps {\n host?: string;\n token?: string;\n}\n\nconst CredentialsContext = React.createContext<\n StrapiCredentialsProviderProps | undefined\n>(undefined);\n\nexport const strapiCredentialsProviderMeta: GlobalContextMeta<StrapiCredentialsProviderProps> = {\n name: \"StrapiCredentialsProvider\",\n displayName: \"Strapi Credentials Provider\",\n importName: \"StrapiCredentialsProvider\",\n importPath: modulePath,\n props: {\n host: {\n type: \"string\",\n displayName: \"Host\",\n defaultValueHint: \"localhost:1337\",\n description: \"Server where you application is hosted.\",\n },\n token: {\n type: \"string\",\n displayName: \"API Token\",\n description: \"API Token (generated in http://yourhost:1337/admin/settings/api-tokens) (or leave blank for unauthenticated usage).\",\n },\n },\n};\n\nexport function StrapiCredentialsProvider({\n host,\n token,\n children,\n}: React.PropsWithChildren<StrapiCredentialsProviderProps>) {\n return (\n <CredentialsContext.Provider value={{ host, token }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface StrapiCollectionProps {\n name?: string;\n children?: ReactNode;\n className?: string;\n noLayout?: boolean;\n}\n\nexport const strapiCollectionMeta: ComponentMeta<StrapiCollectionProps> = {\n name: \"StrapiCollection\",\n displayName: \"Strapi Collection\",\n importName: \"StrapiCollection\",\n importPath: modulePath,\n description: \"Fetches Strapi data of a given collection and repeats content of children once for every row fetched.\",\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n children: {\n type: \"component\",\n name: \"StrapiField\",\n },\n },\n },\n name: {\n type: \"string\",\n displayName: \"Name\",\n description: \"Name of the collection to be fetched.\",\n defaultValueHint: \"restaurants\",\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description: \"When set, Strapi Collection 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 StrapiCollection({\n name,\n children,\n className,\n noLayout,\n}: StrapiCollectionProps) {\n const creds = ensure(useContext(CredentialsContext));\n\n if (!creds.host) {\n return <div>Please specify a host.</div>;\n }\n\n const query = 'http://' + creds.host + '/api/' + name + '?populate=*';\n const cacheKey = JSON.stringify({\n creds,\n name,\n });\n\n const data = usePlasmicQueryData<any[] | null>(\n cacheKey,\n async () => {\n if (!query) {\n return null;\n }\n\n const requestInit: any = { method: 'GET' };\n if (creds.token) {\n requestInit.headers = { Authorization: 'Bearer ' + creds.token };\n }\n\n const resp = await fetch(query, requestInit);\n return resp.json();\n }\n );\n\n if (!data?.data || !L.get(data.data, [\"data\"])) {\n return <div>Please specify valid host, token (if necessary) and collection name.</div>;\n }\n\n const collection = L.get(data.data, [\"data\"]) as any[];\n\n const repElements = collection.map((item, index) => (\n <DataProvider key={item.id} name={\"strapiItem\"} data={item}>\n {repeatedElement(index === 0, children)}\n </DataProvider>\n ))\n\n return noLayout ? <> {repElements} </> : <div className={className}> {repElements} </div>;\n}\n\ninterface StrapiFieldProps {\n className?: string;\n path?: string;\n}\n\nexport const strapiFieldMeta: ComponentMeta<StrapiFieldProps> = {\n name: \"StrapiField\",\n displayName: \"Strapi Field\",\n importName: \"StrapiField\",\n importPath: modulePath,\n props: {\n path: {\n type: \"string\",\n displayName: \"Field\",\n description: \"Field name\",\n defaultValueHint: \"description\",\n },\n },\n};\n\nexport function StrapiField({\n className,\n path,\n}: StrapiFieldProps) {\n const item = useSelector(\"strapiItem\");\n if (!item) {\n return <div>StrapiField must be used within a StrapiCollection</div>;\n }\n if (!path) {\n return <div>StrapiField must specify a field name.</div>;\n }\n\n const data = L.get(item, [\"attributes\", path]);\n if (!data) {\n return <div>Please specify a valid field name.</div>\n } else if (data?.data?.attributes?.mime.startsWith(\"image\")) {\n const creds = ensure(useContext(CredentialsContext));\n const img_url = 'http://' + creds.host + data.data.attributes.url;\n const img_width = data.data.attributes.width;\n const img_height = data.data.attributes.height;\n return (\n <img\n src={img_url}\n width={300}\n height={300*img_height/img_width}\n />\n );\n } else {\n return <div className={className}>{data}</div>;\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n StrapiCredentialsProvider,\n strapiCredentialsProviderMeta,\n StrapiCollection,\n strapiCollectionMeta,\n StrapiField,\n strapiFieldMeta,\n} from \"./strapi\";\n\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(StrapiCredentialsProvider, strapiCredentialsProviderMeta);\n } else {\n registerGlobalContext(StrapiCredentialsProvider, strapiCredentialsProviderMeta);\n }\n\n _registerComponent(StrapiCollection, strapiCollectionMeta);\n _registerComponent(StrapiField, strapiFieldMeta);\n}\n\nexport * from \"./strapi\";"],"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","constructor","displayName","isGeneratorFunction","genFun","ctor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","toString","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","Function","ensure","x","modulePath","CredentialsContext","React","createContext","strapiCredentialsProviderMeta","importName","importPath","props","host","defaultValueHint","description","token","StrapiCredentialsProvider","Provider","children","strapiCollectionMeta","defaultValue","noLayout","StrapiCollection","className","creds","useContext","query","cacheKey","JSON","stringify","data","usePlasmicQueryData","requestInit","headers","Authorization","fetch","json","L","get","repElements","map","item","index","DataProvider","id","repeatedElement","strapiFieldMeta","path","StrapiField","useSelector","_data$data","attributes","_data$data$attributes","mime","startsWith","src","url","width","height","loader","_registerComponent","Component","defaultMeta","registerComponent","registerGlobalContext"],"mappings":"wvBAOIA,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,OA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,iBAAkB,0BAKRmC,aACdzB,IAAAA,UACAwB,IAAAA,KAEMN,EAAOQ,cAAY,kBACpBR,SACInC,qFAEJyC,SACIzC,yEAGHwB,EAAOO,EAAEC,IAAIG,EAAM,CAAC,aAAcM,OACnCjB,EAEE,CAAA,SAAIA,YAAAA,EAAMA,gBAANoB,EAAYC,aAAZC,EAAwBC,KAAKC,WAAW,SAAU,KACrD9B,EAAQtB,EAAOuB,aAAWpB,WAK9BC,uBACEiD,IALY,UAAY/B,EAAMZ,KAAOkB,EAAKA,KAAKqB,WAAWK,IAM1DC,MAAO,IACPC,OAAQ,IALO5B,EAAKA,KAAKqB,WAAWO,OADtB5B,EAAKA,KAAKqB,WAAWM,eAUhCnD,uBAAKiB,UAAWA,GAAYO,UAd5BxB,oMCtKiBqD,OAIpBC,EAAqB,SACzBC,EACAC,GAEIH,EACFA,EAAOI,kBAAkBF,EAAWC,GAEpCC,EAAkBF,EAAWC,IAI7BH,EACFA,EAAOK,sBAAsBhD,EAA2BR,GAExDwD,EAAsBhD,EAA2BR,GAGnDoD,EAAmBtC,EAAkBH,GACrCyC,EAAmBZ,EAAaF"}
|
|
1
|
+
{"version":3,"file":"plasmic-strapi.cjs.production.min.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/strapi.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 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 = Gp.constructor = GeneratorFunctionPrototype;\n 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 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 Gp[iteratorSymbol] = function() {\n return this;\n };\n\n 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, 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 Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","import {\n ComponentMeta,\n DataProvider,\n GlobalContextMeta,\n repeatedElement,\n useSelector,\n} from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\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-strapi\";\n\ninterface StrapiCredentialsProviderProps {\n host?: string;\n token?: string;\n}\n\nconst CredentialsContext = React.createContext<\n StrapiCredentialsProviderProps | undefined\n>(undefined);\n\nexport const strapiCredentialsProviderMeta: GlobalContextMeta<StrapiCredentialsProviderProps> = {\n name: \"StrapiCredentialsProvider\",\n displayName: \"Strapi Credentials Provider\",\n description:\n \"API token is needed only if data is not publicly readable. Learn how to [get your API token](https://docs.strapi.io/user-docs/latest/settings/managing-global-settings.html#managing-api-tokens).\",\n importName: \"StrapiCredentialsProvider\",\n importPath: modulePath,\n props: {\n host: {\n type: \"string\",\n displayName: \"Host\",\n defaultValueHint: \"https://strapi-plasmic.herokuapp.com\",\n description: \"Server where you application is hosted.\",\n },\n token: {\n type: \"string\",\n displayName: \"API Token\",\n description:\n \"API Token (generated in http://yourhost/admin/settings/api-tokens) (or leave blank for unauthenticated usage).\",\n },\n },\n};\n\nexport function StrapiCredentialsProvider({\n host,\n token,\n children,\n}: React.PropsWithChildren<StrapiCredentialsProviderProps>) {\n host = host?.slice(-1) === \"/\" ? host.slice(0, -1) : host;\n return (\n <CredentialsContext.Provider value={{ host, token }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface StrapiCollectionProps {\n name?: string;\n children?: ReactNode;\n className?: string;\n noLayout?: boolean;\n}\n\nexport const strapiCollectionMeta: ComponentMeta<StrapiCollectionProps> = {\n name: \"StrapiCollection\",\n displayName: \"Strapi Collection\",\n importName: \"StrapiCollection\",\n importPath: modulePath,\n description:\n \"Fetches Strapi data of a given collection and repeats content of children once for every row fetched.\",\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n children: {\n type: \"component\",\n name: \"StrapiField\",\n },\n },\n },\n name: {\n type: \"string\",\n displayName: \"Name\",\n description: \"Name of the collection to be fetched.\",\n defaultValueHint: \"restaurants\",\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description:\n \"When set, Strapi Collection 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 StrapiCollection({\n name,\n children,\n className,\n noLayout,\n}: StrapiCollectionProps) {\n const creds = ensure(useContext(CredentialsContext));\n\n if (!creds.host) {\n return <div>Please specify a host.</div>;\n }\n\n const query = creds.host + \"/api/\" + name + \"?populate=*\";\n\n const cacheKey = JSON.stringify({\n creds,\n name,\n });\n\n const data = usePlasmicQueryData<any[] | null>(cacheKey, async () => {\n if (!query) {\n return null;\n }\n\n const requestInit: any = { method: \"GET\" };\n if (creds.token) {\n requestInit.headers = { Authorization: \"Bearer \" + creds.token };\n }\n\n const resp = await fetch(query, requestInit);\n return resp.json();\n });\n\n if (!data?.data) {\n return (\n <div>\n Please configure the Strapi provider with a valid host and token.\n </div>\n );\n }\n\n if (!L.get(data.data, [\"data\"])) {\n return <div>Please specify a valid collection.</div>;\n }\n\n const collection = L.get(data.data, [\"data\"]) as any[];\n\n const repElements = collection.map((item, index) => (\n <DataProvider key={item.id} name={\"strapiItem\"} data={item}>\n {repeatedElement(index === 0, children)}\n </DataProvider>\n ));\n\n return noLayout ? (\n <> {repElements} </>\n ) : (\n <div className={className}> {repElements} </div>\n );\n}\n\ninterface StrapiFieldProps {\n className?: string;\n path?: string;\n setControlContextData?: (data: { fields: string[] }) => void;\n}\n\nexport const strapiFieldMeta: ComponentMeta<StrapiFieldProps> = {\n name: \"StrapiField\",\n displayName: \"Strapi Field\",\n importName: \"StrapiField\",\n importPath: modulePath,\n props: {\n path: {\n type: \"choice\",\n options: (props, ctx) => {\n return ctx?.fields ?? [];\n },\n displayName: \"Field\",\n description: \"Field name\",\n },\n },\n};\n\nexport function StrapiField({\n className,\n path,\n setControlContextData,\n}: StrapiFieldProps) {\n const item = useSelector(\"strapiItem\");\n if (!item) {\n return <div>StrapiField must be used within a StrapiCollection</div>;\n }\n\n // Getting only fields that aren't objects\n const attributes = L.get(item, [\"attributes\"]);\n const displayableFields = Object.keys(attributes).filter((field) => {\n const value = attributes[field];\n return (\n typeof value !== \"object\" ||\n value.data?.attributes?.mime.startsWith(\"image\")\n );\n });\n\n setControlContextData?.({\n fields: displayableFields,\n });\n\n if (!path) {\n return <div>StrapiField must specify a field name.</div>;\n }\n\n const data = L.get(item, [\"attributes\", path]);\n if (!data) {\n return <div>Please specify a valid field name.</div>;\n } else if (data?.data?.attributes?.mime.startsWith(\"image\")) {\n const creds = ensure(useContext(CredentialsContext));\n const attrs = data.data.attributes;\n const img_url = attrs.url.startsWith(\"http\")\n ? attrs.url\n : creds.host + attrs.url;\n const img_width = attrs.width;\n const img_height = attrs.height;\n return (\n <img src={img_url} width={300} height={(300 * img_height) / img_width} />\n );\n } else {\n return <div className={className}>{data}</div>;\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n StrapiCredentialsProvider,\n strapiCredentialsProviderMeta,\n StrapiCollection,\n strapiCollectionMeta,\n StrapiField,\n strapiFieldMeta,\n} from \"./strapi\";\n\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(StrapiCredentialsProvider, strapiCredentialsProviderMeta);\n } else {\n registerGlobalContext(StrapiCredentialsProvider, strapiCredentialsProviderMeta);\n }\n\n _registerComponent(StrapiCollection, strapiCollectionMeta);\n _registerComponent(StrapiField, strapiFieldMeta);\n}\n\nexport * from \"./strapi\";"],"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","constructor","displayName","isGeneratorFunction","genFun","ctor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","toString","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","Function","ensure","x","modulePath","CredentialsContext","React","createContext","strapiCredentialsProviderMeta","description","importName","importPath","props","host","defaultValueHint","token","StrapiCredentialsProvider","children","Provider","strapiCollectionMeta","defaultValue","noLayout","StrapiCollection","className","creds","useContext","query","cacheKey","JSON","stringify","data","usePlasmicQueryData","requestInit","headers","Authorization","fetch","json","L","get","repElements","map","item","index","DataProvider","id","repeatedElement","strapiFieldMeta","path","options","ctx","fields","StrapiField","setControlContextData","useSelector","attributes","displayableFields","filter","field","_value$data","_value$data$attribute","mime","startsWith","_data$data","_data$data$attributes","attrs","img_url","url","src","width","height","loader","_registerComponent","Component","defaultMeta","registerComponent","registerGlobalContext"],"mappings":"wvBAOIA,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,U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C,KAAM,CACJvI,KAAM,SACNwI,QAAS,SAACpC,EAAOqC,+BACRA,SAAAA,EAAKC,UAAU,IAExBvF,YAAa,QACb8C,YAAa,yBAKH0C,aACd5B,IAAAA,UACAwB,IAAAA,KACAK,IAAAA,sBAEMX,EAAOY,cAAY,kBACpBZ,SACInC,qFAIHgD,EAAajB,EAAEC,IAAIG,EAAM,CAAC,eAC1Bc,EAAoB/L,OAAOgH,KAAK8E,GAAYE,QAAO,SAACC,WAClDlL,EAAQ+K,EAAWG,SAEN,iBAAVlL,aACPA,EAAMuJ,gBAAN4B,EAAYJ,mBAAZK,EAAwBC,KAAKC,WAAW,sBAI5CT,GAAAA,EAAwB,CACtBF,OAAQK,KAGLR,SACIzC,yEAGHwB,EAAOO,EAAEC,IAAIG,EAAM,CAAC,aAAcM,OACnCjB,EAEE,CAAA,SAAIA,YAAAA,EAAMA,gBAANgC,EAAYR,aAAZS,EAAwBH,KAAKC,WAAW,SAAU,KACrDrC,EAAQtB,EAAOuB,aAAWpB,IAC1B2D,EAAQlC,EAAKA,KAAKwB,WAClBW,EAAUD,EAAME,IAAIL,WAAW,QACjCG,EAAME,IACN1C,EAAMX,KAAOmD,EAAME,WAIrB5D,uBAAK6D,IAAKF,EAASG,MAAO,IAAKC,OAAS,IAFvBL,EAAMK,OADPL,EAAMI,eAMjB9D,uBAAKiB,UAAWA,GAAYO,UAb5BxB,oMC/MiBgE,OAIpBC,EAAqB,SACzBC,EACAC,GAEIH,EACFA,EAAOI,kBAAkBF,EAAWC,GAEpCC,EAAkBF,EAAWC,IAI7BH,EACFA,EAAOK,sBAAsB3D,EAA2BR,GAExDmE,EAAsB3D,EAA2BR,GAGnD+D,EAAmBjD,EAAkBH,GACrCoD,EAAmBpB,EAAaL"}
|
|
@@ -782,26 +782,30 @@ var CredentialsContext = /*#__PURE__*/React.createContext(undefined);
|
|
|
782
782
|
var strapiCredentialsProviderMeta = {
|
|
783
783
|
name: "StrapiCredentialsProvider",
|
|
784
784
|
displayName: "Strapi Credentials Provider",
|
|
785
|
+
description: "API token is needed only if data is not publicly readable. Learn how to [get your API token](https://docs.strapi.io/user-docs/latest/settings/managing-global-settings.html#managing-api-tokens).",
|
|
785
786
|
importName: "StrapiCredentialsProvider",
|
|
786
787
|
importPath: modulePath,
|
|
787
788
|
props: {
|
|
788
789
|
host: {
|
|
789
790
|
type: "string",
|
|
790
791
|
displayName: "Host",
|
|
791
|
-
defaultValueHint: "
|
|
792
|
+
defaultValueHint: "https://strapi-plasmic.herokuapp.com",
|
|
792
793
|
description: "Server where you application is hosted."
|
|
793
794
|
},
|
|
794
795
|
token: {
|
|
795
796
|
type: "string",
|
|
796
797
|
displayName: "API Token",
|
|
797
|
-
description: "API Token (generated in http://yourhost
|
|
798
|
+
description: "API Token (generated in http://yourhost/admin/settings/api-tokens) (or leave blank for unauthenticated usage)."
|
|
798
799
|
}
|
|
799
800
|
}
|
|
800
801
|
};
|
|
801
802
|
function StrapiCredentialsProvider(_ref) {
|
|
803
|
+
var _host;
|
|
804
|
+
|
|
802
805
|
var host = _ref.host,
|
|
803
806
|
token = _ref.token,
|
|
804
807
|
children = _ref.children;
|
|
808
|
+
host = ((_host = host) == null ? void 0 : _host.slice(-1)) === "/" ? host.slice(0, -1) : host;
|
|
805
809
|
return React.createElement(CredentialsContext.Provider, {
|
|
806
810
|
value: {
|
|
807
811
|
host: host,
|
|
@@ -851,7 +855,7 @@ function StrapiCollection(_ref2) {
|
|
|
851
855
|
return React.createElement("div", null, "Please specify a host.");
|
|
852
856
|
}
|
|
853
857
|
|
|
854
|
-
var query =
|
|
858
|
+
var query = creds.host + "/api/" + name + "?populate=*";
|
|
855
859
|
var cacheKey = JSON.stringify({
|
|
856
860
|
creds: creds,
|
|
857
861
|
name: name
|
|
@@ -871,12 +875,12 @@ function StrapiCollection(_ref2) {
|
|
|
871
875
|
|
|
872
876
|
case 2:
|
|
873
877
|
requestInit = {
|
|
874
|
-
method:
|
|
878
|
+
method: "GET"
|
|
875
879
|
};
|
|
876
880
|
|
|
877
881
|
if (creds.token) {
|
|
878
882
|
requestInit.headers = {
|
|
879
|
-
Authorization:
|
|
883
|
+
Authorization: "Bearer " + creds.token
|
|
880
884
|
};
|
|
881
885
|
}
|
|
882
886
|
|
|
@@ -895,8 +899,12 @@ function StrapiCollection(_ref2) {
|
|
|
895
899
|
}, _callee);
|
|
896
900
|
})));
|
|
897
901
|
|
|
898
|
-
if (!(data != null && data.data)
|
|
899
|
-
return React.createElement("div", null, "Please
|
|
902
|
+
if (!(data != null && data.data)) {
|
|
903
|
+
return React.createElement("div", null, "Please configure the Strapi provider with a valid host and token.");
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
if (!L.get(data.data, ["data"])) {
|
|
907
|
+
return React.createElement("div", null, "Please specify a valid collection.");
|
|
900
908
|
}
|
|
901
909
|
|
|
902
910
|
var collection = L.get(data.data, ["data"]);
|
|
@@ -918,10 +926,14 @@ var strapiFieldMeta = {
|
|
|
918
926
|
importPath: modulePath,
|
|
919
927
|
props: {
|
|
920
928
|
path: {
|
|
921
|
-
type: "
|
|
929
|
+
type: "choice",
|
|
930
|
+
options: function options(props, ctx) {
|
|
931
|
+
var _ctx$fields;
|
|
932
|
+
|
|
933
|
+
return (_ctx$fields = ctx == null ? void 0 : ctx.fields) != null ? _ctx$fields : [];
|
|
934
|
+
},
|
|
922
935
|
displayName: "Field",
|
|
923
|
-
description: "Field name"
|
|
924
|
-
defaultValueHint: "description"
|
|
936
|
+
description: "Field name"
|
|
925
937
|
}
|
|
926
938
|
}
|
|
927
939
|
};
|
|
@@ -929,12 +941,25 @@ function StrapiField(_ref4) {
|
|
|
929
941
|
var _data$data, _data$data$attributes;
|
|
930
942
|
|
|
931
943
|
var className = _ref4.className,
|
|
932
|
-
path = _ref4.path
|
|
944
|
+
path = _ref4.path,
|
|
945
|
+
setControlContextData = _ref4.setControlContextData;
|
|
933
946
|
var item = useSelector("strapiItem");
|
|
934
947
|
|
|
935
948
|
if (!item) {
|
|
936
949
|
return React.createElement("div", null, "StrapiField must be used within a StrapiCollection");
|
|
937
|
-
}
|
|
950
|
+
} // Getting only fields that aren't objects
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
var attributes = L.get(item, ["attributes"]);
|
|
954
|
+
var displayableFields = Object.keys(attributes).filter(function (field) {
|
|
955
|
+
var _value$data, _value$data$attribute;
|
|
956
|
+
|
|
957
|
+
var value = attributes[field];
|
|
958
|
+
return typeof value !== "object" || ((_value$data = value.data) == null ? void 0 : (_value$data$attribute = _value$data.attributes) == null ? void 0 : _value$data$attribute.mime.startsWith("image"));
|
|
959
|
+
});
|
|
960
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
961
|
+
fields: displayableFields
|
|
962
|
+
});
|
|
938
963
|
|
|
939
964
|
if (!path) {
|
|
940
965
|
return React.createElement("div", null, "StrapiField must specify a field name.");
|
|
@@ -946,9 +971,10 @@ function StrapiField(_ref4) {
|
|
|
946
971
|
return React.createElement("div", null, "Please specify a valid field name.");
|
|
947
972
|
} else if (data != null && (_data$data = data.data) != null && (_data$data$attributes = _data$data.attributes) != null && _data$data$attributes.mime.startsWith("image")) {
|
|
948
973
|
var creds = ensure(useContext(CredentialsContext));
|
|
949
|
-
var
|
|
950
|
-
var
|
|
951
|
-
var
|
|
974
|
+
var attrs = data.data.attributes;
|
|
975
|
+
var img_url = attrs.url.startsWith("http") ? attrs.url : creds.host + attrs.url;
|
|
976
|
+
var img_width = attrs.width;
|
|
977
|
+
var img_height = attrs.height;
|
|
952
978
|
return React.createElement("img", {
|
|
953
979
|
src: img_url,
|
|
954
980
|
width: 300,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plasmic-strapi.esm.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/strapi.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 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 = Gp.constructor = GeneratorFunctionPrototype;\n 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 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 Gp[iteratorSymbol] = function() {\n return this;\n };\n\n 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, 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 Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","import { ComponentMeta, DataProvider, GlobalContextMeta, repeatedElement, useSelector } from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\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-strapi\";\n\ninterface StrapiCredentialsProviderProps {\n host?: string;\n token?: string;\n}\n\nconst CredentialsContext = React.createContext<\n StrapiCredentialsProviderProps | undefined\n>(undefined);\n\nexport const strapiCredentialsProviderMeta: GlobalContextMeta<StrapiCredentialsProviderProps> = {\n name: \"StrapiCredentialsProvider\",\n displayName: \"Strapi Credentials Provider\",\n importName: \"StrapiCredentialsProvider\",\n importPath: modulePath,\n props: {\n host: {\n type: \"string\",\n displayName: \"Host\",\n defaultValueHint: \"localhost:1337\",\n description: \"Server where you application is hosted.\",\n },\n token: {\n type: \"string\",\n displayName: \"API Token\",\n description: \"API Token (generated in http://yourhost:1337/admin/settings/api-tokens) (or leave blank for unauthenticated usage).\",\n },\n },\n};\n\nexport function StrapiCredentialsProvider({\n host,\n token,\n children,\n}: React.PropsWithChildren<StrapiCredentialsProviderProps>) {\n return (\n <CredentialsContext.Provider value={{ host, token }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface StrapiCollectionProps {\n name?: string;\n children?: ReactNode;\n className?: string;\n noLayout?: boolean;\n}\n\nexport const strapiCollectionMeta: ComponentMeta<StrapiCollectionProps> = {\n name: \"StrapiCollection\",\n displayName: \"Strapi Collection\",\n importName: \"StrapiCollection\",\n importPath: modulePath,\n description: \"Fetches Strapi data of a given collection and repeats content of children once for every row fetched.\",\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n children: {\n type: \"component\",\n name: \"StrapiField\",\n },\n },\n },\n name: {\n type: \"string\",\n displayName: \"Name\",\n description: \"Name of the collection to be fetched.\",\n defaultValueHint: \"restaurants\",\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description: \"When set, Strapi Collection 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 StrapiCollection({\n name,\n children,\n className,\n noLayout,\n}: StrapiCollectionProps) {\n const creds = ensure(useContext(CredentialsContext));\n\n if (!creds.host) {\n return <div>Please specify a host.</div>;\n }\n\n const query = 'http://' + creds.host + '/api/' + name + '?populate=*';\n const cacheKey = JSON.stringify({\n creds,\n name,\n });\n\n const data = usePlasmicQueryData<any[] | null>(\n cacheKey,\n async () => {\n if (!query) {\n return null;\n }\n\n const requestInit: any = { method: 'GET' };\n if (creds.token) {\n requestInit.headers = { Authorization: 'Bearer ' + creds.token };\n }\n\n const resp = await fetch(query, requestInit);\n return resp.json();\n }\n );\n\n if (!data?.data || !L.get(data.data, [\"data\"])) {\n return <div>Please specify valid host, token (if necessary) and collection name.</div>;\n }\n\n const collection = L.get(data.data, [\"data\"]) as any[];\n\n const repElements = collection.map((item, index) => (\n <DataProvider key={item.id} name={\"strapiItem\"} data={item}>\n {repeatedElement(index === 0, children)}\n </DataProvider>\n ))\n\n return noLayout ? <> {repElements} </> : <div className={className}> {repElements} </div>;\n}\n\ninterface StrapiFieldProps {\n className?: string;\n path?: string;\n}\n\nexport const strapiFieldMeta: ComponentMeta<StrapiFieldProps> = {\n name: \"StrapiField\",\n displayName: \"Strapi Field\",\n importName: \"StrapiField\",\n importPath: modulePath,\n props: {\n path: {\n type: \"string\",\n displayName: \"Field\",\n description: \"Field name\",\n defaultValueHint: \"description\",\n },\n },\n};\n\nexport function StrapiField({\n className,\n path,\n}: StrapiFieldProps) {\n const item = useSelector(\"strapiItem\");\n if (!item) {\n return <div>StrapiField must be used within a StrapiCollection</div>;\n }\n if (!path) {\n return <div>StrapiField must specify a field name.</div>;\n }\n\n const data = L.get(item, [\"attributes\", path]);\n if (!data) {\n return <div>Please specify a valid field name.</div>\n } else if (data?.data?.attributes?.mime.startsWith(\"image\")) {\n const creds = ensure(useContext(CredentialsContext));\n const img_url = 'http://' + creds.host + data.data.attributes.url;\n const img_width = data.data.attributes.width;\n const img_height = data.data.attributes.height;\n return (\n <img\n src={img_url}\n width={300}\n height={300*img_height/img_width}\n />\n );\n } else {\n return <div className={className}>{data}</div>;\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n StrapiCredentialsProvider,\n strapiCredentialsProviderMeta,\n StrapiCollection,\n strapiCollectionMeta,\n StrapiField,\n strapiFieldMeta,\n} from \"./strapi\";\n\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(StrapiCredentialsProvider, strapiCredentialsProviderMeta);\n } else {\n registerGlobalContext(StrapiCredentialsProvider, strapiCredentialsProviderMeta);\n }\n\n _registerComponent(StrapiCollection, strapiCollectionMeta);\n _registerComponent(StrapiField, strapiFieldMeta);\n}\n\nexport * from \"./strapi\";"],"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","constructor","displayName","defineIteratorMethods","forEach","method","isGeneratorFunction","genFun","ctor","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","toString","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","Function","ensure","x","modulePath","CredentialsContext","React","createContext","strapiCredentialsProviderMeta","importName","importPath","props","host","defaultValueHint","description","token","StrapiCredentialsProvider","children","Provider","strapiCollectionMeta","defaultValue","noLayout","StrapiCollection","className","creds","useContext","query","cacheKey","JSON","stringify","data","usePlasmicQueryData","requestInit","headers","Authorization","fetch","resp","json","L","get","collection","repElements","map","item","index","DataProvider","id","repeatedElement","strapiFieldMeta","path","StrapiField","useSelector","attributes","mime","startsWith","img_url","url","img_width","width","img_height","height","src","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,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AV,CAAqBM,KAAvC;AACA,QAAMC,UAAU,GAAG7B,IAAI,CAACA,IAAL,CAAUsB,UAAV,CAAqBQ,MAAxC;AACA,WACEtD,mBAAA,MAAA;AACEuD,MAAAA,GAAG,EAAEN;AACLG,MAAAA,KAAK,EAAE;AACPE,MAAAA,MAAM,EAAE,MAAID,UAAJ,GAAeF;KAHzB,CADF;AAOD,GAZM,MAYA;AACL,WAAOnD,mBAAA,MAAA;AAAKiB,MAAAA,SAAS,EAAEA;KAAhB,EAA4BO,IAA5B,CAAP;AACD;AACF;;SCtLegC,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,CAA6BpD,yBAA7B,EAAwDR,6BAAxD;AACD,GAFD,MAEO;AACL4D,IAAAA,qBAAqB,CAACpD,yBAAD,EAA4BR,6BAA5B,CAArB;AACD;;AAEDwD,EAAAA,kBAAkB,CAAC1C,gBAAD,EAAmBH,oBAAnB,CAAlB;;AACA6C,EAAAA,kBAAkB,CAACd,WAAD,EAAcF,eAAd,CAAlB;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"plasmic-strapi.esm.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/strapi.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 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 = Gp.constructor = GeneratorFunctionPrototype;\n 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 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 Gp[iteratorSymbol] = function() {\n return this;\n };\n\n 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, 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 Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","import {\n ComponentMeta,\n DataProvider,\n GlobalContextMeta,\n repeatedElement,\n useSelector,\n} from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\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-strapi\";\n\ninterface StrapiCredentialsProviderProps {\n host?: string;\n token?: string;\n}\n\nconst CredentialsContext = React.createContext<\n StrapiCredentialsProviderProps | undefined\n>(undefined);\n\nexport const strapiCredentialsProviderMeta: GlobalContextMeta<StrapiCredentialsProviderProps> = {\n name: \"StrapiCredentialsProvider\",\n displayName: \"Strapi Credentials Provider\",\n description:\n \"API token is needed only if data is not publicly readable. Learn how to [get your API token](https://docs.strapi.io/user-docs/latest/settings/managing-global-settings.html#managing-api-tokens).\",\n importName: \"StrapiCredentialsProvider\",\n importPath: modulePath,\n props: {\n host: {\n type: \"string\",\n displayName: \"Host\",\n defaultValueHint: \"https://strapi-plasmic.herokuapp.com\",\n description: \"Server where you application is hosted.\",\n },\n token: {\n type: \"string\",\n displayName: \"API Token\",\n description:\n \"API Token (generated in http://yourhost/admin/settings/api-tokens) (or leave blank for unauthenticated usage).\",\n },\n },\n};\n\nexport function StrapiCredentialsProvider({\n host,\n token,\n children,\n}: React.PropsWithChildren<StrapiCredentialsProviderProps>) {\n host = host?.slice(-1) === \"/\" ? host.slice(0, -1) : host;\n return (\n <CredentialsContext.Provider value={{ host, token }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface StrapiCollectionProps {\n name?: string;\n children?: ReactNode;\n className?: string;\n noLayout?: boolean;\n}\n\nexport const strapiCollectionMeta: ComponentMeta<StrapiCollectionProps> = {\n name: \"StrapiCollection\",\n displayName: \"Strapi Collection\",\n importName: \"StrapiCollection\",\n importPath: modulePath,\n description:\n \"Fetches Strapi data of a given collection and repeats content of children once for every row fetched.\",\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n children: {\n type: \"component\",\n name: \"StrapiField\",\n },\n },\n },\n name: {\n type: \"string\",\n displayName: \"Name\",\n description: \"Name of the collection to be fetched.\",\n defaultValueHint: \"restaurants\",\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description:\n \"When set, Strapi Collection 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 StrapiCollection({\n name,\n children,\n className,\n noLayout,\n}: StrapiCollectionProps) {\n const creds = ensure(useContext(CredentialsContext));\n\n if (!creds.host) {\n return <div>Please specify a host.</div>;\n }\n\n const query = creds.host + \"/api/\" + name + \"?populate=*\";\n\n const cacheKey = JSON.stringify({\n creds,\n name,\n });\n\n const data = usePlasmicQueryData<any[] | null>(cacheKey, async () => {\n if (!query) {\n return null;\n }\n\n const requestInit: any = { method: \"GET\" };\n if (creds.token) {\n requestInit.headers = { Authorization: \"Bearer \" + creds.token };\n }\n\n const resp = await fetch(query, requestInit);\n return resp.json();\n });\n\n if (!data?.data) {\n return (\n <div>\n Please configure the Strapi provider with a valid host and token.\n </div>\n );\n }\n\n if (!L.get(data.data, [\"data\"])) {\n return <div>Please specify a valid collection.</div>;\n }\n\n const collection = L.get(data.data, [\"data\"]) as any[];\n\n const repElements = collection.map((item, index) => (\n <DataProvider key={item.id} name={\"strapiItem\"} data={item}>\n {repeatedElement(index === 0, children)}\n </DataProvider>\n ));\n\n return noLayout ? (\n <> {repElements} </>\n ) : (\n <div className={className}> {repElements} </div>\n );\n}\n\ninterface StrapiFieldProps {\n className?: string;\n path?: string;\n setControlContextData?: (data: { fields: string[] }) => void;\n}\n\nexport const strapiFieldMeta: ComponentMeta<StrapiFieldProps> = {\n name: \"StrapiField\",\n displayName: \"Strapi Field\",\n importName: \"StrapiField\",\n importPath: modulePath,\n props: {\n path: {\n type: \"choice\",\n options: (props, ctx) => {\n return ctx?.fields ?? [];\n },\n displayName: \"Field\",\n description: \"Field name\",\n },\n },\n};\n\nexport function StrapiField({\n className,\n path,\n setControlContextData,\n}: StrapiFieldProps) {\n const item = useSelector(\"strapiItem\");\n if (!item) {\n return <div>StrapiField must be used within a StrapiCollection</div>;\n }\n\n // Getting only fields that aren't objects\n const attributes = L.get(item, [\"attributes\"]);\n const displayableFields = Object.keys(attributes).filter((field) => {\n const value = attributes[field];\n return (\n typeof value !== \"object\" ||\n value.data?.attributes?.mime.startsWith(\"image\")\n );\n });\n\n setControlContextData?.({\n fields: displayableFields,\n });\n\n if (!path) {\n return <div>StrapiField must specify a field name.</div>;\n }\n\n const data = L.get(item, [\"attributes\", path]);\n if (!data) {\n return <div>Please specify a valid field name.</div>;\n } else if (data?.data?.attributes?.mime.startsWith(\"image\")) {\n const creds = ensure(useContext(CredentialsContext));\n const attrs = data.data.attributes;\n const img_url = attrs.url.startsWith(\"http\")\n ? attrs.url\n : creds.host + attrs.url;\n const img_width = attrs.width;\n const img_height = attrs.height;\n return (\n <img src={img_url} width={300} height={(300 * img_height) / img_width} />\n );\n } else {\n return <div className={className}>{data}</div>;\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n StrapiCredentialsProvider,\n strapiCredentialsProviderMeta,\n StrapiCollection,\n strapiCollectionMeta,\n StrapiField,\n strapiFieldMeta,\n} from \"./strapi\";\n\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(StrapiCredentialsProvider, strapiCredentialsProviderMeta);\n } else {\n registerGlobalContext(StrapiCredentialsProvider, strapiCredentialsProviderMeta);\n }\n\n _registerComponent(StrapiCollection, strapiCollectionMeta);\n _registerComponent(StrapiField, strapiFieldMeta);\n}\n\nexport * from \"./strapi\";"],"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","constructor","displayName","defineIteratorMethods","forEach","method","isGeneratorFunction","genFun","ctor","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","toString","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","Function","ensure","x","modulePath","CredentialsContext","React","createContext","strapiCredentialsProviderMeta","description","importName","importPath","props","host","defaultValueHint","token","StrapiCredentialsProvider","children","Provider","strapiCollectionMeta","defaultValue","noLayout","StrapiCollection","className","creds","useContext","query","cacheKey","JSON","stringify","data","usePlasmicQueryData","requestInit","headers","Authorization","fetch","resp","json","L","get","collection","repElements","map","item","index","DataProvider","id","repeatedElement","strapiFieldMeta","path","options","ctx","fields","StrapiField","setControlContextData","useSelector","attributes","displayableFields","filter","field","mime","startsWith","attrs","img_url","url","img_width","width","img_height","height","src","registerAll","loader","_registerComponent","Component","defaultMeta","registerComponent","registerGlobalContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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UAAxB;AACA,QAAMO,OAAO,GAAGD,KAAK,CAACE,GAAN,CAAUH,UAAV,CAAqB,MAArB,IACZC,KAAK,CAACE,GADM,GAEZxC,KAAK,CAACX,IAAN,GAAaiD,KAAK,CAACE,GAFvB;AAGA,QAAMC,SAAS,GAAGH,KAAK,CAACI,KAAxB;AACA,QAAMC,UAAU,GAAGL,KAAK,CAACM,MAAzB;AACA,WACE9D,mBAAA,MAAA;AAAK+D,MAAAA,GAAG,EAAEN;AAASG,MAAAA,KAAK,EAAE;AAAKE,MAAAA,MAAM,EAAG,MAAMD,UAAP,GAAqBF;KAA5D,CADF;AAGD,GAXM,MAWA;AACL,WAAO3D,mBAAA,MAAA;AAAKiB,MAAAA,SAAS,EAAEA;KAAhB,EAA4BO,IAA5B,CAAP;AACD;AACF;;SC9NewC,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,CAA6B5D,yBAA7B,EAAwDR,6BAAxD;AACD,GAFD,MAEO;AACLoE,IAAAA,qBAAqB,CAAC5D,yBAAD,EAA4BR,6BAA5B,CAArB;AACD;;AAEDgE,EAAAA,kBAAkB,CAAClD,gBAAD,EAAmBH,oBAAnB,CAAlB;;AACAqD,EAAAA,kBAAkB,CAACnB,WAAD,EAAcL,eAAd,CAAlB;AACD;;;;"}
|
package/dist/strapi.d.ts
CHANGED
|
@@ -18,7 +18,10 @@ export declare function StrapiCollection({ name, children, className, noLayout,
|
|
|
18
18
|
interface StrapiFieldProps {
|
|
19
19
|
className?: string;
|
|
20
20
|
path?: string;
|
|
21
|
+
setControlContextData?: (data: {
|
|
22
|
+
fields: string[];
|
|
23
|
+
}) => void;
|
|
21
24
|
}
|
|
22
25
|
export declare const strapiFieldMeta: ComponentMeta<StrapiFieldProps>;
|
|
23
|
-
export declare function StrapiField({ className, path, }: StrapiFieldProps): JSX.Element;
|
|
26
|
+
export declare function StrapiField({ className, path, setControlContextData, }: StrapiFieldProps): JSX.Element;
|
|
24
27
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/plasmic-strapi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Plasmic Strapi components.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"lodash": "^4.17.21",
|
|
50
50
|
"lodash-es": "^4.17.21"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "9a050d06cb7ae01d7c912e951b7294d825f13e90"
|
|
53
53
|
}
|