@redneckz/wildless-cms-uni-blocks 0.14.206 → 0.14.208
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/bundle.umd.js +10 -4
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/ui-kit/PreventableEvent.d.ts +1 -0
- package/bundle/utils/isUUID.d.ts +1 -1
- package/dist/ui-kit/LinkButton/useFormSubmit.js +1 -0
- package/dist/ui-kit/LinkButton/useFormSubmit.js.map +1 -1
- package/dist/ui-kit/PreventableEvent.d.ts +1 -0
- package/dist/utils/adjustHref.js +7 -2
- package/dist/utils/adjustHref.js.map +1 -1
- package/dist/utils/isUUID.d.ts +1 -1
- package/dist/utils/isUUID.js +1 -1
- package/dist/utils/isUUID.js.map +1 -1
- package/lib/ui-kit/LinkButton/useFormSubmit.js +1 -0
- package/lib/ui-kit/LinkButton/useFormSubmit.js.map +1 -1
- package/lib/ui-kit/PreventableEvent.d.ts +1 -0
- package/lib/utils/adjustHref.js +8 -3
- package/lib/utils/adjustHref.js.map +1 -1
- package/lib/utils/isUUID.d.ts +1 -1
- package/lib/utils/isUUID.js +1 -1
- package/lib/utils/isUUID.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +10 -4
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/ui-kit/PreventableEvent.d.ts +1 -0
- package/mobile/bundle/utils/isUUID.d.ts +1 -1
- package/mobile/dist/ui-kit/LinkButton/useFormSubmit.js +1 -0
- package/mobile/dist/ui-kit/LinkButton/useFormSubmit.js.map +1 -1
- package/mobile/dist/ui-kit/PreventableEvent.d.ts +1 -0
- package/mobile/dist/utils/adjustHref.js +7 -2
- package/mobile/dist/utils/adjustHref.js.map +1 -1
- package/mobile/dist/utils/isUUID.d.ts +1 -1
- package/mobile/dist/utils/isUUID.js +1 -1
- package/mobile/dist/utils/isUUID.js.map +1 -1
- package/mobile/lib/ui-kit/LinkButton/useFormSubmit.js +1 -0
- package/mobile/lib/ui-kit/LinkButton/useFormSubmit.js.map +1 -1
- package/mobile/lib/ui-kit/PreventableEvent.d.ts +1 -0
- package/mobile/lib/utils/adjustHref.js +8 -3
- package/mobile/lib/utils/adjustHref.js.map +1 -1
- package/mobile/lib/utils/isUUID.d.ts +1 -1
- package/mobile/lib/utils/isUUID.js +1 -1
- package/mobile/lib/utils/isUUID.js.map +1 -1
- package/mobile/src/ui-kit/LinkButton/useFormSubmit.ts +1 -0
- package/mobile/src/ui-kit/PreventableEvent.ts +1 -0
- package/mobile/src/utils/adjustHref.ts +10 -3
- package/mobile/src/utils/isUUID.ts +1 -1
- package/package.json +1 -1
- package/src/ui-kit/LinkButton/useFormSubmit.ts +1 -0
- package/src/ui-kit/PreventableEvent.ts +1 -0
- package/src/utils/adjustHref.ts +10 -3
- package/src/utils/isUUID.ts +1 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -292,7 +292,7 @@
|
|
|
292
292
|
|
|
293
293
|
const dirname = (path) => path?.split('/').slice(0, -1).join('/');
|
|
294
294
|
|
|
295
|
-
const isUUID = (src) => {
|
|
295
|
+
const isUUID = (src = '') => {
|
|
296
296
|
return /^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(src);
|
|
297
297
|
};
|
|
298
298
|
|
|
@@ -314,13 +314,18 @@
|
|
|
314
314
|
const PREFIX_API = '/api/';
|
|
315
315
|
const FILE_STORAGE_API = `${PREFIX_API}v1/storage`;
|
|
316
316
|
const adjustHref = (router) => (href, basePath = projectSettings.BASE_PATH) => {
|
|
317
|
-
if (
|
|
317
|
+
if ([
|
|
318
|
+
!href,
|
|
319
|
+
isURL(href),
|
|
320
|
+
isHash(href),
|
|
321
|
+
[projectSettings.CDN, PREFIX_API].some((_) => hasPrefix(href, _)),
|
|
322
|
+
].some(Boolean)) {
|
|
318
323
|
return href;
|
|
319
324
|
}
|
|
320
325
|
if (isUUID(href)) {
|
|
321
326
|
return `${FILE_STORAGE_API}/${href}/file`;
|
|
322
327
|
}
|
|
323
|
-
const isRelativeToBase = href
|
|
328
|
+
const isRelativeToBase = href?.startsWith('/');
|
|
324
329
|
return joinPath(hasPrefix(href, basePath) ? '' : basePath, isRelativeToBase ? '/' : dirname(router.pathname), href);
|
|
325
330
|
};
|
|
326
331
|
const hasPrefix = (href, prefix) => prefix && href && href.startsWith(prefix);
|
|
@@ -493,6 +498,7 @@
|
|
|
493
498
|
return;
|
|
494
499
|
}
|
|
495
500
|
ev.preventDefault();
|
|
501
|
+
ev.stopPropagation();
|
|
496
502
|
const { origin, pathname, searchParams } = new URL(href || '');
|
|
497
503
|
const form = document.createElement('form');
|
|
498
504
|
form.setAttribute('method', 'POST');
|
|
@@ -6049,7 +6055,7 @@
|
|
|
6049
6055
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
6050
6056
|
});
|
|
6051
6057
|
|
|
6052
|
-
const packageVersion = "0.14.
|
|
6058
|
+
const packageVersion = "0.14.207";
|
|
6053
6059
|
|
|
6054
6060
|
exports.Blocks = Blocks;
|
|
6055
6061
|
exports.ContentPage = ContentPage;
|