@wix/editor-react-components 1.2403.0 → 1.2404.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.
@@ -3,13 +3,15 @@ var __defNormalProp = (obj, key2, value2) => key2 in obj ? __defProp(obj, key2,
3
3
  var __publicField = (obj, key2, value2) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value2);
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { c as clsx } from "../chunks/clsx.js";
6
+ import { useService } from "@wix/services-manager-react";
7
+ import { T as TranslationsDefinition } from "../chunks/index5.js";
6
8
  import { d as directionStyles } from "../chunks/direction.module.js";
9
+ import { g as getTranslation } from "../chunks/getTranslation.js";
7
10
  import { B as Button } from "../chunks/Button.js";
8
- import { s as semanticSelectors, r as rootDataDefaults, d as displayPropertyToObserve, a as ariaLabels, t as testIds, p as pauseIconSvg, b as playIconSvg, c as showButtonOnHoverDefaults } from "../chunks/constants28.js";
11
+ import { s as semanticSelectors, r as rootDataDefaults, d as displayPropertyToObserve, A as ARIA_LABEL_NAMESPACE, t as testIds, p as pauseIconSvg, a as playIconSvg, b as showButtonOnHoverDefaults, D as DefaultTranslations, T as TranslationKeys } from "../chunks/constants28.js";
9
12
  import { g as getDefaultExportFromCjs } from "../chunks/_commonjsHelpers.js";
10
13
  import React__default, { useEffect, useState, useRef, useMemo } from "react";
11
14
  import { f as convertA11yKeysToHtmlFormat } from "../chunks/a11y.js";
12
- import { useService } from "@wix/services-manager-react";
13
15
  import { E as EnvironmentDefinition } from "../chunks/index2.js";
14
16
  var lottie$2 = { exports: {} };
15
17
  var lottie$1 = lottie$2.exports;
@@ -17091,6 +17093,9 @@ const isIOS = (win) => {
17091
17093
  return /iPad|iPhone|iPod/.test(platform) || platform === "MacIntel" && /Macintosh/.test(userAgent) && (((_c = win == null ? void 0 : win.navigator) == null ? void 0 : _c.maxTouchPoints) ?? 0) > 1;
17092
17094
  };
17093
17095
  const Lottie = (props) => {
17096
+ const { translate } = useService(TranslationsDefinition);
17097
+ const translateByKey = translate(ARIA_LABEL_NAMESPACE);
17098
+ const t = (key2) => getTranslation(translateByKey, key2, TranslationKeys, DefaultTranslations);
17094
17099
  const {
17095
17100
  id,
17096
17101
  className,
@@ -17155,7 +17160,7 @@ const Lottie = (props) => {
17155
17160
  type: "button",
17156
17161
  "data-testid": testIds.animationClickWrapper,
17157
17162
  className: styles.animationClickWrapper,
17158
- "aria-label": isPlaying ? ariaLabels.pauseButton : ariaLabels.playButton,
17163
+ "aria-label": isPlaying ? t("pauseButton") : t("playButton"),
17159
17164
  "aria-controls": id,
17160
17165
  onClick: isPlaying ? handlePause : handleResume,
17161
17166
  children: /* @__PURE__ */ jsx(
@@ -17196,7 +17201,7 @@ const Lottie = (props) => {
17196
17201
  styles.playButton
17197
17202
  ),
17198
17203
  a11y: {
17199
- ariaLabel: isPlaying ? ariaLabels.pauseButton : ariaLabels.playButton,
17204
+ ariaLabel: isPlaying ? t("pauseButton") : t("playButton"),
17200
17205
  ariaControls: id
17201
17206
  },
17202
17207
  onClick: isPlaying ? handlePause : handleResume,
@@ -3,7 +3,12 @@ export declare const semanticSelectors: {
3
3
  readonly root: "lottie";
4
4
  readonly playButton: "playButton";
5
5
  };
6
- export declare const ariaLabels: {
6
+ export declare const ARIA_LABEL_NAMESPACE = "lottie";
7
+ export declare const TranslationKeys: {
8
+ readonly playButton: "lottie_aria_label_play";
9
+ readonly pauseButton: "lottie_aria_label_pause";
10
+ };
11
+ export declare const DefaultTranslations: {
7
12
  readonly playButton: "Play animation";
8
13
  readonly pauseButton: "Pause animation";
9
14
  };
@@ -1,6 +1,6 @@
1
1
  import { b as DISPLAY_GROUPS, E as ELEMENTS, D as DATA, L as LAYOUT, A as Archetype } from "../chunks/chunk-V7QOLP3D.js";
2
2
  import { g as getSelector } from "../chunks/manifest.js";
3
- import { e as speedConstraints, f as playButtonDefaults, D as DisplayNames, r as rootDataDefaults, c as showButtonOnHoverDefaults, g as borderDefaultValue, i as initialSize, s as semanticSelectors } from "../chunks/constants28.js";
3
+ import { c as speedConstraints, e as playButtonDefaults, f as DisplayNames, r as rootDataDefaults, b as showButtonOnHoverDefaults, g as borderDefaultValue, i as initialSize, s as semanticSelectors } from "../chunks/constants28.js";
4
4
  import { m as manifestFocusable, c as manifestMouseHover, d as manifestClickable } from "../chunks/manifestSdkMixins.js";
5
5
  const manifest = {
6
6
  id: "13165477-8205-4050-b078-424a1479159e",
@@ -181,9 +181,15 @@ const manifest = {
181
181
  client: {
182
182
  componentUrl: "./site/components/Lottie/component.tsx",
183
183
  moduleSpecifier: "@wix/editor-react-components/Lottie",
184
- serviceDependencies: ["@wix/viewer-service-environment"],
184
+ serviceDependencies: [
185
+ "@wix/viewer-service-environment",
186
+ "@wix/viewer-service-translations"
187
+ ],
185
188
  dependencies: {
186
- serviceDependencies: ["@wix/viewer-service-environment"],
189
+ serviceDependencies: [
190
+ "@wix/viewer-service-environment",
191
+ "@wix/viewer-service-translations"
192
+ ],
187
193
  componentDependencies: [
188
194
  "@wix/editor-react-components/Button",
189
195
  "@wix/editor-react-components/AnimatedIcon"
@@ -1,12 +1,14 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { useState, useRef, useEffect, useCallback, useMemo } from "react";
3
3
  import { c as clsx } from "../chunks/clsx.js";
4
- import { M as MOVEMENT_DIRECTION, A as AUTOPLAY_STATE, s as slideshowDataDefaults, a as semanticClassNames, S as SLIDESHOW_SLIDE_LTR_DIRECTION_EXPERIMENT } from "../chunks/Slideshow.semanticClassNames.js";
4
+ import { M as MOVEMENT_DIRECTION, A as AUTOPLAY_STATE, s as slideshowDataDefaults, a as semanticClassNames, b as ARIA_LABEL_NAMESPACE, S as SLIDESHOW_SLIDE_LTR_DIRECTION_EXPERIMENT, D as DefaultTranslations, T as TranslationKeys } from "../chunks/Slideshow.semanticClassNames.js";
5
5
  import { B as Button } from "../chunks/Button.js";
6
6
  import { p as presetWrapperStyles } from "../chunks/presetWrapper.module.js";
7
7
  import { d as directionStyles } from "../chunks/direction.module.js";
8
8
  import { useService } from "@wix/services-manager-react";
9
9
  import { E as EnvironmentDefinition } from "../chunks/index2.js";
10
+ import { T as TranslationsDefinition } from "../chunks/index5.js";
11
+ import { g as getTranslation } from "../chunks/getTranslation.js";
10
12
  const validateActiveSlide = (activeSlide, slidesLength) => {
11
13
  if (activeSlide === void 0) {
12
14
  return void 0;
@@ -544,6 +546,9 @@ const Slideshow = (props) => {
544
546
  onMouseOut
545
547
  } = props;
546
548
  const environmentService = useService(EnvironmentDefinition);
549
+ const { translate } = useService(TranslationsDefinition);
550
+ const translateByKey = translate(ARIA_LABEL_NAMESPACE);
551
+ const t = (key) => getTranslation(translateByKey, key, TranslationKeys, DefaultTranslations);
547
552
  const siteDirection = environmentService.getLanguageDirection();
548
553
  const isSlideLtrDirectionOpen = ((_a = environmentService == null ? void 0 : environmentService.isExperimentOpen) == null ? void 0 : _a.call(
549
554
  environmentService,
@@ -752,8 +757,8 @@ const Slideshow = (props) => {
752
757
  onResume: () => {
753
758
  setIsPaused(false);
754
759
  },
755
- pauseAriaLabel: "Pause Slideshow",
756
- resumeAriaLabel: "Play Slideshow",
760
+ pauseAriaLabel: t("pauseButton"),
761
+ resumeAriaLabel: t("playButton"),
757
762
  className: semanticClassNames.pauseButton,
758
763
  ariaControls: id
759
764
  }
@@ -145,6 +145,15 @@ export declare const navigationButtonsArrangementFields: readonly ["navigation-b
145
145
  export declare const navigationButtonsAlignmentFields: readonly ["navigation-buttons-alignment"];
146
146
  export declare const slideIndicatorsPositionFields: readonly ["slide-indicators-position-horizontal", "slide-indicators-position-vertical"];
147
147
  export declare const iconPlacementFields: readonly ["icon-placement-horizontal", "icon-placement-vertical"];
148
+ export declare const ARIA_LABEL_NAMESPACE = "slideshow";
149
+ export declare const TranslationKeys: {
150
+ readonly pauseButton: "slideshow_aria_label_pause";
151
+ readonly playButton: "slideshow_aria_label_play";
152
+ };
153
+ export declare const DefaultTranslations: {
154
+ readonly pauseButton: "Pause Slideshow";
155
+ readonly playButton: "Play Slideshow";
156
+ };
148
157
  export declare const AUTOPLAY_STATE: {
149
158
  readonly RUNNING: "running";
150
159
  readonly CANCELLED: "cancelled";
@@ -1,6 +1,6 @@
1
1
  import { E as ELEMENTS, C as CSS_PROPERTIES, D as DATA, a as ACTIONS, I as INTERACTIONS, b as DISPLAY_GROUPS, L as LAYOUT, c as ContainerType, A as Archetype } from "../chunks/chunk-V7QOLP3D.js";
2
2
  import { g as getSelector } from "../chunks/manifest.js";
3
- import { D as DisplayNames, a as semanticClassNames, b as slideshowCssCustomPropertiesDefaults, c as slideshowCssPropertiesDefaults, s as slideshowDataDefaults } from "../chunks/Slideshow.semanticClassNames.js";
3
+ import { c as DisplayNames, a as semanticClassNames, d as slideshowCssCustomPropertiesDefaults, e as slideshowCssPropertiesDefaults, s as slideshowDataDefaults } from "../chunks/Slideshow.semanticClassNames.js";
4
4
  import { c as manifestMouseHover, d as manifestClickable, a as manifestChangeable } from "../chunks/manifestSdkMixins.js";
5
5
  const navigationButtons = {
6
6
  elementType: ELEMENTS.ELEMENT_TYPE.refElement,
@@ -1043,9 +1043,15 @@ const manifest = {
1043
1043
  client: {
1044
1044
  componentUrl: "./site/components/Slideshow/component.tsx",
1045
1045
  moduleSpecifier: "@wix/editor-react-components/Slideshow",
1046
- serviceDependencies: ["@wix/viewer-service-environment"],
1046
+ serviceDependencies: [
1047
+ "@wix/viewer-service-environment",
1048
+ "@wix/viewer-service-translations"
1049
+ ],
1047
1050
  dependencies: {
1048
- serviceDependencies: ["@wix/viewer-service-environment"]
1051
+ serviceDependencies: [
1052
+ "@wix/viewer-service-environment",
1053
+ "@wix/viewer-service-translations"
1054
+ ]
1049
1055
  }
1050
1056
  },
1051
1057
  editor: {
@@ -9,6 +9,7 @@ import { useService } from "@wix/services-manager-react";
9
9
  import { E as EnvironmentDefinition } from "../chunks/index2.js";
10
10
  import { T as TranslationsDefinition } from "../chunks/index5.js";
11
11
  import { a as getDataAttributes } from "../chunks/dataUtils.js";
12
+ import { g as getTranslation } from "../chunks/getTranslation.js";
12
13
  import { d as directionStyles } from "../chunks/direction.module.js";
13
14
  import { p as presetWrapperStyles } from "../chunks/presetWrapper.module.js";
14
15
  import { E as EMPTY_VALUE, T as TestIds, s as selectors, a as TRANSLATIONS_NAMESPACE, d as defaultValues, V as VALUE_MISSING_MESSAGE, H as HourCycleValues, D as DefaultTranslations, b as TranslationKeys } from "../chunks/constants2.js";
@@ -16,11 +17,6 @@ import { u as useValidatedField } from "../chunks/useValidatedField.js";
16
17
  import { R as RequiredIndicator } from "../chunks/RequiredIndicator.js";
17
18
  import { D as DismissSmall_default } from "../chunks/DismissSmall.js";
18
19
  import { I as InfoCircleSmall_default } from "../chunks/InfoCircleSmall.js";
19
- const getTranslation = (translate, key, translationKeys, defaultTranslations) => {
20
- const translationKey = translationKeys[key];
21
- const translated = translate(translationKey);
22
- return translated && translated !== translationKey ? translated : defaultTranslations[key];
23
- };
24
20
  const timePicker = "timePicker__j78My";
25
21
  const root = "root__dzkbY";
26
22
  const labelRow = "labelRow__qoC8g";
@@ -133,6 +133,15 @@ const slideshowCssCustomPropertiesDefaults = {
133
133
  "navigation-buttons-alignment": "center",
134
134
  "controls-padding": "0px"
135
135
  };
136
+ const ARIA_LABEL_NAMESPACE = "slideshow";
137
+ const TranslationKeys = {
138
+ pauseButton: "slideshow_aria_label_pause",
139
+ playButton: "slideshow_aria_label_play"
140
+ };
141
+ const DefaultTranslations = {
142
+ pauseButton: "Pause Slideshow",
143
+ playButton: "Play Slideshow"
144
+ };
136
145
  const AUTOPLAY_STATE = {
137
146
  RUNNING: "running",
138
147
  CANCELLED: "cancelled",
@@ -153,11 +162,14 @@ const semanticClassNames = {
153
162
  };
154
163
  export {
155
164
  AUTOPLAY_STATE as A,
156
- DisplayNames as D,
165
+ DefaultTranslations as D,
157
166
  MOVEMENT_DIRECTION as M,
158
167
  SLIDESHOW_SLIDE_LTR_DIRECTION_EXPERIMENT as S,
168
+ TranslationKeys as T,
159
169
  semanticClassNames as a,
160
- slideshowCssCustomPropertiesDefaults as b,
161
- slideshowCssPropertiesDefaults as c,
170
+ ARIA_LABEL_NAMESPACE as b,
171
+ DisplayNames as c,
172
+ slideshowCssCustomPropertiesDefaults as d,
173
+ slideshowCssPropertiesDefaults as e,
162
174
  slideshowDataDefaults as s
163
175
  };
@@ -2,7 +2,12 @@ const semanticSelectors = {
2
2
  root: "lottie",
3
3
  playButton: "playButton"
4
4
  };
5
- const ariaLabels = {
5
+ const ARIA_LABEL_NAMESPACE = "lottie";
6
+ const TranslationKeys = {
7
+ playButton: "lottie_aria_label_play",
8
+ pauseButton: "lottie_aria_label_pause"
9
+ };
10
+ const DefaultTranslations = {
6
11
  playButton: "Play animation",
7
12
  pauseButton: "Pause animation"
8
13
  };
@@ -72,13 +77,15 @@ const pauseIconSvg = {
72
77
  svgContent: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><rect x="5" y="3" width="5" height="17" rx="1"/><rect x="14" y="3" width="5" height="17" rx="1"/></svg>'
73
78
  };
74
79
  export {
75
- DisplayNames as D,
76
- ariaLabels as a,
77
- playIconSvg as b,
78
- showButtonOnHoverDefaults as c,
80
+ ARIA_LABEL_NAMESPACE as A,
81
+ DefaultTranslations as D,
82
+ TranslationKeys as T,
83
+ playIconSvg as a,
84
+ showButtonOnHoverDefaults as b,
85
+ speedConstraints as c,
79
86
  displayPropertyToObserve as d,
80
- speedConstraints as e,
81
- playButtonDefaults as f,
87
+ playButtonDefaults as e,
88
+ DisplayNames as f,
82
89
  borderDefaultValue as g,
83
90
  initialSize as i,
84
91
  pauseIconSvg as p,
@@ -0,0 +1,8 @@
1
+ const getTranslation = (translate, key, translationKeys, defaultTranslations) => {
2
+ const translationKey = translationKeys[key];
3
+ const translated = translate(translationKey);
4
+ return translated && translated !== translationKey ? translated : defaultTranslations[key];
5
+ };
6
+ export {
7
+ getTranslation as g
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/editor-react-components",
3
- "version": "1.2403.0",
3
+ "version": "1.2404.0",
4
4
  "description": "React components for the Wix Editor",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -196,5 +196,5 @@
196
196
  "registry": "https://registry.npmjs.org/",
197
197
  "access": "public"
198
198
  },
199
- "falconPackageHash": "9dc34d1fbcba762cc1f539f641ede974289aa96d03b7f33b5c2e7b91"
199
+ "falconPackageHash": "2db9c3dbeb4de16a7d6820ce6ef78eb3e8e8c2bb8df54db01f2886e6"
200
200
  }