@redneckz/wildless-cms-uni-blocks 0.8.8 → 0.8.9

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 (197) hide show
  1. package/bundle/EventBus/EventBus.d.ts +1 -4
  2. package/bundle/EventBus/defaultEventBus.d.ts +7 -0
  3. package/bundle/blocks.schema.json +1 -1
  4. package/bundle/bundle.umd.js +31 -66
  5. package/bundle/bundle.umd.min.js +1 -1
  6. package/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  7. package/bundle/hooks/useRouter.d.ts +6 -2
  8. package/bundle/services/BlockRouter/BlockRouter.d.ts +3 -22
  9. package/bundle/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  10. package/bundle/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  11. package/bundle/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  12. package/dist/EventBus/EventBus.d.ts +1 -4
  13. package/dist/EventBus/EventBus.js +0 -1
  14. package/dist/EventBus/EventBus.js.map +1 -1
  15. package/dist/EventBus/defaultEventBus.d.ts +7 -0
  16. package/dist/EventBus/defaultEventBus.js +5 -0
  17. package/dist/EventBus/defaultEventBus.js.map +1 -0
  18. package/dist/components/ButtonBlock/ButtonBlock.js +2 -1
  19. package/dist/components/ButtonBlock/ButtonBlock.js.map +1 -1
  20. package/dist/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  21. package/dist/components/Tabs/Tabs.js +4 -4
  22. package/dist/components/Tabs/Tabs.js.map +1 -1
  23. package/dist/hooks/useLink.js +2 -3
  24. package/dist/hooks/useLink.js.map +1 -1
  25. package/dist/hooks/useRouter.d.ts +6 -2
  26. package/dist/hooks/useRouter.js.map +1 -1
  27. package/dist/services/BlockRouter/BlockRouter.d.ts +3 -22
  28. package/dist/services/BlockRouter/BlockRouter.js +11 -30
  29. package/dist/services/BlockRouter/BlockRouter.js.map +1 -1
  30. package/dist/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  31. package/dist/services/BlockRouter/blockRouterEventBus.js +5 -0
  32. package/dist/services/BlockRouter/blockRouterEventBus.js.map +1 -0
  33. package/dist/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  34. package/dist/services/BlockRouter/useBlockIntersectionObserver.js +5 -16
  35. package/dist/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
  36. package/dist/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  37. package/dist/services/BlockRouter/useBlockRouterProvider.js +11 -12
  38. package/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
  39. package/dist/ui-kit/BlockWrapper.js +2 -2
  40. package/dist/ui-kit/BlockWrapper.js.map +1 -1
  41. package/lib/EventBus/EventBus.d.ts +1 -4
  42. package/lib/EventBus/EventBus.js +0 -1
  43. package/lib/EventBus/EventBus.js.map +1 -1
  44. package/lib/EventBus/defaultEventBus.d.ts +7 -0
  45. package/lib/EventBus/defaultEventBus.js +3 -0
  46. package/lib/EventBus/defaultEventBus.js.map +1 -0
  47. package/lib/common.css +1 -1
  48. package/lib/components/ButtonBlock/ButtonBlock.js +2 -1
  49. package/lib/components/ButtonBlock/ButtonBlock.js.map +1 -1
  50. package/lib/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  51. package/lib/components/Tabs/Tabs.js +4 -4
  52. package/lib/components/Tabs/Tabs.js.map +1 -1
  53. package/lib/hooks/useLink.js +2 -3
  54. package/lib/hooks/useLink.js.map +1 -1
  55. package/lib/hooks/useRouter.d.ts +6 -2
  56. package/lib/hooks/useRouter.js.map +1 -1
  57. package/lib/services/BlockRouter/BlockRouter.d.ts +3 -22
  58. package/lib/services/BlockRouter/BlockRouter.js +8 -28
  59. package/lib/services/BlockRouter/BlockRouter.js.map +1 -1
  60. package/lib/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  61. package/lib/services/BlockRouter/blockRouterEventBus.js +3 -0
  62. package/lib/services/BlockRouter/blockRouterEventBus.js.map +1 -0
  63. package/lib/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  64. package/lib/services/BlockRouter/useBlockIntersectionObserver.js +6 -17
  65. package/lib/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
  66. package/lib/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  67. package/lib/services/BlockRouter/useBlockRouterProvider.js +12 -13
  68. package/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
  69. package/lib/ui-kit/BlockWrapper.js +2 -2
  70. package/lib/ui-kit/BlockWrapper.js.map +1 -1
  71. package/mobile/bundle/EventBus/EventBus.d.ts +1 -4
  72. package/mobile/bundle/EventBus/defaultEventBus.d.ts +7 -0
  73. package/mobile/bundle/bundle.umd.js +27 -62
  74. package/mobile/bundle/bundle.umd.min.js +1 -1
  75. package/mobile/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  76. package/mobile/bundle/hooks/useRouter.d.ts +6 -2
  77. package/mobile/bundle/services/BlockRouter/BlockRouter.d.ts +3 -22
  78. package/mobile/bundle/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  79. package/mobile/bundle/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  80. package/mobile/bundle/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  81. package/mobile/dist/EventBus/EventBus.d.ts +1 -4
  82. package/mobile/dist/EventBus/EventBus.js +0 -1
  83. package/mobile/dist/EventBus/EventBus.js.map +1 -1
  84. package/mobile/dist/EventBus/defaultEventBus.d.ts +7 -0
  85. package/mobile/dist/EventBus/defaultEventBus.js +5 -0
  86. package/mobile/dist/EventBus/defaultEventBus.js.map +1 -0
  87. package/mobile/dist/components/ButtonBlock/ButtonBlock.js +2 -1
  88. package/mobile/dist/components/ButtonBlock/ButtonBlock.js.map +1 -1
  89. package/mobile/dist/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  90. package/mobile/dist/components/Tabs/Tabs.js +4 -4
  91. package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
  92. package/mobile/dist/hooks/useLink.js +2 -3
  93. package/mobile/dist/hooks/useLink.js.map +1 -1
  94. package/mobile/dist/hooks/useRouter.d.ts +6 -2
  95. package/mobile/dist/hooks/useRouter.js.map +1 -1
  96. package/mobile/dist/services/BlockRouter/BlockRouter.d.ts +3 -22
  97. package/mobile/dist/services/BlockRouter/BlockRouter.js +11 -30
  98. package/mobile/dist/services/BlockRouter/BlockRouter.js.map +1 -1
  99. package/mobile/dist/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  100. package/mobile/dist/services/BlockRouter/blockRouterEventBus.js +5 -0
  101. package/mobile/dist/services/BlockRouter/blockRouterEventBus.js.map +1 -0
  102. package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  103. package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.js +5 -16
  104. package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
  105. package/mobile/dist/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  106. package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js +11 -12
  107. package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
  108. package/mobile/dist/ui-kit/BlockWrapper.js +2 -2
  109. package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
  110. package/mobile/lib/EventBus/EventBus.d.ts +1 -4
  111. package/mobile/lib/EventBus/EventBus.js +0 -1
  112. package/mobile/lib/EventBus/EventBus.js.map +1 -1
  113. package/mobile/lib/EventBus/defaultEventBus.d.ts +7 -0
  114. package/mobile/lib/EventBus/defaultEventBus.js +3 -0
  115. package/mobile/lib/EventBus/defaultEventBus.js.map +1 -0
  116. package/mobile/lib/components/ButtonBlock/ButtonBlock.js +2 -1
  117. package/mobile/lib/components/ButtonBlock/ButtonBlock.js.map +1 -1
  118. package/mobile/lib/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
  119. package/mobile/lib/components/Tabs/Tabs.js +4 -4
  120. package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
  121. package/mobile/lib/hooks/useLink.js +2 -3
  122. package/mobile/lib/hooks/useLink.js.map +1 -1
  123. package/mobile/lib/hooks/useRouter.d.ts +6 -2
  124. package/mobile/lib/hooks/useRouter.js.map +1 -1
  125. package/mobile/lib/services/BlockRouter/BlockRouter.d.ts +3 -22
  126. package/mobile/lib/services/BlockRouter/BlockRouter.js +8 -28
  127. package/mobile/lib/services/BlockRouter/BlockRouter.js.map +1 -1
  128. package/mobile/lib/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
  129. package/mobile/lib/services/BlockRouter/blockRouterEventBus.js +3 -0
  130. package/mobile/lib/services/BlockRouter/blockRouterEventBus.js.map +1 -0
  131. package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
  132. package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.js +6 -17
  133. package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
  134. package/mobile/lib/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
  135. package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js +12 -13
  136. package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
  137. package/mobile/lib/ui-kit/BlockWrapper.js +2 -2
  138. package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
  139. package/mobile/src/EventBus/EventBus.ts +1 -7
  140. package/mobile/src/EventBus/defaultEventBus.ts +8 -0
  141. package/mobile/src/components/ButtonBlock/ButtonBlock.example.json +2 -2
  142. package/mobile/src/components/ButtonBlock/ButtonBlock.tsx +5 -2
  143. package/mobile/src/components/ButtonBlock/ButtonBlockContent.ts +5 -1
  144. package/mobile/src/components/Tabs/Tabs.tsx +4 -4
  145. package/mobile/src/hooks/useLink.ts +2 -3
  146. package/mobile/src/hooks/useRouter.ts +6 -2
  147. package/mobile/src/services/BlockRouter/BlockRouter.ts +8 -47
  148. package/mobile/src/services/BlockRouter/blockRouterEventBus.ts +13 -0
  149. package/mobile/src/services/BlockRouter/useBlockIntersectionObserver.ts +6 -23
  150. package/mobile/src/services/BlockRouter/useBlockRouterProvider.ts +13 -19
  151. package/mobile/src/ui-kit/BlockWrapper.tsx +2 -2
  152. package/package.json +1 -1
  153. package/src/EventBus/EventBus.ts +1 -7
  154. package/src/EventBus/defaultEventBus.ts +8 -0
  155. package/src/components/ButtonBlock/ButtonBlock.example.json +2 -2
  156. package/src/components/ButtonBlock/ButtonBlock.tsx +5 -2
  157. package/src/components/ButtonBlock/ButtonBlockContent.ts +5 -1
  158. package/src/components/Tabs/Tabs.tsx +4 -4
  159. package/src/hooks/useLink.ts +2 -3
  160. package/src/hooks/useRouter.ts +6 -2
  161. package/src/services/BlockRouter/BlockRouter.ts +8 -47
  162. package/src/services/BlockRouter/blockRouterEventBus.ts +13 -0
  163. package/src/services/BlockRouter/useBlockIntersectionObserver.ts +6 -23
  164. package/src/services/BlockRouter/useBlockRouterProvider.ts +13 -19
  165. package/src/ui-kit/BlockWrapper.tsx +2 -2
  166. package/bundle/EventBus/EventMap.d.ts +0 -4
  167. package/bundle/services/BlockRouter/useBlockRouter.d.ts +0 -2
  168. package/dist/EventBus/EventMap.d.ts +0 -4
  169. package/dist/EventBus/EventMap.js +0 -2
  170. package/dist/EventBus/EventMap.js.map +0 -1
  171. package/dist/services/BlockRouter/useBlockRouter.d.ts +0 -2
  172. package/dist/services/BlockRouter/useBlockRouter.js +0 -8
  173. package/dist/services/BlockRouter/useBlockRouter.js.map +0 -1
  174. package/lib/EventBus/EventMap.d.ts +0 -4
  175. package/lib/EventBus/EventMap.js +0 -2
  176. package/lib/EventBus/EventMap.js.map +0 -1
  177. package/lib/services/BlockRouter/useBlockRouter.d.ts +0 -2
  178. package/lib/services/BlockRouter/useBlockRouter.js +0 -5
  179. package/lib/services/BlockRouter/useBlockRouter.js.map +0 -1
  180. package/mobile/bundle/EventBus/EventMap.d.ts +0 -4
  181. package/mobile/bundle/services/BlockRouter/useBlockRouter.d.ts +0 -2
  182. package/mobile/dist/EventBus/EventMap.d.ts +0 -4
  183. package/mobile/dist/EventBus/EventMap.js +0 -2
  184. package/mobile/dist/EventBus/EventMap.js.map +0 -1
  185. package/mobile/dist/services/BlockRouter/useBlockRouter.d.ts +0 -2
  186. package/mobile/dist/services/BlockRouter/useBlockRouter.js +0 -8
  187. package/mobile/dist/services/BlockRouter/useBlockRouter.js.map +0 -1
  188. package/mobile/lib/EventBus/EventMap.d.ts +0 -4
  189. package/mobile/lib/EventBus/EventMap.js +0 -2
  190. package/mobile/lib/EventBus/EventMap.js.map +0 -1
  191. package/mobile/lib/services/BlockRouter/useBlockRouter.d.ts +0 -2
  192. package/mobile/lib/services/BlockRouter/useBlockRouter.js +0 -5
  193. package/mobile/lib/services/BlockRouter/useBlockRouter.js.map +0 -1
  194. package/mobile/src/EventBus/EventMap.ts +0 -5
  195. package/mobile/src/services/BlockRouter/useBlockRouter.ts +0 -5
  196. package/src/EventBus/EventMap.ts +0 -5
  197. package/src/services/BlockRouter/useBlockRouter.ts +0 -5
@@ -290,7 +290,6 @@
290
290
  };
291
291
 
292
292
  class EventBus {
293
- static inst = new EventBus();
294
293
  subscribers = {};
295
294
  subjectsStateMap = {};
296
295
  subscribe(type, listener) {
@@ -318,6 +317,8 @@
318
317
  }
319
318
  }
320
319
 
320
+ const defaultEventBus = new EventBus();
321
+
321
322
  const SENSITIVITY_SCALE = 10;
322
323
  function useIntersectionObserver(observerCallback, { sensitivity, rootRef } = {}) {
323
324
  const ref = useRef(null);
@@ -342,55 +343,17 @@
342
343
  .concat(1);
343
344
  }
344
345
 
345
- const normalizeAnchor = (rawAnchor) => rawAnchor?.replace('#', '') || '';
346
- const getURLWithAnchor = (rawAnchor) => `${globalThis.location?.pathname}#${normalizeAnchor(rawAnchor)}`;
347
- class BlockRouter {
348
- static inst = new BlockRouter();
349
- eventBus = new EventBus();
350
- constructor() {
351
- const anchor = normalizeAnchor(globalThis.location?.hash);
352
- if (anchor) {
353
- this.eventBus.subject('goto', { anchor });
354
- }
355
- }
356
- goto(rawAnchor) {
357
- const anchor = normalizeAnchor(rawAnchor);
358
- if (anchor) {
359
- this.push(anchor);
360
- this.eventBus.fire('goto', { anchor });
361
- }
362
- }
363
- push(rawAnchor) {
364
- globalThis.history?.pushState(null, '', getURLWithAnchor(rawAnchor));
365
- }
366
- replace(rawAnchor) {
367
- globalThis.history?.replaceState(null, '', getURLWithAnchor(rawAnchor));
368
- }
369
- reset() {
370
- globalThis.history?.replaceState(null, '', getURLWithAnchor());
371
- }
372
- }
346
+ const blockRouterEventBus = new EventBus();
373
347
 
374
- function useBlockIntersectionObserver(block, router = BlockRouter.inst) {
348
+ function useBlockIntersectionObserver(block) {
375
349
  const observerCallback = useCallback((entries) => {
376
350
  if (!block || !entries?.length) {
377
351
  return;
378
352
  }
379
353
  const intersection = entries[entries.length - 1];
380
- router.eventBus.fire('intersection', { block, intersection });
381
- }, [block, router]);
382
- const ref = useIntersectionObserver(observerCallback, { sensitivity: 1 });
383
- useEffect(() => {
384
- if (!ref.current) {
385
- return undefined;
386
- }
387
- return router.eventBus.subscribe('goto', ({ anchor }) => {
388
- if (ref.current && block?.anchor === anchor) {
389
- ref.current.scrollIntoView({ behavior: 'smooth', block: 'start' });
390
- }
391
- });
392
- }, [block, router]);
393
- return ref;
354
+ blockRouterEventBus.fire('intersection', { block, intersection });
355
+ }, [block]);
356
+ return useIntersectionObserver(observerCallback, { sensitivity: 1 });
394
357
  }
395
358
 
396
359
  const blockStyles = {
@@ -404,7 +367,7 @@
404
367
  const Tag = tag;
405
368
  const ref = useBlockIntersectionObserver(block);
406
369
  const [isVisible, setVisible] = useState(true);
407
- useEffect(() => EventBus.inst.subscribe('tab', (event) => {
370
+ useEffect(() => defaultEventBus.subscribe('tab', (event) => {
408
371
  if (event.type === 'group') {
409
372
  const hasSettings = block?.labels?.length || block?.anchor;
410
373
  setVisible(event.label ? !hasSettings || Boolean(block?.labels?.includes(event.label)) : true);
@@ -651,8 +614,14 @@
651
614
  },
652
615
  ];
653
616
 
654
- function useBlockRouter() {
655
- return BlockRouter.inst;
617
+ const normalizeAnchor = (anchor) => anchor?.replace('#', '') || '';
618
+ function gotoBlock(router, anchor) {
619
+ router.replace(`#${normalizeAnchor(anchor)}`);
620
+ }
621
+ function trackBlock(router, block) {
622
+ router.replace(`#${normalizeAnchor(block?.anchor)}`, undefined, {
623
+ scroll: false,
624
+ });
656
625
  }
657
626
 
658
627
  const isURL = (href) => Boolean(href?.includes('//'));
@@ -699,7 +668,6 @@
699
668
 
700
669
  function useLink(isRemote) {
701
670
  const router = useRouter();
702
- const blockRouter = useBlockRouter();
703
671
  return (props) => ({
704
672
  ...props,
705
673
  href: adjustHref(props.href),
@@ -722,7 +690,7 @@
722
690
  // Client routing
723
691
  ev?.preventDefault();
724
692
  if (isHash(href)) {
725
- blockRouter.goto(href);
693
+ gotoBlock(router, href);
726
694
  }
727
695
  else if (href) {
728
696
  router.push(href);
@@ -1260,7 +1228,7 @@
1260
1228
 
1261
1229
  const BusinessBlock = JSX(({ className = '', title, cards, ...rest }) => (jsxs(BlockWrapper, { className: `p-12 pb-9 ${className}`, ...rest, children: [jsx(Heading, { headingType: "h3", title: title, className: "text-center mb-8" }), jsx("div", { className: "flex gap-5", children: cards?.length ? cards.map((_, i) => jsx(BusinessCard, { ..._ }, String(i))) : null })] })));
1262
1230
 
1263
- const ButtonBlock = JSX(({ button, ...rest }) => (jsx(BlockWrapper, { ...rest, children: renderButtonsSection([button]) })));
1231
+ const ButtonBlock = JSX(({ button, className, ...rest }) => (jsx(BlockWrapper, { className: style('!bg-transparent', className), ...rest, children: renderButtonsSection([button]) })));
1264
1232
 
1265
1233
  const useCarouselControls = (props) => {
1266
1234
  const { itemCount, visibleItemCount, isCyclic } = props;
@@ -4121,7 +4089,7 @@
4121
4089
  const Tabs = JSX((props) => {
4122
4090
  const { className = '', tabs, showCounter, isSticky, tabsMode, ...rest } = props;
4123
4091
  const [currentTab, setCurrentTab] = useState(tabs ? tabs[0] : undefined);
4124
- useEffect(() => EventBus.inst.subscribe('tab', (event) => {
4092
+ useEffect(() => defaultEventBus.subscribe('tab', (event) => {
4125
4093
  const tab = tabs?.find(checkTab(event));
4126
4094
  if (event.type === 'link' && tab) {
4127
4095
  setCurrentTab(tab);
@@ -4129,11 +4097,11 @@
4129
4097
  return [];
4130
4098
  }), [tabs]);
4131
4099
  useEffect(() => currentTab?.type === 'group'
4132
- ? EventBus.inst.subject('tab', { type: currentTab.type, label: currentTab.ref })
4100
+ ? defaultEventBus.subject('tab', { type: currentTab.type, label: currentTab.ref })
4133
4101
  : undefined, [currentTab]);
4134
4102
  const handleClick = useCallback((selectedTab) => {
4135
4103
  if (selectedTab?.type === 'group') {
4136
- EventBus.inst.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
4104
+ defaultEventBus.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
4137
4105
  }
4138
4106
  setCurrentTab(selectedTab);
4139
4107
  }, []);
@@ -4459,25 +4427,22 @@
4459
4427
  }
4460
4428
 
4461
4429
  const isScrolledEnough = () => globalThis.scrollY > (globalThis.innerHeight * 3) / 4;
4462
- function useBlockRouterProvider(router = BlockRouter.inst, scrollTarget = globalThis) {
4430
+ function useBlockRouterProvider(scrollTarget = globalThis) {
4431
+ const router = useRouter();
4463
4432
  const intersectionsMapRef = useRef(new Map());
4464
- useEffect(() => router.eventBus.subscribe('intersection', ({ block, intersection }) => {
4433
+ useEffect(() => blockRouterEventBus.subscribe('intersection', ({ block, intersection }) => {
4465
4434
  if (intersectionsMapRef.current) {
4466
4435
  intersectionsMapRef.current.set(block, intersection);
4467
4436
  }
4468
- }), [router]);
4437
+ }), []);
4469
4438
  useEffect(() => {
4470
4439
  const handleScroll = debounce(() => {
4471
- if (!isScrolledEnough()) {
4472
- router.reset();
4473
- return;
4440
+ if (isScrolledEnough()) {
4441
+ const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
4442
+ trackBlock(router, activeBlock);
4474
4443
  }
4475
- const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
4476
- if (activeBlock?.anchor) {
4477
- router.replace(activeBlock.anchor);
4478
- }
4479
- else if (!activeBlock) {
4480
- router.reset();
4444
+ else {
4445
+ trackBlock(router);
4481
4446
  }
4482
4447
  }, 100);
4483
4448
  scrollTarget.addEventListener('scroll', handleScroll);
@@ -4556,7 +4521,7 @@
4556
4521
  return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
4557
4522
  }
4558
4523
 
4559
- const packageVersion = "0.8.8";
4524
+ const packageVersion = "0.8.9";
4560
4525
 
4561
4526
  exports.Blocks = Blocks;
4562
4527
  exports.ContentPage = ContentPage;