@plasmicapp/loader-react 1.0.50 → 1.0.54
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/loader-react.cjs.development.js +24 -42
- package/dist/loader-react.cjs.development.js.map +1 -1
- package/dist/loader-react.cjs.production.min.js +1 -1
- package/dist/loader-react.cjs.production.min.js.map +1 -1
- package/dist/loader-react.esm.js +24 -42
- package/dist/loader-react.esm.js.map +1 -1
- package/dist/loader.d.ts +1 -0
- package/dist/prepass.d.ts +1 -2
- package/package.json +4 -4
|
@@ -1898,6 +1898,10 @@ var PlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
1898
1898
|
|
|
1899
1899
|
this.substituteComponent(component, metaOrName);
|
|
1900
1900
|
}
|
|
1901
|
+
};
|
|
1902
|
+
|
|
1903
|
+
_proto2.registerContext = function registerContext(context, meta) {
|
|
1904
|
+
this.__internal.registerContext(context, meta);
|
|
1901
1905
|
}
|
|
1902
1906
|
/**
|
|
1903
1907
|
* Pre-fetches component data needed to for PlasmicLoader to render
|
|
@@ -2199,7 +2203,11 @@ function _extractPlasmicQueryData() {
|
|
|
2199
2203
|
cache = {};
|
|
2200
2204
|
_context.prev = 1;
|
|
2201
2205
|
_context.next = 4;
|
|
2202
|
-
return plasmicPrepass(
|
|
2206
|
+
return plasmicPrepass(React__default.createElement(query.PrepassContext.Provider, {
|
|
2207
|
+
value: {
|
|
2208
|
+
cache: cache
|
|
2209
|
+
}
|
|
2210
|
+
}, element));
|
|
2203
2211
|
|
|
2204
2212
|
case 4:
|
|
2205
2213
|
_context.next = 9;
|
|
@@ -2211,12 +2219,12 @@ function _extractPlasmicQueryData() {
|
|
|
2211
2219
|
console.warn("PLASMIC: Error encountered while pre-rendering", _context.t0);
|
|
2212
2220
|
|
|
2213
2221
|
case 9:
|
|
2214
|
-
return _context.abrupt("return", Object.fromEntries(Array.from(Object.entries(cache)).map(function (
|
|
2215
|
-
var key =
|
|
2216
|
-
data =
|
|
2222
|
+
return _context.abrupt("return", Object.fromEntries(Array.from(Object.entries(cache)).map(function (_ref3) {
|
|
2223
|
+
var key = _ref3[0],
|
|
2224
|
+
data = _ref3[1].data;
|
|
2217
2225
|
return [key, data];
|
|
2218
|
-
}).filter(function (
|
|
2219
|
-
var data =
|
|
2226
|
+
}).filter(function (_ref4) {
|
|
2227
|
+
var data = _ref4[1];
|
|
2220
2228
|
return !!data;
|
|
2221
2229
|
})));
|
|
2222
2230
|
|
|
@@ -2230,7 +2238,7 @@ function _extractPlasmicQueryData() {
|
|
|
2230
2238
|
return _extractPlasmicQueryData.apply(this, arguments);
|
|
2231
2239
|
}
|
|
2232
2240
|
|
|
2233
|
-
function plasmicPrepass(_x2
|
|
2241
|
+
function plasmicPrepass(_x2) {
|
|
2234
2242
|
return _plasmicPrepass.apply(this, arguments);
|
|
2235
2243
|
}
|
|
2236
2244
|
/**
|
|
@@ -2241,17 +2249,13 @@ function plasmicPrepass(_x2, _x3) {
|
|
|
2241
2249
|
*/
|
|
2242
2250
|
|
|
2243
2251
|
function _plasmicPrepass() {
|
|
2244
|
-
_plasmicPrepass = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(element
|
|
2252
|
+
_plasmicPrepass = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(element) {
|
|
2245
2253
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
2246
2254
|
while (1) {
|
|
2247
2255
|
switch (_context2.prev = _context2.next) {
|
|
2248
2256
|
case 0:
|
|
2249
2257
|
_context2.next = 2;
|
|
2250
|
-
return prepass(
|
|
2251
|
-
value: {
|
|
2252
|
-
cache: plasmicCache != null ? plasmicCache : {}
|
|
2253
|
-
}
|
|
2254
|
-
}, buildPlasmicPrepassElement(element)));
|
|
2258
|
+
return prepass(buildPlasmicPrepassElement(element));
|
|
2255
2259
|
|
|
2256
2260
|
case 2:
|
|
2257
2261
|
case "end":
|
|
@@ -2280,32 +2284,10 @@ function processComponentProps(props) {
|
|
|
2280
2284
|
return props;
|
|
2281
2285
|
}
|
|
2282
2286
|
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
if (React__default.isValidElement(value)) {
|
|
2289
|
-
return processReactElement(value);
|
|
2290
|
-
} else if (Array.isArray(value)) {
|
|
2291
|
-
return value.map(function (v) {
|
|
2292
|
-
return processValue(v, depth + 1);
|
|
2293
|
-
});
|
|
2294
|
-
} else if (isLiteralObject(value)) {
|
|
2295
|
-
return Object.fromEntries(Object.entries(value).map(function (_ref) {
|
|
2296
|
-
var k = _ref[0],
|
|
2297
|
-
v = _ref[1];
|
|
2298
|
-
return [k, processValue(v, depth + 1)];
|
|
2299
|
-
}));
|
|
2300
|
-
} else {
|
|
2301
|
-
return value;
|
|
2302
|
-
}
|
|
2303
|
-
};
|
|
2304
|
-
|
|
2305
|
-
return Object.fromEntries(Object.entries(props).map(function (_ref2) {
|
|
2306
|
-
var k = _ref2[0],
|
|
2307
|
-
v = _ref2[1];
|
|
2308
|
-
return [k, processValue(v, 1)];
|
|
2287
|
+
return Object.fromEntries(Object.entries(props).map(function (_ref) {
|
|
2288
|
+
var k = _ref[0],
|
|
2289
|
+
v = _ref[1];
|
|
2290
|
+
return [k, React__default.isValidElement(v) ? processReactElement(v) : v];
|
|
2309
2291
|
}));
|
|
2310
2292
|
}
|
|
2311
2293
|
|
|
@@ -2344,9 +2326,9 @@ function processPlasmicComponentProps(x) {
|
|
|
2344
2326
|
} else if (Array.isArray(x)) {
|
|
2345
2327
|
return x.map(processPlasmicComponentProps);
|
|
2346
2328
|
} else if (isLiteralObject(x)) {
|
|
2347
|
-
return Object.fromEntries(Object.entries(x).map(function (
|
|
2348
|
-
var key =
|
|
2349
|
-
val =
|
|
2329
|
+
return Object.fromEntries(Object.entries(x).map(function (_ref2) {
|
|
2330
|
+
var key = _ref2[0],
|
|
2331
|
+
val = _ref2[1];
|
|
2350
2332
|
return [key, processPlasmicComponentProps(val)];
|
|
2351
2333
|
}));
|
|
2352
2334
|
} else {
|