@wix/editor-react-components 1.2562.0 → 1.2564.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.
@@ -2,16 +2,20 @@ import { VectorArt, A11y, Direction } from '@wix/editor-react-types';
2
2
  import { ReactNode } from 'react';
3
3
  import { PagesToShare } from './constants';
4
4
  import { SdkFunctionMouseHoverProps } from '../../../utils/functions/sdkFunctionCallbackProps';
5
+ export type ShareButtonInlineElementProps = {
6
+ className?: string;
7
+ };
5
8
  export type ShareButtonElementProps = {
6
- button?: {
7
- className?: string;
8
- };
9
- label?: {
10
- className?: string;
11
- };
12
- icon?: {
13
- className?: string;
9
+ button?: ShareButtonInlineElementProps & {
10
+ elementProps?: {
11
+ label?: ShareButtonInlineElementProps;
12
+ icon?: ShareButtonInlineElementProps;
13
+ };
14
14
  };
15
+ /** @deprecated Replaced by `button.elementProps.label`. Kept so existing sites keep resolving their persisted overrides. */
16
+ label?: ShareButtonInlineElementProps;
17
+ /** @deprecated Replaced by `button.elementProps.icon`. Kept so existing sites keep resolving their persisted overrides. */
18
+ icon?: ShareButtonInlineElementProps;
15
19
  };
16
20
  export type ShareButtonsProps = Partial<any> & SdkFunctionMouseHoverProps & {
17
21
  onClick?: () => void;
@@ -302,18 +302,21 @@ const ShareButton = ({
302
302
  translations,
303
303
  elementProps
304
304
  }) => {
305
- var _a, _b, _c;
305
+ var _a, _b, _c, _d, _e, _f;
306
+ const buttonElementProps = (_a = elementProps == null ? void 0 : elementProps.button) == null ? void 0 : _a.elementProps;
306
307
  const iconClassName = clsx(
307
308
  shareButtonStyles.icon,
308
309
  "icon",
309
- (_a = elementProps == null ? void 0 : elementProps.icon) == null ? void 0 : _a.className
310
+ (_b = elementProps == null ? void 0 : elementProps.icon) == null ? void 0 : _b.className,
311
+ (_c = buttonElementProps == null ? void 0 : buttonElementProps.icon) == null ? void 0 : _c.className
310
312
  );
311
313
  const labelClassName = clsx(
312
314
  shareButtonStyles.label,
313
315
  "label",
314
- (_b = elementProps == null ? void 0 : elementProps.label) == null ? void 0 : _b.className
316
+ (_d = elementProps == null ? void 0 : elementProps.label) == null ? void 0 : _d.className,
317
+ (_e = buttonElementProps == null ? void 0 : buttonElementProps.label) == null ? void 0 : _e.className
315
318
  );
316
- const buttonClassName = (_c = elementProps == null ? void 0 : elementProps.button) == null ? void 0 : _c.className;
319
+ const buttonClassName = (_f = elementProps == null ? void 0 : elementProps.button) == null ? void 0 : _f.className;
317
320
  const platformIdWithFallback = getPlatformIdWithFallback(platformId, value);
318
321
  const translatedCopyLinkLabel = translations == null ? void 0 : translations[label2];
319
322
  const buttonLabel = platformIdWithFallback === platformIds.copyButton && translatedCopyLinkLabel ? translatedCopyLinkLabel : label2;
@@ -97,6 +97,19 @@ export declare const DisplayNames: {
97
97
  };
98
98
  };
99
99
  };
100
+ export declare const elementKeys: {
101
+ readonly button: "button";
102
+ readonly label: "label";
103
+ readonly icon: "icon";
104
+ };
105
+ export declare const StaticDisplayFilters: {
106
+ data: {
107
+ hide: string[];
108
+ };
109
+ elements: {
110
+ hide: ("label" | "icon")[];
111
+ };
112
+ };
100
113
  export declare const DesignStates: {
101
114
  readonly button: {
102
115
  readonly hover: {
@@ -1,5 +1,5 @@
1
- import { N as NativeStateType, C as CSS_PROPERTIES, E as ELEMENTS, a as ACTIONS, D as DATA, I as INTERACTIONS, L as LAYOUT, A as Archetype } from "../chunks/chunk-IO6HLVLV.js";
2
- import { h as DesignStates, i as DisplayNames, j as DisplayConfig, D as DefaultValues, I as IconPositionOptions, k as PageToShareOptions, m as DefaultButtons, B as ButtonWidthOptions } from "../chunks/constants22.js";
1
+ import { C as CSS_PROPERTIES, N as NativeStateType, E as ELEMENTS, a as ACTIONS, D as DATA, I as INTERACTIONS, L as LAYOUT, A as Archetype } from "../chunks/chunk-IO6HLVLV.js";
2
+ import { h as elementKeys, i as DesignStates, j as DisplayNames, k as DisplayConfig, D as DefaultValues, I as IconPositionOptions, S as StaticDisplayFilters, m as PageToShareOptions, o as DefaultButtons, B as ButtonWidthOptions } from "../chunks/constants22.js";
3
3
  import { c as manifestMouseHover } from "../chunks/manifestSdkMixins.js";
4
4
  import { w as withSpec } from "../chunks/manifest.js";
5
5
  import { I as IS_SUPPORT_DESIGN_STATE_SPEC } from "../chunks/specs.js";
@@ -7,6 +7,26 @@ const presets = {
7
7
  horizontal: "horizontal",
8
8
  vertical: "vertical"
9
9
  };
10
+ const textPartCssProperties = {
11
+ font: {},
12
+ color: {},
13
+ letterSpacing: {
14
+ defaultValue: "0em"
15
+ },
16
+ textDecorationLine: {
17
+ statesDefaultValues: { hover: "underline" }
18
+ },
19
+ textTransform: {}
20
+ };
21
+ const iconPartCssCustomProperties = {
22
+ "icon-size": {
23
+ displayName: DisplayNames.icon.cssCustomProperties["icon-size"],
24
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.length
25
+ },
26
+ "icon-rotation": {
27
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.angle
28
+ }
29
+ };
10
30
  const manifest = {
11
31
  id: "b1e2c3d4-5f6a-7b8c-9d0e-1f2a3b4c5d6e",
12
32
  type: "wixEditorElements.ShareButtons",
@@ -226,12 +246,10 @@ const manifest = {
226
246
  }
227
247
  },
228
248
  displayFilters: {
229
- data: {
230
- hide: ["buttons"]
231
- }
249
+ ...StaticDisplayFilters
232
250
  },
233
251
  elements: {
234
- button: {
252
+ [elementKeys.button]: {
235
253
  elementType: ELEMENTS.ELEMENT_TYPE.inlineElement,
236
254
  inlineElement: {
237
255
  displayName: DisplayNames.button.elementDisplayName,
@@ -276,10 +294,65 @@ const manifest = {
276
294
  className: DesignStates.button.hover.className,
277
295
  pseudoClass: NativeStateType.hover
278
296
  })
297
+ },
298
+ elements: {
299
+ [elementKeys.label]: {
300
+ elementType: ELEMENTS.ELEMENT_TYPE.inlineElement,
301
+ inlineElement: {
302
+ displayName: DisplayNames.label.elementDisplayName,
303
+ selector: ".button .label",
304
+ behaviors: {
305
+ removable: true,
306
+ selectable: false
307
+ },
308
+ cssProperties: {
309
+ display: {
310
+ display: DisplayConfig
311
+ },
312
+ ...textPartCssProperties
313
+ },
314
+ states: {
315
+ hover: withSpec({
316
+ spec: IS_SUPPORT_DESIGN_STATE_SPEC,
317
+ displayName: DesignStates.label.hover.displayName,
318
+ className: DesignStates.label.hover.className,
319
+ pseudoClass: NativeStateType.hover
320
+ })
321
+ }
322
+ }
323
+ },
324
+ [elementKeys.icon]: {
325
+ elementType: ELEMENTS.ELEMENT_TYPE.inlineElement,
326
+ inlineElement: {
327
+ displayName: DisplayNames.icon.elementDisplayName,
328
+ selector: ".button .icon",
329
+ behaviors: {
330
+ removable: true,
331
+ selectable: false
332
+ },
333
+ cssProperties: {
334
+ display: {
335
+ display: DisplayConfig
336
+ }
337
+ },
338
+ cssCustomProperties: {
339
+ ...iconPartCssCustomProperties
340
+ },
341
+ states: {
342
+ hover: withSpec({
343
+ spec: IS_SUPPORT_DESIGN_STATE_SPEC,
344
+ displayName: DesignStates.icon.hover.displayName,
345
+ className: DesignStates.icon.hover.className,
346
+ pseudoClass: NativeStateType.hover
347
+ })
348
+ }
349
+ }
350
+ }
279
351
  }
280
352
  }
281
353
  },
282
- label: {
354
+ // Deprecated: replaced by the nested button.elements.label part. Kept so existing sites keep resolving their persisted overrides.
355
+ [elementKeys.label]: {
283
356
  elementType: ELEMENTS.ELEMENT_TYPE.inlineElement,
284
357
  inlineElement: {
285
358
  displayName: DisplayNames.label.elementDisplayName,
@@ -293,15 +366,7 @@ const manifest = {
293
366
  defaultValue: "inline-block",
294
367
  display: DisplayConfig
295
368
  },
296
- font: {},
297
- color: {},
298
- letterSpacing: {
299
- defaultValue: "0em"
300
- },
301
- textDecorationLine: {
302
- statesDefaultValues: { hover: "underline" }
303
- },
304
- textTransform: {}
369
+ ...textPartCssProperties
305
370
  },
306
371
  states: {
307
372
  hover: withSpec({
@@ -313,7 +378,8 @@ const manifest = {
313
378
  }
314
379
  }
315
380
  },
316
- icon: {
381
+ // Deprecated: replaced by the nested button.elements.icon part. Kept so existing sites keep resolving their persisted overrides.
382
+ [elementKeys.icon]: {
317
383
  elementType: ELEMENTS.ELEMENT_TYPE.inlineElement,
318
384
  inlineElement: {
319
385
  displayName: DisplayNames.icon.elementDisplayName,
@@ -329,13 +395,7 @@ const manifest = {
329
395
  }
330
396
  },
331
397
  cssCustomProperties: {
332
- "icon-size": {
333
- displayName: DisplayNames.icon.cssCustomProperties["icon-size"],
334
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.length
335
- },
336
- "icon-rotation": {
337
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.angle
338
- }
398
+ ...iconPartCssCustomProperties
339
399
  },
340
400
  states: {
341
401
  hover: withSpec({
@@ -111,6 +111,15 @@ const DisplayNames = {
111
111
  }
112
112
  }
113
113
  };
114
+ const elementKeys = {
115
+ button: "button",
116
+ label: "label",
117
+ icon: "icon"
118
+ };
119
+ const StaticDisplayFilters = {
120
+ data: { hide: ["buttons"] },
121
+ elements: { hide: [elementKeys.label, elementKeys.icon] }
122
+ };
114
123
  const DesignStates = {
115
124
  button: {
116
125
  hover: { displayName: "Hover", className: "share-buttons__button--hover" }
@@ -294,6 +303,7 @@ export {
294
303
  HAS_CUSTOM_FOCUS_CLASSNAME as H,
295
304
  IconPositionOptions as I,
296
305
  PagesToShare as P,
306
+ StaticDisplayFilters as S,
297
307
  TOOLTIP_SUCCESS_TEXT as T,
298
308
  TOOLTIP_FAILED_TEXT as a,
299
309
  linkCopiedTranslationKey as b,
@@ -302,13 +312,14 @@ export {
302
312
  TestIds as e,
303
313
  TranslationKeys as f,
304
314
  shareUrlPrefixes as g,
305
- DesignStates as h,
306
- DisplayNames as i,
307
- DisplayConfig as j,
308
- PageToShareOptions as k,
315
+ elementKeys as h,
316
+ DesignStates as i,
317
+ DisplayNames as j,
318
+ DisplayConfig as k,
309
319
  linkCopiedFailedTranslationKey as l,
310
- DefaultButtons as m,
320
+ PageToShareOptions as m,
311
321
  noButtonsErrorMessage as n,
322
+ DefaultButtons as o,
312
323
  platformIds as p,
313
324
  sharerData as s,
314
325
  translationKeys as t,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/editor-react-components",
3
- "version": "1.2562.0",
3
+ "version": "1.2564.0",
4
4
  "description": "React components for the Wix Editor",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -84,7 +84,7 @@
84
84
  "@wix/site-service-business-logger": "^1.0.0",
85
85
  "@wix/site-service-configuration": "^1.0.1",
86
86
  "@wix/site-service-rendering-context": "^1.0.1",
87
- "@wix/site-ui": "1.238.0",
87
+ "@wix/site-ui": "1.240.0",
88
88
  "@wix/video": "^1.106.0",
89
89
  "@wix/viewer-service-consent-policy": "^1.0.101",
90
90
  "@wix/web-bi-logger": "^2.1.29",
@@ -199,5 +199,5 @@
199
199
  "registry": "https://registry.npmjs.org/",
200
200
  "access": "public"
201
201
  },
202
- "falconPackageHash": "d51825f08663affd8594dfcbc2ab6aec0ae82de3b9871fbbe1f92ace"
202
+ "falconPackageHash": "7856aad79fc45322b5fdae0379972b8f3892236d0603869540f54bde"
203
203
  }