@redneckz/wildless-cms-uni-blocks 0.14.853 → 0.14.854

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.
@@ -473,8 +473,12 @@
473
473
 
474
474
  const useDialogManager = () => useEmitterWithActions(defaultEventBus.emitter, 'dialog');
475
475
 
476
- const adjustBase = (href, basePath = '') => href?.replace(basePath, '') || '/';
476
+ const FORWARD_SLASH = '/';
477
+ const adjustBase = (href = FORWARD_SLASH, basePath = FORWARD_SLASH) => [href, basePath].some((_) => _ === FORWARD_SLASH)
478
+ ? href
479
+ : href.replace(basePath, '') || FORWARD_SLASH;
477
480
 
481
+ const RESERVED_PREFIX = ['/api'];
478
482
  function useLink() {
479
483
  const router = useRouter();
480
484
  const { closeAll } = useDialogManager();
@@ -497,7 +501,7 @@
497
501
  };
498
502
  }
499
503
  const isClientRouting = (href, target, basePath) => isLocalURL(href, target) &&
500
- !env.SUB_PORTALS?.split(',')?.some(hasPrefix(href)) &&
504
+ ![...RESERVED_PREFIX, ...(env.SUB_PORTALS?.split(',') ?? [])].some(hasPrefix(href)) &&
501
505
  hasPrefix(href)(basePath || '/');
502
506
 
503
507
  const getAspectsAttributes = (data) => {
@@ -10986,7 +10990,7 @@
10986
10990
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
10987
10991
  });
10988
10992
 
10989
- const packageVersion = "0.14.852";
10993
+ const packageVersion = "0.14.853";
10990
10994
 
10991
10995
  exports.Blocks = Blocks;
10992
10996
  exports.ContentPage = ContentPage;