@redneckz/wildless-cms-uni-blocks 0.14.630 → 0.14.631
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/bundle/Env.d.ts +2 -0
- package/bundle/bundle.umd.js +26 -17
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/utils/adjustBase.d.ts +1 -1
- package/dist/Env.d.ts +2 -0
- package/dist/Env.js.map +1 -1
- package/dist/hooks/useLink.js +13 -4
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/utils/adjustBase.d.ts +1 -1
- package/dist/utils/adjustBase.js +1 -1
- package/dist/utils/adjustBase.js.map +1 -1
- package/dist/utils/getBasePath.js +1 -2
- package/dist/utils/getBasePath.js.map +1 -1
- package/dist/utils/url.js +10 -9
- package/dist/utils/url.js.map +1 -1
- package/lib/Env.d.ts +2 -0
- package/lib/Env.js.map +1 -1
- package/lib/hooks/useLink.js +13 -4
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/utils/adjustBase.d.ts +1 -1
- package/lib/utils/adjustBase.js +1 -1
- package/lib/utils/adjustBase.js.map +1 -1
- package/lib/utils/getBasePath.js +1 -2
- package/lib/utils/getBasePath.js.map +1 -1
- package/lib/utils/url.js +10 -9
- package/lib/utils/url.js.map +1 -1
- package/mobile/bundle/Env.d.ts +2 -0
- package/mobile/bundle/bundle.umd.js +26 -17
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/utils/adjustBase.d.ts +1 -1
- package/mobile/dist/Env.d.ts +2 -0
- package/mobile/dist/Env.js.map +1 -1
- package/mobile/dist/hooks/useLink.js +13 -4
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/dist/utils/adjustBase.d.ts +1 -1
- package/mobile/dist/utils/adjustBase.js +1 -1
- package/mobile/dist/utils/adjustBase.js.map +1 -1
- package/mobile/dist/utils/getBasePath.js +1 -2
- package/mobile/dist/utils/getBasePath.js.map +1 -1
- package/mobile/dist/utils/url.js +10 -9
- package/mobile/dist/utils/url.js.map +1 -1
- package/mobile/lib/Env.d.ts +2 -0
- package/mobile/lib/Env.js.map +1 -1
- package/mobile/lib/hooks/useLink.js +13 -4
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/lib/utils/adjustBase.d.ts +1 -1
- package/mobile/lib/utils/adjustBase.js +1 -1
- package/mobile/lib/utils/adjustBase.js.map +1 -1
- package/mobile/lib/utils/getBasePath.js +1 -2
- package/mobile/lib/utils/getBasePath.js.map +1 -1
- package/mobile/lib/utils/url.js +10 -9
- package/mobile/lib/utils/url.js.map +1 -1
- package/mobile/src/Env.ts +3 -1
- package/mobile/src/hooks/useLink.ts +18 -6
- package/mobile/src/utils/adjustBase.ts +1 -1
- package/mobile/src/utils/getBasePath.ts +1 -3
- package/mobile/src/utils/url.ts +13 -13
- package/package.json +1 -1
- package/src/Env.ts +3 -1
- package/src/hooks/useLink.ts +18 -6
- package/src/utils/adjustBase.ts +1 -1
- package/src/utils/getBasePath.ts +1 -3
- package/src/utils/url.ts +13 -13
package/bundle/Env.d.ts
CHANGED
package/bundle/bundle.umd.js
CHANGED
|
@@ -239,15 +239,16 @@
|
|
|
239
239
|
.filter(Boolean)
|
|
240
240
|
.join('/')
|
|
241
241
|
.replace(/\/+/g, '/')
|
|
242
|
-
.replace(/^(.+):\//, '$1://')
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
242
|
+
.replace(/^(.+):\//, '$1://');
|
|
243
|
+
const hasPrefix = (href, prefix) => {
|
|
244
|
+
if (!href || !prefix) {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
if (href.startsWith(prefix)) {
|
|
248
|
+
return [prefix === '/', href === prefix, href[prefix.length] === '/'].some(Boolean);
|
|
249
|
+
}
|
|
250
|
+
return false;
|
|
251
|
+
};
|
|
251
252
|
|
|
252
253
|
var url = /*#__PURE__*/Object.freeze({
|
|
253
254
|
__proto__: null,
|
|
@@ -321,8 +322,7 @@
|
|
|
321
322
|
|
|
322
323
|
function getBasePath(siteUrl = '') {
|
|
323
324
|
try {
|
|
324
|
-
|
|
325
|
-
return `/${tail.filter(Boolean).join('/')}`;
|
|
325
|
+
return new URL(siteUrl).pathname;
|
|
326
326
|
}
|
|
327
327
|
catch (_) {
|
|
328
328
|
return '';
|
|
@@ -438,7 +438,7 @@
|
|
|
438
438
|
closeAll: () => defaultEventBus.fire('dialog', { type: 'close', all: true }),
|
|
439
439
|
});
|
|
440
440
|
|
|
441
|
-
const adjustBase = (href, basePath = '') => href
|
|
441
|
+
const adjustBase = (href, basePath = '') => href?.replace(basePath, '') || '/';
|
|
442
442
|
|
|
443
443
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
444
444
|
const handlerDecorator = (handler) => {
|
|
@@ -464,10 +464,9 @@
|
|
|
464
464
|
};
|
|
465
465
|
function handleHref({ href, target, onClick }) {
|
|
466
466
|
return (ev) => {
|
|
467
|
-
onClick
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
//? Default routing
|
|
467
|
+
onClick?.(ev);
|
|
468
|
+
if (checkIsRemote(href, target, basePath)) {
|
|
469
|
+
//? Native routing
|
|
471
470
|
return;
|
|
472
471
|
}
|
|
473
472
|
closeAll();
|
|
@@ -477,6 +476,16 @@
|
|
|
477
476
|
};
|
|
478
477
|
}
|
|
479
478
|
}
|
|
479
|
+
const checkIsRemote = (href, target, basePath) => {
|
|
480
|
+
if (!isLocalURL(href, target)) {
|
|
481
|
+
return true;
|
|
482
|
+
}
|
|
483
|
+
const subPortals = env.SUB_PORTALS?.split(',');
|
|
484
|
+
if (subPortals?.some((_) => hasPrefix(href, _))) {
|
|
485
|
+
return true;
|
|
486
|
+
}
|
|
487
|
+
return !hasPrefix(href, basePath || '/');
|
|
488
|
+
};
|
|
480
489
|
|
|
481
490
|
const getAspectsAttributes = (data) => {
|
|
482
491
|
if (!Array.isArray(data) || !data.length) {
|
|
@@ -8316,7 +8325,7 @@
|
|
|
8316
8325
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
8317
8326
|
});
|
|
8318
8327
|
|
|
8319
|
-
const packageVersion = "0.14.
|
|
8328
|
+
const packageVersion = "0.14.630";
|
|
8320
8329
|
|
|
8321
8330
|
exports.Blocks = Blocks;
|
|
8322
8331
|
exports.ContentPage = ContentPage;
|