@plasmicpkgs/plasmic-cms 0.0.284 → 0.0.285

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.
@@ -1,1858 +0,0 @@
1
- import registerComponent from '@plasmicapp/host/registerComponent';
2
- import registerGlobalContext from '@plasmicapp/host/registerGlobalContext';
3
- import { useSelector, DataProvider, useDataEnv, usePlasmicCanvasContext, repeatedElement } from '@plasmicapp/host';
4
- import { usePlasmicQueryData } from '@plasmicapp/query';
5
- import dayjs from 'dayjs';
6
- import React from 'react';
7
-
8
- function asyncGeneratorStep(n, t, e, r, o, a, c) {
9
- try {
10
- var i = n[a](c),
11
- u = i.value;
12
- } catch (n) {
13
- return void e(n);
14
- }
15
- i.done ? t(u) : Promise.resolve(u).then(r, o);
16
- }
17
- function _asyncToGenerator(n) {
18
- return function () {
19
- var t = this,
20
- e = arguments;
21
- return new Promise(function (r, o) {
22
- var a = n.apply(t, e);
23
- function _next(n) {
24
- asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
25
- }
26
- function _throw(n) {
27
- asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
28
- }
29
- _next(void 0);
30
- });
31
- };
32
- }
33
- function _construct(t, e, r) {
34
- if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
35
- var o = [null];
36
- o.push.apply(o, e);
37
- var p = new (t.bind.apply(t, o))();
38
- return r && _setPrototypeOf(p, r.prototype), p;
39
- }
40
- function _extends() {
41
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
42
- for (var e = 1; e < arguments.length; e++) {
43
- var t = arguments[e];
44
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
45
- }
46
- return n;
47
- }, _extends.apply(null, arguments);
48
- }
49
- function _getPrototypeOf(t) {
50
- return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
51
- return t.__proto__ || Object.getPrototypeOf(t);
52
- }, _getPrototypeOf(t);
53
- }
54
- function _inheritsLoose(t, o) {
55
- t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
56
- }
57
- function _isNativeFunction(t) {
58
- try {
59
- return -1 !== Function.toString.call(t).indexOf("[native code]");
60
- } catch (n) {
61
- return "function" == typeof t;
62
- }
63
- }
64
- function _isNativeReflectConstruct() {
65
- try {
66
- var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
67
- } catch (t) {}
68
- return (_isNativeReflectConstruct = function () {
69
- return !!t;
70
- })();
71
- }
72
- function _objectWithoutPropertiesLoose(r, e) {
73
- if (null == r) return {};
74
- var t = {};
75
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
76
- if (-1 !== e.indexOf(n)) continue;
77
- t[n] = r[n];
78
- }
79
- return t;
80
- }
81
- function _regeneratorRuntime() {
82
- _regeneratorRuntime = function () {
83
- return e;
84
- };
85
- var t,
86
- e = {},
87
- r = Object.prototype,
88
- n = r.hasOwnProperty,
89
- o = Object.defineProperty || function (t, e, r) {
90
- t[e] = r.value;
91
- },
92
- i = "function" == typeof Symbol ? Symbol : {},
93
- a = i.iterator || "@@iterator",
94
- c = i.asyncIterator || "@@asyncIterator",
95
- u = i.toStringTag || "@@toStringTag";
96
- function define(t, e, r) {
97
- return Object.defineProperty(t, e, {
98
- value: r,
99
- enumerable: !0,
100
- configurable: !0,
101
- writable: !0
102
- }), t[e];
103
- }
104
- try {
105
- define({}, "");
106
- } catch (t) {
107
- define = function (t, e, r) {
108
- return t[e] = r;
109
- };
110
- }
111
- function wrap(t, e, r, n) {
112
- var i = e && e.prototype instanceof Generator ? e : Generator,
113
- a = Object.create(i.prototype),
114
- c = new Context(n || []);
115
- return o(a, "_invoke", {
116
- value: makeInvokeMethod(t, r, c)
117
- }), a;
118
- }
119
- function tryCatch(t, e, r) {
120
- try {
121
- return {
122
- type: "normal",
123
- arg: t.call(e, r)
124
- };
125
- } catch (t) {
126
- return {
127
- type: "throw",
128
- arg: t
129
- };
130
- }
131
- }
132
- e.wrap = wrap;
133
- var h = "suspendedStart",
134
- l = "suspendedYield",
135
- f = "executing",
136
- s = "completed",
137
- y = {};
138
- function Generator() {}
139
- function GeneratorFunction() {}
140
- function GeneratorFunctionPrototype() {}
141
- var p = {};
142
- define(p, a, function () {
143
- return this;
144
- });
145
- var d = Object.getPrototypeOf,
146
- v = d && d(d(values([])));
147
- v && v !== r && n.call(v, a) && (p = v);
148
- var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
149
- function defineIteratorMethods(t) {
150
- ["next", "throw", "return"].forEach(function (e) {
151
- define(t, e, function (t) {
152
- return this._invoke(e, t);
153
- });
154
- });
155
- }
156
- function AsyncIterator(t, e) {
157
- function invoke(r, o, i, a) {
158
- var c = tryCatch(t[r], t, o);
159
- if ("throw" !== c.type) {
160
- var u = c.arg,
161
- h = u.value;
162
- return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
163
- invoke("next", t, i, a);
164
- }, function (t) {
165
- invoke("throw", t, i, a);
166
- }) : e.resolve(h).then(function (t) {
167
- u.value = t, i(u);
168
- }, function (t) {
169
- return invoke("throw", t, i, a);
170
- });
171
- }
172
- a(c.arg);
173
- }
174
- var r;
175
- o(this, "_invoke", {
176
- value: function (t, n) {
177
- function callInvokeWithMethodAndArg() {
178
- return new e(function (e, r) {
179
- invoke(t, n, e, r);
180
- });
181
- }
182
- return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
183
- }
184
- });
185
- }
186
- function makeInvokeMethod(e, r, n) {
187
- var o = h;
188
- return function (i, a) {
189
- if (o === f) throw Error("Generator is already running");
190
- if (o === s) {
191
- if ("throw" === i) throw a;
192
- return {
193
- value: t,
194
- done: !0
195
- };
196
- }
197
- for (n.method = i, n.arg = a;;) {
198
- var c = n.delegate;
199
- if (c) {
200
- var u = maybeInvokeDelegate(c, n);
201
- if (u) {
202
- if (u === y) continue;
203
- return u;
204
- }
205
- }
206
- if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
207
- if (o === h) throw o = s, n.arg;
208
- n.dispatchException(n.arg);
209
- } else "return" === n.method && n.abrupt("return", n.arg);
210
- o = f;
211
- var p = tryCatch(e, r, n);
212
- if ("normal" === p.type) {
213
- if (o = n.done ? s : l, p.arg === y) continue;
214
- return {
215
- value: p.arg,
216
- done: n.done
217
- };
218
- }
219
- "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
220
- }
221
- };
222
- }
223
- function maybeInvokeDelegate(e, r) {
224
- var n = r.method,
225
- o = e.iterator[n];
226
- if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
227
- var i = tryCatch(o, e.iterator, r.arg);
228
- if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
229
- var a = i.arg;
230
- return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
231
- }
232
- function pushTryEntry(t) {
233
- var e = {
234
- tryLoc: t[0]
235
- };
236
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
237
- }
238
- function resetTryEntry(t) {
239
- var e = t.completion || {};
240
- e.type = "normal", delete e.arg, t.completion = e;
241
- }
242
- function Context(t) {
243
- this.tryEntries = [{
244
- tryLoc: "root"
245
- }], t.forEach(pushTryEntry, this), this.reset(!0);
246
- }
247
- function values(e) {
248
- if (e || "" === e) {
249
- var r = e[a];
250
- if (r) return r.call(e);
251
- if ("function" == typeof e.next) return e;
252
- if (!isNaN(e.length)) {
253
- var o = -1,
254
- i = function next() {
255
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
256
- return next.value = t, next.done = !0, next;
257
- };
258
- return i.next = i;
259
- }
260
- }
261
- throw new TypeError(typeof e + " is not iterable");
262
- }
263
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
264
- value: GeneratorFunctionPrototype,
265
- configurable: !0
266
- }), o(GeneratorFunctionPrototype, "constructor", {
267
- value: GeneratorFunction,
268
- configurable: !0
269
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
270
- var e = "function" == typeof t && t.constructor;
271
- return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
272
- }, e.mark = function (t) {
273
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
274
- }, e.awrap = function (t) {
275
- return {
276
- __await: t
277
- };
278
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
279
- return this;
280
- }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
281
- void 0 === i && (i = Promise);
282
- var a = new AsyncIterator(wrap(t, r, n, o), i);
283
- return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
284
- return t.done ? t.value : a.next();
285
- });
286
- }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
287
- return this;
288
- }), define(g, "toString", function () {
289
- return "[object Generator]";
290
- }), e.keys = function (t) {
291
- var e = Object(t),
292
- r = [];
293
- for (var n in e) r.push(n);
294
- return r.reverse(), function next() {
295
- for (; r.length;) {
296
- var t = r.pop();
297
- if (t in e) return next.value = t, next.done = !1, next;
298
- }
299
- return next.done = !0, next;
300
- };
301
- }, e.values = values, Context.prototype = {
302
- constructor: Context,
303
- reset: function (e) {
304
- if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
305
- },
306
- stop: function () {
307
- this.done = !0;
308
- var t = this.tryEntries[0].completion;
309
- if ("throw" === t.type) throw t.arg;
310
- return this.rval;
311
- },
312
- dispatchException: function (e) {
313
- if (this.done) throw e;
314
- var r = this;
315
- function handle(n, o) {
316
- return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
317
- }
318
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
319
- var i = this.tryEntries[o],
320
- a = i.completion;
321
- if ("root" === i.tryLoc) return handle("end");
322
- if (i.tryLoc <= this.prev) {
323
- var c = n.call(i, "catchLoc"),
324
- u = n.call(i, "finallyLoc");
325
- if (c && u) {
326
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
327
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
328
- } else if (c) {
329
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
330
- } else {
331
- if (!u) throw Error("try statement without catch or finally");
332
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
333
- }
334
- }
335
- }
336
- },
337
- abrupt: function (t, e) {
338
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
339
- var o = this.tryEntries[r];
340
- if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
341
- var i = o;
342
- break;
343
- }
344
- }
345
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
346
- var a = i ? i.completion : {};
347
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
348
- },
349
- complete: function (t, e) {
350
- if ("throw" === t.type) throw t.arg;
351
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
352
- },
353
- finish: function (t) {
354
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
355
- var r = this.tryEntries[e];
356
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
357
- }
358
- },
359
- catch: function (t) {
360
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
361
- var r = this.tryEntries[e];
362
- if (r.tryLoc === t) {
363
- var n = r.completion;
364
- if ("throw" === n.type) {
365
- var o = n.arg;
366
- resetTryEntry(r);
367
- }
368
- return o;
369
- }
370
- }
371
- throw Error("illegal catch attempt");
372
- },
373
- delegateYield: function (e, r, n) {
374
- return this.delegate = {
375
- iterator: values(e),
376
- resultName: r,
377
- nextLoc: n
378
- }, "next" === this.method && (this.arg = t), y;
379
- }
380
- }, e;
381
- }
382
- function _setPrototypeOf(t, e) {
383
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
384
- return t.__proto__ = e, t;
385
- }, _setPrototypeOf(t, e);
386
- }
387
- function _wrapNativeSuper(t) {
388
- var r = "function" == typeof Map ? new Map() : void 0;
389
- return _wrapNativeSuper = function (t) {
390
- if (null === t || !_isNativeFunction(t)) return t;
391
- if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
392
- if (void 0 !== r) {
393
- if (r.has(t)) return r.get(t);
394
- r.set(t, Wrapper);
395
- }
396
- function Wrapper() {
397
- return _construct(t, arguments, _getPrototypeOf(this).constructor);
398
- }
399
- return Wrapper.prototype = Object.create(t.prototype, {
400
- constructor: {
401
- value: Wrapper,
402
- enumerable: !1,
403
- writable: !0,
404
- configurable: !0
405
- }
406
- }), _setPrototypeOf(Wrapper, t);
407
- }, _wrapNativeSuper(t);
408
- }
409
-
410
- function queryParamsToApi(params) {
411
- return {
412
- where: params.where,
413
- limit: params.limit,
414
- offset: params.offset,
415
- order: params.orderBy ? [{
416
- field: params.orderBy,
417
- dir: params.desc ? "desc" : "asc"
418
- }] : undefined,
419
- fields: params.fields
420
- };
421
- }
422
- var HttpError = /*#__PURE__*/function (_Error) {
423
- _inheritsLoose(HttpError, _Error);
424
- function HttpError(status, message) {
425
- var _this;
426
- _this = _Error.call(this, message) || this;
427
- _this.status = status;
428
- return _this;
429
- }
430
- return HttpError;
431
- }(/*#__PURE__*/_wrapNativeSuper(Error));
432
- var API = /*#__PURE__*/function () {
433
- function API(config) {
434
- this.config = config;
435
- }
436
- var _proto = API.prototype;
437
- _proto.get = /*#__PURE__*/function () {
438
- var _get = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(endpoint, params) {
439
- var url, fixedParams, response, message, _json$error, json;
440
- return _regeneratorRuntime().wrap(function _callee$(_context) {
441
- while (1) switch (_context.prev = _context.next) {
442
- case 0:
443
- if (params === void 0) {
444
- params = {};
445
- }
446
- url = new URL(this.config.host + "/api/v1/cms/databases/" + this.config.databaseId + endpoint);
447
- fixedParams = Object.keys(params).reduce(function (newObj, key) {
448
- var value = params[key];
449
- if (value != null) {
450
- newObj[key] = value;
451
- }
452
- return newObj;
453
- }, {});
454
- url.search = new URLSearchParams(fixedParams).toString();
455
- _context.next = 6;
456
- return fetch(url.toString(), {
457
- method: "GET",
458
- headers: {
459
- accept: "*/*",
460
- "x-plasmic-api-cms-tokens": this.config.databaseId + ":" + this.config.databaseToken
461
- },
462
- mode: "cors"
463
- });
464
- case 6:
465
- response = _context.sent;
466
- if (!(response.status !== 200)) {
467
- _context.next = 13;
468
- break;
469
- }
470
- _context.next = 10;
471
- return response.text();
472
- case 10:
473
- message = _context.sent;
474
- try {
475
- json = JSON.parse(message);
476
- if ((_json$error = json.error) != null && _json$error.message) {
477
- message = json.error.message;
478
- }
479
- } catch (_unused) {
480
- // ignored
481
- }
482
- throw new HttpError(response.status, message);
483
- case 13:
484
- _context.next = 15;
485
- return response.json();
486
- case 15:
487
- return _context.abrupt("return", _context.sent);
488
- case 16:
489
- case "end":
490
- return _context.stop();
491
- }
492
- }, _callee, this);
493
- }));
494
- function get(_x, _x2) {
495
- return _get.apply(this, arguments);
496
- }
497
- return get;
498
- }();
499
- _proto.fetchTables = /*#__PURE__*/function () {
500
- var _fetchTables = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
501
- var response;
502
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
503
- while (1) switch (_context2.prev = _context2.next) {
504
- case 0:
505
- _context2.prev = 0;
506
- _context2.next = 3;
507
- return this.get("");
508
- case 3:
509
- response = _context2.sent;
510
- return _context2.abrupt("return", response.tables);
511
- case 7:
512
- _context2.prev = 7;
513
- _context2.t0 = _context2["catch"](0);
514
- console.error(_context2.t0);
515
- throw _context2.t0;
516
- case 11:
517
- case "end":
518
- return _context2.stop();
519
- }
520
- }, _callee2, this, [[0, 7]]);
521
- }));
522
- function fetchTables() {
523
- return _fetchTables.apply(this, arguments);
524
- }
525
- return fetchTables;
526
- }();
527
- _proto.useDraftForTable = function useDraftForTable(table) {
528
- if (Array.isArray(this.config.useDraft)) {
529
- return this.config.useDraft.includes(table);
530
- } else {
531
- return this.config.useDraft;
532
- }
533
- };
534
- _proto.query = /*#__PURE__*/function () {
535
- var _query = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(table, params) {
536
- var response;
537
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
538
- while (1) switch (_context3.prev = _context3.next) {
539
- case 0:
540
- if (params === void 0) {
541
- params = {};
542
- }
543
- _context3.prev = 1;
544
- _context3.next = 4;
545
- return this.get("/tables/" + table + "/query", {
546
- q: JSON.stringify(queryParamsToApi(params)),
547
- draft: Number(this.useDraftForTable(table) || params.useDraft),
548
- locale: this.config.locale
549
- });
550
- case 4:
551
- response = _context3.sent;
552
- return _context3.abrupt("return", response.rows);
553
- case 8:
554
- _context3.prev = 8;
555
- _context3.t0 = _context3["catch"](1);
556
- console.error(_context3.t0);
557
- throw _context3.t0;
558
- case 12:
559
- case "end":
560
- return _context3.stop();
561
- }
562
- }, _callee3, this, [[1, 8]]);
563
- }));
564
- function query(_x3, _x4) {
565
- return _query.apply(this, arguments);
566
- }
567
- return query;
568
- }();
569
- _proto.count = /*#__PURE__*/function () {
570
- var _count = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(table, params) {
571
- var response;
572
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
573
- while (1) switch (_context4.prev = _context4.next) {
574
- case 0:
575
- if (params === void 0) {
576
- params = {};
577
- }
578
- _context4.prev = 1;
579
- _context4.next = 4;
580
- return this.get("/tables/" + table + "/count", {
581
- q: JSON.stringify(queryParamsToApi(params)),
582
- draft: Number(this.useDraftForTable(table) || params.useDraft)
583
- });
584
- case 4:
585
- response = _context4.sent;
586
- return _context4.abrupt("return", response.count);
587
- case 8:
588
- _context4.prev = 8;
589
- _context4.t0 = _context4["catch"](1);
590
- console.error(_context4.t0);
591
- throw _context4.t0;
592
- case 12:
593
- case "end":
594
- return _context4.stop();
595
- }
596
- }, _callee4, this, [[1, 8]]);
597
- }));
598
- function count(_x5, _x6) {
599
- return _count.apply(this, arguments);
600
- }
601
- return count;
602
- }();
603
- return API;
604
- }();
605
- function mkApi(config) {
606
- if (!config) {
607
- throw new Error("Component must be wrapped in 'CMS Data Provider'.");
608
- }
609
- return new API(config);
610
- }
611
-
612
- var _excluded = ["databaseToken"];
613
- var contextPrefix = "plasmicCms";
614
- var databaseContextKey = contextPrefix + "Database";
615
- var tablesContextKey = contextPrefix + "Tables";
616
- var tableSchemaContextKey = contextPrefix + "TableSchema";
617
- var collectionResultSuffix = "Collection";
618
- var mkQueryContextKey = function mkQueryContextKey(table) {
619
- return "" + contextPrefix + capitalizeFirst(table) + collectionResultSuffix;
620
- };
621
- var itemContextSuffix = "Item";
622
- var countContextSuffix = "Count";
623
- var modeContextSuffix = "Mode";
624
- var mkRowContextKey = function mkRowContextKey(table) {
625
- return "" + contextPrefix + capitalizeFirst(table) + itemContextSuffix;
626
- };
627
- var mkCountContextKey = function mkCountContextKey(table) {
628
- return "" + contextPrefix + capitalizeFirst(table) + countContextSuffix;
629
- };
630
- var mkModeContextKey = function mkModeContextKey(table) {
631
- return "" + contextPrefix + capitalizeFirst(table) + modeContextSuffix;
632
- };
633
- function capitalizeFirst(str) {
634
- var _str$;
635
- return ((_str$ = str[0]) == null ? void 0 : _str$.toUpperCase()) + str.slice(1);
636
- }
637
- function useDatabase() {
638
- return useSelector(databaseContextKey);
639
- }
640
- function makeDatabaseCacheKey(config) {
641
- if (!config) {
642
- return null;
643
- }
644
- var rest = _objectWithoutPropertiesLoose(config, _excluded);
645
- return JSON.stringify(rest);
646
- }
647
- function DatabaseProvider(_ref) {
648
- var config = _ref.config,
649
- children = _ref.children;
650
- return React.createElement(DataProvider, {
651
- name: databaseContextKey,
652
- data: config,
653
- hidden: true
654
- }, children);
655
- }
656
- function useTables() {
657
- return useSelector(tablesContextKey);
658
- }
659
- function TablesProvider(_ref2) {
660
- var children = _ref2.children,
661
- tables = _ref2.tables;
662
- return React.createElement(DataProvider, {
663
- name: tablesContextKey,
664
- data: tables,
665
- hidden: true
666
- }, children);
667
- }
668
- function TableSchemaProvider(_ref3) {
669
- var children = _ref3.children,
670
- table = _ref3.table;
671
- var tables = useTables();
672
- var schema;
673
- if (tables && (tables == null ? void 0 : tables.length) > 0) {
674
- if (!table) {
675
- var _tables$;
676
- schema = (_tables$ = tables[0]) == null ? void 0 : _tables$.schema;
677
- } else {
678
- var _tables$find;
679
- schema = tables == null || (_tables$find = tables.find(function (t) {
680
- return (t == null ? void 0 : t.identifier) === table;
681
- })) == null ? void 0 : _tables$find.schema;
682
- }
683
- }
684
- return React.createElement(DataProvider, {
685
- name: tableSchemaContextKey,
686
- data: schema
687
- }, children);
688
- }
689
- function getClosestMatchingKeysBy(env, pred) {
690
- return [].concat(Object.keys(env).reverse()).filter(function (key) {
691
- return pred(key);
692
- });
693
- }
694
- function QueryResultProvider(_ref4) {
695
- var children = _ref4.children,
696
- table = _ref4.table,
697
- rows = _ref4.rows,
698
- hidden = _ref4.hidden;
699
- return React.createElement(DataProvider, {
700
- name: table ? mkModeContextKey(table) : undefined,
701
- data: "rows",
702
- hidden: true
703
- }, React.createElement(DataProvider, {
704
- name: table ? mkQueryContextKey(table) : undefined,
705
- data: rows,
706
- hidden: hidden
707
- }, children));
708
- }
709
- function useTablesWithDataLoaded(mode) {
710
- var env = useDataEnv();
711
- var tables = useTables();
712
- if (!env) {
713
- return undefined;
714
- }
715
- if (!tables) {
716
- return undefined;
717
- }
718
- var matchingKeys = getClosestMatchingKeysBy(env, function (key) {
719
- if (mode === "rows") {
720
- return key.endsWith(itemContextSuffix);
721
- } else if (mode === "count") {
722
- return key.endsWith(countContextSuffix);
723
- } else {
724
- return key.endsWith(itemContextSuffix) || key.endsWith(countContextSuffix);
725
- }
726
- });
727
- return tables.filter(function (table) {
728
- return matchingKeys.some(function (key) {
729
- if (mode === "rows") {
730
- return mkRowContextKey(table.identifier) === key;
731
- } else if (mode === "count") {
732
- return mkCountContextKey(table.identifier) === key;
733
- } else {
734
- return mkRowContextKey(table.identifier) === key || mkCountContextKey(table.identifier) === key;
735
- }
736
- });
737
- });
738
- }
739
- function deriveTableId(tables, table) {
740
- if (!table && tables && tables.length > 0) {
741
- table = tables[0].identifier;
742
- }
743
- return table;
744
- }
745
- function useRow(tables, table) {
746
- var env = useDataEnv();
747
- if (!env) {
748
- return undefined;
749
- }
750
- table = deriveTableId(tables, table);
751
- if (table) {
752
- return {
753
- table: table,
754
- row: env[mkRowContextKey(table)]
755
- };
756
- }
757
- return undefined;
758
- }
759
- function useCount(tables, table) {
760
- var env = useDataEnv();
761
- if (!env) {
762
- return undefined;
763
- }
764
- table = deriveTableId(tables, table);
765
- if (table) {
766
- return {
767
- table: table,
768
- count: env[mkCountContextKey(table)]
769
- };
770
- }
771
- return undefined;
772
- }
773
- function RowProvider(_ref5) {
774
- var children = _ref5.children,
775
- table = _ref5.table,
776
- row = _ref5.row;
777
- return React.createElement(DataProvider, {
778
- name: mkRowContextKey(table),
779
- data: row
780
- }, children);
781
- }
782
- function CountProvider(_ref6) {
783
- var children = _ref6.children,
784
- table = _ref6.table,
785
- count = _ref6.count;
786
- return React.createElement(DataProvider, {
787
- name: table ? mkModeContextKey(table) : undefined,
788
- data: "count",
789
- hidden: true
790
- }, React.createElement(DataProvider, {
791
- name: table ? mkCountContextKey(table) : undefined,
792
- data: count
793
- }, children));
794
- }
795
-
796
- function mkTableOptions(tables) {
797
- if (!tables) {
798
- return [];
799
- }
800
- return tables.map(function (table) {
801
- return {
802
- value: table.identifier,
803
- label: table.name
804
- };
805
- });
806
- }
807
- function mkFieldOptions(tables, tableIdentifier, types) {
808
- if (!tables) {
809
- return [];
810
- }
811
- var table = tables.find(function (t) {
812
- return t.identifier === tableIdentifier;
813
- });
814
- if (!table) {
815
- return [];
816
- }
817
- var fields = table.schema.fields;
818
- if (types) {
819
- fields = fields.filter(function (f) {
820
- return types.includes(f.type);
821
- });
822
- }
823
- var options = fields.map(function (f) {
824
- return {
825
- value: f.identifier,
826
- label: f.name || f.identifier
827
- };
828
- });
829
- if (!options.some(function (option) {
830
- return option.value === "_id";
831
- })) {
832
- options.push({
833
- label: "System-assigned ID",
834
- value: "_id"
835
- });
836
- }
837
- return options;
838
- }
839
-
840
- var _excluded$1 = ["className", "table", "field", "dateFormat", "setControlContextData", "usePlasmicTheme", "themeResetClassName"],
841
- _excluded2 = ["className", "table", "setControlContextData"],
842
- _excluded3 = ["table", "field", "valueProp", "children", "setControlContextData"];
843
- var modulePath = "@plasmicpkgs/plasmic-cms";
844
- var componentPrefix = "hostless-plasmic-cms";
845
- function renderMaybeData(maybeData, renderFn, loaderProps, inEditor, loadingMessage, forceLoadingState) {
846
- if ("error" in maybeData) {
847
- var error = maybeData.error;
848
- if (!inEditor) {
849
- return React.createElement(React.Fragment, null, loadingMessage != null ? loadingMessage : React.createElement("div", null, "Loading..."));
850
- }
851
- if (error && error instanceof HttpError && error.status === 404) {
852
- if (loaderProps.hideIfNotFound) {
853
- return null;
854
- } else {
855
- return React.createElement("div", null, "Error: Data not found");
856
- }
857
- } else {
858
- return React.createElement("div", null, "Error: ", error == null ? void 0 : error.message);
859
- }
860
- }
861
- if (!("data" in maybeData) || forceLoadingState) {
862
- return React.createElement(React.Fragment, null, loadingMessage != null ? loadingMessage : React.createElement("div", null, "Loading..."));
863
- }
864
- return renderFn(maybeData.data);
865
- }
866
- var defaultHost = "https://data.plasmic.app";
867
- var cmsCredentialsProviderMeta = {
868
- name: componentPrefix + "-credentials-provider",
869
- displayName: "CMS Credentials Provider",
870
- 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/).",
871
- importName: "CmsCredentialsProvider",
872
- importPath: modulePath,
873
- providesData: true,
874
- props: {
875
- host: {
876
- type: "string",
877
- displayName: "Studio URL",
878
- description: "The default host for use in production is " + defaultHost + ".",
879
- defaultValue: defaultHost,
880
- defaultValueHint: defaultHost,
881
- advanced: true
882
- },
883
- databaseId: {
884
- type: "string",
885
- displayName: "CMS ID",
886
- description: "The ID of the CMS (database) to use. (Can get on the CMS settings page)"
887
- },
888
- databaseToken: {
889
- type: "string",
890
- displayName: "CMS Public Token",
891
- description: "The Public Token of the CMS (database) you are using. (Can get on the CMS settings page)"
892
- },
893
- locale: {
894
- type: "string",
895
- displayName: "Locale",
896
- description: "The locale to use for localized values, leave empty for the default locale."
897
- }
898
- }
899
- };
900
- function CmsCredentialsProvider(_ref) {
901
- var children = _ref.children,
902
- databaseId = _ref.databaseId,
903
- databaseToken = _ref.databaseToken,
904
- host = _ref.host,
905
- locale = _ref.locale,
906
- useDraft = _ref.useDraft;
907
- var config = {
908
- databaseId: databaseId,
909
- databaseToken: databaseToken,
910
- locale: locale,
911
- host: host || defaultHost,
912
- useDraft: useDraft != null ? useDraft : false
913
- };
914
- return React.createElement(DatabaseProvider, {
915
- config: config
916
- }, React.createElement(TablesFetcher, null, children));
917
- }
918
- function TablesFetcher(_ref2) {
919
- var children = _ref2.children;
920
- var databaseConfig = useDatabase();
921
- var cacheKey = JSON.stringify({
922
- component: "TablesFetcher",
923
- databaseConfig: makeDatabaseCacheKey(databaseConfig)
924
- });
925
- var maybeData = usePlasmicQueryData(cacheKey, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
926
- return _regeneratorRuntime().wrap(function _callee$(_context) {
927
- while (1) switch (_context.prev = _context.next) {
928
- case 0:
929
- if (isDatabaseConfigured(databaseConfig)) {
930
- _context.next = 2;
931
- break;
932
- }
933
- return _context.abrupt("return", []);
934
- case 2:
935
- _context.next = 4;
936
- return mkApi(databaseConfig).fetchTables();
937
- case 4:
938
- return _context.abrupt("return", _context.sent);
939
- case 5:
940
- case "end":
941
- return _context.stop();
942
- }
943
- }, _callee);
944
- })));
945
- var inEditor = !!usePlasmicCanvasContext();
946
- return React.createElement(TablesProvider, {
947
- tables: maybeData.data
948
- }, inEditor && maybeData.error ? React.createElement("div", null, "CMS Error: ", maybeData.error.message) : children);
949
- }
950
- function isDatabaseConfigured(config) {
951
- return (config == null ? void 0 : config.databaseId) && (config == null ? void 0 : config.databaseToken);
952
- }
953
- var cmsQueryRepeaterMeta = {
954
- name: componentPrefix + "-query-repeater",
955
- displayName: "CMS Data Fetcher",
956
- description: "Fetches CMS data. Repeats `children` slot content for each row fetched. [See tutorial video](https://docs.plasmic.app/learn/plasmic-cms/).",
957
- importName: "CmsQueryRepeater",
958
- importPath: modulePath,
959
- providesData: true,
960
- defaultStyles: {
961
- display: "flex",
962
- width: "stretch",
963
- maxWidth: "100%",
964
- flexDirection: "column"
965
- },
966
- props: {
967
- children: {
968
- type: "slot",
969
- isRepeated: true,
970
- defaultValue: {
971
- type: "vbox",
972
- children: [{
973
- type: "component",
974
- name: componentPrefix + "-row-field"
975
- }]
976
- }
977
- },
978
- table: {
979
- type: "choice",
980
- displayName: "Model",
981
- description: "CMS model (table) to query.",
982
- options: function options(_, ctx) {
983
- return mkTableOptions(ctx == null ? void 0 : ctx.tables);
984
- },
985
- defaultValueHint: function defaultValueHint(_, ctx) {
986
- return ctx == null ? void 0 : ctx.table;
987
- }
988
- },
989
- useDraft: {
990
- type: "boolean",
991
- displayName: "Use drafts?",
992
- description: "If set, also query unpublished content.",
993
- defaultValue: false,
994
- hidden: function hidden() {
995
- return true;
996
- }
997
- },
998
- mode: {
999
- type: "choice",
1000
- options: [{
1001
- label: "Rows",
1002
- value: "rows"
1003
- }, {
1004
- label: "Count",
1005
- value: "count"
1006
- }],
1007
- defaultValueHint: "rows"
1008
- },
1009
- where: {
1010
- type: "object",
1011
- displayName: "Filter",
1012
- description: "Filter clause, as a JSON in Mongo query format. Should not be used together with Filter field and Filter value",
1013
- advanced: true
1014
- },
1015
- filterField: {
1016
- type: "choice",
1017
- displayName: "Filter field",
1018
- description: "Field (from model schema) to filter by",
1019
- options: function options(_ref4, ctx) {
1020
- var _ctx$table;
1021
- var table = _ref4.table;
1022
- return mkFieldOptions(ctx == null ? void 0 : ctx.tables, (_ctx$table = ctx == null ? void 0 : ctx.table) != null ? _ctx$table : table, ["number" /* NUMBER */, "boolean" /* BOOLEAN */, "text" /* TEXT */, "long-text" /* LONG_TEXT */, "ref" /* REF */]);
1023
- }
1024
- },
1025
- filterValue: {
1026
- type: "string",
1027
- displayName: "Filter value",
1028
- description: "Value to filter by, should be of filter field type"
1029
- },
1030
- orderBy: {
1031
- type: "choice",
1032
- displayName: "Order by",
1033
- description: "Field to order by.",
1034
- options: function options(_, ctx) {
1035
- return mkFieldOptions(ctx == null ? void 0 : ctx.tables, ctx == null ? void 0 : ctx.table, ["number" /* NUMBER */, "boolean" /* BOOLEAN */, "date-time" /* DATE_TIME */, "long-text" /* LONG_TEXT */, "text" /* TEXT */]);
1036
- },
1037
- hidden: function hidden(ps) {
1038
- return ps.mode === "count";
1039
- }
1040
- },
1041
- desc: {
1042
- type: "boolean",
1043
- displayName: "Sort descending?",
1044
- description: 'Sort descending by "Order by" field.',
1045
- defaultValue: false,
1046
- hidden: function hidden(ps) {
1047
- return ps.mode === "count";
1048
- }
1049
- },
1050
- limit: {
1051
- type: "number",
1052
- displayName: "Limit",
1053
- description: "Maximum number of entries to fetch (0 for unlimited).",
1054
- defaultValue: 0,
1055
- min: 0,
1056
- hidden: function hidden(ps) {
1057
- return ps.mode === "count";
1058
- }
1059
- },
1060
- offset: {
1061
- type: "number",
1062
- displayName: "Offset",
1063
- description: "Skips this number of rows in the result set; used in combination with limit to build pagination",
1064
- min: 0,
1065
- hidden: function hidden(ps) {
1066
- return ps.mode === "count";
1067
- }
1068
- },
1069
- fields: {
1070
- type: "choice",
1071
- multiSelect: true,
1072
- displayName: "Fields",
1073
- description: "Fields from the CMS model to include with each row; by default, all fields are included",
1074
- options: function options(_ref5, ctx) {
1075
- var _ctx$table2;
1076
- var table = _ref5.table;
1077
- return mkFieldOptions(ctx == null ? void 0 : ctx.tables, (_ctx$table2 = ctx == null ? void 0 : ctx.table) != null ? _ctx$table2 : table);
1078
- },
1079
- hidden: function hidden(ps) {
1080
- return ps.mode === "count";
1081
- }
1082
- },
1083
- emptyMessage: {
1084
- type: "slot",
1085
- defaultValue: {
1086
- type: "text",
1087
- value: "No matching published entries found."
1088
- }
1089
- },
1090
- forceEmptyState: {
1091
- type: "boolean",
1092
- displayName: "Force empty state",
1093
- description: "If set, will render as if no matching entries were found.",
1094
- defaultValue: false
1095
- },
1096
- loadingMessage: {
1097
- type: "slot",
1098
- defaultValue: {
1099
- type: "text",
1100
- value: "Loading..."
1101
- }
1102
- },
1103
- forceLoadingState: {
1104
- type: "boolean",
1105
- displayName: "Force loading state",
1106
- description: "If set, will render as if it is waiting for the query to run.",
1107
- defaultValue: false
1108
- },
1109
- noLayout: {
1110
- type: "boolean",
1111
- displayName: "No layout",
1112
- 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.",
1113
- defaultValue: false
1114
- },
1115
- noAutoRepeat: {
1116
- type: "boolean",
1117
- displayName: "No auto-repeat",
1118
- description: "Do not automatically repeat children for every entry.",
1119
- defaultValue: false,
1120
- hidden: function hidden(ps) {
1121
- return ps.mode === "count";
1122
- }
1123
- }
1124
- }
1125
- };
1126
- function CmsQueryRepeater(_ref6) {
1127
- var table = _ref6.table,
1128
- children = _ref6.children,
1129
- setControlContextData = _ref6.setControlContextData,
1130
- mode = _ref6.mode,
1131
- where = _ref6.where,
1132
- useDraft = _ref6.useDraft,
1133
- orderBy = _ref6.orderBy,
1134
- desc = _ref6.desc,
1135
- limit = _ref6.limit,
1136
- offset = _ref6.offset,
1137
- emptyMessage = _ref6.emptyMessage,
1138
- forceEmptyState = _ref6.forceEmptyState,
1139
- loadingMessage = _ref6.loadingMessage,
1140
- forceLoadingState = _ref6.forceLoadingState,
1141
- noLayout = _ref6.noLayout,
1142
- noAutoRepeat = _ref6.noAutoRepeat,
1143
- className = _ref6.className,
1144
- filterField = _ref6.filterField,
1145
- filterValue = _ref6.filterValue,
1146
- fields = _ref6.fields;
1147
- var databaseConfig = useDatabase();
1148
- var tables = useTables();
1149
- if (filterField && filterValue) {
1150
- var _where;
1151
- where = (_where = {}, _where[filterField] = filterValue, _where);
1152
- }
1153
- var params = {
1154
- where: where,
1155
- useDraft: useDraft,
1156
- orderBy: orderBy,
1157
- desc: desc,
1158
- limit: limit,
1159
- offset: offset,
1160
- fields: fields
1161
- };
1162
- if (!table && tables && tables.length > 0) {
1163
- table = tables[0].identifier;
1164
- }
1165
- var cacheKey = JSON.stringify({
1166
- component: "CmsQueryLoader",
1167
- mode: mode,
1168
- table: table,
1169
- databaseConfig: makeDatabaseCacheKey(databaseConfig),
1170
- params: params
1171
- });
1172
- if (tables) {
1173
- // TODO: Only include table if __plasmic_cms_row_{table} exists.
1174
- setControlContextData == null || setControlContextData({
1175
- tables: tables,
1176
- table: table
1177
- });
1178
- }
1179
- var maybeData = usePlasmicQueryData(cacheKey, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
1180
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1181
- while (1) switch (_context2.prev = _context2.next) {
1182
- case 0:
1183
- if (isDatabaseConfigured(databaseConfig)) {
1184
- _context2.next = 2;
1185
- break;
1186
- }
1187
- throw new Error("You must specify a CMS ID and API key");
1188
- case 2:
1189
- if (table) {
1190
- _context2.next = 6;
1191
- break;
1192
- }
1193
- throw new Error("You must select a model to query");
1194
- case 6:
1195
- if (!(tables && !tables.find(function (t) {
1196
- return t.identifier === table;
1197
- }))) {
1198
- _context2.next = 10;
1199
- break;
1200
- }
1201
- throw new Error("There is no model called \"" + table + "\"");
1202
- case 10:
1203
- if (!(mode === "count")) {
1204
- _context2.next = 14;
1205
- break;
1206
- }
1207
- return _context2.abrupt("return", mkApi(databaseConfig).count(table, params));
1208
- case 14:
1209
- return _context2.abrupt("return", mkApi(databaseConfig).query(table, params));
1210
- case 15:
1211
- case "end":
1212
- return _context2.stop();
1213
- }
1214
- }, _callee2);
1215
- })));
1216
- var inEditor = !!usePlasmicCanvasContext();
1217
- if (mode === "count") {
1218
- var node = renderMaybeData(maybeData, function () {
1219
- return children;
1220
- }, {
1221
- hideIfNotFound: false
1222
- }, inEditor, loadingMessage, forceLoadingState);
1223
- return React.createElement(TableSchemaProvider, {
1224
- table: table
1225
- }, React.createElement(CountProvider, {
1226
- table: table,
1227
- count: typeof (maybeData == null ? void 0 : maybeData.data) === "number" ? maybeData.data : undefined
1228
- }, node));
1229
- } else {
1230
- var _node = renderMaybeData(maybeData, function (rows) {
1231
- if (rows.length === 0 || forceEmptyState) {
1232
- return emptyMessage;
1233
- }
1234
- return noAutoRepeat ? children : rows.map(function (row, index) {
1235
- return React.createElement(RowProvider, {
1236
- key: index,
1237
- table: table,
1238
- row: row
1239
- }, repeatedElement(index, children));
1240
- });
1241
- }, {
1242
- hideIfNotFound: false
1243
- }, inEditor, loadingMessage, forceLoadingState);
1244
- return React.createElement(TableSchemaProvider, {
1245
- table: table
1246
- }, React.createElement(QueryResultProvider, {
1247
- rows: Array.isArray(maybeData == null ? void 0 : maybeData.data) ? maybeData.data : undefined,
1248
- table: table
1249
- }, noLayout ? React.createElement(React.Fragment, null, " ", _node, " ") : React.createElement("div", {
1250
- className: className
1251
- }, " ", _node, " ")));
1252
- }
1253
- }
1254
- var cmsRowFieldMeta = {
1255
- name: componentPrefix + "-row-field",
1256
- displayName: "CMS Entry Field",
1257
- importName: "CmsRowField",
1258
- importPath: modulePath,
1259
- props: {
1260
- table: {
1261
- type: "choice",
1262
- displayName: "Model",
1263
- hidden: function hidden(props, ctx) {
1264
- var _ctx$tables$length, _ctx$tables;
1265
- return ((_ctx$tables$length = ctx == null || (_ctx$tables = ctx.tables) == null ? void 0 : _ctx$tables.length) != null ? _ctx$tables$length : 0) <= 1 && !props.table;
1266
- },
1267
- helpText: "Pick model from a CMS Data Fetcher",
1268
- 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.",
1269
- options: function options(_, ctx) {
1270
- return mkTableOptions(ctx == null ? void 0 : ctx.tables);
1271
- },
1272
- defaultValueHint: function defaultValueHint(_, ctx) {
1273
- return ctx == null ? void 0 : ctx.table;
1274
- }
1275
- },
1276
- field: {
1277
- type: "choice",
1278
- displayName: "Field",
1279
- description: "Field (from model schema) to use.",
1280
- options: function options(_ref8, ctx) {
1281
- var _ctx$table3;
1282
- var table = _ref8.table;
1283
- return mkFieldOptions(ctx == null ? void 0 : ctx.tables, (_ctx$table3 = ctx == null ? void 0 : ctx.table) != null ? _ctx$table3 : table, ["number" /* NUMBER */, "boolean" /* BOOLEAN */, "text" /* TEXT */, "long-text" /* LONG_TEXT */, "date-time" /* DATE_TIME */, "rich-text" /* RICH_TEXT */, "image" /* IMAGE */, "file" /* FILE */, "enum" /* ENUM */]);
1284
- },
1285
- defaultValueHint: function defaultValueHint(_, ctx) {
1286
- var _ctx$fieldMeta, _ctx$fieldMeta2;
1287
- return (ctx == null || (_ctx$fieldMeta = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta.name) || (ctx == null || (_ctx$fieldMeta2 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta2.identifier);
1288
- }
1289
- },
1290
- dateFormat: {
1291
- type: "choice",
1292
- displayName: "Date Format",
1293
- hidden: function hidden(_ref9, ctx) {
1294
- var field = _ref9.field;
1295
- if (!ctx) {
1296
- return true;
1297
- }
1298
- var tableIdentifier = ctx.table,
1299
- tables = ctx.tables;
1300
- var table = tables == null ? void 0 : tables.find(function (t) {
1301
- return t.identifier === tableIdentifier;
1302
- });
1303
- if (!table) {
1304
- return true;
1305
- }
1306
- var fieldMeta = table.schema.fields.find(function (f) {
1307
- return f.identifier === field;
1308
- });
1309
- if (!fieldMeta) {
1310
- return true;
1311
- }
1312
- return fieldMeta.type !== "date-time" /* DATE_TIME */;
1313
- },
1314
- options: [{
1315
- label: "July 26, 2014",
1316
- value: "MMMM D, YYYY"
1317
- }, {
1318
- label: "July 26, 2014 10:02 PM",
1319
- value: "MMMM D, YYYY h:mm A"
1320
- }, {
1321
- label: "Jul 26, 2014",
1322
- value: "MMM D, YYYY"
1323
- }, {
1324
- label: "Jul 26, 2014 10:02 PM",
1325
- value: "MMM D, YYYY h:mm A"
1326
- }, {
1327
- label: "Saturday, July 26, 2014",
1328
- value: "dddd, MMMM D, YYYY"
1329
- }, {
1330
- label: "7/26/2014",
1331
- value: "M/D/YYYY"
1332
- }, {
1333
- label: "7/26/2014 10:02 PM",
1334
- value: "M/D/YYYY h:mm A"
1335
- }, {
1336
- label: "26/7/2014",
1337
- value: "D/M/YYYY"
1338
- }, {
1339
- label: "26/7/2014 10:02 PM",
1340
- value: "D/M/YYYY h:mm A"
1341
- }, {
1342
- label: "7/26/14",
1343
- value: "M/D/YY"
1344
- }, {
1345
- label: "7/26/14 10:02 PM",
1346
- value: "M/D/YY h:mm A"
1347
- }, {
1348
- label: "26/7/14",
1349
- value: "D/M/YY"
1350
- }, {
1351
- label: "26/7/14 10:02 PM",
1352
- value: "D/M/YY h:mm A"
1353
- }]
1354
- },
1355
- usePlasmicTheme: {
1356
- type: "boolean",
1357
- displayName: "Use Plasmic tag styles?",
1358
- description: "For HTML content, use tag styles defined in Plasmic",
1359
- advanced: true
1360
- },
1361
- themeResetClassName: {
1362
- type: "themeResetClass",
1363
- targetAllTags: true
1364
- }
1365
- },
1366
- defaultStyles: {
1367
- objectFit: "cover"
1368
- }
1369
- };
1370
- function CmsRowField(_ref10) {
1371
- var _res$row$data;
1372
- var className = _ref10.className,
1373
- table = _ref10.table,
1374
- field = _ref10.field,
1375
- dateFormat = _ref10.dateFormat,
1376
- setControlContextData = _ref10.setControlContextData,
1377
- usePlasmicTheme = _ref10.usePlasmicTheme,
1378
- themeResetClassName = _ref10.themeResetClassName,
1379
- rest = _objectWithoutPropertiesLoose(_ref10, _excluded$1);
1380
- var tables = useTablesWithDataLoaded("rows");
1381
- var res = useRow(tables, table);
1382
- var unknown = React.createElement("div", Object.assign({
1383
- className: className
1384
- }, rest), "Field ", table != null ? table : "Unknown Model", ".", field != null ? field : "Unknown Field");
1385
- var fieldMeta = res ? deriveInferredTableField({
1386
- table: res.table,
1387
- tables: tables,
1388
- field: field,
1389
- typeFilters: ["text" /* TEXT */, "long-text" /* LONG_TEXT */, "rich-text" /* RICH_TEXT */]
1390
- }) : undefined;
1391
- if (tables) {
1392
- // TODO: Only include table if __plasmic_cms_row_{table} exists.
1393
- setControlContextData == null || setControlContextData(_extends({
1394
- tables: tables
1395
- }, res && res.row ? {
1396
- table: res.table,
1397
- row: res.row,
1398
- fieldMeta: fieldMeta
1399
- } : {}));
1400
- }
1401
- if (!res) {
1402
- return unknown;
1403
- }
1404
- if (!res.row) {
1405
- return React.createElement("div", {
1406
- className: className
1407
- }, "Error: No CMS Entry found");
1408
- }
1409
- if (!fieldMeta) {
1410
- return unknown;
1411
- }
1412
- var data = (_res$row$data = res.row.data) == null ? void 0 : _res$row$data[fieldMeta.identifier];
1413
- if (!data) {
1414
- return null;
1415
- }
1416
- if (fieldMeta.type === "date-time" /* DATE_TIME */ && dateFormat) {
1417
- data = dayjs(data).format(dateFormat);
1418
- }
1419
- return data ? renderValue(data, fieldMeta.type, _extends({
1420
- className: (usePlasmicTheme ? themeResetClassName : "") + " " + className
1421
- }, rest)) : null;
1422
- }
1423
- var cmsCountFieldMeta = {
1424
- name: componentPrefix + "-count",
1425
- displayName: "CMS Entries Count",
1426
- importName: "CmsCount",
1427
- importPath: modulePath,
1428
- props: {
1429
- table: {
1430
- type: "choice",
1431
- displayName: "Model",
1432
- hidden: function hidden(props, ctx) {
1433
- var _ctx$tables$length2, _ctx$tables2;
1434
- return ((_ctx$tables$length2 = ctx == null || (_ctx$tables2 = ctx.tables) == null ? void 0 : _ctx$tables2.length) != null ? _ctx$tables$length2 : 0) <= 1 && !props.table;
1435
- },
1436
- helpText: "Pick model from a CMS Data Fetcher",
1437
- 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.",
1438
- options: function options(_, ctx) {
1439
- return mkTableOptions(ctx == null ? void 0 : ctx.tables);
1440
- },
1441
- defaultValueHint: function defaultValueHint(_, ctx) {
1442
- return ctx == null ? void 0 : ctx.table;
1443
- }
1444
- }
1445
- }
1446
- };
1447
- function CmsCount(_ref11) {
1448
- var className = _ref11.className,
1449
- table = _ref11.table,
1450
- rest = _objectWithoutPropertiesLoose(_ref11, _excluded2);
1451
- var tables = useTablesWithDataLoaded("count");
1452
- var res = useCount(tables, table);
1453
- var unknown = React.createElement("div", Object.assign({
1454
- className: className
1455
- }, rest), "Count: ", table != null ? table : "Unknown Model");
1456
- if (!res) {
1457
- return unknown;
1458
- }
1459
- if (res.count == null) {
1460
- return null;
1461
- } else {
1462
- return React.createElement("div", Object.assign({
1463
- className: className
1464
- }, rest), new Intl.NumberFormat().format(res.count));
1465
- }
1466
- }
1467
- var DEFAULT_TYPE_FILTERS = ["text" /* TEXT */];
1468
- function deriveInferredTableField(opts) {
1469
- var _tables$find;
1470
- var table = opts.table,
1471
- tables = opts.tables,
1472
- field = opts.field,
1473
- typeFilters = opts.typeFilters;
1474
- if (!table) return undefined;
1475
- var schema = tables == null || (_tables$find = tables.find(function (t) {
1476
- return t.identifier === table;
1477
- })) == null ? void 0 : _tables$find.schema;
1478
- var fieldMeta = field ? schema == null ? void 0 : schema.fields.find(function (f) {
1479
- return f.identifier === field;
1480
- }) : schema == null ? void 0 : schema.fields.find(function (f) {
1481
- return (typeFilters != null ? typeFilters : DEFAULT_TYPE_FILTERS).includes(f.type);
1482
- });
1483
- return fieldMeta;
1484
- }
1485
- function assertNever(_) {
1486
- throw new Error("unexpected branch taken");
1487
- }
1488
- function renderValue(value, type, props) {
1489
- switch (type) {
1490
- case "number" /* NUMBER */:
1491
- case "boolean" /* BOOLEAN */:
1492
- case "text" /* TEXT */:
1493
- case "long-text" /* LONG_TEXT */:
1494
- case "date-time" /* DATE_TIME */:
1495
- case "enum" /* ENUM */:
1496
- case "ref" /* REF */:
1497
- return React.createElement("div", Object.assign({}, props), value);
1498
- case "rich-text" /* RICH_TEXT */:
1499
- return React.createElement("div", Object.assign({
1500
- dangerouslySetInnerHTML: {
1501
- __html: value
1502
- },
1503
- style: {
1504
- whiteSpace: "normal"
1505
- }
1506
- }, props));
1507
- case "image" /* IMAGE */:
1508
- if (value && typeof value === "object" && value.url && value.imageMeta) {
1509
- return React.createElement("img", Object.assign({
1510
- src: value.url,
1511
- width: value.imageMeta.width,
1512
- height: value.imageMeta.height
1513
- }, props));
1514
- }
1515
- return null;
1516
- case "file" /* FILE */:
1517
- if (value && typeof value === "object" && value.url && value.name) {
1518
- return React.createElement("a", Object.assign({
1519
- href: value.url,
1520
- target: "_blank"
1521
- }, props), value.name);
1522
- }
1523
- return null;
1524
- default:
1525
- assertNever();
1526
- }
1527
- }
1528
- var cmsRowLinkMeta = {
1529
- name: componentPrefix + "-row-link",
1530
- displayName: "CMS Entry Link",
1531
- importName: "CmsRowLink",
1532
- importPath: modulePath,
1533
- props: {
1534
- children: {
1535
- type: "slot",
1536
- defaultValue: {
1537
- type: "text",
1538
- tag: "a",
1539
- value: "Link"
1540
- }
1541
- },
1542
- table: {
1543
- type: "choice",
1544
- displayName: "Model",
1545
- hidden: function hidden(props, ctx) {
1546
- var _ctx$tables$length3, _ctx$tables3;
1547
- return ((_ctx$tables$length3 = ctx == null || (_ctx$tables3 = ctx.tables) == null ? void 0 : _ctx$tables3.length) != null ? _ctx$tables$length3 : 0) <= 1 && !props.table;
1548
- },
1549
- helpText: "Pick model from a CMS Data Fetcher",
1550
- 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.",
1551
- options: function options(_, ctx) {
1552
- return mkTableOptions(ctx == null ? void 0 : ctx.tables);
1553
- },
1554
- defaultValueHint: function defaultValueHint(_, ctx) {
1555
- return ctx == null ? void 0 : ctx.table;
1556
- }
1557
- },
1558
- field: {
1559
- type: "choice",
1560
- displayName: "Field",
1561
- description: "Field (from model schema) to use.",
1562
- options: function options(_ref12, ctx) {
1563
- var _ctx$table4;
1564
- var table = _ref12.table;
1565
- return mkFieldOptions(ctx == null ? void 0 : ctx.tables, (_ctx$table4 = ctx == null ? void 0 : ctx.table) != null ? _ctx$table4 : table);
1566
- },
1567
- defaultValueHint: function defaultValueHint(_, ctx) {
1568
- var _ctx$fieldMeta3, _ctx$fieldMeta4;
1569
- return (ctx == null || (_ctx$fieldMeta3 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta3.name) || (ctx == null || (_ctx$fieldMeta4 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta4.identifier);
1570
- }
1571
- },
1572
- hrefProp: {
1573
- type: "string",
1574
- displayName: '"href" prop',
1575
- description: "Prop to inject into children",
1576
- defaultValue: "href"
1577
- },
1578
- prefix: {
1579
- type: "string",
1580
- displayName: "Optional prefix",
1581
- description: "Prefix to prepend to prop value.",
1582
- hidden: function hidden(_, ctx) {
1583
- var _ctx$fieldMeta5;
1584
- return (ctx == null || (_ctx$fieldMeta5 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta5.type) === "file";
1585
- }
1586
- },
1587
- suffix: {
1588
- type: "string",
1589
- displayName: "Optional suffix",
1590
- description: "Suffix to append to prop value.",
1591
- hidden: function hidden(_, ctx) {
1592
- var _ctx$fieldMeta6;
1593
- return (ctx == null || (_ctx$fieldMeta6 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta6.type) === "file";
1594
- }
1595
- }
1596
- }
1597
- };
1598
- function CmsRowLink(_ref13) {
1599
- var _res$row$data2;
1600
- var table = _ref13.table,
1601
- field = _ref13.field,
1602
- hrefProp = _ref13.hrefProp,
1603
- children = _ref13.children,
1604
- setControlContextData = _ref13.setControlContextData,
1605
- prefix = _ref13.prefix,
1606
- suffix = _ref13.suffix;
1607
- var tables = useTablesWithDataLoaded("rows");
1608
- var res = useRow(tables, table);
1609
- if (!res || !res.row) {
1610
- return React.createElement(React.Fragment, null, children);
1611
- }
1612
- var fieldMeta = deriveInferredTableField({
1613
- table: res.table,
1614
- tables: tables,
1615
- field: field,
1616
- typeFilters: ["file" /* FILE */, "text" /* TEXT */]
1617
- });
1618
- if (tables) {
1619
- // TODO: Only include table if __plasmic_cms_row_{table} exists.
1620
- setControlContextData == null || setControlContextData({
1621
- tables: tables,
1622
- table: res.table,
1623
- row: res.row,
1624
- fieldMeta: fieldMeta
1625
- });
1626
- }
1627
- if (!fieldMeta) {
1628
- return React.createElement(React.Fragment, null, children);
1629
- }
1630
- if (!children) {
1631
- return null;
1632
- }
1633
- var value = ((_res$row$data2 = res.row.data) == null ? void 0 : _res$row$data2[fieldMeta.identifier]) || "";
1634
- var childrenWithProps = React.Children.map(children, function (child) {
1635
- if (React.isValidElement(child)) {
1636
- var _React$cloneElement;
1637
- return React.cloneElement(child, (_React$cloneElement = {}, _React$cloneElement[hrefProp] = fieldMeta.type === "file" /* FILE */ ? value.url : prefix || suffix ? "" + (prefix || "") + value + (suffix || "") : value, _React$cloneElement));
1638
- }
1639
- return child;
1640
- });
1641
- return React.createElement(React.Fragment, null, childrenWithProps != null ? childrenWithProps : null);
1642
- }
1643
- var cmsRowImageMeta = {
1644
- name: componentPrefix + "-row-image",
1645
- displayName: "CMS Entry Image",
1646
- importName: "CmsRowImage",
1647
- importPath: modulePath,
1648
- props: {
1649
- children: {
1650
- type: "slot",
1651
- defaultValue: {
1652
- type: "img",
1653
- src: "https://studio.plasmic.app/static/img/placeholder-full.png"
1654
- }
1655
- },
1656
- table: {
1657
- type: "choice",
1658
- displayName: "Model",
1659
- hidden: function hidden(props, ctx) {
1660
- var _ctx$tables$length4, _ctx$tables4;
1661
- return ((_ctx$tables$length4 = ctx == null || (_ctx$tables4 = ctx.tables) == null ? void 0 : _ctx$tables4.length) != null ? _ctx$tables$length4 : 0) <= 1 && !props.table;
1662
- },
1663
- helpText: "Pick model from a CMS Data Fetcher",
1664
- 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.",
1665
- options: function options(_, ctx) {
1666
- return mkTableOptions(ctx == null ? void 0 : ctx.tables);
1667
- },
1668
- defaultValueHint: function defaultValueHint(_, ctx) {
1669
- return ctx == null ? void 0 : ctx.table;
1670
- }
1671
- },
1672
- field: {
1673
- type: "choice",
1674
- displayName: "Field",
1675
- description: "Field (from model schema) to use.",
1676
- options: function options(_ref14, ctx) {
1677
- var _ctx$table5;
1678
- var table = _ref14.table;
1679
- return mkFieldOptions(ctx == null ? void 0 : ctx.tables, (_ctx$table5 = ctx == null ? void 0 : ctx.table) != null ? _ctx$table5 : table, ["image" /* IMAGE */]);
1680
- },
1681
- defaultValueHint: function defaultValueHint(_, ctx) {
1682
- var _ctx$fieldMeta7, _ctx$fieldMeta8;
1683
- return (ctx == null || (_ctx$fieldMeta7 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta7.name) || (ctx == null || (_ctx$fieldMeta8 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta8.identifier);
1684
- }
1685
- },
1686
- srcProp: {
1687
- type: "string",
1688
- displayName: 'Image "src" prop',
1689
- description: "Prop to inject into children",
1690
- defaultValue: "src"
1691
- }
1692
- }
1693
- };
1694
- function CmsRowImage(_ref15) {
1695
- var _res$row$data3;
1696
- var table = _ref15.table,
1697
- field = _ref15.field,
1698
- srcProp = _ref15.srcProp,
1699
- children = _ref15.children,
1700
- setControlContextData = _ref15.setControlContextData;
1701
- var tables = useTablesWithDataLoaded("rows");
1702
- var res = useRow(tables, table);
1703
- if (!res || !res.row) {
1704
- return React.createElement(React.Fragment, null, children);
1705
- }
1706
- var fieldMeta = deriveInferredTableField({
1707
- table: res.table,
1708
- tables: tables,
1709
- field: field,
1710
- typeFilters: ["image" /* IMAGE */]
1711
- });
1712
- if (tables) {
1713
- // TODO: Only include table if __plasmic_cms_row_{table} exists.
1714
- setControlContextData == null || setControlContextData({
1715
- tables: tables,
1716
- table: res.table,
1717
- row: res.row,
1718
- fieldMeta: fieldMeta
1719
- });
1720
- }
1721
- if (!fieldMeta) {
1722
- return React.createElement(React.Fragment, null, children);
1723
- }
1724
- var value = ((_res$row$data3 = res.row.data) == null ? void 0 : _res$row$data3[fieldMeta.identifier]) || "";
1725
- var childrenWithProps = React.Children.map(children, function (child) {
1726
- if (React.isValidElement(child) && value) {
1727
- var _React$cloneElement3;
1728
- if (typeof value === "object" && value.url && value.imageMeta) {
1729
- var _React$cloneElement2;
1730
- return React.cloneElement(child, (_React$cloneElement2 = {}, _React$cloneElement2[srcProp] = {
1731
- src: value.url,
1732
- fullHeight: value.imageMeta.height,
1733
- fullWidth: value.imageMeta.width
1734
- }, _React$cloneElement2));
1735
- }
1736
- return React.cloneElement(child, (_React$cloneElement3 = {}, _React$cloneElement3[srcProp] = value, _React$cloneElement3));
1737
- }
1738
- return child;
1739
- });
1740
- return React.createElement(React.Fragment, null, childrenWithProps);
1741
- }
1742
- var cmsRowFieldValueMeta = {
1743
- name: componentPrefix + "-row-value",
1744
- displayName: "CMS Entry Value",
1745
- importName: "CmsRowFieldValue",
1746
- importPath: modulePath,
1747
- props: {
1748
- children: {
1749
- type: "slot"
1750
- },
1751
- table: {
1752
- type: "choice",
1753
- displayName: "Model",
1754
- hidden: function hidden(props, ctx) {
1755
- var _ctx$tables$length5, _ctx$tables5;
1756
- return ((_ctx$tables$length5 = ctx == null || (_ctx$tables5 = ctx.tables) == null ? void 0 : _ctx$tables5.length) != null ? _ctx$tables$length5 : 0) <= 1 && !props.table;
1757
- },
1758
- helpText: "Pick model from a CMS Data Fetcher",
1759
- 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.",
1760
- options: function options(_, ctx) {
1761
- return mkTableOptions(ctx == null ? void 0 : ctx.tables);
1762
- },
1763
- defaultValueHint: function defaultValueHint(_, ctx) {
1764
- return ctx == null ? void 0 : ctx.table;
1765
- }
1766
- },
1767
- field: {
1768
- type: "choice",
1769
- displayName: "Field",
1770
- description: "Field (from model schema) to use.",
1771
- options: function options(_ref16, ctx) {
1772
- var _ctx$table6;
1773
- var table = _ref16.table;
1774
- return mkFieldOptions(ctx == null ? void 0 : ctx.tables, (_ctx$table6 = ctx == null ? void 0 : ctx.table) != null ? _ctx$table6 : table);
1775
- },
1776
- defaultValueHint: function defaultValueHint(_, ctx) {
1777
- var _ctx$fieldMeta9, _ctx$fieldMeta10;
1778
- return (ctx == null || (_ctx$fieldMeta9 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta9.name) || (ctx == null || (_ctx$fieldMeta10 = ctx.fieldMeta) == null ? void 0 : _ctx$fieldMeta10.identifier);
1779
- }
1780
- },
1781
- valueProp: {
1782
- type: "string",
1783
- displayName: "Value prop",
1784
- description: "Prop to inject into children as",
1785
- defaultValue: "children"
1786
- }
1787
- }
1788
- };
1789
- function CmsRowFieldValue(_ref17) {
1790
- var _res$row$data4;
1791
- var table = _ref17.table,
1792
- field = _ref17.field,
1793
- valueProp = _ref17.valueProp,
1794
- children = _ref17.children,
1795
- setControlContextData = _ref17.setControlContextData,
1796
- rest = _objectWithoutPropertiesLoose(_ref17, _excluded3);
1797
- var tables = useTablesWithDataLoaded("rows");
1798
- var res = useRow(tables, table);
1799
- if (!res || !res.row) {
1800
- return React.createElement(React.Fragment, null, children);
1801
- }
1802
- var fieldMeta = deriveInferredTableField({
1803
- table: res.table,
1804
- tables: tables,
1805
- field: field,
1806
- typeFilters: ["text" /* TEXT */]
1807
- });
1808
- if (tables) {
1809
- // TODO: Only include table if __plasmic_cms_row_{table} exists.
1810
- setControlContextData == null || setControlContextData({
1811
- tables: tables,
1812
- table: res.table,
1813
- row: res.row,
1814
- fieldMeta: fieldMeta
1815
- });
1816
- }
1817
- if (!fieldMeta) {
1818
- return React.createElement(React.Fragment, null, children);
1819
- }
1820
- var value = ((_res$row$data4 = res.row.data) == null ? void 0 : _res$row$data4[fieldMeta.identifier]) || "";
1821
- var childrenWithProps = React.Children.map(children, function (child) {
1822
- if (React.isValidElement(child)) {
1823
- var _extends2;
1824
- return React.cloneElement(child, _extends({}, rest, (_extends2 = {}, _extends2[valueProp] = value, _extends2)));
1825
- }
1826
- return child;
1827
- });
1828
- return React.createElement(React.Fragment, null, childrenWithProps);
1829
- }
1830
-
1831
- function registerAll(loader) {
1832
- //const registerContext = loader?.registerContext ?? hostRegisterContext;
1833
- //registerContext(CmsDataProvider, cmsDataProviderMeta);
1834
- var _registerComponent = function _registerComponent(Component, defaultMeta) {
1835
- if (loader) {
1836
- loader.registerComponent(Component, defaultMeta);
1837
- } else {
1838
- registerComponent(Component, defaultMeta);
1839
- }
1840
- };
1841
- var _registerGlobalContext = function _registerGlobalContext(Component, defaultMeta) {
1842
- if (loader) {
1843
- loader.registerGlobalContext(Component, defaultMeta);
1844
- } else {
1845
- registerGlobalContext(Component, defaultMeta);
1846
- }
1847
- };
1848
- _registerGlobalContext(CmsCredentialsProvider, cmsCredentialsProviderMeta);
1849
- _registerComponent(CmsQueryRepeater, cmsQueryRepeaterMeta);
1850
- _registerComponent(CmsRowField, cmsRowFieldMeta);
1851
- _registerComponent(CmsRowLink, cmsRowLinkMeta);
1852
- _registerComponent(CmsRowImage, cmsRowImageMeta);
1853
- _registerComponent(CmsRowFieldValue, cmsRowFieldValueMeta);
1854
- _registerComponent(CmsCount, cmsCountFieldMeta);
1855
- }
1856
-
1857
- export { API, CmsCount, CmsCredentialsProvider, CmsQueryRepeater, CmsRowField, CmsRowFieldValue, CmsRowImage, CmsRowLink, HttpError, cmsCountFieldMeta, cmsCredentialsProviderMeta, cmsQueryRepeaterMeta, cmsRowFieldMeta, cmsRowFieldValueMeta, cmsRowImageMeta, cmsRowLinkMeta, mkApi, registerAll };
1858
- //# sourceMappingURL=plasmic-cms.esm.js.map