@react-native-windows/automation-commands 0.1.217 → 0.1.219

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.
@@ -1,44 +1,44 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * @format
6
- */
7
- import { AutomationClient } from '@react-native-windows/automation-channel';
8
- /**
9
- * Schema of tree dumped node
10
- */
11
- export type UIElement = {
12
- XamlType: string;
13
- Foreground?: string | null;
14
- Background?: string | null;
15
- Padding?: string | null;
16
- Margin?: string | null;
17
- RenderSize?: number[] | null;
18
- Visibility?: 'Collapsed' | 'Visible' | null;
19
- CornerRadius?: string | null;
20
- BorderThickness?: string | null;
21
- Width?: number | null;
22
- Height?: number | null;
23
- BorderBrush?: string | null;
24
- VerticalAlignment?: string | null;
25
- HorizontalAlignment?: string | null;
26
- Clip?: string | null;
27
- FlowDirection?: string | null;
28
- Name?: string | null;
29
- Text?: string | null;
30
- children?: UIElement[];
31
- [index: string]: unknown;
32
- };
33
- declare global {
34
- const automationClient: AutomationClient | undefined;
35
- }
36
- /**
37
- * Dump a section of the native visual tree.
38
- */
39
- export default function dumpVisualTree(accessibilityId: string, opts?: {
40
- pruneCollapsed?: boolean;
41
- deterministicOnly?: boolean;
42
- removeDefaultProps?: boolean;
43
- additionalProperties?: string[];
44
- }): Promise<UIElement>;
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * @format
6
+ */
7
+ import { AutomationClient } from '@react-native-windows/automation-channel';
8
+ /**
9
+ * Schema of tree dumped node
10
+ */
11
+ export type UIElement = {
12
+ XamlType: string;
13
+ Foreground?: string | null;
14
+ Background?: string | null;
15
+ Padding?: string | null;
16
+ Margin?: string | null;
17
+ RenderSize?: number[] | null;
18
+ Visibility?: 'Collapsed' | 'Visible' | null;
19
+ CornerRadius?: string | null;
20
+ BorderThickness?: string | null;
21
+ Width?: number | null;
22
+ Height?: number | null;
23
+ BorderBrush?: string | null;
24
+ VerticalAlignment?: string | null;
25
+ HorizontalAlignment?: string | null;
26
+ Clip?: string | null;
27
+ FlowDirection?: string | null;
28
+ Name?: string | null;
29
+ Text?: string | null;
30
+ children?: UIElement[];
31
+ [index: string]: unknown;
32
+ };
33
+ declare global {
34
+ const automationClient: AutomationClient | undefined;
35
+ }
36
+ /**
37
+ * Dump a section of the native visual tree.
38
+ */
39
+ export default function dumpVisualTree(accessibilityId: string, opts?: {
40
+ pruneCollapsed?: boolean;
41
+ deterministicOnly?: boolean;
42
+ removeDefaultProps?: boolean;
43
+ additionalProperties?: string[];
44
+ }): Promise<UIElement>;
@@ -1,73 +1,73 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) Microsoft Corporation.
4
- * Licensed under the MIT License.
5
- *
6
- * @format
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- /**
10
- * Dump a section of the native visual tree.
11
- */
12
- async function dumpVisualTree(accessibilityId, opts) {
13
- if (!automationClient) {
14
- throw new Error('RPC client is not enabled');
15
- }
16
- const dumpResponse = await automationClient.invoke('DumpVisualTree', {
17
- accessibilityId,
18
- ...opts,
19
- });
20
- if (dumpResponse.type === 'error') {
21
- throw new Error(dumpResponse.message);
22
- }
23
- const element = dumpResponse.result;
24
- if ((opts === null || opts === void 0 ? void 0 : opts.pruneCollapsed) !== false) {
25
- pruneCollapsedElements(element);
26
- }
27
- if ((opts === null || opts === void 0 ? void 0 : opts.deterministicOnly) !== false) {
28
- removeNonDeterministicProps(element);
29
- }
30
- if ((opts === null || opts === void 0 ? void 0 : opts.removeDefaultProps) !== false) {
31
- removeDefaultProps(element);
32
- }
33
- return element;
34
- }
35
- exports.default = dumpVisualTree;
36
- /**
37
- * Removes trees of XAML that are not visible.
38
- */
39
- function pruneCollapsedElements(element) {
40
- if (!element.children) {
41
- return;
42
- }
43
- element.children = element.children.filter(child => child.Visibility !== 'Collapsed');
44
- element.children.forEach(pruneCollapsedElements);
45
- }
46
- /**
47
- * Removes trees of properties that are not deterministic
48
- */
49
- function removeNonDeterministicProps(element) {
50
- if (element.RenderSize) {
51
- // RenderSize is subject to rounding, etc and should mostly be derived from
52
- // other deterministic properties in the tree.
53
- delete element.RenderSize;
54
- }
55
- if (element.children) {
56
- element.children.forEach(removeNonDeterministicProps);
57
- }
58
- }
59
- /**
60
- * Removes noise from snapshot by removing properties with the default value
61
- */
62
- function removeDefaultProps(element) {
63
- const defaultValues = [['Tooltip', null]];
64
- defaultValues.forEach(([propname, defaultValue]) => {
65
- if (element[propname] === defaultValue) {
66
- delete element[propname];
67
- }
68
- });
69
- if (element.children) {
70
- element.children.forEach(removeDefaultProps);
71
- }
72
- }
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation.
4
+ * Licensed under the MIT License.
5
+ *
6
+ * @format
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ /**
10
+ * Dump a section of the native visual tree.
11
+ */
12
+ async function dumpVisualTree(accessibilityId, opts) {
13
+ if (!automationClient) {
14
+ throw new Error('RPC client is not enabled');
15
+ }
16
+ const dumpResponse = await automationClient.invoke('DumpVisualTree', {
17
+ accessibilityId,
18
+ ...opts,
19
+ });
20
+ if (dumpResponse.type === 'error') {
21
+ throw new Error(dumpResponse.message);
22
+ }
23
+ const element = dumpResponse.result;
24
+ if ((opts === null || opts === void 0 ? void 0 : opts.pruneCollapsed) !== false) {
25
+ pruneCollapsedElements(element);
26
+ }
27
+ if ((opts === null || opts === void 0 ? void 0 : opts.deterministicOnly) !== false) {
28
+ removeNonDeterministicProps(element);
29
+ }
30
+ if ((opts === null || opts === void 0 ? void 0 : opts.removeDefaultProps) !== false) {
31
+ removeDefaultProps(element);
32
+ }
33
+ return element;
34
+ }
35
+ exports.default = dumpVisualTree;
36
+ /**
37
+ * Removes trees of XAML that are not visible.
38
+ */
39
+ function pruneCollapsedElements(element) {
40
+ if (!element.children) {
41
+ return;
42
+ }
43
+ element.children = element.children.filter(child => child.Visibility !== 'Collapsed');
44
+ element.children.forEach(pruneCollapsedElements);
45
+ }
46
+ /**
47
+ * Removes trees of properties that are not deterministic
48
+ */
49
+ function removeNonDeterministicProps(element) {
50
+ if (element.RenderSize) {
51
+ // RenderSize is subject to rounding, etc and should mostly be derived from
52
+ // other deterministic properties in the tree.
53
+ delete element.RenderSize;
54
+ }
55
+ if (element.children) {
56
+ element.children.forEach(removeNonDeterministicProps);
57
+ }
58
+ }
59
+ /**
60
+ * Removes noise from snapshot by removing properties with the default value
61
+ */
62
+ function removeDefaultProps(element) {
63
+ const defaultValues = [['Tooltip', null]];
64
+ defaultValues.forEach(([propname, defaultValue]) => {
65
+ if (element[propname] === defaultValue) {
66
+ delete element[propname];
67
+ }
68
+ });
69
+ if (element.children) {
70
+ element.children.forEach(removeDefaultProps);
71
+ }
72
+ }
73
73
  //# sourceMappingURL=dumpVisualTree.js.map
@@ -1,8 +1,8 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * @format
6
- */
7
- import dumpVisualTree from './dumpVisualTree';
8
- export { dumpVisualTree };
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * @format
6
+ */
7
+ import dumpVisualTree from './dumpVisualTree';
8
+ export { dumpVisualTree };
@@ -1,15 +1,15 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) Microsoft Corporation.
4
- * Licensed under the MIT License.
5
- *
6
- * @format
7
- */
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.dumpVisualTree = void 0;
13
- const dumpVisualTree_1 = __importDefault(require("./dumpVisualTree"));
14
- exports.dumpVisualTree = dumpVisualTree_1.default;
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation.
4
+ * Licensed under the MIT License.
5
+ *
6
+ * @format
7
+ */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.dumpVisualTree = void 0;
13
+ const dumpVisualTree_1 = __importDefault(require("./dumpVisualTree"));
14
+ exports.dumpVisualTree = dumpVisualTree_1.default;
15
15
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-windows/automation-commands",
3
- "version": "0.1.217",
3
+ "version": "0.1.219",
4
4
  "description": "Allows controlling your react-native-windows application",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "license": "MIT",
@@ -18,20 +18,20 @@
18
18
  "watch": "rnw-scripts watch"
19
19
  },
20
20
  "dependencies": {
21
- "@react-native-windows/automation-channel": "^0.12.115",
21
+ "@react-native-windows/automation-channel": "^0.12.117",
22
22
  "@typescript-eslint/eslint-plugin": "^5.30.5",
23
23
  "@typescript-eslint/parser": "^5.57.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@jest/types": "^29.2.1",
27
- "@rnw-scripts/eslint-config": "1.2.5",
28
- "@rnw-scripts/just-task": "2.3.20",
27
+ "@rnw-scripts/eslint-config": "1.2.6",
28
+ "@rnw-scripts/just-task": "2.3.22",
29
29
  "@rnw-scripts/ts-config": "2.0.5",
30
30
  "@types/jest": "^29.2.2",
31
31
  "@types/node": "^18.0.0",
32
32
  "eslint": "^8.19.0",
33
- "prettier": "^2.4.1",
34
- "typescript": "^4.9.5"
33
+ "prettier": "2.8.8",
34
+ "typescript": "5.0.4"
35
35
  },
36
36
  "files": [
37
37
  "lib-commonjs",