@wix/editor-react-components 1.2288.0 → 1.2289.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/AccordionComponent/component.js +1 -1
- package/dist/site/components/AccordionComponent/manifest.js +1 -1
- package/dist/site/components/AudioPlayer/component.js +5 -1105
- package/dist/site/components/AudioPlayer/manifest.js +1 -1
- package/dist/site/components/Breadcrumbs/component.js +3 -117
- package/dist/site/components/Breadcrumbs/manifest.js +1 -1
- package/dist/site/components/CollapsibleText/component.js +1 -1
- package/dist/site/components/CollapsibleText/manifest.js +1 -1
- package/dist/site/components/DatePicker/DatePicker.d.ts +3 -0
- package/dist/site/components/DatePicker/DatePicker.types.d.ts +91 -0
- package/dist/site/components/DatePicker/component.d.ts +2 -0
- package/dist/site/components/DatePicker/component.js +12181 -0
- package/dist/site/components/DatePicker/component.preview.d.ts +2 -0
- package/dist/site/components/DatePicker/components/DatePickerCalendar.d.ts +5 -0
- package/dist/site/components/DatePicker/components/DatePickerField.d.ts +6 -0
- package/dist/site/components/DatePicker/components/DatePickerLabel.d.ts +6 -0
- package/dist/site/components/DatePicker/components/DatePickerTooltip.d.ts +5 -0
- package/dist/site/components/DatePicker/constants.d.ts +177 -0
- package/dist/site/components/DatePicker/css.css +349 -0
- package/dist/site/components/DatePicker/datePickerUtils.d.ts +26 -0
- package/dist/site/components/DatePicker/hooks/useDateConstraints.d.ts +12 -0
- package/dist/site/components/DatePicker/hooks/useDatePickerValue.d.ts +15 -0
- package/dist/site/components/DatePicker/hooks/useUnavailableDates.d.ts +3 -0
- package/dist/site/components/DatePicker/index.d.ts +2 -0
- package/dist/site/components/DatePicker/index.js +6 -0
- package/dist/site/components/DatePicker/manifest.d.ts +5 -0
- package/dist/site/components/DatePicker/manifest.js +370 -0
- package/dist/site/components/Dropdown/component.js +1 -3
- package/dist/site/components/TextBox/component.js +1 -4
- package/dist/site/components/TextInput/component.js +4 -297
- package/dist/site/components/chunks/Button2.js +1118 -0
- package/dist/site/components/chunks/DismissSmall.js +7 -0
- package/dist/site/components/chunks/Group.js +108 -36
- package/dist/site/components/chunks/I18nProvider.js +32 -2
- package/dist/site/components/chunks/InfoCircleSmall.js +7 -0
- package/dist/site/components/chunks/Input.js +341 -0
- package/dist/site/components/chunks/constants32.js +152 -49
- package/dist/site/components/chunks/constants33.js +53 -71
- package/dist/site/components/chunks/constants34.js +73 -77
- package/dist/site/components/chunks/constants35.js +76 -57
- package/dist/site/components/chunks/constants36.js +72 -0
- package/dist/site/components/chunks/filterDOMProps.js +14 -8
- package/dist/site/components/chunks/useLocalizedStringFormatter.js +122 -0
- package/dist/site/components/extensions.js +53 -48
- package/package.json +3 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as DISPLAY_GROUPS, N as NativeStateType, C as CSS_PROPERTIES, E as ELEMENTS, D as DATA, I as INTERACTIONS, L as LAYOUT, A as Archetype } from "../chunks/chunk-JPMZBG44.js";
|
|
2
2
|
import { b as manifestMouseHover } from "../chunks/manifestSdkMixins.js";
|
|
3
|
-
import { D as DesignStates, a as DisplayNames, s as selectors, b as borderDefaultValue } from "../chunks/
|
|
3
|
+
import { D as DesignStates, a as DisplayNames, s as selectors, b as borderDefaultValue } from "../chunks/constants35.js";
|
|
4
4
|
import manifest$1 from "../Image3/manifest.js";
|
|
5
5
|
import { w as withSpec } from "../chunks/manifest.js";
|
|
6
6
|
import { I as IS_SUPPORT_DESIGN_STATE_SPEC } from "../chunks/specs.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React__default, { useContext, useState, useRef, useMemo, cloneElement, forwardRef, createContext, useCallback, isValidElement, useEffect } from "react";
|
|
3
3
|
import { c as clsx } from "../chunks/clsx.js";
|
|
4
|
-
import {
|
|
5
|
-
import { $ as $
|
|
4
|
+
import { p as $f39a9eba43920ace$export$8dc98ba7eadeaa56, j as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, $ as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f, b as $64fa3d84918910a7$export$29f1550f4b0d4415, g as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, m as $3ef42575df84b30b$export$9d1611c77c2fe928, c as $64fa3d84918910a7$export$fabf2dc03a41866e, f as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "../chunks/filterDOMProps.js";
|
|
5
|
+
import { $ as $cf2482eff2eeeec2$export$f12b703ca79dfbb1 } from "../chunks/useLocalizedStringFormatter.js";
|
|
6
6
|
import { createPortal } from "react-dom";
|
|
7
7
|
import { f as convertA11yKeysToHtmlFormat } from "../chunks/a11y.js";
|
|
8
8
|
import { d as directionStyles } from "../chunks/direction.module.js";
|
|
9
|
-
import { s as semanticClassNames } from "../chunks/
|
|
9
|
+
import { s as semanticClassNames } from "../chunks/constants34.js";
|
|
10
10
|
import { A as AnimatedIcon } from "../chunks/AnimatedIcon.js";
|
|
11
11
|
import { useService } from "@wix/services-manager-react";
|
|
12
12
|
import { d as defineService } from "../chunks/index7.js";
|
|
@@ -70,100 +70,6 @@ function $b5e257d569688ac6$export$535bd6ca7f90a273() {
|
|
|
70
70
|
if (typeof React__default["useSyncExternalStore"] === "function") return React__default["useSyncExternalStore"]($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot);
|
|
71
71
|
return useContext($b5e257d569688ac6$var$IsSSRContext);
|
|
72
72
|
}
|
|
73
|
-
const $a747a10fe70a57da$var$localeSymbol = Symbol.for("react-aria.i18n.locale");
|
|
74
|
-
const $a747a10fe70a57da$var$stringsSymbol = Symbol.for("react-aria.i18n.strings");
|
|
75
|
-
let $a747a10fe70a57da$var$cachedGlobalStrings = void 0;
|
|
76
|
-
class $a747a10fe70a57da$export$c17fa47878dc55b6 {
|
|
77
|
-
constructor(messages, defaultLocale = "en-US") {
|
|
78
|
-
this.strings = Object.fromEntries(Object.entries(messages).filter(([, v]) => v));
|
|
79
|
-
this.defaultLocale = defaultLocale;
|
|
80
|
-
}
|
|
81
|
-
/** Returns a localized string for the given key and locale. */
|
|
82
|
-
getStringForLocale(key, locale) {
|
|
83
|
-
let strings = this.getStringsForLocale(locale);
|
|
84
|
-
let string = strings[key];
|
|
85
|
-
if (!string) throw new Error(`Could not find intl message ${key} in ${locale} locale`);
|
|
86
|
-
return string;
|
|
87
|
-
}
|
|
88
|
-
/** Returns all localized strings for the given locale. */
|
|
89
|
-
getStringsForLocale(locale) {
|
|
90
|
-
let strings = this.strings[locale];
|
|
91
|
-
if (!strings) {
|
|
92
|
-
strings = $a747a10fe70a57da$var$getStringsForLocale(locale, this.strings, this.defaultLocale);
|
|
93
|
-
this.strings[locale] = strings;
|
|
94
|
-
}
|
|
95
|
-
return strings;
|
|
96
|
-
}
|
|
97
|
-
static getGlobalDictionaryForPackage(packageName) {
|
|
98
|
-
if (typeof window === "undefined") return null;
|
|
99
|
-
let locale = window[$a747a10fe70a57da$var$localeSymbol];
|
|
100
|
-
if ($a747a10fe70a57da$var$cachedGlobalStrings === void 0) {
|
|
101
|
-
let globalStrings = window[$a747a10fe70a57da$var$stringsSymbol];
|
|
102
|
-
if (!globalStrings) return null;
|
|
103
|
-
$a747a10fe70a57da$var$cachedGlobalStrings = {};
|
|
104
|
-
for (let pkg in globalStrings) $a747a10fe70a57da$var$cachedGlobalStrings[pkg] = new $a747a10fe70a57da$export$c17fa47878dc55b6({
|
|
105
|
-
[locale]: globalStrings[pkg]
|
|
106
|
-
}, locale);
|
|
107
|
-
}
|
|
108
|
-
let dictionary = $a747a10fe70a57da$var$cachedGlobalStrings == null ? void 0 : $a747a10fe70a57da$var$cachedGlobalStrings[packageName];
|
|
109
|
-
if (!dictionary) throw new Error(`Strings for package "${packageName}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);
|
|
110
|
-
return dictionary;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
function $a747a10fe70a57da$var$getStringsForLocale(locale, strings, defaultLocale = "en-US") {
|
|
114
|
-
if (strings[locale]) return strings[locale];
|
|
115
|
-
let language = $a747a10fe70a57da$var$getLanguage(locale);
|
|
116
|
-
if (strings[language]) return strings[language];
|
|
117
|
-
for (let key in strings) {
|
|
118
|
-
if (key.startsWith(language + "-")) return strings[key];
|
|
119
|
-
}
|
|
120
|
-
return strings[defaultLocale];
|
|
121
|
-
}
|
|
122
|
-
function $a747a10fe70a57da$var$getLanguage(locale) {
|
|
123
|
-
if (Intl.Locale)
|
|
124
|
-
return new Intl.Locale(locale).language;
|
|
125
|
-
return locale.split("-")[0];
|
|
126
|
-
}
|
|
127
|
-
const $b27c684a33948c64$var$pluralRulesCache = /* @__PURE__ */ new Map();
|
|
128
|
-
const $b27c684a33948c64$var$numberFormatCache = /* @__PURE__ */ new Map();
|
|
129
|
-
class $b27c684a33948c64$export$2f817fcdc4b89ae0 {
|
|
130
|
-
constructor(locale, strings) {
|
|
131
|
-
this.locale = locale;
|
|
132
|
-
this.strings = strings;
|
|
133
|
-
}
|
|
134
|
-
/** Formats a localized string for the given key with the provided variables. */
|
|
135
|
-
format(key, variables) {
|
|
136
|
-
let message = this.strings.getStringForLocale(key, this.locale);
|
|
137
|
-
return typeof message === "function" ? message(variables, this) : message;
|
|
138
|
-
}
|
|
139
|
-
plural(count, options, type = "cardinal") {
|
|
140
|
-
let opt = options["=" + count];
|
|
141
|
-
if (opt) return typeof opt === "function" ? opt() : opt;
|
|
142
|
-
let key = this.locale + ":" + type;
|
|
143
|
-
let pluralRules = $b27c684a33948c64$var$pluralRulesCache.get(key);
|
|
144
|
-
if (!pluralRules) {
|
|
145
|
-
pluralRules = new Intl.PluralRules(this.locale, {
|
|
146
|
-
type
|
|
147
|
-
});
|
|
148
|
-
$b27c684a33948c64$var$pluralRulesCache.set(key, pluralRules);
|
|
149
|
-
}
|
|
150
|
-
let selected = pluralRules.select(count);
|
|
151
|
-
opt = options[selected] || options.other;
|
|
152
|
-
return typeof opt === "function" ? opt() : opt;
|
|
153
|
-
}
|
|
154
|
-
number(value) {
|
|
155
|
-
let numberFormat = $b27c684a33948c64$var$numberFormatCache.get(this.locale);
|
|
156
|
-
if (!numberFormat) {
|
|
157
|
-
numberFormat = new Intl.NumberFormat(this.locale);
|
|
158
|
-
$b27c684a33948c64$var$numberFormatCache.set(this.locale, numberFormat);
|
|
159
|
-
}
|
|
160
|
-
return numberFormat.format(value);
|
|
161
|
-
}
|
|
162
|
-
select(options, value) {
|
|
163
|
-
let opt = options[value] || options.other;
|
|
164
|
-
return typeof opt === "function" ? opt() : opt;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
73
|
let $f645667febf57a63$export$f9762fab77588ecb = /* @__PURE__ */ React__default.createContext(null);
|
|
168
74
|
class $23b9f4fcf0fe224b$export$d68d59712b04d9d1 {
|
|
169
75
|
get childNodes() {
|
|
@@ -1123,26 +1029,6 @@ function $7135fc7d473fd974$export$2dbbd341daed716d(collection, node, renderDropI
|
|
|
1123
1029
|
return afterIndicators;
|
|
1124
1030
|
}
|
|
1125
1031
|
const $7135fc7d473fd974$export$4feb769f8ddf26c5 = /* @__PURE__ */ createContext($7135fc7d473fd974$export$a164736487e3f0ae);
|
|
1126
|
-
const $cf2482eff2eeeec2$var$cache = /* @__PURE__ */ new WeakMap();
|
|
1127
|
-
function $cf2482eff2eeeec2$var$getCachedDictionary(strings) {
|
|
1128
|
-
let dictionary = $cf2482eff2eeeec2$var$cache.get(strings);
|
|
1129
|
-
if (!dictionary) {
|
|
1130
|
-
dictionary = new $a747a10fe70a57da$export$c17fa47878dc55b6(strings);
|
|
1131
|
-
$cf2482eff2eeeec2$var$cache.set(strings, dictionary);
|
|
1132
|
-
}
|
|
1133
|
-
return dictionary;
|
|
1134
|
-
}
|
|
1135
|
-
function $cf2482eff2eeeec2$export$87b761675e8eaa10(strings, packageName) {
|
|
1136
|
-
return packageName && $a747a10fe70a57da$export$c17fa47878dc55b6.getGlobalDictionaryForPackage(packageName) || $cf2482eff2eeeec2$var$getCachedDictionary(strings);
|
|
1137
|
-
}
|
|
1138
|
-
function $cf2482eff2eeeec2$export$f12b703ca79dfbb1(strings, packageName) {
|
|
1139
|
-
let { locale } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
|
|
1140
|
-
let dictionary = $cf2482eff2eeeec2$export$87b761675e8eaa10(strings, packageName);
|
|
1141
|
-
return useMemo(() => new $b27c684a33948c64$export$2f817fcdc4b89ae0(locale, dictionary), [
|
|
1142
|
-
locale,
|
|
1143
|
-
dictionary
|
|
1144
|
-
]);
|
|
1145
|
-
}
|
|
1146
1032
|
var $487db6faca3494c5$exports = {};
|
|
1147
1033
|
$487db6faca3494c5$exports = {
|
|
1148
1034
|
"breadcrumbs": `عناصر الواجهة`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { L as LAYOUT, a as ACTIONS, b as DISPLAY_GROUPS, C as CSS_PROPERTIES, E as ELEMENTS, N as NativeStateType, D as DATA, A as Archetype } from "../chunks/chunk-JPMZBG44.js";
|
|
2
2
|
import { w as withSpec, g as getSelector } from "../chunks/manifest.js";
|
|
3
3
|
import { I as IS_SUPPORT_DESIGN_STATE_SPEC } from "../chunks/specs.js";
|
|
4
|
-
import { D as DesignStates, a as DisplayNames, h as homepageModeValues, d as defaultStateValues, b as separatorValues, c as componentMetadata, s as semanticClassNames } from "../chunks/
|
|
4
|
+
import { D as DesignStates, a as DisplayNames, h as homepageModeValues, d as defaultStateValues, b as separatorValues, c as componentMetadata, s as semanticClassNames } from "../chunks/constants34.js";
|
|
5
5
|
import { b as manifestMouseHover } from "../chunks/manifestSdkMixins.js";
|
|
6
6
|
const manifest = {
|
|
7
7
|
id: componentMetadata.id,
|
|
@@ -9,7 +9,7 @@ import { e as getTabIndexAttribute } from "../chunks/a11y.js";
|
|
|
9
9
|
import { a as getDataAttributes } from "../chunks/dataUtils.js";
|
|
10
10
|
import { u as useResizeObserver } from "../chunks/useResizeObserver.js";
|
|
11
11
|
import { d as directionStyles } from "../chunks/direction.module.js";
|
|
12
|
-
import { L as LINE_HEIGHT_ROUNDING_ERROR_TOLERANCE, F as FALLBACK_LINE_HEIGHT, m as manifestClasses, E as ExpandModeValues, T as TestIds, s as semanticClassNames } from "../chunks/
|
|
12
|
+
import { L as LINE_HEIGHT_ROUNDING_ERROR_TOLERANCE, F as FALLBACK_LINE_HEIGHT, m as manifestClasses, E as ExpandModeValues, T as TestIds, s as semanticClassNames } from "../chunks/constants33.js";
|
|
13
13
|
import { B as Button } from "../chunks/Button.js";
|
|
14
14
|
const root = "root__kOEn9";
|
|
15
15
|
const text = "text__rjuUh";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as CSS_PROPERTIES, E as ELEMENTS, D as DATA, b as DISPLAY_GROUPS, L as LAYOUT, I as INTERACTIONS, A as Archetype } from "../chunks/chunk-JPMZBG44.js";
|
|
2
|
-
import { D as DisplayNames, d as defaultValues, m as manifestClasses } from "../chunks/
|
|
2
|
+
import { D as DisplayNames, d as defaultValues, m as manifestClasses } from "../chunks/constants33.js";
|
|
3
3
|
import { g as getSelector } from "../chunks/manifest.js";
|
|
4
4
|
import { b as manifestMouseHover, c as manifestClickable } from "../chunks/manifestSdkMixins.js";
|
|
5
5
|
const manifest = {
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { DateValue } from 'react-aria-components';
|
|
2
|
+
import { A11y, Direction } from '@wix/editor-react-types';
|
|
3
|
+
import { SdkFunctionChangeableProps, SdkFunctionFocusableProps } from '../../../utils/functions/sdkFunctionCallbackProps';
|
|
4
|
+
/** Single date or a start–end range. */
|
|
5
|
+
export type DatePickerSelectionMode = 'single' | 'range';
|
|
6
|
+
/** Smallest editable time unit (React Aria `granularity`). */
|
|
7
|
+
export type DatePickerGranularity = 'day' | 'hour' | 'minute';
|
|
8
|
+
/** A resolved start–end range for the range calendar (or `null` when unset). */
|
|
9
|
+
export type DateRangeValue = {
|
|
10
|
+
start: DateValue;
|
|
11
|
+
end: DateValue;
|
|
12
|
+
} | null;
|
|
13
|
+
/**
|
|
14
|
+
* One blocked span. `from`/`to` are ISO `YYYY-MM-DD` strings (inclusive); a single
|
|
15
|
+
* blocked day sets both to the same date. Comes from the `unavailableDates`
|
|
16
|
+
* arrayItems data.
|
|
17
|
+
*/
|
|
18
|
+
export type UnavailableDateRange = {
|
|
19
|
+
from?: string;
|
|
20
|
+
to?: string;
|
|
21
|
+
};
|
|
22
|
+
export type DatePickerProps = Omit<SdkFunctionChangeableProps, 'onChange'> & SdkFunctionFocusableProps & {
|
|
23
|
+
/** Fires with the selected ISO date string (range mode: the start date). */
|
|
24
|
+
onChange?: (value: string) => void;
|
|
25
|
+
/** Range mode: fires with the selected end date as an ISO string. */
|
|
26
|
+
onEndChange?: (value: string) => void;
|
|
27
|
+
/** DOM `id` on the root `.datePicker` wrapper. */
|
|
28
|
+
id: string;
|
|
29
|
+
/** Appended to the root `.datePicker`. Use this for CSS-variable and per-element overrides. */
|
|
30
|
+
className: string;
|
|
31
|
+
/** Single date or a start–end range. */
|
|
32
|
+
selectionMode: DatePickerSelectionMode;
|
|
33
|
+
/**
|
|
34
|
+
* Smallest editable unit. `day` is date-only; `hour`/`minute` add time
|
|
35
|
+
* segments and make the value an ISO datetime (local wall-clock, no zone).
|
|
36
|
+
*/
|
|
37
|
+
granularity?: DatePickerGranularity;
|
|
38
|
+
/**
|
|
39
|
+
* The selected date as an ISO string — `YYYY-MM-DD`, or `YYYY-MM-DDTHH:MM`
|
|
40
|
+
* with time granularity (range mode: the start date). The empty string means
|
|
41
|
+
* no date is selected.
|
|
42
|
+
*/
|
|
43
|
+
value: string;
|
|
44
|
+
/**
|
|
45
|
+
* Range mode only: the end date as an ISO string (`YYYY-MM-DD`, or
|
|
46
|
+
* `YYYY-MM-DDTHH:MM` with time granularity).
|
|
47
|
+
*/
|
|
48
|
+
endValue?: string;
|
|
49
|
+
/** Optional text label rendered above the field. */
|
|
50
|
+
label: string;
|
|
51
|
+
/** Site-facing helper text rendered under the field. */
|
|
52
|
+
description?: string;
|
|
53
|
+
/** Hint text revealed from an info icon next to the label. */
|
|
54
|
+
tooltip?: string;
|
|
55
|
+
/** Earliest selectable date as an ISO `YYYY-MM-DD` string. */
|
|
56
|
+
minDate?: string;
|
|
57
|
+
/** Latest selectable date as an ISO `YYYY-MM-DD` string. */
|
|
58
|
+
maxDate?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Spans that can't be selected — a list of `{ from, to }` ISO date ranges
|
|
61
|
+
* (inclusive); a single blocked day sets `from` and `to` to the same date.
|
|
62
|
+
* Set via data binding / Velo, not the Settings panel.
|
|
63
|
+
*/
|
|
64
|
+
unavailableDates?: Array<UnavailableDateRange>;
|
|
65
|
+
/** When `false`, dates before today can't be selected (clamps min to today). */
|
|
66
|
+
allowPastDates?: boolean;
|
|
67
|
+
/** When `false`, dates after today can't be selected (clamps max to today). */
|
|
68
|
+
allowFutureDates?: boolean;
|
|
69
|
+
/** Marks the field required for form submission. */
|
|
70
|
+
required?: boolean;
|
|
71
|
+
/** Shows the date but blocks editing. */
|
|
72
|
+
readOnly?: boolean;
|
|
73
|
+
/** Renders a clear (✕) control that empties the value. */
|
|
74
|
+
clearable?: boolean;
|
|
75
|
+
/** Disables interaction with the date picker. */
|
|
76
|
+
isDisabled?: boolean;
|
|
77
|
+
/** Writing direction applied to the root. */
|
|
78
|
+
direction?: Direction;
|
|
79
|
+
/**
|
|
80
|
+
* Editor-only: forces the calendar popover open so the Popover/Calendar/Today
|
|
81
|
+
* design parts are editable on the canvas. Set by the manifest `visibleState`.
|
|
82
|
+
*/
|
|
83
|
+
previewCalendarOpen?: boolean;
|
|
84
|
+
/** Accessibility attributes. `ariaLabel` labels the date picker for assistive tech. */
|
|
85
|
+
a11y?: A11y;
|
|
86
|
+
/** Platform-provided props. */
|
|
87
|
+
wix?: {
|
|
88
|
+
/** Spread on the preset wrapper. */
|
|
89
|
+
presetsWrapperProps?: Record<string, unknown>;
|
|
90
|
+
};
|
|
91
|
+
};
|