@astryxdesign/core 0.7.8-canary.42ccd7c → 0.7.8-canary.4b85670
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/DateInput/PickerWheel.d.ts.map +1 -1
- package/dist/DateInput/PickerWheel.js +0 -3
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +0 -2
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +6 -1
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +7 -2
- package/dist/PowerSearch/PowerSearch.d.ts +4 -2
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +23 -1
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchBottomSheet.js +171 -50
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +15 -15
- package/dist/Resizable/createResizable.d.ts +70 -16
- package/dist/Resizable/createResizable.d.ts.map +1 -1
- package/dist/Resizable/createResizable.js +180 -22
- package/dist/Resizable/separatorAttributes.d.ts +45 -0
- package/dist/Resizable/separatorAttributes.d.ts.map +1 -0
- package/dist/Resizable/separatorAttributes.js +35 -0
- package/dist/Resizable/useResizable.js +2 -2
- package/dist/Tokenizer/TokenizerBottomSheet.js +8 -12
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +6 -0
- package/dist/astryx.css +4 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +5 -2
- package/dist/i18n/generated-english/Resizable/createResizable.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Resizable/createResizable.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Resizable/createResizable.generated.js +13 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +5 -2
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +5 -2
- package/dist/motion/uikit/datePicker.d.ts +58 -0
- package/dist/motion/uikit/datePicker.d.ts.map +1 -0
- package/dist/motion/uikit/datePicker.js +60 -0
- package/dist/motion/uikit/index.d.ts +4 -3
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +4 -3
- package/locales/en.json +21 -9
- package/locales/pseudo.json +15 -6
- package/package.json +4 -4
- package/src/BottomSheet/BottomSheetSwitcher.doc.mjs +5 -0
- package/src/DateInput/PickerWheel.tsx +0 -2
- package/src/DateInput/Wheel.tsx +0 -1
- package/src/HoverCard/useHoverCard.tsx +6 -1
- package/src/Overlay/Overlay.tsx +7 -2
- package/src/PowerSearch/PowerSearch.doc.mjs +2 -2
- package/src/PowerSearch/PowerSearch.tsx +4 -2
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +235 -62
- package/src/Resizable/ResizeHandle.tsx +18 -26
- package/src/Resizable/createResizable.ts +242 -27
- package/src/Resizable/separatorAttributes.ts +73 -0
- package/src/Resizable/useResizable.ts +2 -2
- package/src/Tokenizer/TokenizerBottomSheet.tsx +8 -12
- package/src/Tooltip/useTooltip.tsx +6 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +5 -2
- package/src/i18n/generated-english/Resizable/createResizable.generated.ts +14 -0
- package/src/i18n/generated-locales/en.generated.ts +6 -4
- package/src/i18n/generated-locales/pseudo.generated.ts +6 -4
- package/src/motion/MEASUREMENTS.md +10 -0
- package/src/motion/README.md +1 -0
- package/src/motion/uikit/datePicker.ts +60 -0
- package/src/motion/uikit/index.ts +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickerWheel.d.ts","sourceRoot":"","sources":["../../src/DateInput/PickerWheel.tsx"],"names":[],"mappings":"AAmDA,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AA2HxB;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAe,GAChB,EAAE,UAAU,+
|
|
1
|
+
{"version":3,"file":"PickerWheel.d.ts","sourceRoot":"","sources":["../../src/DateInput/PickerWheel.tsx"],"names":[],"mappings":"AAmDA,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AA2HxB;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAe,GAChB,EAAE,UAAU,+BA8gBZ;yBAphBe,WAAW"}
|
|
@@ -468,9 +468,6 @@ export function PickerWheel({
|
|
|
468
468
|
isEnabled: isActive,
|
|
469
469
|
isPointerKept: true
|
|
470
470
|
});
|
|
471
|
-
|
|
472
|
-
// A key commits the row at `position` at once and turns the wheel there
|
|
473
|
-
// from `offset`.
|
|
474
471
|
const turnToPosition = useCallback((position, offset) => {
|
|
475
472
|
const current = latestRef.current;
|
|
476
473
|
const option = current.options[position];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wheel.d.ts","sourceRoot":"","sources":["../../src/DateInput/Wheel.tsx"],"names":[],"mappings":"AAoDA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,UAAU,GAChB,MAAM,gBAAgB,CAAC;AAoMxB;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,+BAKtC;yBALe,KAAK;;;AASrB;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAe,GAChB,EAAE,UAAU,+
|
|
1
|
+
{"version":3,"file":"Wheel.d.ts","sourceRoot":"","sources":["../../src/DateInput/Wheel.tsx"],"names":[],"mappings":"AAoDA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,UAAU,GAChB,MAAM,gBAAgB,CAAC;AAoMxB;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,+BAKtC;yBALe,KAAK;;;AASrB;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAe,GAChB,EAAE,UAAU,+BAmUZ;yBAzUe,WAAW"}
|
package/dist/DateInput/Wheel.js
CHANGED
|
@@ -351,8 +351,6 @@ export function ScrollWheel({
|
|
|
351
351
|
useOwnScrollGesture(scrollerRef, 'all', {
|
|
352
352
|
isEnabled: isActive
|
|
353
353
|
});
|
|
354
|
-
|
|
355
|
-
// A key commits the row it moves to and scrolls the column there.
|
|
356
354
|
const moveTo = useCallback(row => {
|
|
357
355
|
const option = row == null ? undefined : options[row];
|
|
358
356
|
if (row == null || option == null || option.isDisabled) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/useHoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AA8BlC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAA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WG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B;;;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,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;;;OAOG;IACH,eAAe,EAAE,CACf,QAAQ,EAAE,SAAS,EACnB,KAAK,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,KAC5C,SAAS,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;GAgBG;AAEH,wBAAgB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CAke5E"}
|
|
@@ -197,7 +197,12 @@ export function useHoverCard(options = {}) {
|
|
|
197
197
|
|
|
198
198
|
// Tap-to-open on touch; on a mouse this does nothing and hover still rules.
|
|
199
199
|
const handlePointerDown = useCallback(event => {
|
|
200
|
-
|
|
200
|
+
// A pen in range starts the hover show before it lands. Left pending,
|
|
201
|
+
// that show opens the card during the press. The tap then closes it.
|
|
202
|
+
if (handleTouchPointerDown(event) && showTimeoutRef.current) {
|
|
203
|
+
clearTimeout(showTimeoutRef.current);
|
|
204
|
+
showTimeoutRef.current = null;
|
|
205
|
+
}
|
|
201
206
|
}, [handleTouchPointerDown]);
|
|
202
207
|
|
|
203
208
|
// Under `auto`, whether focus counts is decided when it arrives, and a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../src/Overlay/Overlay.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAE,GAAG,EAAC,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,aAAa,EACd,MAAM,gBAAgB,CAAC;AAGxB,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC7D,8CAA8C;IAC9C,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iDAAiD;IACjD,OAAO,EAAE,SAAS,CAAC;IACnB,wBAAwB;IACxB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sBAAsB;IACtB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,qBAAqB;IACrB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,KAAK,EACL,QAAQ,EACR,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,EACxB,GAAG,IAAI,EACR,EAAE,YAAY,+
|
|
1
|
+
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../src/Overlay/Overlay.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAE,GAAG,EAAC,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,aAAa,EACd,MAAM,gBAAgB,CAAC;AAGxB,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC7D,8CAA8C;IAC9C,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iDAAiD;IACjD,OAAO,EAAE,SAAS,CAAC;IACnB,wBAAwB;IACxB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sBAAsB;IACtB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,qBAAqB;IACrB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,KAAK,EACL,QAAQ,EACR,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,EACxB,GAAG,IAAI,EACR,EAAE,YAAY,+BA0Dd;yBAzEe,OAAO"}
|
package/dist/Overlay/Overlay.js
CHANGED
|
@@ -66,8 +66,13 @@ export function Overlay({
|
|
|
66
66
|
align
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
//
|
|
70
|
-
//
|
|
69
|
+
// Copies the first child's radius onto the wrapper, so the scrim clips to
|
|
70
|
+
// the media's rounded corners. This is a layout read of the mounted DOM, and
|
|
71
|
+
// no user interaction causes it. It runs again when a hidden Activity shows
|
|
72
|
+
// the wrapper, because the child can change while it is hidden. A ref
|
|
73
|
+
// callback runs again when a caller's ref changes identity, so it cannot
|
|
74
|
+
// keep this once-per-show timing. A useOverlay consumer sets the radius on
|
|
75
|
+
// its own element.
|
|
71
76
|
useIsomorphicLayoutEffect(() => {
|
|
72
77
|
const el = overlay.containerRef.current;
|
|
73
78
|
if (!el) {
|
|
@@ -133,8 +133,10 @@ export interface PowerSearchProps extends Omit<BaseProps<HTMLElement>, 'onChange
|
|
|
133
133
|
* above it with the fields (or the content search with inline
|
|
134
134
|
* suggestions), and a value step opens above that, stages operator →
|
|
135
135
|
* value, and confirms from its footer. Dismissing a step reveals the
|
|
136
|
-
* one beneath.
|
|
137
|
-
*
|
|
136
|
+
* one beneath. The flow edits a draft: `onChange` is called when Done
|
|
137
|
+
* applies it, once per edit in order, and a dismissal with a changed
|
|
138
|
+
* draft asks before discarding it. Suited to compact touch screens,
|
|
139
|
+
* where the editor popover competes with the software keyboard.
|
|
138
140
|
* - `'adaptive'`: the bottom sheet on compact coarse-pointer screens,
|
|
139
141
|
* otherwise the popover — the same resolution Selector uses. The server
|
|
140
142
|
* render and the hydrating render are the popover.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearch.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearch.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EAUZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAC,QAA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E,uBAAuB,CAAC;CACxC;AAED,oFAAoF;AACpF,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAoC3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EAAE,UAAU,EAClB,OAAO,EACP,QAAQ,EACR,KAAK,EAAE,cAAc,EACrB,aAAoB,EACpB,WAAW,EAAE,oBAAoB,EACjC,YAAoB,EACpB,QAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,EACN,aAA0B,EAC1B,SAAS,EACT,cAAmB,EACnB,oBAAoB,EACpB,gBAA6C,EAC7C,sBAAsB,EAAE,+BAA+B,EACvD,UAAU,EACV,qBAAqB,EACrB,UAAU,EACV,WAAW,EACX,GAAG,EACH,SAAS,EACT,IAAI,EAAE,QAAQ,EACd,aAAa,EAAE,MAAM,EACrB,MAAM,EACN,SAAS,EACT,KAAK,EACL,UAAU,EAAE,kBAAkB,EAC9B,YAAyB,GAC1B,EAAE,gBAAgB,qBAmiClB;yBAtkCe,WAAW"}
|
|
@@ -72,7 +72,13 @@ export interface PowerSearchBottomSheetProps {
|
|
|
72
72
|
config: InternalConfig;
|
|
73
73
|
/** The caller's config, handed to Editor overrides as they expect it. */
|
|
74
74
|
configProp: PowerSearchConfig;
|
|
75
|
+
/** The committed filters; the draft the sheet edits starts from them. */
|
|
75
76
|
filters: ReadonlyArray<PowerSearchFilter>;
|
|
77
|
+
/**
|
|
78
|
+
* The field's `onChange`. Done replays the draft's edits through it, in
|
|
79
|
+
* order, each with the list as it stood after that edit; nothing is
|
|
80
|
+
* reported before Done.
|
|
81
|
+
*/
|
|
76
82
|
onChange: (filters: ReadonlyArray<PowerSearchFilter>, changeType: PowerSearchChangeType, index: number) => void;
|
|
77
83
|
/** The field typeahead source; the content search lists its suggestions. */
|
|
78
84
|
searchSource: SearchSource<PowerSearchItem>;
|
|
@@ -90,13 +96,29 @@ export interface PowerSearchBottomSheetProps {
|
|
|
90
96
|
components?: PowerSearchComponents;
|
|
91
97
|
editors: PowerSearchSheetEditors;
|
|
92
98
|
}
|
|
99
|
+
/** One edit of the draft: the list before it, the list after it, and how it was reported. */
|
|
100
|
+
interface DraftEdit {
|
|
101
|
+
before: ReadonlyArray<PowerSearchFilter>;
|
|
102
|
+
after: ReadonlyArray<PowerSearchFilter>;
|
|
103
|
+
changeType: PowerSearchChangeType;
|
|
104
|
+
index: number;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Replays the draft's edits onto `base`, the field's latest filters, and
|
|
108
|
+
* reports each through `report` with the list after it. An add appends; an
|
|
109
|
+
* edit replaces the first filter matching the one it edited; a removal drops
|
|
110
|
+
* the filters it removed, by signature. An edit or removal whose target is
|
|
111
|
+
* not in the base list is skipped: the parent removed it meanwhile.
|
|
112
|
+
*/
|
|
113
|
+
export declare function replayDraftEdits(base: ReadonlyArray<PowerSearchFilter>, edits: ReadonlyArray<DraftEdit>, report: (filters: ReadonlyArray<PowerSearchFilter>, changeType: PowerSearchChangeType, index: number) => void): ReadonlyArray<PowerSearchFilter>;
|
|
93
114
|
/**
|
|
94
115
|
* The sheet flow of PowerSearch's touch presentation: Filters, Add filter,
|
|
95
116
|
* and the value step, as standalone sheets that stack, each open beneath the
|
|
96
117
|
* step it led to.
|
|
97
118
|
*/
|
|
98
|
-
export declare function PowerSearchBottomSheet({ isOpen, onOpenChange, finalFocusRef, resultCountText, config, configProp, filters, onChange, searchSource, placeholder, isReadOnly, isDisabled, hasClear, maxOperatorMenuItems, timezoneID, maxSearchResults, saveButtonLabel: saveButtonLabelFromProps, components: componentOverrides, editors, }: PowerSearchBottomSheetProps): React.JSX.Element;
|
|
119
|
+
export declare function PowerSearchBottomSheet({ isOpen, onOpenChange, finalFocusRef, resultCountText, config, configProp, filters: committedFilters, onChange: onCommit, searchSource, placeholder, isReadOnly, isDisabled, hasClear, maxOperatorMenuItems, timezoneID, maxSearchResults, saveButtonLabel: saveButtonLabelFromProps, components: componentOverrides, editors, }: PowerSearchBottomSheetProps): React.JSX.Element;
|
|
99
120
|
export declare namespace PowerSearchBottomSheet {
|
|
100
121
|
var displayName: string;
|
|
101
122
|
}
|
|
123
|
+
export {};
|
|
102
124
|
//# sourceMappingURL=PowerSearchBottomSheet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearchBottomSheet.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchBottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,EAAE,EASZ,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAoBf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAkCrD,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAe3D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAIV,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EAEjB,iBAAiB,EACjB,eAAe,EAEhB,MAAM,SAAS,CAAC;AAajB;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,sBAAsB,EAAE,OAAO,sBAAsB,CAAC;IACtD,wBAAwB,EAAE,OAAO,wBAAwB,CAAC;CAC3D;AAED,MAAM,WAAW,2BAA2B;IAC1C,wEAAwE;IACxE,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,aAAa,EAAE,SAAS,CAAC,WAAW,GA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Ae,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,OAAO,EAAE,uBAAuB,CAAC;CAClC;AAMD,6FAA6F;AAC7F,UAAU,SAAS;IACjB,MAAM,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACzC,KAAK,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACxC,UAAU,EAAE,qBAAqB,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf;AAwCD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,aAAa,CAAC,iBAAiB,CAAC,EACtC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,EAC/B,MAAM,EAAE,CACN,OAAO,EAAE,aAAa,CAAC,iBAAiB,CAAC,EACzC,UAAU,EAAE,qBAAqB,EACjC,KAAK,EAAE,MAAM,KACV,IAAI,GACR,aAAa,CAAC,iBAAiB,CAAC,CA+ClC;AAwmBD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,YAAY,EACZ,aAAa,EACb,eAAe,EACf,MAAM,EACN,UAAU,EACV,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,UAAU,EACV,QAAQ,EACR,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,eAAe,EAAE,wBAAwB,EACzC,UAAU,EAAE,kBAAkB,EAC9B,OAAO,GACR,EAAE,2BAA2B,qBAksD7B;yBAttDe,sBAAsB"}
|
|
@@ -104,6 +104,82 @@ registerEnglishFallback(english);
|
|
|
104
104
|
// Styles
|
|
105
105
|
// =============================================================================
|
|
106
106
|
|
|
107
|
+
/** One edit of the draft: the list before it, the list after it, and how it was reported. */
|
|
108
|
+
|
|
109
|
+
// Whether two filter lists hold the same filters in the same order, by the
|
|
110
|
+
// key-order-insensitive signature the sheet matches filters with.
|
|
111
|
+
function hasSameFilters(a, b) {
|
|
112
|
+
return a.length === b.length && a.every((filter, index) => b[index] != null && filterSignature(filter) === filterSignature(b[index]));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// The filters `before` holds that `after` does not, as a multiset by
|
|
116
|
+
// signature, in `before` order.
|
|
117
|
+
function removedFilters(before, after) {
|
|
118
|
+
const remaining = new Map();
|
|
119
|
+
for (const filter of after) {
|
|
120
|
+
const signature = filterSignature(filter);
|
|
121
|
+
remaining.set(signature, (remaining.get(signature) ?? 0) + 1);
|
|
122
|
+
}
|
|
123
|
+
return before.filter(filter => {
|
|
124
|
+
const signature = filterSignature(filter);
|
|
125
|
+
const count = remaining.get(signature) ?? 0;
|
|
126
|
+
if (count > 0) {
|
|
127
|
+
remaining.set(signature, count - 1);
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
return true;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Replays the draft's edits onto `base`, the field's latest filters, and
|
|
136
|
+
* reports each through `report` with the list after it. An add appends; an
|
|
137
|
+
* edit replaces the first filter matching the one it edited; a removal drops
|
|
138
|
+
* the filters it removed, by signature. An edit or removal whose target is
|
|
139
|
+
* not in the base list is skipped: the parent removed it meanwhile.
|
|
140
|
+
*/
|
|
141
|
+
export function replayDraftEdits(base, edits, report) {
|
|
142
|
+
let current = base;
|
|
143
|
+
for (const edit of edits) {
|
|
144
|
+
if (edit.changeType === 'add') {
|
|
145
|
+
const added = edit.after[edit.index];
|
|
146
|
+
if (added == null) {
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
current = [...current, added];
|
|
150
|
+
report(current, 'add', current.length - 1);
|
|
151
|
+
} else if (edit.changeType === 'edit') {
|
|
152
|
+
const original = edit.before[edit.index];
|
|
153
|
+
const updated = edit.after[edit.index];
|
|
154
|
+
if (original == null || updated == null) {
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
const signature = filterSignature(original);
|
|
158
|
+
const index = current.findIndex(filter => filterSignature(filter) === signature);
|
|
159
|
+
if (index === -1) {
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
current = current.map((filter, i) => i === index ? updated : filter);
|
|
163
|
+
report(current, 'edit', index);
|
|
164
|
+
} else {
|
|
165
|
+
const removed = removedFilters(edit.before, edit.after).map(filterSignature);
|
|
166
|
+
const indexes = [];
|
|
167
|
+
for (const signature of removed) {
|
|
168
|
+
const index = current.findIndex((filter, i) => !indexes.includes(i) && filterSignature(filter) === signature);
|
|
169
|
+
if (index !== -1) {
|
|
170
|
+
indexes.push(index);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (indexes.length === 0) {
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
current = current.filter((_, i) => !indexes.includes(i));
|
|
177
|
+
report(current, 'remove', Math.min(...indexes));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return current;
|
|
181
|
+
}
|
|
182
|
+
|
|
107
183
|
// The trailing plus a field row shows when choosing it adds the filter at
|
|
108
184
|
// once, and the Add filter actions' glyph. Core's default icon set has no plus.
|
|
109
185
|
function PlusIcon(props) {
|
|
@@ -514,8 +590,8 @@ export function PowerSearchBottomSheet({
|
|
|
514
590
|
resultCountText,
|
|
515
591
|
config,
|
|
516
592
|
configProp,
|
|
517
|
-
filters,
|
|
518
|
-
onChange,
|
|
593
|
+
filters: committedFilters,
|
|
594
|
+
onChange: onCommit,
|
|
519
595
|
searchSource,
|
|
520
596
|
placeholder,
|
|
521
597
|
isReadOnly,
|
|
@@ -535,6 +611,27 @@ export function PowerSearchBottomSheet({
|
|
|
535
611
|
const locale = useLocale();
|
|
536
612
|
const formatList = useListFormatter();
|
|
537
613
|
const isInteractive = !isDisabled && !isReadOnly;
|
|
614
|
+
|
|
615
|
+
// ---- draft ----
|
|
616
|
+
// One open flow edits one draft of the filter list; `onChange` waits for
|
|
617
|
+
// Done, and a dismissal with a changed draft asks first.
|
|
618
|
+
const [filtersAtOpen, setFiltersAtOpen] = useState(() => committedFilters);
|
|
619
|
+
const [filters, setFilters] = useState(() => committedFilters);
|
|
620
|
+
// The draft as of the last edit, for the edit log's `before` lists.
|
|
621
|
+
const draftRef = useRef(filters);
|
|
622
|
+
const draftEditsRef = useRef([]);
|
|
623
|
+
const onChange = useCallback((next, changeType, index) => {
|
|
624
|
+
draftEditsRef.current.push({
|
|
625
|
+
before: draftRef.current,
|
|
626
|
+
after: next,
|
|
627
|
+
changeType,
|
|
628
|
+
index
|
|
629
|
+
});
|
|
630
|
+
draftRef.current = next;
|
|
631
|
+
setFilters(next);
|
|
632
|
+
}, []);
|
|
633
|
+
const isDraftDirty = !hasSameFilters(filtersAtOpen, filters);
|
|
634
|
+
const [isDiscardConfirmationOpen, setIsDiscardConfirmationOpen] = useState(false);
|
|
538
635
|
const contentSearchFieldKey = config.config.contentSearchFieldKey;
|
|
539
636
|
const contentSearchOperator = contentSearchFieldKey == null ? undefined : config.getDefaultOperator(contentSearchFieldKey);
|
|
540
637
|
const hasContentSearch = contentSearchOperator?.value.type === 'string';
|
|
@@ -616,9 +713,6 @@ export function PowerSearchBottomSheet({
|
|
|
616
713
|
const [contentQuery, setContentQuery] = useState('');
|
|
617
714
|
const [isClearConfirmationOpen, setIsClearConfirmationOpen] = useState(false);
|
|
618
715
|
const clearAllButtonRef = useRef(null);
|
|
619
|
-
// Set while Clear all commits, so the result count that changes in that
|
|
620
|
-
// commit is spoken with Clear all's outcome, as one message.
|
|
621
|
-
const isClearingRef = useRef(false);
|
|
622
716
|
|
|
623
717
|
// `useAnnounce` delivers inside the open Astryx modal that encloses its
|
|
624
718
|
// caller, and this component renders above the
|
|
@@ -645,13 +739,21 @@ export function PowerSearchBottomSheet({
|
|
|
645
739
|
if (isOpen !== wasOpen) {
|
|
646
740
|
setWasOpen(isOpen);
|
|
647
741
|
if (isOpen) {
|
|
742
|
+
// A fresh draft from the committed filters; the entry step is judged
|
|
743
|
+
// against them, not the previous session's draft.
|
|
744
|
+
setFiltersAtOpen(committedFilters);
|
|
745
|
+
setFilters(committedFilters);
|
|
746
|
+
draftRef.current = committedFilters;
|
|
747
|
+
draftEditsRef.current = [];
|
|
748
|
+
const startsOnAddFilter = committedFilters.length === 0 && isInteractive;
|
|
648
749
|
setFieldQuery('');
|
|
649
750
|
setContentQuery('');
|
|
650
|
-
setStep(
|
|
651
|
-
setFieldPickerOrigin(
|
|
751
|
+
setStep(startsOnAddFilter ? 'fields' : 'manage');
|
|
752
|
+
setFieldPickerOrigin(startsOnAddFilter ? 'trigger' : 'manage');
|
|
652
753
|
} else {
|
|
653
754
|
setStep(null);
|
|
654
755
|
setIsClearConfirmationOpen(false);
|
|
756
|
+
setIsDiscardConfirmationOpen(false);
|
|
655
757
|
}
|
|
656
758
|
}
|
|
657
759
|
const closeFlow = useCallback(() => {
|
|
@@ -659,6 +761,31 @@ export function PowerSearchBottomSheet({
|
|
|
659
761
|
setStep(null);
|
|
660
762
|
onOpenChange(false);
|
|
661
763
|
}, [onOpenChange]);
|
|
764
|
+
// Done replays each edit in order onto the field's latest filters, so a
|
|
765
|
+
// consumer gets the calls a popover session makes and keeps a filter it
|
|
766
|
+
// added meanwhile.
|
|
767
|
+
const commitAndClose = useCallback(() => {
|
|
768
|
+
if (isDraftDirty) {
|
|
769
|
+
replayDraftEdits(committedFilters, draftEditsRef.current, onCommit);
|
|
770
|
+
}
|
|
771
|
+
draftEditsRef.current = [];
|
|
772
|
+
closeFlow();
|
|
773
|
+
}, [closeFlow, committedFilters, isDraftDirty, onCommit]);
|
|
774
|
+
const requestDismiss = useCallback(() => {
|
|
775
|
+
if (isDraftDirty) {
|
|
776
|
+
setIsDiscardConfirmationOpen(true);
|
|
777
|
+
} else {
|
|
778
|
+
closeFlow();
|
|
779
|
+
}
|
|
780
|
+
}, [closeFlow, isDraftDirty]);
|
|
781
|
+
const closeDiscardConfirmation = () => {
|
|
782
|
+
// eslint-disable-next-line @eslint-react/dom-no-flush-sync -- the confirmation must be gone before focus moves back into the sheet
|
|
783
|
+
flushSync(() => setIsDiscardConfirmationOpen(false));
|
|
784
|
+
const target = stepRef.current === 'manage' ? managerAddButtonRef.current ?? manageSheetRef.current?.closest('[tabindex="-1"]') : fieldsSheetRef.current?.closest('[tabindex="-1"]');
|
|
785
|
+
target?.focus({
|
|
786
|
+
preventScroll: true
|
|
787
|
+
});
|
|
788
|
+
};
|
|
662
789
|
|
|
663
790
|
// Whether a Filters row is a button: the field interactive and the
|
|
664
791
|
// filter not read-only. The row opens the value step — the editor for its
|
|
@@ -864,14 +991,8 @@ export function PowerSearchBottomSheet({
|
|
|
864
991
|
// is quiet then, so the change is spoken here, inside the dialog. Only a
|
|
865
992
|
// change after the flow opened is spoken.
|
|
866
993
|
const announcedResultCountRef = useRef(resultCountText);
|
|
867
|
-
// The latest result count, for Clear all's handler to read after its
|
|
868
|
-
// commit has flushed.
|
|
869
|
-
const latestResultCountRef = useRef(resultCountText);
|
|
870
|
-
useLayoutEffect(() => {
|
|
871
|
-
latestResultCountRef.current = resultCountText;
|
|
872
|
-
}, [resultCountText]);
|
|
873
994
|
useEffect(() => {
|
|
874
|
-
if (
|
|
995
|
+
if (resultCountText === announcedResultCountRef.current) {
|
|
875
996
|
return;
|
|
876
997
|
}
|
|
877
998
|
announcedResultCountRef.current = resultCountText;
|
|
@@ -1138,26 +1259,21 @@ export function PowerSearchBottomSheet({
|
|
|
1138
1259
|
// confirmation must be gone before focus moves into the sheet and the
|
|
1139
1260
|
// outcome is routed into the sheet's region, so its close is flushed
|
|
1140
1261
|
// first. The outcome is "Editable filters removed" while a read-only filter
|
|
1141
|
-
// remains, otherwise "All filters removed"
|
|
1142
|
-
//
|
|
1143
|
-
// sheet's first remaining control: a kept read-only row has none,
|
|
1144
|
-
// filter.
|
|
1262
|
+
// remains, otherwise "All filters removed"; the result count follows the
|
|
1263
|
+
// applied filters, which change on Done, so none changes here. Focus moves
|
|
1264
|
+
// to the sheet's first remaining control: a kept read-only row has none,
|
|
1265
|
+
// so Add filter.
|
|
1145
1266
|
const closeClearConfirmation = confirmed => {
|
|
1146
1267
|
const kept = filters.filter(filter => filter.isReadOnly);
|
|
1147
1268
|
const firstRemovedIndex = filters.findIndex(filter => !filter.isReadOnly);
|
|
1148
1269
|
const isClearing = confirmed && isInteractive && firstRemovedIndex >= 0;
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
}
|
|
1157
|
-
});
|
|
1158
|
-
} finally {
|
|
1159
|
-
isClearingRef.current = false;
|
|
1160
|
-
}
|
|
1270
|
+
// eslint-disable-next-line @eslint-react/dom-no-flush-sync -- the confirmation must be gone before focus moves into the sheet and the words are routed into it
|
|
1271
|
+
flushSync(() => {
|
|
1272
|
+
setIsClearConfirmationOpen(false);
|
|
1273
|
+
if (isClearing) {
|
|
1274
|
+
onChange(kept, 'remove', firstRemovedIndex);
|
|
1275
|
+
}
|
|
1276
|
+
});
|
|
1161
1277
|
if (!isClearing) {
|
|
1162
1278
|
clearAllButtonRef.current?.focus();
|
|
1163
1279
|
return;
|
|
@@ -1165,18 +1281,7 @@ export function PowerSearchBottomSheet({
|
|
|
1165
1281
|
managerAddButtonRef.current?.focus({
|
|
1166
1282
|
preventScroll: true
|
|
1167
1283
|
});
|
|
1168
|
-
|
|
1169
|
-
const changedCount = resultCount !== announcedResultCountRef.current ? resultCount : null;
|
|
1170
|
-
announcedResultCountRef.current = resultCount;
|
|
1171
|
-
if (kept.length > 0) {
|
|
1172
|
-
announce(changedCount == null ? t('@astryx.powersearch.editableFiltersRemoved') : t('@astryx.powersearch.sheet.editableFiltersClearedWithCount', {
|
|
1173
|
-
resultCount: changedCount
|
|
1174
|
-
}));
|
|
1175
|
-
} else {
|
|
1176
|
-
announce(changedCount == null ? t('@astryx.powersearch.allFiltersRemoved') : t('@astryx.powersearch.sheet.filtersClearedWithCount', {
|
|
1177
|
-
resultCount: changedCount
|
|
1178
|
-
}));
|
|
1179
|
-
}
|
|
1284
|
+
announce(kept.length > 0 ? t('@astryx.powersearch.editableFiltersRemoved') : t('@astryx.powersearch.allFiltersRemoved'));
|
|
1180
1285
|
};
|
|
1181
1286
|
const handleOperatorSelect = useCallback(operator => {
|
|
1182
1287
|
setDraft(current => {
|
|
@@ -1270,20 +1375,20 @@ export function PowerSearchBottomSheet({
|
|
|
1270
1375
|
// Every step change goes through the handlers above.
|
|
1271
1376
|
const handleManageOpenChange = useCallback(isSheetOpen => {
|
|
1272
1377
|
if (!isSheetOpen && stepRef.current === 'manage') {
|
|
1273
|
-
|
|
1378
|
+
requestDismiss();
|
|
1274
1379
|
}
|
|
1275
|
-
}, [
|
|
1380
|
+
}, [requestDismiss]);
|
|
1276
1381
|
const handleFieldsOpenChange = useCallback(isSheetOpen => {
|
|
1277
1382
|
if (isSheetOpen || stepRef.current !== 'fields') {
|
|
1278
1383
|
return;
|
|
1279
1384
|
}
|
|
1280
1385
|
if (fieldPickerOrigin === 'trigger') {
|
|
1281
|
-
|
|
1386
|
+
requestDismiss();
|
|
1282
1387
|
return;
|
|
1283
1388
|
}
|
|
1284
1389
|
queueManagerAddFocus();
|
|
1285
1390
|
setStep('manage');
|
|
1286
|
-
}, [
|
|
1391
|
+
}, [fieldPickerOrigin, queueManagerAddFocus, requestDismiss]);
|
|
1287
1392
|
const handleValueOpenChange = useCallback(isSheetOpen => {
|
|
1288
1393
|
if (!isSheetOpen && stepRef.current === 'value') {
|
|
1289
1394
|
returnFromValue();
|
|
@@ -1510,7 +1615,7 @@ export function PowerSearchBottomSheet({
|
|
|
1510
1615
|
// action. Mounted only while the sheet is open, so its text
|
|
1511
1616
|
// is spoken in this sheet when it appears.
|
|
1512
1617
|
isManageSheetOpen && /*#__PURE__*/_jsx(EmptyState, {
|
|
1513
|
-
title: t('@astryx.powersearch.sheet.noFilters'),
|
|
1618
|
+
title: t(isDraftDirty ? '@astryx.powersearch.sheet.noFiltersInDraft' : '@astryx.powersearch.sheet.noFilters'),
|
|
1514
1619
|
description: t('@astryx.powersearch.sheet.noFiltersDescription'),
|
|
1515
1620
|
headingLevel: 4,
|
|
1516
1621
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
@@ -1574,7 +1679,7 @@ export function PowerSearchBottomSheet({
|
|
|
1574
1679
|
})
|
|
1575
1680
|
})
|
|
1576
1681
|
})
|
|
1577
|
-
}), filterRows.length > 0 && /*#__PURE__*/_jsxs("div", {
|
|
1682
|
+
}), (filterRows.length > 0 || isDraftDirty) && /*#__PURE__*/_jsxs("div", {
|
|
1578
1683
|
...{
|
|
1579
1684
|
className: "x1vjfegm x78zum5 x6s0dn4 x1qughib x1txdalj x8o8v82 x1pzlopt x10xzikg x1n2onr6 xdd4er5 x2lah0s"
|
|
1580
1685
|
},
|
|
@@ -1590,7 +1695,7 @@ export function PowerSearchBottomSheet({
|
|
|
1590
1695
|
variant: "primary",
|
|
1591
1696
|
size: "lg",
|
|
1592
1697
|
xstyle: isClearAllShown ? styles.footerEqualAction : [styles.footerSoleAction, styles.touchHitArea],
|
|
1593
|
-
onClick:
|
|
1698
|
+
onClick: commitAndClose,
|
|
1594
1699
|
width: isClearAllShown ? undefined : '100%'
|
|
1595
1700
|
})]
|
|
1596
1701
|
})]
|
|
@@ -1776,7 +1881,7 @@ export function PowerSearchBottomSheet({
|
|
|
1776
1881
|
variant: "primary",
|
|
1777
1882
|
width: "100%",
|
|
1778
1883
|
xstyle: styles.touchAction,
|
|
1779
|
-
onClick:
|
|
1884
|
+
onClick: commitAndClose
|
|
1780
1885
|
})
|
|
1781
1886
|
})]
|
|
1782
1887
|
})
|
|
@@ -1913,6 +2018,22 @@ export function PowerSearchBottomSheet({
|
|
|
1913
2018
|
actionLabel: t('@astryx.powersearch.sheet.clearAllConfirm'),
|
|
1914
2019
|
cancelLabel: t('@astryx.powersearch.sheet.clearAllCancel'),
|
|
1915
2020
|
onAction: () => closeClearConfirmation(true)
|
|
2021
|
+
}), isDiscardConfirmationOpen && /*#__PURE__*/_jsx(SheetConfirmation, {
|
|
2022
|
+
isOpen: true,
|
|
2023
|
+
onOpenChange: isConfirmationOpen => {
|
|
2024
|
+
if (!isConfirmationOpen) {
|
|
2025
|
+
closeDiscardConfirmation();
|
|
2026
|
+
}
|
|
2027
|
+
},
|
|
2028
|
+
title: t('@astryx.powersearch.sheet.discardTitle'),
|
|
2029
|
+
description: t('@astryx.powersearch.sheet.discardDescription'),
|
|
2030
|
+
actionLabel: t('@astryx.powersearch.sheet.discardConfirm'),
|
|
2031
|
+
cancelLabel: t('@astryx.powersearch.sheet.keepEditing'),
|
|
2032
|
+
onAction: () => {
|
|
2033
|
+
setIsDiscardConfirmationOpen(false);
|
|
2034
|
+
draftEditsRef.current = [];
|
|
2035
|
+
closeFlow();
|
|
2036
|
+
}
|
|
1916
2037
|
})]
|
|
1917
2038
|
});
|
|
1918
2039
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResizeHandle.d.ts","sourceRoot":"","sources":["../../src/Resizable/ResizeHandle.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAiB,SAAS,EAAC,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAU5C,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ResizeHandle.d.ts","sourceRoot":"","sources":["../../src/Resizable/ResizeHandle.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAiB,SAAS,EAAC,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAU5C,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAmBxB,KAAK,aAAa,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AA8PzD,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAC7C,SAAS,CAAC,cAAc,CAAC,EACzB,OAAO,CACR;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC;;;OAGG;IACH,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IAEtC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAEhC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,6CAA6C;IAC7C,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B,yDAAyD;IACzD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,YAAY,CAAC,EAC3B,SAAwB,EACxB,QAAQ,EAAE,YAAuB,EACjC,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAsB,EACtB,aAAsB,EACtB,KAAK,EAAE,cAAc,EACrB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,iBAAiB,+BAsSnB;yBArTe,YAAY"}
|
|
@@ -19,6 +19,7 @@ import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
|
19
19
|
import { mergeProps, rtlStyles } from "../utils/index.js";
|
|
20
20
|
import { getCollapseControls, getEffectiveMaxPx } from "./useResizable.js";
|
|
21
21
|
import { createResizeGesture } from "./resizeGesture.js";
|
|
22
|
+
import { separatorAttributes } from "./separatorAttributes.js";
|
|
22
23
|
import { themeProps } from "../utils/themeProps.js";
|
|
23
24
|
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
24
25
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
@@ -410,20 +411,25 @@ export function ResizeHandle({
|
|
|
410
411
|
}, [hasRegion, regionGesture]);
|
|
411
412
|
|
|
412
413
|
// --- ARIA ---
|
|
413
|
-
// When collapsed the panel's real size (0) sits below aria-valuemin, which
|
|
414
|
-
// is invalid per WCAG 4.1.2. Clamp aria-valuenow to the minimum and announce
|
|
415
|
-
// the true state via aria-valuetext instead; the valuetext is removed as
|
|
416
|
-
// soon as the panel expands so the numeric value reads again.
|
|
417
414
|
const sizeNow = resizable?._size;
|
|
418
415
|
const minNow = resizable?._minSizePx;
|
|
419
|
-
const ariaValueNow = sizeNow == null || minNow == null ? undefined : isCollapsed ? Math.max(sizeNow, minNow) : sizeNow;
|
|
420
|
-
const ariaValueMin = minNow;
|
|
421
416
|
// A separator with a value needs a maximum (WAI-ARIA, APG window splitter).
|
|
422
417
|
// Unbounded regions report the basis they can fill; a hand-built props
|
|
423
418
|
// object without it reports only a configured maximum.
|
|
424
419
|
const effectiveMax = resizable ? getEffectiveMaxPx(resizable) ?? (resizable._maxSizePx !== Infinity ? resizable._maxSizePx : undefined) : undefined;
|
|
425
|
-
|
|
426
|
-
|
|
420
|
+
// The attributes createResizable writes on a plain element, from the same
|
|
421
|
+
// derivation.
|
|
422
|
+
const aria = separatorAttributes({
|
|
423
|
+
direction,
|
|
424
|
+
isDisabled,
|
|
425
|
+
value: sizeNow == null || minNow == null ? undefined : {
|
|
426
|
+
size: sizeNow,
|
|
427
|
+
minPx: minNow,
|
|
428
|
+
maxPx: effectiveMax,
|
|
429
|
+
isCollapsed,
|
|
430
|
+
collapsedText: t('@astryx.resizable.collapsed')
|
|
431
|
+
}
|
|
432
|
+
});
|
|
427
433
|
|
|
428
434
|
// The Grip pill takes the pointer as the Grab zone does, so a pill drawn
|
|
429
435
|
// outside the zone still resizes.
|
|
@@ -447,14 +453,8 @@ export function ResizeHandle({
|
|
|
447
453
|
return /*#__PURE__*/_jsxs("div", {
|
|
448
454
|
ref: useMergedRefs(ref, handleRef),
|
|
449
455
|
role: "separator",
|
|
450
|
-
|
|
451
|
-
"aria-valuenow": ariaValueNow,
|
|
452
|
-
"aria-valuemin": ariaValueMin,
|
|
453
|
-
"aria-valuemax": ariaValueMax,
|
|
454
|
-
"aria-valuetext": ariaValueText,
|
|
456
|
+
...aria,
|
|
455
457
|
"aria-label": label,
|
|
456
|
-
"aria-disabled": isDisabled || undefined,
|
|
457
|
-
tabIndex: isDisabled ? -1 : 0,
|
|
458
458
|
onDoubleClick: () => {
|
|
459
459
|
if (!isDisabled) {
|
|
460
460
|
gesture?.doubleClick();
|