@plasmicapp/loader-react 1.0.168 → 1.0.171
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.ts +1 -0
- package/dist/loader-react.cjs.development.js +14 -10
- 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 +14 -11
- package/dist/loader-react.esm.js.map +1 -1
- package/dist/loader.d.ts +10 -2
- package/dist/utils.d.ts +14 -0
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -8,3 +8,4 @@ export { GlobalVariantSpec, PlasmicRootProvider, PlasmicTranslator, } from './Pl
|
|
|
8
8
|
export { extractPlasmicQueryData, plasmicPrepass } from './prepass';
|
|
9
9
|
export { extractPlasmicQueryDataFromElement, hydrateFromElement, renderToElement, renderToString, } from './render';
|
|
10
10
|
export { usePlasmicComponent } from './usePlasmicComponent';
|
|
11
|
+
export { matchesPagePath } from './utils';
|
|
@@ -1168,6 +1168,9 @@ function matchesPagePath(pagePath, lookup) {
|
|
|
1168
1168
|
params: params
|
|
1169
1169
|
};
|
|
1170
1170
|
}
|
|
1171
|
+
function isDynamicPagePath(path) {
|
|
1172
|
+
return !!path.match(/\[[^/]*\]/);
|
|
1173
|
+
}
|
|
1171
1174
|
|
|
1172
1175
|
function matchesCompMeta(lookup, meta) {
|
|
1173
1176
|
if (lookup.projectId && meta.projectId !== lookup.projectId) {
|
|
@@ -1871,7 +1874,7 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
1871
1874
|
}();
|
|
1872
1875
|
|
|
1873
1876
|
_proto.fetchPages = /*#__PURE__*/function () {
|
|
1874
|
-
var _fetchPages = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
|
|
1877
|
+
var _fetchPages = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(opts) {
|
|
1875
1878
|
var data;
|
|
1876
1879
|
return runtime_1.wrap(function _callee4$(_context4) {
|
|
1877
1880
|
while (1) {
|
|
@@ -1886,7 +1889,7 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
1886
1889
|
case 3:
|
|
1887
1890
|
data = _context4.sent;
|
|
1888
1891
|
return _context4.abrupt("return", data.components.filter(function (comp) {
|
|
1889
|
-
return comp.isPage && comp.path;
|
|
1892
|
+
return comp.isPage && comp.path && ((opts == null ? void 0 : opts.includeDynamicPages) || !isDynamicPagePath(comp.path));
|
|
1890
1893
|
}));
|
|
1891
1894
|
|
|
1892
1895
|
case 5:
|
|
@@ -1897,7 +1900,7 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
1897
1900
|
}, _callee4, this);
|
|
1898
1901
|
}));
|
|
1899
1902
|
|
|
1900
|
-
function fetchPages() {
|
|
1903
|
+
function fetchPages(_x2) {
|
|
1901
1904
|
return _fetchPages.apply(this, arguments);
|
|
1902
1905
|
}
|
|
1903
1906
|
|
|
@@ -1977,7 +1980,7 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
1977
1980
|
}, _callee6, this);
|
|
1978
1981
|
}));
|
|
1979
1982
|
|
|
1980
|
-
function fetchMissingData(
|
|
1983
|
+
function fetchMissingData(_x3) {
|
|
1981
1984
|
return _fetchMissingData.apply(this, arguments);
|
|
1982
1985
|
}
|
|
1983
1986
|
|
|
@@ -2018,7 +2021,7 @@ var InternalPlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
2018
2021
|
}, _callee7, this);
|
|
2019
2022
|
}));
|
|
2020
2023
|
|
|
2021
|
-
function getActiveVariation(
|
|
2024
|
+
function getActiveVariation(_x4) {
|
|
2022
2025
|
return _getActiveVariation2.apply(this, arguments);
|
|
2023
2026
|
}
|
|
2024
2027
|
|
|
@@ -2300,12 +2303,12 @@ var PlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
2300
2303
|
_proto2.fetchPages =
|
|
2301
2304
|
/*#__PURE__*/
|
|
2302
2305
|
function () {
|
|
2303
|
-
var _fetchPages2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11() {
|
|
2306
|
+
var _fetchPages2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(opts) {
|
|
2304
2307
|
return runtime_1.wrap(function _callee11$(_context11) {
|
|
2305
2308
|
while (1) {
|
|
2306
2309
|
switch (_context11.prev = _context11.next) {
|
|
2307
2310
|
case 0:
|
|
2308
|
-
return _context11.abrupt("return", this.__internal.fetchPages());
|
|
2311
|
+
return _context11.abrupt("return", this.__internal.fetchPages(opts));
|
|
2309
2312
|
|
|
2310
2313
|
case 1:
|
|
2311
2314
|
case "end":
|
|
@@ -2315,7 +2318,7 @@ var PlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
2315
2318
|
}, _callee11, this);
|
|
2316
2319
|
}));
|
|
2317
2320
|
|
|
2318
|
-
function fetchPages() {
|
|
2321
|
+
function fetchPages(_x5) {
|
|
2319
2322
|
return _fetchPages2.apply(this, arguments);
|
|
2320
2323
|
}
|
|
2321
2324
|
|
|
@@ -2367,7 +2370,7 @@ var PlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
2367
2370
|
}, _callee13, this);
|
|
2368
2371
|
}));
|
|
2369
2372
|
|
|
2370
|
-
function _getActiveVariation(
|
|
2373
|
+
function _getActiveVariation(_x6) {
|
|
2371
2374
|
return _getActiveVariation3.apply(this, arguments);
|
|
2372
2375
|
}
|
|
2373
2376
|
|
|
@@ -2405,7 +2408,7 @@ var PlasmicComponentLoader = /*#__PURE__*/function () {
|
|
|
2405
2408
|
}, _callee14, this);
|
|
2406
2409
|
}));
|
|
2407
2410
|
|
|
2408
|
-
function getActiveVariation(
|
|
2411
|
+
function getActiveVariation(_x7) {
|
|
2409
2412
|
return _getActiveVariation4.apply(this, arguments);
|
|
2410
2413
|
}
|
|
2411
2414
|
|
|
@@ -2965,6 +2968,7 @@ exports.extractPlasmicQueryData = extractPlasmicQueryData;
|
|
|
2965
2968
|
exports.extractPlasmicQueryDataFromElement = extractPlasmicQueryDataFromElement;
|
|
2966
2969
|
exports.hydrateFromElement = hydrateFromElement;
|
|
2967
2970
|
exports.initPlasmicLoader = initPlasmicLoader;
|
|
2971
|
+
exports.matchesPagePath = matchesPagePath;
|
|
2968
2972
|
exports.plasmicPrepass = plasmicPrepass;
|
|
2969
2973
|
exports.renderToElement = renderToElement;
|
|
2970
2974
|
exports.renderToString = renderToString;
|