New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@plasmicpkgs/plasmic-cms

Package Overview
Dependencies
Maintainers
1
Versions
245
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@plasmicpkgs/plasmic-cms - npm Package Compare versions

Comparing version 0.0.244 to 0.0.245

3

dist/components.d.ts

@@ -43,6 +43,7 @@ import { CanvasComponentProps, ComponentMeta } from "@plasmicapp/host/registerComponent";

dateFormat?: string;
usePlasmicTheme?: boolean;
themeResetClassName?: string;
}
export declare const cmsRowFieldMeta: ComponentMeta<CmsRowFieldProps>;
export declare function CmsRowField({ className, table, field, dateFormat, setControlContextData, themeResetClassName, ...rest }: CmsRowFieldProps): React.JSX.Element | null;
export declare function CmsRowField({ className, table, field, dateFormat, setControlContextData, usePlasmicTheme, themeResetClassName, ...rest }: CmsRowFieldProps): React.JSX.Element | null;
interface CmsCountProps extends CanvasComponentProps<RowContextData> {

@@ -49,0 +50,0 @@ table: string;

@@ -6,2 +6,3 @@ import React from "react";

export declare function useDatabase(): DatabaseConfig | undefined;
export declare function makeDatabaseCacheKey(config: DatabaseConfig | undefined): string | null;
export declare function DatabaseProvider({ config, children, }: {

@@ -8,0 +9,0 @@ config: DatabaseConfig;

@@ -640,2 +640,3 @@ 'use strict';

var _excluded = ["databaseToken"];
var contextPrefix = "plasmicCms";

@@ -667,2 +668,9 @@ var databaseContextKey = contextPrefix + "Database";

}
function makeDatabaseCacheKey(config) {
if (!config) {
return null;
}
var rest = _objectWithoutPropertiesLoose(config, _excluded);
return JSON.stringify(rest);
}
function DatabaseProvider(_ref) {

@@ -840,3 +848,3 @@ var config = _ref.config,

var _excluded = ["className", "table", "field", "dateFormat", "setControlContextData", "themeResetClassName"],
var _excluded$1 = ["className", "table", "field", "dateFormat", "setControlContextData", "usePlasmicTheme", "themeResetClassName"],
_excluded2 = ["className", "table", "setControlContextData"],

@@ -924,3 +932,3 @@ _excluded3 = ["table", "field", "valueProp", "children", "setControlContextData"];

component: "TablesFetcher",
databaseConfig: databaseConfig
databaseConfig: makeDatabaseCacheKey(databaseConfig)
});

@@ -1171,3 +1179,3 @@ var maybeData = query.usePlasmicQueryData(cacheKey, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {

table: table,
databaseConfig: databaseConfig,
databaseConfig: makeDatabaseCacheKey(databaseConfig),
params: params

@@ -1354,2 +1362,8 @@ });

},
usePlasmicTheme: {
type: "boolean",
displayName: "Use Plasmic tag styles?",
description: "For HTML content, use tag styles defined in Plasmic",
advanced: true
},
themeResetClassName: {

@@ -1371,4 +1385,5 @@ type: "themeResetClass",

setControlContextData = _ref10.setControlContextData,
usePlasmicTheme = _ref10.usePlasmicTheme,
themeResetClassName = _ref10.themeResetClassName,
rest = _objectWithoutPropertiesLoose(_ref10, _excluded);
rest = _objectWithoutPropertiesLoose(_ref10, _excluded$1);
var tables = useTablesWithDataLoaded("rows");

@@ -1414,3 +1429,3 @@ var res = useRow(tables, table);

return data ? renderValue(data, fieldMeta.type, _extends({
className: themeResetClassName + " " + className
className: (usePlasmicTheme ? themeResetClassName : "") + " " + className
}, rest)) : null;

@@ -1417,0 +1432,0 @@ }

@@ -1,2 +0,2 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@plasmicapp/host/registerComponent")),r=e(require("@plasmicapp/host/registerGlobalContext")),n=require("@plasmicapp/host"),a=require("@plasmicapp/query"),i=e(require("dayjs")),o=e(require("react"));function l(){l=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i=Object.create((t&&t.prototype instanceof y?t:y).prototype),o=new O(n||[]);return a(i,"_invoke",{value:D(e,r,o)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var p="suspendedStart",m="executing",h="completed",v={};function y(){}function b(){}function g(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,M=x&&x(x(L([])));M&&M!==r&&n.call(M,o)&&(w=M);var C=g.prototype=y.prototype=Object.create(w);function E(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function N(e,t){function r(a,i,o,l){var u=f(e[a],e,i);if("throw"!==u.type){var s=u.arg,c=s.value;return c&&"object"==typeof c&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,o,l)}),(function(e){r("throw",e,o,l)})):t.resolve(c).then((function(e){s.value=e,o(s)}),(function(e){return r("throw",e,o,l)}))}l(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,a){r(e,n,t,a)}))}return i=i?i.then(a,a):a()}})}function D(t,r,n){var a=p;return function(i,o){if(a===m)throw new Error("Generator is already running");if(a===h){if("throw"===i)throw o;return{value:e,done:!0}}for(n.method=i,n.arg=o;;){var l=n.delegate;if(l){var u=F(l,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===p)throw a=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=m;var s=f(t,r,n);if("normal"===s.type){if(a=n.done?h:"suspendedYield",s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(a=h,n.method="throw",n.arg=s.arg)}}}function F(t,r){var n=r.method,a=t.iterator[n];if(a===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,F(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(a,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(n.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return b.prototype=g,a(C,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:b,configurable:!0}),b.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(C),e},t.awrap=function(e){return{__await:e}},E(N.prototype),c(N.prototype,u,(function(){return this})),t.AsyncIterator=N,t.async=function(e,r,n,a,i){void 0===i&&(i=Promise);var o=new N(d(e,r,n,a),i);return t.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},E(C),c(C,s,"Generator"),c(C,o,(function(){return this})),c(C,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function a(n,a){return l.type="throw",l.arg=t,r.next=n,a&&(r.method="next",r.arg=e),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],l=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function u(e,t,r,n,a,i,o){try{var l=e[i](o),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).then(n,a)}function s(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){u(i,n,a,o,l,"next",e)}function l(e){u(i,n,a,o,l,"throw",e)}o(void 0)}))}}function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function m(e,t,r){return(m=p()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&f(a,r.prototype),a}).apply(null,arguments)}function h(e){var t="function"==typeof Map?new Map:void 0;return(h=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return m(e,arguments,d(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),f(r,e)})(e)}function v(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(a[r]=e[r]);return a}function y(e){return{where:e.where,limit:e.limit,offset:e.offset,order:e.orderBy?[{field:e.orderBy,dir:e.desc?"desc":"asc"}]:void 0,fields:e.fields}}var b=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,r)||this).status=t,n}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,f(t,r),n}(h(Error)),g=function(){function e(e){this.config=e}var t=e.prototype;return t.get=function(){var e=s(l().mark((function e(t,r){var n,a,i,o,u;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===r&&(r={}),(n=new URL(this.config.host+"/api/v1/cms/databases/"+this.config.databaseId+t)).search=new URLSearchParams(r).toString(),e.next=5,fetch(n.toString(),{method:"GET",headers:{accept:"*/*","x-plasmic-api-cms-tokens":this.config.databaseId+":"+this.config.databaseToken},mode:"cors"});case 5:if(200===(a=e.sent).status){e.next=12;break}return e.next=9,a.text();case 9:i=e.sent;try{u=JSON.parse(i),null!=(o=u.error)&&o.message&&(i=u.error.message)}catch(e){}throw new b(a.status,i);case 12:return e.next=14,a.json();case 14:return e.abrupt("return",e.sent);case 15:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}(),t.fetchTables=function(){var e=s(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.get("");case 3:return e.abrupt("return",e.sent.tables);case 7:throw e.prev=7,e.t0=e.catch(0),console.error(e.t0),e.t0;case 11:case"end":return e.stop()}}),e,this,[[0,7]])})));return function(){return e.apply(this,arguments)}}(),t.useDraftForTable=function(e){return Array.isArray(this.config.useDraft)?this.config.useDraft.includes(e):this.config.useDraft},t.query=function(){var e=s(l().mark((function e(t,r){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===r&&(r={}),e.prev=1,e.next=4,this.get("/tables/"+t+"/query",{q:JSON.stringify(y(r)),draft:Number(this.useDraftForTable(t)||r.useDraft),locale:this.config.locale});case 4:return e.abrupt("return",e.sent.rows);case 8:throw e.prev=8,e.t0=e.catch(1),console.error(e.t0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[1,8]])})));return function(t,r){return e.apply(this,arguments)}}(),t.count=function(){var e=s(l().mark((function e(t,r){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===r&&(r={}),e.prev=1,e.next=4,this.get("/tables/"+t+"/count",{q:JSON.stringify(y(r)),draft:Number(this.useDraftForTable(t)||r.useDraft)});case 4:return e.abrupt("return",e.sent.count);case 8:throw e.prev=8,e.t0=e.catch(1),console.error(e.t0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[1,8]])})));return function(t,r){return e.apply(this,arguments)}}(),e}();function w(e){if(!e)throw new Error("Component must be wrapped in 'CMS Data Provider'.");return new g(e)}var x=function(e){return"plasmicCms"+N(e)+"Collection"},M=function(e){return"plasmicCms"+N(e)+"Item"},C=function(e){return"plasmicCms"+N(e)+"Count"},E=function(e){return"plasmicCms"+N(e)+"Mode"};function N(e){var t;return(null==(t=e[0])?void 0:t.toUpperCase())+e.slice(1)}function D(){return n.useSelector("plasmicCmsDatabase")}function F(e){return o.createElement(n.DataProvider,{name:"plasmicCmsDatabase",data:e.config,hidden:!0},e.children)}function S(){return n.useSelector("plasmicCmsTables")}function P(e){return o.createElement(n.DataProvider,{name:"plasmicCmsTables",data:e.tables,hidden:!0},e.children)}function O(e){var t=e.children,r=e.table,a=e.rows,i=e.hidden;return o.createElement(n.DataProvider,{name:r?E(r):void 0,data:"rows",hidden:!0},o.createElement(n.DataProvider,{name:r?x(r):void 0,data:a,hidden:i},t))}function L(e){var t=n.useDataEnv(),r=S();if(t&&r){var a=function(t,r){return[].concat(Object.keys(t).reverse()).filter((function(t){return function(t){return"rows"===e?t.endsWith("Item"):"count"===e?t.endsWith("Count"):t.endsWith("Item")||t.endsWith("Count")}(t)}))}(t);return r.filter((function(t){return a.some((function(r){return"rows"===e?M(t.identifier)===r:"count"===e?C(t.identifier)===r:M(t.identifier)===r||C(t.identifier)===r}))}))}}function k(e,t){return!t&&e&&e.length>0&&(t=e[0].identifier),t}function Y(e,t){var r=n.useDataEnv();if(r)return(t=k(e,t))?{table:t,row:r[M(t)]}:void 0}function j(e){var t=e.children,r=e.row;return o.createElement(n.DataProvider,{name:M(e.table),data:r},t)}function V(e){var t=e.children,r=e.table,a=e.count;return o.createElement(n.DataProvider,{name:r?E(r):void 0,data:"count",hidden:!0},o.createElement(n.DataProvider,{name:r?C(r):void 0,data:a},t))}function T(e){return e?e.map((function(e){return{value:e.identifier,label:e.name}})):[]}function I(e,t,r){if(!e)return[];var n=e.find((function(e){return e.identifier===t}));if(!n)return[];var a=n.schema.fields;r&&(a=a.filter((function(e){return r.includes(e.type)})));var i=a.map((function(e){return{value:e.identifier,label:e.name||e.identifier}}));return i.some((function(e){return"_id"===e.value}))||i.push({label:"System-assigned ID",value:"_id"}),i}var R=["className","table","field","dateFormat","setControlContextData","themeResetClassName"],_=["className","table","setControlContextData"],A=["table","field","valueProp","children","setControlContextData"],q="@plasmicpkgs/plasmic-cms",H="hostless-plasmic-cms";function U(e,t,r,n,a,i){if("error"in e){var l=e.error;return n?l&&l instanceof b&&404===l.status?r.hideIfNotFound?null:o.createElement("div",null,"Error: Data not found"):o.createElement("div",null,"Error: ",null==l?void 0:l.message):o.createElement(o.Fragment,null,null!=a?a:o.createElement("div",null,"Loading..."))}return!("data"in e)||i?o.createElement(o.Fragment,null,null!=a?a:o.createElement("div",null,"Loading...")):t(e.data)}var G="https://data.plasmic.app",J={name:H+"-credentials-provider",displayName:"CMS Credentials Provider",description:"\nFind (or create) your CMS in the [dashboard](https://studio.plasmic.app), and go to its Settings view for the ID and token.\n\n[See tutorial video](https://docs.plasmic.app/learn/plasmic-cms/).",importName:"CmsCredentialsProvider",importPath:q,providesData:!0,props:{host:{type:"string",displayName:"Studio URL",description:"The default host for use in production is "+G+".",defaultValue:G,defaultValueHint:G,advanced:!0},databaseId:{type:"string",displayName:"CMS ID",description:"The ID of the CMS (database) to use. (Can get on the CMS settings page)"},databaseToken:{type:"string",displayName:"CMS Public Token",description:"The Public Token of the CMS (database) you are using. (Can get on the CMS settings page)"},locale:{type:"string",displayName:"Locale",description:"The locale to use for localized values, leave empty for the default locale."}}};function B(e){var t=e.useDraft;return o.createElement(F,{config:{databaseId:e.databaseId,databaseToken:e.databaseToken,locale:e.locale,host:e.host||G,useDraft:null!=t&&t}},o.createElement(W,null,e.children))}function W(e){var t=e.children,r=D(),i=JSON.stringify({component:"TablesFetcher",databaseConfig:r}),u=a.usePlasmicQueryData(i,s(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Q(r)){e.next=2;break}return e.abrupt("return",[]);case 2:return e.next=4,w(r).fetchTables();case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))),c=!!n.usePlasmicCanvasContext();return o.createElement(P,{tables:u.data},c&&u.error?o.createElement("div",null,"CMS Error: ",u.error.message):t)}function Q(e){return(null==e?void 0:e.databaseId)&&(null==e?void 0:e.databaseToken)}var z={name:H+"-query-repeater",displayName:"CMS Data Fetcher",description:"Fetches CMS data. Repeats `children` slot content for each row fetched. [See tutorial video](https://docs.plasmic.app/learn/plasmic-cms/).",importName:"CmsQueryRepeater",importPath:q,providesData:!0,defaultStyles:{display:"flex",width:"stretch",maxWidth:"100%",flexDirection:"column"},props:{children:{type:"slot",isRepeated:!0,defaultValue:{type:"vbox",children:[{type:"component",name:H+"-row-field"}]}},table:{type:"choice",displayName:"Model",description:"CMS model (table) to query.",options:function(e,t){return T(null==t?void 0:t.tables)},defaultValueHint:function(e,t){return null==t?void 0:t.table}},useDraft:{type:"boolean",displayName:"Use drafts?",description:"If set, also query unpublished content.",defaultValue:!1,hidden:function(){return!0}},mode:{type:"choice",options:[{label:"Rows",value:"rows"},{label:"Count",value:"count"}],defaultValueHint:"rows"},where:{type:"object",displayName:"Filter",description:"Filter clause, in JSON format.",hidden:function(){return!0}},filterField:{type:"choice",displayName:"Filter field",description:"Field (from model schema) to filter by",options:function(e,t){var r;return I(null==t?void 0:t.tables,null!=(r=null==t?void 0:t.table)?r:e.table,["number","boolean","text","long-text","ref"])}},filterValue:{type:"string",displayName:"Filter value",description:"Value to filter by, should be of filter field type"},orderBy:{type:"choice",displayName:"Order by",description:"Field to order by.",options:function(e,t){return I(null==t?void 0:t.tables,null==t?void 0:t.table,["number","boolean","date-time","long-text","text"])},hidden:function(e){return"count"===e.mode}},desc:{type:"boolean",displayName:"Sort descending?",description:'Sort descending by "Order by" field.',defaultValue:!1,hidden:function(e){return"count"===e.mode}},limit:{type:"number",displayName:"Limit",description:"Maximum number of entries to fetch (0 for unlimited).",defaultValue:0,hidden:function(e){return"count"===e.mode}},offset:{type:"number",displayName:"Offset",description:"Skips this number of rows in the result set; used in combination with limit to build pagination",hidden:function(e){return"count"===e.mode}},fields:{type:"choice",multiSelect:!0,displayName:"Fields",description:"Fields from the CMS model to include with each row; by default, all fields are included",options:function(e,t){var r;return I(null==t?void 0:t.tables,null!=(r=null==t?void 0:t.table)?r:e.table)},hidden:function(e){return"count"===e.mode}},emptyMessage:{type:"slot",defaultValue:{type:"text",value:"No matching published entries found."}},forceEmptyState:{type:"boolean",displayName:"Force empty state",description:"If set, will render as if no matching entries were found.",defaultValue:!1},loadingMessage:{type:"slot",defaultValue:{type:"text",value:"Loading..."}},forceLoadingState:{type:"boolean",displayName:"Force loading state",description:"If set, will render as if it is waiting for the query to run.",defaultValue:!1},noLayout:{type:"boolean",displayName:"No layout",description:"When set, CMS Data Loader 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},noAutoRepeat:{type:"boolean",displayName:"No auto-repeat",description:"Do not automatically repeat children for every entry.",defaultValue:!1,hidden:function(e){return"count"===e.mode}}}};function K(e){var t,r=e.table,i=e.children,u=e.setControlContextData,c=e.mode,d=e.where,f=e.useDraft,p=e.orderBy,m=e.desc,h=e.limit,v=e.offset,y=e.emptyMessage,b=e.forceEmptyState,g=e.loadingMessage,x=e.forceLoadingState,M=e.noLayout,C=e.noAutoRepeat,E=e.className,N=e.filterField,F=e.filterValue,P=e.fields,L=D(),k=S();N&&F&&((t={})[N]=F,d=t);var Y={where:d,useDraft:f,orderBy:p,desc:m,limit:h,offset:v,fields:P};!r&&k&&k.length>0&&(r=k[0].identifier);var T=JSON.stringify({component:"CmsQueryLoader",mode:c,table:r,databaseConfig:L,params:Y});k&&(null==u||u({tables:k,table:r}));var I=a.usePlasmicQueryData(T,s(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Q(L)){e.next=2;break}throw new Error("You must specify a CMS ID and API key");case 2:if(r){e.next=6;break}throw new Error("You must select a model to query");case 6:if(!k||k.find((function(e){return e.identifier===r}))){e.next=10;break}throw new Error('There is no model called "'+r+'"');case 10:if("count"!==c){e.next=14;break}return e.abrupt("return",w(L).count(r,Y));case 14:return e.abrupt("return",w(L).query(r,Y));case 15:case"end":return e.stop()}}),e)})))),R=!!n.usePlasmicCanvasContext();if("count"===c){var _=U(I,(function(){return i}),{hideIfNotFound:!1},R,g,x);return o.createElement(V,{table:r,count:"number"==typeof(null==I?void 0:I.data)?I.data:void 0},_)}var A=U(I,(function(e){return 0===e.length||b?y:C?i:e.map((function(e,t){return o.createElement(j,{key:t,table:r,row:e},n.repeatedElement(t,i))}))}),{hideIfNotFound:!1},R,g,x);return o.createElement(O,{rows:Array.isArray(null==I?void 0:I.data)?I.data:void 0,table:r},M?o.createElement(o.Fragment,null," ",A," "):o.createElement("div",{className:E}," ",A," "))}var X={name:H+"-row-field",displayName:"CMS Entry Field",importName:"CmsRowField",importPath:q,props:{table:{type:"choice",displayName:"Model",hidden:function(e,t){var r,n;return(null!=(r=null==t||null==(n=t.tables)?void 0:n.length)?r:0)<=1&&!e.table},helpText:"Pick model from a CMS Data Fetcher",description:"Usually not used! Only with multiple CMS Data Loaders, use this to choose which to show. Otherwise, go select the CMS Data Loader if you want to load different data.",options:function(e,t){return T(null==t?void 0:t.tables)},defaultValueHint:function(e,t){return null==t?void 0:t.table}},field:{type:"choice",displayName:"Field",description:"Field (from model schema) to use.",options:function(e,t){var r;return I(null==t?void 0:t.tables,null!=(r=null==t?void 0:t.table)?r:e.table,["number","boolean","text","long-text","date-time","rich-text","image","file"])},defaultValueHint:function(e,t){var r,n;return(null==t||null==(r=t.fieldMeta)?void 0:r.name)||(null==t||null==(n=t.fieldMeta)?void 0:n.identifier)}},dateFormat:{type:"choice",displayName:"Date Format",hidden:function(e,t){var r=e.field;if(!t)return!0;var n=t.table,a=t.tables,i=null==a?void 0:a.find((function(e){return e.identifier===n}));if(!i)return!0;var o=i.schema.fields.find((function(e){return e.identifier===r}));return!o||"date-time"!==o.type},options:[{label:"July 26, 2014",value:"MMMM D, YYYY"},{label:"July 26, 2014 10:02 PM",value:"MMMM D, YYYY h:mm A"},{label:"Jul 26, 2014",value:"MMM D, YYYY"},{label:"Jul 26, 2014 10:02 PM",value:"MMM D, YYYY h:mm A"},{label:"Saturday, July 26, 2014",value:"dddd, MMMM D, YYYY"},{label:"7/26/2014",value:"M/D/YYYY"},{label:"7/26/2014 10:02 PM",value:"M/D/YYYY h:mm A"},{label:"26/7/2014",value:"D/M/YYYY"},{label:"26/7/2014 10:02 PM",value:"D/M/YYYY h:mm A"},{label:"7/26/14",value:"M/D/YY"},{label:"7/26/14 10:02 PM",value:"M/D/YY h:mm A"},{label:"26/7/14",value:"D/M/YY"},{label:"26/7/14 10:02 PM",value:"D/M/YY h:mm A"}]},themeResetClassName:{type:"themeResetClass",targetAllTags:!0}},defaultStyles:{objectFit:"cover"}};function Z(e){var t,r=e.className,n=e.table,a=e.field,l=e.dateFormat,u=e.setControlContextData,s=e.themeResetClassName,d=v(e,R),f=L("rows"),p=Y(f,n),m=o.createElement("div",Object.assign({className:r},d),"Field ",null!=n?n:"Unknown Model",".",null!=a?a:"Unknown Field"),h=p?re({table:p.table,tables:f,field:a,typeFilters:["text","long-text","rich-text"]}):void 0;if(f&&(null==u||u(c({tables:f},p&&p.row?{table:p.table,row:p.row,fieldMeta:h}:{}))),!p)return m;if(!p.row)return o.createElement("div",{className:r},"Error: No CMS Entry found");if(!h)return m;var y=null==(t=p.row.data)?void 0:t[h.identifier];return y?("date-time"===h.type&&l&&(y=i(y).format(l)),y?function(e,t,r){switch(t){case"number":case"boolean":case"text":case"long-text":case"date-time":case"ref":return o.createElement("div",Object.assign({},r),e);case"rich-text":return o.createElement("div",Object.assign({dangerouslySetInnerHTML:{__html:e},style:{whiteSpace:"normal"}},r));case"image":return e&&"object"==typeof e&&e.url&&e.imageMeta?o.createElement("img",Object.assign({src:e.url,width:e.imageMeta.width,height:e.imageMeta.height},r)):null;case"file":return e&&"object"==typeof e&&e.url&&e.name?o.createElement("a",Object.assign({href:e.url,target:"_blank"},r),e.name):null;default:!function(e){throw new Error("unexpected branch taken")}()}}(y,h.type,c({className:s+" "+r},d)):null):null}var $={name:H+"-count",displayName:"CMS Entries Count",importName:"CmsCount",importPath:q,props:{table:{type:"choice",displayName:"Model",hidden:function(e,t){var r,n;return(null!=(r=null==t||null==(n=t.tables)?void 0:n.length)?r:0)<=1&&!e.table},helpText:"Pick model from a CMS Data Fetcher",description:"Usually not used! Only with multiple CMS Data Loaders, use this to choose which to show. Otherwise, go select the CMS Data Loader if you want to load different data.",options:function(e,t){return T(null==t?void 0:t.tables)},defaultValueHint:function(e,t){return null==t?void 0:t.table}}}};function ee(e){var t=e.className,r=e.table,a=v(e,_),i=function(e,t){var r=n.useDataEnv();if(r)return(t=k(e,t))?{table:t,count:r[C(t)]}:void 0}(L("count"),r),l=o.createElement("div",Object.assign({className:t},a),"Count: ",null!=r?r:"Unknown Model");return i?null==i.count?null:o.createElement("div",Object.assign({className:t},a),(new Intl.NumberFormat).format(i.count)):l}var te=["text"];function re(e){var t,r=e.table,n=e.tables,a=e.field,i=e.typeFilters;if(r){var o=null==n||null==(t=n.find((function(e){return e.identifier===r})))?void 0:t.schema;return a?null==o?void 0:o.fields.find((function(e){return e.identifier===a})):null==o?void 0:o.fields.find((function(e){return(null!=i?i:te).includes(e.type)}))}}var ne={name:H+"-row-link",displayName:"CMS Entry Link",importName:"CmsRowLink",importPath:q,props:{children:{type:"slot",defaultValue:{type:"text",tag:"a",value:"Link"}},table:{type:"choice",displayName:"Model",hidden:function(e,t){var r,n;return(null!=(r=null==t||null==(n=t.tables)?void 0:n.length)?r:0)<=1&&!e.table},helpText:"Pick model from a CMS Data Fetcher",description:"Usually not used! Only with multiple CMS Data Loaders, use this to choose which to show. Otherwise, go select the CMS Data Loader if you want to load different data.",options:function(e,t){return T(null==t?void 0:t.tables)},defaultValueHint:function(e,t){return null==t?void 0:t.table}},field:{type:"choice",displayName:"Field",description:"Field (from model schema) to use.",options:function(e,t){var r;return I(null==t?void 0:t.tables,null!=(r=null==t?void 0:t.table)?r:e.table)},defaultValueHint:function(e,t){var r,n;return(null==t||null==(r=t.fieldMeta)?void 0:r.name)||(null==t||null==(n=t.fieldMeta)?void 0:n.identifier)}},hrefProp:{type:"string",displayName:'"href" prop',description:"Prop to inject into children",defaultValue:"href"},prefix:{type:"string",displayName:"Optional prefix",description:"Prefix to prepend to prop value.",hidden:function(e,t){var r;return"file"===(null==t||null==(r=t.fieldMeta)?void 0:r.type)}},suffix:{type:"string",displayName:"Optional suffix",description:"Suffix to append to prop value.",hidden:function(e,t){var r;return"file"===(null==t||null==(r=t.fieldMeta)?void 0:r.type)}}}};function ae(e){var t,r=e.table,n=e.field,a=e.hrefProp,i=e.children,l=e.setControlContextData,u=e.prefix,s=e.suffix,c=L("rows"),d=Y(c,r);if(!d||!d.row)return o.createElement(o.Fragment,null,i);var f=re({table:d.table,tables:c,field:n,typeFilters:["file","text"]});if(c&&(null==l||l({tables:c,table:d.table,row:d.row,fieldMeta:f})),!f)return o.createElement(o.Fragment,null,i);if(!i)return null;var p=(null==(t=d.row.data)?void 0:t[f.identifier])||"",m=o.Children.map(i,(function(e){var t;return o.isValidElement(e)?o.cloneElement(e,((t={})[a]="file"===f.type?p.url:u||s?""+(u||"")+p+(s||""):p,t)):e}));return o.createElement(o.Fragment,null,null!=m?m:null)}var ie={name:H+"-row-image",displayName:"CMS Entry Image",importName:"CmsRowImage",importPath:q,props:{children:{type:"slot",defaultValue:{type:"img",src:"https://studio.plasmic.app/static/img/placeholder-full.png"}},table:{type:"choice",displayName:"Model",hidden:function(e,t){var r,n;return(null!=(r=null==t||null==(n=t.tables)?void 0:n.length)?r:0)<=1&&!e.table},helpText:"Pick model from a CMS Data Fetcher",description:"Usually not used! Only with multiple CMS Data Loaders, use this to choose which to show. Otherwise, go select the CMS Data Loader if you want to load different data.",options:function(e,t){return T(null==t?void 0:t.tables)},defaultValueHint:function(e,t){return null==t?void 0:t.table}},field:{type:"choice",displayName:"Field",description:"Field (from model schema) to use.",options:function(e,t){var r;return I(null==t?void 0:t.tables,null!=(r=null==t?void 0:t.table)?r:e.table,["image"])},defaultValueHint:function(e,t){var r,n;return(null==t||null==(r=t.fieldMeta)?void 0:r.name)||(null==t||null==(n=t.fieldMeta)?void 0:n.identifier)}},srcProp:{type:"string",displayName:'Image "src" prop',description:"Prop to inject into children",defaultValue:"src"}}};function oe(e){var t,r=e.table,n=e.field,a=e.srcProp,i=e.children,l=e.setControlContextData,u=L("rows"),s=Y(u,r);if(!s||!s.row)return o.createElement(o.Fragment,null,i);var c=re({table:s.table,tables:u,field:n,typeFilters:["image"]});if(u&&(null==l||l({tables:u,table:s.table,row:s.row,fieldMeta:c})),!c)return o.createElement(o.Fragment,null,i);var d=(null==(t=s.row.data)?void 0:t[c.identifier])||"",f=o.Children.map(i,(function(e){var t,r;return o.isValidElement(e)&&d?o.cloneElement(e,"object"==typeof d&&d.url&&d.imageMeta?((r={})[a]={src:d.url,fullHeight:d.imageMeta.height,fullWidth:d.imageMeta.width},r):((t={})[a]=d,t)):e}));return o.createElement(o.Fragment,null,f)}var le={name:H+"-row-value",displayName:"CMS Entry Value",importName:"CmsRowFieldValue",importPath:q,props:{children:{type:"slot"},table:{type:"choice",displayName:"Model",hidden:function(e,t){var r,n;return(null!=(r=null==t||null==(n=t.tables)?void 0:n.length)?r:0)<=1&&!e.table},helpText:"Pick model from a CMS Data Fetcher",description:"Usually not used! Only with multiple CMS Data Loaders, use this to choose which to show. Otherwise, go select the CMS Data Loader if you want to load different data.",options:function(e,t){return T(null==t?void 0:t.tables)},defaultValueHint:function(e,t){return null==t?void 0:t.table}},field:{type:"choice",displayName:"Field",description:"Field (from model schema) to use.",options:function(e,t){var r;return I(null==t?void 0:t.tables,null!=(r=null==t?void 0:t.table)?r:e.table)},defaultValueHint:function(e,t){var r,n;return(null==t||null==(r=t.fieldMeta)?void 0:r.name)||(null==t||null==(n=t.fieldMeta)?void 0:n.identifier)}},valueProp:{type:"string",displayName:"Value prop",description:"Prop to inject into children as",defaultValue:"children"}}};function ue(e){var t,r=e.table,n=e.field,a=e.valueProp,i=e.children,l=e.setControlContextData,u=v(e,A),s=L("rows"),d=Y(s,r);if(!d||!d.row)return o.createElement(o.Fragment,null,i);var f=re({table:d.table,tables:s,field:n,typeFilters:["text"]});if(s&&(null==l||l({tables:s,table:d.table,row:d.row,fieldMeta:f})),!f)return o.createElement(o.Fragment,null,i);var p=(null==(t=d.row.data)?void 0:t[f.identifier])||"",m=o.Children.map(i,(function(e){var t;return o.isValidElement(e)?o.cloneElement(e,c({},u,((t={})[a]=p,t))):e}));return o.createElement(o.Fragment,null,m)}exports.API=g,exports.CmsCount=ee,exports.CmsCredentialsProvider=B,exports.CmsQueryRepeater=K,exports.CmsRowField=Z,exports.CmsRowFieldValue=ue,exports.CmsRowImage=oe,exports.CmsRowLink=ae,exports.HttpError=b,exports.cmsCountFieldMeta=$,exports.cmsCredentialsProviderMeta=J,exports.cmsQueryRepeaterMeta=z,exports.cmsRowFieldMeta=X,exports.cmsRowFieldValueMeta=le,exports.cmsRowImageMeta=ie,exports.cmsRowLinkMeta=ne,exports.mkApi=w,exports.registerAll=function(e){var n,a,i=function(r,n){e?e.registerComponent(r,n):t(r,n)};n=B,a=J,e?e.registerGlobalContext(n,a):r(n,a),i(K,z),i(Z,X),i(ae,ne),i(oe,ie),i(ue,le),i(ee,$)};
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@plasmicapp/host/registerComponent")),r=e(require("@plasmicapp/host/registerGlobalContext")),n=require("@plasmicapp/host"),a=require("@plasmicapp/query"),i=e(require("dayjs")),o=e(require("react"));function l(){l=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i=Object.create((t&&t.prototype instanceof y?t:y).prototype),o=new O(n||[]);return a(i,"_invoke",{value:D(e,r,o)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var p="suspendedStart",m="executing",h="completed",v={};function y(){}function b(){}function g(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,M=x&&x(x(L([])));M&&M!==r&&n.call(M,o)&&(w=M);var C=g.prototype=y.prototype=Object.create(w);function E(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function N(e,t){function r(a,i,o,l){var u=f(e[a],e,i);if("throw"!==u.type){var s=u.arg,c=s.value;return c&&"object"==typeof c&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,o,l)}),(function(e){r("throw",e,o,l)})):t.resolve(c).then((function(e){s.value=e,o(s)}),(function(e){return r("throw",e,o,l)}))}l(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,a){r(e,n,t,a)}))}return i=i?i.then(a,a):a()}})}function D(t,r,n){var a=p;return function(i,o){if(a===m)throw new Error("Generator is already running");if(a===h){if("throw"===i)throw o;return{value:e,done:!0}}for(n.method=i,n.arg=o;;){var l=n.delegate;if(l){var u=F(l,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===p)throw a=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=m;var s=f(t,r,n);if("normal"===s.type){if(a=n.done?h:"suspendedYield",s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(a=h,n.method="throw",n.arg=s.arg)}}}function F(t,r){var n=r.method,a=t.iterator[n];if(a===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,F(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(a,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(n.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return b.prototype=g,a(C,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:b,configurable:!0}),b.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(C),e},t.awrap=function(e){return{__await:e}},E(N.prototype),c(N.prototype,u,(function(){return this})),t.AsyncIterator=N,t.async=function(e,r,n,a,i){void 0===i&&(i=Promise);var o=new N(d(e,r,n,a),i);return t.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},E(C),c(C,s,"Generator"),c(C,o,(function(){return this})),c(C,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function a(n,a){return l.type="throw",l.arg=t,r.next=n,a&&(r.method="next",r.arg=e),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],l=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function u(e,t,r,n,a,i,o){try{var l=e[i](o),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).then(n,a)}function s(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){u(i,n,a,o,l,"next",e)}function l(e){u(i,n,a,o,l,"throw",e)}o(void 0)}))}}function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function m(e,t,r){return(m=p()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&f(a,r.prototype),a}).apply(null,arguments)}function h(e){var t="function"==typeof Map?new Map:void 0;return(h=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return m(e,arguments,d(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),f(r,e)})(e)}function v(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(a[r]=e[r]);return a}function y(e){return{where:e.where,limit:e.limit,offset:e.offset,order:e.orderBy?[{field:e.orderBy,dir:e.desc?"desc":"asc"}]:void 0,fields:e.fields}}var b=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,r)||this).status=t,n}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,f(t,r),n}(h(Error)),g=function(){function e(e){this.config=e}var t=e.prototype;return t.get=function(){var e=s(l().mark((function e(t,r){var n,a,i,o,u;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===r&&(r={}),(n=new URL(this.config.host+"/api/v1/cms/databases/"+this.config.databaseId+t)).search=new URLSearchParams(r).toString(),e.next=5,fetch(n.toString(),{method:"GET",headers:{accept:"*/*","x-plasmic-api-cms-tokens":this.config.databaseId+":"+this.config.databaseToken},mode:"cors"});case 5:if(200===(a=e.sent).status){e.next=12;break}return e.next=9,a.text();case 9:i=e.sent;try{u=JSON.parse(i),null!=(o=u.error)&&o.message&&(i=u.error.message)}catch(e){}throw new b(a.status,i);case 12:return e.next=14,a.json();case 14:return e.abrupt("return",e.sent);case 15:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}(),t.fetchTables=function(){var e=s(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.get("");case 3:return e.abrupt("return",e.sent.tables);case 7:throw e.prev=7,e.t0=e.catch(0),console.error(e.t0),e.t0;case 11:case"end":return e.stop()}}),e,this,[[0,7]])})));return function(){return e.apply(this,arguments)}}(),t.useDraftForTable=function(e){return Array.isArray(this.config.useDraft)?this.config.useDraft.includes(e):this.config.useDraft},t.query=function(){var e=s(l().mark((function e(t,r){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===r&&(r={}),e.prev=1,e.next=4,this.get("/tables/"+t+"/query",{q:JSON.stringify(y(r)),draft:Number(this.useDraftForTable(t)||r.useDraft),locale:this.config.locale});case 4:return e.abrupt("return",e.sent.rows);case 8:throw e.prev=8,e.t0=e.catch(1),console.error(e.t0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[1,8]])})));return function(t,r){return e.apply(this,arguments)}}(),t.count=function(){var e=s(l().mark((function e(t,r){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===r&&(r={}),e.prev=1,e.next=4,this.get("/tables/"+t+"/count",{q:JSON.stringify(y(r)),draft:Number(this.useDraftForTable(t)||r.useDraft)});case 4:return e.abrupt("return",e.sent.count);case 8:throw e.prev=8,e.t0=e.catch(1),console.error(e.t0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[1,8]])})));return function(t,r){return e.apply(this,arguments)}}(),e}();function w(e){if(!e)throw new Error("Component must be wrapped in 'CMS Data Provider'.");return new g(e)}var x=["databaseToken"],M=function(e){return"plasmicCms"+D(e)+"Collection"},C=function(e){return"plasmicCms"+D(e)+"Item"},E=function(e){return"plasmicCms"+D(e)+"Count"},N=function(e){return"plasmicCms"+D(e)+"Mode"};function D(e){var t;return(null==(t=e[0])?void 0:t.toUpperCase())+e.slice(1)}function F(){return n.useSelector("plasmicCmsDatabase")}function S(e){if(!e)return null;var t=v(e,x);return JSON.stringify(t)}function P(e){return o.createElement(n.DataProvider,{name:"plasmicCmsDatabase",data:e.config,hidden:!0},e.children)}function O(){return n.useSelector("plasmicCmsTables")}function L(e){return o.createElement(n.DataProvider,{name:"plasmicCmsTables",data:e.tables,hidden:!0},e.children)}function k(e){var t=e.children,r=e.table,a=e.rows,i=e.hidden;return o.createElement(n.DataProvider,{name:r?N(r):void 0,data:"rows",hidden:!0},o.createElement(n.DataProvider,{name:r?M(r):void 0,data:a,hidden:i},t))}function Y(e){var t=n.useDataEnv(),r=O();if(t&&r){var a=function(t,r){return[].concat(Object.keys(t).reverse()).filter((function(t){return function(t){return"rows"===e?t.endsWith("Item"):"count"===e?t.endsWith("Count"):t.endsWith("Item")||t.endsWith("Count")}(t)}))}(t);return r.filter((function(t){return a.some((function(r){return"rows"===e?C(t.identifier)===r:"count"===e?E(t.identifier)===r:C(t.identifier)===r||E(t.identifier)===r}))}))}}function j(e,t){return!t&&e&&e.length>0&&(t=e[0].identifier),t}function T(e,t){var r=n.useDataEnv();if(r)return(t=j(e,t))?{table:t,row:r[C(t)]}:void 0}function V(e){var t=e.children,r=e.row;return o.createElement(n.DataProvider,{name:C(e.table),data:r},t)}function I(e){var t=e.children,r=e.table,a=e.count;return o.createElement(n.DataProvider,{name:r?N(r):void 0,data:"count",hidden:!0},o.createElement(n.DataProvider,{name:r?E(r):void 0,data:a},t))}function R(e){return e?e.map((function(e){return{value:e.identifier,label:e.name}})):[]}function _(e,t,r){if(!e)return[];var n=e.find((function(e){return e.identifier===t}));if(!n)return[];var a=n.schema.fields;r&&(a=a.filter((function(e){return r.includes(e.type)})));var i=a.map((function(e){return{value:e.identifier,label:e.name||e.identifier}}));return i.some((function(e){return"_id"===e.value}))||i.push({label:"System-assigned ID",value:"_id"}),i}var A=["className","table","field","dateFormat","setControlContextData","usePlasmicTheme","themeResetClassName"],q=["className","table","setControlContextData"],H=["table","field","valueProp","children","setControlContextData"],U="@plasmicpkgs/plasmic-cms",J="hostless-plasmic-cms";function G(e,t,r,n,a,i){if("error"in e){var l=e.error;return n?l&&l instanceof b&&404===l.status?r.hideIfNotFound?null:o.createElement("div",null,"Error: Data not found"):o.createElement("div",null,"Error: ",null==l?void 0:l.message):o.createElement(o.Fragment,null,null!=a?a:o.createElement("div",null,"Loading..."))}return!("data"in e)||i?o.createElement(o.Fragment,null,null!=a?a:o.createElement("div",null,"Loading...")):t(e.data)}var B="https://data.plasmic.app",W={name:J+"-credentials-provider",displayName:"CMS Credentials Provider",description:"\nFind (or create) your CMS in the [dashboard](https://studio.plasmic.app), and go to its Settings view for the ID and token.\n\n[See tutorial video](https://docs.plasmic.app/learn/plasmic-cms/).",importName:"CmsCredentialsProvider",importPath:U,providesData:!0,props:{host:{type:"string",displayName:"Studio URL",description:"The default host for use in production is "+B+".",defaultValue:B,defaultValueHint:B,advanced:!0},databaseId:{type:"string",displayName:"CMS ID",description:"The ID of the CMS (database) to use. (Can get on the CMS settings page)"},databaseToken:{type:"string",displayName:"CMS Public Token",description:"The Public Token of the CMS (database) you are using. (Can get on the CMS settings page)"},locale:{type:"string",displayName:"Locale",description:"The locale to use for localized values, leave empty for the default locale."}}};function Q(e){var t=e.useDraft;return o.createElement(P,{config:{databaseId:e.databaseId,databaseToken:e.databaseToken,locale:e.locale,host:e.host||B,useDraft:null!=t&&t}},o.createElement(z,null,e.children))}function z(e){var t=e.children,r=F(),i=JSON.stringify({component:"TablesFetcher",databaseConfig:S(r)}),u=a.usePlasmicQueryData(i,s(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(K(r)){e.next=2;break}return e.abrupt("return",[]);case 2:return e.next=4,w(r).fetchTables();case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))),c=!!n.usePlasmicCanvasContext();return o.createElement(L,{tables:u.data},c&&u.error?o.createElement("div",null,"CMS Error: ",u.error.message):t)}function K(e){return(null==e?void 0:e.databaseId)&&(null==e?void 0:e.databaseToken)}var X={name:J+"-query-repeater",displayName:"CMS Data Fetcher",description:"Fetches CMS data. Repeats `children` slot content for each row fetched. [See tutorial video](https://docs.plasmic.app/learn/plasmic-cms/).",importName:"CmsQueryRepeater",importPath:U,providesData:!0,defaultStyles:{display:"flex",width:"stretch",maxWidth:"100%",flexDirection:"column"},props:{children:{type:"slot",isRepeated:!0,defaultValue:{type:"vbox",children:[{type:"component",name:J+"-row-field"}]}},table:{type:"choice",displayName:"Model",description:"CMS model (table) to query.",options:function(e,t){return R(null==t?void 0:t.tables)},defaultValueHint:function(e,t){return null==t?void 0:t.table}},useDraft:{type:"boolean",displayName:"Use drafts?",description:"If set, also query unpublished content.",defaultValue:!1,hidden:function(){return!0}},mode:{type:"choice",options:[{label:"Rows",value:"rows"},{label:"Count",value:"count"}],defaultValueHint:"rows"},where:{type:"object",displayName:"Filter",description:"Filter clause, in JSON format.",hidden:function(){return!0}},filterField:{type:"choice",displayName:"Filter field",description:"Field (from model schema) to filter by",options:function(e,t){var r;return _(null==t?void 0:t.tables,null!=(r=null==t?void 0:t.table)?r:e.table,["number","boolean","text","long-text","ref"])}},filterValue:{type:"string",displayName:"Filter value",description:"Value to filter by, should be of filter field type"},orderBy:{type:"choice",displayName:"Order by",description:"Field to order by.",options:function(e,t){return _(null==t?void 0:t.tables,null==t?void 0:t.table,["number","boolean","date-time","long-text","text"])},hidden:function(e){return"count"===e.mode}},desc:{type:"boolean",displayName:"Sort descending?",description:'Sort descending by "Order by" field.',defaultValue:!1,hidden:function(e){return"count"===e.mode}},limit:{type:"number",displayName:"Limit",description:"Maximum number of entries to fetch (0 for unlimited).",defaultValue:0,hidden:function(e){return"count"===e.mode}},offset:{type:"number",displayName:"Offset",description:"Skips this number of rows in the result set; used in combination with limit to build pagination",hidden:function(e){return"count"===e.mode}},fields:{type:"choice",multiSelect:!0,displayName:"Fields",description:"Fields from the CMS model to include with each row; by default, all fields are included",options:function(e,t){var r;return _(null==t?void 0:t.tables,null!=(r=null==t?void 0:t.table)?r:e.table)},hidden:function(e){return"count"===e.mode}},emptyMessage:{type:"slot",defaultValue:{type:"text",value:"No matching published entries found."}},forceEmptyState:{type:"boolean",displayName:"Force empty state",description:"If set, will render as if no matching entries were found.",defaultValue:!1},loadingMessage:{type:"slot",defaultValue:{type:"text",value:"Loading..."}},forceLoadingState:{type:"boolean",displayName:"Force loading state",description:"If set, will render as if it is waiting for the query to run.",defaultValue:!1},noLayout:{type:"boolean",displayName:"No layout",description:"When set, CMS Data Loader 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},noAutoRepeat:{type:"boolean",displayName:"No auto-repeat",description:"Do not automatically repeat children for every entry.",defaultValue:!1,hidden:function(e){return"count"===e.mode}}}};function Z(e){var t,r=e.table,i=e.children,u=e.setControlContextData,c=e.mode,d=e.where,f=e.useDraft,p=e.orderBy,m=e.desc,h=e.limit,v=e.offset,y=e.emptyMessage,b=e.forceEmptyState,g=e.loadingMessage,x=e.forceLoadingState,M=e.noLayout,C=e.noAutoRepeat,E=e.className,N=e.filterField,D=e.filterValue,P=e.fields,L=F(),Y=O();N&&D&&((t={})[N]=D,d=t);var j={where:d,useDraft:f,orderBy:p,desc:m,limit:h,offset:v,fields:P};!r&&Y&&Y.length>0&&(r=Y[0].identifier);var T=JSON.stringify({component:"CmsQueryLoader",mode:c,table:r,databaseConfig:S(L),params:j});Y&&(null==u||u({tables:Y,table:r}));var R=a.usePlasmicQueryData(T,s(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(K(L)){e.next=2;break}throw new Error("You must specify a CMS ID and API key");case 2:if(r){e.next=6;break}throw new Error("You must select a model to query");case 6:if(!Y||Y.find((function(e){return e.identifier===r}))){e.next=10;break}throw new Error('There is no model called "'+r+'"');case 10:if("count"!==c){e.next=14;break}return e.abrupt("return",w(L).count(r,j));case 14:return e.abrupt("return",w(L).query(r,j));case 15:case"end":return e.stop()}}),e)})))),_=!!n.usePlasmicCanvasContext();if("count"===c){var A=G(R,(function(){return i}),{hideIfNotFound:!1},_,g,x);return o.createElement(I,{table:r,count:"number"==typeof(null==R?void 0:R.data)?R.data:void 0},A)}var q=G(R,(function(e){return 0===e.length||b?y:C?i:e.map((function(e,t){return o.createElement(V,{key:t,table:r,row:e},n.repeatedElement(t,i))}))}),{hideIfNotFound:!1},_,g,x);return o.createElement(k,{rows:Array.isArray(null==R?void 0:R.data)?R.data:void 0,table:r},M?o.createElement(o.Fragment,null," ",q," "):o.createElement("div",{className:E}," ",q," "))}var $={name:J+"-row-field",displayName:"CMS Entry Field",importName:"CmsRowField",importPath:U,props:{table:{type:"choice",displayName:"Model",hidden:function(e,t){var r,n;return(null!=(r=null==t||null==(n=t.tables)?void 0:n.length)?r:0)<=1&&!e.table},helpText:"Pick model from a CMS Data Fetcher",description:"Usually not used! Only with multiple CMS Data Loaders, use this to choose which to show. Otherwise, go select the CMS Data Loader if you want to load different data.",options:function(e,t){return R(null==t?void 0:t.tables)},defaultValueHint:function(e,t){return null==t?void 0:t.table}},field:{type:"choice",displayName:"Field",description:"Field (from model schema) to use.",options:function(e,t){var r;return _(null==t?void 0:t.tables,null!=(r=null==t?void 0:t.table)?r:e.table,["number","boolean","text","long-text","date-time","rich-text","image","file"])},defaultValueHint:function(e,t){var r,n;return(null==t||null==(r=t.fieldMeta)?void 0:r.name)||(null==t||null==(n=t.fieldMeta)?void 0:n.identifier)}},dateFormat:{type:"choice",displayName:"Date Format",hidden:function(e,t){var r=e.field;if(!t)return!0;var n=t.table,a=t.tables,i=null==a?void 0:a.find((function(e){return e.identifier===n}));if(!i)return!0;var o=i.schema.fields.find((function(e){return e.identifier===r}));return!o||"date-time"!==o.type},options:[{label:"July 26, 2014",value:"MMMM D, YYYY"},{label:"July 26, 2014 10:02 PM",value:"MMMM D, YYYY h:mm A"},{label:"Jul 26, 2014",value:"MMM D, YYYY"},{label:"Jul 26, 2014 10:02 PM",value:"MMM D, YYYY h:mm A"},{label:"Saturday, July 26, 2014",value:"dddd, MMMM D, YYYY"},{label:"7/26/2014",value:"M/D/YYYY"},{label:"7/26/2014 10:02 PM",value:"M/D/YYYY h:mm A"},{label:"26/7/2014",value:"D/M/YYYY"},{label:"26/7/2014 10:02 PM",value:"D/M/YYYY h:mm A"},{label:"7/26/14",value:"M/D/YY"},{label:"7/26/14 10:02 PM",value:"M/D/YY h:mm A"},{label:"26/7/14",value:"D/M/YY"},{label:"26/7/14 10:02 PM",value:"D/M/YY h:mm A"}]},usePlasmicTheme:{type:"boolean",displayName:"Use Plasmic tag styles?",description:"For HTML content, use tag styles defined in Plasmic",advanced:!0},themeResetClassName:{type:"themeResetClass",targetAllTags:!0}},defaultStyles:{objectFit:"cover"}};function ee(e){var t,r=e.className,n=e.table,a=e.field,l=e.dateFormat,u=e.setControlContextData,s=e.usePlasmicTheme,d=e.themeResetClassName,f=v(e,A),p=Y("rows"),m=T(p,n),h=o.createElement("div",Object.assign({className:r},f),"Field ",null!=n?n:"Unknown Model",".",null!=a?a:"Unknown Field"),y=m?ae({table:m.table,tables:p,field:a,typeFilters:["text","long-text","rich-text"]}):void 0;if(p&&(null==u||u(c({tables:p},m&&m.row?{table:m.table,row:m.row,fieldMeta:y}:{}))),!m)return h;if(!m.row)return o.createElement("div",{className:r},"Error: No CMS Entry found");if(!y)return h;var b=null==(t=m.row.data)?void 0:t[y.identifier];return b?("date-time"===y.type&&l&&(b=i(b).format(l)),b?function(e,t,r){switch(t){case"number":case"boolean":case"text":case"long-text":case"date-time":case"ref":return o.createElement("div",Object.assign({},r),e);case"rich-text":return o.createElement("div",Object.assign({dangerouslySetInnerHTML:{__html:e},style:{whiteSpace:"normal"}},r));case"image":return e&&"object"==typeof e&&e.url&&e.imageMeta?o.createElement("img",Object.assign({src:e.url,width:e.imageMeta.width,height:e.imageMeta.height},r)):null;case"file":return e&&"object"==typeof e&&e.url&&e.name?o.createElement("a",Object.assign({href:e.url,target:"_blank"},r),e.name):null;default:!function(e){throw new Error("unexpected branch taken")}()}}(b,y.type,c({className:(s?d:"")+" "+r},f)):null):null}var te={name:J+"-count",displayName:"CMS Entries Count",importName:"CmsCount",importPath:U,props:{table:{type:"choice",displayName:"Model",hidden:function(e,t){var r,n;return(null!=(r=null==t||null==(n=t.tables)?void 0:n.length)?r:0)<=1&&!e.table},helpText:"Pick model from a CMS Data Fetcher",description:"Usually not used! Only with multiple CMS Data Loaders, use this to choose which to show. Otherwise, go select the CMS Data Loader if you want to load different data.",options:function(e,t){return R(null==t?void 0:t.tables)},defaultValueHint:function(e,t){return null==t?void 0:t.table}}}};function re(e){var t=e.className,r=e.table,a=v(e,q),i=function(e,t){var r=n.useDataEnv();if(r)return(t=j(e,t))?{table:t,count:r[E(t)]}:void 0}(Y("count"),r),l=o.createElement("div",Object.assign({className:t},a),"Count: ",null!=r?r:"Unknown Model");return i?null==i.count?null:o.createElement("div",Object.assign({className:t},a),(new Intl.NumberFormat).format(i.count)):l}var ne=["text"];function ae(e){var t,r=e.table,n=e.tables,a=e.field,i=e.typeFilters;if(r){var o=null==n||null==(t=n.find((function(e){return e.identifier===r})))?void 0:t.schema;return a?null==o?void 0:o.fields.find((function(e){return e.identifier===a})):null==o?void 0:o.fields.find((function(e){return(null!=i?i:ne).includes(e.type)}))}}var ie={name:J+"-row-link",displayName:"CMS Entry Link",importName:"CmsRowLink",importPath:U,props:{children:{type:"slot",defaultValue:{type:"text",tag:"a",value:"Link"}},table:{type:"choice",displayName:"Model",hidden:function(e,t){var r,n;return(null!=(r=null==t||null==(n=t.tables)?void 0:n.length)?r:0)<=1&&!e.table},helpText:"Pick model from a CMS Data Fetcher",description:"Usually not used! Only with multiple CMS Data Loaders, use this to choose which to show. Otherwise, go select the CMS Data Loader if you want to load different data.",options:function(e,t){return R(null==t?void 0:t.tables)},defaultValueHint:function(e,t){return null==t?void 0:t.table}},field:{type:"choice",displayName:"Field",description:"Field (from model schema) to use.",options:function(e,t){var r;return _(null==t?void 0:t.tables,null!=(r=null==t?void 0:t.table)?r:e.table)},defaultValueHint:function(e,t){var r,n;return(null==t||null==(r=t.fieldMeta)?void 0:r.name)||(null==t||null==(n=t.fieldMeta)?void 0:n.identifier)}},hrefProp:{type:"string",displayName:'"href" prop',description:"Prop to inject into children",defaultValue:"href"},prefix:{type:"string",displayName:"Optional prefix",description:"Prefix to prepend to prop value.",hidden:function(e,t){var r;return"file"===(null==t||null==(r=t.fieldMeta)?void 0:r.type)}},suffix:{type:"string",displayName:"Optional suffix",description:"Suffix to append to prop value.",hidden:function(e,t){var r;return"file"===(null==t||null==(r=t.fieldMeta)?void 0:r.type)}}}};function oe(e){var t,r=e.table,n=e.field,a=e.hrefProp,i=e.children,l=e.setControlContextData,u=e.prefix,s=e.suffix,c=Y("rows"),d=T(c,r);if(!d||!d.row)return o.createElement(o.Fragment,null,i);var f=ae({table:d.table,tables:c,field:n,typeFilters:["file","text"]});if(c&&(null==l||l({tables:c,table:d.table,row:d.row,fieldMeta:f})),!f)return o.createElement(o.Fragment,null,i);if(!i)return null;var p=(null==(t=d.row.data)?void 0:t[f.identifier])||"",m=o.Children.map(i,(function(e){var t;return o.isValidElement(e)?o.cloneElement(e,((t={})[a]="file"===f.type?p.url:u||s?""+(u||"")+p+(s||""):p,t)):e}));return o.createElement(o.Fragment,null,null!=m?m:null)}var le={name:J+"-row-image",displayName:"CMS Entry Image",importName:"CmsRowImage",importPath:U,props:{children:{type:"slot",defaultValue:{type:"img",src:"https://studio.plasmic.app/static/img/placeholder-full.png"}},table:{type:"choice",displayName:"Model",hidden:function(e,t){var r,n;return(null!=(r=null==t||null==(n=t.tables)?void 0:n.length)?r:0)<=1&&!e.table},helpText:"Pick model from a CMS Data Fetcher",description:"Usually not used! Only with multiple CMS Data Loaders, use this to choose which to show. Otherwise, go select the CMS Data Loader if you want to load different data.",options:function(e,t){return R(null==t?void 0:t.tables)},defaultValueHint:function(e,t){return null==t?void 0:t.table}},field:{type:"choice",displayName:"Field",description:"Field (from model schema) to use.",options:function(e,t){var r;return _(null==t?void 0:t.tables,null!=(r=null==t?void 0:t.table)?r:e.table,["image"])},defaultValueHint:function(e,t){var r,n;return(null==t||null==(r=t.fieldMeta)?void 0:r.name)||(null==t||null==(n=t.fieldMeta)?void 0:n.identifier)}},srcProp:{type:"string",displayName:'Image "src" prop',description:"Prop to inject into children",defaultValue:"src"}}};function ue(e){var t,r=e.table,n=e.field,a=e.srcProp,i=e.children,l=e.setControlContextData,u=Y("rows"),s=T(u,r);if(!s||!s.row)return o.createElement(o.Fragment,null,i);var c=ae({table:s.table,tables:u,field:n,typeFilters:["image"]});if(u&&(null==l||l({tables:u,table:s.table,row:s.row,fieldMeta:c})),!c)return o.createElement(o.Fragment,null,i);var d=(null==(t=s.row.data)?void 0:t[c.identifier])||"",f=o.Children.map(i,(function(e){var t,r;return o.isValidElement(e)&&d?o.cloneElement(e,"object"==typeof d&&d.url&&d.imageMeta?((r={})[a]={src:d.url,fullHeight:d.imageMeta.height,fullWidth:d.imageMeta.width},r):((t={})[a]=d,t)):e}));return o.createElement(o.Fragment,null,f)}var se={name:J+"-row-value",displayName:"CMS Entry Value",importName:"CmsRowFieldValue",importPath:U,props:{children:{type:"slot"},table:{type:"choice",displayName:"Model",hidden:function(e,t){var r,n;return(null!=(r=null==t||null==(n=t.tables)?void 0:n.length)?r:0)<=1&&!e.table},helpText:"Pick model from a CMS Data Fetcher",description:"Usually not used! Only with multiple CMS Data Loaders, use this to choose which to show. Otherwise, go select the CMS Data Loader if you want to load different data.",options:function(e,t){return R(null==t?void 0:t.tables)},defaultValueHint:function(e,t){return null==t?void 0:t.table}},field:{type:"choice",displayName:"Field",description:"Field (from model schema) to use.",options:function(e,t){var r;return _(null==t?void 0:t.tables,null!=(r=null==t?void 0:t.table)?r:e.table)},defaultValueHint:function(e,t){var r,n;return(null==t||null==(r=t.fieldMeta)?void 0:r.name)||(null==t||null==(n=t.fieldMeta)?void 0:n.identifier)}},valueProp:{type:"string",displayName:"Value prop",description:"Prop to inject into children as",defaultValue:"children"}}};function ce(e){var t,r=e.table,n=e.field,a=e.valueProp,i=e.children,l=e.setControlContextData,u=v(e,H),s=Y("rows"),d=T(s,r);if(!d||!d.row)return o.createElement(o.Fragment,null,i);var f=ae({table:d.table,tables:s,field:n,typeFilters:["text"]});if(s&&(null==l||l({tables:s,table:d.table,row:d.row,fieldMeta:f})),!f)return o.createElement(o.Fragment,null,i);var p=(null==(t=d.row.data)?void 0:t[f.identifier])||"",m=o.Children.map(i,(function(e){var t;return o.isValidElement(e)?o.cloneElement(e,c({},u,((t={})[a]=p,t))):e}));return o.createElement(o.Fragment,null,m)}exports.API=g,exports.CmsCount=re,exports.CmsCredentialsProvider=Q,exports.CmsQueryRepeater=Z,exports.CmsRowField=ee,exports.CmsRowFieldValue=ce,exports.CmsRowImage=ue,exports.CmsRowLink=oe,exports.HttpError=b,exports.cmsCountFieldMeta=te,exports.cmsCredentialsProviderMeta=W,exports.cmsQueryRepeaterMeta=X,exports.cmsRowFieldMeta=$,exports.cmsRowFieldValueMeta=se,exports.cmsRowImageMeta=le,exports.cmsRowLinkMeta=ie,exports.mkApi=w,exports.registerAll=function(e){var n,a,i=function(r,n){e?e.registerComponent(r,n):t(r,n)};n=Q,a=W,e?e.registerGlobalContext(n,a):r(n,a),i(Z,X),i(ee,$),i(oe,ie),i(ue,le),i(ce,se),i(re,te)};
//# sourceMappingURL=plasmic-cms.cjs.production.min.js.map

@@ -634,2 +634,3 @@ import registerComponent from '@plasmicapp/host/registerComponent';

var _excluded = ["databaseToken"];
var contextPrefix = "plasmicCms";

@@ -661,2 +662,9 @@ var databaseContextKey = contextPrefix + "Database";

}
function makeDatabaseCacheKey(config) {
if (!config) {
return null;
}
var rest = _objectWithoutPropertiesLoose(config, _excluded);
return JSON.stringify(rest);
}
function DatabaseProvider(_ref) {

@@ -834,3 +842,3 @@ var config = _ref.config,

var _excluded = ["className", "table", "field", "dateFormat", "setControlContextData", "themeResetClassName"],
var _excluded$1 = ["className", "table", "field", "dateFormat", "setControlContextData", "usePlasmicTheme", "themeResetClassName"],
_excluded2 = ["className", "table", "setControlContextData"],

@@ -918,3 +926,3 @@ _excluded3 = ["table", "field", "valueProp", "children", "setControlContextData"];

component: "TablesFetcher",
databaseConfig: databaseConfig
databaseConfig: makeDatabaseCacheKey(databaseConfig)
});

@@ -1165,3 +1173,3 @@ var maybeData = usePlasmicQueryData(cacheKey, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {

table: table,
databaseConfig: databaseConfig,
databaseConfig: makeDatabaseCacheKey(databaseConfig),
params: params

@@ -1348,2 +1356,8 @@ });

},
usePlasmicTheme: {
type: "boolean",
displayName: "Use Plasmic tag styles?",
description: "For HTML content, use tag styles defined in Plasmic",
advanced: true
},
themeResetClassName: {

@@ -1365,4 +1379,5 @@ type: "themeResetClass",

setControlContextData = _ref10.setControlContextData,
usePlasmicTheme = _ref10.usePlasmicTheme,
themeResetClassName = _ref10.themeResetClassName,
rest = _objectWithoutPropertiesLoose(_ref10, _excluded);
rest = _objectWithoutPropertiesLoose(_ref10, _excluded$1);
var tables = useTablesWithDataLoaded("rows");

@@ -1408,3 +1423,3 @@ var res = useRow(tables, table);

return data ? renderValue(data, fieldMeta.type, _extends({
className: themeResetClassName + " " + className
className: (usePlasmicTheme ? themeResetClassName : "") + " " + className
}, rest)) : null;

@@ -1411,0 +1426,0 @@ }

{
"name": "@plasmicpkgs/plasmic-cms",
"version": "0.0.244",
"version": "0.0.245",
"description": "Plasmic CMS components",

@@ -49,3 +49,3 @@ "main": "dist/index.js",

},
"gitHead": "34a39fbe7707170c9d7a9d28607af2db46dbc98f"
"gitHead": "bf00f36483427e63521c9bb2737c3631c9bfb53f"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc