@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.
Files changed (49) hide show
  1. package/bundle/bundle.umd.js +10 -4
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/ui-kit/PreventableEvent.d.ts +1 -0
  4. package/bundle/utils/isUUID.d.ts +1 -1
  5. package/dist/ui-kit/LinkButton/useFormSubmit.js +1 -0
  6. package/dist/ui-kit/LinkButton/useFormSubmit.js.map +1 -1
  7. package/dist/ui-kit/PreventableEvent.d.ts +1 -0
  8. package/dist/utils/adjustHref.js +7 -2
  9. package/dist/utils/adjustHref.js.map +1 -1
  10. package/dist/utils/isUUID.d.ts +1 -1
  11. package/dist/utils/isUUID.js +1 -1
  12. package/dist/utils/isUUID.js.map +1 -1
  13. package/lib/ui-kit/LinkButton/useFormSubmit.js +1 -0
  14. package/lib/ui-kit/LinkButton/useFormSubmit.js.map +1 -1
  15. package/lib/ui-kit/PreventableEvent.d.ts +1 -0
  16. package/lib/utils/adjustHref.js +8 -3
  17. package/lib/utils/adjustHref.js.map +1 -1
  18. package/lib/utils/isUUID.d.ts +1 -1
  19. package/lib/utils/isUUID.js +1 -1
  20. package/lib/utils/isUUID.js.map +1 -1
  21. package/mobile/bundle/bundle.umd.js +10 -4
  22. package/mobile/bundle/bundle.umd.min.js +1 -1
  23. package/mobile/bundle/ui-kit/PreventableEvent.d.ts +1 -0
  24. package/mobile/bundle/utils/isUUID.d.ts +1 -1
  25. package/mobile/dist/ui-kit/LinkButton/useFormSubmit.js +1 -0
  26. package/mobile/dist/ui-kit/LinkButton/useFormSubmit.js.map +1 -1
  27. package/mobile/dist/ui-kit/PreventableEvent.d.ts +1 -0
  28. package/mobile/dist/utils/adjustHref.js +7 -2
  29. package/mobile/dist/utils/adjustHref.js.map +1 -1
  30. package/mobile/dist/utils/isUUID.d.ts +1 -1
  31. package/mobile/dist/utils/isUUID.js +1 -1
  32. package/mobile/dist/utils/isUUID.js.map +1 -1
  33. package/mobile/lib/ui-kit/LinkButton/useFormSubmit.js +1 -0
  34. package/mobile/lib/ui-kit/LinkButton/useFormSubmit.js.map +1 -1
  35. package/mobile/lib/ui-kit/PreventableEvent.d.ts +1 -0
  36. package/mobile/lib/utils/adjustHref.js +8 -3
  37. package/mobile/lib/utils/adjustHref.js.map +1 -1
  38. package/mobile/lib/utils/isUUID.d.ts +1 -1
  39. package/mobile/lib/utils/isUUID.js +1 -1
  40. package/mobile/lib/utils/isUUID.js.map +1 -1
  41. package/mobile/src/ui-kit/LinkButton/useFormSubmit.ts +1 -0
  42. package/mobile/src/ui-kit/PreventableEvent.ts +1 -0
  43. package/mobile/src/utils/adjustHref.ts +10 -3
  44. package/mobile/src/utils/isUUID.ts +1 -1
  45. package/package.json +1 -1
  46. package/src/ui-kit/LinkButton/useFormSubmit.ts +1 -0
  47. package/src/ui-kit/PreventableEvent.ts +1 -0
  48. package/src/utils/adjustHref.ts +10 -3
  49. package/src/utils/isUUID.ts +1 -1
@@ -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 (!href || isURL(href) || [projectSettings.CDN, PREFIX_API].some((_) => hasPrefix(href, _))) {
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.startsWith('/');
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.205";
6058
+ const packageVersion = "0.14.207";
6053
6059
 
6054
6060
  exports.Blocks = Blocks;
6055
6061
  exports.ContentPage = ContentPage;