atom.io 0.33.12 → 0.33.14
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/data/index.js.map +1 -1
- package/dist/eslint-plugin/index.js.map +1 -1
- package/dist/internal/index.js +25 -23
- package/dist/internal/index.js.map +1 -1
- package/dist/introspection/index.d.ts +7 -7
- package/dist/introspection/index.d.ts.map +1 -1
- package/dist/introspection/index.js +26 -38
- package/dist/introspection/index.js.map +1 -1
- package/dist/json/index.js.map +1 -1
- package/dist/main/index.js +11 -11
- package/dist/main/index.js.map +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react-devtools/index.css +182 -96
- package/dist/react-devtools/index.css.map +1 -1
- package/dist/react-devtools/index.d.ts +1 -0
- package/dist/react-devtools/index.d.ts.map +1 -1
- package/dist/react-devtools/index.js +177 -81
- package/dist/react-devtools/index.js.map +1 -1
- package/dist/realtime/index.js.map +1 -1
- package/dist/realtime-client/index.js.map +1 -1
- package/dist/realtime-react/index.js.map +1 -1
- package/dist/realtime-server/index.js.map +1 -1
- package/dist/realtime-testing/index.js.map +1 -1
- package/dist/transceivers/set-rtx/index.js.map +1 -1
- package/dist/use-o-BrXc7Qro.js.map +1 -1
- package/dist/web/index.js.map +1 -1
- package/package.json +10 -10
- package/src/internal/transaction/create-transaction.ts +9 -5
- package/src/introspection/attach-atom-index.ts +6 -15
- package/src/introspection/attach-introspection-states.ts +5 -5
- package/src/introspection/attach-selector-index.ts +78 -85
- package/src/introspection/attach-timeline-index.ts +5 -12
- package/src/introspection/attach-transaction-index.ts +18 -16
- package/src/introspection/auditor.ts +2 -3
- package/src/react-devtools/Button.tsx +12 -4
- package/src/react-devtools/StateEditor.tsx +13 -1
- package/src/react-devtools/StateIndex.tsx +83 -39
- package/src/react-devtools/TimelineIndex.tsx +16 -12
- package/src/react-devtools/TransactionIndex.tsx +22 -18
- package/src/react-devtools/devtools.css +182 -96
- package/src/react-devtools/json-editor/developer-interface.tsx +2 -1
- package/src/react-devtools/json-editor/editors-by-type/array-editor.tsx +23 -20
- package/src/react-devtools/json-editor/editors-by-type/object-editor.tsx +7 -23
- package/src/react-devtools/json-editor/json-editor-internal.tsx +94 -77
- package/src/react-devtools/store.ts +97 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
main[data-css="atom_io_devtools"] {
|
|
2
2
|
--fg-color: #ccc;
|
|
3
3
|
--fg-light: #aaa;
|
|
4
|
-
--fg-soft: #
|
|
5
|
-
--fg-faint: #
|
|
6
|
-
--fg-hint: #
|
|
4
|
+
--fg-soft: #888;
|
|
5
|
+
--fg-faint: #777;
|
|
6
|
+
--fg-hint: #4a4a4a;
|
|
7
7
|
--fg-max: #fff;
|
|
8
8
|
--bg-color: #111;
|
|
9
9
|
--bg-accent: #00f;
|
|
@@ -26,6 +26,9 @@ main[data-css="atom_io_devtools"] {
|
|
|
26
26
|
--bg-tint1: #e3e3e3;
|
|
27
27
|
--bg-tint2: #f3f3f3;
|
|
28
28
|
}
|
|
29
|
+
* {
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
}
|
|
29
32
|
& {
|
|
30
33
|
pointer-events: all;
|
|
31
34
|
box-sizing: border-box;
|
|
@@ -44,7 +47,7 @@ main[data-css="atom_io_devtools"] {
|
|
|
44
47
|
overflow-y: scroll;
|
|
45
48
|
}
|
|
46
49
|
* {
|
|
47
|
-
font-size:
|
|
50
|
+
font-size: 14px;
|
|
48
51
|
font-family: theia, monospace;
|
|
49
52
|
line-height: 1em;
|
|
50
53
|
color: var(--fg-color);
|
|
@@ -83,54 +86,76 @@ main[data-css="atom_io_devtools"] {
|
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
88
|
}
|
|
89
|
+
|
|
86
90
|
> main {
|
|
87
91
|
background: var(--bg-tint1);
|
|
88
|
-
}
|
|
89
|
-
> main::before {
|
|
90
|
-
background-color: black;
|
|
91
|
-
height: 10px;
|
|
92
|
-
}
|
|
93
|
-
main {
|
|
94
92
|
overflow-y: scroll;
|
|
95
93
|
flex-grow: 1;
|
|
96
94
|
display: flex;
|
|
97
95
|
flex-flow: column;
|
|
98
96
|
gap: 0;
|
|
99
97
|
article.index {
|
|
98
|
+
margin-bottom: 0px;
|
|
99
|
+
padding-bottom: 24px;
|
|
100
|
+
border-top: var(--fg-border);
|
|
101
|
+
min-height: calc(100% - 24px);
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-shrink: 0;
|
|
104
|
+
flex-flow: column;
|
|
100
105
|
.node .node {
|
|
101
|
-
border-right:
|
|
106
|
+
border-right: none;
|
|
102
107
|
padding-right: 0;
|
|
103
108
|
background: #ffffff08;
|
|
104
109
|
@media (prefers-color-scheme: light) {
|
|
105
110
|
background: #00000004;
|
|
106
111
|
}
|
|
107
112
|
}
|
|
113
|
+
.index-empty-state {
|
|
114
|
+
width: 100%;
|
|
115
|
+
height: 100%;
|
|
116
|
+
font-style: italic;
|
|
117
|
+
display: flex;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
align-items: center;
|
|
120
|
+
}
|
|
108
121
|
.node > .node {
|
|
109
|
-
margin: 0px
|
|
122
|
+
margin: 0px 0px 0px 9px;
|
|
123
|
+
width: calc(100% - 9px);
|
|
110
124
|
border-left: var(--fg-border-soft);
|
|
125
|
+
&:first-of-type {
|
|
126
|
+
border-top: var(--fg-border-soft);
|
|
127
|
+
}
|
|
111
128
|
&:last-of-type {
|
|
112
|
-
|
|
129
|
+
border-bottom: none;
|
|
113
130
|
}
|
|
114
131
|
}
|
|
115
132
|
.node {
|
|
116
|
-
|
|
133
|
+
position: relative;
|
|
134
|
+
border-bottom: var(--fg-border-soft);
|
|
117
135
|
overflow: visible;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
136
|
+
width: 100%;
|
|
137
|
+
display: flex;
|
|
138
|
+
flex-flow: column;
|
|
121
139
|
&.transaction_update {
|
|
122
140
|
padding: 0;
|
|
123
141
|
}
|
|
142
|
+
|
|
124
143
|
> header {
|
|
144
|
+
width: auto;
|
|
125
145
|
display: flex;
|
|
126
146
|
flex-flow: row;
|
|
147
|
+
justify-content: space-between;
|
|
127
148
|
position: sticky;
|
|
128
149
|
z-index: 999;
|
|
129
150
|
top: 0;
|
|
130
151
|
height: 22px;
|
|
131
152
|
background: var(--bg-tint2);
|
|
132
|
-
border-bottom:
|
|
153
|
+
border-bottom: none;
|
|
154
|
+
align-items: center;
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
|
|
133
157
|
> main {
|
|
158
|
+
height: 100%;
|
|
134
159
|
display: flex;
|
|
135
160
|
flex-flow: row;
|
|
136
161
|
cursor: help;
|
|
@@ -146,47 +171,67 @@ main[data-css="atom_io_devtools"] {
|
|
|
146
171
|
h2 {
|
|
147
172
|
margin: 0;
|
|
148
173
|
}
|
|
149
|
-
.detail {
|
|
150
|
-
margin-left: 5px;
|
|
151
|
-
color: #777;
|
|
152
|
-
@media (prefers-color-scheme: light) {
|
|
153
|
-
color: #999;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
174
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
> .json_editor,
|
|
164
|
-
> .json_viewer {
|
|
175
|
+
|
|
176
|
+
> footer {
|
|
177
|
+
height: 16px;
|
|
178
|
+
width: fit-content;
|
|
179
|
+
min-width: 0;
|
|
165
180
|
display: flex;
|
|
166
|
-
|
|
167
|
-
z-index: -1;
|
|
168
|
-
overflow-x: scroll;
|
|
181
|
+
justify-content: flex-start;
|
|
169
182
|
align-items: center;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
outline: 2px solid var(--fg-max);
|
|
176
|
-
* {
|
|
177
|
-
color: var(--fg-max);
|
|
178
|
-
}
|
|
183
|
+
flex-shrink: 1;
|
|
184
|
+
> button {
|
|
185
|
+
border: none;
|
|
186
|
+
background: none;
|
|
187
|
+
border-left: var(--fg-border-soft);
|
|
179
188
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
189
|
+
> .json_viewer {
|
|
190
|
+
color: var(--fg-light);
|
|
191
|
+
flex-shrink: 1;
|
|
192
|
+
overflow: scroll;
|
|
193
|
+
align-self: center;
|
|
194
|
+
align-items: flex-start;
|
|
183
195
|
}
|
|
184
|
-
>
|
|
185
|
-
|
|
186
|
-
|
|
196
|
+
> .json_editor,
|
|
197
|
+
> .json_viewer {
|
|
198
|
+
height: 16px;
|
|
199
|
+
min-width: 10px;
|
|
200
|
+
padding-left: 4px;
|
|
201
|
+
padding-right: 2px;
|
|
202
|
+
display: flex;
|
|
203
|
+
flex-flow: row;
|
|
204
|
+
margin-right: 0px;
|
|
205
|
+
overflow-x: scroll;
|
|
206
|
+
align-items: center;
|
|
207
|
+
justify-content: flex-start;
|
|
208
|
+
white-space: pre;
|
|
209
|
+
border-left: var(--fg-border-soft);
|
|
210
|
+
&:focus-within {
|
|
211
|
+
background-color: var(--bg-max);
|
|
212
|
+
outline: 2px solid var(--fg-max);
|
|
213
|
+
* {
|
|
214
|
+
color: var(--fg-max);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
main {
|
|
218
|
+
height: 100%;
|
|
219
|
+
}
|
|
220
|
+
> span {
|
|
221
|
+
padding: 0px 5px;
|
|
222
|
+
z-index: 0;
|
|
223
|
+
}
|
|
224
|
+
input {
|
|
225
|
+
outline: none;
|
|
226
|
+
}
|
|
187
227
|
}
|
|
188
|
-
|
|
189
|
-
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.detail {
|
|
231
|
+
margin-left: 5px;
|
|
232
|
+
color: #777;
|
|
233
|
+
@media (prefers-color-scheme: light) {
|
|
234
|
+
color: #999;
|
|
190
235
|
}
|
|
191
236
|
}
|
|
192
237
|
}
|
|
@@ -196,8 +241,8 @@ main[data-css="atom_io_devtools"] {
|
|
|
196
241
|
main {
|
|
197
242
|
display: flex;
|
|
198
243
|
flex-flow: row wrap;
|
|
199
|
-
gap:
|
|
200
|
-
.transaction_update {
|
|
244
|
+
gap: 0;
|
|
245
|
+
article.transaction_update {
|
|
201
246
|
width: 100%;
|
|
202
247
|
display: flex;
|
|
203
248
|
flex-flow: row;
|
|
@@ -205,10 +250,14 @@ main[data-css="atom_io_devtools"] {
|
|
|
205
250
|
justify-content: flex-start;
|
|
206
251
|
justify-items: flex-start;
|
|
207
252
|
align-content: flex-start;
|
|
208
|
-
border-left:
|
|
253
|
+
border-left: none;
|
|
254
|
+
border-bottom: none;
|
|
209
255
|
border-top: var(--fg-border);
|
|
210
256
|
header {
|
|
257
|
+
height: 100%;
|
|
211
258
|
padding: 5px;
|
|
259
|
+
display: flex;
|
|
260
|
+
flex-flow: column;
|
|
212
261
|
h4 {
|
|
213
262
|
margin: 0;
|
|
214
263
|
padding: 0;
|
|
@@ -219,6 +268,7 @@ main[data-css="atom_io_devtools"] {
|
|
|
219
268
|
margin-left: 0;
|
|
220
269
|
display: flex;
|
|
221
270
|
flex-flow: column;
|
|
271
|
+
flex-grow: 1;
|
|
222
272
|
gap: 0px;
|
|
223
273
|
border-left: 1px solid #333;
|
|
224
274
|
section ~ section {
|
|
@@ -226,16 +276,22 @@ main[data-css="atom_io_devtools"] {
|
|
|
226
276
|
}
|
|
227
277
|
section {
|
|
228
278
|
padding: 5px;
|
|
279
|
+
border-bottom: none;
|
|
280
|
+
margin: 0;
|
|
229
281
|
&.transaction_output {
|
|
230
282
|
border-right: none;
|
|
231
283
|
}
|
|
232
284
|
&.transaction_impact {
|
|
233
285
|
padding: 5px;
|
|
234
286
|
}
|
|
235
|
-
|
|
287
|
+
|
|
236
288
|
article {
|
|
289
|
+
padding: 3px 6px;
|
|
237
290
|
border-left: var(--fg-border);
|
|
238
291
|
border-right: var(--fg-border);
|
|
292
|
+
&:first-of-type {
|
|
293
|
+
border-top: var(--fg-border);
|
|
294
|
+
}
|
|
239
295
|
.summary {
|
|
240
296
|
white-space: nowrap;
|
|
241
297
|
}
|
|
@@ -245,6 +301,7 @@ main[data-css="atom_io_devtools"] {
|
|
|
245
301
|
}
|
|
246
302
|
}
|
|
247
303
|
}
|
|
304
|
+
|
|
248
305
|
section.timeline_log {
|
|
249
306
|
header {
|
|
250
307
|
display: flex;
|
|
@@ -285,7 +342,9 @@ main[data-css="atom_io_devtools"] {
|
|
|
285
342
|
}
|
|
286
343
|
}
|
|
287
344
|
}
|
|
288
|
-
|
|
345
|
+
|
|
346
|
+
> footer {
|
|
347
|
+
z-index: 10000;
|
|
289
348
|
display: flex;
|
|
290
349
|
justify-content: flex-end;
|
|
291
350
|
button {
|
|
@@ -302,31 +361,41 @@ main[data-css="atom_io_devtools"] {
|
|
|
302
361
|
.json_editor {
|
|
303
362
|
display: flex;
|
|
304
363
|
flex-flow: column;
|
|
305
|
-
align-items: flex-start;
|
|
306
364
|
> header {
|
|
365
|
+
width: 100%;
|
|
307
366
|
display: flex;
|
|
308
367
|
flex-flow: row;
|
|
309
|
-
|
|
310
|
-
position: relative;
|
|
311
|
-
align-items: baseline;
|
|
368
|
+
align-items: center;
|
|
312
369
|
overflow: hidden;
|
|
313
370
|
white-space: nowrap;
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
overflow-x: scroll;
|
|
371
|
+
justify-content: space-between;
|
|
372
|
+
&:has(> main > button.carat) {
|
|
317
373
|
height: 21px;
|
|
318
|
-
|
|
374
|
+
}
|
|
375
|
+
> main {
|
|
319
376
|
display: flex;
|
|
377
|
+
flex-flow: row;
|
|
320
378
|
align-items: center;
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
379
|
+
align-self: center;
|
|
380
|
+
flex-shrink: 1;
|
|
381
|
+
overflow-x: hidden;
|
|
382
|
+
padding-right: 2px;
|
|
383
|
+
> .json_viewer {
|
|
384
|
+
flex-shrink: 1;
|
|
385
|
+
overflow-x: scroll;
|
|
386
|
+
height: 21px;
|
|
328
387
|
font-size: 14px;
|
|
329
|
-
|
|
388
|
+
display: flex;
|
|
389
|
+
align-items: center;
|
|
390
|
+
margin-left: 0px;
|
|
391
|
+
color: var(--fg-soft);
|
|
392
|
+
}
|
|
393
|
+
> button {
|
|
394
|
+
padding: 0;
|
|
395
|
+
&.carat {
|
|
396
|
+
line-height: 0.5em;
|
|
397
|
+
font-size: 14px;
|
|
398
|
+
}
|
|
330
399
|
}
|
|
331
400
|
}
|
|
332
401
|
}
|
|
@@ -343,7 +412,6 @@ main[data-css="atom_io_devtools"] {
|
|
|
343
412
|
}
|
|
344
413
|
}
|
|
345
414
|
input,
|
|
346
|
-
button,
|
|
347
415
|
select {
|
|
348
416
|
&:focus-within {
|
|
349
417
|
outline: 2px solid var(--fg-max);
|
|
@@ -351,6 +419,7 @@ main[data-css="atom_io_devtools"] {
|
|
|
351
419
|
color: var(--fg-max);
|
|
352
420
|
}
|
|
353
421
|
}
|
|
422
|
+
|
|
354
423
|
button:disabled {
|
|
355
424
|
cursor: default;
|
|
356
425
|
> span.json_editor_icon {
|
|
@@ -376,9 +445,20 @@ main[data-css="atom_io_devtools"] {
|
|
|
376
445
|
padding: 4px;
|
|
377
446
|
padding-bottom: 6px;
|
|
378
447
|
cursor: pointer;
|
|
379
|
-
&:hover
|
|
380
|
-
|
|
381
|
-
background-color:
|
|
448
|
+
&:hover,
|
|
449
|
+
&:focus-within {
|
|
450
|
+
background-color: var(--fg-faint);
|
|
451
|
+
&,
|
|
452
|
+
> * {
|
|
453
|
+
color: var(--bg-color);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
&:active {
|
|
457
|
+
background: var(--fg-color);
|
|
458
|
+
&,
|
|
459
|
+
> * {
|
|
460
|
+
color: var(--bg-color);
|
|
461
|
+
}
|
|
382
462
|
}
|
|
383
463
|
}
|
|
384
464
|
select {
|
|
@@ -404,6 +484,7 @@ main[data-css="atom_io_devtools"] {
|
|
|
404
484
|
padding-right: 0px;
|
|
405
485
|
&::after {
|
|
406
486
|
content: ":";
|
|
487
|
+
color: var(--fg-soft);
|
|
407
488
|
}
|
|
408
489
|
input {
|
|
409
490
|
color: var(--fg-color);
|
|
@@ -412,26 +493,35 @@ main[data-css="atom_io_devtools"] {
|
|
|
412
493
|
.json_editor_object,
|
|
413
494
|
.json_editor_array {
|
|
414
495
|
border-left: var(--fg-border-soft);
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
496
|
+
margin-left: 9px;
|
|
497
|
+
width: calc(100% - 9px);
|
|
498
|
+
> footer {
|
|
499
|
+
display: flex;
|
|
500
|
+
flex-flow: row;
|
|
501
|
+
justify-content: flex-start;
|
|
502
|
+
justify-items: flex-start;
|
|
503
|
+
height: 21px;
|
|
504
|
+
align-items: baseline;
|
|
505
|
+
position: relative;
|
|
506
|
+
}
|
|
418
507
|
.json_editor_properties,
|
|
419
508
|
.json_editor_elements {
|
|
509
|
+
border-top: var(--fg-border-soft);
|
|
420
510
|
.json_editor_property,
|
|
421
511
|
.json_editor_element {
|
|
422
512
|
display: flex;
|
|
423
513
|
border-bottom: var(--fg-border-soft);
|
|
424
|
-
margin-bottom:
|
|
425
|
-
min-height:
|
|
514
|
+
margin-bottom: 0;
|
|
515
|
+
min-height: 21px;
|
|
426
516
|
> header {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
517
|
+
> main {
|
|
518
|
+
> span {
|
|
519
|
+
input {
|
|
520
|
+
min-width: 10px;
|
|
521
|
+
}
|
|
522
|
+
> * {
|
|
523
|
+
border: var(--fg-border-hint);
|
|
524
|
+
}
|
|
435
525
|
}
|
|
436
526
|
}
|
|
437
527
|
}
|
|
@@ -442,7 +532,7 @@ main[data-css="atom_io_devtools"] {
|
|
|
442
532
|
&:last-of-type {
|
|
443
533
|
border-bottom: none;
|
|
444
534
|
}
|
|
445
|
-
|
|
535
|
+
span > * {
|
|
446
536
|
border: 1px solid transparent;
|
|
447
537
|
}
|
|
448
538
|
}
|
|
@@ -459,10 +549,6 @@ main[data-css="atom_io_devtools"] {
|
|
|
459
549
|
border: none;
|
|
460
550
|
cursor: pointer;
|
|
461
551
|
background: none;
|
|
462
|
-
&:focus-within {
|
|
463
|
-
outline: none;
|
|
464
|
-
background: none;
|
|
465
|
-
}
|
|
466
552
|
> .json_editor_icon {
|
|
467
553
|
line-height: 4px;
|
|
468
554
|
}
|
|
@@ -48,6 +48,7 @@ export const JsonEditor = <T,>({
|
|
|
48
48
|
name,
|
|
49
49
|
rename,
|
|
50
50
|
remove,
|
|
51
|
+
path = [],
|
|
51
52
|
isReadonly = () => false,
|
|
52
53
|
isHidden = () => false,
|
|
53
54
|
className,
|
|
@@ -68,7 +69,7 @@ export const JsonEditor = <T,>({
|
|
|
68
69
|
name={name}
|
|
69
70
|
rename={rename}
|
|
70
71
|
remove={remove}
|
|
71
|
-
path={
|
|
72
|
+
path={path}
|
|
72
73
|
isReadonly={isReadonly}
|
|
73
74
|
isHidden={isHidden}
|
|
74
75
|
className={className}
|
|
@@ -25,7 +25,7 @@ type ArrayElementProps = {
|
|
|
25
25
|
recast: (newType: keyof JsonTypes) => void
|
|
26
26
|
Components: JsonEditorComponents
|
|
27
27
|
testid?: string | undefined
|
|
28
|
-
viewIsOpenAtom: RegularAtomToken<boolean, string>
|
|
28
|
+
viewIsOpenAtom: RegularAtomToken<boolean, readonly (number | string)[]>
|
|
29
29
|
}
|
|
30
30
|
const ArrayElement = ({
|
|
31
31
|
path,
|
|
@@ -80,15 +80,14 @@ export const ArrayEditor = ({
|
|
|
80
80
|
|
|
81
81
|
return (
|
|
82
82
|
<Components.ArrayWrapper>
|
|
83
|
-
<
|
|
83
|
+
<main className={`json_editor_elements${disabled ? ` readonly` : ``}`}>
|
|
84
84
|
{data.map((element, index) => {
|
|
85
85
|
const elementPath = [...path, index]
|
|
86
86
|
const pathKey = elementPath.join(`,`)
|
|
87
|
-
const viewIsOpenAtom = findInStore(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
)
|
|
87
|
+
const viewIsOpenAtom = findInStore(store, viewIsOpenAtoms, [
|
|
88
|
+
...path,
|
|
89
|
+
index,
|
|
90
|
+
])
|
|
92
91
|
return (
|
|
93
92
|
<ArrayElement
|
|
94
93
|
key={pathKey}
|
|
@@ -105,19 +104,23 @@ export const ArrayEditor = ({
|
|
|
105
104
|
/>
|
|
106
105
|
)
|
|
107
106
|
})}
|
|
108
|
-
</
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
107
|
+
</main>
|
|
108
|
+
{!disabled ? (
|
|
109
|
+
<footer>
|
|
110
|
+
<Components.Button
|
|
111
|
+
testid={`${testid}-add-element`}
|
|
112
|
+
disabled={disabled}
|
|
113
|
+
onClick={() => {
|
|
114
|
+
set((current) => {
|
|
115
|
+
const newData = [...current, JSON_DEFAULTS.string]
|
|
116
|
+
return newData
|
|
117
|
+
})
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
<Components.AddIcon />
|
|
121
|
+
</Components.Button>
|
|
122
|
+
</footer>
|
|
123
|
+
) : null}
|
|
121
124
|
</Components.ArrayWrapper>
|
|
122
125
|
)
|
|
123
126
|
}
|
|
@@ -60,7 +60,7 @@ type ObjectPropertyProps = {
|
|
|
60
60
|
recast: (newType: keyof JsonTypes) => void
|
|
61
61
|
Components: JsonEditorComponents
|
|
62
62
|
testid?: string | undefined
|
|
63
|
-
viewIsOpenAtom: RegularAtomToken<boolean, string>
|
|
63
|
+
viewIsOpenAtom: RegularAtomToken<boolean, readonly (number | string)[]>
|
|
64
64
|
}
|
|
65
65
|
const ObjectProperty = ({
|
|
66
66
|
path,
|
|
@@ -137,28 +137,12 @@ export const ObjectEditor = <T extends Json.Tree.Object>({
|
|
|
137
137
|
const propertyPath = [...path, key]
|
|
138
138
|
const originalPropertyPath = [...path, originalKey]
|
|
139
139
|
const stablePathKey = originalPropertyPath.join(`.`)
|
|
140
|
-
const viewIsOpenAtom = findInStore(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
)
|
|
140
|
+
const viewIsOpenAtom = findInStore(store, viewIsOpenAtoms, [
|
|
141
|
+
...path,
|
|
142
|
+
key,
|
|
143
|
+
])
|
|
145
144
|
|
|
146
145
|
return (
|
|
147
|
-
// <JsonEditor_INTERNAL
|
|
148
|
-
// key={originalPath.join(`.`)}
|
|
149
|
-
// path={newPath}
|
|
150
|
-
// name={key}
|
|
151
|
-
// isReadonly={isReadonly}
|
|
152
|
-
// isHidden={isHidden}
|
|
153
|
-
// data={data[key as keyof T]}
|
|
154
|
-
// set={setProperty[key as keyof T]}
|
|
155
|
-
// rename={renameProperty[key as keyof T]}
|
|
156
|
-
// remove={removeProperty[key as keyof T]}
|
|
157
|
-
// recast={recastProperty[key as keyof T]}
|
|
158
|
-
// className="json_editor_property"
|
|
159
|
-
// Components={Components}
|
|
160
|
-
// testid={`${testid}-property-${key}`}
|
|
161
|
-
// />
|
|
162
146
|
<ObjectProperty
|
|
163
147
|
key={stablePathKey}
|
|
164
148
|
path={propertyPath}
|
|
@@ -177,7 +161,7 @@ export const ObjectEditor = <T extends Json.Tree.Object>({
|
|
|
177
161
|
})}
|
|
178
162
|
</div>
|
|
179
163
|
{disabled ? null : (
|
|
180
|
-
|
|
164
|
+
<footer>
|
|
181
165
|
<Components.Button
|
|
182
166
|
disabled={disabled}
|
|
183
167
|
testid={`${testid}-add-property`}
|
|
@@ -196,7 +180,7 @@ export const ObjectEditor = <T extends Json.Tree.Object>({
|
|
|
196
180
|
>
|
|
197
181
|
Sort
|
|
198
182
|
</Components.Button>
|
|
199
|
-
|
|
183
|
+
</footer>
|
|
200
184
|
)}
|
|
201
185
|
</Components.ObjectWrapper>
|
|
202
186
|
)
|