@astryxdesign/core 0.7.1 → 0.7.2-canary.3aca324
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/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +38 -14
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +10 -2
- package/dist/Markdown/plugins/frontmatter.d.ts.map +1 -1
- package/dist/Markdown/plugins/frontmatter.js +7 -3
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +22 -8
- package/dist/MultiSelector/OptionActions.a11y.chromium.spec.js +100 -2
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +3 -1
- package/dist/Pagination/Pagination.d.ts +8 -5
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +21 -8
- package/dist/PowerSearch/PowerSearch.js +1 -1
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +6 -2
- package/dist/Switch/Switch.d.ts +1 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +13 -1
- package/dist/Text/useTruncation.d.ts +7 -5
- package/dist/Text/useTruncation.d.ts.map +1 -1
- package/dist/Text/useTruncation.js +16 -5
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +11 -0
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +26 -0
- package/dist/astryx.css +5 -4
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +112 -1
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +112 -1
- package/dist/utils/focusOutline.stylex.d.ts +4 -0
- package/dist/utils/focusOutline.stylex.d.ts.map +1 -1
- package/dist/utils/focusOutline.stylex.js +4 -0
- package/dist/utils/sharedMutationObserver.d.ts +21 -0
- package/dist/utils/sharedMutationObserver.d.ts.map +1 -0
- package/dist/utils/sharedMutationObserver.js +69 -0
- package/locales/en.json +444 -0
- package/locales/pseudo.json +333 -0
- package/package.json +4 -4
- package/src/Button/Button.doc.mjs +2 -2
- package/src/Button/Button.test.tsx +155 -9
- package/src/Button/Button.tsx +39 -16
- package/src/Button/__tests__/Button.a11y.known-failures.ts +1 -62
- package/src/Button/__tests__/Button.a11y.states.ts +0 -10
- package/src/HoverCard/HoverCard.test.tsx +58 -0
- package/src/HoverCard/useHoverCard.tsx +10 -2
- package/src/IconButton/IconButton.doc.mjs +2 -2
- package/src/IconButton/IconButton.test.tsx +3 -1
- package/src/List/ListItem.doc.mjs +8 -5
- package/src/Markdown/plugins/frontmatter.test.tsx +25 -0
- package/src/Markdown/plugins/frontmatter.ts +7 -3
- package/src/MultiSelector/MultiSelector.test.tsx +159 -0
- package/src/MultiSelector/MultiSelector.tsx +40 -7
- package/src/MultiSelector/OptionActions.a11y.chromium.spec.ts +112 -2
- package/src/MultiSelector/hooks.ts +3 -1
- package/src/MultiSelector/useMultiCombobox.doc.mjs +267 -0
- package/src/Pagination/Pagination.doc.mjs +7 -7
- package/src/Pagination/Pagination.spec.md +9 -9
- package/src/Pagination/Pagination.test.tsx +242 -0
- package/src/Pagination/Pagination.tsx +27 -11
- package/src/PowerSearch/PowerSearch.test.tsx +85 -0
- package/src/PowerSearch/PowerSearch.tsx +2 -2
- package/src/Selector/hooks.ts +6 -2
- package/src/Selector/useCombobox.doc.mjs +237 -0
- package/src/Switch/Switch.test.tsx +49 -0
- package/src/Switch/Switch.tsx +11 -0
- package/src/Text/useTruncation.test.tsx +69 -0
- package/src/Text/useTruncation.ts +16 -5
- package/src/Tokenizer/Tokenizer.test.tsx +54 -1
- package/src/Tooltip/useTooltip.test.tsx +13 -0
- package/src/Tooltip/useTooltip.tsx +11 -0
- package/src/Typeahead/BaseTypeahead.tsx +26 -0
- package/src/Typeahead/Typeahead.test.tsx +260 -2
- package/src/i18n/InternationalizationProvider.doc.mjs +8 -0
- package/src/i18n/InternationalizationProvider.spec.md +252 -0
- package/src/i18n/__tests__/InternationalizationProvider.test.tsx +128 -0
- package/src/i18n/generated-locales/en.generated.ts +121 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +121 -0
- package/src/i18n/useTranslator.test.tsx +37 -0
- package/src/utils/focusOutline.stylex.ts +4 -0
- package/src/utils/sharedMutationObserver.test.ts +53 -0
- package/src/utils/sharedMutationObserver.ts +78 -0
package/dist/Switch/Switch.js
CHANGED
|
@@ -291,6 +291,8 @@ export function Switch({
|
|
|
291
291
|
className,
|
|
292
292
|
style,
|
|
293
293
|
ref,
|
|
294
|
+
'aria-describedby': ariaDescribedByProp,
|
|
295
|
+
'aria-labelledby': ariaLabelledByProp,
|
|
294
296
|
...rest
|
|
295
297
|
}) {
|
|
296
298
|
const t = useTranslator();
|
|
@@ -335,7 +337,12 @@ export function Switch({
|
|
|
335
337
|
// Only include descriptionID when the element actually renders.
|
|
336
338
|
// FieldLabel renders the description (with descriptionID) even when the
|
|
337
339
|
// label is visually hidden — it's sr-only, so keep it linked.
|
|
340
|
+
// A consumer's own `aria-describedby` describes the control, so it comes
|
|
341
|
+
// first here rather than landing on the field wrapper via `...rest`.
|
|
338
342
|
const describedByParts = [];
|
|
343
|
+
if (ariaDescribedByProp) {
|
|
344
|
+
describedByParts.push(ariaDescribedByProp);
|
|
345
|
+
}
|
|
339
346
|
if (description) {
|
|
340
347
|
describedByParts.push(descriptionID);
|
|
341
348
|
}
|
|
@@ -382,7 +389,12 @@ export function Switch({
|
|
|
382
389
|
}
|
|
383
390
|
},
|
|
384
391
|
onFocus: onFocus,
|
|
385
|
-
onBlur: onBlur
|
|
392
|
+
onBlur: onBlur
|
|
393
|
+
// A caller's `aria-labelledby` names the control (a visible title
|
|
394
|
+
// elsewhere in the row, for example), so it reaches the input rather
|
|
395
|
+
// than the field wrapper via `...rest`.
|
|
396
|
+
,
|
|
397
|
+
"aria-labelledby": ariaLabelledByProp,
|
|
386
398
|
"aria-describedby": ariaDescribedBy,
|
|
387
399
|
"aria-invalid": status?.type === 'error' ? true : undefined,
|
|
388
400
|
"aria-busy": isBusy || undefined,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file useTruncation.ts
|
|
3
|
-
* @input Uses React hooks, sharedResizeObserver
|
|
3
|
+
* @input Uses React hooks, sharedResizeObserver, sharedMutationObserver
|
|
4
4
|
* @output Exports useTruncation hook for detecting text overflow
|
|
5
5
|
* @position Hook; consumed by Text.tsx, Heading.tsx
|
|
6
6
|
*
|
|
@@ -32,10 +32,12 @@ export interface UseTruncationReturn {
|
|
|
32
32
|
/**
|
|
33
33
|
* Hook for detecting text overflow/truncation.
|
|
34
34
|
*
|
|
35
|
-
* Uses a shared ResizeObserver singleton (via observeResize)
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
35
|
+
* Uses a shared ResizeObserver singleton (via observeResize) for size
|
|
36
|
+
* changes and a shared MutationObserver singleton (via observeContent) for
|
|
37
|
+
* content changes, so even hundreds of table cells create one observer of
|
|
38
|
+
* each kind. Observing content matters because an element whose text changes
|
|
39
|
+
* without resizing (a fixed-width status line) must still be re-measured for
|
|
40
|
+
* the tooltip text and the truncated state to follow the current content.
|
|
39
41
|
*
|
|
40
42
|
* - Single-line: compares scrollWidth > offsetWidth
|
|
41
43
|
* - Multi-line: uses Range.getBoundingClientRect() to measure actual content
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTruncation.d.ts","sourceRoot":"","sources":["../../src/Text/useTruncation.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAAgC,KAAK,WAAW,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useTruncation.d.ts","sourceRoot":"","sources":["../../src/Text/useTruncation.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAAgC,KAAK,WAAW,EAAC,MAAM,OAAO,CAAC;AAItE,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,GAAG,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAE9B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,oBAAoB,GAC5B,mBAAmB,CAmFrB"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file useTruncation.ts
|
|
7
|
-
* @input Uses React hooks, sharedResizeObserver
|
|
7
|
+
* @input Uses React hooks, sharedResizeObserver, sharedMutationObserver
|
|
8
8
|
* @output Exports useTruncation hook for detecting text overflow
|
|
9
9
|
* @position Hook; consumed by Text.tsx, Heading.tsx
|
|
10
10
|
*
|
|
@@ -13,13 +13,16 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { useCallback, useRef, useState } from 'react';
|
|
15
15
|
import { observeResize } from "../utils/sharedResizeObserver.js";
|
|
16
|
+
import { observeContent } from "../utils/sharedMutationObserver.js";
|
|
16
17
|
/**
|
|
17
18
|
* Hook for detecting text overflow/truncation.
|
|
18
19
|
*
|
|
19
|
-
* Uses a shared ResizeObserver singleton (via observeResize)
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* Uses a shared ResizeObserver singleton (via observeResize) for size
|
|
21
|
+
* changes and a shared MutationObserver singleton (via observeContent) for
|
|
22
|
+
* content changes, so even hundreds of table cells create one observer of
|
|
23
|
+
* each kind. Observing content matters because an element whose text changes
|
|
24
|
+
* without resizing (a fixed-width status line) must still be re-measured for
|
|
25
|
+
* the tooltip text and the truncated state to follow the current content.
|
|
23
26
|
*
|
|
24
27
|
* - Single-line: compares scrollWidth > offsetWidth
|
|
25
28
|
* - Multi-line: uses Range.getBoundingClientRect() to measure actual content
|
|
@@ -44,6 +47,7 @@ export function useTruncation(options) {
|
|
|
44
47
|
const [fullText, setFullText] = useState('');
|
|
45
48
|
const elementRef = useRef(null);
|
|
46
49
|
const unobserveRef = useRef(null);
|
|
50
|
+
const unobserveContentRef = useRef(null);
|
|
47
51
|
const checkTruncation = useCallback(element => {
|
|
48
52
|
if (maxLines === 0) {
|
|
49
53
|
setIsTruncated(false);
|
|
@@ -80,6 +84,8 @@ export function useTruncation(options) {
|
|
|
80
84
|
// by element leaves any other observer of the same node untouched.
|
|
81
85
|
unobserveRef.current?.();
|
|
82
86
|
unobserveRef.current = null;
|
|
87
|
+
unobserveContentRef.current?.();
|
|
88
|
+
unobserveContentRef.current = null;
|
|
83
89
|
elementRef.current = element;
|
|
84
90
|
if (element && maxLines > 0) {
|
|
85
91
|
// Observe via shared singleton (if available).
|
|
@@ -92,6 +98,11 @@ export function useTruncation(options) {
|
|
|
92
98
|
} else {
|
|
93
99
|
checkTruncation(element);
|
|
94
100
|
}
|
|
101
|
+
// New text in a box that keeps its size fires no resize, so the
|
|
102
|
+
// captured text and truncated state would otherwise stay stale.
|
|
103
|
+
unobserveContentRef.current = observeContent(element, () => {
|
|
104
|
+
checkTruncation(element);
|
|
105
|
+
});
|
|
95
106
|
} else {
|
|
96
107
|
setIsTruncated(false);
|
|
97
108
|
setFullText('');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/useTooltip.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KA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IAEpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,GAAG,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAE9B;;;OAGG;IACH,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAEtC;;;;OAIG;IACH,cAAc,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAEzC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;;OAOG;IACH,aAAa,EAAE,CACb,QAAQ,EAAE,SAAS,EACnB,KAAK,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,KAC5C,SAAS,CAAC;CAChB;AAyBD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,cAAmB,GAAG,aAAa,CAwXtE"}
|
|
@@ -177,6 +177,17 @@ export function useTooltip(options = {}) {
|
|
|
177
177
|
}, delay);
|
|
178
178
|
}, [isEnabled, isOpen, clearTimeouts, showLayer, delay]);
|
|
179
179
|
|
|
180
|
+
// A show scheduled while the triggers were enabled must not outlive them:
|
|
181
|
+
// disabling also detaches the leave listener that would have cancelled it,
|
|
182
|
+
// so the timer would open a tooltip that nothing ever closes. Only the
|
|
183
|
+
// pending show is dropped; a pending hide still runs.
|
|
184
|
+
useEffect(() => {
|
|
185
|
+
if (!isEnabled && showTimeoutRef.current) {
|
|
186
|
+
clearTimeout(showTimeoutRef.current);
|
|
187
|
+
showTimeoutRef.current = null;
|
|
188
|
+
}
|
|
189
|
+
}, [isEnabled]);
|
|
190
|
+
|
|
180
191
|
// Schedule hide with delay (suppressed when isOpen is true).
|
|
181
192
|
// A small hover bridge (when hideDelay is 0) lets the pointer travel from the
|
|
182
193
|
// trigger onto the tooltip surface without the tooltip vanishing — required
|
|
@@ -1 +1 @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AAC;IAExC;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAEzC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;IAEtD;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC;IAE3B;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAE1C;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE/D;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAoKD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,aAAa,EA82BrB,CAAC,CAAC,SAAS,cAAc,EAC5B,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,KACzB,KAAK,CAAC,YAAY,CAAC"}
|
|
@@ -340,6 +340,32 @@ export const BaseTypeahead = function BaseTypeahead({
|
|
|
340
340
|
sourceGenRef.current = ++searchGenRef.current;
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
+
// The previous source is remembered in state, not a ref, so a render React
|
|
344
|
+
// discards cannot consume the comparison without its state updates.
|
|
345
|
+
const [sourceOfState, setSourceOfState] = useState(searchSource);
|
|
346
|
+
if (sourceOfState !== searchSource) {
|
|
347
|
+
setSourceOfState(searchSource);
|
|
348
|
+
if (isLoading) {
|
|
349
|
+
setIsLoading(false);
|
|
350
|
+
setHasSearched(false);
|
|
351
|
+
}
|
|
352
|
+
loadingRef.current = false;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// When the search source is replaced, any in-flight load from the previous
|
|
356
|
+
// source is abandoned (generation bumped above). Notify the wrapper's busy lane
|
|
357
|
+
// in an effect so external store listeners run safely after commit.
|
|
358
|
+
const isInitialMountRef = useRef(true);
|
|
359
|
+
useEffect(() => {
|
|
360
|
+
if (isInitialMountRef.current) {
|
|
361
|
+
isInitialMountRef.current = false;
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
if (!loadingRef.current) {
|
|
365
|
+
onLoadingChangeRef.current?.(false);
|
|
366
|
+
}
|
|
367
|
+
}, [searchSource]);
|
|
368
|
+
|
|
343
369
|
// Layer for dropdown
|
|
344
370
|
const handleLayerShow = useCallback(() => {
|
|
345
371
|
onOpenChange?.(true);
|
package/dist/astryx.css
CHANGED
|
@@ -1127,6 +1127,7 @@
|
|
|
1127
1127
|
.xd10s4z:not(#\#):not(#\#):not(#\#){margin-inline-start:calc(-1 * var(--border-width))}
|
|
1128
1128
|
.xojxgvx:not(#\#):not(#\#):not(#\#){margin-inline-start:calc(-1 * var(--container-padding-inline-start,0px))}
|
|
1129
1129
|
.x1wim8z0:not(#\#):not(#\#):not(#\#){margin-inline-start:calc(-1 * var(--layout-padding-inner-x,var(--spacing-4)))}
|
|
1130
|
+
.x547jwd:not(#\#):not(#\#):not(#\#){margin-inline-start:calc(-1 * var(--spacing-1))}
|
|
1130
1131
|
.x1s1akpx:not(#\#):not(#\#):not(#\#){margin-inline-start:calc(-1 * var(--spacing-2))}
|
|
1131
1132
|
.x6n8pbd:not(#\#):not(#\#):not(#\#){margin-inline-start:calc((40px - min(var(--spacing-6),40px)) / 2 - var(--spacing-2))}
|
|
1132
1133
|
.xs69w1r:not(#\#):not(#\#):not(#\#){margin-inline-start:calc((40px - min(var(--spacing-6),40px)) / 2 - var(--spacing-3))}
|
|
@@ -1169,14 +1170,14 @@
|
|
|
1169
1170
|
.x1i7u4iq:not(#\#):not(#\#):not(#\#){opacity:var(--_toast-swipe-opacity,1)}
|
|
1170
1171
|
.x1clqncf:not(#\#):not(#\#):not(#\#){order:-1}
|
|
1171
1172
|
.x1g77sc7:not(#\#):not(#\#):not(#\#){order:0}
|
|
1172
|
-
.
|
|
1173
|
+
.x19bwoy8:not(#\#):not(#\#):not(#\#){outline-color:var(--focus-outline-color)}
|
|
1173
1174
|
.x1wfwxd8:not(#\#):not(#\#):not(#\#){outline-offset:0}
|
|
1174
1175
|
.x1kvmbwa:not(#\#):not(#\#):not(#\#){outline-offset:var(--_focus-outline-offset,0)}
|
|
1175
|
-
.
|
|
1176
|
+
.x1eqjuhu:not(#\#):not(#\#):not(#\#){outline-offset:var(--focus-outline-offset)}
|
|
1176
1177
|
.x1t137rt:not(#\#):not(#\#):not(#\#){outline-style:none}
|
|
1177
|
-
.
|
|
1178
|
+
.x9ssot5:not(#\#):not(#\#):not(#\#){outline-style:var(--focus-outline-style)}
|
|
1178
1179
|
.x1k57tk5:not(#\#):not(#\#):not(#\#){outline-width:0}
|
|
1179
|
-
.
|
|
1180
|
+
.xak0ai5:not(#\#):not(#\#):not(#\#){outline-width:var(--focus-outline-width)}
|
|
1180
1181
|
.x9y5y3v:not(#\#):not(#\#):not(#\#){overflow-clip-margin:1px}
|
|
1181
1182
|
.xj0a0fe:not(#\#):not(#\#):not(#\#){overflow-wrap:anywhere}
|
|
1182
1183
|
.x1mzt3pk:not(#\#):not(#\#):not(#\#){overflow-wrap:break-word}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/en.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"en.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/en.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA8jBpD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -139,6 +139,25 @@ const runtimeCatalog = {
|
|
|
139
139
|
'@astryx.listInput.announceReturnedToPosition': '{itemName} returned to position {position, number}.',
|
|
140
140
|
'@astryx.listInput.announceDropped': '{itemName} dropped at position {position, number} of {total, number}.',
|
|
141
141
|
'@astryx.listInput.announceAlreadyAtBoundary': 'This {itemName} is already {boundary, select, first {first} last {last} other {}}.',
|
|
142
|
+
'@astryx.diffViewer.label': 'Diff',
|
|
143
|
+
'@astryx.diffViewer.renamedPath': '{oldPath} → {newPath}',
|
|
144
|
+
'@astryx.diffViewer.statusAdded': 'Added',
|
|
145
|
+
'@astryx.diffViewer.statusDeleted': 'Deleted',
|
|
146
|
+
'@astryx.diffViewer.statusRenamed': 'Renamed',
|
|
147
|
+
'@astryx.diffViewer.addedCount': '+{count, number}',
|
|
148
|
+
'@astryx.diffViewer.removedCount': '−{count, number}',
|
|
149
|
+
'@astryx.diffViewer.stats': '{added, plural, one {# line added} other {# lines added}}, {removed, plural, one {# line removed} other {# lines removed}}',
|
|
150
|
+
'@astryx.diffViewer.added': 'Added',
|
|
151
|
+
'@astryx.diffViewer.removed': 'Removed',
|
|
152
|
+
'@astryx.diffViewer.lineNumberButton': '{side, select, old {Original line {line, number}} other {Changed line {line, number}}}',
|
|
153
|
+
'@astryx.diffViewer.columnOldLine': 'Original line number',
|
|
154
|
+
'@astryx.diffViewer.columnNewLine': 'Changed line number',
|
|
155
|
+
'@astryx.diffViewer.columnChange': 'Change',
|
|
156
|
+
'@astryx.diffViewer.columnCode': 'Code',
|
|
157
|
+
'@astryx.diffViewer.columnOldCode': 'Original code',
|
|
158
|
+
'@astryx.diffViewer.columnNewCode': 'Changed code',
|
|
159
|
+
'@astryx.diffViewer.binary': 'Binary file not shown',
|
|
160
|
+
'@astryx.diffViewer.noChanges': 'No content changes',
|
|
142
161
|
'@astryx.markdownHeadingLinks.copied': 'Link copied',
|
|
143
162
|
'@astryx.markdownHeadingLinks.copy': 'Copy link to {heading}',
|
|
144
163
|
'@astryx.richTextEditor.tabEscapeHint': 'Press Escape then Tab to move focus out of the editor.',
|
|
@@ -417,6 +436,98 @@ const runtimeCatalog = {
|
|
|
417
436
|
'@astryx.transferList.announceSearchResults': '{count, number} {count, plural, one {item} other {items}} found.',
|
|
418
437
|
'@astryx.transferListSelector.apply': 'Apply',
|
|
419
438
|
'@astryx.transferListSelector.cancel': 'Cancel',
|
|
420
|
-
'@astryx.transferListSelector.triggerLabel': '{count, number} selected'
|
|
439
|
+
'@astryx.transferListSelector.triggerLabel': '{count, number} selected',
|
|
440
|
+
'@astryx.emojiPicker.label': 'Emoji',
|
|
441
|
+
'@astryx.emojiPicker.searchLabel': 'Search emoji',
|
|
442
|
+
'@astryx.emojiPicker.frequentlyUsed': 'Frequently used',
|
|
443
|
+
'@astryx.emojiPicker.searchResults': 'Search results',
|
|
444
|
+
'@astryx.emojiPicker.noResults': 'No emoji match “{query}”',
|
|
445
|
+
'@astryx.emojiPicker.loading': 'Loading emoji',
|
|
446
|
+
'@astryx.emojiPicker.loadFailed': "More emoji couldn't be loaded.",
|
|
447
|
+
'@astryx.emojiPicker.groupSmileysEmotion': 'Smileys & emotion',
|
|
448
|
+
'@astryx.emojiPicker.groupPeopleBody': 'People & body',
|
|
449
|
+
'@astryx.emojiPicker.groupAnimalsNature': 'Animals & nature',
|
|
450
|
+
'@astryx.emojiPicker.groupFoodDrink': 'Food & drink',
|
|
451
|
+
'@astryx.emojiPicker.groupTravelPlaces': 'Travel & places',
|
|
452
|
+
'@astryx.emojiPicker.groupActivities': 'Activities',
|
|
453
|
+
'@astryx.emojiPicker.groupObjects': 'Objects',
|
|
454
|
+
'@astryx.emojiPicker.groupSymbols': 'Symbols',
|
|
455
|
+
'@astryx.emojiPicker.groupFlags': 'Flags',
|
|
456
|
+
'@astryx.comments.retry': 'Retry',
|
|
457
|
+
'@astryx.commentComposer.placeholder': 'Write a comment…',
|
|
458
|
+
'@astryx.commentComposer.noAgents': 'No agents',
|
|
459
|
+
'@astryx.commentComposer.agents': 'Agents',
|
|
460
|
+
'@astryx.commentComposer.uploadFailed': "Images couldn't be added",
|
|
461
|
+
'@astryx.commentComposer.imagesOnly': 'Only image files can be added',
|
|
462
|
+
'@astryx.commentComposer.chooseImages': 'Choose images',
|
|
463
|
+
'@astryx.commentComposer.imageAlt': 'Image attachment',
|
|
464
|
+
'@astryx.commentComposer.removeQuote': 'Remove quoted text',
|
|
465
|
+
'@astryx.commentComposer.attachImages': 'Attach images',
|
|
466
|
+
'@astryx.commentComposer.addEmoji': 'Add emoji',
|
|
467
|
+
'@astryx.commentComposer.cancel': 'Cancel',
|
|
468
|
+
'@astryx.comments.actionsLabel': "Actions for {name}'s comment",
|
|
469
|
+
'@astryx.comments.addReaction': 'Add reaction',
|
|
470
|
+
'@astryx.comments.agentBadge': 'Agent',
|
|
471
|
+
'@astryx.comments.agentLogo': '{name} logo',
|
|
472
|
+
'@astryx.comments.chooseReaction': 'Choose a reaction',
|
|
473
|
+
'@astryx.comments.copyLink': 'Copy comment link',
|
|
474
|
+
'@astryx.comments.currentVersion': 'Current version',
|
|
475
|
+
'@astryx.comments.delete': 'Delete',
|
|
476
|
+
'@astryx.comments.deleteDescription': "Delete {name}'s comment? This action cannot be undone.",
|
|
477
|
+
'@astryx.comments.deleteFailed': "This comment couldn't be deleted.",
|
|
478
|
+
'@astryx.comments.deleteFailedRetry': "This comment couldn't be deleted. Try again.",
|
|
479
|
+
'@astryx.comments.deleteTitle': 'Delete comment?',
|
|
480
|
+
'@astryx.comments.edit': 'Edit',
|
|
481
|
+
'@astryx.comments.editFailed': "Your edit couldn't be saved.",
|
|
482
|
+
'@astryx.comments.editPlaceholder': 'Edit comment',
|
|
483
|
+
'@astryx.comments.edited': 'Edited',
|
|
484
|
+
'@astryx.comments.editingContext': 'Editing comment',
|
|
485
|
+
'@astryx.comments.hideReplies': 'Hide replies',
|
|
486
|
+
'@astryx.comments.historyEmptyDescription': 'This comment has no earlier versions.',
|
|
487
|
+
'@astryx.comments.historyEmptyTitle': 'No edit history',
|
|
488
|
+
'@astryx.comments.historyFailed': "Edit history couldn't load",
|
|
489
|
+
'@astryx.comments.historyLoadFailed': "The comment's edit history couldn't be loaded. Try again.",
|
|
490
|
+
'@astryx.comments.historyLoading': 'Loading edit history',
|
|
491
|
+
'@astryx.comments.historySubtitle': 'Comment by {name}',
|
|
492
|
+
'@astryx.comments.historyTitle': 'Edit history',
|
|
493
|
+
'@astryx.comments.linkCopied': 'Comment link copied',
|
|
494
|
+
'@astryx.comments.otherReactors': '{count, plural, one {# other} other {# others}}',
|
|
495
|
+
'@astryx.comments.outdated': 'Outdated',
|
|
496
|
+
'@astryx.comments.reactionCelebrate': 'Celebrate',
|
|
497
|
+
'@astryx.comments.reactionCount': '{reaction}: {count, number}',
|
|
498
|
+
'@astryx.comments.reactionFailed': "Your reaction couldn't be saved.",
|
|
499
|
+
'@astryx.comments.reactionLaugh': 'Haha',
|
|
500
|
+
'@astryx.comments.reactionLike': 'Like',
|
|
501
|
+
'@astryx.comments.reactionLove': 'Love',
|
|
502
|
+
'@astryx.comments.reactionSad': 'Sad',
|
|
503
|
+
'@astryx.comments.reactionWow': 'Wow',
|
|
504
|
+
'@astryx.comments.reopen': 'Reopen',
|
|
505
|
+
'@astryx.comments.reopenFailed': "This thread couldn't be reopened.",
|
|
506
|
+
'@astryx.comments.reply': 'Reply',
|
|
507
|
+
'@astryx.comments.replyFailed': "Your reply couldn't be posted.",
|
|
508
|
+
'@astryx.comments.replyPlaceholder': 'Reply to {name}…',
|
|
509
|
+
'@astryx.comments.replyingContext': 'Replying to {name}',
|
|
510
|
+
'@astryx.comments.resolve': 'Mark as resolved',
|
|
511
|
+
'@astryx.comments.resolveFailed': "This thread couldn't be resolved.",
|
|
512
|
+
'@astryx.comments.resolved': 'Resolved',
|
|
513
|
+
'@astryx.comments.resolvedBy': 'Resolved by {name}',
|
|
514
|
+
'@astryx.comments.retryFailed': "Retrying didn't work.",
|
|
515
|
+
'@astryx.comments.sendFailed': "Couldn't send this comment.",
|
|
516
|
+
'@astryx.comments.threadLabel': 'Thread by {name}',
|
|
517
|
+
'@astryx.comments.unread': 'New',
|
|
518
|
+
'@astryx.comments.unsavedDraft': 'Unsaved draft. Dismiss again to discard it.',
|
|
519
|
+
'@astryx.comments.versionAuthor': 'by {name}',
|
|
520
|
+
'@astryx.comments.viewHistory': 'View edit history',
|
|
521
|
+
'@astryx.comments.viewReplies': 'View {count, plural, one {# reply} other {# replies}}',
|
|
522
|
+
'@astryx.comments.commentsLabel': 'Threads in {label}',
|
|
523
|
+
'@astryx.comments.emptyDescription': 'Start the discussion with a comment.',
|
|
524
|
+
'@astryx.comments.emptyReadOnlyDescription': 'There is no discussion on this item.',
|
|
525
|
+
'@astryx.comments.emptyTitle': 'No comments yet',
|
|
526
|
+
'@astryx.comments.label': 'Comments',
|
|
527
|
+
'@astryx.comments.loadFailed': "Comments couldn't load",
|
|
528
|
+
'@astryx.comments.loadOlder': 'Load earlier comments',
|
|
529
|
+
'@astryx.comments.loading': 'Loading comments',
|
|
530
|
+
'@astryx.comments.olderFailed': "Earlier comments couldn't load",
|
|
531
|
+
'@astryx.comments.postFailed': "Your comment couldn't be posted."
|
|
421
532
|
};
|
|
422
533
|
export default runtimeCatalog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pseudo.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/pseudo.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"pseudo.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/pseudo.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAukBpD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -139,6 +139,25 @@ const runtimeCatalog = {
|
|
|
139
139
|
'@astryx.listInput.announceReturnedToPosition': '⟦{itemName} řéţúřñéð ţó þóšíţíóñ {position, number}.⟧',
|
|
140
140
|
'@astryx.listInput.announceDropped': '⟦{itemName} ðřóþþéð àţ þóšíţíóñ {position, number} óƒ {total, number}.⟧',
|
|
141
141
|
'@astryx.listInput.announceAlreadyAtBoundary': '⟦Ţĥíš {itemName} íš àłřéàðý {boundary, select, first {first} last {last} other {}}.⟧',
|
|
142
|
+
'@astryx.diffViewer.label': '⟦Ð탃⟧',
|
|
143
|
+
'@astryx.diffViewer.renamedPath': '⟦{oldPath} → {newPath}⟧',
|
|
144
|
+
'@astryx.diffViewer.statusAdded': '⟦Àððéð⟧',
|
|
145
|
+
'@astryx.diffViewer.statusDeleted': '⟦Ðéłéţéð⟧',
|
|
146
|
+
'@astryx.diffViewer.statusRenamed': '⟦Řéñàɱéð⟧',
|
|
147
|
+
'@astryx.diffViewer.addedCount': '⟦+{count, number}⟧',
|
|
148
|
+
'@astryx.diffViewer.removedCount': '⟦−{count, number}⟧',
|
|
149
|
+
'@astryx.diffViewer.stats': '⟦{added, plural, one {# line added} other {# lines added}}, {removed, plural, one {# line removed} other {# lines removed}}⟧',
|
|
150
|
+
'@astryx.diffViewer.added': '⟦Àððéð⟧',
|
|
151
|
+
'@astryx.diffViewer.removed': '⟦Řéɱóṽéð⟧',
|
|
152
|
+
'@astryx.diffViewer.lineNumberButton': '⟦{side, select, old {Original line {line, number}} other {Changed line {line, number}}}⟧',
|
|
153
|
+
'@astryx.diffViewer.columnOldLine': '⟦Óříĝíñàł łíñé ñúɱƀéř⟧',
|
|
154
|
+
'@astryx.diffViewer.columnNewLine': '⟦Çĥàñĝéð łíñé ñúɱƀéř⟧',
|
|
155
|
+
'@astryx.diffViewer.columnChange': '⟦Çĥàñĝé⟧',
|
|
156
|
+
'@astryx.diffViewer.columnCode': '⟦Çóðé⟧',
|
|
157
|
+
'@astryx.diffViewer.columnOldCode': '⟦Óříĝíñàł çóðé⟧',
|
|
158
|
+
'@astryx.diffViewer.columnNewCode': '⟦Çĥàñĝéð çóðé⟧',
|
|
159
|
+
'@astryx.diffViewer.binary': '⟦Ɓíñàřý ƒíłé ñóţ šĥóŵñ⟧',
|
|
160
|
+
'@astryx.diffViewer.noChanges': '⟦Ñó çóñţéñţ çĥàñĝéš⟧',
|
|
142
161
|
'@astryx.markdownHeadingLinks.copied': '⟦Łíñķ çóþíéð⟧',
|
|
143
162
|
'@astryx.markdownHeadingLinks.copy': '⟦Çóþý łíñķ ţó {heading}⟧',
|
|
144
163
|
'@astryx.richTextEditor.tabEscapeHint': '⟦Þřéšš Éšçàþé ţĥéñ Ţàƀ ţó ɱóṽé ƒóçúš óúţ óƒ ţĥé éðíţóř.⟧',
|
|
@@ -417,6 +436,98 @@ const runtimeCatalog = {
|
|
|
417
436
|
'@astryx.transferList.announceSearchResults': '⟦{count, number} {count, plural, one {item} other {items}} ƒóúñð.⟧',
|
|
418
437
|
'@astryx.transferListSelector.apply': '⟦Àþþłý⟧',
|
|
419
438
|
'@astryx.transferListSelector.cancel': '⟦Çàñçéł⟧',
|
|
420
|
-
'@astryx.transferListSelector.triggerLabel': '⟦{count, number} šéłéçţéð⟧'
|
|
439
|
+
'@astryx.transferListSelector.triggerLabel': '⟦{count, number} šéłéçţéð⟧',
|
|
440
|
+
'@astryx.emojiPicker.label': '⟦Éɱóĵí⟧',
|
|
441
|
+
'@astryx.emojiPicker.searchLabel': '⟦Šéàřçĥ éɱóĵí⟧',
|
|
442
|
+
'@astryx.emojiPicker.frequentlyUsed': '⟦Ƒřéɋúéñţłý úšéð⟧',
|
|
443
|
+
'@astryx.emojiPicker.searchResults': '⟦Šéàřçĥ řéšúłţš⟧',
|
|
444
|
+
'@astryx.emojiPicker.noResults': '⟦Ñó éɱóĵí ɱàţçĥ “{query}”⟧',
|
|
445
|
+
'@astryx.emojiPicker.loading': '⟦Łóàðíñĝ éɱóĵí⟧',
|
|
446
|
+
'@astryx.emojiPicker.loadFailed': "⟦Ṁóřé éɱóĵí çóúłðñ'ţ ƀé łóàðéð.⟧",
|
|
447
|
+
'@astryx.emojiPicker.groupSmileysEmotion': '⟦Šɱíłéýš & éɱóţíóñ⟧',
|
|
448
|
+
'@astryx.emojiPicker.groupPeopleBody': '⟦Þéóþłé & ƀóðý⟧',
|
|
449
|
+
'@astryx.emojiPicker.groupAnimalsNature': '⟦Àñíɱàłš & ñàţúřé⟧',
|
|
450
|
+
'@astryx.emojiPicker.groupFoodDrink': '⟦Ƒóóð & ðříñķ⟧',
|
|
451
|
+
'@astryx.emojiPicker.groupTravelPlaces': '⟦Ţřàṽéł & þłàçéš⟧',
|
|
452
|
+
'@astryx.emojiPicker.groupActivities': '⟦Àçţíṽíţíéš⟧',
|
|
453
|
+
'@astryx.emojiPicker.groupObjects': '⟦Óƀĵéçţš⟧',
|
|
454
|
+
'@astryx.emojiPicker.groupSymbols': '⟦Šýɱƀółš⟧',
|
|
455
|
+
'@astryx.emojiPicker.groupFlags': '⟦Ƒłàĝš⟧',
|
|
456
|
+
'@astryx.comments.retry': '⟦Řéţřý⟧',
|
|
457
|
+
'@astryx.commentComposer.placeholder': '⟦Ŵříţé à çóɱɱéñţ…⟧',
|
|
458
|
+
'@astryx.commentComposer.noAgents': '⟦Ñó àĝéñţš⟧',
|
|
459
|
+
'@astryx.commentComposer.agents': '⟦Àĝéñţš⟧',
|
|
460
|
+
'@astryx.commentComposer.uploadFailed': "⟦Íɱàĝéš çóúłðñ'ţ ƀé àððéð⟧",
|
|
461
|
+
'@astryx.commentComposer.imagesOnly': '⟦Óñłý íɱàĝé ƒíłéš çàñ ƀé àððéð⟧',
|
|
462
|
+
'@astryx.commentComposer.chooseImages': '⟦Çĥóóšé íɱàĝéš⟧',
|
|
463
|
+
'@astryx.commentComposer.imageAlt': '⟦Íɱàĝé àţţàçĥɱéñţ⟧',
|
|
464
|
+
'@astryx.commentComposer.removeQuote': '⟦Řéɱóṽé ɋúóţéð ţéẋţ⟧',
|
|
465
|
+
'@astryx.commentComposer.attachImages': '⟦Àţţàçĥ íɱàĝéš⟧',
|
|
466
|
+
'@astryx.commentComposer.addEmoji': '⟦Àðð éɱóĵí⟧',
|
|
467
|
+
'@astryx.commentComposer.cancel': '⟦Çàñçéł⟧',
|
|
468
|
+
'@astryx.comments.actionsLabel': "⟦Àçţíóñš ƒóř {name}'š çóɱɱéñţ⟧",
|
|
469
|
+
'@astryx.comments.addReaction': '⟦Àðð řéàçţíóñ⟧',
|
|
470
|
+
'@astryx.comments.agentBadge': '⟦Àĝéñţ⟧',
|
|
471
|
+
'@astryx.comments.agentLogo': '⟦{name} łóĝó⟧',
|
|
472
|
+
'@astryx.comments.chooseReaction': '⟦Çĥóóšé à řéàçţíóñ⟧',
|
|
473
|
+
'@astryx.comments.copyLink': '⟦Çóþý çóɱɱéñţ łíñķ⟧',
|
|
474
|
+
'@astryx.comments.currentVersion': '⟦Çúřřéñţ ṽéřšíóñ⟧',
|
|
475
|
+
'@astryx.comments.delete': '⟦Ðéłéţé⟧',
|
|
476
|
+
'@astryx.comments.deleteDescription': "⟦Ðéłéţé {name}'š çóɱɱéñţ? Ţĥíš àçţíóñ çàññóţ ƀé úñðóñé.⟧",
|
|
477
|
+
'@astryx.comments.deleteFailed': "⟦Ţĥíš çóɱɱéñţ çóúłðñ'ţ ƀé ðéłéţéð.⟧",
|
|
478
|
+
'@astryx.comments.deleteFailedRetry': "⟦Ţĥíš çóɱɱéñţ çóúłðñ'ţ ƀé ðéłéţéð. Ţřý àĝàíñ.⟧",
|
|
479
|
+
'@astryx.comments.deleteTitle': '⟦Ðéłéţé çóɱɱéñţ?⟧',
|
|
480
|
+
'@astryx.comments.edit': '⟦Éðíţ⟧',
|
|
481
|
+
'@astryx.comments.editFailed': "⟦Ýóúř éðíţ çóúłðñ'ţ ƀé šàṽéð.⟧",
|
|
482
|
+
'@astryx.comments.editPlaceholder': '⟦Éðíţ çóɱɱéñţ⟧',
|
|
483
|
+
'@astryx.comments.edited': '⟦Éðíţéð⟧',
|
|
484
|
+
'@astryx.comments.editingContext': '⟦Éðíţíñĝ çóɱɱéñţ⟧',
|
|
485
|
+
'@astryx.comments.hideReplies': '⟦Ĥíðé řéþłíéš⟧',
|
|
486
|
+
'@astryx.comments.historyEmptyDescription': '⟦Ţĥíš çóɱɱéñţ ĥàš ñó éàřłíéř ṽéřšíóñš.⟧',
|
|
487
|
+
'@astryx.comments.historyEmptyTitle': '⟦Ñó éðíţ ĥíšţóřý⟧',
|
|
488
|
+
'@astryx.comments.historyFailed': "⟦Éðíţ ĥíšţóřý çóúłðñ'ţ łóàð⟧",
|
|
489
|
+
'@astryx.comments.historyLoadFailed': "⟦Ţĥé çóɱɱéñţ'š éðíţ ĥíšţóřý çóúłðñ'ţ ƀé łóàðéð. Ţřý àĝàíñ.⟧",
|
|
490
|
+
'@astryx.comments.historyLoading': '⟦Łóàðíñĝ éðíţ ĥíšţóřý⟧',
|
|
491
|
+
'@astryx.comments.historySubtitle': '⟦Çóɱɱéñţ ƀý {name}⟧',
|
|
492
|
+
'@astryx.comments.historyTitle': '⟦Éðíţ ĥíšţóřý⟧',
|
|
493
|
+
'@astryx.comments.linkCopied': '⟦Çóɱɱéñţ łíñķ çóþíéð⟧',
|
|
494
|
+
'@astryx.comments.otherReactors': '⟦{count, plural, one {# other} other {# others}}⟧',
|
|
495
|
+
'@astryx.comments.outdated': '⟦Óúţðàţéð⟧',
|
|
496
|
+
'@astryx.comments.reactionCelebrate': '⟦Çéłéƀřàţé⟧',
|
|
497
|
+
'@astryx.comments.reactionCount': '⟦{reaction}: {count, number}⟧',
|
|
498
|
+
'@astryx.comments.reactionFailed': "⟦Ýóúř řéàçţíóñ çóúłðñ'ţ ƀé šàṽéð.⟧",
|
|
499
|
+
'@astryx.comments.reactionLaugh': '⟦Ĥàĥà⟧',
|
|
500
|
+
'@astryx.comments.reactionLike': '⟦Łíķé⟧',
|
|
501
|
+
'@astryx.comments.reactionLove': '⟦Łóṽé⟧',
|
|
502
|
+
'@astryx.comments.reactionSad': '⟦Šàð⟧',
|
|
503
|
+
'@astryx.comments.reactionWow': '⟦Ŵóŵ⟧',
|
|
504
|
+
'@astryx.comments.reopen': '⟦Řéóþéñ⟧',
|
|
505
|
+
'@astryx.comments.reopenFailed': "⟦Ţĥíš ţĥřéàð çóúłðñ'ţ ƀé řéóþéñéð.⟧",
|
|
506
|
+
'@astryx.comments.reply': '⟦Řéþłý⟧',
|
|
507
|
+
'@astryx.comments.replyFailed': "⟦Ýóúř řéþłý çóúłðñ'ţ ƀé þóšţéð.⟧",
|
|
508
|
+
'@astryx.comments.replyPlaceholder': '⟦Řéþłý ţó {name}…⟧',
|
|
509
|
+
'@astryx.comments.replyingContext': '⟦Řéþłýíñĝ ţó {name}⟧',
|
|
510
|
+
'@astryx.comments.resolve': '⟦Ṁàřķ àš řéšółṽéð⟧',
|
|
511
|
+
'@astryx.comments.resolveFailed': "⟦Ţĥíš ţĥřéàð çóúłðñ'ţ ƀé řéšółṽéð.⟧",
|
|
512
|
+
'@astryx.comments.resolved': '⟦Řéšółṽéð⟧',
|
|
513
|
+
'@astryx.comments.resolvedBy': '⟦Řéšółṽéð ƀý {name}⟧',
|
|
514
|
+
'@astryx.comments.retryFailed': "⟦Řéţřýíñĝ ðíðñ'ţ ŵóřķ.⟧",
|
|
515
|
+
'@astryx.comments.sendFailed': "⟦Çóúłðñ'ţ šéñð ţĥíš çóɱɱéñţ.⟧",
|
|
516
|
+
'@astryx.comments.threadLabel': '⟦Ţĥřéàð ƀý {name}⟧',
|
|
517
|
+
'@astryx.comments.unread': '⟦Ñéŵ⟧',
|
|
518
|
+
'@astryx.comments.unsavedDraft': '⟦Úñšàṽéð ðřàƒţ. Ðíšɱíšš àĝàíñ ţó ðíšçàřð íţ.⟧',
|
|
519
|
+
'@astryx.comments.versionAuthor': '⟦ƀý {name}⟧',
|
|
520
|
+
'@astryx.comments.viewHistory': '⟦Ṽíéŵ éðíţ ĥíšţóřý⟧',
|
|
521
|
+
'@astryx.comments.viewReplies': '⟦Ṽíéŵ {count, plural, one {# reply} other {# replies}}⟧',
|
|
522
|
+
'@astryx.comments.commentsLabel': '⟦Ţĥřéàðš íñ {label}⟧',
|
|
523
|
+
'@astryx.comments.emptyDescription': '⟦Šţàřţ ţĥé ðíšçúššíóñ ŵíţĥ à çóɱɱéñţ.⟧',
|
|
524
|
+
'@astryx.comments.emptyReadOnlyDescription': '⟦Ţĥéřé íš ñó ðíšçúššíóñ óñ ţĥíš íţéɱ.⟧',
|
|
525
|
+
'@astryx.comments.emptyTitle': '⟦Ñó çóɱɱéñţš ýéţ⟧',
|
|
526
|
+
'@astryx.comments.label': '⟦Çóɱɱéñţš⟧',
|
|
527
|
+
'@astryx.comments.loadFailed': "⟦Çóɱɱéñţš çóúłðñ'ţ łóàð⟧",
|
|
528
|
+
'@astryx.comments.loadOlder': '⟦Łóàð éàřłíéř çóɱɱéñţš⟧',
|
|
529
|
+
'@astryx.comments.loading': '⟦Łóàðíñĝ çóɱɱéñţš⟧',
|
|
530
|
+
'@astryx.comments.olderFailed': "⟦Éàřłíéř çóɱɱéñţš çóúłðñ'ţ łóàð⟧",
|
|
531
|
+
'@astryx.comments.postFailed': "⟦Ýóúř çóɱɱéñţ çóúłðñ'ţ ƀé þóšţéð.⟧"
|
|
421
532
|
};
|
|
422
533
|
export default runtimeCatalog;
|
|
@@ -44,6 +44,10 @@ export declare const FOCUS_OUTLINE: string;
|
|
|
44
44
|
* independently overridable — and every part stays a var, so a theme's
|
|
45
45
|
* `--focus-outline-*` overrides still flow through.
|
|
46
46
|
*
|
|
47
|
+
* NOT usable inside another file's `stylex.create`, for the same reason as
|
|
48
|
+
* {@link FOCUS_OUTLINE}: StyleX compiles each member there to a CSS variable
|
|
49
|
+
* nothing defines. Compose the `focusVars` tokens instead.
|
|
50
|
+
*
|
|
47
51
|
* Keys are camelCase to match `HTMLElement.style`, so this spreads straight
|
|
48
52
|
* onto an element:
|
|
49
53
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusOutline.stylex.d.ts","sourceRoot":"","sources":["../../src/utils/focusOutline.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,QAAyE,CAAC;AAgBpG
|
|
1
|
+
{"version":3,"file":"focusOutline.stylex.d.ts","sourceRoot":"","sources":["../../src/utils/focusOutline.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,QAAyE,CAAC;AAgBpG;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC;AAEX,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB;;;;;CAK3B,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiG7B,CAAC;AAIH,KAAK,cAAc,GAAG,OAAO,CAAC;AAiB9B,eAAO,MAAM,iBAAiB;uCAdT,cAAc,EAAE;;;;;;;sCAAhB,cAAc,EAAE;;;;;;;gDAAhB,cAAc,EAAE;;;;;;;qCAAhB,cAAc,EAAE;;;;;;;kDAAhB,cAAc,EAAE;;;;;;;iDAAhB,cAAc,EAAE;;;;;;;CA2B3B,CAAC"}
|
|
@@ -69,6 +69,10 @@ const focusOutlineLonghands = {
|
|
|
69
69
|
* independently overridable — and every part stays a var, so a theme's
|
|
70
70
|
* `--focus-outline-*` overrides still flow through.
|
|
71
71
|
*
|
|
72
|
+
* NOT usable inside another file's `stylex.create`, for the same reason as
|
|
73
|
+
* {@link FOCUS_OUTLINE}: StyleX compiles each member there to a CSS variable
|
|
74
|
+
* nothing defines. Compose the `focusVars` tokens instead.
|
|
75
|
+
*
|
|
72
76
|
* Keys are camelCase to match `HTMLElement.style`, so this spreads straight
|
|
73
77
|
* onto an element:
|
|
74
78
|
*
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file sharedMutationObserver.ts
|
|
3
|
+
* @input MutationObserver API
|
|
4
|
+
* @output Exports observeContent for shared content-change observation
|
|
5
|
+
* @position Internal utility; consumed by useTruncation. The content-change
|
|
6
|
+
* counterpart of sharedResizeObserver: one observer for every element, so a
|
|
7
|
+
* repeated cell or row path does not create one observer per instance.
|
|
8
|
+
*/
|
|
9
|
+
type ContentCallback = () => void;
|
|
10
|
+
/**
|
|
11
|
+
* Call `callback` when the element's text or children change (including
|
|
12
|
+
* descendants). Returns an unsubscribe that removes only this registration.
|
|
13
|
+
*
|
|
14
|
+
* MutationObserver has no per-target unobserve, so a released element stays
|
|
15
|
+
* registered with the shared observer until no element remains; its records
|
|
16
|
+
* match no callback and are ignored. The observer disconnects and is released
|
|
17
|
+
* when the last registration goes.
|
|
18
|
+
*/
|
|
19
|
+
export declare function observeContent(element: Element, callback: ContentCallback): () => void;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=sharedMutationObserver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sharedMutationObserver.d.ts","sourceRoot":"","sources":["../../src/utils/sharedMutationObserver.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,KAAK,eAAe,GAAG,MAAM,IAAI,CAAC;AAuBlC;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,eAAe,GACxB,MAAM,IAAI,CA6BZ"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file sharedMutationObserver.ts
|
|
7
|
+
* @input MutationObserver API
|
|
8
|
+
* @output Exports observeContent for shared content-change observation
|
|
9
|
+
* @position Internal utility; consumed by useTruncation. The content-change
|
|
10
|
+
* counterpart of sharedResizeObserver: one observer for every element, so a
|
|
11
|
+
* repeated cell or row path does not create one observer per instance.
|
|
12
|
+
*/
|
|
13
|
+
const OPTIONS = {
|
|
14
|
+
characterData: true,
|
|
15
|
+
childList: true,
|
|
16
|
+
subtree: true
|
|
17
|
+
};
|
|
18
|
+
let observer = null;
|
|
19
|
+
const callbacks = new Map();
|
|
20
|
+
function dispatch(records) {
|
|
21
|
+
// One call per callback per batch, however many records it received. A
|
|
22
|
+
// record's target can be any descendant, so walk up to the observed roots.
|
|
23
|
+
const pending = new Set();
|
|
24
|
+
for (const record of records) {
|
|
25
|
+
for (let node = record.target; node; node = node.parentNode) {
|
|
26
|
+
callbacks.get(node)?.forEach(callback => pending.add(callback));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
pending.forEach(callback => callback());
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Call `callback` when the element's text or children change (including
|
|
34
|
+
* descendants). Returns an unsubscribe that removes only this registration.
|
|
35
|
+
*
|
|
36
|
+
* MutationObserver has no per-target unobserve, so a released element stays
|
|
37
|
+
* registered with the shared observer until no element remains; its records
|
|
38
|
+
* match no callback and are ignored. The observer disconnects and is released
|
|
39
|
+
* when the last registration goes.
|
|
40
|
+
*/
|
|
41
|
+
export function observeContent(element, callback) {
|
|
42
|
+
if (typeof MutationObserver === 'undefined') {
|
|
43
|
+
return () => {};
|
|
44
|
+
}
|
|
45
|
+
observer ??= new MutationObserver(dispatch);
|
|
46
|
+
const existing = callbacks.get(element);
|
|
47
|
+
if (existing) {
|
|
48
|
+
existing.add(callback);
|
|
49
|
+
} else {
|
|
50
|
+
callbacks.set(element, new Set([callback]));
|
|
51
|
+
observer.observe(element, OPTIONS);
|
|
52
|
+
}
|
|
53
|
+
let isSubscribed = true;
|
|
54
|
+
return () => {
|
|
55
|
+
if (!isSubscribed) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
isSubscribed = false;
|
|
59
|
+
const targetCallbacks = callbacks.get(element);
|
|
60
|
+
targetCallbacks?.delete(callback);
|
|
61
|
+
if (targetCallbacks?.size === 0) {
|
|
62
|
+
callbacks.delete(element);
|
|
63
|
+
}
|
|
64
|
+
if (callbacks.size === 0 && observer) {
|
|
65
|
+
observer.disconnect();
|
|
66
|
+
observer = null;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|