@redneckz/wildless-cms-uni-blocks 0.14.76 → 0.14.77

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 (121) hide show
  1. package/bundle/bundle.umd.js +26 -96
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/dist/components/ContentPage/ContentPage.js +0 -2
  4. package/dist/components/ContentPage/ContentPage.js.map +1 -1
  5. package/dist/ui-kit/BlockWrapper.js +1 -3
  6. package/dist/ui-kit/BlockWrapper.js.map +1 -1
  7. package/lib/components/ContentPage/ContentPage.js +0 -2
  8. package/lib/components/ContentPage/ContentPage.js.map +1 -1
  9. package/lib/ui-kit/BlockWrapper.js +1 -3
  10. package/lib/ui-kit/BlockWrapper.js.map +1 -1
  11. package/mobile/bundle/bundle.umd.js +26 -96
  12. package/mobile/bundle/bundle.umd.min.js +1 -1
  13. package/mobile/dist/components/ContentPage/ContentPage.js +0 -2
  14. package/mobile/dist/components/ContentPage/ContentPage.js.map +1 -1
  15. package/mobile/dist/ui-kit/BlockWrapper.js +1 -3
  16. package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
  17. package/mobile/lib/components/ContentPage/ContentPage.js +0 -2
  18. package/mobile/lib/components/ContentPage/ContentPage.js.map +1 -1
  19. package/mobile/lib/ui-kit/BlockWrapper.js +1 -3
  20. package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
  21. package/mobile/src/components/ContentPage/ContentPage.tsx +0 -3
  22. package/mobile/src/ui-kit/BlockWrapper.tsx +2 -4
  23. package/package.json +1 -1
  24. package/src/components/ContentPage/ContentPage.tsx +0 -3
  25. package/src/ui-kit/BlockWrapper.tsx +2 -4
  26. package/bundle/services/BlockRouter/BlockIntersection.d.ts +0 -2
  27. package/bundle/services/BlockRouter/BlockRouter.d.ts +0 -2
  28. package/bundle/services/BlockRouter/blockRouterEventBus.d.ts +0 -11
  29. package/bundle/services/BlockRouter/findActiveBlock.d.ts +0 -3
  30. package/bundle/services/BlockRouter/useBlockIntersectionObserver.d.ts +0 -4
  31. package/bundle/services/BlockRouter/useBlockRouterProvider.d.ts +0 -1
  32. package/dist/services/BlockRouter/BlockIntersection.d.ts +0 -2
  33. package/dist/services/BlockRouter/BlockIntersection.js +0 -2
  34. package/dist/services/BlockRouter/BlockIntersection.js.map +0 -1
  35. package/dist/services/BlockRouter/BlockRouter.d.ts +0 -2
  36. package/dist/services/BlockRouter/BlockRouter.js +0 -11
  37. package/dist/services/BlockRouter/BlockRouter.js.map +0 -1
  38. package/dist/services/BlockRouter/blockRouterEventBus.d.ts +0 -11
  39. package/dist/services/BlockRouter/blockRouterEventBus.js +0 -5
  40. package/dist/services/BlockRouter/blockRouterEventBus.js.map +0 -1
  41. package/dist/services/BlockRouter/findActiveBlock.d.ts +0 -3
  42. package/dist/services/BlockRouter/findActiveBlock.js +0 -15
  43. package/dist/services/BlockRouter/findActiveBlock.js.map +0 -1
  44. package/dist/services/BlockRouter/useBlockIntersectionObserver.d.ts +0 -4
  45. package/dist/services/BlockRouter/useBlockIntersectionObserver.js +0 -17
  46. package/dist/services/BlockRouter/useBlockIntersectionObserver.js.map +0 -1
  47. package/dist/services/BlockRouter/useBlockRouterProvider.d.ts +0 -1
  48. package/dist/services/BlockRouter/useBlockRouterProvider.js +0 -28
  49. package/dist/services/BlockRouter/useBlockRouterProvider.js.map +0 -1
  50. package/lib/services/BlockRouter/BlockIntersection.d.ts +0 -2
  51. package/lib/services/BlockRouter/BlockIntersection.js +0 -2
  52. package/lib/services/BlockRouter/BlockIntersection.js.map +0 -1
  53. package/lib/services/BlockRouter/BlockRouter.d.ts +0 -2
  54. package/lib/services/BlockRouter/BlockRouter.js +0 -8
  55. package/lib/services/BlockRouter/BlockRouter.js.map +0 -1
  56. package/lib/services/BlockRouter/blockRouterEventBus.d.ts +0 -11
  57. package/lib/services/BlockRouter/blockRouterEventBus.js +0 -3
  58. package/lib/services/BlockRouter/blockRouterEventBus.js.map +0 -1
  59. package/lib/services/BlockRouter/findActiveBlock.d.ts +0 -3
  60. package/lib/services/BlockRouter/findActiveBlock.js +0 -12
  61. package/lib/services/BlockRouter/findActiveBlock.js.map +0 -1
  62. package/lib/services/BlockRouter/useBlockIntersectionObserver.d.ts +0 -4
  63. package/lib/services/BlockRouter/useBlockIntersectionObserver.js +0 -14
  64. package/lib/services/BlockRouter/useBlockIntersectionObserver.js.map +0 -1
  65. package/lib/services/BlockRouter/useBlockRouterProvider.d.ts +0 -1
  66. package/lib/services/BlockRouter/useBlockRouterProvider.js +0 -25
  67. package/lib/services/BlockRouter/useBlockRouterProvider.js.map +0 -1
  68. package/mobile/bundle/services/BlockRouter/BlockIntersection.d.ts +0 -2
  69. package/mobile/bundle/services/BlockRouter/BlockRouter.d.ts +0 -2
  70. package/mobile/bundle/services/BlockRouter/blockRouterEventBus.d.ts +0 -11
  71. package/mobile/bundle/services/BlockRouter/findActiveBlock.d.ts +0 -3
  72. package/mobile/bundle/services/BlockRouter/useBlockIntersectionObserver.d.ts +0 -4
  73. package/mobile/bundle/services/BlockRouter/useBlockRouterProvider.d.ts +0 -1
  74. package/mobile/dist/services/BlockRouter/BlockIntersection.d.ts +0 -2
  75. package/mobile/dist/services/BlockRouter/BlockIntersection.js +0 -2
  76. package/mobile/dist/services/BlockRouter/BlockIntersection.js.map +0 -1
  77. package/mobile/dist/services/BlockRouter/BlockRouter.d.ts +0 -2
  78. package/mobile/dist/services/BlockRouter/BlockRouter.js +0 -11
  79. package/mobile/dist/services/BlockRouter/BlockRouter.js.map +0 -1
  80. package/mobile/dist/services/BlockRouter/blockRouterEventBus.d.ts +0 -11
  81. package/mobile/dist/services/BlockRouter/blockRouterEventBus.js +0 -5
  82. package/mobile/dist/services/BlockRouter/blockRouterEventBus.js.map +0 -1
  83. package/mobile/dist/services/BlockRouter/findActiveBlock.d.ts +0 -3
  84. package/mobile/dist/services/BlockRouter/findActiveBlock.js +0 -15
  85. package/mobile/dist/services/BlockRouter/findActiveBlock.js.map +0 -1
  86. package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.d.ts +0 -4
  87. package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.js +0 -17
  88. package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.js.map +0 -1
  89. package/mobile/dist/services/BlockRouter/useBlockRouterProvider.d.ts +0 -1
  90. package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js +0 -28
  91. package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js.map +0 -1
  92. package/mobile/lib/services/BlockRouter/BlockIntersection.d.ts +0 -2
  93. package/mobile/lib/services/BlockRouter/BlockIntersection.js +0 -2
  94. package/mobile/lib/services/BlockRouter/BlockIntersection.js.map +0 -1
  95. package/mobile/lib/services/BlockRouter/BlockRouter.d.ts +0 -2
  96. package/mobile/lib/services/BlockRouter/BlockRouter.js +0 -8
  97. package/mobile/lib/services/BlockRouter/BlockRouter.js.map +0 -1
  98. package/mobile/lib/services/BlockRouter/blockRouterEventBus.d.ts +0 -11
  99. package/mobile/lib/services/BlockRouter/blockRouterEventBus.js +0 -3
  100. package/mobile/lib/services/BlockRouter/blockRouterEventBus.js.map +0 -1
  101. package/mobile/lib/services/BlockRouter/findActiveBlock.d.ts +0 -3
  102. package/mobile/lib/services/BlockRouter/findActiveBlock.js +0 -12
  103. package/mobile/lib/services/BlockRouter/findActiveBlock.js.map +0 -1
  104. package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.d.ts +0 -4
  105. package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.js +0 -14
  106. package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.js.map +0 -1
  107. package/mobile/lib/services/BlockRouter/useBlockRouterProvider.d.ts +0 -1
  108. package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js +0 -25
  109. package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js.map +0 -1
  110. package/mobile/src/services/BlockRouter/BlockIntersection.ts +0 -3
  111. package/mobile/src/services/BlockRouter/BlockRouter.ts +0 -11
  112. package/mobile/src/services/BlockRouter/blockRouterEventBus.ts +0 -13
  113. package/mobile/src/services/BlockRouter/findActiveBlock.ts +0 -20
  114. package/mobile/src/services/BlockRouter/useBlockIntersectionObserver.ts +0 -20
  115. package/mobile/src/services/BlockRouter/useBlockRouterProvider.ts +0 -37
  116. package/src/services/BlockRouter/BlockIntersection.ts +0 -3
  117. package/src/services/BlockRouter/BlockRouter.ts +0 -11
  118. package/src/services/BlockRouter/blockRouterEventBus.ts +0 -13
  119. package/src/services/BlockRouter/findActiveBlock.ts +0 -20
  120. package/src/services/BlockRouter/useBlockIntersectionObserver.ts +0 -20
  121. package/src/services/BlockRouter/useBlockRouterProvider.ts +0 -37
@@ -4,7 +4,6 @@ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
4
  const uni_jsx_1 = require("@redneckz/uni-jsx");
5
5
  const renderBlockList_1 = require("../../BlockRenderer/renderBlockList");
6
6
  const renderChildren_1 = require("../../BlockRenderer/renderChildren");
7
- const useBlockRouterProvider_1 = require("../../services/BlockRouter/useBlockRouterProvider");
8
7
  const CookiePopup_1 = require("../../ui-kit/CookiePopup/CookiePopup");
9
8
  const DialogManager_1 = require("../../ui-kit/DialogManager/DialogManager");
10
9
  const PopupManager_1 = require("../../ui-kit/PopupManager/PopupManager");
@@ -20,7 +19,6 @@ exports.ContentPage = (0, uni_jsx_1.JSX)(({ className, blocksRegistry, blockDeco
20
19
  blockDecorator,
21
20
  parent: data,
22
21
  };
23
- (0, useBlockRouterProvider_1.useBlockRouterProvider)();
24
22
  return ((0, jsx_runtime_1.jsxs)("div", { "data-theme": colorPalette, children: [(0, jsx_runtime_1.jsxs)("section", { className: (0, style_1.style)('@container relative', pageStyle, className), children: [slots?.header ? ((0, jsx_runtime_1.jsx)("div", { className: "relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]", children: (0, renderBlockList_1.renderBlocksList)(slots?.header, { ...options, slotName: 'header' }) })) : null, (0, jsx_runtime_1.jsxs)("div", { className: "container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs", children: [(0, renderChildren_1.renderChildren)({ block: data, options, extraProps: { className: 'scroll-mt-12' } }), (0, renderBlockList_1.renderBlocksList)(slots?.footer, { ...options, slotName: 'footer' })] }), likeControl ? renderLikeControl() : null] }), (0, jsx_runtime_1.jsx)(StickyBottomMenu_1.StickyBottomMenu, {}), (0, jsx_runtime_1.jsx)(DialogManager_1.DialogManager, {}), (0, jsx_runtime_1.jsx)(PopupManager_1.PopupManager, {}), (0, jsx_runtime_1.jsx)(CookiePopup_1.CookiePopup, { termLink: { href: '/pd-policy#cookie', target: '_blank' }, personalDataPolicyLink: { href: '/pd-policy', target: '_blank' } })] }));
25
23
  });
26
24
  exports.ContentPage.childrenTypes = [];
@@ -1 +1 @@
1
- {"version":3,"file":"ContentPage.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPage.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,yEAAuE;AACvE,uEAAoE;AAKpE,8FAA2F;AAC3F,sEAAmE;AACnE,4EAAyE;AACzE,yEAAsE;AACtE,6CAA0C;AAC1C,4DAAyD;AACzD,2EAAwE;AAQ3D,QAAA,WAAW,GAA+B,IAAA,aAAG,EACxD,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,IAAI,GAAG,EAAE,EAAE,EAAE,EAAE;IAC3D,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IAE3E,MAAM,OAAO,GAAyB;QACpC,GAAG,EAAE,EAAE;QACP,IAAI,EAAE,IAAI;QACV,cAAc;QACd,cAAc;QACd,MAAM,EAAE,IAAI;KACb,CAAC;IAEF,IAAA,+CAAsB,GAAE,CAAC;IAEzB,OAAO,CACL,+CAAiB,YAAY,aAC3B,qCAAS,SAAS,EAAE,IAAA,aAAK,EAAC,qBAAqB,EAAE,SAAS,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BAAC,6BAAa,KAAG,EACjB,uBAAC,2BAAY,KAAG,EAChB,uBAAC,yBAAW,IACV,QAAQ,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,EACzD,sBAAsB,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,GAChE,IACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,mBAAW,CAAC,aAAa,GAAG,EAAE,CAAC;AAC/B,mBAAW,CAAC,KAAK,GAAG,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC;AAEnE,SAAS,iBAAiB;IACxB,OAAO,CACL,gCAAK,SAAS,EAAC,qEAAqE,YAClF,uBAAC,yBAAW,IAAC,SAAS,EAAC,oDAAoD,GAAG,GAC1E,CACP,CAAC;AACJ,CAAC"}
@@ -4,7 +4,6 @@ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
4
  const uni_jsx_1 = require("@redneckz/uni-jsx");
5
5
  const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
6
6
  const defaultEventBus_1 = require("../EventBus/defaultEventBus");
7
- const useBlockIntersectionObserver_1 = require("../services/BlockRouter/useBlockIntersectionObserver");
8
7
  const style_1 = require("../utils/style");
9
8
  exports.blockStyles = {
10
9
  primary: 'bg-white text-primary-text',
@@ -15,12 +14,11 @@ exports.blockStyles = {
15
14
  };
16
15
  exports.BlockWrapper = (0, uni_jsx_1.JSX)(({ className, version = 'primary', isTheme = true, defaultPadding = 'p-xl', padding, block, tag = 'section', role, children, }) => {
17
16
  const Tag = tag;
18
- const ref = (0, useBlockIntersectionObserver_1.useBlockIntersectionObserver)(block);
19
17
  const [isHidden, setHidden] = (0, hooks_1.useState)(false);
20
18
  (0, hooks_1.useEffect)(() => defaultEventBus_1.defaultEventBus.subscribe('tab', (event) => {
21
19
  setHidden(Boolean(event.label && block?.labels?.length && !block.labels.includes(event.label)));
22
20
  }), [block]);
23
21
  const isGroup = version && isTheme;
24
- return ((0, jsx_runtime_1.jsx)(Tag, { className: (0, style_1.style)('@container font-sans', isGroup ? 'group' : '', exports.blockStyles[version], isHidden ? 'hidden' : '', padding || defaultPadding, className), ...(isGroup ? { 'data-ver': version } : {}), ...(block?.anchor ? { id: block.anchor, ref } : {}), role: role, children: children }));
22
+ return ((0, jsx_runtime_1.jsx)(Tag, { className: (0, style_1.style)('@container font-sans', isGroup ? 'group' : '', exports.blockStyles[version], isHidden ? 'hidden' : '', padding || defaultPadding, className), ...(isGroup ? { 'data-ver': version } : {}), ...(block?.anchor ? { id: block.anchor } : {}), role: role, children: children }));
25
23
  });
26
24
  //# sourceMappingURL=BlockWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlockWrapper.js","sourceRoot":"","sources":["../../src/ui-kit/BlockWrapper.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAAkE;AAClE,iEAA8D;AAG9D,uGAAoG;AACpG,0CAAuC;AAO1B,QAAA,WAAW,GAAiC;IACvD,OAAO,EAAE,4BAA4B;IACrC,SAAS,EAAE,4BAA4B;IACvC,IAAI,EAAE,mCAAmC;IACzC,WAAW,EAAE,kCAAkC;IAC/C,EAAE,EAAE,EAAE;CACP,CAAC;AAEW,QAAA,YAAY,GAAG,IAAA,aAAG,EAC7B,CAAC,EACC,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,OAAO,GAAG,IAAI,EACd,cAAc,GAAG,MAAM,EACvB,OAAO,EACP,KAAK,EACL,GAAG,GAAG,SAAS,EACf,IAAI,EACJ,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,GAAG,GAAQ,GAAG,CAAC;IAErB,MAAM,GAAG,GAAG,IAAA,2DAA4B,EAAC,KAAK,CAAC,CAAC;IAEhD,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAC9C,IAAA,iBAAS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EAAE,IAAI,YAET,QAAQ,GACL,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
2
  import { JSX } from '@redneckz/uni-jsx';
3
3
  import { renderBlocksList } from '../../BlockRenderer/renderBlockList.js';
4
4
  import { renderChildren } from '../../BlockRenderer/renderChildren.js';
5
- import { useBlockRouterProvider } from '../../services/BlockRouter/useBlockRouterProvider.js';
6
5
  import { CookiePopup } from '../../ui-kit/CookiePopup/CookiePopup.js';
7
6
  import { DialogManager } from '../../ui-kit/DialogManager/DialogManager.js';
8
7
  import { PopupManager } from '../../ui-kit/PopupManager/PopupManager.js';
@@ -18,7 +17,6 @@ export const ContentPage = JSX(({ className, blocksRegistry, blockDecorator, dat
18
17
  blockDecorator,
19
18
  parent: data,
20
19
  };
21
- useBlockRouterProvider();
22
20
  return (_jsxs("div", { "data-theme": colorPalette, children: [_jsxs("section", { className: style('@container relative', pageStyle, className), children: [slots?.header ? (_jsx("div", { className: "relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]", children: renderBlocksList(slots?.header, { ...options, slotName: 'header' }) })) : null, _jsxs("div", { className: "container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs", children: [renderChildren({ block: data, options, extraProps: { className: 'scroll-mt-12' } }), renderBlocksList(slots?.footer, { ...options, slotName: 'footer' })] }), likeControl ? renderLikeControl() : null] }), _jsx(StickyBottomMenu, {}), _jsx(DialogManager, {}), _jsx(PopupManager, {}), _jsx(CookiePopup, { termLink: { href: '/pd-policy#cookie', target: '_blank' }, personalDataPolicyLink: { href: '/pd-policy', target: '_blank' } })] }));
23
21
  });
24
22
  ContentPage.childrenTypes = [];
@@ -1 +1 @@
1
- {"version":3,"file":"ContentPage.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE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KAAG,EACpB,KAAC,aAAa,KAAG,EACjB,KAAC,YAAY,KAAG,EAChB,KAAC,WAAW,IACV,QAAQ,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,EACzD,sBAAsB,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,GAChE,IACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,WAAW,CAAC,aAAa,GAAG,EAAE,CAAC;AAC/B,WAAW,CAAC,KAAK,GAAG,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC;AAEnE,SAAS,iBAAiB;IACxB,OAAO,CACL,cAAK,SAAS,EAAC,qEAAqE,YAClF,KAAC,WAAW,IAAC,SAAS,EAAC,oDAAoD,GAAG,GAC1E,CACP,CAAC;AACJ,CAAC"}
@@ -2,7 +2,6 @@ import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
2
2
  import { JSX } from '@redneckz/uni-jsx';
3
3
  import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
4
4
  import { defaultEventBus } from '../EventBus/defaultEventBus.js';
5
- import { useBlockIntersectionObserver } from '../services/BlockRouter/useBlockIntersectionObserver.js';
6
5
  import { style } from '../utils/style.js';
7
6
  export const blockStyles = {
8
7
  primary: 'bg-white text-primary-text',
@@ -13,12 +12,11 @@ export const blockStyles = {
13
12
  };
14
13
  export const BlockWrapper = JSX(({ className, version = 'primary', isTheme = true, defaultPadding = 'p-xl', padding, block, tag = 'section', role, children, }) => {
15
14
  const Tag = tag;
16
- const ref = useBlockIntersectionObserver(block);
17
15
  const [isHidden, setHidden] = useState(false);
18
16
  useEffect(() => defaultEventBus.subscribe('tab', (event) => {
19
17
  setHidden(Boolean(event.label && block?.labels?.length && !block.labels.includes(event.label)));
20
18
  }), [block]);
21
19
  const isGroup = version && isTheme;
22
- 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, ref } : {}), role: role, children: children }));
20
+ 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, children: children }));
23
21
  });
24
22
  //# sourceMappingURL=BlockWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlockWrapper.js","sourceRoot":"","sources":["../../src/ui-kit/BlockWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAC;AACpG,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAOvC,MAAM,CAAC,MAAM,WAAW,GAAiC;IACvD,OAAO,EAAE,4BAA4B;IACrC,SAAS,EAAE,4BAA4B;IACvC,IAAI,EAAE,mCAAmC;IACzC,WAAW,EAAE,kCAAkC;IAC/C,EAAE,EAAE,EAAE;CACP,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAC7B,CAAC,EACC,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,OAAO,GAAG,IAAI,EACd,cAAc,GAAG,MAAM,EACvB,OAAO,EACP,KAAK,EACL,GAAG,GAAG,SAAS,EACf,IAAI,EACJ,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,GAAG,GAAQ,GAAG,CAAC;IAErB,MAAM,GAAG,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAC;IAEhD,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC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E,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KACxC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC/C,IAAI,EAAE,IAAI,YAET,QAAQ,GACL,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -6,7 +6,6 @@ import { type BlockDecorator } from '../../model/BlockDecorator';
6
6
  import { type BlocksRegistry } from '../../model/BlocksRegistry';
7
7
  import { type ContentPageDef } from '../../model/ContentPageDef';
8
8
  import { type JSXBlock, type UniBlockProps } from '../../model/JSXBlock';
9
- import { useBlockRouterProvider } from '../../services/BlockRouter/useBlockRouterProvider';
10
9
  import { CookiePopup } from '../../ui-kit/CookiePopup/CookiePopup';
11
10
  import { DialogManager } from '../../ui-kit/DialogManager/DialogManager';
12
11
  import { PopupManager } from '../../ui-kit/PopupManager/PopupManager';
@@ -32,8 +31,6 @@ export const ContentPage: JSXBlock<ContentPageProps> = JSX<ContentPageProps>(
32
31
  parent: data,
33
32
  };
34
33
 
35
- useBlockRouterProvider();
36
-
37
34
  return (
38
35
  <div data-theme={colorPalette}>
39
36
  <section className={style('@container relative', pageStyle, className)}>
@@ -3,7 +3,6 @@ import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { defaultEventBus } from '../EventBus/defaultEventBus';
4
4
  import { type BlockVersion } from '../model/BlockVersion';
5
5
  import { type UniBlockProps } from '../model/JSXBlock';
6
- import { useBlockIntersectionObserver } from '../services/BlockRouter/useBlockIntersectionObserver';
7
6
  import { style } from '../utils/style';
8
7
 
9
8
  interface BlockWrapperProps extends UniBlockProps {
@@ -33,9 +32,8 @@ export const BlockWrapper = JSX<BlockWrapperProps>(
33
32
  }) => {
34
33
  const Tag: any = tag;
35
34
 
36
- const ref = useBlockIntersectionObserver(block);
37
-
38
35
  const [isHidden, setHidden] = useState(false);
36
+
39
37
  useEffect(
40
38
  () =>
41
39
  defaultEventBus.subscribe('tab', (event) => {
@@ -59,7 +57,7 @@ export const BlockWrapper = JSX<BlockWrapperProps>(
59
57
  className,
60
58
  )}
61
59
  {...(isGroup ? { 'data-ver': version } : {})}
62
- {...(block?.anchor ? { id: block.anchor, ref } : {})}
60
+ {...(block?.anchor ? { id: block.anchor } : {})}
63
61
  role={role}
64
62
  >
65
63
  {children}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.76",
3
+ "version": "0.14.77",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -6,7 +6,6 @@ import { type BlockDecorator } from '../../model/BlockDecorator';
6
6
  import { type BlocksRegistry } from '../../model/BlocksRegistry';
7
7
  import { type ContentPageDef } from '../../model/ContentPageDef';
8
8
  import { type JSXBlock, type UniBlockProps } from '../../model/JSXBlock';
9
- import { useBlockRouterProvider } from '../../services/BlockRouter/useBlockRouterProvider';
10
9
  import { CookiePopup } from '../../ui-kit/CookiePopup/CookiePopup';
11
10
  import { DialogManager } from '../../ui-kit/DialogManager/DialogManager';
12
11
  import { PopupManager } from '../../ui-kit/PopupManager/PopupManager';
@@ -32,8 +31,6 @@ export const ContentPage: JSXBlock<ContentPageProps> = JSX<ContentPageProps>(
32
31
  parent: data,
33
32
  };
34
33
 
35
- useBlockRouterProvider();
36
-
37
34
  return (
38
35
  <div data-theme={colorPalette}>
39
36
  <section className={style('@container relative', pageStyle, className)}>
@@ -3,7 +3,6 @@ import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { defaultEventBus } from '../EventBus/defaultEventBus';
4
4
  import { type BlockVersion } from '../model/BlockVersion';
5
5
  import { type UniBlockProps } from '../model/JSXBlock';
6
- import { useBlockIntersectionObserver } from '../services/BlockRouter/useBlockIntersectionObserver';
7
6
  import { style } from '../utils/style';
8
7
 
9
8
  interface BlockWrapperProps extends UniBlockProps {
@@ -33,9 +32,8 @@ export const BlockWrapper = JSX<BlockWrapperProps>(
33
32
  }) => {
34
33
  const Tag: any = tag;
35
34
 
36
- const ref = useBlockIntersectionObserver(block);
37
-
38
35
  const [isHidden, setHidden] = useState(false);
36
+
39
37
  useEffect(
40
38
  () =>
41
39
  defaultEventBus.subscribe('tab', (event) => {
@@ -59,7 +57,7 @@ export const BlockWrapper = JSX<BlockWrapperProps>(
59
57
  className,
60
58
  )}
61
59
  {...(isGroup ? { 'data-ver': version } : {})}
62
- {...(block?.anchor ? { id: block.anchor, ref } : {})}
60
+ {...(block?.anchor ? { id: block.anchor } : {})}
63
61
  role={role}
64
62
  >
65
63
  {children}
@@ -1,2 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- export declare type BlockIntersection = [BlockDef, IntersectionObserverEntry];
@@ -1,2 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- export declare function trackBlock(block?: BlockDef): void;
@@ -1,11 +0,0 @@
1
- import { EventBus } from '../../EventBus/EventBus';
2
- import { type BlockDef } from '../../model/ContentPageDef';
3
- export interface BlockIntersectionEvent {
4
- block: BlockDef;
5
- intersection: IntersectionObserverEntry;
6
- }
7
- interface EventMap {
8
- intersection: BlockIntersectionEvent;
9
- }
10
- export declare const blockRouterEventBus: EventBus<EventMap>;
11
- export {};
@@ -1,3 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- import { type BlockIntersection } from './BlockIntersection';
3
- export declare function findActiveBlock(intersections: BlockIntersection[]): BlockDef | undefined;
@@ -1,4 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- export declare function useBlockIntersectionObserver(block?: BlockDef): {
3
- current: Element | null;
4
- };
@@ -1 +0,0 @@
1
- export declare function useBlockRouterProvider(scrollTarget?: EventTarget): void;
@@ -1,2 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- export declare type BlockIntersection = [BlockDef, IntersectionObserverEntry];
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- //# sourceMappingURL=BlockIntersection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BlockIntersection.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/BlockIntersection.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- export declare function trackBlock(block?: BlockDef): void;
@@ -1,11 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.trackBlock = void 0;
3
- const normalizeAnchor = (anchor) => anchor?.replace('#', '') || '';
4
- function trackBlock(block) {
5
- const hash = `#${normalizeAnchor(block?.anchor)}`;
6
- if (globalThis.location?.hash !== hash) {
7
- globalThis.history?.replaceState(globalThis.history?.state, '', hash);
8
- }
9
- }
10
- exports.trackBlock = trackBlock;
11
- //# sourceMappingURL=BlockRouter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BlockRouter.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/BlockRouter.ts"],"names":[],"mappings":";;AAEA,MAAM,eAAe,GAAG,CAAC,MAAe,EAAE,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAE5E,SAAgB,UAAU,CAAC,KAAgB;IACzC,MAAM,IAAI,GAAG,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC;IAElD,IAAI,UAAU,CAAC,QAAQ,EAAE,IAAI,KAAK,IAAI,EAAE;QACtC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;KACvE;AACH,CAAC;AAND,gCAMC"}
@@ -1,11 +0,0 @@
1
- import { EventBus } from '../../EventBus/EventBus';
2
- import { type BlockDef } from '../../model/ContentPageDef';
3
- export interface BlockIntersectionEvent {
4
- block: BlockDef;
5
- intersection: IntersectionObserverEntry;
6
- }
7
- interface EventMap {
8
- intersection: BlockIntersectionEvent;
9
- }
10
- export declare const blockRouterEventBus: EventBus<EventMap>;
11
- export {};
@@ -1,5 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.blockRouterEventBus = void 0;
3
- const EventBus_1 = require("../../EventBus/EventBus");
4
- exports.blockRouterEventBus = new EventBus_1.EventBus();
5
- //# sourceMappingURL=blockRouterEventBus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blockRouterEventBus.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/blockRouterEventBus.ts"],"names":[],"mappings":";;AAAA,sDAAmD;AAYtC,QAAA,mBAAmB,GAAG,IAAI,mBAAQ,EAAY,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- import { type BlockIntersection } from './BlockIntersection';
3
- export declare function findActiveBlock(intersections: BlockIntersection[]): BlockDef | undefined;
@@ -1,15 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.findActiveBlock = void 0;
3
- const minBy_1 = require("../../utils/minBy");
4
- const SPECIAL_BLOCK_TYPES = ['Header', 'Footer'];
5
- const EPS = 0.01;
6
- const topLineDelta = ([, { target }]) => Math.abs(target.getBoundingClientRect().top);
7
- function findActiveBlock(intersections) {
8
- const visibleIntersections = intersections
9
- .filter(([block]) => !SPECIAL_BLOCK_TYPES.includes(block.type || ''))
10
- .filter(([, { intersectionRatio }]) => intersectionRatio > EPS);
11
- const [activeBlock] = visibleIntersections.length > 0 ? (0, minBy_1.minBy)(topLineDelta)(visibleIntersections) : [];
12
- return activeBlock;
13
- }
14
- exports.findActiveBlock = findActiveBlock;
15
- //# sourceMappingURL=findActiveBlock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"findActiveBlock.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/findActiveBlock.ts"],"names":[],"mappings":";;AACA,6CAA0C;AAG1C,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACjD,MAAM,GAAG,GAAG,IAAI,CAAC;AAEjB,MAAM,YAAY,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAoB,EAAE,EAAE,CACzD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,GAAG,CAAC,CAAC;AAE/C,SAAgB,eAAe,CAAC,aAAkC;IAChE,MAAM,oBAAoB,GAAG,aAAa;SACvC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;SACpE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,iBAAiB,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,GAAG,GAAG,CAAC,CAAC;IAElE,MAAM,CAAC,WAAW,CAAC,GACjB,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAA,aAAK,EAAC,YAAY,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEnF,OAAO,WAAW,CAAC;AACrB,CAAC;AATD,0CASC"}
@@ -1,4 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- export declare function useBlockIntersectionObserver(block?: BlockDef): {
3
- current: Element | null;
4
- };
@@ -1,17 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.useBlockIntersectionObserver = void 0;
3
- const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
4
- const useIntersectionObserver_1 = require("../../hooks/useIntersectionObserver");
5
- const blockRouterEventBus_1 = require("./blockRouterEventBus");
6
- function useBlockIntersectionObserver(block) {
7
- const observerCallback = (0, hooks_1.useCallback)((entries) => {
8
- if (!block || !entries?.length) {
9
- return;
10
- }
11
- const intersection = entries[entries.length - 1];
12
- blockRouterEventBus_1.blockRouterEventBus.fire('intersection', { block, intersection });
13
- }, [block]);
14
- return (0, useIntersectionObserver_1.useIntersectionObserver)(observerCallback, { sensitivity: 1 });
15
- }
16
- exports.useBlockIntersectionObserver = useBlockIntersectionObserver;
17
- //# sourceMappingURL=useBlockIntersectionObserver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useBlockIntersectionObserver.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockIntersectionObserver.ts"],"names":[],"mappings":";;AAAA,uDAA0D;AAC1D,iFAA8E;AAE9E,+DAA4D;AAE5D,SAAgB,4BAA4B,CAAC,KAAgB;IAC3D,MAAM,gBAAgB,GAAG,IAAA,mBAAW,EAClC,CAAC,OAAoC,EAAE,EAAE;QACvC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE;YAC9B,OAAO;SACR;QAED,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjD,yCAAmB,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;IACpE,CAAC,EACD,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,IAAA,iDAAuB,EAAC,gBAAgB,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC;AACvE,CAAC;AAdD,oEAcC"}
@@ -1 +0,0 @@
1
- export declare function useBlockRouterProvider(scrollTarget?: EventTarget): void;
@@ -1,28 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.useBlockRouterProvider = void 0;
3
- const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
4
- const debounce_1 = require("../../utils/debounce");
5
- const BlockRouter_1 = require("./BlockRouter");
6
- const blockRouterEventBus_1 = require("./blockRouterEventBus");
7
- const findActiveBlock_1 = require("./findActiveBlock");
8
- const isScrolledEnough = () => globalThis.scrollY > (globalThis.innerHeight * 3) / 4;
9
- function useBlockRouterProvider(scrollTarget = globalThis) {
10
- const intersectionsMapRef = (0, hooks_1.useRef)(new Map());
11
- (0, hooks_1.useEffect)(() => blockRouterEventBus_1.blockRouterEventBus.subscribe('intersection', ({ block, intersection }) => {
12
- if (intersectionsMapRef.current) {
13
- intersectionsMapRef.current.set(block, intersection);
14
- }
15
- }), []);
16
- (0, hooks_1.useEffect)(() => {
17
- const handleScroll = (0, debounce_1.debounce)(() => {
18
- (0, BlockRouter_1.trackBlock)(isScrolledEnough() ? (0, findActiveBlock_1.findActiveBlock)([...(intersectionsMapRef.current || [])]) : undefined);
19
- }, 100);
20
- scrollTarget.addEventListener('scroll', handleScroll);
21
- return () => {
22
- handleScroll.dispose();
23
- scrollTarget.removeEventListener('scroll', handleScroll);
24
- };
25
- }, [scrollTarget]);
26
- }
27
- exports.useBlockRouterProvider = useBlockRouterProvider;
28
- //# sourceMappingURL=useBlockRouterProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useBlockRouterProvider.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockRouterProvider.ts"],"names":[],"mappings":";;AAAA,uDAAgE;AAEhE,mDAAgD;AAChD,+CAA2C;AAC3C,+DAA4D;AAC5D,uDAAoD;AAEpD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,UAAU,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAErF,SAAgB,sBAAsB,CAAC,eAA4B,UAAU;IAC3E,MAAM,mBAAmB,GAAG,IAAA,cAAM,EAA2C,IAAI,GAAG,EAAE,CAAC,CAAC;IAExF,IAAA,iBAAS,EACP,GAAG,EAAE,CACH,yCAAmB,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE;QACxE,IAAI,mBAAmB,CAAC,OAAO,EAAE;YAC/B,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;SACtD;IACH,CAAC,CAAC,EACJ,EAAE,CACH,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,IAAA,mBAAQ,EAAC,GAAG,EAAE;YACjC,IAAA,wBAAU,EACR,gBAAgB,EAAE,CAAC,CAAC,CAAC,IAAA,iCAAe,EAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAC3F,CAAC;QACJ,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,YAAY,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAEtD,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,EAAE,CAAC;YACvB,YAAY,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;AACrB,CAAC;AA3BD,wDA2BC"}
@@ -1,2 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- export declare type BlockIntersection = [BlockDef, IntersectionObserverEntry];
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=BlockIntersection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BlockIntersection.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/BlockIntersection.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- export declare function trackBlock(block?: BlockDef): void;
@@ -1,8 +0,0 @@
1
- const normalizeAnchor = (anchor) => anchor?.replace('#', '') || '';
2
- export function trackBlock(block) {
3
- const hash = `#${normalizeAnchor(block?.anchor)}`;
4
- if (globalThis.location?.hash !== hash) {
5
- globalThis.history?.replaceState(globalThis.history?.state, '', hash);
6
- }
7
- }
8
- //# sourceMappingURL=BlockRouter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BlockRouter.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/BlockRouter.ts"],"names":[],"mappings":"AAEA,MAAM,eAAe,GAAG,CAAC,MAAe,EAAE,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAE5E,MAAM,UAAU,UAAU,CAAC,KAAgB;IACzC,MAAM,IAAI,GAAG,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC;IAElD,IAAI,UAAU,CAAC,QAAQ,EAAE,IAAI,KAAK,IAAI,EAAE;QACtC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;KACvE;AACH,CAAC"}
@@ -1,11 +0,0 @@
1
- import { EventBus } from '../../EventBus/EventBus';
2
- import { type BlockDef } from '../../model/ContentPageDef';
3
- export interface BlockIntersectionEvent {
4
- block: BlockDef;
5
- intersection: IntersectionObserverEntry;
6
- }
7
- interface EventMap {
8
- intersection: BlockIntersectionEvent;
9
- }
10
- export declare const blockRouterEventBus: EventBus<EventMap>;
11
- export {};
@@ -1,3 +0,0 @@
1
- import { EventBus } from '../../EventBus/EventBus.js';
2
- export const blockRouterEventBus = new EventBus();
3
- //# sourceMappingURL=blockRouterEventBus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blockRouterEventBus.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/blockRouterEventBus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAYnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,QAAQ,EAAY,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- import { type BlockIntersection } from './BlockIntersection';
3
- export declare function findActiveBlock(intersections: BlockIntersection[]): BlockDef | undefined;
@@ -1,12 +0,0 @@
1
- import { minBy } from '../../utils/minBy.js';
2
- const SPECIAL_BLOCK_TYPES = ['Header', 'Footer'];
3
- const EPS = 0.01;
4
- const topLineDelta = ([, { target }]) => Math.abs(target.getBoundingClientRect().top);
5
- export function findActiveBlock(intersections) {
6
- const visibleIntersections = intersections
7
- .filter(([block]) => !SPECIAL_BLOCK_TYPES.includes(block.type || ''))
8
- .filter(([, { intersectionRatio }]) => intersectionRatio > EPS);
9
- const [activeBlock] = visibleIntersections.length > 0 ? minBy(topLineDelta)(visibleIntersections) : [];
10
- return activeBlock;
11
- }
12
- //# sourceMappingURL=findActiveBlock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"findActiveBlock.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/findActiveBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACjD,MAAM,GAAG,GAAG,IAAI,CAAC;AAEjB,MAAM,YAAY,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAoB,EAAE,EAAE,CACzD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,GAAG,CAAC,CAAC;AAE/C,MAAM,UAAU,eAAe,CAAC,aAAkC;IAChE,MAAM,oBAAoB,GAAG,aAAa;SACvC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;SACpE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,iBAAiB,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,GAAG,GAAG,CAAC,CAAC;IAElE,MAAM,CAAC,WAAW,CAAC,GACjB,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEnF,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -1,4 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- export declare function useBlockIntersectionObserver(block?: BlockDef): {
3
- current: Element | null;
4
- };
@@ -1,14 +0,0 @@
1
- import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
2
- import { useIntersectionObserver } from '../../hooks/useIntersectionObserver.js';
3
- import { blockRouterEventBus } from './blockRouterEventBus.js';
4
- export function useBlockIntersectionObserver(block) {
5
- const observerCallback = useCallback((entries) => {
6
- if (!block || !entries?.length) {
7
- return;
8
- }
9
- const intersection = entries[entries.length - 1];
10
- blockRouterEventBus.fire('intersection', { block, intersection });
11
- }, [block]);
12
- return useIntersectionObserver(observerCallback, { sensitivity: 1 });
13
- }
14
- //# sourceMappingURL=useBlockIntersectionObserver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useBlockIntersectionObserver.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockIntersectionObserver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,4BAA4B,CAAC,KAAgB;IAC3D,MAAM,gBAAgB,GAAG,WAAW,CAClC,CAAC,OAAoC,EAAE,EAAE;QACvC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE;YAC9B,OAAO;SACR;QAED,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjD,mBAAmB,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;IACpE,CAAC,EACD,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,uBAAuB,CAAC,gBAAgB,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC;AACvE,CAAC"}
@@ -1 +0,0 @@
1
- export declare function useBlockRouterProvider(scrollTarget?: EventTarget): void;
@@ -1,25 +0,0 @@
1
- import { useEffect, useRef } from '@redneckz/uni-jsx/lib/hooks';
2
- import { debounce } from '../../utils/debounce.js';
3
- import { trackBlock } from './BlockRouter.js';
4
- import { blockRouterEventBus } from './blockRouterEventBus.js';
5
- import { findActiveBlock } from './findActiveBlock.js';
6
- const isScrolledEnough = () => globalThis.scrollY > (globalThis.innerHeight * 3) / 4;
7
- export function useBlockRouterProvider(scrollTarget = globalThis) {
8
- const intersectionsMapRef = useRef(new Map());
9
- useEffect(() => blockRouterEventBus.subscribe('intersection', ({ block, intersection }) => {
10
- if (intersectionsMapRef.current) {
11
- intersectionsMapRef.current.set(block, intersection);
12
- }
13
- }), []);
14
- useEffect(() => {
15
- const handleScroll = debounce(() => {
16
- trackBlock(isScrolledEnough() ? findActiveBlock([...(intersectionsMapRef.current || [])]) : undefined);
17
- }, 100);
18
- scrollTarget.addEventListener('scroll', handleScroll);
19
- return () => {
20
- handleScroll.dispose();
21
- scrollTarget.removeEventListener('scroll', handleScroll);
22
- };
23
- }, [scrollTarget]);
24
- }
25
- //# sourceMappingURL=useBlockRouterProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useBlockRouterProvider.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockRouterProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,UAAU,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAErF,MAAM,UAAU,sBAAsB,CAAC,eAA4B,UAAU;IAC3E,MAAM,mBAAmB,GAAG,MAAM,CAA2C,IAAI,GAAG,EAAE,CAAC,CAAC;IAExF,SAAS,CACP,GAAG,EAAE,CACH,mBAAmB,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE;QACxE,IAAI,mBAAmB,CAAC,OAAO,EAAE;YAC/B,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;SACtD;IACH,CAAC,CAAC,EACJ,EAAE,CACH,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,EAAE;YACjC,UAAU,CACR,gBAAgB,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAC3F,CAAC;QACJ,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,YAAY,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAEtD,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,EAAE,CAAC;YACvB,YAAY,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;AACrB,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- export declare type BlockIntersection = [BlockDef, IntersectionObserverEntry];
@@ -1,2 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- export declare function trackBlock(block?: BlockDef): void;
@@ -1,11 +0,0 @@
1
- import { EventBus } from '../../EventBus/EventBus';
2
- import { type BlockDef } from '../../model/ContentPageDef';
3
- export interface BlockIntersectionEvent {
4
- block: BlockDef;
5
- intersection: IntersectionObserverEntry;
6
- }
7
- interface EventMap {
8
- intersection: BlockIntersectionEvent;
9
- }
10
- export declare const blockRouterEventBus: EventBus<EventMap>;
11
- export {};
@@ -1,3 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- import { type BlockIntersection } from './BlockIntersection';
3
- export declare function findActiveBlock(intersections: BlockIntersection[]): BlockDef | undefined;
@@ -1,4 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- export declare function useBlockIntersectionObserver(block?: BlockDef): {
3
- current: Element | null;
4
- };
@@ -1 +0,0 @@
1
- export declare function useBlockRouterProvider(scrollTarget?: EventTarget): void;
@@ -1,2 +0,0 @@
1
- import { type BlockDef } from '../../model/ContentPageDef';
2
- export declare type BlockIntersection = [BlockDef, IntersectionObserverEntry];
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- //# sourceMappingURL=BlockIntersection.js.map