@ngrok/mantle 0.89.0 → 0.90.1
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/agent.json +1529 -1
- package/dist/alert-DO00UiQe.js +1 -0
- package/dist/{alert-CZYYlx9q.js → alert-ZaUBtgno.js} +1 -1
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/app-layout.d.ts +68 -13
- package/dist/app-layout.js +1 -1
- package/dist/card.d.ts +7 -0
- package/dist/combobox.d.ts +1 -1
- package/dist/command.js +1 -1
- package/dist/{dialog-BDzapPLR.js → dialog-CaGJD02w.js} +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-CpRsyt_F.d.ts → dropdown-menu-Cef0Cz2B.d.ts} +1 -1
- package/dist/dropdown-menu-DMA8dGxZ.d.ts +1 -0
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/empty.d.ts +7 -0
- package/dist/flag.d.ts +1 -1
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +251 -1
- package/dist/hooks.js +1 -1
- package/dist/{icons-BMZnm4hM.js → icons-CAtjMNti.js} +1 -1
- package/dist/icons.js +1 -1
- package/dist/input.js +1 -1
- package/dist/llms.txt +117 -2
- package/dist/mantle.css +9 -0
- 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 +1 -1
- package/dist/multi-select.js +1 -1
- package/dist/pagination.d.ts +1 -1
- package/dist/{primitive-B-6XILB2.js → primitive-AGoxSJBI.js} +1 -1
- package/dist/sandbar.js +1 -1
- package/dist/{select-CxXb3aiC.d.ts → select-DlohFa54.d.ts} +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/{separator-HzGvuD0B.d.ts → separator-BWGjCIl7.d.ts} +7 -0
- package/dist/separator.d.ts +1 -1
- package/dist/{sheet-DND_KjmS.js → sheet-H8zvhSuA.js} +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +17 -10
- package/dist/sidebar.js +1 -1
- package/dist/split-button.d.ts +1 -1
- package/dist/strata.d.ts +548 -0
- package/dist/strata.js +1 -0
- package/dist/tabs.d.ts +12 -2
- package/dist/tabs.js +1 -1
- package/dist/theme-6Q65C1Rx.js +1 -0
- package/dist/theme-switcher.d.ts +2 -2
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/truncated-text.d.ts +9 -1
- package/dist/truncated-text.js +1 -1
- package/dist/use-prefers-reduced-motion-DimzRx-M.js +1 -0
- package/dist/use-swipe-to-dismiss-Cj-AayFd.js +1 -0
- package/dist/well.d.ts +7 -0
- package/package.json +4 -3
- package/dist/alert-vfeV_hso.js +0 -1
- package/dist/dropdown-menu-CWUzGFgf.d.ts +0 -1
- package/dist/theme-BlCZHClJ.js +0 -1
- package/dist/use-prefers-reduced-motion-Cj9tJ181.js +0 -1
|
@@ -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 />"
|