@plasmicapp/loader-react 1.0.169 → 1.0.172
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/PlasmicRootProvider.d.ts +6 -0
- package/dist/loader-react.cjs.development.js +21 -14
- 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 +21 -14
- package/dist/loader-react.esm.js.map +1 -1
- package/dist/loader.d.ts +10 -2
- package/dist/utils.d.ts +1 -0
- package/package.json +3 -3
package/dist/loader-react.esm.js
CHANGED
|
@@ -1165,6 +1165,9 @@ function matchesPagePath(pagePath, lookup) {
|
|
|
1165
1165
|
params: params
|
|
1166
1166
|
};
|
|
1167
1167
|
}
|
|
1168
|
+
function isDynamicPagePath(path) {
|
|
1169
|
+
return !!path.match(/\[[^/]*\]/);
|
|
1170
|
+
}
|
|
1168
1171
|
|
|
1169
1172
|
function matchesCompMeta(lookup, meta) {
|
|
1170
1173
|
if (lookup.projectId && meta.projectId !== lookup.projectId) {
|
|
@@ -1397,6 +1400,7 @@ function PlasmicRootProvider(props) {
|
|
|
1397
1400
|
globalContextsProps = props.globalContextsProps,
|
|
1398
1401
|
variation = props.variation,
|
|
1399
1402
|
translator = props.translator,
|
|
1403
|
+
Head = props.Head,
|
|
1400
1404
|
pageParams = props.pageParams,
|
|
1401
1405
|
pageQuery = props.pageQuery;
|
|
1402
1406
|
var loader = props.loader.__internal;
|
|
@@ -1442,9 +1446,10 @@ function PlasmicRootProvider(props) {
|
|
|
1442
1446
|
globalContextsProps: globalContextsProps,
|
|
1443
1447
|
loader: loader,
|
|
1444
1448
|
variation: variation,
|
|
1445
|
-
translator: translator
|
|
1449
|
+
translator: translator,
|
|
1450
|
+
Head: Head
|
|
1446
1451
|
};
|
|
1447
|
-
}, [globalVariants, variation, globalContextsProps, loader, splits, translator]);
|
|
1452
|
+
}, [globalVariants, variation, globalContextsProps, loader, splits, translator, Head]);
|
|
1448
1453
|
return createElement(PlasmicQueryDataProvider, {
|
|
1449
1454
|
prefetchedCache: prefetchedQueryData,
|
|
1450
1455
|
suspense: suspenseForQueryData
|
|
@@ -1868,7 +1873,7 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
1868
1873
|
}();
|
|
1869
1874
|
|
|
1870
1875
|
_proto.fetchPages = /*#__PURE__*/function () {
|
|
1871
|
-
var _fetchPages = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
|
|
1876
|
+
var _fetchPages = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(opts) {
|
|
1872
1877
|
var data;
|
|
1873
1878
|
return runtime_1.wrap(function _callee4$(_context4) {
|
|
1874
1879
|
while (1) {
|
|
@@ -1883,7 +1888,7 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
1883
1888
|
case 3:
|
|
1884
1889
|
data = _context4.sent;
|
|
1885
1890
|
return _context4.abrupt("return", data.components.filter(function (comp) {
|
|
1886
|
-
return comp.isPage && comp.path;
|
|
1891
|
+
return comp.isPage && comp.path && ((opts == null ? void 0 : opts.includeDynamicPages) || !isDynamicPagePath(comp.path));
|
|
1887
1892
|
}));
|
|
1888
1893
|
|
|
1889
1894
|
case 5:
|
|
@@ -1894,7 +1899,7 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
1894
1899
|
}, _callee4, this);
|
|
1895
1900
|
}));
|
|
1896
1901
|
|
|
1897
|
-
function fetchPages() {
|
|
1902
|
+
function fetchPages(_x2) {
|
|
1898
1903
|
return _fetchPages.apply(this, arguments);
|
|
1899
1904
|
}
|
|
1900
1905
|
|
|
@@ -1974,7 +1979,7 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
1974
1979
|
}, _callee6, this);
|
|
1975
1980
|
}));
|
|
1976
1981
|
|
|
1977
|
-
function fetchMissingData(
|
|
1982
|
+
function fetchMissingData(_x3) {
|
|
1978
1983
|
return _fetchMissingData.apply(this, arguments);
|
|
1979
1984
|
}
|
|
1980
1985
|
|
|
@@ -2015,7 +2020,7 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
2015
2020
|
}, _callee7, this);
|
|
2016
2021
|
}));
|
|
2017
2022
|
|
|
2018
|
-
function getActiveVariation$1(
|
|
2023
|
+
function getActiveVariation$1(_x4) {
|
|
2019
2024
|
return _getActiveVariation2.apply(this, arguments);
|
|
2020
2025
|
}
|
|
2021
2026
|
|
|
@@ -2297,12 +2302,12 @@ var PlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
2297
2302
|
_proto2.fetchPages =
|
|
2298
2303
|
/*#__PURE__*/
|
|
2299
2304
|
function () {
|
|
2300
|
-
var _fetchPages2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11() {
|
|
2305
|
+
var _fetchPages2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(opts) {
|
|
2301
2306
|
return runtime_1.wrap(function _callee11$(_context11) {
|
|
2302
2307
|
while (1) {
|
|
2303
2308
|
switch (_context11.prev = _context11.next) {
|
|
2304
2309
|
case 0:
|
|
2305
|
-
return _context11.abrupt("return", this.__internal.fetchPages());
|
|
2310
|
+
return _context11.abrupt("return", this.__internal.fetchPages(opts));
|
|
2306
2311
|
|
|
2307
2312
|
case 1:
|
|
2308
2313
|
case "end":
|
|
@@ -2312,7 +2317,7 @@ var PlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
2312
2317
|
}, _callee11, this);
|
|
2313
2318
|
}));
|
|
2314
2319
|
|
|
2315
|
-
function fetchPages() {
|
|
2320
|
+
function fetchPages(_x5) {
|
|
2316
2321
|
return _fetchPages2.apply(this, arguments);
|
|
2317
2322
|
}
|
|
2318
2323
|
|
|
@@ -2364,7 +2369,7 @@ var PlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
2364
2369
|
}, _callee13, this);
|
|
2365
2370
|
}));
|
|
2366
2371
|
|
|
2367
|
-
function _getActiveVariation(
|
|
2372
|
+
function _getActiveVariation(_x6) {
|
|
2368
2373
|
return _getActiveVariation3.apply(this, arguments);
|
|
2369
2374
|
}
|
|
2370
2375
|
|
|
@@ -2402,7 +2407,7 @@ var PlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
2402
2407
|
}, _callee14, this);
|
|
2403
2408
|
}));
|
|
2404
2409
|
|
|
2405
|
-
function getActiveVariation(
|
|
2410
|
+
function getActiveVariation(_x7) {
|
|
2406
2411
|
return _getActiveVariation4.apply(this, arguments);
|
|
2407
2412
|
}
|
|
2408
2413
|
|
|
@@ -2504,7 +2509,8 @@ function PlasmicComponent(props) {
|
|
|
2504
2509
|
var loader = rootContext.loader,
|
|
2505
2510
|
globalContextsProps = rootContext.globalContextsProps,
|
|
2506
2511
|
variation = rootContext.variation,
|
|
2507
|
-
translator = rootContext.translator
|
|
2512
|
+
translator = rootContext.translator,
|
|
2513
|
+
Head = rootContext.Head;
|
|
2508
2514
|
var Component = usePlasmicComponent({
|
|
2509
2515
|
name: component,
|
|
2510
2516
|
projectId: projectId,
|
|
@@ -2556,7 +2562,8 @@ function PlasmicComponent(props) {
|
|
|
2556
2562
|
projectId: projectId
|
|
2557
2563
|
});
|
|
2558
2564
|
element = createElement(ReactWebRootProvider, {
|
|
2559
|
-
translator: translator
|
|
2565
|
+
translator: translator,
|
|
2566
|
+
Head: Head
|
|
2560
2567
|
}, createElement(MaybeWrap, {
|
|
2561
2568
|
cond: !!GlobalContextsProvider,
|
|
2562
2569
|
wrapper: function wrapper(children) {
|