@plasmicapp/loader-react 1.0.124 → 1.0.127
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 +17 -4
- 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 +18 -5
- package/dist/loader-react.esm.js.map +1 -1
- package/dist/loader.d.ts +4 -3
- package/package.json +4 -4
package/dist/loader-react.esm.js
CHANGED
|
@@ -5,7 +5,7 @@ import * as PlasmicQuery from '@plasmicapp/query';
|
|
|
5
5
|
import { PlasmicQueryDataProvider, PlasmicPrepassContext } from '@plasmicapp/query';
|
|
6
6
|
export { usePlasmicQueryData } from '@plasmicapp/query';
|
|
7
7
|
import { getBundleSubset, Registry, PlasmicModulesFetcher } from '@plasmicapp/loader-core';
|
|
8
|
-
import { getActiveVariation } from '@plasmicapp/loader-splits';
|
|
8
|
+
import { getExternalIds, getActiveVariation } from '@plasmicapp/loader-splits';
|
|
9
9
|
import React__default, { useState, useCallback, useEffect, useRef, useMemo, createElement, memo, useContext, createContext } from 'react';
|
|
10
10
|
import ReactDOM from 'react-dom';
|
|
11
11
|
import * as jsxDevRuntime from 'react/jsx-dev-runtime';
|
|
@@ -2281,6 +2281,10 @@ var PlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
2281
2281
|
return getActiveVariation;
|
|
2282
2282
|
}();
|
|
2283
2283
|
|
|
2284
|
+
_proto2.getExternalVariation = function getExternalVariation(variation) {
|
|
2285
|
+
return getExternalIds(this.getActiveSplits(), variation);
|
|
2286
|
+
};
|
|
2287
|
+
|
|
2284
2288
|
_proto2.getActiveSplits = function getActiveSplits() {
|
|
2285
2289
|
return this.__internal.getActiveSplits();
|
|
2286
2290
|
};
|
|
@@ -2460,7 +2464,7 @@ function extractPlasmicQueryData(_x) {
|
|
|
2460
2464
|
|
|
2461
2465
|
function _extractPlasmicQueryData() {
|
|
2462
2466
|
_extractPlasmicQueryData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(element) {
|
|
2463
|
-
var cache;
|
|
2467
|
+
var cache, queryCache;
|
|
2464
2468
|
return runtime_1.wrap(function _callee$(_context) {
|
|
2465
2469
|
while (1) {
|
|
2466
2470
|
switch (_context.prev = _context.next) {
|
|
@@ -2482,18 +2486,27 @@ function _extractPlasmicQueryData() {
|
|
|
2482
2486
|
console.warn("PLASMIC: Error encountered while pre-rendering", _context.t0);
|
|
2483
2487
|
|
|
2484
2488
|
case 9:
|
|
2485
|
-
|
|
2489
|
+
queryCache = Object.fromEntries(Array.from(cache.entries()).filter(function (_ref3) {
|
|
2486
2490
|
var key = _ref3[0],
|
|
2487
2491
|
val = _ref3[1];
|
|
2488
2492
|
return !key.startsWith('$swr$') && val !== undefined;
|
|
2493
|
+
}));
|
|
2494
|
+
_context.prev = 10;
|
|
2495
|
+
return _context.abrupt("return", JSON.parse(JSON.stringify(queryCache, function (key, value) {
|
|
2496
|
+
return value !== undefined ? value : null;
|
|
2489
2497
|
})));
|
|
2490
2498
|
|
|
2491
|
-
case
|
|
2499
|
+
case 14:
|
|
2500
|
+
_context.prev = 14;
|
|
2501
|
+
_context.t1 = _context["catch"](10);
|
|
2502
|
+
return _context.abrupt("return", queryCache);
|
|
2503
|
+
|
|
2504
|
+
case 17:
|
|
2492
2505
|
case "end":
|
|
2493
2506
|
return _context.stop();
|
|
2494
2507
|
}
|
|
2495
2508
|
}
|
|
2496
|
-
}, _callee, null, [[1, 6]]);
|
|
2509
|
+
}, _callee, null, [[1, 6], [10, 14]]);
|
|
2497
2510
|
}));
|
|
2498
2511
|
return _extractPlasmicQueryData.apply(this, arguments);
|
|
2499
2512
|
}
|