@astryxdesign/core 0.6.1 → 0.6.2-canary.2b2113d
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/CHANGELOG.md +33 -0
- package/dist/BottomSheet/BottomSheet.d.ts +1 -1
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +3 -1
- package/dist/BottomSheet/BottomSheetPanel.d.ts +7 -5
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +56 -19
- package/dist/DateRangeInput/DateRangeInput.d.ts +3 -0
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +16 -9
- package/dist/Dialog/DialogHeader.d.ts +1 -1
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +10 -7
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +9 -3
- package/dist/Markdown/Markdown.d.ts +10 -2
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +58 -14
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.d.ts.map +1 -1
- package/dist/Markdown/parser.d.ts +126 -12
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +369 -34
- package/dist/Markdown/utils.d.ts +1 -1
- package/dist/Markdown/utils.d.ts.map +1 -1
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +5 -2
- package/dist/Spinner/Spinner.d.ts +1 -1
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +23 -15
- package/dist/astryx.css +5 -2
- package/dist/hooks/scrollKeyboardDelegation.d.ts +3 -0
- package/dist/hooks/scrollKeyboardDelegation.d.ts.map +1 -0
- package/dist/hooks/scrollKeyboardDelegation.js +146 -0
- package/dist/hooks/useScrollableArea.d.ts +6 -2
- package/dist/hooks/useScrollableArea.d.ts.map +1 -1
- package/dist/hooks/useScrollableArea.js +17 -5
- package/locales/en.json +16 -0
- package/locales/pseudo.json +12 -0
- package/package.json +7 -5
- package/scripts/agent-doc-state.mjs +1 -1
- package/src/BottomSheet/BottomSheet.doc.mjs +8 -1
- package/src/BottomSheet/BottomSheet.spec.md +46 -20
- package/src/BottomSheet/BottomSheet.test.tsx +6 -3
- package/src/BottomSheet/BottomSheet.tsx +3 -1
- package/src/BottomSheet/BottomSheetKeyboard.test.tsx +195 -0
- package/src/BottomSheet/BottomSheetPanel.test.tsx +11 -1
- package/src/BottomSheet/BottomSheetPanel.tsx +49 -16
- package/src/BottomSheet/__tests__/BottomSheetKeyboard.a11y.browser.spec.ts +344 -0
- package/src/DateRangeInput/DateRangeInput.doc.mjs +35 -7
- package/src/DateRangeInput/DateRangeInput.spec.md +203 -0
- package/src/DateRangeInput/DateRangeInput.test.tsx +100 -4
- package/src/DateRangeInput/DateRangeInput.tsx +29 -20
- package/src/Dialog/Dialog.doc.mjs +3 -0
- package/src/Dialog/Dialog.spec.md +1 -1
- package/src/Dialog/DialogHeader.doc.mjs +38 -0
- package/src/Dialog/DialogHeader.test.tsx +49 -0
- package/src/Dialog/DialogHeader.tsx +23 -4
- package/src/Dialog/modules/DialogHeader.spec.md +152 -0
- package/src/FileInput/FileInput.doc.mjs +2 -0
- package/src/FileInput/FileInput.spec.md +199 -0
- package/src/FileInput/FileInput.test.tsx +14 -0
- package/src/FileInput/FileInput.tsx +13 -3
- package/src/Markdown/Markdown.doc.mjs +167 -42
- package/src/Markdown/Markdown.public.test.ts +157 -0
- package/src/Markdown/Markdown.spec.md +149 -70
- package/src/Markdown/Markdown.test.tsx +107 -3
- package/src/Markdown/Markdown.tsx +116 -35
- package/src/Markdown/incremental.test.ts +175 -7
- package/src/Markdown/index.ts +6 -0
- package/src/Markdown/parser.perf.test.ts +3 -1
- package/src/Markdown/parser.test.ts +122 -0
- package/src/Markdown/parser.ts +609 -81
- package/src/Markdown/utils.ts +6 -0
- package/src/ScrollableArea/modules/useScrollableArea.spec.md +50 -22
- package/src/Slider/Slider.doc.mjs +16 -0
- package/src/Slider/Slider.spec.md +61 -47
- package/src/Slider/Slider.test.tsx +18 -0
- package/src/Slider/Slider.tsx +12 -6
- package/src/Spinner/Spinner.doc.mjs +6 -3
- package/src/Spinner/Spinner.test.tsx +37 -0
- package/src/Spinner/Spinner.tsx +31 -14
- package/src/hooks/scrollKeyboardDelegation.test.ts +155 -0
- package/src/hooks/scrollKeyboardDelegation.ts +233 -0
- package/src/hooks/useScrollableArea.doc.mjs +15 -3
- package/src/hooks/useScrollableArea.test.tsx +59 -1
- package/src/hooks/useScrollableArea.ts +34 -10
- package/src/theme/derivedVarRegistry.test.ts +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @xds/core
|
|
2
2
|
|
|
3
|
+
# 0.6.2
|
|
4
|
+
|
|
5
|
+
#### New Features
|
|
6
|
+
|
|
7
|
+
- Markdown: add an opt-in math renderer (#6312)
|
|
8
|
+
Supply `components.math` to parse `$…$` inline math and `$$…$$` display math. The renderer receives the delimiter-free expression as `value` and its placement as `display: 'inline' | 'block'`, so applications can connect their preferred math typesetter without preprocessing Markdown or accepting raw HTML.
|
|
9
|
+
|
|
10
|
+
Math is off unless the renderer is present. Direct parser callers can opt in with `MathParseOptions` (`{math: true}`) and incremental callers create `IncrementalParseState<true>` via `createIncrementalState<true>()`. Those overloads return `InlineNodeWithMath` or `BlockNodeWithMath`; default, legacy-set, `math: false`, and `ParseOptions`- annotated calls retain the existing `InlineNode` and `BlockNode` unions, so exhaustive consumers do not gain a case unless they opt in. Existing Markdown parsing and rendering stay unchanged by default; code stays opaque, escaped and unmatched delimiters stay literal, and inline plugins skip math. Incremental parsing preserves full-parse results when display math is nested in ordinary or task lists and blockquotes, including quote-depth transitions, with LF or CRLF and with source ranges enabled.
|
|
11
|
+
|
|
12
|
+
- DialogHeader exposes theme targets for its header gap, title/subtitle gap, and close-icon size. (#6240)
|
|
13
|
+
- Expose DateRangeInput preset theming targets (#6223)
|
|
14
|
+
- Expose the Slider interactive control as a theme target (#6225)
|
|
15
|
+
- Expose FileInput's upload icon as a mode-aware theme target (#5417)
|
|
16
|
+
- Add a `--spinner-arc-fraction` public var to Spinner, so a theme can change how much of the ring the moving arc covers (defaults to 0.375, a 135deg sweep), the same way it already retheme diameter, stroke width, and color. (#5845)
|
|
17
|
+
|
|
18
|
+
#### Fixes
|
|
19
|
+
|
|
20
|
+
- Adds the `@astryx.chatTypingIndicator.*` catalog keys so the lab ChatTypingIndicator can build its typing status from the translation runtime instead of English literals, joining names with `Intl.ListFormat` for the active locale. English output is unchanged. (#6220)
|
|
21
|
+
- Spinner: the default assistive label now comes from the translation catalog (`@astryx.spinner.loading`) instead of a literal `"Loading"` in component source, so a localized app translates the status. An explicit `aria-label` and a visible string label still take precedence, in that order. (#6217)
|
|
22
|
+
|
|
23
|
+
#### Contributors
|
|
24
|
+
|
|
25
|
+
Thanks to everyone who contributed to this release:
|
|
26
|
+
|
|
27
|
+
- @athz
|
|
28
|
+
- @cixzhang
|
|
29
|
+
- @freddymeta
|
|
30
|
+
- @HelloOjasMutreja
|
|
31
|
+
- @ksying
|
|
32
|
+
- @Kyujenius
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
3
36
|
# 0.6.1
|
|
4
37
|
|
|
5
38
|
#### New Features
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file BottomSheet.tsx
|
|
3
|
-
* @input Uses React, StyleX, core hooks/utils, BottomSheetPanel, BottomSheetSwitcherContext
|
|
3
|
+
* @input Uses React, StyleX, core hooks/utils, named BottomSheetPanel, BottomSheetSwitcherContext
|
|
4
4
|
* @output Exports BottomSheet component and BottomSheetProps
|
|
5
5
|
* @position Public BottomSheet router plus private standalone/switcher hosts
|
|
6
6
|
*
|
|
@@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ACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC9C,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAED,UAAU,wBAAyB,SAAQ,sBAAsB;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED,MAAM,MAAM,gBAAgB,GAC1B,0BAA0B,GAAG,wBAAwB,CAAC;AA8XxD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BA6BlD;yBA7Be,WAAW"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file BottomSheet.tsx
|
|
7
|
-
* @input Uses React, StyleX, core hooks/utils, BottomSheetPanel, BottomSheetSwitcherContext
|
|
7
|
+
* @input Uses React, StyleX, core hooks/utils, named BottomSheetPanel, BottomSheetSwitcherContext
|
|
8
8
|
* @output Exports BottomSheet component and BottomSheetProps
|
|
9
9
|
* @position Public BottomSheet router plus private standalone/switcher hosts
|
|
10
10
|
*
|
|
@@ -266,6 +266,7 @@ function StandaloneBottomSheet({
|
|
|
266
266
|
ref: ref,
|
|
267
267
|
state: panelState,
|
|
268
268
|
height: height,
|
|
269
|
+
label: label,
|
|
269
270
|
snapPoints: snapPoints,
|
|
270
271
|
isSwipeDismissAllowed: purpose === 'info',
|
|
271
272
|
isPageScrollLocked: shouldPresent && hasScrim,
|
|
@@ -397,6 +398,7 @@ function SwitcherBottomSheetItem({
|
|
|
397
398
|
ref: ref,
|
|
398
399
|
state: panelState,
|
|
399
400
|
height: height,
|
|
401
|
+
label: label,
|
|
400
402
|
snapPoints: snapPoints,
|
|
401
403
|
isSwipeDismissAllowed: purpose === 'info',
|
|
402
404
|
isPageScrollLocked: hasScrim,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file BottomSheetPanel.tsx
|
|
3
|
-
* @input Uses React, StyleX, theme tokens,
|
|
4
|
-
* @output Internal BottomSheetPanel
|
|
3
|
+
* @input Uses React, StyleX, theme tokens, sheet gestures, shared scroll behavior, and the host label
|
|
4
|
+
* @output Internal BottomSheetPanel with a keyboard-reachable scrolling body and motion-state types
|
|
5
5
|
* @position Shared presentation layer for standalone and switcher BottomSheets
|
|
6
6
|
*
|
|
7
7
|
* This component owns everything intrinsic to a sheet surface: height budgets,
|
|
8
8
|
* drag and snap gestures, the handle and scrolling body, motion styles, and
|
|
9
|
-
* transition completion. It
|
|
10
|
-
* state,
|
|
9
|
+
* transition completion. It owns the body's keyboard access; dialog focus
|
|
10
|
+
* entry/return, inert state, and switcher registration belong to the host.
|
|
11
11
|
*
|
|
12
12
|
* SYNC: When modified, update these files to stay in sync:
|
|
13
13
|
* - /packages/core/src/BottomSheet/BottomSheet.tsx
|
|
@@ -44,6 +44,8 @@ interface BottomSheetPanelProps extends BaseProps<HTMLDivElement> {
|
|
|
44
44
|
ref?: React.Ref<HTMLDivElement>;
|
|
45
45
|
state: BottomSheetPanelState;
|
|
46
46
|
height: BottomSheetHeight | number | string;
|
|
47
|
+
/** Existing host name, reused for the keyboard scrolling group. */
|
|
48
|
+
label: string;
|
|
47
49
|
children: ReactNode;
|
|
48
50
|
snapPoints?: ReadonlyArray<BottomSheetSnapPoint>;
|
|
49
51
|
isSwipeDismissAllowed?: boolean;
|
|
@@ -56,7 +58,7 @@ interface BottomSheetPanelProps extends BaseProps<HTMLDivElement> {
|
|
|
56
58
|
onMotionComplete?: (motion: BottomSheetPanelMotion) => void;
|
|
57
59
|
}
|
|
58
60
|
/** Internal visual and gesture surface shared by every BottomSheet host. */
|
|
59
|
-
export declare function BottomSheetPanel({ ref, state, height, children, snapPoints, className, style, tabIndex, xstyle, isSwipeDismissAllowed, isPageScrollLocked, onDismiss, onScrimOpacity, onElementChange, onMotionStart, onMotionComplete, ...props }: BottomSheetPanelProps): import("react").JSX.Element;
|
|
61
|
+
export declare function BottomSheetPanel({ ref, state, height, label, children, snapPoints, className, style, tabIndex, xstyle, isSwipeDismissAllowed, isPageScrollLocked, onDismiss, onScrimOpacity, onElementChange, onMotionStart, onMotionComplete, ...props }: BottomSheetPanelProps): import("react").JSX.Element;
|
|
60
62
|
export declare namespace BottomSheetPanel {
|
|
61
63
|
var displayName: string;
|
|
62
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetPanel.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetPanel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"BottomSheetPanel.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetPanel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAiB5C,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AAIvB,QAAA,MAAM,cAAc;;;;CAIV,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,cAAc,CAAC;AAC5D,YAAY,EAAC,oBAAoB,EAAC,CAAC;AAsMnC,MAAM,MAAM,sBAAsB,GAChC,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEjD,MAAM,MAAM,qBAAqB,GAC7B;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAC,GAChB;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,Q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GAAG,KAAK,EACT,EAAE,qBAAqB,+BAyRvB;yBA5Se,gBAAgB"}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file BottomSheetPanel.tsx
|
|
7
|
-
* @input Uses React, StyleX, theme tokens,
|
|
8
|
-
* @output Internal BottomSheetPanel
|
|
7
|
+
* @input Uses React, StyleX, theme tokens, sheet gestures, shared scroll behavior, and the host label
|
|
8
|
+
* @output Internal BottomSheetPanel with a keyboard-reachable scrolling body and motion-state types
|
|
9
9
|
* @position Shared presentation layer for standalone and switcher BottomSheets
|
|
10
10
|
*
|
|
11
11
|
* This component owns everything intrinsic to a sheet surface: height budgets,
|
|
12
12
|
* drag and snap gestures, the handle and scrolling body, motion styles, and
|
|
13
|
-
* transition completion. It
|
|
14
|
-
* state,
|
|
13
|
+
* transition completion. It owns the body's keyboard access; dialog focus
|
|
14
|
+
* entry/return, inert state, and switcher registration belong to the host.
|
|
15
15
|
*
|
|
16
16
|
* SYNC: When modified, update these files to stay in sync:
|
|
17
17
|
* - /packages/core/src/BottomSheet/BottomSheet.tsx
|
|
@@ -23,9 +23,11 @@
|
|
|
23
23
|
import { useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef } from 'react';
|
|
24
24
|
import * as stylex from '@stylexjs/stylex';
|
|
25
25
|
import { useDevWarning } from "../hooks/index.js";
|
|
26
|
+
import { useScrollableArea } from "../hooks/useScrollableArea.js";
|
|
26
27
|
import "../theme/tokens.stylex.js";
|
|
27
|
-
import { borderVars, colorVars, durationVars, easeVars, radiusVars, shadowVars, sizeVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
28
|
+
import { borderVars, colorVars, durationVars, easeVars, focusVars, radiusVars, shadowVars, sizeVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
28
29
|
import { mergeProps, themeProps } from "../utils/index.js";
|
|
30
|
+
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
29
31
|
import { overlayPaddingReset } from "../Layout/padding.stylex.js";
|
|
30
32
|
import { isValidSnapPoint, resolveSnapPoints } from "./snapOffsets.js";
|
|
31
33
|
import { useMobileKeyboard } from "./useMobileKeyboard.js";
|
|
@@ -120,6 +122,24 @@ const styles = {
|
|
|
120
122
|
kfzvcC: "x47corl",
|
|
121
123
|
$$css: true
|
|
122
124
|
},
|
|
125
|
+
body: {
|
|
126
|
+
kzQI83: "x1iyjqo2",
|
|
127
|
+
kAzted: "x2lwn1j",
|
|
128
|
+
kB7OPa: "x9f619",
|
|
129
|
+
kFalU9: "xx69xxh",
|
|
130
|
+
kInvED: "x1wfwxd8 x1nw7mhf",
|
|
131
|
+
kWkggS: "x10xzikg",
|
|
132
|
+
kGO01o: "x18d9i69",
|
|
133
|
+
$$css: true
|
|
134
|
+
},
|
|
135
|
+
tallKeyboardBody: {
|
|
136
|
+
kFlMNQ: "xrw9175",
|
|
137
|
+
k5JduY: "x1s928wv",
|
|
138
|
+
kc3QkE: "xhkezso",
|
|
139
|
+
k4zj60: "xu6fald",
|
|
140
|
+
kloYau: "x2q1x1w",
|
|
141
|
+
$$css: true
|
|
142
|
+
},
|
|
123
143
|
budget: {
|
|
124
144
|
kZKoxP: "x1tpcejd",
|
|
125
145
|
$$css: true
|
|
@@ -222,6 +242,7 @@ export function BottomSheetPanel({
|
|
|
222
242
|
ref,
|
|
223
243
|
state,
|
|
224
244
|
height,
|
|
245
|
+
label,
|
|
225
246
|
children,
|
|
226
247
|
snapPoints,
|
|
227
248
|
className,
|
|
@@ -312,6 +333,22 @@ export function BottomSheetPanel({
|
|
|
312
333
|
snapHeights,
|
|
313
334
|
onScrimOpacity
|
|
314
335
|
});
|
|
336
|
+
const {
|
|
337
|
+
getViewportProps,
|
|
338
|
+
getContentProps
|
|
339
|
+
} = useScrollableArea({
|
|
340
|
+
// The previous overflow-y:auto also computed overflow-x:auto. Keep wide
|
|
341
|
+
// content reachable instead of clipping that existing inline scroll path.
|
|
342
|
+
axis: 'both',
|
|
343
|
+
keyboardAccess: {
|
|
344
|
+
owner: 'contentOrViewport',
|
|
345
|
+
label
|
|
346
|
+
},
|
|
347
|
+
overscroll: 'contain',
|
|
348
|
+
// The sheet body deliberately remains the boundary for sheet-local sticky
|
|
349
|
+
// content while fitting, as it was before shared scroll adoption.
|
|
350
|
+
stickyContainment: 'always'
|
|
351
|
+
});
|
|
315
352
|
const setElement = useCallback(element => {
|
|
316
353
|
sheetRef(element);
|
|
317
354
|
elementRef.current = element;
|
|
@@ -438,20 +475,20 @@ export function BottomSheetPanel({
|
|
|
438
475
|
}
|
|
439
476
|
})
|
|
440
477
|
}), /*#__PURE__*/_jsx("div", {
|
|
441
|
-
...
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
478
|
+
...getViewportProps({
|
|
479
|
+
...bodyProps,
|
|
480
|
+
...mergeProps(stylex.props(focusOutlineStyles.focusVisible, styles.body, height === 'tall' && styles.tallKeyboardBody), scrollPreservationInset > 0 ? {
|
|
481
|
+
style: {
|
|
482
|
+
paddingBlockEnd: `${scrollPreservationInset}px`
|
|
483
|
+
}
|
|
484
|
+
} : {})
|
|
485
|
+
}),
|
|
486
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
487
|
+
...getContentProps({
|
|
488
|
+
className: "xufnvkl x9f619 x5yr21d x121v3j4"
|
|
489
|
+
}),
|
|
490
|
+
children: children
|
|
491
|
+
})
|
|
455
492
|
})]
|
|
456
493
|
});
|
|
457
494
|
}
|
|
@@ -119,6 +119,9 @@ export interface DateRangeInputProps extends Omit<BaseProps, 'onChange' | 'defau
|
|
|
119
119
|
minRangeSpan?: number;
|
|
120
120
|
/**
|
|
121
121
|
* Preset date ranges shown as quick-select options beside the calendar.
|
|
122
|
+
* A preset is disabled when either endpoint violates `min`, `max`, or
|
|
123
|
+
* `dateConstraints`, or when its span violates `minRangeSpan` or
|
|
124
|
+
* `maxRangeSpan`.
|
|
122
125
|
*/
|
|
123
126
|
presets?: ReadonlyArray<DateRangePreset>;
|
|
124
127
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangeInput.d.ts","sourceRoot":"","sources":["../../src/DateRangeInput/DateRangeInput.tsx"],"names":[],"mappings":"AAqCA,OAAO,EAGL,KAAK,WAAW,EAKhB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"DateRangeInput.d.ts","sourceRoot":"","sources":["../../src/DateRangeInput/DateRangeInput.tsx"],"names":[],"mappings":"AAqCA,OAAO,EAGL,KAAK,WAAW,EAKhB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAKrB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAU9C,YAAY,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAE3C,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,SAAS,CAAC;CAC3B;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,YAAY,EACV,WAAW,IAAI,oBAAoB,EACnC,eAAe,IAAI,wBAAwB,GAC5C,MAAM,UAAU,CAAC;AAsKlB,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,SAAS,EACT,UAAU,GAAG,cAAc,CAC5B;IACC,0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,CAAC;IAErB;;;OAGG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAE1B;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IAEnC;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAEvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAiB,EACjB,GAAG,EACH,GAAG,EACH,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,QAAe,EACf,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,aAA0B,EAC1B,YAAY,EACZ,cAAkB,EAClB,YAAY,EACZ,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,mBAAmB,+BA+RrB;yBA/Te,cAAc"}
|
|
@@ -24,6 +24,7 @@ import { Field, InputClearButton, inputWrapperStyles, inputStatusBorderStyles, i
|
|
|
24
24
|
import { Icon } from "../Icon/index.js";
|
|
25
25
|
import { Spinner } from "../Spinner/index.js";
|
|
26
26
|
import { Calendar } from "../Calendar/index.js";
|
|
27
|
+
import { useCalendarConstraints } from "../Calendar/hooks/index.js";
|
|
27
28
|
import { usePopover } from "../Popover/index.js";
|
|
28
29
|
import { useTooltip } from "../Tooltip/index.js";
|
|
29
30
|
import { mergeProps } from "../utils/index.js";
|
|
@@ -232,6 +233,13 @@ export function DateRangeInput({
|
|
|
232
233
|
dialogLabel: t('@astryx.dateRangeInput.dialogLabel'),
|
|
233
234
|
closeButtonLabel: t('@astryx.dateInput.closeCalendar')
|
|
234
235
|
});
|
|
236
|
+
const {
|
|
237
|
+
isDateDisabled
|
|
238
|
+
} = useCalendarConstraints({
|
|
239
|
+
min,
|
|
240
|
+
max,
|
|
241
|
+
dateConstraints
|
|
242
|
+
});
|
|
235
243
|
const fireChange = useCallback(newValue => {
|
|
236
244
|
if (isBusy) {
|
|
237
245
|
return;
|
|
@@ -257,10 +265,6 @@ export function DateRangeInput({
|
|
|
257
265
|
fireChange(range);
|
|
258
266
|
popover.hide();
|
|
259
267
|
}, [fireChange, popover]);
|
|
260
|
-
const handlePresetClick = useCallback(preset => {
|
|
261
|
-
fireChange(preset.getRange());
|
|
262
|
-
popover.hide();
|
|
263
|
-
}, [fireChange, popover]);
|
|
264
268
|
const handleClear = useCallback(e => {
|
|
265
269
|
e.stopPropagation();
|
|
266
270
|
fireChange(null);
|
|
@@ -362,13 +366,13 @@ export function DateRangeInput({
|
|
|
362
366
|
children: [presets && presets.length > 0 && /*#__PURE__*/_jsx("div", {
|
|
363
367
|
role: "group",
|
|
364
368
|
"aria-label": t('@astryx.dateRangeInput.presetDateRanges'),
|
|
365
|
-
...{
|
|
369
|
+
...mergeProps(themeProps('date-range-input-presets'), {
|
|
366
370
|
className: "x78zum5 xdt5ytf xzye2dw x1b2ylru xw8tdv1 x18b5jzi xl0t3rv x1d77m7x"
|
|
367
|
-
},
|
|
371
|
+
}),
|
|
368
372
|
children: presets.map(preset => {
|
|
369
373
|
const presetRange = preset.getRange();
|
|
370
374
|
const isActive = isRangeEqual(value, presetRange);
|
|
371
|
-
const isPresetDisabled = !isRangeWithinSpan(presetRange, maxRangeSpan, minRangeSpan);
|
|
375
|
+
const isPresetDisabled = !isRangeWithinSpan(presetRange, maxRangeSpan, minRangeSpan) || isDateDisabled(plainDateFromISO(presetRange.start)) || isDateDisabled(plainDateFromISO(presetRange.end));
|
|
372
376
|
return /*#__PURE__*/_jsx("button", {
|
|
373
377
|
type: "button"
|
|
374
378
|
// These presets are independent action buttons navigated by
|
|
@@ -379,8 +383,11 @@ export function DateRangeInput({
|
|
|
379
383
|
,
|
|
380
384
|
"aria-current": isActive ? 'true' : undefined,
|
|
381
385
|
disabled: isPresetDisabled,
|
|
382
|
-
onClick: () =>
|
|
383
|
-
...
|
|
386
|
+
onClick: () => handleRangeSelect(presetRange),
|
|
387
|
+
...mergeProps(themeProps('date-range-input-preset', {
|
|
388
|
+
selected: isActive ? 'selected' : null,
|
|
389
|
+
disabled: isPresetDisabled ? 'disabled' : null
|
|
390
|
+
}), stylex.props(focusOutlineStyles.focusVisible, styles.presetButton, isActive && styles.presetButtonActive, isPresetDisabled && styles.presetButtonDisabled)),
|
|
384
391
|
children: preset.label
|
|
385
392
|
}, preset.label);
|
|
386
393
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file DialogHeader.tsx
|
|
3
|
-
* @input Uses React,
|
|
3
|
+
* @input Uses React, StyleX, LayoutHeader, Button, Icon, Heading, Text, DialogContext, mergeProps, themeProps
|
|
4
4
|
* @output Exports DialogHeader component and DialogHeaderProps
|
|
5
5
|
* @position Dialog header component; used with Dialog and Layout
|
|
6
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogHeader.d.ts","sourceRoot":"","sources":["../../src/Dialog/DialogHeader.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQxD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"DialogHeader.d.ts","sourceRoot":"","sources":["../../src/Dialog/DialogHeader.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQxD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAyC5C,MAAM,WAAW,iBAAkB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAClE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IAE5C;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,iBAAiB,+BAmFnB;yBA/Fe,YAAY"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file DialogHeader.tsx
|
|
7
|
-
* @input Uses React,
|
|
7
|
+
* @input Uses React, StyleX, LayoutHeader, Button, Icon, Heading, Text, DialogContext, mergeProps, themeProps
|
|
8
8
|
* @output Exports DialogHeader component and DialogHeaderProps
|
|
9
9
|
* @position Dialog header component; used with Dialog and Layout
|
|
10
10
|
*
|
|
@@ -24,6 +24,8 @@ import { Button } from "../Button/index.js";
|
|
|
24
24
|
import { Icon } from "../Icon/index.js";
|
|
25
25
|
import { Heading } from "../Heading/Heading.js";
|
|
26
26
|
import { Text } from "../Text/Text.js";
|
|
27
|
+
import { mergeProps } from "../utils/index.js";
|
|
28
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
27
29
|
import { useDialogContext } from "./DialogContext.js";
|
|
28
30
|
import { useTranslator } from "../i18n/index.js";
|
|
29
31
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -92,18 +94,18 @@ export function DialogHeader({
|
|
|
92
94
|
style: style,
|
|
93
95
|
...rest,
|
|
94
96
|
children: /*#__PURE__*/_jsxs("div", {
|
|
95
|
-
...{
|
|
97
|
+
...mergeProps(themeProps('dialog-header'), {
|
|
96
98
|
className: "x78zum5 x1cy8zhl x1qughib xjcht0a"
|
|
97
|
-
},
|
|
99
|
+
}),
|
|
98
100
|
children: [startContent && /*#__PURE__*/_jsx("div", {
|
|
99
101
|
...{
|
|
100
102
|
className: "x78zum5 x6s0dn4 x1txdalj x2lah0s"
|
|
101
103
|
},
|
|
102
104
|
children: startContent
|
|
103
105
|
}), /*#__PURE__*/_jsxs("div", {
|
|
104
|
-
...{
|
|
105
|
-
className: "x98rzlu xeuugli xqixskq"
|
|
106
|
-
},
|
|
106
|
+
...mergeProps(themeProps('dialog-header-title-block'), {
|
|
107
|
+
className: "x78zum5 xdt5ytf xsn7fz1 x98rzlu xeuugli xqixskq"
|
|
108
|
+
}),
|
|
107
109
|
children: [/*#__PURE__*/_jsx(Heading, {
|
|
108
110
|
ref: titleRef,
|
|
109
111
|
id: titleId,
|
|
@@ -132,7 +134,8 @@ export function DialogHeader({
|
|
|
132
134
|
tooltip: t('@astryx.dialog.close'),
|
|
133
135
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
134
136
|
icon: "close",
|
|
135
|
-
color: "inherit"
|
|
137
|
+
color: "inherit",
|
|
138
|
+
...themeProps('dialog-header-close-icon')
|
|
136
139
|
}),
|
|
137
140
|
onClick: () => {
|
|
138
141
|
onOpenChange?.(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["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C;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,aAAqB,EACrB,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,UAAkB,EAClB,OAAO,EACP,QAAQ,EACR,UAAkB,EAClB,eAAe,EACf,UAAkB,EAClB,SAAiB,EACjB,MAAM,EAAE,UAAU,EAClB,aAA0B,EAC1B,WAAW,EACX,WAAW,EACX,IAAc,EACd,UAAkB,EAClB,YAAY,EACZ,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,cAAc,+
|
|
1
|
+
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../src/FileInput/FileInput.tsx"],"names":[],"mappings":"AAsCA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AASlB,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,eAAe,IAAI,mBAAmB,GACvC,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAgO9C,MA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B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,aAAqB,EACrB,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,UAAkB,EAClB,OAAO,EACP,QAAQ,EACR,UAAkB,EAClB,eAAe,EACf,UAAkB,EAClB,SAAiB,EACjB,MAAM,EAAE,UAAU,EAClB,aAA0B,EAC1B,WAAW,EACX,WAAW,EACX,IAAc,EACd,UAAkB,EAClB,YAAY,EACZ,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,cAAc,+BAkbhB;yBA7ce,SAAS"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file FileInput.tsx
|
|
7
7
|
* @input Uses React, useId, Field, Icon, Spinner, VisuallyHidden
|
|
8
|
-
* @output Exports FileInput component,
|
|
8
|
+
* @output Exports FileInput component, public types, and its root/icon theme targets
|
|
9
9
|
* @position Core implementation; consumed by index.ts, tested by FileInput.test.tsx
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update these files to stay in sync:
|
|
@@ -406,7 +406,10 @@ export function FileInput({
|
|
|
406
406
|
children: [/*#__PURE__*/_jsx(Icon, {
|
|
407
407
|
icon: "arrowUp",
|
|
408
408
|
size: "md",
|
|
409
|
-
color: "secondary"
|
|
409
|
+
color: "secondary",
|
|
410
|
+
...themeProps('file-input-icon', {
|
|
411
|
+
mode
|
|
412
|
+
})
|
|
410
413
|
}), /*#__PURE__*/_jsx("span", {
|
|
411
414
|
...{
|
|
412
415
|
className: "x9ynric xjm74w1 x6pjikd xw6l6zx xv1l7n4 x2b8uid x87ps6o"
|
|
@@ -432,7 +435,10 @@ export function FileInput({
|
|
|
432
435
|
children: [/*#__PURE__*/_jsx(Icon, {
|
|
433
436
|
icon: "arrowUp",
|
|
434
437
|
size: "sm",
|
|
435
|
-
color: "secondary"
|
|
438
|
+
color: "secondary",
|
|
439
|
+
...themeProps('file-input-icon', {
|
|
440
|
+
mode
|
|
441
|
+
})
|
|
436
442
|
}), /*#__PURE__*/_jsx("span", {
|
|
437
443
|
...{
|
|
438
444
|
0: {
|
|
@@ -5,7 +5,7 @@ import type { CitationSource } from '../Citation/Citation';
|
|
|
5
5
|
/**
|
|
6
6
|
* A plugin that transforms text patterns into custom React elements
|
|
7
7
|
* inside Markdown. Applied to parsed text nodes only — code blocks,
|
|
8
|
-
* inline code, and other non-prose contexts are unaffected.
|
|
8
|
+
* inline code, math, and other non-prose contexts are unaffected.
|
|
9
9
|
*
|
|
10
10
|
* Follows Lexical's TextMatchTransformer architecture:
|
|
11
11
|
* - `pattern` for initial regex matching
|
|
@@ -38,6 +38,14 @@ export interface MarkdownComponents {
|
|
|
38
38
|
inlineCode?: React.ComponentType<{
|
|
39
39
|
children: string;
|
|
40
40
|
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Renders opt-in `$…$` and `$$…$$` math. Supplying this renderer enables
|
|
43
|
+
* math parsing; Astryx passes the raw expression and does not execute it.
|
|
44
|
+
*/
|
|
45
|
+
math?: React.ComponentType<{
|
|
46
|
+
value: string;
|
|
47
|
+
display: 'inline' | 'block';
|
|
48
|
+
}>;
|
|
41
49
|
citation?: React.ComponentType<{
|
|
42
50
|
source: CitationSource;
|
|
43
51
|
number: number;
|
|
@@ -125,7 +133,7 @@ export interface MarkdownProps extends BaseProps<HTMLElement> {
|
|
|
125
133
|
components?: Partial<MarkdownComponents>;
|
|
126
134
|
/**
|
|
127
135
|
* Plugins that transform text patterns into custom React elements.
|
|
128
|
-
* Applied to text nodes after parsing — code blocks
|
|
136
|
+
* Applied to text nodes after parsing — code blocks, inline code, and math
|
|
129
137
|
* are unaffected. Patterns are matched in order; first match wins
|
|
130
138
|
* for overlapping ranges.
|
|
131
139
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../src/Markdown/Markdown.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAgBhD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAG5C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../src/Markdown/Markdown.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAgBhD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAG5C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AA6BzD;;;;;;;;;GASG;AACH,MAAM,WAAW,oBAAoB;IACnC,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,KAAK,MAAM,GAAG,KAAK,CAAC;IAExE,2CAA2C;IAC3C,MAAM,EAAE,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;CACnE;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC;AAE5C,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IAC9D,UAA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