@wix/editor-react-components 1.2848.0 → 1.2850.0
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.
- package/dist/site/components/BoxContainer/component.js +1 -2
- package/dist/site/components/BoxContainer/manifest.js +0 -1
- package/dist/site/components/Menu/component.js +33 -5
- package/dist/site/components/Menu/contexts/MenuContext.d.ts +1 -0
- package/dist/site/components/Menu/menuItems.d.ts +1 -1
- package/dist/site/components/TextEffects3d/component.js +3 -1
- package/dist/site/components/TextEffects3d/css.css +7 -1
- package/dist/site/components/chunks/urlUtils.js +1 -0
- package/package.json +2 -2
|
@@ -45,7 +45,6 @@ const manifest = {
|
|
|
45
45
|
DATA.A11Y_ATTRIBUTES.ariaLive,
|
|
46
46
|
DATA.A11Y_ATTRIBUTES.ariaRoledescription,
|
|
47
47
|
DATA.A11Y_ATTRIBUTES.ariaLevel,
|
|
48
|
-
// Existing sites persist this value, so it must remain schema-valid.
|
|
49
48
|
DATA.A11Y_ATTRIBUTES.ariaHidden,
|
|
50
49
|
DATA.A11Y_ATTRIBUTES.ariaAtomic,
|
|
51
50
|
DATA.A11Y_ATTRIBUTES.ariaCurrent,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { c as clsx } from "../chunks/clsx.js";
|
|
3
3
|
import { useService, useGetService } from "@wix/services-manager-react";
|
|
4
|
-
import { t as toUrlWithoutQuery } from "../chunks/urlUtils.js";
|
|
4
|
+
import { t as toUrlWithoutQuery, s as safeDecode } from "../chunks/urlUtils.js";
|
|
5
5
|
import { U as UrlDefinition } from "../chunks/index16.js";
|
|
6
6
|
import { d as defineService } from "../chunks/index11.js";
|
|
7
7
|
import { T as TranslationsDefinition } from "../chunks/index4.js";
|
|
@@ -39,6 +39,7 @@ const MenuContextProvider = ({
|
|
|
39
39
|
items,
|
|
40
40
|
partToPreviewStateMap,
|
|
41
41
|
currentUrl,
|
|
42
|
+
siteUrl,
|
|
42
43
|
activeAnchor,
|
|
43
44
|
translations,
|
|
44
45
|
menuStyleId,
|
|
@@ -63,6 +64,7 @@ const MenuContextProvider = ({
|
|
|
63
64
|
items,
|
|
64
65
|
partToPreviewStateMap,
|
|
65
66
|
currentUrl,
|
|
67
|
+
siteUrl,
|
|
66
68
|
activeAnchor,
|
|
67
69
|
translations,
|
|
68
70
|
menuStyleId,
|
|
@@ -79,6 +81,7 @@ const MenuContextProvider = ({
|
|
|
79
81
|
items,
|
|
80
82
|
partToPreviewStateMap,
|
|
81
83
|
currentUrl,
|
|
84
|
+
siteUrl,
|
|
82
85
|
activeAnchor,
|
|
83
86
|
translations,
|
|
84
87
|
menuStyleId,
|
|
@@ -611,6 +614,24 @@ const INITIAL_HAMBURGER_MENU_ANIMATION_STATE = {
|
|
|
611
614
|
name: HamburgerMenuAnimationName.None
|
|
612
615
|
};
|
|
613
616
|
const removeQueryFromUrl = (url) => url.split("?")[0];
|
|
617
|
+
const isPathInSite = (pathname, sitePathname) => {
|
|
618
|
+
const sitePath = sitePathname.replace(/\/$/, "");
|
|
619
|
+
return pathname === sitePath || pathname.startsWith(`${sitePath}/`);
|
|
620
|
+
};
|
|
621
|
+
const isSitePageHref = (href, siteUrl) => {
|
|
622
|
+
if (!href || href.startsWith("#") || href.startsWith("?")) {
|
|
623
|
+
return false;
|
|
624
|
+
}
|
|
625
|
+
try {
|
|
626
|
+
const { protocol, origin, pathname } = new URL(href, `${siteUrl}/`);
|
|
627
|
+
const site = new URL(siteUrl);
|
|
628
|
+
const isWebPage = protocol === "http:" || protocol === "https:";
|
|
629
|
+
return isWebPage && origin === site.origin && isPathInSite(pathname, site.pathname);
|
|
630
|
+
} catch {
|
|
631
|
+
return false;
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
const toComparablePageUrl = (href, siteUrl) => siteUrl && isSitePageHref(href, siteUrl) ? toUrlWithoutQuery(href, siteUrl) : safeDecode(removeQueryFromUrl(href));
|
|
614
635
|
const isDefaultAnchor = (activeAnchor) => {
|
|
615
636
|
return activeAnchor.dataId === "SCROLL_TO_TOP" || activeAnchor.dataId === "SCROLL_TO_BOTTOM";
|
|
616
637
|
};
|
|
@@ -636,7 +657,7 @@ const flattenMenuItems = (items) => {
|
|
|
636
657
|
});
|
|
637
658
|
return result;
|
|
638
659
|
};
|
|
639
|
-
const getCurrentMenuItem = (items, activeAnchor, currentPageHref) => {
|
|
660
|
+
const getCurrentMenuItem = (items, activeAnchor, currentPageHref, siteUrl) => {
|
|
640
661
|
const flatItems = flattenMenuItems(items);
|
|
641
662
|
const selectedFromVelo = flatItems.find((item2) => item2.selected);
|
|
642
663
|
if (selectedFromVelo) {
|
|
@@ -654,7 +675,7 @@ const getCurrentMenuItem = (items, activeAnchor, currentPageHref) => {
|
|
|
654
675
|
if (!link) {
|
|
655
676
|
return false;
|
|
656
677
|
}
|
|
657
|
-
return !isAnchorLink(link) &&
|
|
678
|
+
return !isAnchorLink(link) && toComparablePageUrl(link.href || "", siteUrl) === currentPageHref;
|
|
658
679
|
});
|
|
659
680
|
};
|
|
660
681
|
const isSameAnchorLinks = (first, second) => {
|
|
@@ -1976,6 +1997,7 @@ const MenuContent = (props) => {
|
|
|
1976
1997
|
items,
|
|
1977
1998
|
partToPreviewStateMap,
|
|
1978
1999
|
currentUrl,
|
|
2000
|
+
siteUrl,
|
|
1979
2001
|
activeAnchor,
|
|
1980
2002
|
translations,
|
|
1981
2003
|
getAnimationPackage,
|
|
@@ -1992,7 +2014,12 @@ const MenuContent = (props) => {
|
|
|
1992
2014
|
void 0
|
|
1993
2015
|
);
|
|
1994
2016
|
const currentItem = useMemo(() => {
|
|
1995
|
-
const menuItem = getCurrentMenuItem(
|
|
2017
|
+
const menuItem = getCurrentMenuItem(
|
|
2018
|
+
items,
|
|
2019
|
+
activeAnchor,
|
|
2020
|
+
currentUrl,
|
|
2021
|
+
siteUrl
|
|
2022
|
+
);
|
|
1996
2023
|
if (activeAnchor) {
|
|
1997
2024
|
if (isDefaultAnchor(activeAnchor)) {
|
|
1998
2025
|
lastValidAnchorMenuItemRef.current = void 0;
|
|
@@ -2003,7 +2030,7 @@ const MenuContent = (props) => {
|
|
|
2003
2030
|
}
|
|
2004
2031
|
}
|
|
2005
2032
|
return menuItem;
|
|
2006
|
-
}, [items, activeAnchor, currentUrl]);
|
|
2033
|
+
}, [items, activeAnchor, currentUrl, siteUrl]);
|
|
2007
2034
|
const {
|
|
2008
2035
|
isScrollable,
|
|
2009
2036
|
updateScrollState,
|
|
@@ -2519,6 +2546,7 @@ const Menu = (props) => {
|
|
|
2519
2546
|
translations,
|
|
2520
2547
|
getAnimationPackage: () => animationName,
|
|
2521
2548
|
currentUrl,
|
|
2549
|
+
siteUrl: url.siteUrl,
|
|
2522
2550
|
activeAnchor,
|
|
2523
2551
|
navAriaLabel: ((_a = navbarProps == null ? void 0 : navbarProps.a11y) == null ? void 0 : _a.ariaLabel) ?? "",
|
|
2524
2552
|
a11yProps: convertA11yKeysToHtmlFormat((navbarProps == null ? void 0 : navbarProps.a11y) ?? {}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MenuItemProps, ActiveAnchor } from '../../../types/vendored/editor-elements-definitions';
|
|
2
2
|
export declare const isDefaultAnchor: (activeAnchor: ActiveAnchor) => boolean;
|
|
3
|
-
export declare const getCurrentMenuItem: (items: Array<MenuItemProps>, activeAnchor?: ActiveAnchor, currentPageHref?: string) => MenuItemProps | undefined;
|
|
3
|
+
export declare const getCurrentMenuItem: (items: Array<MenuItemProps>, activeAnchor?: ActiveAnchor, currentPageHref?: string, siteUrl?: string) => MenuItemProps | undefined;
|
|
4
4
|
export declare const isCurrentItem: (item: MenuItemProps, currentItem?: MenuItemProps) => boolean;
|
|
@@ -4,9 +4,11 @@ import { T as TestIds } from "../chunks/constants17.js";
|
|
|
4
4
|
import { u as usePatterns, P as Patterns } from "../chunks/Patterns.js";
|
|
5
5
|
import { c as cn } from "../chunks/index8.js";
|
|
6
6
|
const container = "container__kUr-I";
|
|
7
|
+
const shadow = "shadow__nrGyZ";
|
|
7
8
|
const block = "block__EMDF3";
|
|
8
9
|
const styles = {
|
|
9
10
|
container,
|
|
11
|
+
shadow,
|
|
10
12
|
block
|
|
11
13
|
};
|
|
12
14
|
const TextEffects3d$1 = (props) => {
|
|
@@ -30,7 +32,7 @@ const TextEffects3d$1 = (props) => {
|
|
|
30
32
|
className: styles.container,
|
|
31
33
|
disabledPattern: arePatternsDisabled
|
|
32
34
|
}),
|
|
33
|
-
unitPredicate: (data) => /* @__PURE__ */ jsx("span", { className: styles.block, "data-testid": TestIds.viewer.text, children: data })
|
|
35
|
+
unitPredicate: (data) => /* @__PURE__ */ jsx("span", { className: styles.shadow, children: /* @__PURE__ */ jsx("span", { className: styles.block, "data-testid": TestIds.viewer.text, children: data }) })
|
|
34
36
|
}
|
|
35
37
|
)
|
|
36
38
|
}
|
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
--unit-size: 0.01em;
|
|
4
4
|
color: rgb(from var(--fill-color) r g b/var(--fill-opacity));
|
|
5
5
|
-webkit-text-stroke: calc(var(--unit-size) * var(--text-stroke)) rgb(from var(--text-stroke-color) r g b/var(--text-stroke-opacity));
|
|
6
|
-
filter: drop-shadow(var(--text-shadow-
|
|
6
|
+
filter: drop-shadow(var(--text-shadow-3));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.shadow__nrGyZ {
|
|
10
|
+
display: block;
|
|
11
|
+
filter: drop-shadow(var(--text-shadow-2));
|
|
7
12
|
}
|
|
8
13
|
|
|
9
14
|
.block__EMDF3 {
|
|
10
15
|
display: block;
|
|
16
|
+
filter: drop-shadow(var(--text-shadow-1));
|
|
11
17
|
}.textEffects3d__1BhaT {
|
|
12
18
|
--fill-color: var(--text-fill);
|
|
13
19
|
--fill-opacity: var(--text-fill-opacity);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/editor-react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2850.0",
|
|
4
4
|
"description": "React components for the Wix Editor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -228,5 +228,5 @@
|
|
|
228
228
|
"registry": "https://registry.npmjs.org/",
|
|
229
229
|
"access": "public"
|
|
230
230
|
},
|
|
231
|
-
"falconPackageHash": "
|
|
231
|
+
"falconPackageHash": "df5ad4374c691faaf8120f0e1249e10a3f20c44b12349039290229f3"
|
|
232
232
|
}
|