@wix/editor-react-components 1.2640.0 → 1.2642.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.
Files changed (44) hide show
  1. package/dist/site/components/AnimatedIcon/component.js +1 -1
  2. package/dist/site/components/AudioPlayer/component.js +1 -1
  3. package/dist/site/components/Breadcrumbs/component.js +1 -1
  4. package/dist/site/components/Checkbox/component.js +1 -1
  5. package/dist/site/components/CheckboxGroup/component.js +1 -1
  6. package/dist/site/components/CollapsibleText/component.js +1 -1
  7. package/dist/site/components/DatePicker/component.js +1 -1
  8. package/dist/site/components/Dropdown/component.js +1 -1
  9. package/dist/site/components/GoogleMap/component.js +2 -2
  10. package/dist/site/components/HTMLComponent/component.js +1 -1
  11. package/dist/site/components/Image3/component.js +1 -1
  12. package/dist/site/components/Line/component.js +1 -1
  13. package/dist/site/components/Lottie/component.js +1 -1
  14. package/dist/site/components/Menu/component.js +1 -1
  15. package/dist/site/components/Menu/sdk.js +1 -1
  16. package/dist/site/components/RadioButtons/component.js +1 -1
  17. package/dist/site/components/Repeater/component.js +74 -40
  18. package/dist/site/components/Slideshow/component.js +1 -1
  19. package/dist/site/components/Slideshow/css.css +6 -2
  20. package/dist/site/components/SlotsPlaceholder/component.js +1 -1
  21. package/dist/site/components/Tabs/component.js +1 -1
  22. package/dist/site/components/TextBox/component.js +1 -1
  23. package/dist/site/components/TextInput/component.js +4 -1
  24. package/dist/site/components/TextMarquee/component.js +1 -1
  25. package/dist/site/components/TimePicker/component.js +1 -1
  26. package/dist/site/components/TransparentVideo/component.js +1 -1
  27. package/dist/site/components/VideoUpload/component.js +2 -2
  28. package/dist/site/components/WRichText/WRichText.types.d.ts +2 -0
  29. package/dist/site/components/WRichText/component.js +44 -4
  30. package/dist/site/components/WRichText/components/demoteInlineAnchors.d.ts +2 -0
  31. package/dist/site/components/WRichText/constants.d.ts +1 -0
  32. package/dist/site/components/WRichText/css.css +17 -0
  33. package/dist/site/components/WRichText/manifest.js +18 -0
  34. package/dist/site/components/WRichText/sdk.js +1 -1
  35. package/dist/site/components/chunks/Button.js +1 -1
  36. package/dist/site/components/chunks/constants.js +2 -1
  37. package/dist/site/components/chunks/index.js +2133 -3
  38. package/dist/site/components/chunks/index2.js +2 -2
  39. package/dist/site/components/chunks/index3.js +3 -3
  40. package/dist/site/components/chunks/index4.js +3 -2133
  41. package/dist/site/components/chunks/parseHtml.js +1 -1
  42. package/dist/site/components/chunks/parseSvg.js +1 -1
  43. package/dist/site/components/chunks/useConsentPolicyProps.js +1 -1
  44. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { c as clsx } from "../chunks/clsx.js";
3
- import { E as EnvironmentDefinition } from "../chunks/index2.js";
3
+ import { E as EnvironmentDefinition } from "../chunks/index3.js";
4
4
  import { useService } from "@wix/services-manager-react";
5
5
  import * as React from "react";
6
6
  const Plugin = ({ size, ...props }) => /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: size || "24", height: size || "24", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M19.35 9.16a.48.48 0 00-.7 0l-3.16 3.16-3.82-3.82 3.13-3.13a.502.502 0 10-.71-.71L11 7.79 9 5.85l-1 1-1.61 1.64a6.442 6.442 0 009.11 9.11l2.63-2.6-1.94-2 3.16-3.16a.5.5 0 000-.68zM7.09 16.89a5.45 5.45 0 010-7.68l7.7 7.69a5.45 5.45 0 01-7.7-.01zm9.34-1.63l-.94.94-7.7-7.7L9 7.27l7.7 7.7-.27.29z" }));
@@ -4,7 +4,7 @@ import { c as clsx } from "../chunks/clsx.js";
4
4
  import { O as OVERFLOW_BEHAVIOR, c as classes } from "../chunks/constants20.js";
5
5
  import { d as debounce } from "../chunks/performanceUtils.js";
6
6
  import { useService } from "@wix/services-manager-react";
7
- import { E as EnvironmentDefinition } from "../chunks/index2.js";
7
+ import { E as EnvironmentDefinition } from "../chunks/index3.js";
8
8
  import { H as HAS_CUSTOM_FOCUS_CLASSNAME } from "../chunks/a11y.js";
9
9
  const tabs = "tabs__xLDfA";
10
10
  const tabMenu = "tab-menu__LMnG9";
@@ -3,7 +3,7 @@ import { useState } from "react";
3
3
  import { c as clsx } from "../chunks/clsx.js";
4
4
  import { F as Field, T as Tooltip, I as Input_Input_Input } from "../chunks/index12.js";
5
5
  import { useService } from "@wix/services-manager-react";
6
- import { E as EnvironmentDefinition } from "../chunks/index2.js";
6
+ import { E as EnvironmentDefinition } from "../chunks/index3.js";
7
7
  import { f as formatClassNames } from "../chunks/classNames.js";
8
8
  import { a as getDataAttributes } from "../chunks/dataUtils.js";
9
9
  import { u as useValidatedField, R as RequiredIndicator } from "../chunks/RequiredIndicator.js";
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import React__default, { createContext, useState, useRef, useCallback, Component, createElement, Suspense, useContext } from "react";
4
4
  import { c as clsx } from "../chunks/clsx.js";
5
- import { E as EnvironmentDefinition } from "../chunks/index2.js";
5
+ import { E as EnvironmentDefinition } from "../chunks/index3.js";
6
6
  import { b as getAccessibilityAttributes, H as HAS_CUSTOM_FOCUS_CLASSNAME } from "../chunks/a11y.js";
7
7
  import { a as getDataAttributes } from "../chunks/dataUtils.js";
8
8
  import { u as useValidatedField, R as RequiredIndicator } from "../chunks/RequiredIndicator.js";
@@ -220,6 +220,9 @@ class IconContentFetcher {
220
220
  if (this.pendingRequests.has(cacheKey)) {
221
221
  throw this.pendingRequests.get(cacheKey);
222
222
  }
223
+ if (typeof fetch !== "function") {
224
+ return "";
225
+ }
223
226
  const url = `https://static.parastorage.com/services/wix-ui-icons-common/dist/icons/${theme}/${category}/${name}.${hash}.json`;
224
227
  const request = fetch(url, {
225
228
  signal: createTimeoutSignal(ABORT_SIGNAL_TIMEOUT)
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import React__default, { useState, useRef, useCallback, useEffect, useMemo } from "react";
4
4
  import { useService } from "@wix/services-manager-react";
5
- import { E as EnvironmentDefinition } from "../chunks/index2.js";
5
+ import { E as EnvironmentDefinition } from "../chunks/index3.js";
6
6
  import { T as TranslationsDefinition } from "../chunks/index6.js";
7
7
  import { c as clsx } from "../chunks/clsx.js";
8
8
  import { L as Link } from "../chunks/Link.js";
@@ -6,7 +6,7 @@ import { $ as $58246871e4652552$export$c9698ec7f05a07e1, a as $40825cdb76e74f70$
6
6
  import { $ as $4e3b923658d69c60$export$8c610744efcf8a1d, a as $4e3b923658d69c60$export$28c660c63b792dea, b as $514c0188e459b4c0$export$5f1af8db9871e1d6, c as $ee014567cb39d3f0$export$f551688fc98f2e09 } from "../chunks/Tooltip.js";
7
7
  import { $ as $2eb8e6d23f3d0cb0$export$a54013f0d02a8f82 } from "../chunks/filterDOMProps.js";
8
8
  import { useService } from "@wix/services-manager-react";
9
- import { E as EnvironmentDefinition } from "../chunks/index2.js";
9
+ import { E as EnvironmentDefinition } from "../chunks/index3.js";
10
10
  import { T as TranslationsDefinition } from "../chunks/index6.js";
11
11
  import { a as getDataAttributes } from "../chunks/dataUtils.js";
12
12
  import { g as getTranslation } from "../chunks/getTranslation.js";
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import React__default, { useRef, useState, useEffect, useMemo, useCallback } from "react";
3
- import { p as parse } from "../chunks/index4.js";
3
+ import { p as parse } from "../chunks/index.js";
4
4
  import { F as FilterEffectType, V as VideoStartType, a as VideoEndType, b as VideoPlayingState } from "../chunks/TransparentVideo.types.js";
5
5
  import "../chunks/index5.js";
6
6
  import { c as clsx } from "../chunks/clsx.js";
@@ -4,8 +4,8 @@ import { c as clsx } from "../chunks/clsx.js";
4
4
  import { f as formatClassNames } from "../chunks/classNames.js";
5
5
  import { V as Video } from "../chunks/Video.js";
6
6
  import { useService } from "@wix/services-manager-react";
7
- import { E as EnvironmentDefinition } from "../chunks/index2.js";
8
- import { R as RenderingContextDefinition } from "../chunks/index3.js";
7
+ import { E as EnvironmentDefinition } from "../chunks/index3.js";
8
+ import { R as RenderingContextDefinition } from "../chunks/index4.js";
9
9
  const semanticClassNames = {
10
10
  root: "video-upload",
11
11
  title: "video-upload__title"
@@ -3,6 +3,7 @@ import { ScreenReaderSDKProps, AriaAttributesSDKProps, LangSDKProps } from '../.
3
3
  import { IElementPropsSDKActions } from '../../../common/sdk/props-factories/elementPropsSDKFactory';
4
4
  import { IClickPropsSDKActions } from '../../../common/sdk/props-factories/clickPropsSDKFactory';
5
5
  import { default as React } from 'react';
6
+ import { Link } from '@wix/editor-react-types';
6
7
  type BooleanString = 'true' | 'false';
7
8
  type A11yRole = 'region' | 'group' | 'none' | 'status' | 'alert' | 'nav';
8
9
  type AriaLive = 'polite' | 'assertive';
@@ -21,6 +22,7 @@ type WRichTextProps = {
21
22
  html: string;
22
23
  skin: WRichTextSkin;
23
24
  a11y?: StyledTextA11yProps;
25
+ link?: Link;
24
26
  };
25
27
  type ListMarkersInRtlExperiment = {
26
28
  isListInRtlEnabled: boolean;
@@ -6,7 +6,9 @@ import { f as formatClassNames } from "../chunks/classNames.js";
6
6
  import { g as getQaDataAttributes, a as getDataAttributes } from "../chunks/dataUtils.js";
7
7
  import { a as activateBySpaceOrEnterButton, g as getAccessibilityAttributesSpread } from "../chunks/a11y.js";
8
8
  import { p as parseHtml } from "../chunks/parseHtml.js";
9
+ import { i as isValidLink, L as Link } from "../chunks/Link.js";
9
10
  import { T as TestIds } from "../chunks/constants.js";
11
+ import { l as libExports } from "../chunks/index.js";
10
12
  const semanticClassNames = {
11
13
  root: "rich-text"
12
14
  };
@@ -24,6 +26,7 @@ const wRichTextClickableSkin = "WRichTextClickableSkin__uOAlS";
24
26
  const WRichTextThemeSkin = "WRichTextThemeSkin__MmVol";
25
27
  const wRichTextThemeSkin = "WRichTextThemeSkin__MmVol";
26
28
  const listDirectionSpec = "list-direction-spec__FK8Gl";
29
+ const componentLink = "componentLink__TMksE";
27
30
  const skinsStyle = {
28
31
  clickable,
29
32
  srOnly,
@@ -39,7 +42,8 @@ const skinsStyle = {
39
42
  WRichTextThemeSkin,
40
43
  wRichTextThemeSkin,
41
44
  "list-direction-spec": "list-direction-spec__FK8Gl",
42
- listDirectionSpec
45
+ listDirectionSpec,
46
+ componentLink
43
47
  };
44
48
  function usePopupLinkEvents(htmlWrapperRef, deps = []) {
45
49
  const trackedLinkElementsRef = useRef([]);
@@ -64,6 +68,28 @@ function usePopupLinkEvents(htmlWrapperRef, deps = []) {
64
68
  return clearPopupLinkListeners;
65
69
  }, deps);
66
70
  }
71
+ const LINK_BEHAVIOUR_ATTRIBUTES = /* @__PURE__ */ new Set([
72
+ "href",
73
+ "target",
74
+ "rel",
75
+ "data-popupid",
76
+ "data-anchor",
77
+ "data-anchor-comp-id"
78
+ ]);
79
+ const demoteInlineAnchors = {
80
+ replace: (domNode) => {
81
+ if (domNode.type !== "tag" || domNode.name !== "a") {
82
+ return void 0;
83
+ }
84
+ const anchor = domNode;
85
+ const keptAttributes = Object.fromEntries(
86
+ Object.entries(anchor.attribs).filter(
87
+ ([name]) => !LINK_BEHAVIOUR_ATTRIBUTES.has(name)
88
+ )
89
+ );
90
+ return /* @__PURE__ */ jsx("span", { ...libExports.attributesToProps(keptAttributes, "span"), children: libExports.domToReact(anchor.children, demoteInlineAnchors) });
91
+ }
92
+ };
67
93
  const ScreenReaderAffix = ({
68
94
  text,
69
95
  testId
@@ -86,12 +112,14 @@ const WRichText$1 = React.forwardRef((props, ref) => {
86
112
  isListInRtlEnabled,
87
113
  // Should be removed after the specs.thunderbolt.wrichtextListInRtl experiment is open to 100%
88
114
  isClassNameToRootEnabled,
89
- corvid
115
+ corvid,
116
+ link
90
117
  } = props;
91
118
  const [isInteractive, setIsInteractive] = React.useState(false);
92
119
  const { prefix, suffix } = screenReader || {};
93
120
  const htmlWrapperRef = React.useRef(null);
94
- usePopupLinkEvents(htmlWrapperRef, [html]);
121
+ const componentLink2 = isValidLink(link) ? link : void 0;
122
+ usePopupLinkEvents(htmlWrapperRef, [html, Boolean(componentLink2)]);
95
123
  const skinsWithContainer = [
96
124
  "WRichTextSkin",
97
125
  "WRichTextClickableSkin"
@@ -184,7 +212,19 @@ const WRichText$1 = React.forwardRef((props, ref) => {
184
212
  testId: TestIds.screenReaderSuffixElement
185
213
  }
186
214
  );
187
- const richTextElement = /* @__PURE__ */ jsx("div", { ...richTextAttributes, children: parseHtml(html) });
215
+ const parsedHtml = parseHtml(
216
+ html,
217
+ componentLink2 ? demoteInlineAnchors : void 0
218
+ );
219
+ const richTextElement = /* @__PURE__ */ jsx("div", { ...richTextAttributes, children: componentLink2 ? /* @__PURE__ */ jsx(
220
+ Link,
221
+ {
222
+ ...componentLink2,
223
+ className: skinsStyle.componentLink,
224
+ dataTestId: TestIds.componentLink,
225
+ children: parsedHtml
226
+ }
227
+ ) : parsedHtml });
188
228
  if (isInContainer) {
189
229
  return /* @__PURE__ */ jsxs("div", { ...wrapperAttributes, children: [
190
230
  prefixElement,
@@ -0,0 +1,2 @@
1
+ import { HTMLReactParserOptions } from 'html-react-parser';
2
+ export declare const demoteInlineAnchors: HTMLReactParserOptions;
@@ -8,4 +8,5 @@ export declare const TestIds: {
8
8
  readonly containerElement: "containerElement";
9
9
  readonly screenReaderPrefixElement: "screenReaderPrefixElement";
10
10
  readonly screenReaderSuffixElement: "screenReaderSuffixElement";
11
+ readonly componentLink: "componentLink";
11
12
  };
@@ -357,6 +357,23 @@ div) span[style*=color] {
357
357
  .list-direction-spec__FK8Gl li {
358
358
  margin-inline-start: 1.3em;
359
359
  margin-inline-end: 0;
360
+ }
361
+
362
+ .componentLink__TMksE {
363
+ display: block;
364
+ color: inherit;
365
+ text-decoration: inherit;
366
+ }
367
+
368
+ @supports (-webkit-appearance: none) and (stroke-color: transparent) {
369
+ .supportTableDesign__Lc0ts .componentLink__TMksE > * > :first-child {
370
+ vertical-align: top;
371
+ }
372
+ }
373
+ @supports (-webkit-touch-callout: none) {
374
+ .supportTableDesign__Lc0ts .componentLink__TMksE > * > :first-child {
375
+ vertical-align: top;
376
+ }
360
377
  }.wrichtext__a-BNA {
361
378
  word-wrap: break-word;
362
379
  overflow-wrap: break-word;
@@ -61,6 +61,24 @@ const manifest = {
61
61
  dataType: DATA.DATA_TYPE.richText,
62
62
  displayName: "Text"
63
63
  },
64
+ // Whole-component link, rendered around the text. No popup links: the
65
+ // viewer renders it from the resolved href alone.
66
+ link: {
67
+ displayName: "Link",
68
+ dataType: DATA.DATA_TYPE.link,
69
+ [DATA.DATA_TYPE.link]: {
70
+ linkTypes: [
71
+ DATA.LINK_TYPE.pageLink,
72
+ DATA.LINK_TYPE.dynamicPageLink,
73
+ DATA.LINK_TYPE.externalLink,
74
+ DATA.LINK_TYPE.anchorLink,
75
+ DATA.LINK_TYPE.edgeAnchorLinks,
76
+ DATA.LINK_TYPE.documentLink,
77
+ DATA.LINK_TYPE.emailLink,
78
+ DATA.LINK_TYPE.phoneLink
79
+ ]
80
+ }
81
+ },
64
82
  a11y: {
65
83
  dataType: DATA.DATA_TYPE.a11y,
66
84
  [DATA.DATA_TYPE.a11y]: {
@@ -1,6 +1,6 @@
1
1
  import { c as createA11ySdk } from "../chunks/a11ySdk.js";
2
2
  import { s as sanitizeHTML } from "../chunks/sanitizeHTML.js";
3
- import { L as LinkUtilsDefinition } from "../chunks/index.js";
3
+ import { L as LinkUtilsDefinition } from "../chunks/index2.js";
4
4
  import { w as wixCodeName, a as wixGuard, e as endBlockTagRegex, b as endTagRegex, s as startTagRegex } from "../chunks/constants.js";
5
5
  import { i as isNil } from "../chunks/assert.js";
6
6
  import { c as createElementPropsSDKFactory } from "../chunks/elementPropsSDKFactory.js";
@@ -12,7 +12,7 @@ import { d as activateByEnterButton, a as activateBySpaceOrEnterButton, r as rem
12
12
  import { i as isValidLink } from "./Link.js";
13
13
  import { d as defineStaticService } from "./staticService.js";
14
14
  import { d as defineService } from "./index8.js";
15
- import { E as EnvironmentDefinition } from "./index2.js";
15
+ import { E as EnvironmentDefinition } from "./index3.js";
16
16
  import { useService } from "@wix/services-manager-react";
17
17
  const root = "root__IB9QF";
18
18
  const active = "active__lpoVO";
@@ -7,7 +7,8 @@ const TestIds = {
7
7
  richTextElement: "richTextElement",
8
8
  containerElement: "containerElement",
9
9
  screenReaderPrefixElement: "screenReaderPrefixElement",
10
- screenReaderSuffixElement: "screenReaderSuffixElement"
10
+ screenReaderSuffixElement: "screenReaderSuffixElement",
11
+ componentLink: "componentLink"
11
12
  };
12
13
  export {
13
14
  TestIds as T,