@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,526 @@
|
|
|
1
|
+
# Every rule binds $DT to the local name of the `DataTable` import from
|
|
2
|
+
# `@ngrok/mantle/data-table` (and $TABLE to `Table`), so an aliased import
|
|
3
|
+
# matches and another library's `Table` does not.
|
|
4
|
+
id: action-column-header
|
|
5
|
+
language: tsx
|
|
6
|
+
message: the action column header becomes DataTable.ActionHeader
|
|
7
|
+
utils:
|
|
8
|
+
# A node that opens a lexical scope. The shadow search below stops at a
|
|
9
|
+
# nested one, so a sibling function's local name does not count.
|
|
10
|
+
scope:
|
|
11
|
+
any:
|
|
12
|
+
- kind: statement_block
|
|
13
|
+
- kind: function_declaration
|
|
14
|
+
- kind: generator_function_declaration
|
|
15
|
+
- kind: function_expression
|
|
16
|
+
- kind: generator_function
|
|
17
|
+
- kind: arrow_function
|
|
18
|
+
- kind: method_definition
|
|
19
|
+
- kind: class_body
|
|
20
|
+
- kind: for_statement
|
|
21
|
+
- kind: for_in_statement
|
|
22
|
+
- kind: catch_clause
|
|
23
|
+
# An identifier in a binding position: a parameter, a destructured name, a
|
|
24
|
+
# local variable, a function name, or a class name.
|
|
25
|
+
binding-name:
|
|
26
|
+
any:
|
|
27
|
+
- kind: shorthand_property_identifier_pattern
|
|
28
|
+
- kind: identifier
|
|
29
|
+
any:
|
|
30
|
+
- inside: { kind: variable_declarator, field: name }
|
|
31
|
+
- inside: { kind: function_declaration, field: name }
|
|
32
|
+
- inside: { kind: generator_function_declaration, field: name }
|
|
33
|
+
- inside: { kind: function_expression, field: name }
|
|
34
|
+
- inside: { kind: required_parameter, field: pattern }
|
|
35
|
+
- inside: { kind: optional_parameter, field: pattern }
|
|
36
|
+
- inside: { kind: assignment_pattern, field: left }
|
|
37
|
+
- inside: { kind: pair_pattern, field: value }
|
|
38
|
+
- inside: { kind: array_pattern }
|
|
39
|
+
- inside: { kind: rest_pattern }
|
|
40
|
+
- inside: { kind: arrow_function, field: parameter }
|
|
41
|
+
- inside: { kind: catch_clause, field: parameter }
|
|
42
|
+
- kind: type_identifier
|
|
43
|
+
inside: { kind: class_declaration, field: name }
|
|
44
|
+
# A function declaration opens a scope, so the search above stops at it and
|
|
45
|
+
# never reads its name. This matches the declaration itself instead.
|
|
46
|
+
function-declaration:
|
|
47
|
+
any:
|
|
48
|
+
- kind: function_declaration
|
|
49
|
+
- kind: generator_function_declaration
|
|
50
|
+
datatable-import:
|
|
51
|
+
kind: import_statement
|
|
52
|
+
all:
|
|
53
|
+
- has:
|
|
54
|
+
field: source
|
|
55
|
+
regex: ^["']@ngrok/mantle/data-table["']$
|
|
56
|
+
- has:
|
|
57
|
+
stopBy: end
|
|
58
|
+
kind: import_specifier
|
|
59
|
+
has:
|
|
60
|
+
field: name
|
|
61
|
+
regex: ^DataTable$
|
|
62
|
+
any:
|
|
63
|
+
- kind: import_specifier
|
|
64
|
+
has:
|
|
65
|
+
field: alias
|
|
66
|
+
pattern: $DT
|
|
67
|
+
- kind: import_specifier
|
|
68
|
+
not:
|
|
69
|
+
has:
|
|
70
|
+
field: alias
|
|
71
|
+
kind: identifier
|
|
72
|
+
has:
|
|
73
|
+
field: name
|
|
74
|
+
pattern: $DT
|
|
75
|
+
table-import:
|
|
76
|
+
kind: import_statement
|
|
77
|
+
all:
|
|
78
|
+
- has:
|
|
79
|
+
field: source
|
|
80
|
+
regex: ^["']@ngrok/mantle/table["']$
|
|
81
|
+
- has:
|
|
82
|
+
stopBy: end
|
|
83
|
+
kind: import_specifier
|
|
84
|
+
has:
|
|
85
|
+
field: name
|
|
86
|
+
regex: ^Table$
|
|
87
|
+
any:
|
|
88
|
+
- kind: import_specifier
|
|
89
|
+
has:
|
|
90
|
+
field: alias
|
|
91
|
+
pattern: $TABLE
|
|
92
|
+
- kind: import_specifier
|
|
93
|
+
not:
|
|
94
|
+
has:
|
|
95
|
+
field: alias
|
|
96
|
+
kind: identifier
|
|
97
|
+
has:
|
|
98
|
+
field: name
|
|
99
|
+
pattern: $TABLE
|
|
100
|
+
action-cell-name:
|
|
101
|
+
kind: member_expression
|
|
102
|
+
all:
|
|
103
|
+
- has:
|
|
104
|
+
field: object
|
|
105
|
+
pattern: $DT
|
|
106
|
+
- has:
|
|
107
|
+
field: property
|
|
108
|
+
regex: ^ActionCell$
|
|
109
|
+
# The nearest object literal is the column, and it holds an action cell. The
|
|
110
|
+
# search stops at a nested object, so a column whose cell renders a table
|
|
111
|
+
# with its own action column keeps its header.
|
|
112
|
+
action-column:
|
|
113
|
+
kind: object
|
|
114
|
+
has:
|
|
115
|
+
stopBy:
|
|
116
|
+
kind: object
|
|
117
|
+
any:
|
|
118
|
+
- kind: jsx_opening_element
|
|
119
|
+
- kind: jsx_self_closing_element
|
|
120
|
+
has:
|
|
121
|
+
field: name
|
|
122
|
+
matches: action-cell-name
|
|
123
|
+
# The nearest property is the column's `header`, so a table a `cell` renders
|
|
124
|
+
# keeps its own headers.
|
|
125
|
+
header-property:
|
|
126
|
+
kind: pair
|
|
127
|
+
has:
|
|
128
|
+
field: key
|
|
129
|
+
regex: ^header$
|
|
130
|
+
rule:
|
|
131
|
+
any:
|
|
132
|
+
- pattern: <$DT.Header $$$ATTRS>$$$CHILDREN</$DT.Header>
|
|
133
|
+
- pattern: <$TABLE.Header $$$ATTRS>$$$CHILDREN</$TABLE.Header>
|
|
134
|
+
inside:
|
|
135
|
+
stopBy: end
|
|
136
|
+
kind: program
|
|
137
|
+
has:
|
|
138
|
+
matches: table-import
|
|
139
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
140
|
+
# rules cannot tell which binding the element reads.
|
|
141
|
+
not:
|
|
142
|
+
inside:
|
|
143
|
+
stopBy: end
|
|
144
|
+
matches: scope
|
|
145
|
+
has:
|
|
146
|
+
stopBy:
|
|
147
|
+
matches: scope
|
|
148
|
+
any:
|
|
149
|
+
- matches: binding-name
|
|
150
|
+
pattern: $TABLE
|
|
151
|
+
- matches: function-declaration
|
|
152
|
+
has:
|
|
153
|
+
field: name
|
|
154
|
+
pattern: $TABLE
|
|
155
|
+
all:
|
|
156
|
+
- inside:
|
|
157
|
+
stopBy:
|
|
158
|
+
kind: pair
|
|
159
|
+
matches: header-property
|
|
160
|
+
- inside:
|
|
161
|
+
stopBy:
|
|
162
|
+
kind: object
|
|
163
|
+
matches: action-column
|
|
164
|
+
- inside:
|
|
165
|
+
stopBy: end
|
|
166
|
+
kind: program
|
|
167
|
+
has:
|
|
168
|
+
matches: datatable-import
|
|
169
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
170
|
+
# rules cannot tell which binding the element reads.
|
|
171
|
+
- not:
|
|
172
|
+
inside:
|
|
173
|
+
stopBy: end
|
|
174
|
+
matches: scope
|
|
175
|
+
has:
|
|
176
|
+
stopBy:
|
|
177
|
+
matches: scope
|
|
178
|
+
any:
|
|
179
|
+
- matches: binding-name
|
|
180
|
+
pattern: $DT
|
|
181
|
+
- matches: function-declaration
|
|
182
|
+
has:
|
|
183
|
+
field: name
|
|
184
|
+
pattern: $DT
|
|
185
|
+
fix: <$DT.ActionHeader $$$ATTRS>$$$CHILDREN</$DT.ActionHeader>
|
|
186
|
+
---
|
|
187
|
+
id: action-column-header-self-closing
|
|
188
|
+
language: tsx
|
|
189
|
+
message: the action column header becomes DataTable.ActionHeader
|
|
190
|
+
utils:
|
|
191
|
+
# A node that opens a lexical scope. The shadow search below stops at a
|
|
192
|
+
# nested one, so a sibling function's local name does not count.
|
|
193
|
+
scope:
|
|
194
|
+
any:
|
|
195
|
+
- kind: statement_block
|
|
196
|
+
- kind: function_declaration
|
|
197
|
+
- kind: generator_function_declaration
|
|
198
|
+
- kind: function_expression
|
|
199
|
+
- kind: generator_function
|
|
200
|
+
- kind: arrow_function
|
|
201
|
+
- kind: method_definition
|
|
202
|
+
- kind: class_body
|
|
203
|
+
- kind: for_statement
|
|
204
|
+
- kind: for_in_statement
|
|
205
|
+
- kind: catch_clause
|
|
206
|
+
# An identifier in a binding position: a parameter, a destructured name, a
|
|
207
|
+
# local variable, a function name, or a class name.
|
|
208
|
+
binding-name:
|
|
209
|
+
any:
|
|
210
|
+
- kind: shorthand_property_identifier_pattern
|
|
211
|
+
- kind: identifier
|
|
212
|
+
any:
|
|
213
|
+
- inside: { kind: variable_declarator, field: name }
|
|
214
|
+
- inside: { kind: function_declaration, field: name }
|
|
215
|
+
- inside: { kind: generator_function_declaration, field: name }
|
|
216
|
+
- inside: { kind: function_expression, field: name }
|
|
217
|
+
- inside: { kind: required_parameter, field: pattern }
|
|
218
|
+
- inside: { kind: optional_parameter, field: pattern }
|
|
219
|
+
- inside: { kind: assignment_pattern, field: left }
|
|
220
|
+
- inside: { kind: pair_pattern, field: value }
|
|
221
|
+
- inside: { kind: array_pattern }
|
|
222
|
+
- inside: { kind: rest_pattern }
|
|
223
|
+
- inside: { kind: arrow_function, field: parameter }
|
|
224
|
+
- inside: { kind: catch_clause, field: parameter }
|
|
225
|
+
- kind: type_identifier
|
|
226
|
+
inside: { kind: class_declaration, field: name }
|
|
227
|
+
# A function declaration opens a scope, so the search above stops at it and
|
|
228
|
+
# never reads its name. This matches the declaration itself instead.
|
|
229
|
+
function-declaration:
|
|
230
|
+
any:
|
|
231
|
+
- kind: function_declaration
|
|
232
|
+
- kind: generator_function_declaration
|
|
233
|
+
datatable-import:
|
|
234
|
+
kind: import_statement
|
|
235
|
+
all:
|
|
236
|
+
- has:
|
|
237
|
+
field: source
|
|
238
|
+
regex: ^["']@ngrok/mantle/data-table["']$
|
|
239
|
+
- has:
|
|
240
|
+
stopBy: end
|
|
241
|
+
kind: import_specifier
|
|
242
|
+
has:
|
|
243
|
+
field: name
|
|
244
|
+
regex: ^DataTable$
|
|
245
|
+
any:
|
|
246
|
+
- kind: import_specifier
|
|
247
|
+
has:
|
|
248
|
+
field: alias
|
|
249
|
+
pattern: $DT
|
|
250
|
+
- kind: import_specifier
|
|
251
|
+
not:
|
|
252
|
+
has:
|
|
253
|
+
field: alias
|
|
254
|
+
kind: identifier
|
|
255
|
+
has:
|
|
256
|
+
field: name
|
|
257
|
+
pattern: $DT
|
|
258
|
+
table-import:
|
|
259
|
+
kind: import_statement
|
|
260
|
+
all:
|
|
261
|
+
- has:
|
|
262
|
+
field: source
|
|
263
|
+
regex: ^["']@ngrok/mantle/table["']$
|
|
264
|
+
- has:
|
|
265
|
+
stopBy: end
|
|
266
|
+
kind: import_specifier
|
|
267
|
+
has:
|
|
268
|
+
field: name
|
|
269
|
+
regex: ^Table$
|
|
270
|
+
any:
|
|
271
|
+
- kind: import_specifier
|
|
272
|
+
has:
|
|
273
|
+
field: alias
|
|
274
|
+
pattern: $TABLE
|
|
275
|
+
- kind: import_specifier
|
|
276
|
+
not:
|
|
277
|
+
has:
|
|
278
|
+
field: alias
|
|
279
|
+
kind: identifier
|
|
280
|
+
has:
|
|
281
|
+
field: name
|
|
282
|
+
pattern: $TABLE
|
|
283
|
+
action-cell-name:
|
|
284
|
+
kind: member_expression
|
|
285
|
+
all:
|
|
286
|
+
- has:
|
|
287
|
+
field: object
|
|
288
|
+
pattern: $DT
|
|
289
|
+
- has:
|
|
290
|
+
field: property
|
|
291
|
+
regex: ^ActionCell$
|
|
292
|
+
# The nearest object literal is the column, and it holds an action cell. The
|
|
293
|
+
# search stops at a nested object, so a column whose cell renders a table
|
|
294
|
+
# with its own action column keeps its header.
|
|
295
|
+
action-column:
|
|
296
|
+
kind: object
|
|
297
|
+
has:
|
|
298
|
+
stopBy:
|
|
299
|
+
kind: object
|
|
300
|
+
any:
|
|
301
|
+
- kind: jsx_opening_element
|
|
302
|
+
- kind: jsx_self_closing_element
|
|
303
|
+
has:
|
|
304
|
+
field: name
|
|
305
|
+
matches: action-cell-name
|
|
306
|
+
# The nearest property is the column's `header`, so a table a `cell` renders
|
|
307
|
+
# keeps its own headers.
|
|
308
|
+
header-property:
|
|
309
|
+
kind: pair
|
|
310
|
+
has:
|
|
311
|
+
field: key
|
|
312
|
+
regex: ^header$
|
|
313
|
+
rule:
|
|
314
|
+
any:
|
|
315
|
+
- pattern: <$DT.Header $$$ATTRS />
|
|
316
|
+
- pattern: <$TABLE.Header $$$ATTRS />
|
|
317
|
+
inside:
|
|
318
|
+
stopBy: end
|
|
319
|
+
kind: program
|
|
320
|
+
has:
|
|
321
|
+
matches: table-import
|
|
322
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
323
|
+
# rules cannot tell which binding the element reads.
|
|
324
|
+
not:
|
|
325
|
+
inside:
|
|
326
|
+
stopBy: end
|
|
327
|
+
matches: scope
|
|
328
|
+
has:
|
|
329
|
+
stopBy:
|
|
330
|
+
matches: scope
|
|
331
|
+
any:
|
|
332
|
+
- matches: binding-name
|
|
333
|
+
pattern: $TABLE
|
|
334
|
+
- matches: function-declaration
|
|
335
|
+
has:
|
|
336
|
+
field: name
|
|
337
|
+
pattern: $TABLE
|
|
338
|
+
all:
|
|
339
|
+
- inside:
|
|
340
|
+
stopBy:
|
|
341
|
+
kind: pair
|
|
342
|
+
matches: header-property
|
|
343
|
+
- inside:
|
|
344
|
+
stopBy:
|
|
345
|
+
kind: object
|
|
346
|
+
matches: action-column
|
|
347
|
+
- inside:
|
|
348
|
+
stopBy: end
|
|
349
|
+
kind: program
|
|
350
|
+
has:
|
|
351
|
+
matches: datatable-import
|
|
352
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
353
|
+
# rules cannot tell which binding the element reads.
|
|
354
|
+
- not:
|
|
355
|
+
inside:
|
|
356
|
+
stopBy: end
|
|
357
|
+
matches: scope
|
|
358
|
+
has:
|
|
359
|
+
stopBy:
|
|
360
|
+
matches: scope
|
|
361
|
+
any:
|
|
362
|
+
- matches: binding-name
|
|
363
|
+
pattern: $DT
|
|
364
|
+
- matches: function-declaration
|
|
365
|
+
has:
|
|
366
|
+
field: name
|
|
367
|
+
pattern: $DT
|
|
368
|
+
fix: <$DT.ActionHeader $$$ATTRS />
|
|
369
|
+
---
|
|
370
|
+
id: action-column-null-header
|
|
371
|
+
language: tsx
|
|
372
|
+
message: the action column needs a sticky header even when it has no label
|
|
373
|
+
utils:
|
|
374
|
+
# A node that opens a lexical scope. The shadow search below stops at a
|
|
375
|
+
# nested one, so a sibling function's local name does not count.
|
|
376
|
+
scope:
|
|
377
|
+
any:
|
|
378
|
+
- kind: statement_block
|
|
379
|
+
- kind: function_declaration
|
|
380
|
+
- kind: generator_function_declaration
|
|
381
|
+
- kind: function_expression
|
|
382
|
+
- kind: generator_function
|
|
383
|
+
- kind: arrow_function
|
|
384
|
+
- kind: method_definition
|
|
385
|
+
- kind: class_body
|
|
386
|
+
- kind: for_statement
|
|
387
|
+
- kind: for_in_statement
|
|
388
|
+
- kind: catch_clause
|
|
389
|
+
# An identifier in a binding position: a parameter, a destructured name, a
|
|
390
|
+
# local variable, a function name, or a class name.
|
|
391
|
+
binding-name:
|
|
392
|
+
any:
|
|
393
|
+
- kind: shorthand_property_identifier_pattern
|
|
394
|
+
- kind: identifier
|
|
395
|
+
any:
|
|
396
|
+
- inside: { kind: variable_declarator, field: name }
|
|
397
|
+
- inside: { kind: function_declaration, field: name }
|
|
398
|
+
- inside: { kind: generator_function_declaration, field: name }
|
|
399
|
+
- inside: { kind: function_expression, field: name }
|
|
400
|
+
- inside: { kind: required_parameter, field: pattern }
|
|
401
|
+
- inside: { kind: optional_parameter, field: pattern }
|
|
402
|
+
- inside: { kind: assignment_pattern, field: left }
|
|
403
|
+
- inside: { kind: pair_pattern, field: value }
|
|
404
|
+
- inside: { kind: array_pattern }
|
|
405
|
+
- inside: { kind: rest_pattern }
|
|
406
|
+
- inside: { kind: arrow_function, field: parameter }
|
|
407
|
+
- inside: { kind: catch_clause, field: parameter }
|
|
408
|
+
- kind: type_identifier
|
|
409
|
+
inside: { kind: class_declaration, field: name }
|
|
410
|
+
# A function declaration opens a scope, so the search above stops at it and
|
|
411
|
+
# never reads its name. This matches the declaration itself instead.
|
|
412
|
+
function-declaration:
|
|
413
|
+
any:
|
|
414
|
+
- kind: function_declaration
|
|
415
|
+
- kind: generator_function_declaration
|
|
416
|
+
datatable-import:
|
|
417
|
+
kind: import_statement
|
|
418
|
+
all:
|
|
419
|
+
- has:
|
|
420
|
+
field: source
|
|
421
|
+
regex: ^["']@ngrok/mantle/data-table["']$
|
|
422
|
+
- has:
|
|
423
|
+
stopBy: end
|
|
424
|
+
kind: import_specifier
|
|
425
|
+
has:
|
|
426
|
+
field: name
|
|
427
|
+
regex: ^DataTable$
|
|
428
|
+
any:
|
|
429
|
+
- kind: import_specifier
|
|
430
|
+
has:
|
|
431
|
+
field: alias
|
|
432
|
+
pattern: $DT
|
|
433
|
+
- kind: import_specifier
|
|
434
|
+
not:
|
|
435
|
+
has:
|
|
436
|
+
field: alias
|
|
437
|
+
kind: identifier
|
|
438
|
+
has:
|
|
439
|
+
field: name
|
|
440
|
+
pattern: $DT
|
|
441
|
+
table-import:
|
|
442
|
+
kind: import_statement
|
|
443
|
+
all:
|
|
444
|
+
- has:
|
|
445
|
+
field: source
|
|
446
|
+
regex: ^["']@ngrok/mantle/table["']$
|
|
447
|
+
- has:
|
|
448
|
+
stopBy: end
|
|
449
|
+
kind: import_specifier
|
|
450
|
+
has:
|
|
451
|
+
field: name
|
|
452
|
+
regex: ^Table$
|
|
453
|
+
any:
|
|
454
|
+
- kind: import_specifier
|
|
455
|
+
has:
|
|
456
|
+
field: alias
|
|
457
|
+
pattern: $TABLE
|
|
458
|
+
- kind: import_specifier
|
|
459
|
+
not:
|
|
460
|
+
has:
|
|
461
|
+
field: alias
|
|
462
|
+
kind: identifier
|
|
463
|
+
has:
|
|
464
|
+
field: name
|
|
465
|
+
pattern: $TABLE
|
|
466
|
+
action-cell-name:
|
|
467
|
+
kind: member_expression
|
|
468
|
+
all:
|
|
469
|
+
- has:
|
|
470
|
+
field: object
|
|
471
|
+
pattern: $DT
|
|
472
|
+
- has:
|
|
473
|
+
field: property
|
|
474
|
+
regex: ^ActionCell$
|
|
475
|
+
# The nearest object literal is the column, and it holds an action cell. The
|
|
476
|
+
# search stops at a nested object, so a column whose cell renders a table
|
|
477
|
+
# with its own action column keeps its header.
|
|
478
|
+
action-column:
|
|
479
|
+
kind: object
|
|
480
|
+
has:
|
|
481
|
+
stopBy:
|
|
482
|
+
kind: object
|
|
483
|
+
any:
|
|
484
|
+
- kind: jsx_opening_element
|
|
485
|
+
- kind: jsx_self_closing_element
|
|
486
|
+
has:
|
|
487
|
+
field: name
|
|
488
|
+
matches: action-cell-name
|
|
489
|
+
# The nearest property is the column's `header`, so a table a `cell` renders
|
|
490
|
+
# keeps its own headers.
|
|
491
|
+
header-property:
|
|
492
|
+
kind: pair
|
|
493
|
+
has:
|
|
494
|
+
field: key
|
|
495
|
+
regex: ^header$
|
|
496
|
+
rule:
|
|
497
|
+
pattern:
|
|
498
|
+
context: "({ header: () => null })"
|
|
499
|
+
selector: pair
|
|
500
|
+
all:
|
|
501
|
+
- inside:
|
|
502
|
+
stopBy:
|
|
503
|
+
kind: object
|
|
504
|
+
matches: action-column
|
|
505
|
+
- inside:
|
|
506
|
+
stopBy: end
|
|
507
|
+
kind: program
|
|
508
|
+
has:
|
|
509
|
+
matches: datatable-import
|
|
510
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
511
|
+
# rules cannot tell which binding the element reads.
|
|
512
|
+
- not:
|
|
513
|
+
inside:
|
|
514
|
+
stopBy: end
|
|
515
|
+
matches: scope
|
|
516
|
+
has:
|
|
517
|
+
stopBy:
|
|
518
|
+
matches: scope
|
|
519
|
+
any:
|
|
520
|
+
- matches: binding-name
|
|
521
|
+
pattern: $DT
|
|
522
|
+
- matches: function-declaration
|
|
523
|
+
has:
|
|
524
|
+
field: name
|
|
525
|
+
pattern: $DT
|
|
526
|
+
fix: "header: () => <$DT.ActionHeader />"
|