@redneckz/wildless-cms-uni-blocks 0.14.1012 → 0.14.1014

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.
@@ -0,0 +1,34 @@
1
+ export const description = 'v0.14.1013';
2
+
3
+ export default (uniPath, content) => {
4
+ modifyBlock(content, uniPath);
5
+
6
+ return content;
7
+ };
8
+
9
+ function modifyBlock(data, uniPath) {
10
+ if (!uniPath.includes('.page.json')) return;
11
+
12
+ const slug = data?.slug;
13
+ const canonical = data?.main?.canonical || '';
14
+ const ogUrl = data?.og?.url || '';
15
+
16
+ if (slug && !canonical.includes(slug) && !ogUrl.includes(slug)) {
17
+ const relativePath = uniPath;
18
+ const cleanPath = relativePath.replace('content/', '').replace(/\.page\.json$/, ''); // убираем расширение на всякий случай
19
+ const isSubFolder = cleanPath.includes('/');
20
+ const newValue = (isSubFolder ? '/' : '') + cleanPath;
21
+
22
+ if (data.main) {
23
+ data.main.canonical = newValue;
24
+ } else {
25
+ data.main = { canonical: newValue };
26
+ }
27
+
28
+ if (data.og) {
29
+ data.og.url = newValue;
30
+ } else {
31
+ data.og = { url: newValue };
32
+ }
33
+ }
34
+ }
@@ -13074,7 +13074,7 @@
13074
13074
  });
13075
13075
  const getTextStyle$1 = (active = false) => style('font-sans text-l lg:font-light', active ? 'text-primary-main' : 'text-primary-text hover:text-primary-main', 'group-data-transparent:text-white group-data-transparent:hover:text-primary-hover');
13076
13076
 
13077
- const HeaderSubMenuItem = JSX(({ observerOptions, onVisibilityChange, children, className, items, activeItem, ...rest }) => {
13077
+ const HeaderSubMenuItem = JSX(({ observerOptions, onVisibilityChange, children, className, navigationSubItems, activeItem, ...rest }) => {
13078
13078
  const [isOpenDropdown, { setFalse, setTrue }] = useBool(false);
13079
13079
  const observerCallback = useCallback((entries) => {
13080
13080
  if (!entries.length || !onVisibilityChange) {
@@ -13086,11 +13086,11 @@
13086
13086
  }, [onVisibilityChange]);
13087
13087
  const ref = useIntersectionObserver(observerCallback, observerOptions);
13088
13088
  const dropdownMenu = useDropdownSubMenu({
13089
- items,
13089
+ items: navigationSubItems,
13090
13090
  onClose: setFalse,
13091
13091
  isOpen: isOpenDropdown,
13092
13092
  activeItem,
13093
- onHover: true
13093
+ onHover: true,
13094
13094
  });
13095
13095
  useEffect(() => {
13096
13096
  dropdownMenu.current?.addEventListener('mouseenter', setTrue);
@@ -14163,7 +14163,7 @@
14163
14163
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
14164
14164
  });
14165
14165
 
14166
- const packageVersion = "0.14.1010";
14166
+ const packageVersion = "0.14.1013";
14167
14167
 
14168
14168
  exports.Blocks = Blocks;
14169
14169
  exports.ContentPage = ContentPage;