@plasmicpkgs/plasmic-contentful 0.0.115 → 0.0.117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +52 -0
- package/dist/index.d.ts +52 -7
- package/dist/index.js +533 -5
- package/dist/index.mjs +498 -0
- package/package.json +12 -13
- package/dist/contentful.d.ts +0 -43
- package/dist/plasmic-contentful.cjs.development.js +0 -874
- package/dist/plasmic-contentful.cjs.development.js.map +0 -1
- package/dist/plasmic-contentful.cjs.production.min.js +0 -2
- package/dist/plasmic-contentful.cjs.production.min.js.map +0 -1
- package/dist/plasmic-contentful.esm.js +0 -860
- package/dist/plasmic-contentful.esm.js.map +0 -1
- package/dist/types.d.ts +0 -8
- package/dist/utils.d.ts +0 -5
|
@@ -1,860 +0,0 @@
|
|
|
1
|
-
import registerComponent from '@plasmicapp/host/registerComponent';
|
|
2
|
-
import registerGlobalContext from '@plasmicapp/host/registerGlobalContext';
|
|
3
|
-
import { documentToHtmlString } from '@contentful/rich-text-html-renderer';
|
|
4
|
-
import { DataProvider, repeatedElement, useSelector } from '@plasmicapp/host';
|
|
5
|
-
import { usePlasmicQueryData } from '@plasmicapp/query';
|
|
6
|
-
import { pascalCase } from 'change-case';
|
|
7
|
-
import get from 'dlv';
|
|
8
|
-
import React, { useContext } from 'react';
|
|
9
|
-
|
|
10
|
-
function _regeneratorRuntime() {
|
|
11
|
-
_regeneratorRuntime = function () {
|
|
12
|
-
return e;
|
|
13
|
-
};
|
|
14
|
-
var t,
|
|
15
|
-
e = {},
|
|
16
|
-
r = Object.prototype,
|
|
17
|
-
n = r.hasOwnProperty,
|
|
18
|
-
o = Object.defineProperty || function (t, e, r) {
|
|
19
|
-
t[e] = r.value;
|
|
20
|
-
},
|
|
21
|
-
i = "function" == typeof Symbol ? Symbol : {},
|
|
22
|
-
a = i.iterator || "@@iterator",
|
|
23
|
-
c = i.asyncIterator || "@@asyncIterator",
|
|
24
|
-
u = i.toStringTag || "@@toStringTag";
|
|
25
|
-
function define(t, e, r) {
|
|
26
|
-
return Object.defineProperty(t, e, {
|
|
27
|
-
value: r,
|
|
28
|
-
enumerable: !0,
|
|
29
|
-
configurable: !0,
|
|
30
|
-
writable: !0
|
|
31
|
-
}), t[e];
|
|
32
|
-
}
|
|
33
|
-
try {
|
|
34
|
-
define({}, "");
|
|
35
|
-
} catch (t) {
|
|
36
|
-
define = function (t, e, r) {
|
|
37
|
-
return t[e] = r;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
function wrap(t, e, r, n) {
|
|
41
|
-
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
42
|
-
a = Object.create(i.prototype),
|
|
43
|
-
c = new Context(n || []);
|
|
44
|
-
return o(a, "_invoke", {
|
|
45
|
-
value: makeInvokeMethod(t, r, c)
|
|
46
|
-
}), a;
|
|
47
|
-
}
|
|
48
|
-
function tryCatch(t, e, r) {
|
|
49
|
-
try {
|
|
50
|
-
return {
|
|
51
|
-
type: "normal",
|
|
52
|
-
arg: t.call(e, r)
|
|
53
|
-
};
|
|
54
|
-
} catch (t) {
|
|
55
|
-
return {
|
|
56
|
-
type: "throw",
|
|
57
|
-
arg: t
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
e.wrap = wrap;
|
|
62
|
-
var h = "suspendedStart",
|
|
63
|
-
l = "suspendedYield",
|
|
64
|
-
f = "executing",
|
|
65
|
-
s = "completed",
|
|
66
|
-
y = {};
|
|
67
|
-
function Generator() {}
|
|
68
|
-
function GeneratorFunction() {}
|
|
69
|
-
function GeneratorFunctionPrototype() {}
|
|
70
|
-
var p = {};
|
|
71
|
-
define(p, a, function () {
|
|
72
|
-
return this;
|
|
73
|
-
});
|
|
74
|
-
var d = Object.getPrototypeOf,
|
|
75
|
-
v = d && d(d(values([])));
|
|
76
|
-
v && v !== r && n.call(v, a) && (p = v);
|
|
77
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
78
|
-
function defineIteratorMethods(t) {
|
|
79
|
-
["next", "throw", "return"].forEach(function (e) {
|
|
80
|
-
define(t, e, function (t) {
|
|
81
|
-
return this._invoke(e, t);
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
function AsyncIterator(t, e) {
|
|
86
|
-
function invoke(r, o, i, a) {
|
|
87
|
-
var c = tryCatch(t[r], t, o);
|
|
88
|
-
if ("throw" !== c.type) {
|
|
89
|
-
var u = c.arg,
|
|
90
|
-
h = u.value;
|
|
91
|
-
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
92
|
-
invoke("next", t, i, a);
|
|
93
|
-
}, function (t) {
|
|
94
|
-
invoke("throw", t, i, a);
|
|
95
|
-
}) : e.resolve(h).then(function (t) {
|
|
96
|
-
u.value = t, i(u);
|
|
97
|
-
}, function (t) {
|
|
98
|
-
return invoke("throw", t, i, a);
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
a(c.arg);
|
|
102
|
-
}
|
|
103
|
-
var r;
|
|
104
|
-
o(this, "_invoke", {
|
|
105
|
-
value: function (t, n) {
|
|
106
|
-
function callInvokeWithMethodAndArg() {
|
|
107
|
-
return new e(function (e, r) {
|
|
108
|
-
invoke(t, n, e, r);
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
function makeInvokeMethod(e, r, n) {
|
|
116
|
-
var o = h;
|
|
117
|
-
return function (i, a) {
|
|
118
|
-
if (o === f) throw new Error("Generator is already running");
|
|
119
|
-
if (o === s) {
|
|
120
|
-
if ("throw" === i) throw a;
|
|
121
|
-
return {
|
|
122
|
-
value: t,
|
|
123
|
-
done: !0
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
for (n.method = i, n.arg = a;;) {
|
|
127
|
-
var c = n.delegate;
|
|
128
|
-
if (c) {
|
|
129
|
-
var u = maybeInvokeDelegate(c, n);
|
|
130
|
-
if (u) {
|
|
131
|
-
if (u === y) continue;
|
|
132
|
-
return u;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
136
|
-
if (o === h) throw o = s, n.arg;
|
|
137
|
-
n.dispatchException(n.arg);
|
|
138
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
139
|
-
o = f;
|
|
140
|
-
var p = tryCatch(e, r, n);
|
|
141
|
-
if ("normal" === p.type) {
|
|
142
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
143
|
-
return {
|
|
144
|
-
value: p.arg,
|
|
145
|
-
done: n.done
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
function maybeInvokeDelegate(e, r) {
|
|
153
|
-
var n = r.method,
|
|
154
|
-
o = e.iterator[n];
|
|
155
|
-
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;
|
|
156
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
157
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
158
|
-
var a = i.arg;
|
|
159
|
-
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);
|
|
160
|
-
}
|
|
161
|
-
function pushTryEntry(t) {
|
|
162
|
-
var e = {
|
|
163
|
-
tryLoc: t[0]
|
|
164
|
-
};
|
|
165
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
166
|
-
}
|
|
167
|
-
function resetTryEntry(t) {
|
|
168
|
-
var e = t.completion || {};
|
|
169
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
170
|
-
}
|
|
171
|
-
function Context(t) {
|
|
172
|
-
this.tryEntries = [{
|
|
173
|
-
tryLoc: "root"
|
|
174
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
175
|
-
}
|
|
176
|
-
function values(e) {
|
|
177
|
-
if (e || "" === e) {
|
|
178
|
-
var r = e[a];
|
|
179
|
-
if (r) return r.call(e);
|
|
180
|
-
if ("function" == typeof e.next) return e;
|
|
181
|
-
if (!isNaN(e.length)) {
|
|
182
|
-
var o = -1,
|
|
183
|
-
i = function next() {
|
|
184
|
-
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
185
|
-
return next.value = t, next.done = !0, next;
|
|
186
|
-
};
|
|
187
|
-
return i.next = i;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
191
|
-
}
|
|
192
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
193
|
-
value: GeneratorFunctionPrototype,
|
|
194
|
-
configurable: !0
|
|
195
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
196
|
-
value: GeneratorFunction,
|
|
197
|
-
configurable: !0
|
|
198
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
199
|
-
var e = "function" == typeof t && t.constructor;
|
|
200
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
201
|
-
}, e.mark = function (t) {
|
|
202
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
203
|
-
}, e.awrap = function (t) {
|
|
204
|
-
return {
|
|
205
|
-
__await: t
|
|
206
|
-
};
|
|
207
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
208
|
-
return this;
|
|
209
|
-
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
210
|
-
void 0 === i && (i = Promise);
|
|
211
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
212
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
213
|
-
return t.done ? t.value : a.next();
|
|
214
|
-
});
|
|
215
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
216
|
-
return this;
|
|
217
|
-
}), define(g, "toString", function () {
|
|
218
|
-
return "[object Generator]";
|
|
219
|
-
}), e.keys = function (t) {
|
|
220
|
-
var e = Object(t),
|
|
221
|
-
r = [];
|
|
222
|
-
for (var n in e) r.push(n);
|
|
223
|
-
return r.reverse(), function next() {
|
|
224
|
-
for (; r.length;) {
|
|
225
|
-
var t = r.pop();
|
|
226
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
|
227
|
-
}
|
|
228
|
-
return next.done = !0, next;
|
|
229
|
-
};
|
|
230
|
-
}, e.values = values, Context.prototype = {
|
|
231
|
-
constructor: Context,
|
|
232
|
-
reset: function (e) {
|
|
233
|
-
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);
|
|
234
|
-
},
|
|
235
|
-
stop: function () {
|
|
236
|
-
this.done = !0;
|
|
237
|
-
var t = this.tryEntries[0].completion;
|
|
238
|
-
if ("throw" === t.type) throw t.arg;
|
|
239
|
-
return this.rval;
|
|
240
|
-
},
|
|
241
|
-
dispatchException: function (e) {
|
|
242
|
-
if (this.done) throw e;
|
|
243
|
-
var r = this;
|
|
244
|
-
function handle(n, o) {
|
|
245
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
246
|
-
}
|
|
247
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
248
|
-
var i = this.tryEntries[o],
|
|
249
|
-
a = i.completion;
|
|
250
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
251
|
-
if (i.tryLoc <= this.prev) {
|
|
252
|
-
var c = n.call(i, "catchLoc"),
|
|
253
|
-
u = n.call(i, "finallyLoc");
|
|
254
|
-
if (c && u) {
|
|
255
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
256
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
257
|
-
} else if (c) {
|
|
258
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
259
|
-
} else {
|
|
260
|
-
if (!u) throw new Error("try statement without catch or finally");
|
|
261
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
},
|
|
266
|
-
abrupt: function (t, e) {
|
|
267
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
268
|
-
var o = this.tryEntries[r];
|
|
269
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
270
|
-
var i = o;
|
|
271
|
-
break;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
275
|
-
var a = i ? i.completion : {};
|
|
276
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
277
|
-
},
|
|
278
|
-
complete: function (t, e) {
|
|
279
|
-
if ("throw" === t.type) throw t.arg;
|
|
280
|
-
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;
|
|
281
|
-
},
|
|
282
|
-
finish: function (t) {
|
|
283
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
284
|
-
var r = this.tryEntries[e];
|
|
285
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
catch: function (t) {
|
|
289
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
290
|
-
var r = this.tryEntries[e];
|
|
291
|
-
if (r.tryLoc === t) {
|
|
292
|
-
var n = r.completion;
|
|
293
|
-
if ("throw" === n.type) {
|
|
294
|
-
var o = n.arg;
|
|
295
|
-
resetTryEntry(r);
|
|
296
|
-
}
|
|
297
|
-
return o;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
throw new Error("illegal catch attempt");
|
|
301
|
-
},
|
|
302
|
-
delegateYield: function (e, r, n) {
|
|
303
|
-
return this.delegate = {
|
|
304
|
-
iterator: values(e),
|
|
305
|
-
resultName: r,
|
|
306
|
-
nextLoc: n
|
|
307
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
308
|
-
}
|
|
309
|
-
}, e;
|
|
310
|
-
}
|
|
311
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
312
|
-
try {
|
|
313
|
-
var info = gen[key](arg);
|
|
314
|
-
var value = info.value;
|
|
315
|
-
} catch (error) {
|
|
316
|
-
reject(error);
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
if (info.done) {
|
|
320
|
-
resolve(value);
|
|
321
|
-
} else {
|
|
322
|
-
Promise.resolve(value).then(_next, _throw);
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
function _asyncToGenerator(fn) {
|
|
326
|
-
return function () {
|
|
327
|
-
var self = this,
|
|
328
|
-
args = arguments;
|
|
329
|
-
return new Promise(function (resolve, reject) {
|
|
330
|
-
var gen = fn.apply(self, args);
|
|
331
|
-
function _next(value) {
|
|
332
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
333
|
-
}
|
|
334
|
-
function _throw(err) {
|
|
335
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
336
|
-
}
|
|
337
|
-
_next(undefined);
|
|
338
|
-
});
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
function _extends() {
|
|
342
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
343
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
344
|
-
var source = arguments[i];
|
|
345
|
-
for (var key in source) {
|
|
346
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
347
|
-
target[key] = source[key];
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
return target;
|
|
352
|
-
};
|
|
353
|
-
return _extends.apply(this, arguments);
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
var searchParameters = [{
|
|
357
|
-
value: "[lt]",
|
|
358
|
-
label: "Less than"
|
|
359
|
-
}, {
|
|
360
|
-
value: "[lte]",
|
|
361
|
-
label: "Less than or equal"
|
|
362
|
-
}, {
|
|
363
|
-
value: "[gt]",
|
|
364
|
-
label: "Greater than"
|
|
365
|
-
}, {
|
|
366
|
-
value: "[gte]",
|
|
367
|
-
label: "Greater than or equal "
|
|
368
|
-
}];
|
|
369
|
-
var uniq = function uniq(xs) {
|
|
370
|
-
return Array.from(new Set(xs));
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
function ensure(x) {
|
|
374
|
-
if (x === null || x === undefined) {
|
|
375
|
-
throw new Error("Value must not be undefined or null");
|
|
376
|
-
} else {
|
|
377
|
-
return x;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
var modulePath = "@plasmicpkgs/plasmic-contentful";
|
|
381
|
-
var makeDataProviderName = function makeDataProviderName(contentType) {
|
|
382
|
-
return "currentContentful" + pascalCase(contentType) + "Item";
|
|
383
|
-
};
|
|
384
|
-
var CredentialsContext = /*#__PURE__*/React.createContext(undefined);
|
|
385
|
-
var ContentfulCredentialsProviderMeta = {
|
|
386
|
-
name: "Contentful CredentialsProvider",
|
|
387
|
-
displayName: "Contentful Credentials Provider",
|
|
388
|
-
description: "Any client requesting content from the CDA needs to provide an access token that has access to the environment you're requesting content from. Learn how to [get your API key](https://www.contentful.com/developers/docs/references/authentication/).",
|
|
389
|
-
importName: "ContentfulCredentialsProvider",
|
|
390
|
-
importPath: modulePath,
|
|
391
|
-
props: {
|
|
392
|
-
space: {
|
|
393
|
-
type: "string",
|
|
394
|
-
displayName: "Space",
|
|
395
|
-
description: "Name of your space",
|
|
396
|
-
defaultValue: "lmfbwqzbh93n"
|
|
397
|
-
},
|
|
398
|
-
accessToken: {
|
|
399
|
-
type: "string",
|
|
400
|
-
displayName: "Access Token ",
|
|
401
|
-
description: "Access Token",
|
|
402
|
-
defaultValue: "aWvf6oSLTuqxKCxSUpokajdQr84hGQFE6zoJG7DVVLg"
|
|
403
|
-
},
|
|
404
|
-
environment: {
|
|
405
|
-
type: "string",
|
|
406
|
-
displayName: "Environment",
|
|
407
|
-
defaultValue: "master"
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
};
|
|
411
|
-
function ContentfulCredentialsProvider(_ref) {
|
|
412
|
-
var accessToken = _ref.accessToken,
|
|
413
|
-
space = _ref.space,
|
|
414
|
-
environment = _ref.environment,
|
|
415
|
-
children = _ref.children;
|
|
416
|
-
return React.createElement(CredentialsContext.Provider, {
|
|
417
|
-
value: {
|
|
418
|
-
space: space,
|
|
419
|
-
accessToken: accessToken,
|
|
420
|
-
environment: environment
|
|
421
|
-
}
|
|
422
|
-
}, children);
|
|
423
|
-
}
|
|
424
|
-
var ContentfulFetcherMeta = {
|
|
425
|
-
name: "ContentfulFetcher",
|
|
426
|
-
displayName: "Contentful Fetcher",
|
|
427
|
-
importName: "ContentfulFetcher",
|
|
428
|
-
importPath: modulePath,
|
|
429
|
-
providesData: true,
|
|
430
|
-
description: "Fetches Contentful data and repeats content of children once for every row fetched. ",
|
|
431
|
-
defaultStyles: {
|
|
432
|
-
display: "grid",
|
|
433
|
-
gridTemplateColumns: "1fr 1fr 1fr 1fr",
|
|
434
|
-
gridRowGap: "8px",
|
|
435
|
-
gridColumnGap: "8px",
|
|
436
|
-
padding: "8px",
|
|
437
|
-
maxWidth: "100%"
|
|
438
|
-
},
|
|
439
|
-
props: {
|
|
440
|
-
children: {
|
|
441
|
-
type: "slot",
|
|
442
|
-
defaultValue: {
|
|
443
|
-
type: "vbox",
|
|
444
|
-
styles: {
|
|
445
|
-
padding: "8px"
|
|
446
|
-
},
|
|
447
|
-
children: {
|
|
448
|
-
type: "component",
|
|
449
|
-
name: "ContentfulField"
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
},
|
|
453
|
-
contentType: {
|
|
454
|
-
type: "choice",
|
|
455
|
-
options: function options(props, ctx) {
|
|
456
|
-
var _ctx$types$map, _ctx$types;
|
|
457
|
-
return (_ctx$types$map = ctx == null || (_ctx$types = ctx.types) == null ? void 0 : _ctx$types.map(function (type) {
|
|
458
|
-
var _type$sys;
|
|
459
|
-
return {
|
|
460
|
-
label: type == null ? void 0 : type.name,
|
|
461
|
-
value: type == null || (_type$sys = type.sys) == null ? void 0 : _type$sys.id
|
|
462
|
-
};
|
|
463
|
-
})) != null ? _ctx$types$map : [];
|
|
464
|
-
},
|
|
465
|
-
displayName: "Content type",
|
|
466
|
-
description: "Content type to be queried."
|
|
467
|
-
},
|
|
468
|
-
filterField: {
|
|
469
|
-
type: "choice",
|
|
470
|
-
displayName: "Filter field",
|
|
471
|
-
description: "Field (from Collection) to filter by.",
|
|
472
|
-
options: function options(props, ctx) {
|
|
473
|
-
var _ctx$fields;
|
|
474
|
-
return (_ctx$fields = ctx == null ? void 0 : ctx.fields) != null ? _ctx$fields : [];
|
|
475
|
-
},
|
|
476
|
-
hidden: function hidden(props, ctx) {
|
|
477
|
-
return !props.contentType;
|
|
478
|
-
}
|
|
479
|
-
},
|
|
480
|
-
searchParameter: {
|
|
481
|
-
type: "choice",
|
|
482
|
-
displayName: "Search Parameter",
|
|
483
|
-
description: "Search Parameter to filter by (see Contentful Content Delivery API documentation for details).",
|
|
484
|
-
options: function options(props, ctx) {
|
|
485
|
-
var _ctx$queryOptions;
|
|
486
|
-
return (_ctx$queryOptions = ctx == null ? void 0 : ctx.queryOptions) != null ? _ctx$queryOptions : [];
|
|
487
|
-
},
|
|
488
|
-
hidden: function hidden(props, ctx) {
|
|
489
|
-
return !props.filterField;
|
|
490
|
-
}
|
|
491
|
-
},
|
|
492
|
-
filterValue: {
|
|
493
|
-
type: "string",
|
|
494
|
-
displayName: "Filter value",
|
|
495
|
-
description: "Value to filter by, should be of filter field type.",
|
|
496
|
-
hidden: function hidden(props, ctx) {
|
|
497
|
-
return !props.searchParameter;
|
|
498
|
-
}
|
|
499
|
-
},
|
|
500
|
-
limit: {
|
|
501
|
-
type: "number",
|
|
502
|
-
displayName: "Limit",
|
|
503
|
-
description: "Limit the number of entries that are returned."
|
|
504
|
-
},
|
|
505
|
-
include: {
|
|
506
|
-
type: "number",
|
|
507
|
-
displayName: "Linked items depth",
|
|
508
|
-
defaultValueHint: 1,
|
|
509
|
-
description: "When you have related content (e.g. entries with links to image assets) it's possible to include both search results and related data in a single request. Using the include parameter, you can specify the number of levels to resolve.",
|
|
510
|
-
max: 10,
|
|
511
|
-
min: 0
|
|
512
|
-
},
|
|
513
|
-
noAutoRepeat: {
|
|
514
|
-
type: "boolean",
|
|
515
|
-
displayName: "No auto-repeat",
|
|
516
|
-
description: "Do not automatically repeat children for every entry.",
|
|
517
|
-
defaultValue: false
|
|
518
|
-
},
|
|
519
|
-
noLayout: {
|
|
520
|
-
type: "boolean",
|
|
521
|
-
displayName: "No layout",
|
|
522
|
-
description: "When set, Contentful Fetcher will not layout its children; instead, the layout set on its parent element will be used. Useful if you want to set flex gap or control container tag type.",
|
|
523
|
-
defaultValue: false
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
};
|
|
527
|
-
function ContentfulFetcher(_ref2) {
|
|
528
|
-
var _contentTypes$items, _operators, _contentTypes$items2;
|
|
529
|
-
var filterField = _ref2.filterField,
|
|
530
|
-
filterValue = _ref2.filterValue,
|
|
531
|
-
searchParameter = _ref2.searchParameter,
|
|
532
|
-
noAutoRepeat = _ref2.noAutoRepeat,
|
|
533
|
-
contentType = _ref2.contentType,
|
|
534
|
-
children = _ref2.children,
|
|
535
|
-
className = _ref2.className,
|
|
536
|
-
limit = _ref2.limit,
|
|
537
|
-
include = _ref2.include,
|
|
538
|
-
noLayout = _ref2.noLayout,
|
|
539
|
-
setControlContextData = _ref2.setControlContextData;
|
|
540
|
-
var creds = ensure(useContext(CredentialsContext));
|
|
541
|
-
var cacheKey = JSON.stringify({
|
|
542
|
-
include: include,
|
|
543
|
-
limit: limit,
|
|
544
|
-
filterField: filterField,
|
|
545
|
-
filterValue: filterValue,
|
|
546
|
-
searchParameter: searchParameter,
|
|
547
|
-
creds: creds
|
|
548
|
-
});
|
|
549
|
-
var baseUrl = "https://cdn.contentful.com";
|
|
550
|
-
var _usePlasmicQueryData = usePlasmicQueryData(cacheKey + "/contentTypes", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
551
|
-
var resp;
|
|
552
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
553
|
-
while (1) switch (_context.prev = _context.next) {
|
|
554
|
-
case 0:
|
|
555
|
-
_context.next = 2;
|
|
556
|
-
return fetch(baseUrl + "/spaces/" + creds.space + "/environments/" + creds.environment + "/content_types?access_token=" + creds.accessToken);
|
|
557
|
-
case 2:
|
|
558
|
-
resp = _context.sent;
|
|
559
|
-
return _context.abrupt("return", resp.json());
|
|
560
|
-
case 4:
|
|
561
|
-
case "end":
|
|
562
|
-
return _context.stop();
|
|
563
|
-
}
|
|
564
|
-
}, _callee);
|
|
565
|
-
}))),
|
|
566
|
-
contentTypes = _usePlasmicQueryData.data;
|
|
567
|
-
setControlContextData == null || setControlContextData({
|
|
568
|
-
types: (_contentTypes$items = contentTypes == null ? void 0 : contentTypes.items) != null ? _contentTypes$items : []
|
|
569
|
-
});
|
|
570
|
-
var _usePlasmicQueryData2 = usePlasmicQueryData(contentType ? cacheKey + "/" + contentType + "/entriesData" : null, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
571
|
-
var query, resp;
|
|
572
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
573
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
574
|
-
case 0:
|
|
575
|
-
query = "/spaces/" + creds.space + "/environments/" + creds.environment + "/entries?access_token=" + creds.accessToken + "&content_type=" + contentType;
|
|
576
|
-
if (limit) {
|
|
577
|
-
query = query + "&limit=" + limit;
|
|
578
|
-
}
|
|
579
|
-
if (include) {
|
|
580
|
-
query = query + "&include=" + include;
|
|
581
|
-
}
|
|
582
|
-
_context2.next = 5;
|
|
583
|
-
return fetch("" + baseUrl + query);
|
|
584
|
-
case 5:
|
|
585
|
-
resp = _context2.sent;
|
|
586
|
-
return _context2.abrupt("return", resp.json());
|
|
587
|
-
case 7:
|
|
588
|
-
case "end":
|
|
589
|
-
return _context2.stop();
|
|
590
|
-
}
|
|
591
|
-
}, _callee2);
|
|
592
|
-
}))),
|
|
593
|
-
entriesData = _usePlasmicQueryData2.data;
|
|
594
|
-
var _usePlasmicQueryData3 = usePlasmicQueryData(contentType && filterField && filterValue ? cacheKey + "/" + contentType + "/filteredData" : null, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
595
|
-
var queryPath, resp;
|
|
596
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
597
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
598
|
-
case 0:
|
|
599
|
-
queryPath = "/spaces/" + creds.space + "/environments/" + creds.environment + "/entries?access_token=" + creds.accessToken + "&content_type=" + contentType + "&fields." + filterField + searchParameter + "=" + filterValue;
|
|
600
|
-
_context3.next = 3;
|
|
601
|
-
return fetch("" + baseUrl + queryPath);
|
|
602
|
-
case 3:
|
|
603
|
-
resp = _context3.sent;
|
|
604
|
-
return _context3.abrupt("return", resp.json());
|
|
605
|
-
case 5:
|
|
606
|
-
case "end":
|
|
607
|
-
return _context3.stop();
|
|
608
|
-
}
|
|
609
|
-
}, _callee3);
|
|
610
|
-
}))),
|
|
611
|
-
filteredData = _usePlasmicQueryData3.data;
|
|
612
|
-
if (!creds.space || !creds.accessToken) {
|
|
613
|
-
return React.createElement("div", null, "Please specify a valid API Credentials: Space, Access Token and Environment");
|
|
614
|
-
}
|
|
615
|
-
if (!contentTypes) {
|
|
616
|
-
return React.createElement("div", null, "Please configure the Contentful credentials");
|
|
617
|
-
}
|
|
618
|
-
if (!entriesData) {
|
|
619
|
-
return React.createElement("div", null, "Please select a content type");
|
|
620
|
-
}
|
|
621
|
-
var filterFields = entriesData == null ? void 0 : entriesData.items.flatMap(function (item) {
|
|
622
|
-
var fields = Object.keys(item.fields).filter(function (field) {
|
|
623
|
-
var value = get(item, field);
|
|
624
|
-
return typeof value !== "object" && field !== "photos";
|
|
625
|
-
});
|
|
626
|
-
return fields;
|
|
627
|
-
});
|
|
628
|
-
var operators;
|
|
629
|
-
var matchedFields = Object.values(entriesData.items).map(function (item) {
|
|
630
|
-
var fields = Object.entries(item.fields).find(function (el) {
|
|
631
|
-
return el[0] === filterField;
|
|
632
|
-
});
|
|
633
|
-
return fields;
|
|
634
|
-
});
|
|
635
|
-
Object.values(matchedFields).map(function (model) {
|
|
636
|
-
return Array.isArray(model) ? model : [model];
|
|
637
|
-
}).map(function (item) {
|
|
638
|
-
if (typeof item[1] === "number" && typeof item[1] !== "object") {
|
|
639
|
-
operators = searchParameters;
|
|
640
|
-
} else if (typeof item[1] !== "number" && typeof item[1] !== "object" && typeof item[1] === "string") {
|
|
641
|
-
operators = [{
|
|
642
|
-
value: "[match]",
|
|
643
|
-
label: "Full text search"
|
|
644
|
-
}];
|
|
645
|
-
}
|
|
646
|
-
});
|
|
647
|
-
setControlContextData == null || setControlContextData({
|
|
648
|
-
queryOptions: (_operators = operators) != null ? _operators : [],
|
|
649
|
-
types: (_contentTypes$items2 = contentTypes == null ? void 0 : contentTypes.items) != null ? _contentTypes$items2 : [],
|
|
650
|
-
fields: uniq(filterFields != null ? filterFields : [])
|
|
651
|
-
});
|
|
652
|
-
if (filterField && !searchParameter) {
|
|
653
|
-
return React.createElement("div", null, "Please specify a Search Parameter");
|
|
654
|
-
}
|
|
655
|
-
if (searchParameter && !filterValue) {
|
|
656
|
-
return React.createElement("div", null, "Please specify a Filter value");
|
|
657
|
-
}
|
|
658
|
-
function denormalizeData(data) {
|
|
659
|
-
if (!(data != null && data.items) || !(data != null && data.includes)) {
|
|
660
|
-
return data;
|
|
661
|
-
}
|
|
662
|
-
var entryMap = {};
|
|
663
|
-
if (data.includes.Entry) {
|
|
664
|
-
data.includes.Entry.forEach(function (entry) {
|
|
665
|
-
entryMap[entry.sys.id] = entry.fields;
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
var itemsWithDenormalizedFields = data.items.map(function (item) {
|
|
669
|
-
var updatedFields = {};
|
|
670
|
-
var _loop = function _loop(fieldName) {
|
|
671
|
-
var fieldValue = item.fields[fieldName];
|
|
672
|
-
if (Array.isArray(fieldValue)) {
|
|
673
|
-
var updatedArray = fieldValue.map(function (arrayItem) {
|
|
674
|
-
if (data.includes.Asset && arrayItem && typeof arrayItem === "object" && "sys" in arrayItem && arrayItem.sys.linkType === "Asset") {
|
|
675
|
-
var fieldId = arrayItem.sys.id;
|
|
676
|
-
var asset = data.includes.Asset.find(function (asset) {
|
|
677
|
-
return asset.sys.id === fieldId;
|
|
678
|
-
});
|
|
679
|
-
if (asset) {
|
|
680
|
-
var _asset$fields;
|
|
681
|
-
return _extends({}, arrayItem, {
|
|
682
|
-
url: "https:" + ((_asset$fields = asset.fields) == null || (_asset$fields = _asset$fields.file) == null ? void 0 : _asset$fields.url)
|
|
683
|
-
});
|
|
684
|
-
} else {
|
|
685
|
-
console.log("Asset URL not found for ID: " + fieldId);
|
|
686
|
-
}
|
|
687
|
-
} else if (data.includes.Entry && arrayItem && typeof arrayItem === "object" && "sys" in arrayItem && arrayItem.sys.linkType === "Entry") {
|
|
688
|
-
var _fieldId = arrayItem.sys.id;
|
|
689
|
-
if (entryMap[_fieldId]) {
|
|
690
|
-
updatedFields[fieldName] = _extends({}, fieldValue, {
|
|
691
|
-
fields: entryMap[_fieldId]
|
|
692
|
-
});
|
|
693
|
-
} else {
|
|
694
|
-
console.log("Entry not found for ID: " + _fieldId);
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
return arrayItem;
|
|
698
|
-
});
|
|
699
|
-
updatedFields[fieldName] = updatedArray;
|
|
700
|
-
} else if (data.includes.Asset && fieldValue && typeof fieldValue === "object" && "sys" in fieldValue && fieldValue.sys.linkType === "Asset") {
|
|
701
|
-
var fieldId = fieldValue.sys.id;
|
|
702
|
-
var asset = data.includes.Asset.find(function (asset) {
|
|
703
|
-
return asset.sys.id === fieldId;
|
|
704
|
-
});
|
|
705
|
-
if (asset) {
|
|
706
|
-
var _asset$fields2;
|
|
707
|
-
updatedFields[fieldName] = _extends({}, fieldValue, {
|
|
708
|
-
url: "https:" + ((_asset$fields2 = asset.fields) == null || (_asset$fields2 = _asset$fields2.file) == null ? void 0 : _asset$fields2.url)
|
|
709
|
-
});
|
|
710
|
-
} else {
|
|
711
|
-
console.log("Asset URL not found for ID: " + fieldId);
|
|
712
|
-
}
|
|
713
|
-
} else if (data.includes.Entry && fieldValue && typeof fieldValue === "object" && "sys" in fieldValue && fieldValue.sys.linkType === "Entry") {
|
|
714
|
-
var _fieldId2 = fieldValue.sys.id;
|
|
715
|
-
if (entryMap[_fieldId2]) {
|
|
716
|
-
updatedFields[fieldName] = _extends({}, fieldValue, {
|
|
717
|
-
fields: entryMap[_fieldId2]
|
|
718
|
-
});
|
|
719
|
-
} else {
|
|
720
|
-
console.log("Entry not found for ID: " + _fieldId2);
|
|
721
|
-
}
|
|
722
|
-
} else {
|
|
723
|
-
updatedFields[fieldName] = fieldValue;
|
|
724
|
-
}
|
|
725
|
-
};
|
|
726
|
-
for (var fieldName in item.fields) {
|
|
727
|
-
_loop(fieldName);
|
|
728
|
-
}
|
|
729
|
-
return _extends({}, item, {
|
|
730
|
-
fields: updatedFields
|
|
731
|
-
});
|
|
732
|
-
});
|
|
733
|
-
return _extends({}, data, {
|
|
734
|
-
items: itemsWithDenormalizedFields
|
|
735
|
-
});
|
|
736
|
-
}
|
|
737
|
-
var renderedData;
|
|
738
|
-
if (filteredData) {
|
|
739
|
-
var _filteredData$items, _denormalizeData;
|
|
740
|
-
if ((filteredData == null || (_filteredData$items = filteredData.items) == null ? void 0 : _filteredData$items.length) === 0) {
|
|
741
|
-
return React.createElement("div", {
|
|
742
|
-
className: className
|
|
743
|
-
}, "No published entry found");
|
|
744
|
-
}
|
|
745
|
-
renderedData = noAutoRepeat ? children : (_denormalizeData = denormalizeData(filteredData)) == null || (_denormalizeData = _denormalizeData.items) == null ? void 0 : _denormalizeData.map(function (item, index) {
|
|
746
|
-
var _item$sys;
|
|
747
|
-
return React.createElement(DataProvider, {
|
|
748
|
-
key: item == null || (_item$sys = item.sys) == null ? void 0 : _item$sys.id,
|
|
749
|
-
name: "contentfulItem",
|
|
750
|
-
data: item,
|
|
751
|
-
hidden: true
|
|
752
|
-
}, React.createElement(DataProvider, {
|
|
753
|
-
name: makeDataProviderName(contentType),
|
|
754
|
-
data: item
|
|
755
|
-
}, repeatedElement(index, children)));
|
|
756
|
-
});
|
|
757
|
-
} else {
|
|
758
|
-
var _entriesData$items, _denormalizeData2;
|
|
759
|
-
if ((entriesData == null || (_entriesData$items = entriesData.items) == null ? void 0 : _entriesData$items.length) === 0) {
|
|
760
|
-
return React.createElement("div", {
|
|
761
|
-
className: className
|
|
762
|
-
}, contentType, " is empty");
|
|
763
|
-
}
|
|
764
|
-
renderedData = noAutoRepeat ? children : (_denormalizeData2 = denormalizeData(entriesData)) == null || (_denormalizeData2 = _denormalizeData2.items) == null ? void 0 : _denormalizeData2.map(function (item, index) {
|
|
765
|
-
var _item$sys2;
|
|
766
|
-
return React.createElement(DataProvider, {
|
|
767
|
-
key: item == null || (_item$sys2 = item.sys) == null ? void 0 : _item$sys2.id,
|
|
768
|
-
name: "contentfulItem",
|
|
769
|
-
data: item,
|
|
770
|
-
hidden: true
|
|
771
|
-
}, React.createElement(DataProvider, {
|
|
772
|
-
name: makeDataProviderName(contentType),
|
|
773
|
-
data: item
|
|
774
|
-
}, repeatedElement(index, children)));
|
|
775
|
-
});
|
|
776
|
-
}
|
|
777
|
-
return React.createElement(DataProvider, {
|
|
778
|
-
name: "contentfulItems",
|
|
779
|
-
data: entriesData == null ? void 0 : entriesData.items
|
|
780
|
-
}, noLayout ? React.createElement(React.Fragment, null, " ", renderedData, " ") : React.createElement("div", {
|
|
781
|
-
className: className
|
|
782
|
-
}, " ", renderedData, " "));
|
|
783
|
-
}
|
|
784
|
-
var ContentfulFieldMeta = {
|
|
785
|
-
name: "ContentfulField",
|
|
786
|
-
displayName: "Contentful Field",
|
|
787
|
-
importName: "ContentfulField",
|
|
788
|
-
importPath: modulePath,
|
|
789
|
-
props: {
|
|
790
|
-
objectPath: {
|
|
791
|
-
type: "dataSelector",
|
|
792
|
-
data: function data(props, ctx) {
|
|
793
|
-
var _ctx$data;
|
|
794
|
-
return (_ctx$data = ctx == null ? void 0 : ctx.data) != null ? _ctx$data : {};
|
|
795
|
-
},
|
|
796
|
-
displayName: "Field",
|
|
797
|
-
description: "Field to be displayed."
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
};
|
|
801
|
-
function ContentfulField(_ref6) {
|
|
802
|
-
var _useSelector;
|
|
803
|
-
var className = _ref6.className,
|
|
804
|
-
objectPath = _ref6.objectPath,
|
|
805
|
-
setControlContextData = _ref6.setControlContextData;
|
|
806
|
-
var item = (_useSelector = useSelector("contentfulItem")) == null ? void 0 : _useSelector.fields;
|
|
807
|
-
if (!item) {
|
|
808
|
-
return React.createElement("div", null, "ContentfulField must be used within a ContentfulFetcher ");
|
|
809
|
-
}
|
|
810
|
-
setControlContextData == null || setControlContextData({
|
|
811
|
-
data: item
|
|
812
|
-
});
|
|
813
|
-
if (!objectPath) {
|
|
814
|
-
return React.createElement("div", null, "Please specify a valid path or select a field.");
|
|
815
|
-
}
|
|
816
|
-
var data = get(item, objectPath);
|
|
817
|
-
if (typeof data === "object" && "nodeType" in data && data.nodeType === "document") {
|
|
818
|
-
return React.createElement("div", {
|
|
819
|
-
className: className,
|
|
820
|
-
dangerouslySetInnerHTML: {
|
|
821
|
-
__html: documentToHtmlString(data)
|
|
822
|
-
}
|
|
823
|
-
});
|
|
824
|
-
} else if (typeof data === "object" && data.sys.linkType === "Asset" && data.url) {
|
|
825
|
-
return React.createElement("img", {
|
|
826
|
-
className: className,
|
|
827
|
-
src: data.url
|
|
828
|
-
});
|
|
829
|
-
} else if (!data) {
|
|
830
|
-
return React.createElement("div", null, "Please specify a valid field.");
|
|
831
|
-
} else if (typeof data !== "object") {
|
|
832
|
-
return React.createElement("div", {
|
|
833
|
-
className: className
|
|
834
|
-
}, data);
|
|
835
|
-
} else {
|
|
836
|
-
return React.createElement("div", {
|
|
837
|
-
className: className
|
|
838
|
-
}, data.toString());
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
function registerAll(loader) {
|
|
843
|
-
var _registerComponent = function _registerComponent(Component, defaultMeta) {
|
|
844
|
-
if (loader) {
|
|
845
|
-
loader.registerComponent(Component, defaultMeta);
|
|
846
|
-
} else {
|
|
847
|
-
registerComponent(Component, defaultMeta);
|
|
848
|
-
}
|
|
849
|
-
};
|
|
850
|
-
if (loader) {
|
|
851
|
-
loader.registerGlobalContext(ContentfulCredentialsProvider, ContentfulCredentialsProviderMeta);
|
|
852
|
-
} else {
|
|
853
|
-
registerGlobalContext(ContentfulCredentialsProvider, ContentfulCredentialsProviderMeta);
|
|
854
|
-
}
|
|
855
|
-
_registerComponent(ContentfulFetcher, ContentfulFetcherMeta);
|
|
856
|
-
_registerComponent(ContentfulField, ContentfulFieldMeta);
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
export { ContentfulCredentialsProvider, ContentfulCredentialsProviderMeta, ContentfulFetcher, ContentfulFetcherMeta, ContentfulField, ContentfulFieldMeta, ensure, registerAll };
|
|
860
|
-
//# sourceMappingURL=plasmic-contentful.esm.js.map
|