@workbench-kit/shell-react 0.0.2-prototype.0.2.41 → 0.0.2-prototype.0.2.44
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/README.md +81 -2
- package/package.json +14 -10
- package/src/editor/workspace-reconcile.tsx +12 -7
- package/src/extensions/extension-enablement-controller.ts +40 -9
- package/src/extensions/theme-selection-protection.ts +80 -55
- package/src/field-remap/chrome-labels.ts +117 -0
- package/src/field-remap/convert-note-editor.tsx +119 -104
- package/src/field-remap/convert-palette.tsx +6 -0
- package/src/field-remap/demo.tsx +8 -2
- package/src/field-remap/detail-panel.tsx +535 -434
- package/src/field-remap/document-io.tsx +299 -0
- package/src/field-remap/drag-payload.ts +48 -0
- package/src/field-remap/flow-adapter.ts +216 -88
- package/src/field-remap/flow-ops.ts +150 -0
- package/src/field-remap/flow.tsx +1227 -272
- package/src/field-remap/index.ts +2 -0
- package/src/field-remap/io-class-browse.tsx +34 -22
- package/src/field-remap/keyboard.ts +16 -0
- package/src/field-remap/modal-detail.tsx +34 -0
- package/src/field-remap/panel.tsx +110 -14
- package/src/field-remap/transform-options-editor.tsx +68 -48
- package/src/field-remap/view.css +107 -189
- package/src/index.ts +7 -0
- package/src/keybinding-management-settings.ts +4 -0
- package/src/management/keybinding-overrides-storage.ts +48 -23
- package/src/management/keybinding-settings-view.tsx +31 -0
- package/src/management/keybinding-settings.tsx +4 -12
- package/src/management/use-keybinding-management.ts +72 -22
- package/src/shell/appearance-catalog.ts +453 -0
- package/src/shell/appearance-controller.ts +331 -0
- package/src/shell/appearance-presentation.ts +269 -0
- package/src/shell/provider.tsx +157 -19
- package/src/shell/settings.tsx +282 -153
- package/src/shell/shell.tsx +88 -18
- package/src/workbench/appearance-storage.ts +2 -2
- package/src/workbench/command-host-controller.tsx +223 -0
- package/src/workbench/command-host.tsx +100 -150
- package/src/workbench/keybinding-bridge.ts +84 -38
- package/src/workbench/shell-command-registration.ts +27 -2
package/src/field-remap/view.css
CHANGED
|
@@ -53,6 +53,50 @@
|
|
|
53
53
|
font-size: 0.8em;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
.workbench-field-remap-document-io {
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-wrap: wrap;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: 0.5rem 0.75rem;
|
|
61
|
+
margin-top: 0.25rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.workbench-field-remap-document-io__actions {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-wrap: wrap;
|
|
67
|
+
gap: 0.5rem;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.workbench-field-remap-document-io__availability,
|
|
71
|
+
.workbench-field-remap-document-io__status {
|
|
72
|
+
color: var(--vscode-descriptionForeground, var(--color-text-muted));
|
|
73
|
+
font-size: 0.8rem;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.workbench-field-remap-document-io__status[data-status='error'],
|
|
77
|
+
.workbench-field-remap-document-import__error {
|
|
78
|
+
color: var(--vscode-errorForeground, var(--color-danger));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.workbench-field-remap-document-export__description,
|
|
82
|
+
.workbench-field-remap-document-import__description,
|
|
83
|
+
.workbench-field-remap-document-import__error {
|
|
84
|
+
margin: 0;
|
|
85
|
+
font-size: 0.875rem;
|
|
86
|
+
line-height: 1.45;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.workbench-field-remap-document-export__label,
|
|
90
|
+
.workbench-field-remap-document-import__label {
|
|
91
|
+
font-size: 0.875rem;
|
|
92
|
+
font-weight: 600;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.workbench-field-remap-document-export__body textarea,
|
|
96
|
+
.workbench-field-remap-document-import__body textarea {
|
|
97
|
+
min-height: 14rem;
|
|
98
|
+
}
|
|
99
|
+
|
|
56
100
|
.workbench-field-remap-demo__error {
|
|
57
101
|
margin: 0;
|
|
58
102
|
color: var(--vscode-errorForeground, var(--color-danger));
|
|
@@ -486,22 +530,6 @@
|
|
|
486
530
|
gap: 0.35rem;
|
|
487
531
|
}
|
|
488
532
|
|
|
489
|
-
.workbench-field-remap-detail__draft-ports {
|
|
490
|
-
display: grid;
|
|
491
|
-
gap: 0.5rem;
|
|
492
|
-
margin: 0;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
.workbench-field-remap-detail__draft-ports dt {
|
|
496
|
-
font-size: 0.7rem;
|
|
497
|
-
text-transform: uppercase;
|
|
498
|
-
color: var(--vscode-descriptionForeground, var(--color-text-muted));
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
.workbench-field-remap-detail__draft-ports dd {
|
|
502
|
-
margin: 0;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
533
|
.workbench-field-remap-flow__canvas {
|
|
506
534
|
height: min(40rem, 70vh);
|
|
507
535
|
min-height: 26rem;
|
|
@@ -772,6 +800,11 @@
|
|
|
772
800
|
font: inherit;
|
|
773
801
|
}
|
|
774
802
|
|
|
803
|
+
.workbench-field-remap-flow__binding-select.is-selected {
|
|
804
|
+
color: var(--vscode-textLink-foreground, var(--color-accent, #3794ff));
|
|
805
|
+
font-weight: 600;
|
|
806
|
+
}
|
|
807
|
+
|
|
775
808
|
.workbench-field-remap-detail,
|
|
776
809
|
.workbench-field-remap-convert-note {
|
|
777
810
|
display: flex;
|
|
@@ -797,6 +830,15 @@
|
|
|
797
830
|
overflow: auto;
|
|
798
831
|
}
|
|
799
832
|
|
|
833
|
+
.workbench-field-remap-detail-modal .workbench-field-remap-detail,
|
|
834
|
+
.workbench-field-remap-detail-modal .workbench-field-remap-convert-note {
|
|
835
|
+
min-height: 0;
|
|
836
|
+
max-height: none;
|
|
837
|
+
border: 0;
|
|
838
|
+
border-radius: 0;
|
|
839
|
+
background: transparent;
|
|
840
|
+
}
|
|
841
|
+
|
|
800
842
|
.workbench-field-remap-preview {
|
|
801
843
|
display: flex;
|
|
802
844
|
flex-direction: column;
|
|
@@ -850,39 +892,6 @@
|
|
|
850
892
|
background: var(--vscode-editor-background, var(--color-bg));
|
|
851
893
|
}
|
|
852
894
|
|
|
853
|
-
.workbench-field-remap-convert-note__header {
|
|
854
|
-
display: flex;
|
|
855
|
-
align-items: flex-start;
|
|
856
|
-
justify-content: space-between;
|
|
857
|
-
gap: 0.5rem;
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
.workbench-field-remap-convert-note__eyebrow {
|
|
861
|
-
margin: 0 0 0.2rem;
|
|
862
|
-
font-size: 0.7rem;
|
|
863
|
-
font-weight: 600;
|
|
864
|
-
letter-spacing: 0.04em;
|
|
865
|
-
text-transform: uppercase;
|
|
866
|
-
color: var(--vscode-focusBorder, var(--color-accent, #3794ff));
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
.workbench-field-remap-convert-note__header h4,
|
|
870
|
-
.workbench-field-remap-convert-note__section h5 {
|
|
871
|
-
margin: 0 0 0.35rem;
|
|
872
|
-
font-size: 0.75rem;
|
|
873
|
-
font-weight: 600;
|
|
874
|
-
text-transform: uppercase;
|
|
875
|
-
letter-spacing: 0.03em;
|
|
876
|
-
color: var(--vscode-descriptionForeground, var(--color-text-muted));
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
.workbench-field-remap-convert-note__header h4 {
|
|
880
|
-
font-size: 1rem;
|
|
881
|
-
text-transform: none;
|
|
882
|
-
letter-spacing: normal;
|
|
883
|
-
color: var(--vscode-foreground, var(--color-text));
|
|
884
|
-
}
|
|
885
|
-
|
|
886
895
|
.workbench-field-remap-convert-note__binding,
|
|
887
896
|
.workbench-field-remap-convert-note__muted {
|
|
888
897
|
display: block;
|
|
@@ -898,68 +907,15 @@
|
|
|
898
907
|
gap: 0.35rem;
|
|
899
908
|
}
|
|
900
909
|
|
|
901
|
-
.workbench-field-remap-convert-note__section,
|
|
902
|
-
.workbench-field-remap-convert-note__field {
|
|
903
|
-
display: flex;
|
|
904
|
-
flex-direction: column;
|
|
905
|
-
gap: 0.5rem;
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
.workbench-field-remap-convert-note__field {
|
|
909
|
-
gap: 0.2rem;
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
.workbench-field-remap-convert-note select {
|
|
913
|
-
box-sizing: border-box;
|
|
914
|
-
width: 100%;
|
|
915
|
-
margin-top: 0.2rem;
|
|
916
|
-
padding: 0.3rem 0.4rem;
|
|
917
|
-
border: 1px solid var(--vscode-panel-border, var(--color-border));
|
|
918
|
-
border-radius: 0.25rem;
|
|
919
|
-
background: var(--vscode-input-background, var(--color-bg));
|
|
920
|
-
color: var(--vscode-input-foreground, var(--color-text));
|
|
921
|
-
font: inherit;
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
.workbench-field-remap-convert-note__footer {
|
|
925
|
-
margin-top: auto;
|
|
926
|
-
padding-top: 0.5rem;
|
|
927
|
-
border-top: 1px solid var(--vscode-panel-border, var(--color-border));
|
|
928
|
-
}
|
|
929
|
-
|
|
930
910
|
.workbench-field-remap-detail--empty {
|
|
931
911
|
color: var(--vscode-descriptionForeground, var(--color-text-muted));
|
|
932
912
|
}
|
|
933
913
|
|
|
934
|
-
.workbench-field-remap-detail__header {
|
|
935
|
-
display: flex;
|
|
936
|
-
align-items: flex-start;
|
|
937
|
-
justify-content: space-between;
|
|
938
|
-
gap: 0.5rem;
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
.workbench-field-remap-detail__header h4,
|
|
942
|
-
.workbench-field-remap-detail__section h5 {
|
|
943
|
-
margin: 0 0 0.35rem;
|
|
944
|
-
font-size: 0.75rem;
|
|
945
|
-
font-weight: 600;
|
|
946
|
-
text-transform: uppercase;
|
|
947
|
-
letter-spacing: 0.03em;
|
|
948
|
-
color: var(--vscode-descriptionForeground, var(--color-text-muted));
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
.workbench-field-remap-detail__header code,
|
|
952
914
|
.workbench-field-remap-detail__steps code {
|
|
953
915
|
font-size: 0.75rem;
|
|
954
916
|
word-break: break-all;
|
|
955
917
|
}
|
|
956
918
|
|
|
957
|
-
.workbench-field-remap-detail__section {
|
|
958
|
-
display: flex;
|
|
959
|
-
flex-direction: column;
|
|
960
|
-
gap: 0.5rem;
|
|
961
|
-
}
|
|
962
|
-
|
|
963
919
|
.workbench-field-remap-detail__muted {
|
|
964
920
|
margin: 0;
|
|
965
921
|
color: var(--vscode-descriptionForeground, var(--color-text-muted));
|
|
@@ -1006,31 +962,12 @@
|
|
|
1006
962
|
color: var(--vscode-descriptionForeground, var(--color-text-muted));
|
|
1007
963
|
}
|
|
1008
964
|
|
|
1009
|
-
.workbench-field-remap-detail__palette,
|
|
1010
|
-
.workbench-field-remap-detail__item-pickers,
|
|
1011
|
-
.workbench-field-remap-detail__field {
|
|
1012
|
-
display: flex;
|
|
1013
|
-
flex-direction: column;
|
|
1014
|
-
gap: 0.35rem;
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
965
|
.workbench-field-remap-detail__palette {
|
|
1018
|
-
flex-direction: row;
|
|
1019
966
|
flex-wrap: wrap;
|
|
1020
|
-
align-items: flex-end;
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
.workbench-field-remap-detail__palette label,
|
|
1024
|
-
.workbench-field-remap-detail__item-pickers label,
|
|
1025
|
-
.workbench-field-remap-detail__field {
|
|
1026
|
-
flex: 1 1 10rem;
|
|
1027
|
-
min-width: 0;
|
|
1028
967
|
}
|
|
1029
968
|
|
|
1030
|
-
.workbench-field-remap-
|
|
1031
|
-
.workbench-field-remap-
|
|
1032
|
-
.workbench-field-remap-options input[type='number'],
|
|
1033
|
-
.workbench-field-remap-options textarea {
|
|
969
|
+
.workbench-field-remap-options__string-map input[type='text'],
|
|
970
|
+
.workbench-field-remap-options__json textarea {
|
|
1034
971
|
box-sizing: border-box;
|
|
1035
972
|
width: 100%;
|
|
1036
973
|
margin-top: 0.2rem;
|
|
@@ -1042,13 +979,6 @@
|
|
|
1042
979
|
font: inherit;
|
|
1043
980
|
}
|
|
1044
981
|
|
|
1045
|
-
.workbench-field-remap-detail__list-context-bar {
|
|
1046
|
-
display: flex;
|
|
1047
|
-
align-items: center;
|
|
1048
|
-
justify-content: space-between;
|
|
1049
|
-
gap: 0.5rem;
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
982
|
.workbench-field-remap-detail__item-edges {
|
|
1053
983
|
list-style: none;
|
|
1054
984
|
margin: 0;
|
|
@@ -1065,23 +995,6 @@
|
|
|
1065
995
|
gap: 0.35rem;
|
|
1066
996
|
}
|
|
1067
997
|
|
|
1068
|
-
.workbench-field-remap-options {
|
|
1069
|
-
display: flex;
|
|
1070
|
-
flex-direction: column;
|
|
1071
|
-
gap: 0.55rem;
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
.workbench-field-remap-options__field {
|
|
1075
|
-
display: flex;
|
|
1076
|
-
flex-direction: column;
|
|
1077
|
-
gap: 0.2rem;
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
.workbench-field-remap-options__label {
|
|
1081
|
-
font-size: 0.75rem;
|
|
1082
|
-
color: var(--vscode-descriptionForeground, var(--color-text-muted));
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
998
|
.workbench-field-remap-options__empty,
|
|
1086
999
|
.workbench-field-remap-options__error {
|
|
1087
1000
|
margin: 0;
|
|
@@ -1418,18 +1331,15 @@
|
|
|
1418
1331
|
}
|
|
1419
1332
|
|
|
1420
1333
|
.workbench-field-remap-io-browse {
|
|
1334
|
+
--ui-sidebar-inline-padding: var(--shell-spacing-side-bar-inline);
|
|
1335
|
+
--ui-sidebar-row-block-padding: var(--shell-spacing-side-bar-block);
|
|
1336
|
+
--ui-sidebar-tree-indent-step: 10px;
|
|
1421
1337
|
display: grid;
|
|
1422
|
-
grid-template-columns: repeat(
|
|
1423
|
-
gap:
|
|
1338
|
+
grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr));
|
|
1339
|
+
gap: var(--shell-spacing-block);
|
|
1424
1340
|
width: 100%;
|
|
1425
1341
|
}
|
|
1426
1342
|
|
|
1427
|
-
@media (max-width: 800px) {
|
|
1428
|
-
.workbench-field-remap-io-browse {
|
|
1429
|
-
grid-template-columns: 1fr;
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
|
|
1433
1343
|
.workbench-field-remap-io-browse__toggle {
|
|
1434
1344
|
display: inline-flex;
|
|
1435
1345
|
align-items: center;
|
|
@@ -1442,31 +1352,36 @@
|
|
|
1442
1352
|
.workbench-field-remap-io-browse__section {
|
|
1443
1353
|
display: flex;
|
|
1444
1354
|
flex-direction: column;
|
|
1445
|
-
gap:
|
|
1355
|
+
gap: var(--shell-spacing-block);
|
|
1446
1356
|
min-width: 0;
|
|
1447
1357
|
}
|
|
1448
1358
|
|
|
1449
1359
|
.workbench-field-remap-io-browse__section-title {
|
|
1450
1360
|
margin: 0;
|
|
1451
|
-
|
|
1361
|
+
padding: 0 var(--ui-sidebar-inline-padding);
|
|
1362
|
+
color: var(--color-text-muted);
|
|
1363
|
+
font-size: var(--font-size-sm);
|
|
1452
1364
|
font-weight: 600;
|
|
1453
1365
|
}
|
|
1454
1366
|
|
|
1367
|
+
.workbench-field-remap-io-browse__ports,
|
|
1368
|
+
.workbench-field-remap-io-browse__fields {
|
|
1369
|
+
margin: 0;
|
|
1370
|
+
padding: 0;
|
|
1371
|
+
list-style: none;
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1455
1374
|
.workbench-field-remap-io-browse__port {
|
|
1456
|
-
|
|
1457
|
-
flex-direction: column;
|
|
1458
|
-
gap: 0.35rem;
|
|
1459
|
-
padding: 0.5rem 0.65rem;
|
|
1460
|
-
border: 1px solid var(--vscode-widget-border, var(--color-border, #3c3c3c));
|
|
1461
|
-
border-radius: 4px;
|
|
1375
|
+
border-block-start: 1px solid var(--color-border);
|
|
1462
1376
|
}
|
|
1463
1377
|
|
|
1464
1378
|
.workbench-field-remap-io-browse__port-title {
|
|
1465
|
-
display: flex;
|
|
1466
1379
|
flex-wrap: wrap;
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1380
|
+
min-height: 26px;
|
|
1381
|
+
gap: 5px;
|
|
1382
|
+
padding: var(--ui-sidebar-row-block-padding) var(--ui-sidebar-inline-padding);
|
|
1383
|
+
color: var(--color-text);
|
|
1384
|
+
font-size: var(--font-size-sm);
|
|
1470
1385
|
}
|
|
1471
1386
|
|
|
1472
1387
|
.workbench-field-remap-io-browse__port-id {
|
|
@@ -1474,49 +1389,52 @@
|
|
|
1474
1389
|
}
|
|
1475
1390
|
|
|
1476
1391
|
.workbench-field-remap-io-browse__port-meta {
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
.workbench-field-remap-io-browse__fields {
|
|
1482
|
-
margin: 0;
|
|
1483
|
-
padding-left: 1rem;
|
|
1484
|
-
list-style: disc;
|
|
1392
|
+
margin-inline-start: auto;
|
|
1393
|
+
color: var(--color-text-muted);
|
|
1394
|
+
font-size: var(--font-size-xs);
|
|
1485
1395
|
}
|
|
1486
1396
|
|
|
1487
1397
|
.workbench-field-remap-io-browse__fields .workbench-field-remap-io-browse__fields {
|
|
1488
|
-
|
|
1398
|
+
padding-inline-start: var(--ui-sidebar-tree-indent-step);
|
|
1489
1399
|
}
|
|
1490
1400
|
|
|
1491
1401
|
.workbench-field-remap-io-browse__row {
|
|
1492
|
-
display: flex;
|
|
1493
1402
|
flex-wrap: wrap;
|
|
1494
|
-
|
|
1495
|
-
|
|
1403
|
+
min-height: 26px;
|
|
1404
|
+
gap: 5px;
|
|
1405
|
+
padding: var(--ui-sidebar-row-block-padding) var(--ui-sidebar-inline-padding);
|
|
1406
|
+
color: var(--color-text-muted);
|
|
1407
|
+
font-size: var(--font-size-sm);
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
.workbench-field-remap-io-browse__port-title:hover,
|
|
1411
|
+
.workbench-field-remap-io-browse__row:hover {
|
|
1412
|
+
background: transparent;
|
|
1496
1413
|
}
|
|
1497
1414
|
|
|
1498
1415
|
.workbench-field-remap-io-browse__path {
|
|
1499
|
-
|
|
1416
|
+
color: var(--color-text);
|
|
1417
|
+
font-size: inherit;
|
|
1500
1418
|
word-break: break-all;
|
|
1501
1419
|
}
|
|
1502
1420
|
|
|
1503
1421
|
.workbench-field-remap-io-browse__meta {
|
|
1504
1422
|
display: inline-flex;
|
|
1505
1423
|
flex-wrap: wrap;
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1424
|
+
align-items: center;
|
|
1425
|
+
gap: 5px;
|
|
1426
|
+
margin-inline-start: auto;
|
|
1427
|
+
color: var(--color-text-muted);
|
|
1428
|
+
font-size: var(--font-size-xs);
|
|
1509
1429
|
}
|
|
1510
1430
|
|
|
1511
1431
|
.workbench-field-remap-io-browse__badge {
|
|
1512
|
-
|
|
1513
|
-
border-radius: 3px;
|
|
1514
|
-
background: var(--vscode-badge-background, rgba(127, 127, 127, 0.25));
|
|
1515
|
-
color: var(--vscode-badge-foreground, inherit);
|
|
1432
|
+
flex: none;
|
|
1516
1433
|
}
|
|
1517
1434
|
|
|
1518
1435
|
.workbench-field-remap-io-browse__empty {
|
|
1519
1436
|
margin: 0;
|
|
1520
|
-
|
|
1521
|
-
|
|
1437
|
+
padding: var(--ui-sidebar-row-block-padding) var(--ui-sidebar-inline-padding);
|
|
1438
|
+
color: var(--color-text-muted);
|
|
1439
|
+
font-size: var(--font-size-sm);
|
|
1522
1440
|
}
|
package/src/index.ts
CHANGED
|
@@ -114,6 +114,8 @@ export {
|
|
|
114
114
|
} from './field-remap/panel.js';
|
|
115
115
|
export {
|
|
116
116
|
FieldRemapFlowMapper,
|
|
117
|
+
type FieldRemapConnectionFeedback,
|
|
118
|
+
type FieldRemapConnectionFeedbackReason,
|
|
117
119
|
type FieldRemapFlowActions,
|
|
118
120
|
type FieldRemapFlowMapperProps,
|
|
119
121
|
} from './field-remap/flow.js';
|
|
@@ -230,6 +232,11 @@ export {
|
|
|
230
232
|
resolveShellCommandActivities,
|
|
231
233
|
} from './workbench/command-palette.js';
|
|
232
234
|
export { WorkbenchCommandHost, type WorkbenchCommandHostProps } from './workbench/command-host.js';
|
|
235
|
+
export {
|
|
236
|
+
WorkbenchCommandHostController,
|
|
237
|
+
type WorkbenchCommandHostControllerProps,
|
|
238
|
+
type WorkbenchCommandHostExecutor,
|
|
239
|
+
} from './workbench/command-host-controller.js';
|
|
233
240
|
export { WorkbenchStartupGate, type WorkbenchStartupGateProps } from './workbench/startup-gate.js';
|
|
234
241
|
export {
|
|
235
242
|
normalizeKeybindingKeyFromEvent,
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
parseWorkbenchKeybindingsConfig,
|
|
3
|
-
type WorkbenchKeybindingDefinition,
|
|
4
|
-
} from '@workbench-kit/workbench-config';
|
|
1
|
+
import { type WorkbenchKeybindingDefinition } from '@workbench-kit/workbench-config';
|
|
5
2
|
import {
|
|
6
3
|
type WorkbenchPersistenceDiagnosticOptions,
|
|
7
|
-
type WorkbenchPersistenceReadResult,
|
|
8
4
|
type WorkbenchPersistenceWriteResult,
|
|
9
5
|
type WorkbenchStorageReader,
|
|
10
6
|
type WorkbenchStorageWriter,
|
|
11
7
|
} from '@workbench-kit/workbench-core';
|
|
12
|
-
|
|
13
8
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
readWorkbenchKeybindingOverridesStorageResult,
|
|
10
|
+
writeWorkbenchKeybindingOverridesStorageResult,
|
|
11
|
+
type WorkbenchKeybindingOverridesStorageReadResult,
|
|
12
|
+
} from '@workbench-kit/workbench-core/keybinding-overrides-storage';
|
|
13
|
+
import {
|
|
14
|
+
resolveWorkbenchShortcutPlatform,
|
|
15
|
+
type WorkbenchShortcutPlatform,
|
|
16
|
+
} from '@workbench-kit/platform';
|
|
17
|
+
|
|
18
|
+
import { resolveLocalWorkbenchStorage } from '../storage/local-json-storage.js';
|
|
20
19
|
|
|
21
20
|
export const DEFAULT_WORKBENCH_KEYBINDING_STORAGE_KEY = 'workbench-kit/.workbench/keybindings';
|
|
22
21
|
|
|
@@ -27,22 +26,35 @@ export function isWorkbenchKeybindingPersistenceAvailable(): boolean {
|
|
|
27
26
|
export function readPersistedKeybindingOverrides(
|
|
28
27
|
storageKey = DEFAULT_WORKBENCH_KEYBINDING_STORAGE_KEY,
|
|
29
28
|
storage?: WorkbenchStorageReader,
|
|
29
|
+
options: ReadPersistedKeybindingOverridesOptions = {},
|
|
30
30
|
): readonly WorkbenchKeybindingDefinition[] {
|
|
31
|
-
return
|
|
31
|
+
return readPersistedKeybindingOverridesResult(storageKey, storage, options).value;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface ReadPersistedKeybindingOverridesOptions extends WorkbenchPersistenceDiagnosticOptions {
|
|
35
|
+
readonly platform?: WorkbenchShortcutPlatform | undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface PersistedKeybindingOverridesReadResult extends WorkbenchKeybindingOverridesStorageReadResult {
|
|
39
|
+
readonly value: readonly WorkbenchKeybindingDefinition[];
|
|
32
40
|
}
|
|
33
41
|
|
|
34
42
|
export function readPersistedKeybindingOverridesResult(
|
|
35
43
|
storageKey = DEFAULT_WORKBENCH_KEYBINDING_STORAGE_KEY,
|
|
36
44
|
storage?: WorkbenchStorageReader,
|
|
37
|
-
options:
|
|
38
|
-
):
|
|
39
|
-
|
|
40
|
-
storageKey,
|
|
41
|
-
parseWorkbenchKeybindingsConfig,
|
|
42
|
-
() => [],
|
|
43
|
-
storage,
|
|
45
|
+
options: ReadPersistedKeybindingOverridesOptions = {},
|
|
46
|
+
): PersistedKeybindingOverridesReadResult {
|
|
47
|
+
const result = readWorkbenchKeybindingOverridesStorageResult({
|
|
44
48
|
options,
|
|
45
|
-
|
|
49
|
+
platform: options.platform ?? resolveWorkbenchShortcutPlatform(),
|
|
50
|
+
storage: resolveLocalWorkbenchStorage(storage),
|
|
51
|
+
storageKey,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
...result,
|
|
56
|
+
value: result.entries,
|
|
57
|
+
};
|
|
46
58
|
}
|
|
47
59
|
|
|
48
60
|
export function writePersistedKeybindingOverrides(
|
|
@@ -50,7 +62,15 @@ export function writePersistedKeybindingOverrides(
|
|
|
50
62
|
storageKey = DEFAULT_WORKBENCH_KEYBINDING_STORAGE_KEY,
|
|
51
63
|
storage?: WorkbenchStorageWriter,
|
|
52
64
|
): void {
|
|
53
|
-
|
|
65
|
+
const resolvedStorage = resolveLocalWorkbenchStorage(storage);
|
|
66
|
+
if (!resolvedStorage) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const result = writePersistedKeybindingOverridesResult(overrides, storageKey, resolvedStorage);
|
|
71
|
+
if (!result.committed) {
|
|
72
|
+
throw new Error(result.diagnostic.message);
|
|
73
|
+
}
|
|
54
74
|
}
|
|
55
75
|
|
|
56
76
|
export function writePersistedKeybindingOverridesResult(
|
|
@@ -59,5 +79,10 @@ export function writePersistedKeybindingOverridesResult(
|
|
|
59
79
|
storage?: WorkbenchStorageWriter,
|
|
60
80
|
options: WorkbenchPersistenceDiagnosticOptions = {},
|
|
61
81
|
): WorkbenchPersistenceWriteResult {
|
|
62
|
-
return
|
|
82
|
+
return writeWorkbenchKeybindingOverridesStorageResult({
|
|
83
|
+
entries: overrides,
|
|
84
|
+
options,
|
|
85
|
+
storage: resolveLocalWorkbenchStorage(storage),
|
|
86
|
+
storageKey,
|
|
87
|
+
});
|
|
63
88
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { KeybindingManagementEntry, WorkbenchShortcutPlatform } from '@workbench-kit/platform';
|
|
2
|
+
import { KeybindingManagementPanel } from '@workbench-kit/react/workbench/management';
|
|
3
|
+
|
|
4
|
+
export interface WorkbenchKeybindingManagementSettingsViewProps {
|
|
5
|
+
readonly editingDisabledReason?: string | undefined;
|
|
6
|
+
readonly entries: readonly KeybindingManagementEntry[];
|
|
7
|
+
readonly overrideCount: number;
|
|
8
|
+
readonly platform: WorkbenchShortcutPlatform;
|
|
9
|
+
readonly resetKeybinding: (commandId: string) => void;
|
|
10
|
+
readonly setKeybinding: (commandId: string, key: string | undefined) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function WorkbenchKeybindingManagementSettingsView({
|
|
14
|
+
editingDisabledReason,
|
|
15
|
+
entries,
|
|
16
|
+
overrideCount,
|
|
17
|
+
platform,
|
|
18
|
+
resetKeybinding,
|
|
19
|
+
setKeybinding,
|
|
20
|
+
}: WorkbenchKeybindingManagementSettingsViewProps) {
|
|
21
|
+
return (
|
|
22
|
+
<KeybindingManagementPanel
|
|
23
|
+
editingDisabledReason={editingDisabledReason}
|
|
24
|
+
entries={entries}
|
|
25
|
+
platform={platform}
|
|
26
|
+
summaryLabel={`${entries.length} command${entries.length === 1 ? '' : 's'} · ${overrideCount} user override${overrideCount === 1 ? '' : 's'}`}
|
|
27
|
+
onResetKeybinding={resetKeybinding}
|
|
28
|
+
onSetKeybinding={setKeybinding}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { useKeybindingManagementModel } from './use-keybinding-management.js';
|
|
1
|
+
import { useWorkbenchKeybindingManagementBinding } from '../shell/provider.js';
|
|
2
|
+
import { WorkbenchKeybindingManagementSettingsView } from './keybinding-settings-view.js';
|
|
4
3
|
|
|
5
4
|
export function WorkbenchKeybindingManagementSettings() {
|
|
6
|
-
const
|
|
5
|
+
const binding = useWorkbenchKeybindingManagementBinding();
|
|
7
6
|
|
|
8
|
-
return
|
|
9
|
-
<KeybindingManagementPanel
|
|
10
|
-
entries={entries}
|
|
11
|
-
summaryLabel={`${entries.length} command${entries.length === 1 ? '' : 's'} · ${overrideCount} user override${overrideCount === 1 ? '' : 's'}`}
|
|
12
|
-
onResetKeybinding={resetKeybinding}
|
|
13
|
-
onSetKeybinding={setKeybinding}
|
|
14
|
-
/>
|
|
15
|
-
);
|
|
7
|
+
return <WorkbenchKeybindingManagementSettingsView {...binding} />;
|
|
16
8
|
}
|