@redneckz/wildless-cms-uni-blocks 0.14.141 → 0.14.142

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.
@@ -278,6 +278,28 @@
278
278
 
279
279
  const defaultEventBus = new EventBus();
280
280
 
281
+ function useRouter() {
282
+ return useRouter._impl();
283
+ }
284
+ useRouter._impl = () => ({
285
+ isReady: false,
286
+ href: globalThis.location?.href || '/',
287
+ pathname: globalThis.location?.pathname || '/',
288
+ query: {},
289
+ push: () => {
290
+ // Do nothing
291
+ },
292
+ replace: () => {
293
+ // Do nothing
294
+ },
295
+ back: () => {
296
+ // Do nothing
297
+ },
298
+ });
299
+ useRouter.setup = (impl) => {
300
+ useRouter._impl = impl;
301
+ };
302
+
281
303
  const style = (...atoms) => atoms
282
304
  .flatMap((_) => _)
283
305
  .filter(Boolean)
@@ -292,12 +314,13 @@
292
314
  };
293
315
  const BlockWrapper = JSX(({ className, version = 'primary', isTheme = true, defaultPadding = 'p-xl', padding, block, tag = 'section', role, children, style: inlineStyles, }) => {
294
316
  const Tag = tag;
317
+ const router = useRouter();
295
318
  const [isHidden, setHidden] = useState(false);
296
319
  useEffect(() => defaultEventBus.subscribe('tab', (event) => {
297
320
  if (!event.groupName || event.groupName === block?.labelGroup) {
298
321
  setHidden(Boolean(event.label && block?.labels?.length && !block.labels.includes(event.label)));
299
322
  }
300
- }), [block]);
323
+ }), [block, router]);
301
324
  const isGroup = version && isTheme;
302
325
  return (jsx(Tag, { className: style('@container font-sans', isGroup ? 'group' : '', blockStyles[version], isHidden ? 'hidden' : '', padding || defaultPadding, className), ...(isGroup ? { 'data-ver': version } : {}), ...(block?.anchor ? { id: block.anchor } : {}), role: role, style: inlineStyles, children: children }));
303
326
  });
@@ -413,28 +436,6 @@
413
436
  : null;
414
437
  }
415
438
 
416
- function useRouter() {
417
- return useRouter._impl();
418
- }
419
- useRouter._impl = () => ({
420
- isReady: false,
421
- href: globalThis.location?.href || '/',
422
- pathname: globalThis.location?.pathname || '/',
423
- query: {},
424
- push: () => {
425
- // Do nothing
426
- },
427
- replace: () => {
428
- // Do nothing
429
- },
430
- back: () => {
431
- // Do nothing
432
- },
433
- });
434
- useRouter.setup = (impl) => {
435
- useRouter._impl = impl;
436
- };
437
-
438
439
  const dirname = (path) => path?.split('/').slice(0, -1).join('/');
439
440
 
440
441
  const isUUID = (src) => {
@@ -6033,7 +6034,7 @@
6033
6034
  return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-3xl sticky bottom-0 pointer-events-auto" }) }));
6034
6035
  }
6035
6036
 
6036
- const packageVersion = "0.14.140";
6037
+ const packageVersion = "0.14.141";
6037
6038
 
6038
6039
  exports.Blocks = Blocks;
6039
6040
  exports.ContentPage = ContentPage;