@gtkx/testing 1.0.0-rc.2 → 1.0.0-rc.3
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/bound-queries.d.ts +2 -3
- package/dist/bound-queries.d.ts.map +1 -1
- package/dist/bound-queries.js.map +1 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/matchers.d.ts +81 -21
- package/dist/matchers.d.ts.map +1 -1
- package/dist/matchers.js +258 -21
- package/dist/matchers.js.map +1 -1
- package/dist/normalize.d.ts +10 -0
- package/dist/normalize.d.ts.map +1 -0
- package/dist/normalize.js +20 -0
- package/dist/normalize.js.map +1 -0
- package/dist/queries.d.ts +3 -21
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +46 -59
- package/dist/queries.js.map +1 -1
- package/dist/render.js +1 -1
- package/dist/render.js.map +1 -1
- package/dist/types.d.ts +29 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/user-event/controller.d.ts +2 -1
- package/dist/user-event/controller.d.ts.map +1 -1
- package/dist/user-event/controller.js +8 -1
- package/dist/user-event/controller.js.map +1 -1
- package/dist/widget-accessible-properties.d.ts +12 -2
- package/dist/widget-accessible-properties.d.ts.map +1 -1
- package/dist/widget-accessible-properties.js +112 -10
- package/dist/widget-accessible-properties.js.map +1 -1
- package/dist/within.js.map +1 -1
- package/package.json +6 -6
- package/src/bound-queries.ts +2 -3
- package/src/index.ts +11 -2
- package/src/matchers.ts +456 -53
- package/src/normalize.ts +28 -0
- package/src/queries.ts +78 -105
- package/src/render.tsx +1 -1
- package/src/types.ts +48 -2
- package/src/user-event/controller.ts +21 -1
- package/src/widget-accessible-properties.ts +172 -10
- package/src/within.ts +1 -1
package/dist/queries.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as Gtk from "@gtkx/gi/gtk";
|
|
2
2
|
import { buildQueries } from "./build-queries.js";
|
|
3
3
|
import { multipleFoundError, notFoundError } from "./errors.js";
|
|
4
|
+
import { getDefaultNormalizer } from "./normalize.js";
|
|
4
5
|
import { findAll, traverse } from "./traversal.js";
|
|
5
|
-
import { getWidgetAccessibleName, getWidgetBusyState,
|
|
6
|
+
import { getWidgetAccessibleName, getWidgetBusyState, getWidgetDescription, getWidgetDisplayValue, getWidgetExpandedState, getWidgetLabelledByText, getWidgetLabelText, getWidgetLevel, getWidgetName, getWidgetOwnLabel, getWidgetPlaceholderText, getWidgetPressedState, getWidgetSelectedState, getWidgetValue, isInaccessible, isWidgetChecked, } from "./widget-accessible-properties.js";
|
|
6
7
|
const roleQueries = nameQueryFamily("Role", queryAllByRole, buildQueries("Role", queryAllByRole, (container, matches, role, options) => multipleFoundError(container, { queryType: "role", role, options }, matches), (container, role, options) => notFoundError(container, { queryType: "role", role, options })));
|
|
7
8
|
const labelTextQueries = nameQueryFamily("LabelText", queryAllByLabelText, buildQueries("LabelText", queryAllByLabelText, (container, matches, text) => multipleFoundError(container, { queryType: "labelText", text }, matches), (container, text) => notFoundError(container, { queryType: "labelText", text })));
|
|
8
9
|
const textQueries = nameQueryFamily("Text", queryAllByText, buildQueries("Text", queryAllByText, (container, matches, text) => multipleFoundError(container, { queryType: "text", text }, matches), (container, text) => notFoundError(container, { queryType: "text", text })));
|
|
@@ -21,137 +22,119 @@ const builtinQueries = {
|
|
|
21
22
|
* Returns the single widget with a matching accessible role and options, or null when none match.
|
|
22
23
|
* Throws when more than one matches.
|
|
23
24
|
*/
|
|
24
|
-
const queryByRole =
|
|
25
|
+
const queryByRole = builtinQueries.queryByRole;
|
|
25
26
|
/** Returns every widget with a matching accessible role and options. Throws when none match. */
|
|
26
|
-
const getAllByRole =
|
|
27
|
+
const getAllByRole = builtinQueries.getAllByRole;
|
|
27
28
|
/**
|
|
28
29
|
* Returns the single widget with a matching accessible role and options.
|
|
29
30
|
* Throws when none or more than one matches.
|
|
30
31
|
*/
|
|
31
|
-
const getByRole =
|
|
32
|
+
const getByRole = builtinQueries.getByRole;
|
|
32
33
|
/**
|
|
33
34
|
* Waits for and returns every widget with a matching accessible role and options, retrying until at
|
|
34
35
|
* least one appears or the timeout elapses.
|
|
35
36
|
*/
|
|
36
|
-
const findAllByRole =
|
|
37
|
+
const findAllByRole = builtinQueries.findAllByRole;
|
|
37
38
|
/**
|
|
38
39
|
* Waits for and returns the single widget with a matching accessible role and options, retrying
|
|
39
40
|
* until it appears or the timeout elapses. Rejects when none or more than one matches.
|
|
40
41
|
*/
|
|
41
|
-
const findByRole =
|
|
42
|
+
const findByRole = builtinQueries.findByRole;
|
|
42
43
|
/**
|
|
43
44
|
* Returns the single widget with matching associated label text, or null when none match.
|
|
44
45
|
* Throws when more than one matches.
|
|
45
46
|
*/
|
|
46
|
-
const queryByLabelText =
|
|
47
|
+
const queryByLabelText = builtinQueries.queryByLabelText;
|
|
47
48
|
/** Returns every widget with matching associated label text. Throws when none match. */
|
|
48
|
-
const getAllByLabelText =
|
|
49
|
+
const getAllByLabelText = builtinQueries.getAllByLabelText;
|
|
49
50
|
/** Returns the single widget with matching associated label text. Throws when none or more than one matches. */
|
|
50
|
-
const getByLabelText =
|
|
51
|
+
const getByLabelText = builtinQueries.getByLabelText;
|
|
51
52
|
/**
|
|
52
53
|
* Waits for and returns every widget with matching associated label text, retrying until at least
|
|
53
54
|
* one appears or the timeout elapses.
|
|
54
55
|
*/
|
|
55
|
-
const findAllByLabelText =
|
|
56
|
+
const findAllByLabelText = builtinQueries.findAllByLabelText;
|
|
56
57
|
/**
|
|
57
58
|
* Waits for and returns the single widget with matching associated label text, retrying until it
|
|
58
59
|
* appears or the timeout elapses. Rejects when none or more than one matches.
|
|
59
60
|
*/
|
|
60
|
-
const findByLabelText =
|
|
61
|
+
const findByLabelText = builtinQueries.findByLabelText;
|
|
61
62
|
/**
|
|
62
63
|
* Returns the single widget with matching rendered text content, or null when none match.
|
|
63
64
|
* Throws when more than one matches.
|
|
64
65
|
*/
|
|
65
|
-
const queryByText =
|
|
66
|
+
const queryByText = builtinQueries.queryByText;
|
|
66
67
|
/** Returns every widget with matching rendered text content. Throws when none match. */
|
|
67
|
-
const getAllByText =
|
|
68
|
+
const getAllByText = builtinQueries.getAllByText;
|
|
68
69
|
/** Returns the single widget with matching rendered text content. Throws when none or more than one matches. */
|
|
69
|
-
const getByText =
|
|
70
|
+
const getByText = builtinQueries.getByText;
|
|
70
71
|
/**
|
|
71
72
|
* Waits for and returns every widget with matching rendered text content, retrying until at least
|
|
72
73
|
* one appears or the timeout elapses.
|
|
73
74
|
*/
|
|
74
|
-
const findAllByText =
|
|
75
|
+
const findAllByText = builtinQueries.findAllByText;
|
|
75
76
|
/**
|
|
76
77
|
* Waits for and returns the single widget with matching rendered text content, retrying until it
|
|
77
78
|
* appears or the timeout elapses. Rejects when none or more than one matches.
|
|
78
79
|
*/
|
|
79
|
-
const findByText =
|
|
80
|
+
const findByText = builtinQueries.findByText;
|
|
80
81
|
/**
|
|
81
82
|
* Returns the single widget with a matching widget name, or null when none match.
|
|
82
83
|
* Throws when more than one matches.
|
|
83
84
|
*/
|
|
84
|
-
const queryByName =
|
|
85
|
+
const queryByName = builtinQueries.queryByName;
|
|
85
86
|
/** Returns every widget with a matching widget name. Throws when none match. */
|
|
86
|
-
const getAllByName =
|
|
87
|
+
const getAllByName = builtinQueries.getAllByName;
|
|
87
88
|
/** Returns the single widget with a matching widget name. Throws when none or more than one matches. */
|
|
88
|
-
const getByName =
|
|
89
|
+
const getByName = builtinQueries.getByName;
|
|
89
90
|
/**
|
|
90
91
|
* Waits for and returns every widget with a matching widget name, retrying until at least one
|
|
91
92
|
* appears or the timeout elapses.
|
|
92
93
|
*/
|
|
93
|
-
const findAllByName =
|
|
94
|
+
const findAllByName = builtinQueries.findAllByName;
|
|
94
95
|
/**
|
|
95
96
|
* Waits for and returns the single widget with a matching widget name, retrying until it appears or
|
|
96
97
|
* the timeout elapses. Rejects when none or more than one matches.
|
|
97
98
|
*/
|
|
98
|
-
const findByName =
|
|
99
|
+
const findByName = builtinQueries.findByName;
|
|
99
100
|
/**
|
|
100
101
|
* Returns the single widget with matching placeholder text, or null when none match.
|
|
101
102
|
* Throws when more than one matches.
|
|
102
103
|
*/
|
|
103
|
-
const queryByPlaceholderText =
|
|
104
|
+
const queryByPlaceholderText = builtinQueries.queryByPlaceholderText;
|
|
104
105
|
/** Returns every widget with matching placeholder text. Throws when none match. */
|
|
105
|
-
const getAllByPlaceholderText =
|
|
106
|
+
const getAllByPlaceholderText = builtinQueries.getAllByPlaceholderText;
|
|
106
107
|
/** Returns the single widget with matching placeholder text. Throws when none or more than one matches. */
|
|
107
|
-
const getByPlaceholderText =
|
|
108
|
+
const getByPlaceholderText = builtinQueries.getByPlaceholderText;
|
|
108
109
|
/**
|
|
109
110
|
* Waits for and returns every widget with matching placeholder text, retrying until at least one
|
|
110
111
|
* appears or the timeout elapses.
|
|
111
112
|
*/
|
|
112
|
-
const findAllByPlaceholderText =
|
|
113
|
+
const findAllByPlaceholderText = builtinQueries.findAllByPlaceholderText;
|
|
113
114
|
/**
|
|
114
115
|
* Waits for and returns the single widget with matching placeholder text, retrying until it appears
|
|
115
116
|
* or the timeout elapses. Rejects when none or more than one matches.
|
|
116
117
|
*/
|
|
117
|
-
const findByPlaceholderText =
|
|
118
|
+
const findByPlaceholderText = builtinQueries.findByPlaceholderText;
|
|
118
119
|
/**
|
|
119
120
|
* Returns the single widget with a matching display value, or null when none match.
|
|
120
121
|
* Throws when more than one matches.
|
|
121
122
|
*/
|
|
122
|
-
const queryByDisplayValue =
|
|
123
|
+
const queryByDisplayValue = builtinQueries.queryByDisplayValue;
|
|
123
124
|
/** Returns every widget with a matching display value. Throws when none match. */
|
|
124
|
-
const getAllByDisplayValue =
|
|
125
|
+
const getAllByDisplayValue = builtinQueries.getAllByDisplayValue;
|
|
125
126
|
/** Returns the single widget with a matching display value. Throws when none or more than one matches. */
|
|
126
|
-
const getByDisplayValue =
|
|
127
|
+
const getByDisplayValue = builtinQueries.getByDisplayValue;
|
|
127
128
|
/**
|
|
128
129
|
* Waits for and returns every widget with a matching display value, retrying until at least one
|
|
129
130
|
* appears or the timeout elapses.
|
|
130
131
|
*/
|
|
131
|
-
const findAllByDisplayValue =
|
|
132
|
+
const findAllByDisplayValue = builtinQueries.findAllByDisplayValue;
|
|
132
133
|
/**
|
|
133
134
|
* Waits for and returns the single widget with a matching display value, retrying until it appears
|
|
134
135
|
* or the timeout elapses. Rejects when none or more than one matches.
|
|
135
136
|
*/
|
|
136
|
-
const findByDisplayValue =
|
|
137
|
-
/**
|
|
138
|
-
* Builds the default text normalizer, which optionally trims surrounding whitespace and collapses
|
|
139
|
-
* runs of whitespace into single spaces.
|
|
140
|
-
* @param options Toggles for trimming and whitespace collapsing.
|
|
141
|
-
* @returns A function that normalizes a string for comparison against a matcher.
|
|
142
|
-
*/
|
|
143
|
-
const getDefaultNormalizer = ({ trim = true, collapseWhitespace = true, } = {}) => {
|
|
144
|
-
return (text) => {
|
|
145
|
-
let result = text;
|
|
146
|
-
if (trim) {
|
|
147
|
-
result = result.trim();
|
|
148
|
-
}
|
|
149
|
-
if (collapseWhitespace) {
|
|
150
|
-
result = result.replaceAll(/\s+/g, " ");
|
|
151
|
-
}
|
|
152
|
-
return result;
|
|
153
|
-
};
|
|
154
|
-
};
|
|
137
|
+
const findByDisplayValue = builtinQueries.findByDisplayValue;
|
|
155
138
|
const buildNormalizer = (options) => {
|
|
156
139
|
const { normalizer, trim, collapseWhitespace } = options ?? {};
|
|
157
140
|
if (!normalizer) {
|
|
@@ -210,7 +193,7 @@ const hasMatchingAccessibleValue = (widget, value, options) => {
|
|
|
210
193
|
};
|
|
211
194
|
const hasMatchingBooleanStates = (widget, options) => {
|
|
212
195
|
const stateChecks = [
|
|
213
|
-
[options.checked, () =>
|
|
196
|
+
[options.checked, () => isWidgetChecked(widget)],
|
|
214
197
|
[options.pressed, () => getWidgetPressedState(widget)],
|
|
215
198
|
[options.expanded, () => getWidgetExpandedState(widget)],
|
|
216
199
|
[options.selected, () => getWidgetSelectedState(widget)],
|
|
@@ -231,14 +214,17 @@ const hasMatchingAccessibleStates = (widget, options) => hasMatchingBooleanState
|
|
|
231
214
|
hasMatchingLevelState(widget, options) &&
|
|
232
215
|
hasMatchingDescriptionState(widget, options) &&
|
|
233
216
|
hasMatchingValueState(widget, options);
|
|
217
|
+
const isMatchingWidgetType = (widget, options) => options?.as === undefined || widget instanceof options.as;
|
|
234
218
|
const hasMatchingByRoleOptions = (widget, options) => {
|
|
235
219
|
if (!options) {
|
|
236
220
|
return true;
|
|
237
221
|
}
|
|
238
|
-
return
|
|
222
|
+
return (isMatchingWidgetType(widget, options) &&
|
|
223
|
+
hasMatchingAccessibleName(widget, options) &&
|
|
224
|
+
hasMatchingAccessibleStates(widget, options));
|
|
239
225
|
};
|
|
240
226
|
function nameQueryFamily(suffix, queryAllBy, built) {
|
|
241
|
-
|
|
227
|
+
return {
|
|
242
228
|
[`queryBy${suffix}`]: built.queryBy,
|
|
243
229
|
[`queryAllBy${suffix}`]: queryAllBy,
|
|
244
230
|
[`getBy${suffix}`]: built.getBy,
|
|
@@ -246,7 +232,6 @@ function nameQueryFamily(suffix, queryAllBy, built) {
|
|
|
246
232
|
[`findBy${suffix}`]: built.findBy,
|
|
247
233
|
[`findAllBy${suffix}`]: built.findAllBy,
|
|
248
234
|
};
|
|
249
|
-
return family;
|
|
250
235
|
}
|
|
251
236
|
/**
|
|
252
237
|
* Finds every widget under the container whose accessible role matches `role` and that satisfies the given options.
|
|
@@ -304,7 +289,7 @@ function queryAllByLabelText(container, text, options) {
|
|
|
304
289
|
for (const widget of traverse(container)) {
|
|
305
290
|
collectLabelMatches(results, widget, text, options);
|
|
306
291
|
}
|
|
307
|
-
return [...results];
|
|
292
|
+
return [...results].filter((widget) => isMatchingWidgetType(widget, options));
|
|
308
293
|
}
|
|
309
294
|
/**
|
|
310
295
|
* Finds every widget whose rendered text content matches.
|
|
@@ -314,7 +299,7 @@ function queryAllByLabelText(container, text, options) {
|
|
|
314
299
|
* @returns Every matching widget, or an empty array when none match.
|
|
315
300
|
*/
|
|
316
301
|
function queryAllByText(container, text, options) {
|
|
317
|
-
return findAll(container, (widget) => isTextMatch(getWidgetLabelText(widget), text, widget, options));
|
|
302
|
+
return findAll(container, (widget) => isMatchingWidgetType(widget, options) && isTextMatch(getWidgetLabelText(widget), text, widget, options));
|
|
318
303
|
}
|
|
319
304
|
/**
|
|
320
305
|
* Finds every widget whose widget name matches.
|
|
@@ -324,7 +309,7 @@ function queryAllByText(container, text, options) {
|
|
|
324
309
|
* @returns Every matching widget, or an empty array when none match.
|
|
325
310
|
*/
|
|
326
311
|
function queryAllByName(container, name, options) {
|
|
327
|
-
return findAll(container, (widget) => isTextMatch(getWidgetName(widget), name, widget, options));
|
|
312
|
+
return findAll(container, (widget) => isMatchingWidgetType(widget, options) && isTextMatch(getWidgetName(widget), name, widget, options));
|
|
328
313
|
}
|
|
329
314
|
/**
|
|
330
315
|
* Finds every widget whose placeholder text matches.
|
|
@@ -334,7 +319,8 @@ function queryAllByName(container, name, options) {
|
|
|
334
319
|
* @returns Every matching widget, or an empty array when none match.
|
|
335
320
|
*/
|
|
336
321
|
function queryAllByPlaceholderText(container, text, options) {
|
|
337
|
-
return findAll(container, (widget) =>
|
|
322
|
+
return findAll(container, (widget) => isMatchingWidgetType(widget, options) &&
|
|
323
|
+
isTextMatch(getWidgetPlaceholderText(widget), text, widget, options));
|
|
338
324
|
}
|
|
339
325
|
/**
|
|
340
326
|
* Finds every widget whose current display value matches.
|
|
@@ -344,7 +330,8 @@ function queryAllByPlaceholderText(container, text, options) {
|
|
|
344
330
|
* @returns Every matching widget, or an empty array when none match.
|
|
345
331
|
*/
|
|
346
332
|
function queryAllByDisplayValue(container, value, options) {
|
|
347
|
-
return findAll(container, (widget) =>
|
|
333
|
+
return findAll(container, (widget) => isMatchingWidgetType(widget, options) &&
|
|
334
|
+
isTextMatch(getWidgetDisplayValue(widget), value, widget, options));
|
|
348
335
|
}
|
|
349
|
-
export { builtinQueries, queryByRole, getAllByRole, getByRole, findAllByRole, findByRole, queryByLabelText, getAllByLabelText, getByLabelText, findAllByLabelText, findByLabelText, queryByText, getAllByText, getByText, findAllByText, findByText, queryByName, getAllByName, getByName, findAllByName, findByName, queryByPlaceholderText, getAllByPlaceholderText, getByPlaceholderText, findAllByPlaceholderText, findByPlaceholderText, queryByDisplayValue, getAllByDisplayValue, getByDisplayValue, findAllByDisplayValue, findByDisplayValue,
|
|
336
|
+
export { builtinQueries, queryByRole, getAllByRole, getByRole, findAllByRole, findByRole, queryByLabelText, getAllByLabelText, getByLabelText, findAllByLabelText, findByLabelText, queryByText, getAllByText, getByText, findAllByText, findByText, queryByName, getAllByName, getByName, findAllByName, findByName, queryByPlaceholderText, getAllByPlaceholderText, getByPlaceholderText, findAllByPlaceholderText, findByPlaceholderText, queryByDisplayValue, getAllByDisplayValue, getByDisplayValue, findAllByDisplayValue, findByDisplayValue, queryAllByRole, queryAllByLabelText, queryAllByText, queryAllByName, queryAllByPlaceholderText, queryAllByDisplayValue, };
|
|
350
337
|
//# sourceMappingURL=queries.js.map
|
package/dist/queries.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAsC,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAkB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EACH,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,wBAAwB,E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AC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACrG,CAAC;AAED;;;;;;GAMG;AACH,SAAS,yBAAyB,CAC9B,SAAoB,EACpB,IAAa,EACb,OAAwB;IAExB,OAAO,OAAO,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAChH,CAAC;AAED;;;;;;GAMG;AACH,SAAS,sBAAsB,CAAC,SAAoB,EAAE,KAAc,EAAE,OAAwB;IAC1F,OAAO,OAAO,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAC9G,CAAC;AAED,OAAO,EACH,cAAc,EACd,WAAW,EACX,YAAY,EACZ,SAAS,EACT,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,YAAY,EACZ,SAAS,EACT,aAAa,EACb,UAAU,EACV,WAAW,EACX,YAAY,EACZ,SAAS,EACT,aAAa,EACb,UAAU,EACV,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,sBAAsB,GAEzB,CAAC","sourcesContent":["import * as Gtk from \"@gtkx/gi/gtk\";\nimport type { ByRoleOptions, ByRoleValue, Matcher, MatcherOptions, NormalizerFn, NormalizerOptions } from \"./types.js\";\nimport { buildQueries, type BuiltQueries, type QueryAllBy } from \"./build-queries.js\";\nimport { multipleFoundError, notFoundError } from \"./errors.js\";\nimport { type Container, findAll, traverse } from \"./traversal.js\";\nimport {\n getWidgetAccessibleName,\n getWidgetBusyState,\n getWidgetCheckedState,\n getWidgetDescription,\n getWidgetDisplayValue,\n getWidgetExpandedState,\n getWidgetLabelledByText,\n getWidgetLabelText,\n getWidgetLevel,\n getWidgetName,\n getWidgetOwnLabel,\n getWidgetPlaceholderText,\n getWidgetPressedState,\n getWidgetSelectedState,\n getWidgetValue,\n isInaccessible,\n} from \"./widget-accessible-properties.js\";\n\ntype QueryFamilyReturns = {\n queryBy: Gtk.Widget | null;\n queryAllBy: Gtk.Widget[];\n getBy: Gtk.Widget;\n getAllBy: Gtk.Widget[];\n findBy: Promise<Gtk.Widget>;\n findAllBy: Promise<Gtk.Widget[]>;\n};\n\ntype NamedFamily<Suffix extends string, Args extends unknown[]> = {\n [K in keyof QueryFamilyReturns as `${K & string}${Suffix}`]: (\n container: Container,\n ...args: Args\n ) => QueryFamilyReturns[K];\n};\n\ntype BuiltinQueries = NamedFamily<\"Role\", [role: Gtk.AccessibleRole, options?: ByRoleOptions]> &\n NamedFamily<\"LabelText\", [text: Matcher, options?: MatcherOptions]> &\n NamedFamily<\"Text\", [text: Matcher, options?: MatcherOptions]> &\n NamedFamily<\"Name\", [name: Matcher, options?: MatcherOptions]> &\n NamedFamily<\"PlaceholderText\", [text: Matcher, options?: MatcherOptions]> &\n NamedFamily<\"DisplayValue\", [value: Matcher, options?: MatcherOptions]>;\n\nconst roleQueries = nameQueryFamily(\n \"Role\",\n queryAllByRole,\n buildQueries<[role: Gtk.AccessibleRole, options?: ByRoleOptions]>(\n \"Role\",\n queryAllByRole,\n (container, matches, role, options) =>\n multipleFoundError(container, { queryType: \"role\", role, options }, matches),\n (container, role, options) => notFoundError(container, { queryType: \"role\", role, options }),\n ),\n);\n\nconst labelTextQueries = nameQueryFamily(\n \"LabelText\",\n queryAllByLabelText,\n buildQueries<[text: Matcher, options?: MatcherOptions]>(\n \"LabelText\",\n queryAllByLabelText,\n (container, matches, text) => multipleFoundError(container, { queryType: \"labelText\", text }, matches),\n (container, text) => notFoundError(container, { queryType: \"labelText\", text }),\n ),\n);\n\nconst textQueries = nameQueryFamily(\n \"Text\",\n queryAllByText,\n buildQueries<[text: Matcher, options?: MatcherOptions]>(\n \"Text\",\n queryAllByText,\n (container, matches, text) => multipleFoundError(container, { queryType: \"text\", text }, matches),\n (container, text) => notFoundError(container, { queryType: \"text\", text }),\n ),\n);\n\nconst nameQueries = nameQueryFamily(\n \"Name\",\n queryAllByName,\n buildQueries<[name: Matcher, options?: MatcherOptions]>(\n \"Name\",\n queryAllByName,\n (container, matches, name) => multipleFoundError(container, { queryType: \"name\", name }, matches),\n (container, name) => notFoundError(container, { queryType: \"name\", name }),\n ),\n);\n\nconst placeholderTextQueries = nameQueryFamily(\n \"PlaceholderText\",\n queryAllByPlaceholderText,\n buildQueries<[text: Matcher, options?: MatcherOptions]>(\n \"PlaceholderText\",\n queryAllByPlaceholderText,\n (container, matches, text) => multipleFoundError(container, { queryType: \"placeholderText\", text }, matches),\n (container, text) => notFoundError(container, { queryType: \"placeholderText\", text }),\n ),\n);\n\nconst displayValueQueries = nameQueryFamily(\n \"DisplayValue\",\n queryAllByDisplayValue,\n buildQueries<[value: Matcher, options?: MatcherOptions]>(\n \"DisplayValue\",\n queryAllByDisplayValue,\n (container, matches, value) => multipleFoundError(container, { queryType: \"displayValue\", value }, matches),\n (container, value) => notFoundError(container, { queryType: \"displayValue\", value }),\n ),\n);\n\nconst builtinQueries: BuiltinQueries = {\n ...roleQueries,\n ...labelTextQueries,\n ...textQueries,\n ...nameQueries,\n ...placeholderTextQueries,\n ...displayValueQueries,\n};\n\n/**\n * Returns the single widget with a matching accessible role and options, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByRole: BuiltinQueries[\"queryByRole\"] = roleQueries.queryByRole;\n/** Returns every widget with a matching accessible role and options. Throws when none match. */\nconst getAllByRole: BuiltinQueries[\"getAllByRole\"] = roleQueries.getAllByRole;\n/**\n * Returns the single widget with a matching accessible role and options.\n * Throws when none or more than one matches.\n */\nconst getByRole: BuiltinQueries[\"getByRole\"] = roleQueries.getByRole;\n/**\n * Waits for and returns every widget with a matching accessible role and options, retrying until at\n * least one appears or the timeout elapses.\n */\nconst findAllByRole: BuiltinQueries[\"findAllByRole\"] = roleQueries.findAllByRole;\n/**\n * Waits for and returns the single widget with a matching accessible role and options, retrying\n * until it appears or the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByRole: BuiltinQueries[\"findByRole\"] = roleQueries.findByRole;\n/**\n * Returns the single widget with matching associated label text, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByLabelText: BuiltinQueries[\"queryByLabelText\"] = labelTextQueries.queryByLabelText;\n/** Returns every widget with matching associated label text. Throws when none match. */\nconst getAllByLabelText: BuiltinQueries[\"getAllByLabelText\"] = labelTextQueries.getAllByLabelText;\n/** Returns the single widget with matching associated label text. Throws when none or more than one matches. */\nconst getByLabelText: BuiltinQueries[\"getByLabelText\"] = labelTextQueries.getByLabelText;\n/**\n * Waits for and returns every widget with matching associated label text, retrying until at least\n * one appears or the timeout elapses.\n */\nconst findAllByLabelText: BuiltinQueries[\"findAllByLabelText\"] = labelTextQueries.findAllByLabelText;\n/**\n * Waits for and returns the single widget with matching associated label text, retrying until it\n * appears or the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByLabelText: BuiltinQueries[\"findByLabelText\"] = labelTextQueries.findByLabelText;\n/**\n * Returns the single widget with matching rendered text content, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByText: BuiltinQueries[\"queryByText\"] = textQueries.queryByText;\n/** Returns every widget with matching rendered text content. Throws when none match. */\nconst getAllByText: BuiltinQueries[\"getAllByText\"] = textQueries.getAllByText;\n/** Returns the single widget with matching rendered text content. Throws when none or more than one matches. */\nconst getByText: BuiltinQueries[\"getByText\"] = textQueries.getByText;\n/**\n * Waits for and returns every widget with matching rendered text content, retrying until at least\n * one appears or the timeout elapses.\n */\nconst findAllByText: BuiltinQueries[\"findAllByText\"] = textQueries.findAllByText;\n/**\n * Waits for and returns the single widget with matching rendered text content, retrying until it\n * appears or the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByText: BuiltinQueries[\"findByText\"] = textQueries.findByText;\n/**\n * Returns the single widget with a matching widget name, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByName: BuiltinQueries[\"queryByName\"] = nameQueries.queryByName;\n/** Returns every widget with a matching widget name. Throws when none match. */\nconst getAllByName: BuiltinQueries[\"getAllByName\"] = nameQueries.getAllByName;\n/** Returns the single widget with a matching widget name. Throws when none or more than one matches. */\nconst getByName: BuiltinQueries[\"getByName\"] = nameQueries.getByName;\n/**\n * Waits for and returns every widget with a matching widget name, retrying until at least one\n * appears or the timeout elapses.\n */\nconst findAllByName: BuiltinQueries[\"findAllByName\"] = nameQueries.findAllByName;\n/**\n * Waits for and returns the single widget with a matching widget name, retrying until it appears or\n * the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByName: BuiltinQueries[\"findByName\"] = nameQueries.findByName;\n\n/**\n * Returns the single widget with matching placeholder text, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByPlaceholderText: BuiltinQueries[\"queryByPlaceholderText\"] =\n placeholderTextQueries.queryByPlaceholderText;\n\n/** Returns every widget with matching placeholder text. Throws when none match. */\nconst getAllByPlaceholderText: BuiltinQueries[\"getAllByPlaceholderText\"] =\n placeholderTextQueries.getAllByPlaceholderText;\n\n/** Returns the single widget with matching placeholder text. Throws when none or more than one matches. */\nconst getByPlaceholderText: BuiltinQueries[\"getByPlaceholderText\"] = placeholderTextQueries.getByPlaceholderText;\n\n/**\n * Waits for and returns every widget with matching placeholder text, retrying until at least one\n * appears or the timeout elapses.\n */\nconst findAllByPlaceholderText: BuiltinQueries[\"findAllByPlaceholderText\"] =\n placeholderTextQueries.findAllByPlaceholderText;\n\n/**\n * Waits for and returns the single widget with matching placeholder text, retrying until it appears\n * or the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByPlaceholderText: BuiltinQueries[\"findByPlaceholderText\"] =\n placeholderTextQueries.findByPlaceholderText;\n\n/**\n * Returns the single widget with a matching display value, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByDisplayValue: BuiltinQueries[\"queryByDisplayValue\"] = displayValueQueries.queryByDisplayValue;\n/** Returns every widget with a matching display value. Throws when none match. */\nconst getAllByDisplayValue: BuiltinQueries[\"getAllByDisplayValue\"] = displayValueQueries.getAllByDisplayValue;\n/** Returns the single widget with a matching display value. Throws when none or more than one matches. */\nconst getByDisplayValue: BuiltinQueries[\"getByDisplayValue\"] = displayValueQueries.getByDisplayValue;\n/**\n * Waits for and returns every widget with a matching display value, retrying until at least one\n * appears or the timeout elapses.\n */\nconst findAllByDisplayValue: BuiltinQueries[\"findAllByDisplayValue\"] = displayValueQueries.findAllByDisplayValue;\n/**\n * Waits for and returns the single widget with a matching display value, retrying until it appears\n * or the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByDisplayValue: BuiltinQueries[\"findByDisplayValue\"] = displayValueQueries.findByDisplayValue;\n\n/**\n * Builds the default text normalizer, which optionally trims surrounding whitespace and collapses\n * runs of whitespace into single spaces.\n * @param options Toggles for trimming and whitespace collapsing.\n * @returns A function that normalizes a string for comparison against a matcher.\n */\nconst getDefaultNormalizer = ({\n trim = true,\n collapseWhitespace = true,\n}: NormalizerOptions = {}): NormalizerFn => {\n return (text: string): string => {\n let result = text;\n\n if (trim) {\n result = result.trim();\n }\n\n if (collapseWhitespace) {\n result = result.replaceAll(/\\s+/g, \" \");\n }\n\n return result;\n };\n};\n\nconst buildNormalizer = (options?: MatcherOptions): NormalizerFn => {\n const { normalizer, trim, collapseWhitespace } = options ?? {};\n\n if (!normalizer) {\n return getDefaultNormalizer({ trim, collapseWhitespace });\n }\n\n if (trim !== undefined || collapseWhitespace !== undefined) {\n throw new Error(\n \"trim and collapseWhitespace are not supported with a normalizer. \" +\n \"If you want to use the default trim and collapseWhitespace logic in your normalizer, \" +\n \"use \\\"getDefaultNormalizer({ trim, collapseWhitespace })\\\" and compose that into your normalizer\",\n );\n }\n\n return normalizer;\n};\n\nconst normalizeText = (text: string, options?: MatcherOptions): string => {\n const normalizer = buildNormalizer(options);\n\n return normalizer(text);\n};\n\nconst isTextMatch = (\n actual: string | null,\n expected: Matcher,\n widget: Gtk.Widget,\n options?: MatcherOptions,\n): boolean => {\n if (actual === null) {\n return false;\n }\n\n const normalizedActual = normalizeText(actual, options);\n\n if (typeof expected === \"function\") {\n return expected(normalizedActual, widget);\n }\n\n if (expected instanceof RegExp) {\n expected.lastIndex = 0;\n\n return expected.test(normalizedActual);\n }\n\n const normalizedExpected = normalizeText(String(expected), options);\n const isExact = options?.exact ?? true;\n\n return isExact\n ? normalizedActual === normalizedExpected\n : normalizedActual.toLowerCase().includes(normalizedExpected.toLowerCase());\n};\n\nconst hasMatchingAccessibleName = (widget: Gtk.Widget, options: ByRoleOptions): boolean => {\n if (options.name === undefined) {\n return true;\n }\n\n const text = getWidgetAccessibleName(widget);\n\n return isTextMatch(text, options.name, widget, options);\n};\n\nconst isNumericValueMatch = (expected: number | undefined, actual: number | null): boolean =>\n expected === undefined || actual === expected;\n\nconst hasMatchingAccessibleValue = (widget: Gtk.Widget, value: ByRoleValue, options: ByRoleOptions): boolean => {\n const actual = getWidgetValue(widget);\n\n const numericChecks: [number | undefined, number | null][] = [\n [value.now, actual.now],\n [value.min, actual.min],\n [value.max, actual.max],\n ];\n\n for (const [expected, current] of numericChecks) {\n if (!isNumericValueMatch(expected, current)) {\n return false;\n }\n }\n\n return value.text === undefined || isTextMatch(actual.text, value.text, widget, options);\n};\n\nconst hasMatchingBooleanStates = (widget: Gtk.Widget, options: ByRoleOptions): boolean => {\n const stateChecks: [boolean | undefined, () => boolean | null][] = [\n [options.checked, () => getWidgetCheckedState(widget)],\n [options.pressed, () => getWidgetPressedState(widget)],\n [options.expanded, () => getWidgetExpandedState(widget)],\n [options.selected, () => getWidgetSelectedState(widget)],\n [options.busy, () => getWidgetBusyState(widget) ?? false],\n ];\n\n for (const [expected, getActual] of stateChecks) {\n if (expected !== undefined && getActual() !== expected) {\n return false;\n }\n }\n\n return true;\n};\n\nconst hasMatchingLevelState = (widget: Gtk.Widget, options: ByRoleOptions): boolean =>\n options.level === undefined || getWidgetLevel(widget) === options.level;\n\nconst hasMatchingDescriptionState = (widget: Gtk.Widget, options: ByRoleOptions): boolean =>\n options.description === undefined ||\n isTextMatch(getWidgetDescription(widget), options.description, widget, options);\n\nconst hasMatchingValueState = (widget: Gtk.Widget, options: ByRoleOptions): boolean =>\n options.value === undefined || hasMatchingAccessibleValue(widget, options.value, options);\n\nconst hasMatchingAccessibleStates = (widget: Gtk.Widget, options: ByRoleOptions): boolean =>\n hasMatchingBooleanStates(widget, options) &&\n hasMatchingLevelState(widget, options) &&\n hasMatchingDescriptionState(widget, options) &&\n hasMatchingValueState(widget, options);\n\nconst hasMatchingByRoleOptions = (widget: Gtk.Widget, options?: ByRoleOptions): boolean => {\n if (!options) {\n return true;\n }\n\n return hasMatchingAccessibleName(widget, options) && hasMatchingAccessibleStates(widget, options);\n};\n\nfunction nameQueryFamily<Suffix extends string, Args extends unknown[]>(\n suffix: Suffix,\n queryAllBy: QueryAllBy<Args>,\n built: BuiltQueries<Args>,\n): NamedFamily<Suffix, Args> {\n const family = {\n [`queryBy${suffix}`]: built.queryBy,\n [`queryAllBy${suffix}`]: queryAllBy,\n [`getBy${suffix}`]: built.getBy,\n [`getAllBy${suffix}`]: built.getAllBy,\n [`findBy${suffix}`]: built.findBy,\n [`findAllBy${suffix}`]: built.findAllBy,\n };\n\n return family as NamedFamily<Suffix, Args>;\n}\n\n/**\n * Finds every widget under the container whose accessible role matches `role` and that satisfies the given options.\n * Widgets excluded from the accessibility tree are skipped unless `options.hidden` is set.\n * @param container Widget subtree to search.\n * @param role Accessible role to match.\n * @param options Additional accessible name, state, and value constraints.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByRole(\n container: Container,\n role: Gtk.AccessibleRole,\n options?: ByRoleOptions,\n): Gtk.Widget[] {\n return findAll(container, (widget) => {\n if (widget.getAccessibleRole() !== role) {\n return false;\n }\n\n if (!options?.hidden && isInaccessible(widget)) {\n return false;\n }\n\n return hasMatchingByRoleOptions(widget, options);\n });\n}\n\nconst collectMnemonicMatch = (\n widget: Gtk.Widget,\n text: Matcher,\n options: MatcherOptions | undefined,\n): Gtk.Widget | null => {\n if (!(widget instanceof Gtk.Label)) {\n return null;\n }\n\n const labelText = widget.getLabel();\n\n if (!labelText || !isTextMatch(labelText, text, widget, options)) {\n return null;\n }\n\n return widget.getMnemonicWidget();\n};\n\nconst collectLabelMatches = (\n results: Set<Gtk.Widget>,\n widget: Gtk.Widget,\n text: Matcher,\n options: MatcherOptions | undefined,\n): void => {\n const mnemonicTarget = collectMnemonicMatch(widget, text, options);\n\n if (mnemonicTarget) {\n results.add(mnemonicTarget);\n }\n\n const ownLabel = getWidgetOwnLabel(widget);\n\n if (ownLabel !== null && isTextMatch(ownLabel, text, widget, options)) {\n results.add(widget);\n }\n\n const labelledByText = getWidgetLabelledByText(widget);\n\n if (labelledByText !== null && isTextMatch(labelledByText, text, widget, options)) {\n results.add(widget);\n }\n};\n\n/**\n * Finds every widget associated with a label whose text matches: a Gtk.Label mnemonic target, the\n * widget's own accessible label, or its labelled-by relation.\n * @param container Widget subtree to search.\n * @param text Matcher for the label text.\n * @param options Text matching options.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByLabelText(container: Container, text: Matcher, options?: MatcherOptions): Gtk.Widget[] {\n const results: Set<Gtk.Widget> = new Set();\n\n for (const widget of traverse(container)) {\n collectLabelMatches(results, widget, text, options);\n }\n\n return [...results];\n}\n\n/**\n * Finds every widget whose rendered text content matches.\n * @param container Widget subtree to search.\n * @param text Matcher for the widget text.\n * @param options Text matching options.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByText(container: Container, text: Matcher, options?: MatcherOptions): Gtk.Widget[] {\n return findAll(container, (widget) => isTextMatch(getWidgetLabelText(widget), text, widget, options));\n}\n\n/**\n * Finds every widget whose widget name matches.\n * @param container Widget subtree to search.\n * @param name Matcher for the widget name.\n * @param options Text matching options.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByName(container: Container, name: Matcher, options?: MatcherOptions): Gtk.Widget[] {\n return findAll(container, (widget) => isTextMatch(getWidgetName(widget), name, widget, options));\n}\n\n/**\n * Finds every widget whose placeholder text matches.\n * @param container Widget subtree to search.\n * @param text Matcher for the placeholder text.\n * @param options Text matching options.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByPlaceholderText(\n container: Container,\n text: Matcher,\n options?: MatcherOptions,\n): Gtk.Widget[] {\n return findAll(container, (widget) => isTextMatch(getWidgetPlaceholderText(widget), text, widget, options));\n}\n\n/**\n * Finds every widget whose current display value matches.\n * @param container Widget subtree to search.\n * @param value Matcher for the display value.\n * @param options Text matching options.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByDisplayValue(container: Container, value: Matcher, options?: MatcherOptions): Gtk.Widget[] {\n return findAll(container, (widget) => isTextMatch(getWidgetDisplayValue(widget), value, widget, options));\n}\n\nexport {\n builtinQueries,\n queryByRole,\n getAllByRole,\n getByRole,\n findAllByRole,\n findByRole,\n queryByLabelText,\n getAllByLabelText,\n getByLabelText,\n findAllByLabelText,\n findByLabelText,\n queryByText,\n getAllByText,\n getByText,\n findAllByText,\n findByText,\n queryByName,\n getAllByName,\n getByName,\n findAllByName,\n findByName,\n queryByPlaceholderText,\n getAllByPlaceholderText,\n getByPlaceholderText,\n findAllByPlaceholderText,\n findByPlaceholderText,\n queryByDisplayValue,\n getAllByDisplayValue,\n getByDisplayValue,\n findAllByDisplayValue,\n findByDisplayValue,\n getDefaultNormalizer,\n queryAllByRole,\n queryAllByLabelText,\n queryAllByText,\n queryAllByName,\n queryAllByPlaceholderText,\n queryAllByDisplayValue,\n type BuiltinQueries,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"que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AsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,sBAAsB,GAEzB,CAAC","sourcesContent":["import * as Gtk from \"@gtkx/gi/gtk\";\nimport type {\n ByRoleOptions,\n ByRoleValue,\n Matcher,\n MatcherOptions,\n NormalizerFn,\n QueryFamilies,\n} from \"./types.js\";\nimport { buildQueries, type BuiltQueries, type QueryAllBy } from \"./build-queries.js\";\nimport { multipleFoundError, notFoundError } from \"./errors.js\";\nimport { getDefaultNormalizer } from \"./normalize.js\";\nimport { type Container, findAll, traverse } from \"./traversal.js\";\nimport {\n getWidgetAccessibleName,\n getWidgetBusyState,\n getWidgetDescription,\n getWidgetDisplayValue,\n getWidgetExpandedState,\n getWidgetLabelledByText,\n getWidgetLabelText,\n getWidgetLevel,\n getWidgetName,\n getWidgetOwnLabel,\n getWidgetPlaceholderText,\n getWidgetPressedState,\n getWidgetSelectedState,\n getWidgetValue,\n isInaccessible,\n isWidgetChecked,\n} from \"./widget-accessible-properties.js\";\n\ntype BuiltinQueries = QueryFamilies<[container: Container]>;\n\nconst roleQueries = nameQueryFamily(\n \"Role\",\n queryAllByRole,\n buildQueries<[role: Gtk.AccessibleRole, options?: ByRoleOptions]>(\n \"Role\",\n queryAllByRole,\n (container, matches, role, options) =>\n multipleFoundError(container, { queryType: \"role\", role, options }, matches),\n (container, role, options) => notFoundError(container, { queryType: \"role\", role, options }),\n ),\n);\n\nconst labelTextQueries = nameQueryFamily(\n \"LabelText\",\n queryAllByLabelText,\n buildQueries<[text: Matcher, options?: MatcherOptions]>(\n \"LabelText\",\n queryAllByLabelText,\n (container, matches, text) => multipleFoundError(container, { queryType: \"labelText\", text }, matches),\n (container, text) => notFoundError(container, { queryType: \"labelText\", text }),\n ),\n);\n\nconst textQueries = nameQueryFamily(\n \"Text\",\n queryAllByText,\n buildQueries<[text: Matcher, options?: MatcherOptions]>(\n \"Text\",\n queryAllByText,\n (container, matches, text) => multipleFoundError(container, { queryType: \"text\", text }, matches),\n (container, text) => notFoundError(container, { queryType: \"text\", text }),\n ),\n);\n\nconst nameQueries = nameQueryFamily(\n \"Name\",\n queryAllByName,\n buildQueries<[name: Matcher, options?: MatcherOptions]>(\n \"Name\",\n queryAllByName,\n (container, matches, name) => multipleFoundError(container, { queryType: \"name\", name }, matches),\n (container, name) => notFoundError(container, { queryType: \"name\", name }),\n ),\n);\n\nconst placeholderTextQueries = nameQueryFamily(\n \"PlaceholderText\",\n queryAllByPlaceholderText,\n buildQueries<[text: Matcher, options?: MatcherOptions]>(\n \"PlaceholderText\",\n queryAllByPlaceholderText,\n (container, matches, text) => multipleFoundError(container, { queryType: \"placeholderText\", text }, matches),\n (container, text) => notFoundError(container, { queryType: \"placeholderText\", text }),\n ),\n);\n\nconst displayValueQueries = nameQueryFamily(\n \"DisplayValue\",\n queryAllByDisplayValue,\n buildQueries<[value: Matcher, options?: MatcherOptions]>(\n \"DisplayValue\",\n queryAllByDisplayValue,\n (container, matches, value) => multipleFoundError(container, { queryType: \"displayValue\", value }, matches),\n (container, value) => notFoundError(container, { queryType: \"displayValue\", value }),\n ),\n);\n\nconst builtinQueries = {\n ...roleQueries,\n ...labelTextQueries,\n ...textQueries,\n ...nameQueries,\n ...placeholderTextQueries,\n ...displayValueQueries,\n} as BuiltinQueries;\n\n/**\n * Returns the single widget with a matching accessible role and options, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByRole: BuiltinQueries[\"queryByRole\"] = builtinQueries.queryByRole;\n/** Returns every widget with a matching accessible role and options. Throws when none match. */\nconst getAllByRole: BuiltinQueries[\"getAllByRole\"] = builtinQueries.getAllByRole;\n/**\n * Returns the single widget with a matching accessible role and options.\n * Throws when none or more than one matches.\n */\nconst getByRole: BuiltinQueries[\"getByRole\"] = builtinQueries.getByRole;\n/**\n * Waits for and returns every widget with a matching accessible role and options, retrying until at\n * least one appears or the timeout elapses.\n */\nconst findAllByRole: BuiltinQueries[\"findAllByRole\"] = builtinQueries.findAllByRole;\n/**\n * Waits for and returns the single widget with a matching accessible role and options, retrying\n * until it appears or the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByRole: BuiltinQueries[\"findByRole\"] = builtinQueries.findByRole;\n/**\n * Returns the single widget with matching associated label text, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByLabelText: BuiltinQueries[\"queryByLabelText\"] = builtinQueries.queryByLabelText;\n/** Returns every widget with matching associated label text. Throws when none match. */\nconst getAllByLabelText: BuiltinQueries[\"getAllByLabelText\"] = builtinQueries.getAllByLabelText;\n/** Returns the single widget with matching associated label text. Throws when none or more than one matches. */\nconst getByLabelText: BuiltinQueries[\"getByLabelText\"] = builtinQueries.getByLabelText;\n/**\n * Waits for and returns every widget with matching associated label text, retrying until at least\n * one appears or the timeout elapses.\n */\nconst findAllByLabelText: BuiltinQueries[\"findAllByLabelText\"] = builtinQueries.findAllByLabelText;\n/**\n * Waits for and returns the single widget with matching associated label text, retrying until it\n * appears or the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByLabelText: BuiltinQueries[\"findByLabelText\"] = builtinQueries.findByLabelText;\n/**\n * Returns the single widget with matching rendered text content, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByText: BuiltinQueries[\"queryByText\"] = builtinQueries.queryByText;\n/** Returns every widget with matching rendered text content. Throws when none match. */\nconst getAllByText: BuiltinQueries[\"getAllByText\"] = builtinQueries.getAllByText;\n/** Returns the single widget with matching rendered text content. Throws when none or more than one matches. */\nconst getByText: BuiltinQueries[\"getByText\"] = builtinQueries.getByText;\n/**\n * Waits for and returns every widget with matching rendered text content, retrying until at least\n * one appears or the timeout elapses.\n */\nconst findAllByText: BuiltinQueries[\"findAllByText\"] = builtinQueries.findAllByText;\n/**\n * Waits for and returns the single widget with matching rendered text content, retrying until it\n * appears or the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByText: BuiltinQueries[\"findByText\"] = builtinQueries.findByText;\n/**\n * Returns the single widget with a matching widget name, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByName: BuiltinQueries[\"queryByName\"] = builtinQueries.queryByName;\n/** Returns every widget with a matching widget name. Throws when none match. */\nconst getAllByName: BuiltinQueries[\"getAllByName\"] = builtinQueries.getAllByName;\n/** Returns the single widget with a matching widget name. Throws when none or more than one matches. */\nconst getByName: BuiltinQueries[\"getByName\"] = builtinQueries.getByName;\n/**\n * Waits for and returns every widget with a matching widget name, retrying until at least one\n * appears or the timeout elapses.\n */\nconst findAllByName: BuiltinQueries[\"findAllByName\"] = builtinQueries.findAllByName;\n/**\n * Waits for and returns the single widget with a matching widget name, retrying until it appears or\n * the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByName: BuiltinQueries[\"findByName\"] = builtinQueries.findByName;\n/**\n * Returns the single widget with matching placeholder text, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByPlaceholderText: BuiltinQueries[\"queryByPlaceholderText\"] = builtinQueries.queryByPlaceholderText;\n/** Returns every widget with matching placeholder text. Throws when none match. */\nconst getAllByPlaceholderText: BuiltinQueries[\"getAllByPlaceholderText\"] = builtinQueries.getAllByPlaceholderText;\n/** Returns the single widget with matching placeholder text. Throws when none or more than one matches. */\nconst getByPlaceholderText: BuiltinQueries[\"getByPlaceholderText\"] = builtinQueries.getByPlaceholderText;\n/**\n * Waits for and returns every widget with matching placeholder text, retrying until at least one\n * appears or the timeout elapses.\n */\nconst findAllByPlaceholderText: BuiltinQueries[\"findAllByPlaceholderText\"] = builtinQueries.findAllByPlaceholderText;\n/**\n * Waits for and returns the single widget with matching placeholder text, retrying until it appears\n * or the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByPlaceholderText: BuiltinQueries[\"findByPlaceholderText\"] = builtinQueries.findByPlaceholderText;\n/**\n * Returns the single widget with a matching display value, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByDisplayValue: BuiltinQueries[\"queryByDisplayValue\"] = builtinQueries.queryByDisplayValue;\n/** Returns every widget with a matching display value. Throws when none match. */\nconst getAllByDisplayValue: BuiltinQueries[\"getAllByDisplayValue\"] = builtinQueries.getAllByDisplayValue;\n/** Returns the single widget with a matching display value. Throws when none or more than one matches. */\nconst getByDisplayValue: BuiltinQueries[\"getByDisplayValue\"] = builtinQueries.getByDisplayValue;\n/**\n * Waits for and returns every widget with a matching display value, retrying until at least one\n * appears or the timeout elapses.\n */\nconst findAllByDisplayValue: BuiltinQueries[\"findAllByDisplayValue\"] = builtinQueries.findAllByDisplayValue;\n/**\n * Waits for and returns the single widget with a matching display value, retrying until it appears\n * or the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByDisplayValue: BuiltinQueries[\"findByDisplayValue\"] = builtinQueries.findByDisplayValue;\n\nconst buildNormalizer = (options?: MatcherOptions): NormalizerFn => {\n const { normalizer, trim, collapseWhitespace } = options ?? {};\n\n if (!normalizer) {\n return getDefaultNormalizer({ trim, collapseWhitespace });\n }\n\n if (trim !== undefined || collapseWhitespace !== undefined) {\n throw new Error(\n \"trim and collapseWhitespace are not supported with a normalizer. \" +\n \"If you want to use the default trim and collapseWhitespace logic in your normalizer, \" +\n \"use \\\"getDefaultNormalizer({ trim, collapseWhitespace })\\\" and compose that into your normalizer\",\n );\n }\n\n return normalizer;\n};\n\nconst normalizeText = (text: string, options?: MatcherOptions): string => {\n const normalizer = buildNormalizer(options);\n\n return normalizer(text);\n};\n\nconst isTextMatch = (\n actual: string | null,\n expected: Matcher,\n widget: Gtk.Widget,\n options?: MatcherOptions,\n): boolean => {\n if (actual === null) {\n return false;\n }\n\n const normalizedActual = normalizeText(actual, options);\n\n if (typeof expected === \"function\") {\n return expected(normalizedActual, widget);\n }\n\n if (expected instanceof RegExp) {\n expected.lastIndex = 0;\n\n return expected.test(normalizedActual);\n }\n\n const normalizedExpected = normalizeText(String(expected), options);\n const isExact = options?.exact ?? true;\n\n return isExact\n ? normalizedActual === normalizedExpected\n : normalizedActual.toLowerCase().includes(normalizedExpected.toLowerCase());\n};\n\nconst hasMatchingAccessibleName = (widget: Gtk.Widget, options: ByRoleOptions): boolean => {\n if (options.name === undefined) {\n return true;\n }\n\n const text = getWidgetAccessibleName(widget);\n\n return isTextMatch(text, options.name, widget, options);\n};\n\nconst isNumericValueMatch = (expected: number | undefined, actual: number | null): boolean =>\n expected === undefined || actual === expected;\n\nconst hasMatchingAccessibleValue = (widget: Gtk.Widget, value: ByRoleValue, options: ByRoleOptions): boolean => {\n const actual = getWidgetValue(widget);\n\n const numericChecks: [number | undefined, number | null][] = [\n [value.now, actual.now],\n [value.min, actual.min],\n [value.max, actual.max],\n ];\n\n for (const [expected, current] of numericChecks) {\n if (!isNumericValueMatch(expected, current)) {\n return false;\n }\n }\n\n return value.text === undefined || isTextMatch(actual.text, value.text, widget, options);\n};\n\nconst hasMatchingBooleanStates = (widget: Gtk.Widget, options: ByRoleOptions): boolean => {\n const stateChecks: [boolean | undefined, () => boolean | null][] = [\n [options.checked, () => isWidgetChecked(widget)],\n [options.pressed, () => getWidgetPressedState(widget)],\n [options.expanded, () => getWidgetExpandedState(widget)],\n [options.selected, () => getWidgetSelectedState(widget)],\n [options.busy, () => getWidgetBusyState(widget) ?? false],\n ];\n\n for (const [expected, getActual] of stateChecks) {\n if (expected !== undefined && getActual() !== expected) {\n return false;\n }\n }\n\n return true;\n};\n\nconst hasMatchingLevelState = (widget: Gtk.Widget, options: ByRoleOptions): boolean =>\n options.level === undefined || getWidgetLevel(widget) === options.level;\n\nconst hasMatchingDescriptionState = (widget: Gtk.Widget, options: ByRoleOptions): boolean =>\n options.description === undefined ||\n isTextMatch(getWidgetDescription(widget), options.description, widget, options);\n\nconst hasMatchingValueState = (widget: Gtk.Widget, options: ByRoleOptions): boolean =>\n options.value === undefined || hasMatchingAccessibleValue(widget, options.value, options);\n\nconst hasMatchingAccessibleStates = (widget: Gtk.Widget, options: ByRoleOptions): boolean =>\n hasMatchingBooleanStates(widget, options) &&\n hasMatchingLevelState(widget, options) &&\n hasMatchingDescriptionState(widget, options) &&\n hasMatchingValueState(widget, options);\n\nconst isMatchingWidgetType = (widget: Gtk.Widget, options?: MatcherOptions): boolean =>\n options?.as === undefined || widget instanceof options.as;\n\nconst hasMatchingByRoleOptions = (widget: Gtk.Widget, options?: ByRoleOptions): boolean => {\n if (!options) {\n return true;\n }\n\n return (\n isMatchingWidgetType(widget, options) &&\n hasMatchingAccessibleName(widget, options) &&\n hasMatchingAccessibleStates(widget, options)\n );\n};\n\nfunction nameQueryFamily<Args extends unknown[]>(\n suffix: string,\n queryAllBy: QueryAllBy<Args>,\n built: BuiltQueries<Args>,\n): Record<string, unknown> {\n return {\n [`queryBy${suffix}`]: built.queryBy,\n [`queryAllBy${suffix}`]: queryAllBy,\n [`getBy${suffix}`]: built.getBy,\n [`getAllBy${suffix}`]: built.getAllBy,\n [`findBy${suffix}`]: built.findBy,\n [`findAllBy${suffix}`]: built.findAllBy,\n };\n}\n\n/**\n * Finds every widget under the container whose accessible role matches `role` and that satisfies the given options.\n * Widgets excluded from the accessibility tree are skipped unless `options.hidden` is set.\n * @param container Widget subtree to search.\n * @param role Accessible role to match.\n * @param options Additional accessible name, state, and value constraints.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByRole(\n container: Container,\n role: Gtk.AccessibleRole,\n options?: ByRoleOptions,\n): Gtk.Widget[] {\n return findAll(container, (widget) => {\n if (widget.getAccessibleRole() !== role) {\n return false;\n }\n\n if (!options?.hidden && isInaccessible(widget)) {\n return false;\n }\n\n return hasMatchingByRoleOptions(widget, options);\n });\n}\n\nconst collectMnemonicMatch = (\n widget: Gtk.Widget,\n text: Matcher,\n options: MatcherOptions | undefined,\n): Gtk.Widget | null => {\n if (!(widget instanceof Gtk.Label)) {\n return null;\n }\n\n const labelText = widget.getLabel();\n\n if (!labelText || !isTextMatch(labelText, text, widget, options)) {\n return null;\n }\n\n return widget.getMnemonicWidget();\n};\n\nconst collectLabelMatches = (\n results: Set<Gtk.Widget>,\n widget: Gtk.Widget,\n text: Matcher,\n options: MatcherOptions | undefined,\n): void => {\n const mnemonicTarget = collectMnemonicMatch(widget, text, options);\n\n if (mnemonicTarget) {\n results.add(mnemonicTarget);\n }\n\n const ownLabel = getWidgetOwnLabel(widget);\n\n if (ownLabel !== null && isTextMatch(ownLabel, text, widget, options)) {\n results.add(widget);\n }\n\n const labelledByText = getWidgetLabelledByText(widget);\n\n if (labelledByText !== null && isTextMatch(labelledByText, text, widget, options)) {\n results.add(widget);\n }\n};\n\n/**\n * Finds every widget associated with a label whose text matches: a Gtk.Label mnemonic target, the\n * widget's own accessible label, or its labelled-by relation.\n * @param container Widget subtree to search.\n * @param text Matcher for the label text.\n * @param options Text matching options.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByLabelText(container: Container, text: Matcher, options?: MatcherOptions): Gtk.Widget[] {\n const results: Set<Gtk.Widget> = new Set();\n\n for (const widget of traverse(container)) {\n collectLabelMatches(results, widget, text, options);\n }\n\n return [...results].filter((widget) => isMatchingWidgetType(widget, options));\n}\n\n/**\n * Finds every widget whose rendered text content matches.\n * @param container Widget subtree to search.\n * @param text Matcher for the widget text.\n * @param options Text matching options.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByText(container: Container, text: Matcher, options?: MatcherOptions): Gtk.Widget[] {\n return findAll(\n container,\n (widget) =>\n isMatchingWidgetType(widget, options) && isTextMatch(getWidgetLabelText(widget), text, widget, options),\n );\n}\n\n/**\n * Finds every widget whose widget name matches.\n * @param container Widget subtree to search.\n * @param name Matcher for the widget name.\n * @param options Text matching options.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByName(container: Container, name: Matcher, options?: MatcherOptions): Gtk.Widget[] {\n return findAll(\n container,\n (widget) => isMatchingWidgetType(widget, options) && isTextMatch(getWidgetName(widget), name, widget, options),\n );\n}\n\n/**\n * Finds every widget whose placeholder text matches.\n * @param container Widget subtree to search.\n * @param text Matcher for the placeholder text.\n * @param options Text matching options.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByPlaceholderText(\n container: Container,\n text: Matcher,\n options?: MatcherOptions,\n): Gtk.Widget[] {\n return findAll(\n container,\n (widget) =>\n isMatchingWidgetType(widget, options) &&\n isTextMatch(getWidgetPlaceholderText(widget), text, widget, options),\n );\n}\n\n/**\n * Finds every widget whose current display value matches.\n * @param container Widget subtree to search.\n * @param value Matcher for the display value.\n * @param options Text matching options.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByDisplayValue(container: Container, value: Matcher, options?: MatcherOptions): Gtk.Widget[] {\n return findAll(\n container,\n (widget) =>\n isMatchingWidgetType(widget, options) &&\n isTextMatch(getWidgetDisplayValue(widget), value, widget, options),\n );\n}\n\nexport {\n builtinQueries,\n queryByRole,\n getAllByRole,\n getByRole,\n findAllByRole,\n findByRole,\n queryByLabelText,\n getAllByLabelText,\n getByLabelText,\n findAllByLabelText,\n findByLabelText,\n queryByText,\n getAllByText,\n getByText,\n findAllByText,\n findByText,\n queryByName,\n getAllByName,\n getByName,\n findAllByName,\n findByName,\n queryByPlaceholderText,\n getAllByPlaceholderText,\n getByPlaceholderText,\n findAllByPlaceholderText,\n findByPlaceholderText,\n queryByDisplayValue,\n getAllByDisplayValue,\n getByDisplayValue,\n findAllByDisplayValue,\n findByDisplayValue,\n queryAllByRole,\n queryAllByLabelText,\n queryAllByText,\n queryAllByName,\n queryAllByPlaceholderText,\n queryAllByDisplayValue,\n type BuiltinQueries,\n};\n"]}
|
package/dist/render.js
CHANGED
|
@@ -61,7 +61,7 @@ const resolveContainer = (container) => {
|
|
|
61
61
|
return { containerInfo: container, window: null };
|
|
62
62
|
}
|
|
63
63
|
const window = new Gtk.Window({ defaultWidth: HARNESS_WINDOW_WIDTH, defaultHeight: HARNESS_WINDOW_HEIGHT });
|
|
64
|
-
window.
|
|
64
|
+
window.setDecorated(false);
|
|
65
65
|
return { containerInfo: window, window };
|
|
66
66
|
};
|
|
67
67
|
const firstToplevelWidget = (baseElement) => {
|
package/dist/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EACH,oBAAoB,EACpB,aAAa,EAEb,yBAAyB,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAkC,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,SAAS,EAA4B,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAkB,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAiBrC,MAAM,gBAAgB,GAAyB,EAAE,SAAS,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC;AAC9F,MAAM,aAAa,GAAsB,IAAI,GAAG,EAAE,CAAC;AACnD,MAAM,oBAAoB,GAAG,GAAG,CAAC;AACjC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC,MAAM,WAAW,GAAG,CAAC,MAAyB,EAAiB,EAAE,CAC7D,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;IACpB,mBAAmB,CAAC,MAAM,EAAE,OAA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AC,UAAU,CAAC,EAAE,IAAI,CAAC,CAAC;YACrC,MAAM,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC;QACD,KAAK,EAAE,CAAC,UAAmC,WAAW,EAAE,YAAkC,EAAE,EAAE;YAC1F,SAAS,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACrC,CAAC;QACD,QAAQ,EAAE,GAAG,EAAE;YACX,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC1B,CAAC;QACD,UAAU,EAAE,CAAC,QAAyB,EAAE,iBAAqC,EAAE,EAAE,CAC7E,wBAAwB,CAAC,QAAQ,EAAE,iBAAiB,CAAC;KAC5D,CAAC;IAEF,SAAS,CAAC,MAAM,CAAC,CAAC;IAElB,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,OAAO,GAAG,KAAK,IAAmB,EAAE;IACtC,MAAM,UAAU,EAAE,CAAC;AACvB,CAAC,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import type { RootElement } from \"@gtkx/react\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport {\n createReconcilerRoot,\n isRootElement,\n type ReconcilerRoot,\n setReconcilerErrorHandler,\n} from \"@gtkx/react/internal\";\nimport { type ErrorInfo, type ReactNode, StrictMode } from \"react\";\nimport type { RenderResult } from \"./bound-queries.js\";\nimport type { QueryMap, RenderOptions, ScreenshotOptions, WindowSelector } from \"./types.js\";\nimport { runInAct } from \"./act.js\";\nimport { addToCleanupQueue, runCleanup } from \"./cleanup-registry.js\";\nimport { scheduleAfterLayout } from \"./frame-sync.js\";\nimport { logWidget, type PrettyWidgetOptions } from \"./pretty-widget.js\";\nimport { logRoles } from \"./role-helpers.js\";\nimport { clearScreen, setScreen } from \"./screen.js\";\nimport { captureAndSaveScreenshot } from \"./screenshot.js\";\nimport { type Container, TOPLEVELS, traverse } from \"./traversal.js\";\nimport { resetClipboard } from \"./user-event/index.js\";\nimport { within } from \"./within.js\";\n\ntype ActiveRender = {\n root: ReconcilerRoot;\n window: Gtk.Window | null;\n};\n\ntype ResolvedContainer = {\n containerInfo: Gtk.Widget | RootElement;\n window: Gtk.Window | null;\n};\n\ntype ReconcilerErrorState = {\n lastError: Error | null;\n isHandlerInstalled: boolean;\n};\n\nconst reconcilerErrors: ReconcilerErrorState = { lastError: null, isHandlerInstalled: false };\nconst activeRenders: Set<ActiveRender> = new Set();\nconst HARNESS_WINDOW_WIDTH = 800;\nconst HARNESS_WINDOW_HEIGHT = 600;\n\nconst flushLayout = (window: Gtk.Window | null): Promise<void> =>\n new Promise((resolve) => {\n scheduleAfterLayout(window, resolve);\n });\n\nconst update = async (element: ReactNode, root: ReconcilerRoot): Promise<void> => {\n await runInAct(() => {\n root.update(element);\n });\n\n if (reconcilerErrors.lastError) {\n const captured = reconcilerErrors.lastError;\n reconcilerErrors.lastError = null;\n throw captured;\n }\n};\n\nconst disposeActiveRender = async (active: ActiveRender): Promise<void> => {\n if (!activeRenders.delete(active)) {\n return;\n }\n\n await active.root.unmount(async (root) => {\n await update(null, root);\n active.window?.destroy();\n });\n};\n\nconst disposeAllActiveRenders = async (): Promise<void> => {\n for (const active of activeRenders) {\n await disposeActiveRender(active);\n }\n};\n\nconst handleError = (error: unknown): void => {\n reconcilerErrors.lastError = error instanceof Error ? error : new Error(String(error));\n};\n\nconst installErrorHandler = (): void => {\n if (reconcilerErrors.isHandlerInstalled) {\n return;\n }\n\n setReconcilerErrorHandler(handleError);\n reconcilerErrors.isHandlerInstalled = true;\n};\n\nconst resolveContainer = (container: RenderOptions[\"container\"]): ResolvedContainer => {\n if (isRootElement(container)) {\n return { containerInfo: container, window: null };\n }\n\n if (container instanceof Gtk.Widget) {\n return { containerInfo: container, window: null };\n }\n\n const window = new Gtk.Window({ defaultWidth: HARNESS_WINDOW_WIDTH, defaultHeight: HARNESS_WINDOW_HEIGHT });\n window.setTitlebar(new Gtk.HeaderBar({ showTitleButtons: false }));\n\n return { containerInfo: window, window };\n};\n\nconst firstToplevelWidget = (baseElement: Container): Gtk.Widget => {\n if (baseElement instanceof Gtk.Widget) {\n return baseElement;\n }\n\n const [first] = traverse(baseElement);\n\n if (first) {\n return first;\n }\n\n throw new Error(\"render() produced no widgets: ensure the element renders visible content\");\n};\n\nconst resolveResultContainer = (\n resolved: ResolvedContainer,\n container: RenderOptions[\"container\"],\n baseElement: Container,\n): Gtk.Widget => {\n if (resolved.window) {\n return resolved.window;\n }\n\n if (container instanceof Gtk.Widget) {\n return container;\n }\n\n return firstToplevelWidget(baseElement);\n};\n\nconst renderErrorHandlers = <Q extends QueryMap>(options: RenderOptions<Q> | undefined) => ({\n onUncaughtError: handleError,\n onCaughtError: (error: unknown, errorInfo: ErrorInfo): void => {\n handleError(error);\n options?.onCaughtError?.(error, errorInfo);\n },\n onRecoverableError: (error: unknown, errorInfo: ErrorInfo): void => {\n options?.onRecoverableError?.(error, errorInfo);\n },\n});\n\nconst applyEnableAnimations = (areAnimationsEnabled: boolean): void => {\n const settings = Gtk.Settings.getDefault();\n\n if (settings) {\n settings.gtkEnableAnimations = areAnimationsEnabled;\n }\n};\n\n/**\n * Renders a React element into a GTK4 widget tree and returns queries\n * scoped to it along with controls for rerendering and unmounting. When no\n * container is supplied, a harness window is created and presented.\n *\n * @param element The React element to render.\n * @param options Optional container, wrapper, custom queries, and other render settings.\n * @returns A render result with bound queries, debug helpers, and lifecycle controls.\n */\nconst render = async <Q extends QueryMap = Record<never, never>>(\n element: ReactNode,\n options?: RenderOptions<Q>,\n): Promise<RenderResult<Q>> => {\n installErrorHandler();\n applyEnableAnimations(options?.animations === true);\n const baseElement: Container = options?.baseElement ?? TOPLEVELS;\n const Wrapper = options?.wrapper;\n const resolved = resolveContainer(options?.container);\n\n const root = createReconcilerRoot({\n containerInfo: resolved.containerInfo,\n ...renderErrorHandlers(options),\n });\n\n const active: ActiveRender = { root, window: resolved.window };\n activeRenders.add(active);\n addToCleanupQueue(disposeAllActiveRenders);\n addToCleanupQueue(clearScreen);\n addToCleanupQueue(resetClipboard);\n\n const wrap = (node: ReactNode): ReactNode => {\n const wrapped = Wrapper ? <Wrapper>{node}</Wrapper> : node;\n\n return options?.reactStrictMode ? <StrictMode>{wrapped}</StrictMode> : wrapped;\n };\n\n await update(wrap(element), root);\n resolved.window?.present();\n await flushLayout(resolved.window);\n const container = resolveResultContainer(resolved, options?.container, baseElement);\n\n const result: RenderResult<Q> = {\n ...within(baseElement, options?.queries),\n container,\n baseElement,\n unmount: async () => {\n await disposeActiveRender(active);\n },\n rerender: async (newElement: ReactNode) => {\n await update(wrap(newElement), root);\n await flushLayout(resolved.window);\n },\n debug: (element: Container | Container[] = baseElement, debugOptions?: PrettyWidgetOptions) => {\n logWidget(element, debugOptions);\n },\n logRoles: () => {\n logRoles(baseElement);\n },\n screenshot: (selector?: WindowSelector, screenshotOptions?: ScreenshotOptions) =>\n captureAndSaveScreenshot(selector, screenshotOptions),\n };\n\n setScreen(result);\n\n return result;\n};\n\n/**\n * Unmounts every active render and runs all registered cleanup callbacks,\n * resetting the screen and clipboard. Called automatically after each test.\n */\nconst cleanup = async (): Promise<void> => {\n await runCleanup();\n};\n\nexport { render, cleanup };\n"]}
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EACH,oBAAoB,EACpB,aAAa,EAEb,yBAAyB,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAkC,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,SAAS,EAA4B,MAAM,oBAAoB,CAAC;AACzE,OAA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OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import type { RootElement } from \"@gtkx/react\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport {\n createReconcilerRoot,\n isRootElement,\n type ReconcilerRoot,\n setReconcilerErrorHandler,\n} from \"@gtkx/react/internal\";\nimport { type ErrorInfo, type ReactNode, StrictMode } from \"react\";\nimport type { RenderResult } from \"./bound-queries.js\";\nimport type { QueryMap, RenderOptions, ScreenshotOptions, WindowSelector } from \"./types.js\";\nimport { runInAct } from \"./act.js\";\nimport { addToCleanupQueue, runCleanup } from \"./cleanup-registry.js\";\nimport { scheduleAfterLayout } from \"./frame-sync.js\";\nimport { logWidget, type PrettyWidgetOptions } from \"./pretty-widget.js\";\nimport { logRoles } from \"./role-helpers.js\";\nimport { clearScreen, setScreen } from \"./screen.js\";\nimport { captureAndSaveScreenshot } from \"./screenshot.js\";\nimport { type Container, TOPLEVELS, traverse } from \"./traversal.js\";\nimport { resetClipboard } from \"./user-event/index.js\";\nimport { within } from \"./within.js\";\n\ntype ActiveRender = {\n root: ReconcilerRoot;\n window: Gtk.Window | null;\n};\n\ntype ResolvedContainer = {\n containerInfo: Gtk.Widget | RootElement;\n window: Gtk.Window | null;\n};\n\ntype ReconcilerErrorState = {\n lastError: Error | null;\n isHandlerInstalled: boolean;\n};\n\nconst reconcilerErrors: ReconcilerErrorState = { lastError: null, isHandlerInstalled: false };\nconst activeRenders: Set<ActiveRender> = new Set();\nconst HARNESS_WINDOW_WIDTH = 800;\nconst HARNESS_WINDOW_HEIGHT = 600;\n\nconst flushLayout = (window: Gtk.Window | null): Promise<void> =>\n new Promise((resolve) => {\n scheduleAfterLayout(window, resolve);\n });\n\nconst update = async (element: ReactNode, root: ReconcilerRoot): Promise<void> => {\n await runInAct(() => {\n root.update(element);\n });\n\n if (reconcilerErrors.lastError) {\n const captured = reconcilerErrors.lastError;\n reconcilerErrors.lastError = null;\n throw captured;\n }\n};\n\nconst disposeActiveRender = async (active: ActiveRender): Promise<void> => {\n if (!activeRenders.delete(active)) {\n return;\n }\n\n await active.root.unmount(async (root) => {\n await update(null, root);\n active.window?.destroy();\n });\n};\n\nconst disposeAllActiveRenders = async (): Promise<void> => {\n for (const active of activeRenders) {\n await disposeActiveRender(active);\n }\n};\n\nconst handleError = (error: unknown): void => {\n reconcilerErrors.lastError = error instanceof Error ? error : new Error(String(error));\n};\n\nconst installErrorHandler = (): void => {\n if (reconcilerErrors.isHandlerInstalled) {\n return;\n }\n\n setReconcilerErrorHandler(handleError);\n reconcilerErrors.isHandlerInstalled = true;\n};\n\nconst resolveContainer = (container: RenderOptions[\"container\"]): ResolvedContainer => {\n if (isRootElement(container)) {\n return { containerInfo: container, window: null };\n }\n\n if (container instanceof Gtk.Widget) {\n return { containerInfo: container, window: null };\n }\n\n const window = new Gtk.Window({ defaultWidth: HARNESS_WINDOW_WIDTH, defaultHeight: HARNESS_WINDOW_HEIGHT });\n window.setDecorated(false);\n\n return { containerInfo: window, window };\n};\n\nconst firstToplevelWidget = (baseElement: Container): Gtk.Widget => {\n if (baseElement instanceof Gtk.Widget) {\n return baseElement;\n }\n\n const [first] = traverse(baseElement);\n\n if (first) {\n return first;\n }\n\n throw new Error(\"render() produced no widgets: ensure the element renders visible content\");\n};\n\nconst resolveResultContainer = (\n resolved: ResolvedContainer,\n container: RenderOptions[\"container\"],\n baseElement: Container,\n): Gtk.Widget => {\n if (resolved.window) {\n return resolved.window;\n }\n\n if (container instanceof Gtk.Widget) {\n return container;\n }\n\n return firstToplevelWidget(baseElement);\n};\n\nconst renderErrorHandlers = <Q extends QueryMap>(options: RenderOptions<Q> | undefined) => ({\n onUncaughtError: handleError,\n onCaughtError: (error: unknown, errorInfo: ErrorInfo): void => {\n handleError(error);\n options?.onCaughtError?.(error, errorInfo);\n },\n onRecoverableError: (error: unknown, errorInfo: ErrorInfo): void => {\n options?.onRecoverableError?.(error, errorInfo);\n },\n});\n\nconst applyEnableAnimations = (areAnimationsEnabled: boolean): void => {\n const settings = Gtk.Settings.getDefault();\n\n if (settings) {\n settings.gtkEnableAnimations = areAnimationsEnabled;\n }\n};\n\n/**\n * Renders a React element into a GTK4 widget tree and returns queries\n * scoped to it along with controls for rerendering and unmounting. When no\n * container is supplied, a harness window is created and presented.\n *\n * @param element The React element to render.\n * @param options Optional container, wrapper, custom queries, and other render settings.\n * @returns A render result with bound queries, debug helpers, and lifecycle controls.\n */\nconst render = async <Q extends QueryMap = Record<never, never>>(\n element: ReactNode,\n options?: RenderOptions<Q>,\n): Promise<RenderResult<Q>> => {\n installErrorHandler();\n applyEnableAnimations(options?.animations === true);\n const baseElement: Container = options?.baseElement ?? TOPLEVELS;\n const Wrapper = options?.wrapper;\n const resolved = resolveContainer(options?.container);\n\n const root = createReconcilerRoot({\n containerInfo: resolved.containerInfo,\n ...renderErrorHandlers(options),\n });\n\n const active: ActiveRender = { root, window: resolved.window };\n activeRenders.add(active);\n addToCleanupQueue(disposeAllActiveRenders);\n addToCleanupQueue(clearScreen);\n addToCleanupQueue(resetClipboard);\n\n const wrap = (node: ReactNode): ReactNode => {\n const wrapped = Wrapper ? <Wrapper>{node}</Wrapper> : node;\n\n return options?.reactStrictMode ? <StrictMode>{wrapped}</StrictMode> : wrapped;\n };\n\n await update(wrap(element), root);\n resolved.window?.present();\n await flushLayout(resolved.window);\n const container = resolveResultContainer(resolved, options?.container, baseElement);\n\n const result: RenderResult<Q> = {\n ...within(baseElement, options?.queries),\n container,\n baseElement,\n unmount: async () => {\n await disposeActiveRender(active);\n },\n rerender: async (newElement: ReactNode) => {\n await update(wrap(newElement), root);\n await flushLayout(resolved.window);\n },\n debug: (element: Container | Container[] = baseElement, debugOptions?: PrettyWidgetOptions) => {\n logWidget(element, debugOptions);\n },\n logRoles: () => {\n logRoles(baseElement);\n },\n screenshot: (selector?: WindowSelector, screenshotOptions?: ScreenshotOptions) =>\n captureAndSaveScreenshot(selector, screenshotOptions),\n };\n\n setScreen(result);\n\n return result;\n};\n\n/**\n * Unmounts every active render and runs all registered cleanup callbacks,\n * resetting the screen and clipboard. Called automatically after each test.\n */\nconst cleanup = async (): Promise<void> => {\n await runCleanup();\n};\n\nexport { render, cleanup };\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -12,6 +12,11 @@ type MatcherFunction = (content: string, widget: Gtk.Widget) => boolean;
|
|
|
12
12
|
type Matcher = string | number | RegExp | MatcherFunction;
|
|
13
13
|
/** Normalizes a widget's text before it is compared against a matcher. */
|
|
14
14
|
type NormalizerFn = (text: string) => string;
|
|
15
|
+
/**
|
|
16
|
+
* A widget class usable as a query's `as` constraint, such as `Gtk.Button`. Abstract classes and
|
|
17
|
+
* generated GInterface pseudo-classes are accepted.
|
|
18
|
+
*/
|
|
19
|
+
type WidgetType<T extends Gtk.Widget = Gtk.Widget> = abstract new (...args: never[]) => T;
|
|
15
20
|
/** Options controlling the default text normalizer. */
|
|
16
21
|
type NormalizerOptions = {
|
|
17
22
|
/** Trim leading and trailing whitespace. */
|
|
@@ -31,7 +36,7 @@ type WaitForOptions = {
|
|
|
31
36
|
stackTraceError?: Error | undefined;
|
|
32
37
|
};
|
|
33
38
|
/** Options controlling text matching and, for asynchronous queries, polling behavior. */
|
|
34
|
-
type MatcherOptions = {
|
|
39
|
+
type MatcherOptions<T extends Gtk.Widget = Gtk.Widget> = {
|
|
35
40
|
/** When true (the default), require an exact match; when false, match case-insensitively as a substring. */
|
|
36
41
|
exact?: boolean | undefined;
|
|
37
42
|
/** Custom normalizer replacing the default; cannot be combined with `trim` or `collapseWhitespace`. */
|
|
@@ -42,6 +47,8 @@ type MatcherOptions = {
|
|
|
42
47
|
collapseWhitespace?: boolean | undefined;
|
|
43
48
|
/** Whether to include a suggested better query in error messages. */
|
|
44
49
|
suggest?: boolean | undefined;
|
|
50
|
+
/** Restricts matches to instances of this widget class, and narrows the query's return type to it. */
|
|
51
|
+
as?: WidgetType<T> | undefined;
|
|
45
52
|
} & WaitForOptions;
|
|
46
53
|
/** Constraints on a widget's numeric range value used by role queries. */
|
|
47
54
|
type ByRoleValue = {
|
|
@@ -53,7 +60,7 @@ type ByRoleValue = {
|
|
|
53
60
|
text?: Matcher | undefined;
|
|
54
61
|
};
|
|
55
62
|
/** Options for role queries: an accessible name matcher plus accessible state and value constraints. */
|
|
56
|
-
type ByRoleOptions = MatcherOptions & {
|
|
63
|
+
type ByRoleOptions<T extends Gtk.Widget = Gtk.Widget> = MatcherOptions<T> & {
|
|
57
64
|
name?: Matcher | undefined;
|
|
58
65
|
checked?: boolean | undefined;
|
|
59
66
|
pressed?: boolean | undefined;
|
|
@@ -77,6 +84,25 @@ type BoundQuery<Q extends Query> = Q extends (container: Container, ...args: inf
|
|
|
77
84
|
type BoundCustomQueries<Q extends QueryMap> = {
|
|
78
85
|
[K in keyof Q]: BoundQuery<Q[K]>;
|
|
79
86
|
};
|
|
87
|
+
type QueryFamilyReturns<T extends Gtk.Widget> = {
|
|
88
|
+
queryBy: T | null;
|
|
89
|
+
queryAllBy: T[];
|
|
90
|
+
getBy: T;
|
|
91
|
+
getAllBy: T[];
|
|
92
|
+
findBy: Promise<T>;
|
|
93
|
+
findAllBy: Promise<T[]>;
|
|
94
|
+
};
|
|
95
|
+
type QueryKind = "role" | "text" | "name" | "value";
|
|
96
|
+
type QueryArgs<Kind extends QueryKind, T extends Gtk.Widget> = Kind extends "role" ? [role: Gtk.AccessibleRole, options?: ByRoleOptions<T>] : Kind extends "name" ? [name: Matcher, options?: MatcherOptions<T>] : Kind extends "value" ? [value: Matcher, options?: MatcherOptions<T>] : [text: Matcher, options?: MatcherOptions<T>];
|
|
97
|
+
/**
|
|
98
|
+
* One query family (`queryBy`, `getBy`, `findBy` and their `All` variants) for a single suffix.
|
|
99
|
+
* Each member takes an explicit widget type, as Testing Library's queries do, and also infers it
|
|
100
|
+
* from an `as` option.
|
|
101
|
+
*/
|
|
102
|
+
type QueryFamily<Suffix extends string, Kind extends QueryKind, Head extends unknown[]> = {
|
|
103
|
+
[K in keyof QueryFamilyReturns<Gtk.Widget> as `${K & string}${Suffix}`]: <T extends Gtk.Widget = Gtk.Widget>(...args: [...Head, ...QueryArgs<Kind, T>]) => QueryFamilyReturns<T>[K];
|
|
104
|
+
};
|
|
105
|
+
type QueryFamilies<Head extends unknown[]> = QueryFamily<"Role", "role", Head> & QueryFamily<"LabelText", "text", Head> & QueryFamily<"Text", "text", Head> & QueryFamily<"Name", "name", Head> & QueryFamily<"PlaceholderText", "text", Head> & QueryFamily<"DisplayValue", "value", Head>;
|
|
80
106
|
/**
|
|
81
107
|
* Options for {@link render}: the container and base element to mount into, an optional wrapper,
|
|
82
108
|
* React behavior toggles, error callbacks, and custom queries to bind.
|
|
@@ -142,5 +168,5 @@ type RenderHookResult<Result, Props> = {
|
|
|
142
168
|
rerender: (newProps?: Props) => Promise<void>;
|
|
143
169
|
unmount: () => Promise<void>;
|
|
144
170
|
};
|
|
145
|
-
export { type MatcherFunction, type Matcher, type NormalizerFn, type NormalizerOptions, type WaitForOptions, type MatcherOptions, type ByRoleValue, type ByRoleOptions, type WrapperComponent, type QueryMap, type BoundCustomQueries, type RenderOptions, type DebugUtilities, type ScreenshotResult, type ScreenshotOptions, type WindowSelector, type RenderHookOptions, type RenderHookResult, };
|
|
171
|
+
export { type MatcherFunction, type Matcher, type NormalizerFn, type NormalizerOptions, type WaitForOptions, type MatcherOptions, type ByRoleValue, type ByRoleOptions, type WidgetType, type WrapperComponent, type QueryMap, type BoundCustomQueries, type QueryFamilies, type RenderOptions, type DebugUtilities, type ScreenshotResult, type ScreenshotOptions, type WindowSelector, type RenderHookOptions, type RenderHookResult, };
|
|
146
172
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC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