@plasmicapp/loader-react 1.0.47 → 1.0.51

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.
@@ -1428,6 +1428,19 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
1428
1428
  }));
1429
1429
  };
1430
1430
 
1431
+ _proto.registerContext = function registerContext(context, meta) {
1432
+ var _meta$importPath2;
1433
+
1434
+ this.substituteComponent(context, {
1435
+ name: meta.name,
1436
+ isCode: true
1437
+ }); // Import path is not used as we will use component substitution
1438
+
1439
+ host.registerContext(context, _extends({}, meta, {
1440
+ importPath: (_meta$importPath2 = meta.importPath) != null ? _meta$importPath2 : ''
1441
+ }));
1442
+ };
1443
+
1431
1444
  _proto.registerPrefetchedBundle = function registerPrefetchedBundle(bundle) {
1432
1445
  this.mergeBundle(bundle);
1433
1446
  };
@@ -2202,12 +2215,12 @@ function _extractPlasmicQueryData() {
2202
2215
  console.warn("PLASMIC: Error encountered while pre-rendering", _context.t0);
2203
2216
 
2204
2217
  case 9:
2205
- return _context.abrupt("return", Object.fromEntries(Array.from(Object.entries(cache)).map(function (_ref4) {
2206
- var key = _ref4[0],
2207
- data = _ref4[1].data;
2218
+ return _context.abrupt("return", Object.fromEntries(Array.from(Object.entries(cache)).map(function (_ref3) {
2219
+ var key = _ref3[0],
2220
+ data = _ref3[1].data;
2208
2221
  return [key, data];
2209
- }).filter(function (_ref5) {
2210
- var data = _ref5[1];
2222
+ }).filter(function (_ref4) {
2223
+ var data = _ref4[1];
2211
2224
  return !!data;
2212
2225
  })));
2213
2226
 
@@ -2267,32 +2280,10 @@ function processComponentProps(props) {
2267
2280
  return props;
2268
2281
  }
2269
2282
 
2270
- var processValue = function processValue(value, depth) {
2271
- if (depth > 2) {
2272
- return value;
2273
- }
2274
-
2275
- if (React__default.isValidElement(value)) {
2276
- return processReactElement(value);
2277
- } else if (Array.isArray(value)) {
2278
- return value.map(function (v) {
2279
- return processValue(v, depth + 1);
2280
- });
2281
- } else if (isLiteralObject(value)) {
2282
- return Object.fromEntries(Object.entries(value).map(function (_ref) {
2283
- var k = _ref[0],
2284
- v = _ref[1];
2285
- return [k, processValue(v, depth + 1)];
2286
- }));
2287
- } else {
2288
- return value;
2289
- }
2290
- };
2291
-
2292
- return Object.fromEntries(Object.entries(props).map(function (_ref2) {
2293
- var k = _ref2[0],
2294
- v = _ref2[1];
2295
- return [k, processValue(v, 1)];
2283
+ return Object.fromEntries(Object.entries(props).map(function (_ref) {
2284
+ var k = _ref[0],
2285
+ v = _ref[1];
2286
+ return [k, React__default.isValidElement(v) ? processReactElement(v) : v];
2296
2287
  }));
2297
2288
  }
2298
2289
 
@@ -2331,9 +2322,9 @@ function processPlasmicComponentProps(x) {
2331
2322
  } else if (Array.isArray(x)) {
2332
2323
  return x.map(processPlasmicComponentProps);
2333
2324
  } else if (isLiteralObject(x)) {
2334
- return Object.fromEntries(Object.entries(x).map(function (_ref3) {
2335
- var key = _ref3[0],
2336
- val = _ref3[1];
2325
+ return Object.fromEntries(Object.entries(x).map(function (_ref2) {
2326
+ var key = _ref2[0],
2327
+ val = _ref2[1];
2337
2328
  return [key, processPlasmicComponentProps(val)];
2338
2329
  }));
2339
2330
  } else {