@ngrok/mantle 0.88.0 → 0.90.0
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/accordion.d.ts +10 -9
- package/dist/accordion.js +1 -1
- package/dist/agent.json +1530 -1
- package/dist/{alert-DCVfviBx.d.ts → alert-BzPDUaU7.d.ts} +16 -15
- package/dist/alert-DO00UiQe.js +1 -0
- package/dist/alert-ZaUBtgno.js +1 -0
- package/dist/alert-center.d.ts +7 -7
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +17 -16
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-CgcbWEUs.js +1 -0
- package/dist/anchor.js +1 -1
- package/dist/app-layout.d.ts +1183 -45
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.d.ts +41 -18
- package/dist/area-chart.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge.d.ts +3 -2
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +37 -13
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/browser-only.js +1 -1
- package/dist/button-69InNC_m.js +1 -0
- package/dist/button-BMfUxs_j.js +1 -0
- package/dist/{button-DO53OA70.d.ts → button-CHoYpOzx.d.ts} +5 -4
- package/dist/{button-B52_vczK.js → button-D8rr-1AB.js} +1 -1
- package/dist/{button-crUf0hbR.d.ts → button-DL7V4bzW.d.ts} +5 -4
- package/dist/button-b2HKEIE2.js +1 -0
- package/dist/{button-B5i9n7Qp.d.ts → button-mzUR1U0Y.d.ts} +5 -4
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +3 -2
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +15 -7
- package/dist/card.js +1 -1
- package/dist/centered-layout.js +1 -1
- package/dist/{chart-DgaWVBqi.d.ts → chart-23KQ1ZNO.d.ts} +128 -62
- package/dist/chart-BRkJfptA.js +2 -0
- package/dist/checkbox-C3N2afhB.js +1 -0
- package/dist/checkbox.d.ts +3 -2
- package/dist/checkbox.js +1 -1
- package/dist/{choice-PESu-9s8.d.ts → choice-BCiyqLgO.d.ts} +12 -11
- package/dist/choice-DQmecLfy.js +1 -0
- package/dist/choice.d.ts +1 -1
- package/dist/choice.js +1 -1
- package/dist/code-block-4Esx_gV-.js +12 -0
- package/dist/code-block.d.ts +17 -16
- package/dist/code-block.js +6 -6
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +2 -1
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +15 -14
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +13 -13
- package/dist/command.js +1 -1
- package/dist/cx-CK7o_rVv.js +1 -0
- package/dist/cx.js +1 -1
- package/dist/data-table.d.ts +32 -31
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +6 -6
- package/dist/description-list.js +1 -1
- package/dist/dialog-CaGJD02w.js +1 -0
- package/dist/{dialog-DXpqpdJj.d.ts → dialog-DQdeqvq-.d.ts} +28 -15
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-BloQKE_y.d.ts → dropdown-menu-Cef0Cz2B.d.ts} +17 -17
- package/dist/dropdown-menu-CutWQ0bl.js +1 -0
- package/dist/dropdown-menu-DMA8dGxZ.d.ts +1 -0
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +14 -6
- package/dist/empty.js +1 -1
- package/dist/field.d.ts +16 -15
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +4 -3
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +251 -1
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +5 -4
- package/dist/hover-card.js +1 -1
- package/dist/icon-BudQMD2S.js +1 -0
- package/dist/icon-kK0c-POG.js +1 -0
- package/dist/{icon-w0HUe7tr.d.ts → icon-r2NvfTWW.d.ts} +3 -2
- package/dist/{icon-BmJ57Tgh.d.ts → icon-ucVgZeXn.d.ts} +3 -2
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js +1 -1
- package/dist/icons-CAtjMNti.js +1 -0
- package/dist/{icons-Bu-2boul.js → icons-CH3tD_wq.js} +1 -1
- package/dist/icons-CSwTVV2m.js +1 -0
- package/dist/icons.js +1 -1
- package/dist/in-view-Dxv_GrUU.js +1 -0
- package/dist/input-D_DjD9lT.js +1 -0
- package/dist/{input-DpnC3Xgj.d.ts → input-bbB1tC0h.d.ts} +3 -2
- package/dist/input.d.ts +5 -4
- package/dist/input.js +1 -1
- package/dist/kbd-CLHsJ99p.js +1 -0
- package/dist/kbd.d.ts +2 -1
- package/dist/kbd.js +1 -1
- package/dist/label-5T8i7I4X.js +1 -0
- package/dist/{label-Bnfe9YJ6.d.ts → label-C-KbNls8.d.ts} +3 -2
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/{layer-container-R7aux3n8.js → layer-container-DLf-6eBz.js} +1 -1
- package/dist/layer-container.js +1 -1
- package/dist/line-chart.d.ts +40 -15
- package/dist/line-chart.js +1 -1
- package/dist/list-DOVZoz9t.js +1 -0
- package/dist/list.d.ts +3 -2
- package/dist/list.js +1 -1
- package/dist/live-region-DQ1QLv3L.js +1 -0
- package/dist/live-region.d.ts +3 -2
- package/dist/live-region.js +1 -1
- package/dist/llms.txt +118 -2
- package/dist/{main-Dv2zuT_b.js → main-CC1L9IsH.js} +1 -1
- package/dist/main.js +1 -1
- package/dist/mantle.css +12 -0
- package/dist/media-object.js +1 -1
- package/dist/migrations/0002-data-table-action-header.yml +526 -0
- package/dist/migrations/0003-dialog-footer-dom-order.yml +271 -0
- package/dist/migrations/0004-priority-to-intent.yml +1728 -0
- package/dist/migrations/0005-field-item-owns-control-id.yml +234 -0
- package/dist/migrations/0006-data-table-tanstack-v9.yml +423 -0
- package/dist/migrations/0008-tabs-separator.yml +1212 -0
- package/dist/migrations/0009-chart-root-mode.yml +871 -0
- package/dist/multi-select.d.ts +23 -22
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +9 -8
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +9 -8
- package/dist/pagination.js +1 -1
- package/dist/{popover-Cco1nw8I.d.ts → popover-Dvls7-j4.d.ts} +5 -4
- package/dist/popover-oQDUvcZ2.js +1 -0
- package/dist/popover.d.ts +1 -1
- package/dist/popover.js +1 -1
- package/dist/primitive-AGoxSJBI.js +1 -0
- package/dist/progress.d.ts +9 -8
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +9 -8
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +19 -18
- package/dist/radio-group.js +1 -1
- package/dist/sandbar.d.ts +7 -7
- package/dist/sandbar.js +1 -1
- package/dist/{sandboxed-on-click-BLvvSqOP.js → sandboxed-on-click-C7pPu-2M.js} +1 -1
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/scatter-plot.d.ts +39 -14
- package/dist/scatter-plot.js +1 -1
- package/dist/select-DcL0-duV.js +1 -0
- package/dist/{select-BITJP7I5.d.ts → select-DlohFa54.d.ts} +3 -3
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +16 -15
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-Bo4nY_3M.d.ts → separator-BWGjCIl7.d.ts} +11 -3
- package/dist/separator-DvPe27fH.js +1 -0
- package/dist/separator.d.ts +1 -1
- package/dist/separator.js +1 -1
- package/dist/sheet-H8zvhSuA.js +1 -0
- package/dist/sheet.d.ts +13 -12
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +163 -102
- package/dist/sidebar.js +1 -1
- package/dist/skeleton-zfqoDAxT.js +1 -0
- package/dist/skeleton.d.ts +3 -2
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +3 -2
- package/dist/slider.js +1 -1
- package/dist/{slot-BsvE2ntj.js → slot-DdYN1L1C.js} +1 -1
- package/dist/{slot-DdgxmuI5.d.ts → slot-Q996Hqk9.d.ts} +1 -1
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +6 -5
- package/dist/split-button.js +1 -1
- package/dist/strata.d.ts +544 -0
- package/dist/strata.js +1 -0
- package/dist/switch.d.ts +3 -2
- package/dist/switch.js +1 -1
- package/dist/{table-DEI-qvSC.d.ts → table-BhzITa19.d.ts} +10 -9
- package/dist/table-DBbKqOVq.js +1 -0
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +2 -2
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +3 -2
- package/dist/text-area.js +1 -1
- package/dist/theme-6Q65C1Rx.js +1 -0
- package/dist/theme-switcher.d.ts +3 -3
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +10 -9
- package/dist/toast.js +1 -1
- package/dist/{tooltip-nuUCoqq8.d.ts → tooltip-CngH7Kl6.d.ts} +7 -6
- package/dist/tooltip-NhYXqStK.js +1 -0
- package/dist/tooltip.d.ts +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/truncated-text.d.ts +138 -0
- package/dist/truncated-text.js +1 -0
- package/dist/types.js +1 -1
- package/dist/use-breakpoint--mo7kr9d.js +1 -0
- package/dist/use-is-hydrated-after-paint-r9Cl2mGp.js +1 -0
- package/dist/use-prefers-reduced-motion-DimzRx-M.js +1 -0
- package/dist/use-swipe-to-dismiss-Cj-AayFd.js +1 -0
- package/dist/utils.js +1 -1
- package/dist/visually-hidden.d.ts +2 -1
- package/dist/visually-hidden.js +1 -1
- package/dist/well.d.ts +10 -2
- package/dist/well.js +1 -1
- package/package.json +17 -15
- package/dist/alert-OP_-aGJD.js +0 -1
- package/dist/anchor-BnMhJYS4.js +0 -1
- package/dist/button-BFpCB99R.js +0 -1
- package/dist/button-Dij5vCQG.js +0 -1
- package/dist/button-pwkdtR3U.js +0 -1
- package/dist/chart-aZLMj4xx.js +0 -2
- package/dist/checkbox-DbJSqSNN.js +0 -1
- package/dist/choice-SRyLguqU.js +0 -1
- package/dist/code-block-BE3Q0iAo.js +0 -12
- package/dist/cx-0HCjnNv1.js +0 -1
- package/dist/dialog-HIdb5d3I.js +0 -1
- package/dist/dropdown-menu-BR_AQNMj.js +0 -1
- package/dist/dropdown-menu-Dlpb7600.d.ts +0 -1
- package/dist/icon-BT8FnkkJ.js +0 -1
- package/dist/icon-U24NfYv7.js +0 -1
- package/dist/icons-BQRcOU6J.js +0 -1
- package/dist/icons-C3rVfpx9.js +0 -1
- package/dist/in-view-T_AAYaaF.js +0 -1
- package/dist/input-yq0jLE4e.js +0 -1
- package/dist/kbd-CJ8hNZfS.js +0 -1
- package/dist/label-BAy0Mg59.js +0 -1
- package/dist/list-BleZ-43e.js +0 -1
- package/dist/live-region-B2vJRvPH.js +0 -1
- package/dist/popover-BJ5XNwzD.js +0 -1
- package/dist/primitive-w3wFk2La.js +0 -1
- package/dist/select-CUWLEeuf.js +0 -1
- package/dist/separator-D98be0gY.js +0 -1
- package/dist/sheet-B5x8EO9Y.js +0 -1
- package/dist/skeleton-bVDP8BzY.js +0 -1
- package/dist/table-D2jh52KA.js +0 -1
- package/dist/theme-C1kFFdIk.js +0 -1
- package/dist/tooltip-H03l7E4Y.js +0 -1
- package/dist/use-is-hydrated-after-paint-Drj0lNi4.js +0 -1
- package/dist/use-prefers-reduced-motion-Cj9tJ181.js +0 -1
- /package/dist/{types-D85fCNV3.js → css-properties-D85fCNV3.js} +0 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# Both rules bind $DIALOG to the local name of the `Dialog` import from
|
|
2
|
+
# `@ngrok/mantle/dialog`, so an aliased import matches and another library's
|
|
3
|
+
# `Dialog` does not. They swap the two actions in place: each rule writes the
|
|
4
|
+
# other action's text over its own, so a comment between them stays where it is.
|
|
5
|
+
id: dialog-footer-first-action
|
|
6
|
+
language: tsx
|
|
7
|
+
message: the first of two Dialog.Footer actions moves second
|
|
8
|
+
utils:
|
|
9
|
+
# A node that opens a lexical scope. The shadow search below stops at a
|
|
10
|
+
# nested one, so a sibling function's local name does not count.
|
|
11
|
+
scope:
|
|
12
|
+
any:
|
|
13
|
+
- kind: statement_block
|
|
14
|
+
- kind: function_declaration
|
|
15
|
+
- kind: generator_function_declaration
|
|
16
|
+
- kind: function_expression
|
|
17
|
+
- kind: generator_function
|
|
18
|
+
- kind: arrow_function
|
|
19
|
+
- kind: method_definition
|
|
20
|
+
- kind: class_body
|
|
21
|
+
- kind: for_statement
|
|
22
|
+
- kind: for_in_statement
|
|
23
|
+
- kind: catch_clause
|
|
24
|
+
# An identifier in a binding position: a parameter, a destructured name, a
|
|
25
|
+
# local variable, a function name, or a class name.
|
|
26
|
+
binding-name:
|
|
27
|
+
any:
|
|
28
|
+
- kind: shorthand_property_identifier_pattern
|
|
29
|
+
- kind: identifier
|
|
30
|
+
any:
|
|
31
|
+
- inside: { kind: variable_declarator, field: name }
|
|
32
|
+
- inside: { kind: function_declaration, field: name }
|
|
33
|
+
- inside: { kind: generator_function_declaration, field: name }
|
|
34
|
+
- inside: { kind: function_expression, field: name }
|
|
35
|
+
- inside: { kind: required_parameter, field: pattern }
|
|
36
|
+
- inside: { kind: optional_parameter, field: pattern }
|
|
37
|
+
- inside: { kind: assignment_pattern, field: left }
|
|
38
|
+
- inside: { kind: pair_pattern, field: value }
|
|
39
|
+
- inside: { kind: array_pattern }
|
|
40
|
+
- inside: { kind: rest_pattern }
|
|
41
|
+
- inside: { kind: arrow_function, field: parameter }
|
|
42
|
+
- inside: { kind: catch_clause, field: parameter }
|
|
43
|
+
- kind: type_identifier
|
|
44
|
+
inside: { kind: class_declaration, field: name }
|
|
45
|
+
# A function declaration opens a scope, so the search above stops at it and
|
|
46
|
+
# never reads its name. This matches the declaration itself instead.
|
|
47
|
+
function-declaration:
|
|
48
|
+
any:
|
|
49
|
+
- kind: function_declaration
|
|
50
|
+
- kind: generator_function_declaration
|
|
51
|
+
dialog-import:
|
|
52
|
+
kind: import_statement
|
|
53
|
+
all:
|
|
54
|
+
- has:
|
|
55
|
+
field: source
|
|
56
|
+
regex: ^["']@ngrok/mantle/dialog["']$
|
|
57
|
+
- has:
|
|
58
|
+
stopBy: end
|
|
59
|
+
kind: import_specifier
|
|
60
|
+
has:
|
|
61
|
+
field: name
|
|
62
|
+
regex: ^Dialog$
|
|
63
|
+
any:
|
|
64
|
+
- kind: import_specifier
|
|
65
|
+
has:
|
|
66
|
+
field: alias
|
|
67
|
+
pattern: $DIALOG
|
|
68
|
+
- kind: import_specifier
|
|
69
|
+
not:
|
|
70
|
+
has:
|
|
71
|
+
field: alias
|
|
72
|
+
kind: identifier
|
|
73
|
+
has:
|
|
74
|
+
field: name
|
|
75
|
+
pattern: $DIALOG
|
|
76
|
+
# An action the swap moves. A comment-only expression is not one, so it
|
|
77
|
+
# neither counts toward the two nor moves.
|
|
78
|
+
action:
|
|
79
|
+
any:
|
|
80
|
+
- kind: jsx_element
|
|
81
|
+
- kind: jsx_self_closing_element
|
|
82
|
+
- kind: jsx_expression
|
|
83
|
+
has:
|
|
84
|
+
pattern: $_EXPRESSION
|
|
85
|
+
not:
|
|
86
|
+
kind: comment
|
|
87
|
+
two-action-footer:
|
|
88
|
+
pattern: <$DIALOG.Footer $$$ATTRS>$$$CHILDREN</$DIALOG.Footer>
|
|
89
|
+
all:
|
|
90
|
+
- inside:
|
|
91
|
+
stopBy: end
|
|
92
|
+
kind: program
|
|
93
|
+
has:
|
|
94
|
+
matches: dialog-import
|
|
95
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
96
|
+
# rules cannot tell which binding the element reads.
|
|
97
|
+
- not:
|
|
98
|
+
inside:
|
|
99
|
+
stopBy: end
|
|
100
|
+
matches: scope
|
|
101
|
+
has:
|
|
102
|
+
stopBy:
|
|
103
|
+
matches: scope
|
|
104
|
+
any:
|
|
105
|
+
- matches: binding-name
|
|
106
|
+
pattern: $DIALOG
|
|
107
|
+
- matches: function-declaration
|
|
108
|
+
has:
|
|
109
|
+
field: name
|
|
110
|
+
pattern: $DIALOG
|
|
111
|
+
- not:
|
|
112
|
+
has:
|
|
113
|
+
nthChild:
|
|
114
|
+
position: 3
|
|
115
|
+
ofRule:
|
|
116
|
+
matches: action
|
|
117
|
+
# Why: the swap moves the two actions only, so a footer with its own text
|
|
118
|
+
# between them would read in the wrong order.
|
|
119
|
+
- not:
|
|
120
|
+
has:
|
|
121
|
+
kind: jsx_text
|
|
122
|
+
regex: \S
|
|
123
|
+
rule:
|
|
124
|
+
matches: action
|
|
125
|
+
nthChild:
|
|
126
|
+
position: 1
|
|
127
|
+
ofRule:
|
|
128
|
+
matches: action
|
|
129
|
+
inside:
|
|
130
|
+
matches: two-action-footer
|
|
131
|
+
has:
|
|
132
|
+
pattern: $SECOND
|
|
133
|
+
nthChild:
|
|
134
|
+
position: 2
|
|
135
|
+
ofRule:
|
|
136
|
+
matches: action
|
|
137
|
+
fix: $SECOND
|
|
138
|
+
---
|
|
139
|
+
id: dialog-footer-second-action
|
|
140
|
+
language: tsx
|
|
141
|
+
message: the second of two Dialog.Footer actions moves first
|
|
142
|
+
utils:
|
|
143
|
+
# A node that opens a lexical scope. The shadow search below stops at a
|
|
144
|
+
# nested one, so a sibling function's local name does not count.
|
|
145
|
+
scope:
|
|
146
|
+
any:
|
|
147
|
+
- kind: statement_block
|
|
148
|
+
- kind: function_declaration
|
|
149
|
+
- kind: generator_function_declaration
|
|
150
|
+
- kind: function_expression
|
|
151
|
+
- kind: generator_function
|
|
152
|
+
- kind: arrow_function
|
|
153
|
+
- kind: method_definition
|
|
154
|
+
- kind: class_body
|
|
155
|
+
- kind: for_statement
|
|
156
|
+
- kind: for_in_statement
|
|
157
|
+
- kind: catch_clause
|
|
158
|
+
# An identifier in a binding position: a parameter, a destructured name, a
|
|
159
|
+
# local variable, a function name, or a class name.
|
|
160
|
+
binding-name:
|
|
161
|
+
any:
|
|
162
|
+
- kind: shorthand_property_identifier_pattern
|
|
163
|
+
- kind: identifier
|
|
164
|
+
any:
|
|
165
|
+
- inside: { kind: variable_declarator, field: name }
|
|
166
|
+
- inside: { kind: function_declaration, field: name }
|
|
167
|
+
- inside: { kind: generator_function_declaration, field: name }
|
|
168
|
+
- inside: { kind: function_expression, field: name }
|
|
169
|
+
- inside: { kind: required_parameter, field: pattern }
|
|
170
|
+
- inside: { kind: optional_parameter, field: pattern }
|
|
171
|
+
- inside: { kind: assignment_pattern, field: left }
|
|
172
|
+
- inside: { kind: pair_pattern, field: value }
|
|
173
|
+
- inside: { kind: array_pattern }
|
|
174
|
+
- inside: { kind: rest_pattern }
|
|
175
|
+
- inside: { kind: arrow_function, field: parameter }
|
|
176
|
+
- inside: { kind: catch_clause, field: parameter }
|
|
177
|
+
- kind: type_identifier
|
|
178
|
+
inside: { kind: class_declaration, field: name }
|
|
179
|
+
# A function declaration opens a scope, so the search above stops at it and
|
|
180
|
+
# never reads its name. This matches the declaration itself instead.
|
|
181
|
+
function-declaration:
|
|
182
|
+
any:
|
|
183
|
+
- kind: function_declaration
|
|
184
|
+
- kind: generator_function_declaration
|
|
185
|
+
dialog-import:
|
|
186
|
+
kind: import_statement
|
|
187
|
+
all:
|
|
188
|
+
- has:
|
|
189
|
+
field: source
|
|
190
|
+
regex: ^["']@ngrok/mantle/dialog["']$
|
|
191
|
+
- has:
|
|
192
|
+
stopBy: end
|
|
193
|
+
kind: import_specifier
|
|
194
|
+
has:
|
|
195
|
+
field: name
|
|
196
|
+
regex: ^Dialog$
|
|
197
|
+
any:
|
|
198
|
+
- kind: import_specifier
|
|
199
|
+
has:
|
|
200
|
+
field: alias
|
|
201
|
+
pattern: $DIALOG
|
|
202
|
+
- kind: import_specifier
|
|
203
|
+
not:
|
|
204
|
+
has:
|
|
205
|
+
field: alias
|
|
206
|
+
kind: identifier
|
|
207
|
+
has:
|
|
208
|
+
field: name
|
|
209
|
+
pattern: $DIALOG
|
|
210
|
+
# An action the swap moves. A comment-only expression is not one, so it
|
|
211
|
+
# neither counts toward the two nor moves.
|
|
212
|
+
action:
|
|
213
|
+
any:
|
|
214
|
+
- kind: jsx_element
|
|
215
|
+
- kind: jsx_self_closing_element
|
|
216
|
+
- kind: jsx_expression
|
|
217
|
+
has:
|
|
218
|
+
pattern: $_EXPRESSION
|
|
219
|
+
not:
|
|
220
|
+
kind: comment
|
|
221
|
+
two-action-footer:
|
|
222
|
+
pattern: <$DIALOG.Footer $$$ATTRS>$$$CHILDREN</$DIALOG.Footer>
|
|
223
|
+
all:
|
|
224
|
+
- inside:
|
|
225
|
+
stopBy: end
|
|
226
|
+
kind: program
|
|
227
|
+
has:
|
|
228
|
+
matches: dialog-import
|
|
229
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
230
|
+
# rules cannot tell which binding the element reads.
|
|
231
|
+
- not:
|
|
232
|
+
inside:
|
|
233
|
+
stopBy: end
|
|
234
|
+
matches: scope
|
|
235
|
+
has:
|
|
236
|
+
stopBy:
|
|
237
|
+
matches: scope
|
|
238
|
+
any:
|
|
239
|
+
- matches: binding-name
|
|
240
|
+
pattern: $DIALOG
|
|
241
|
+
- matches: function-declaration
|
|
242
|
+
has:
|
|
243
|
+
field: name
|
|
244
|
+
pattern: $DIALOG
|
|
245
|
+
- not:
|
|
246
|
+
has:
|
|
247
|
+
nthChild:
|
|
248
|
+
position: 3
|
|
249
|
+
ofRule:
|
|
250
|
+
matches: action
|
|
251
|
+
# Why: the swap moves the two actions only, so a footer with its own text
|
|
252
|
+
# between them would read in the wrong order.
|
|
253
|
+
- not:
|
|
254
|
+
has:
|
|
255
|
+
kind: jsx_text
|
|
256
|
+
regex: \S
|
|
257
|
+
rule:
|
|
258
|
+
matches: action
|
|
259
|
+
nthChild:
|
|
260
|
+
position: 2
|
|
261
|
+
ofRule:
|
|
262
|
+
matches: action
|
|
263
|
+
inside:
|
|
264
|
+
matches: two-action-footer
|
|
265
|
+
has:
|
|
266
|
+
pattern: $FIRST
|
|
267
|
+
nthChild:
|
|
268
|
+
position: 1
|
|
269
|
+
ofRule:
|
|
270
|
+
matches: action
|
|
271
|
+
fix: $FIRST
|