@eclipse-glsp/client 2.6.0-next.3 → 2.6.0-next.4
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/css/navigation.css +2 -2
- package/css/search.css +12 -3
- package/lib/base/auto-complete/auto-complete-widget.d.ts +2 -2
- package/lib/base/auto-complete/auto-complete-widget.d.ts.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.js +5 -2
- package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
- package/lib/base/auto-complete/autocomplete-suggestion-provider.d.ts +56 -0
- package/lib/base/auto-complete/autocomplete-suggestion-provider.d.ts.map +1 -0
- package/lib/base/auto-complete/autocomplete-suggestion-provider.js +56 -0
- package/lib/base/auto-complete/autocomplete-suggestion-provider.js.map +1 -0
- package/lib/base/auto-complete/base-autocomplete-palette.d.ts +4 -9
- package/lib/base/auto-complete/base-autocomplete-palette.d.ts.map +1 -1
- package/lib/base/auto-complete/base-autocomplete-palette.js +2 -2
- package/lib/base/auto-complete/base-autocomplete-palette.js.map +1 -1
- package/lib/base/default.module.d.ts.map +1 -1
- package/lib/base/default.module.js +4 -0
- package/lib/base/default.module.js.map +1 -1
- package/lib/default-modules.d.ts +1 -1
- package/lib/default-modules.d.ts.map +1 -1
- package/lib/default-modules.js +4 -1
- package/lib/default-modules.js.map +1 -1
- package/lib/features/accessibility/accessibility-module.d.ts.map +1 -1
- package/lib/features/accessibility/accessibility-module.js +2 -4
- package/lib/features/accessibility/accessibility-module.js.map +1 -1
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.d.ts +20 -14
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.d.ts.map +1 -1
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.js +58 -44
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.js.map +1 -1
- package/lib/features/accessibility/element-navigation/diagram-navigation-tool.d.ts.map +1 -1
- package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js +2 -3
- package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js.map +1 -1
- package/lib/features/accessibility/{keyboard-pointer/keyboard-pointer-module.d.ts → keyboard/keyboard-module.d.ts} +1 -1
- package/lib/features/accessibility/keyboard/keyboard-module.d.ts.map +1 -0
- package/lib/features/accessibility/{keyboard-pointer/keyboard-pointer-module.js → keyboard/keyboard-module.js} +6 -3
- package/lib/features/accessibility/keyboard/keyboard-module.js.map +1 -0
- package/lib/features/accessibility/keyboard-grid/keyboard-grid-search-palette.d.ts +14 -11
- package/lib/features/accessibility/keyboard-grid/keyboard-grid-search-palette.d.ts.map +1 -1
- package/lib/features/accessibility/keyboard-grid/keyboard-grid-search-palette.js +39 -21
- package/lib/features/accessibility/keyboard-grid/keyboard-grid-search-palette.js.map +1 -1
- package/lib/features/accessibility/keyboard-grid/keyboard-node-grid.js +1 -1
- package/lib/features/accessibility/keyboard-grid/keyboard-node-grid.js.map +1 -1
- package/{src/features/accessibility/edge-autocomplete/edge-autocomplete-context.ts → lib/features/search-palette/search-palette-key-listener.d.ts} +5 -9
- package/lib/features/search-palette/search-palette-key-listener.d.ts.map +1 -0
- package/lib/features/search-palette/search-palette-key-listener.js +45 -0
- package/lib/features/search-palette/search-palette-key-listener.js.map +1 -0
- package/lib/features/{accessibility/search → search-palette}/search-palette-module.d.ts +4 -3
- package/lib/features/search-palette/search-palette-module.d.ts.map +1 -0
- package/lib/features/search-palette/search-palette-module.js +39 -0
- package/lib/features/search-palette/search-palette-module.js.map +1 -0
- package/lib/features/search-palette/search-palette.d.ts +51 -0
- package/lib/features/search-palette/search-palette.d.ts.map +1 -0
- package/lib/features/search-palette/search-palette.js +141 -0
- package/lib/features/search-palette/search-palette.js.map +1 -0
- package/{src/base/auto-complete/autocomplete-suggestion-providers.ts → lib/features/search-palette/suggestions/edge-element-suggestions.d.ts} +11 -22
- package/lib/features/search-palette/suggestions/edge-element-suggestions.d.ts.map +1 -0
- package/lib/features/search-palette/suggestions/edge-element-suggestions.js +72 -0
- package/lib/features/search-palette/suggestions/edge-element-suggestions.js.map +1 -0
- package/lib/features/search-palette/suggestions/named-element-suggestions.d.ts +30 -0
- package/lib/features/search-palette/suggestions/named-element-suggestions.d.ts.map +1 -0
- package/lib/features/search-palette/suggestions/named-element-suggestions.js +83 -0
- package/lib/features/search-palette/suggestions/named-element-suggestions.js.map +1 -0
- package/lib/features/viewport/reposition.d.ts.map +1 -1
- package/lib/features/viewport/reposition.js +1 -5
- package/lib/features/viewport/reposition.js.map +1 -1
- package/lib/index.d.ts +5 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -6
- package/lib/index.js.map +1 -1
- package/lib/standalone-modules.d.ts +1 -1
- package/lib/standalone-modules.d.ts.map +1 -1
- package/lib/standalone-modules.js +2 -0
- package/lib/standalone-modules.js.map +1 -1
- package/package.json +3 -3
- package/src/base/auto-complete/auto-complete-widget.ts +7 -4
- package/src/base/auto-complete/autocomplete-suggestion-provider.ts +86 -0
- package/src/base/auto-complete/base-autocomplete-palette.ts +6 -6
- package/src/base/default.module.ts +5 -0
- package/src/default-modules.ts +4 -1
- package/src/features/accessibility/accessibility-module.ts +1 -3
- package/src/features/accessibility/edge-autocomplete/edge-autocomplete-palette.ts +74 -51
- package/src/features/accessibility/element-navigation/diagram-navigation-tool.ts +2 -4
- package/src/features/accessibility/{keyboard-pointer/keyboard-pointer-module.ts → keyboard/keyboard-module.ts} +11 -4
- package/src/features/accessibility/keyboard-grid/keyboard-grid-search-palette.ts +35 -21
- package/src/features/accessibility/keyboard-grid/keyboard-node-grid.ts +2 -2
- package/src/features/{accessibility/search/search-palette-module.ts → search-palette/search-palette-key-listener.ts} +15 -14
- package/src/features/search-palette/search-palette-module.ts +48 -0
- package/src/features/search-palette/search-palette.ts +164 -0
- package/src/features/search-palette/suggestions/edge-element-suggestions.ts +71 -0
- package/src/features/search-palette/suggestions/named-element-suggestions.ts +88 -0
- package/src/features/viewport/reposition.ts +1 -7
- package/src/index.ts +5 -6
- package/src/standalone-modules.ts +2 -0
- package/lib/base/auto-complete/autocomplete-suggestion-providers.d.ts +0 -35
- package/lib/base/auto-complete/autocomplete-suggestion-providers.d.ts.map +0 -1
- package/lib/base/auto-complete/autocomplete-suggestion-providers.js +0 -18
- package/lib/base/auto-complete/autocomplete-suggestion-providers.js.map +0 -1
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-context.d.ts +0 -23
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-context.d.ts.map +0 -1
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-context.js +0 -18
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-context.js.map +0 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-module.d.ts.map +0 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-module.js.map +0 -1
- package/lib/features/accessibility/search/search-palette-module.d.ts.map +0 -1
- package/lib/features/accessibility/search/search-palette-module.js +0 -32
- package/lib/features/accessibility/search/search-palette-module.js.map +0 -1
- package/lib/features/accessibility/search/search-palette.d.ts +0 -51
- package/lib/features/accessibility/search/search-palette.d.ts.map +0 -1
- package/lib/features/accessibility/search/search-palette.js +0 -186
- package/lib/features/accessibility/search/search-palette.js.map +0 -1
- package/lib/features/accessibility/search/search-tool.d.ts +0 -33
- package/lib/features/accessibility/search/search-tool.d.ts.map +0 -1
- package/lib/features/accessibility/search/search-tool.js +0 -84
- package/lib/features/accessibility/search/search-tool.js.map +0 -1
- package/src/features/accessibility/search/search-palette.ts +0 -218
- package/src/features/accessibility/search/search-tool.ts +0 -74
package/lib/index.js
CHANGED
|
@@ -34,7 +34,7 @@ __exportStar(require("./base/action-handler-registry"), exports);
|
|
|
34
34
|
__exportStar(require("./base/args-feature"), exports);
|
|
35
35
|
__exportStar(require("./base/auto-complete/auto-complete-actions"), exports);
|
|
36
36
|
__exportStar(require("./base/auto-complete/auto-complete-widget"), exports);
|
|
37
|
-
__exportStar(require("./base/auto-complete/autocomplete-suggestion-
|
|
37
|
+
__exportStar(require("./base/auto-complete/autocomplete-suggestion-provider"), exports);
|
|
38
38
|
__exportStar(require("./base/auto-complete/base-autocomplete-palette"), exports);
|
|
39
39
|
__exportStar(require("./base/auto-complete/validation-decorator"), exports);
|
|
40
40
|
__exportStar(require("./base/command-stack"), exports);
|
|
@@ -74,7 +74,6 @@ __exportStar(require("./default-modules"), exports);
|
|
|
74
74
|
__exportStar(require("./features/accessibility/accessibility-module"), exports);
|
|
75
75
|
__exportStar(require("./features/accessibility/actions"), exports);
|
|
76
76
|
__exportStar(require("./features/accessibility/edge-autocomplete/action"), exports);
|
|
77
|
-
__exportStar(require("./features/accessibility/edge-autocomplete/edge-autocomplete-context"), exports);
|
|
78
77
|
__exportStar(require("./features/accessibility/edge-autocomplete/edge-autocomplete-palette"), exports);
|
|
79
78
|
__exportStar(require("./features/accessibility/edge-autocomplete/edge-autocomplete-tool"), exports);
|
|
80
79
|
__exportStar(require("./features/accessibility/element-navigation/diagram-navigation-tool"), exports);
|
|
@@ -95,13 +94,10 @@ __exportStar(require("./features/accessibility/keyboard-pointer/actions"), expor
|
|
|
95
94
|
__exportStar(require("./features/accessibility/keyboard-pointer/constants"), exports);
|
|
96
95
|
__exportStar(require("./features/accessibility/keyboard-pointer/keyboard-pointer"), exports);
|
|
97
96
|
__exportStar(require("./features/accessibility/keyboard-pointer/keyboard-pointer-listener"), exports);
|
|
98
|
-
__exportStar(require("./features/accessibility/keyboard-pointer/keyboard-pointer-module"), exports);
|
|
99
97
|
__exportStar(require("./features/accessibility/keyboard-pointer/keyboard-pointer-position"), exports);
|
|
100
98
|
__exportStar(require("./features/accessibility/keyboard-tool-palette/keyboard-tool-palette"), exports);
|
|
101
99
|
__exportStar(require("./features/accessibility/keyboard-tool-palette/keyboard-tool-palette-module"), exports);
|
|
102
|
-
__exportStar(require("./features/accessibility/
|
|
103
|
-
__exportStar(require("./features/accessibility/search/search-palette-module"), exports);
|
|
104
|
-
__exportStar(require("./features/accessibility/search/search-tool"), exports);
|
|
100
|
+
__exportStar(require("./features/accessibility/keyboard/keyboard-module"), exports);
|
|
105
101
|
__exportStar(require("./features/accessibility/toast/toast-handler"), exports);
|
|
106
102
|
__exportStar(require("./features/accessibility/toast/toast-module"), exports);
|
|
107
103
|
__exportStar(require("./features/accessibility/toast/toast-tool"), exports);
|
|
@@ -187,6 +183,9 @@ __exportStar(require("./features/routing/edge-router"), exports);
|
|
|
187
183
|
__exportStar(require("./features/routing/routing-module"), exports);
|
|
188
184
|
__exportStar(require("./features/save/save-keylistener"), exports);
|
|
189
185
|
__exportStar(require("./features/save/save-module"), exports);
|
|
186
|
+
__exportStar(require("./features/search-palette/search-palette"), exports);
|
|
187
|
+
__exportStar(require("./features/search-palette/search-palette-key-listener"), exports);
|
|
188
|
+
__exportStar(require("./features/search-palette/search-palette-module"), exports);
|
|
190
189
|
__exportStar(require("./features/select/select-feedback-command"), exports);
|
|
191
190
|
__exportStar(require("./features/select/select-module"), exports);
|
|
192
191
|
__exportStar(require("./features/select/select-mouse-listener"), exports);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,2DAAyC;AACzC,iEAA+C;AAC/C,sDAAoC;AACpC,6EAA2D;AAC3D,4EAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,2DAAyC;AACzC,iEAA+C;AAC/C,sDAAoC;AACpC,6EAA2D;AAC3D,4EAA0D;AAC1D,wFAAsE;AACtE,iFAA+D;AAC/D,4EAA0D;AAC1D,uDAAqC;AACrC,wDAAsC;AACtC,mEAAiD;AACjD,gEAA8C;AAC9C,+DAA6C;AAC7C,6EAA2D;AAC3D,mEAAiD;AACjD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E;AACrE,oFAAkE;AAClE,6FAA2E;AAC3E,sEAAoD;AACpD,8EAA4D;AAC5D,4EAA0D;AAC1D,qFAAmE;AACnE,sFAAoE;AACpE,wFAAsE;AACtE,8FAA4E;AAC5E,kFAAgE;AAChE,2FAAyE;AACzE,2EAAyD;AACzD,0EAAwD;AACxD,mFAAiE;AACjE,kFAAgE;AAChE,sFAAoE;AACpE,oFAAkE;AAClE,qFAAmE;AACnE,0EAAwD;AACxD,8EAA4D;AAC5D,wEAAsD;AACtD,qEAAmD;AACnD,yEAAuD;AACvD,iEAA+C;AAC/C,2EAAyD;AACzD,iFAA+D;AAC/D,sEAAoD;AACpD,iEAA+C;AAC/C,uEAAqD;AACrD,4EAA0D;AAC1D,uEAAqD;AACrD,oEAAkD;AAClD,2EAAyD;AACzD,2EAAyD;AACzD,kEAAgD;AAChD,0CAAwB;AACxB,+CAA6B;AAC7B,uDAAqC;AACrC,yDAAuC;AACvC,wDAAsC;AACtC,sDAAoC;AACpC,qDAAmC;AACnC,uDAAqC;AACrC,iDAA+B;AAC/B,yDAAuC;AACvC,2DAAyC;AACzC,uDAAqC;AACrC,qDAAmC;AACnC,sDAAoC;AACpC,+DAA6C;AAC7C,4DAA0C;AAC1C,yDAAuC;AACvC,8DAA4C;AAC5C,oEAAkD"}
|
|
@@ -36,6 +36,6 @@ export declare class LayoutKeyListener extends KeyListener {
|
|
|
36
36
|
* Typically standalone modules built on top of (i.e require ) a default module and are therefore conditionally loaded if the
|
|
37
37
|
* required default modules have been loaded beforehand.
|
|
38
38
|
*/
|
|
39
|
-
export declare const STANDALONE_MODULES: readonly [FeatureModule, FeatureModule, FeatureModule, FeatureModule, FeatureModule, FeatureModule, FeatureModule, FeatureModule, FeatureModule, FeatureModule];
|
|
39
|
+
export declare const STANDALONE_MODULES: readonly [FeatureModule, FeatureModule, FeatureModule, FeatureModule, FeatureModule, FeatureModule, FeatureModule, FeatureModule, FeatureModule, FeatureModule, FeatureModule];
|
|
40
40
|
export declare const STANDALONE_MODULE_CONFIG: ModuleConfiguration;
|
|
41
41
|
//# sourceMappingURL=standalone-modules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standalone-modules.d.ts","sourceRoot":"","sources":["../src/standalone-modules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EACH,MAAM,EAEN,aAAa,EACb,aAAa,EACb,cAAc,EACd,QAAQ,EACR,OAAO,EACP,WAAW,EAEX,mBAAmB,EAQtB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"standalone-modules.d.ts","sourceRoot":"","sources":["../src/standalone-modules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EACH,MAAM,EAEN,aAAa,EACb,aAAa,EACb,cAAc,EACd,QAAQ,EACR,OAAO,EACP,WAAW,EAEX,mBAAmB,EAQtB,MAAM,uBAAuB,CAAC;AAa/B,eAAO,MAAM,uBAAuB,eAWnC,CAAC;AAEF;;;GAGG;AACH,qBACa,qBAAsB,YAAW,cAAc;IAExD,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;IAE1B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ;CAGnD;AAED,qBACa,iBAAkB,SAAQ,WAAW;IACrC,OAAO,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE;CAM5E;AAED;;;;;;;;;GASG;AAEH,eAAO,MAAM,kBAAkB,gLAYrB,CAAC;AAEX,eAAO,MAAM,wBAAwB,EAAE,mBAEtC,CAAC"}
|
|
@@ -32,6 +32,7 @@ const resize_module_1 = require("./features/change-bounds/resize/resize-module")
|
|
|
32
32
|
const copy_paste_modules_1 = require("./features/copy-paste/copy-paste-modules");
|
|
33
33
|
const export_modules_1 = require("./features/export/export-modules");
|
|
34
34
|
const save_module_1 = require("./features/save/save-module");
|
|
35
|
+
const search_palette_module_1 = require("./features/search-palette/search-palette-module");
|
|
35
36
|
const select_module_1 = require("./features/select/select-module");
|
|
36
37
|
const undo_redo_module_1 = require("./features/undo-redo/undo-redo-module");
|
|
37
38
|
const validation_modules_1 = require("./features/validation/validation-modules");
|
|
@@ -93,6 +94,7 @@ exports.STANDALONE_MODULES = [
|
|
|
93
94
|
exports.standaloneDefaultModule,
|
|
94
95
|
shortcuts_module_1.standaloneShortcutsModule,
|
|
95
96
|
resize_module_1.standaloneResizeModule,
|
|
97
|
+
search_palette_module_1.standaloneSearchPaletteModule,
|
|
96
98
|
save_module_1.saveModule,
|
|
97
99
|
undo_redo_module_1.undoRedoModule
|
|
98
100
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standalone-modules.js","sourceRoot":"","sources":["../src/standalone-modules.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,mDAkB+B;AAC/B,yCAA+C;AAC/C,wEAA8E;AAC9E,iFAAuF;AACvF,iFAAqF;AACrF,qEAA0E;AAC1E,6DAAyD;AACzD,mEAAyE;AACzE,4EAAuE;AACvE,iFAA2F;AAC3F,2EAAgF;AAEnE,QAAA,uBAAuB,GAAG,IAAI,uBAAa,CACpD,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAC9B,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClD,IAAI,CAAC,qBAAqB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACxD,IAAA,gCAAsB,EAAC,OAAO,EAAE,uBAAa,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;IAC3E,IAAA,gCAAsB,EAAC,OAAO,EAAE,6BAAmB,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;IACjF,IAAA,gCAAsB,EAAC,OAAO,EAAE,8BAAoB,CAAC,IAAI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AAC,GAAG,CAAC,IAAI,EAAE,4BAA4B,EAAE,MAAM,CAAC,CAAC;IAChE,CAAC;CACJ,CAAA;AAPY,sDAAqB;AAEpB;IADT,IAAA,kBAAM,EAAC,eAAK,CAAC,OAAO,CAAC;;qDACI;gCAFjB,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CAOjC;AAGM,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,qBAAW;IACrC,OAAO,CAAC,QAAuB,EAAE,KAAoB;QAC1D,IAAI,IAAA,0BAAgB,EAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC;YACtD,OAAO,CAAC,6BAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,EAAE,CAAC;IACd,CAAC;CACJ,CAAA;AAPY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,sBAAU,GAAE;GACA,iBAAiB,CAO7B;AAED;;;;;;;;;GASG;AAEU,QAAA,kBAAkB,GAAG;IAC9B,2CAAwB;IACxB,8CAAyB;IACzB,oDAA+B;IAC/B,sCAAsB;IACtB,uCAAsB;IACtB,+BAAuB;IACvB,4CAAyB;IACzB,sCAAsB;IACtB,qDAA6B;IAC7B,wBAAU;IACV,iCAAc;CACR,CAAC;AAEE,QAAA,wBAAwB,GAAwB;IACzD,GAAG,EAAE,CAAC,GAAG,0BAAkB,CAAC;CAC/B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/client",
|
|
3
|
-
"version": "2.6.0-next.
|
|
3
|
+
"version": "2.6.0-next.4+79a4b50",
|
|
4
4
|
"description": "A sprotty-based client for GLSP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"watch": "tsc -w"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@eclipse-glsp/sprotty": "2.6.0-next.
|
|
49
|
+
"@eclipse-glsp/sprotty": "2.6.0-next.4+79a4b50",
|
|
50
50
|
"autocompleter": "^9.1.2",
|
|
51
51
|
"file-saver": "^2.0.5",
|
|
52
52
|
"lodash": "4.17.21",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "79a4b507ae2bee5b36df3e99a998a88f116ddeff"
|
|
67
67
|
}
|
|
@@ -21,7 +21,8 @@ import {
|
|
|
21
21
|
ValidationStatus,
|
|
22
22
|
codiconCSSClasses,
|
|
23
23
|
matchesKeystroke,
|
|
24
|
-
toArray
|
|
24
|
+
toArray,
|
|
25
|
+
type MaybePromise
|
|
25
26
|
} from '@eclipse-glsp/sprotty';
|
|
26
27
|
import { AutocompleteResult, AutocompleteSettings } from 'autocompleter';
|
|
27
28
|
import { AutoCompleteValue } from './auto-complete-actions';
|
|
@@ -48,7 +49,7 @@ export interface InputValueInitializer {
|
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
export interface SuggestionSubmitHandler {
|
|
51
|
-
executeFromSuggestion(input: LabeledAction | Action | Action[]): void
|
|
52
|
+
executeFromSuggestion(input: LabeledAction | Action | Action[]): MaybePromise<void>;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
export interface TextSubmitHandler {
|
|
@@ -303,8 +304,9 @@ export class AutoCompleteWidget {
|
|
|
303
304
|
// trigger update of suggestions with an keyup event
|
|
304
305
|
window.setTimeout(() => this.inputElement.dispatchEvent(new Event('input')));
|
|
305
306
|
} else {
|
|
306
|
-
this.executeFromSuggestion(item)
|
|
307
|
-
|
|
307
|
+
Promise.resolve(this.executeFromSuggestion(item)).then(() => {
|
|
308
|
+
this.notifyClose('submission');
|
|
309
|
+
});
|
|
308
310
|
}
|
|
309
311
|
}
|
|
310
312
|
|
|
@@ -362,6 +364,7 @@ export class AutoCompleteWidget {
|
|
|
362
364
|
if (this.autoCompleteResult) {
|
|
363
365
|
this.autoCompleteResult.destroy();
|
|
364
366
|
}
|
|
367
|
+
this.observer?.disconnect();
|
|
365
368
|
}
|
|
366
369
|
}
|
|
367
370
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023-2025 Business Informatics Group (TU Wien) and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
GModelRoot,
|
|
19
|
+
InstanceRegistry,
|
|
20
|
+
LazyInjector,
|
|
21
|
+
TYPES,
|
|
22
|
+
type GModelElement,
|
|
23
|
+
type LabeledAction,
|
|
24
|
+
type MaybePromise
|
|
25
|
+
} from '@eclipse-glsp/sprotty';
|
|
26
|
+
import { inject, injectable } from 'inversify';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Interface for autocomplete suggestions.
|
|
30
|
+
*/
|
|
31
|
+
export interface AutocompleteSuggestion {
|
|
32
|
+
element?: GModelElement;
|
|
33
|
+
action: LabeledAction;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A provider for autocomplete suggestions.
|
|
38
|
+
*/
|
|
39
|
+
export interface IAutocompleteSuggestionProvider {
|
|
40
|
+
id: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Returns whether this provider can handle the given autocomplete context.
|
|
44
|
+
* @param context The context to check.
|
|
45
|
+
*/
|
|
46
|
+
canHandle(context: string): boolean;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Provides suggestions for the given input
|
|
50
|
+
*/
|
|
51
|
+
getSuggestions(root: Readonly<GModelRoot>, text: string, context?: unknown): Promise<AutocompleteSuggestion[]>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Default contexts for autocomplete suggestions.
|
|
56
|
+
*/
|
|
57
|
+
export namespace AutocompleteSuggestionProviderContext {
|
|
58
|
+
export const CANVAS = 'canvas' as const;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Registry for autocomplete suggestion providers.
|
|
63
|
+
*/
|
|
64
|
+
export interface AutocompleteSuggestionRegistry extends InstanceRegistry<IAutocompleteSuggestionProvider> {
|
|
65
|
+
providersForContext(context: string[]): IAutocompleteSuggestionProvider[];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@injectable()
|
|
69
|
+
export class DefaultAutocompleteSuggestionRegistry
|
|
70
|
+
extends InstanceRegistry<IAutocompleteSuggestionProvider>
|
|
71
|
+
implements AutocompleteSuggestionRegistry
|
|
72
|
+
{
|
|
73
|
+
@inject(LazyInjector)
|
|
74
|
+
protected lazyInjector: LazyInjector;
|
|
75
|
+
|
|
76
|
+
preLoadDiagram(): MaybePromise<void> {
|
|
77
|
+
const suggestionProviders = this.lazyInjector.getAll<IAutocompleteSuggestionProvider>(TYPES.IAutocompleteSuggestionProvider);
|
|
78
|
+
suggestionProviders.forEach(provider => {
|
|
79
|
+
this.register(provider.id, provider);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
providersForContext(searchContext: string[]): IAutocompleteSuggestionProvider[] {
|
|
84
|
+
return Array.from(this.elements.values()).filter(provider => searchContext.some(c => provider.canHandle(c)));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import { Action, GModelRoot, IActionDispatcher, LabeledAction, TYPES } from '@eclipse-glsp/sprotty';
|
|
17
|
+
import { Action, GModelRoot, IActionDispatcher, LabeledAction, TYPES, type MaybePromise } from '@eclipse-glsp/sprotty';
|
|
18
18
|
import { inject } from 'inversify';
|
|
19
19
|
import '../../../css/autocomplete-palette.css';
|
|
20
|
-
import { GLSPAbstractUIExtension } from '../ui-extension/ui-extension';
|
|
21
|
-
import { AutoCompleteWidget, CloseReason, toActionArray } from './auto-complete-widget';
|
|
22
20
|
import { messages } from '../messages';
|
|
21
|
+
import { GLSPAbstractUIExtension } from '../ui-extension/ui-extension';
|
|
22
|
+
import { AutoCompleteWidget, CloseReason, toActionArray, type AutoCompleteSettings } from './auto-complete-widget';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* A reusable base implementation for `UIExtensions` that want to provide autocomplete functionality
|
|
@@ -27,7 +27,7 @@ import { messages } from '../messages';
|
|
|
27
27
|
*
|
|
28
28
|
*/
|
|
29
29
|
export abstract class BaseAutocompletePalette extends GLSPAbstractUIExtension {
|
|
30
|
-
protected readonly autoSuggestionSettings = {
|
|
30
|
+
protected readonly autoSuggestionSettings: AutoCompleteSettings = {
|
|
31
31
|
noSuggestionsMessage: messages.autocomplete.no_suggestions,
|
|
32
32
|
suggestionsClass: 'command-palette-suggestions',
|
|
33
33
|
debounceWaitMs: 50,
|
|
@@ -87,7 +87,7 @@ export abstract class BaseAutocompletePalette extends GLSPAbstractUIExtension {
|
|
|
87
87
|
this.hide();
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
protected executeSuggestion(input: LabeledAction | Action[] | Action): void {
|
|
91
|
-
this.actionDispatcher.dispatchAll(toActionArray(input));
|
|
90
|
+
protected executeSuggestion(input: LabeledAction | Action[] | Action): MaybePromise<void> {
|
|
91
|
+
return this.actionDispatcher.dispatchAll(toActionArray(input));
|
|
92
92
|
}
|
|
93
93
|
}
|
|
@@ -36,6 +36,7 @@ import '@vscode/codicons/dist/codicon.css';
|
|
|
36
36
|
import '../../css/glsp-sprotty.css';
|
|
37
37
|
import { GLSPActionDispatcher } from './action-dispatcher';
|
|
38
38
|
import { GLSPActionHandlerRegistry } from './action-handler-registry';
|
|
39
|
+
import { DefaultAutocompleteSuggestionRegistry } from './auto-complete/autocomplete-suggestion-provider';
|
|
39
40
|
import { GLSPCommandStack } from './command-stack';
|
|
40
41
|
import { EditorContextService } from './editor-context-service';
|
|
41
42
|
import { ModifyCssFeedbackCommand } from './feedback/css-feedback';
|
|
@@ -148,6 +149,10 @@ export const defaultModule = new FeatureModule(
|
|
|
148
149
|
|
|
149
150
|
// Shortcut manager initialization ------------------------------------
|
|
150
151
|
bindAsService(context, TYPES.IShortcutManager, ShortcutManager);
|
|
152
|
+
|
|
153
|
+
// Autocomplete suggestion provider initialization ------------------------------------
|
|
154
|
+
bind(TYPES.IAutocompleteSuggestionProviderRegistry).to(DefaultAutocompleteSuggestionRegistry).inSingletonScope();
|
|
155
|
+
bind(TYPES.IDiagramStartup).toService(TYPES.IAutocompleteSuggestionProviderRegistry);
|
|
151
156
|
},
|
|
152
157
|
{
|
|
153
158
|
featureId: Symbol('default')
|
package/src/default-modules.ts
CHANGED
|
@@ -47,6 +47,7 @@ import { labelEditModule } from './features/label-edit/label-edit-module';
|
|
|
47
47
|
import { layoutModule } from './features/layout/layout-module';
|
|
48
48
|
import { navigationModule } from './features/navigation/navigation-module';
|
|
49
49
|
import { routingModule } from './features/routing/routing-module';
|
|
50
|
+
import { searchPaletteDefaultSuggestionsModule, searchPaletteModule } from './features/search-palette/search-palette-module';
|
|
50
51
|
import { selectModule } from './features/select/select-module';
|
|
51
52
|
import { sourceModelWatcherModule } from './features/source-model-watcher/source-model-watcher-module';
|
|
52
53
|
import { statusModule } from './features/status/status-module';
|
|
@@ -101,7 +102,9 @@ export const DEFAULT_MODULES = [
|
|
|
101
102
|
zorderModule,
|
|
102
103
|
svgMetadataModule,
|
|
103
104
|
statusModule,
|
|
104
|
-
resizeModule
|
|
105
|
+
resizeModule,
|
|
106
|
+
searchPaletteModule,
|
|
107
|
+
searchPaletteDefaultSuggestionsModule
|
|
105
108
|
] as const;
|
|
106
109
|
|
|
107
110
|
/**
|
|
@@ -17,9 +17,8 @@
|
|
|
17
17
|
import { FeatureModule } from '@eclipse-glsp/sprotty';
|
|
18
18
|
import { configureElementNavigationTool } from './element-navigation/element-navigation-module';
|
|
19
19
|
import { configureFocusTrackerTool } from './focus-tracker/focus-tracker-module';
|
|
20
|
-
import { configureKeyboardControlTools } from './keyboard-pointer/keyboard-pointer-module';
|
|
21
20
|
import { configureKeyboardToolPaletteTool } from './keyboard-tool-palette/keyboard-tool-palette-module';
|
|
22
|
-
import {
|
|
21
|
+
import { configureKeyboardControlTools } from './keyboard/keyboard-module';
|
|
23
22
|
import { configureToastTool } from './toast/toast-module';
|
|
24
23
|
import { configureViewKeyTools } from './view-key-tools/view-key-tools-module';
|
|
25
24
|
|
|
@@ -30,7 +29,6 @@ export const accessibilityModule = new FeatureModule(
|
|
|
30
29
|
(bind, unbind, isBound, rebind) => {
|
|
31
30
|
const context = { bind, unbind, isBound, rebind };
|
|
32
31
|
configureViewKeyTools(context);
|
|
33
|
-
configureSearchPaletteModule(context);
|
|
34
32
|
configureKeyboardToolPaletteTool(context);
|
|
35
33
|
configureKeyboardControlTools(context);
|
|
36
34
|
configureElementNavigationTool(context);
|
|
@@ -29,76 +29,89 @@ import {
|
|
|
29
29
|
} from '@eclipse-glsp/sprotty';
|
|
30
30
|
import { injectable } from 'inversify';
|
|
31
31
|
import { CloseReason, toActionArray } from '../../../base/auto-complete/auto-complete-widget';
|
|
32
|
-
import {
|
|
32
|
+
import { IAutocompleteSuggestionProvider, type AutocompleteSuggestion } from '../../../base/auto-complete/autocomplete-suggestion-provider';
|
|
33
33
|
import { EnableDefaultToolsAction } from '../../../base/tool-manager/tool';
|
|
34
34
|
import { GEdge } from '../../../model';
|
|
35
|
-
import { SearchAutocompletePalette } from '
|
|
35
|
+
import { SearchAutocompletePalette, SearchAutocompleteSuggestion } from '../../search-palette/search-palette';
|
|
36
36
|
import { SetEdgeTargetSelectionAction } from './action';
|
|
37
|
-
import { EdgeAutocompleteContext } from './edge-autocomplete-context';
|
|
38
37
|
|
|
39
38
|
export namespace EdgeAutocompletePaletteMetadata {
|
|
40
39
|
export const ID = 'edge-autocomplete-palette';
|
|
41
40
|
}
|
|
42
41
|
|
|
42
|
+
export interface EdgeAutocompleteContext {
|
|
43
|
+
role: 'source' | 'target';
|
|
44
|
+
triggerAction: TriggerEdgeCreationAction;
|
|
45
|
+
sourceId?: string;
|
|
46
|
+
targetId?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type EdgeAutocompletePaletteStages = 'initial' | 'source' | 'target' | 'reloading';
|
|
50
|
+
|
|
43
51
|
@injectable()
|
|
44
52
|
export class EdgeAutocompletePalette extends SearchAutocompletePalette implements IActionHandler {
|
|
45
|
-
protected
|
|
46
|
-
|
|
47
|
-
protected readonly targetSuggestionProvider = new PossibleEdgeTargetAutocompleteSuggestionProvider();
|
|
53
|
+
protected edgeAutocompleteContext?: EdgeAutocompleteContext;
|
|
54
|
+
protected stage: EdgeAutocompletePaletteStages = 'initial';
|
|
48
55
|
|
|
49
56
|
override id(): string {
|
|
50
57
|
return EdgeAutocompletePaletteMetadata.ID;
|
|
51
58
|
}
|
|
52
59
|
|
|
60
|
+
override get searchContext(): string[] {
|
|
61
|
+
return [EdgeAutocompletePaletteMetadata.ID];
|
|
62
|
+
}
|
|
63
|
+
|
|
53
64
|
handle(action: Action): Action | void {
|
|
54
65
|
if (TriggerEdgeCreationAction.is(action)) {
|
|
55
|
-
this.
|
|
56
|
-
|
|
66
|
+
this.stage = 'source';
|
|
67
|
+
this.edgeAutocompleteContext = {
|
|
68
|
+
triggerAction: action,
|
|
57
69
|
role: 'source'
|
|
58
70
|
};
|
|
59
|
-
this.targetSuggestionProvider.setContext(action, this.context);
|
|
60
71
|
}
|
|
61
72
|
}
|
|
62
73
|
|
|
63
74
|
protected override onBeforeShow(containerElement: HTMLElement, root: Readonly<GModelRoot>, ...contextElementIds: string[]): void {
|
|
64
75
|
super.onBeforeShow(containerElement, root, ...contextElementIds);
|
|
65
76
|
|
|
66
|
-
this.autocompleteWidget.inputField.placeholder = `Search for ${this.
|
|
77
|
+
this.autocompleteWidget.inputField.placeholder = `Search for ${this.edgeAutocompleteContext?.role} elements`;
|
|
67
78
|
}
|
|
68
79
|
|
|
69
|
-
protected
|
|
70
|
-
|
|
80
|
+
protected async reload(): Promise<void> {
|
|
81
|
+
this.stage = 'reloading';
|
|
82
|
+
this.hide();
|
|
71
83
|
}
|
|
72
84
|
|
|
73
|
-
protected
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
protected override async provideSearchSuggestions(root: Readonly<GModelRoot>, input: string): Promise<SearchAutocompleteSuggestion[]> {
|
|
86
|
+
return (
|
|
87
|
+
await Promise.all(
|
|
88
|
+
this.suggestionRegistry
|
|
89
|
+
.providersForContext(this.searchContext)
|
|
90
|
+
.flatMap(provider => provider.getSuggestions(root, input, this.edgeAutocompleteContext))
|
|
91
|
+
)
|
|
92
|
+
)
|
|
93
|
+
.flat(1)
|
|
94
|
+
.filter(SearchAutocompleteSuggestion.is);
|
|
83
95
|
}
|
|
84
96
|
|
|
85
|
-
protected override executeSuggestion(input: LabeledAction | Action[] | Action): void {
|
|
97
|
+
protected override async executeSuggestion(input: LabeledAction | Action[] | Action): Promise<void> {
|
|
86
98
|
const action = toActionArray(input)[0] as SetEdgeTargetSelectionAction;
|
|
87
99
|
|
|
88
|
-
if (this.
|
|
89
|
-
this.
|
|
90
|
-
this.
|
|
100
|
+
if (this.edgeAutocompleteContext?.role === 'source') {
|
|
101
|
+
this.edgeAutocompleteContext.sourceId = action.elementId;
|
|
102
|
+
this.edgeAutocompleteContext.role = 'target';
|
|
91
103
|
this.reload();
|
|
92
|
-
} else if (this.
|
|
93
|
-
this.
|
|
104
|
+
} else if (this.edgeAutocompleteContext?.role === 'target') {
|
|
105
|
+
this.edgeAutocompleteContext.targetId = action.elementId;
|
|
94
106
|
}
|
|
95
|
-
|
|
96
|
-
|
|
107
|
+
|
|
108
|
+
if (this.edgeAutocompleteContext?.sourceId !== undefined && this.edgeAutocompleteContext?.targetId !== undefined) {
|
|
109
|
+
await this.actionDispatcher.dispatchAll([
|
|
97
110
|
CreateEdgeOperation.create({
|
|
98
|
-
elementTypeId: this.
|
|
99
|
-
sourceElementId: this.
|
|
100
|
-
targetElementId: this.
|
|
101
|
-
args: this.
|
|
111
|
+
elementTypeId: this.edgeAutocompleteContext.triggerAction.elementTypeId,
|
|
112
|
+
sourceElementId: this.edgeAutocompleteContext.sourceId,
|
|
113
|
+
targetElementId: this.edgeAutocompleteContext.targetId,
|
|
114
|
+
args: this.edgeAutocompleteContext.triggerAction.args
|
|
102
115
|
}),
|
|
103
116
|
EnableDefaultToolsAction.create()
|
|
104
117
|
]);
|
|
@@ -107,41 +120,51 @@ export class EdgeAutocompletePalette extends SearchAutocompletePalette implement
|
|
|
107
120
|
}
|
|
108
121
|
|
|
109
122
|
protected override autocompleteHide(reason: CloseReason): void {
|
|
110
|
-
if (
|
|
123
|
+
if (this.stage === 'reloading') {
|
|
124
|
+
// Wait until the auto complete is closed before reloading
|
|
125
|
+
if (reason === 'blur') {
|
|
126
|
+
this.actionDispatcher.dispatch(
|
|
127
|
+
SetUIExtensionVisibilityAction.create({
|
|
128
|
+
extensionId: EdgeAutocompletePaletteMetadata.ID,
|
|
129
|
+
visible: true
|
|
130
|
+
})
|
|
131
|
+
);
|
|
132
|
+
this.stage = 'target';
|
|
133
|
+
}
|
|
134
|
+
} else if (reason !== 'submission') {
|
|
111
135
|
this.hide();
|
|
112
136
|
}
|
|
113
137
|
}
|
|
114
138
|
}
|
|
115
139
|
|
|
116
140
|
@injectable()
|
|
117
|
-
export class
|
|
118
|
-
|
|
119
|
-
protected context?: EdgeAutocompleteContext;
|
|
120
|
-
|
|
121
|
-
setContext(triggerAction: TriggerEdgeCreationAction, edgeAutocompleteContext: EdgeAutocompleteContext): void {
|
|
122
|
-
this.proxyEdge = new GEdge();
|
|
123
|
-
this.proxyEdge.type = triggerAction.elementTypeId;
|
|
124
|
-
this.context = edgeAutocompleteContext;
|
|
125
|
-
}
|
|
141
|
+
export class SetEdgeTargetGridSuggestionProvider implements IAutocompleteSuggestionProvider {
|
|
142
|
+
id = 'glsp.set-edge-target-autocomplete-suggestions';
|
|
126
143
|
|
|
127
|
-
|
|
128
|
-
return
|
|
144
|
+
canHandle(searchContext: string): boolean {
|
|
145
|
+
return searchContext === EdgeAutocompletePaletteMetadata.ID;
|
|
129
146
|
}
|
|
130
147
|
|
|
131
|
-
async
|
|
132
|
-
|
|
133
|
-
if (this.context === undefined) {
|
|
148
|
+
async getSuggestions(root: Readonly<GModelRoot>, text: string, context: EdgeAutocompleteContext): Promise<AutocompleteSuggestion[]> {
|
|
149
|
+
if (context === undefined) {
|
|
134
150
|
return [];
|
|
135
151
|
}
|
|
136
152
|
|
|
137
|
-
const
|
|
153
|
+
const proxyEdge = new GEdge();
|
|
154
|
+
proxyEdge.type = context.triggerAction.elementTypeId;
|
|
155
|
+
|
|
156
|
+
const nodes = toArray(root.index.all().filter(element => this.isAllowedSource(proxyEdge, element, context.role))) as GEdge[];
|
|
138
157
|
return nodes.map(node => ({
|
|
139
158
|
element: node,
|
|
140
159
|
action: {
|
|
141
160
|
label: `[${node.type}] ${name(node) ?? '<no-name>'}`,
|
|
142
|
-
actions: [SetEdgeTargetSelectionAction.create(node.id, context
|
|
161
|
+
actions: [SetEdgeTargetSelectionAction.create(node.id, context.role)],
|
|
143
162
|
icon: codiconCSSString('arrow-both')
|
|
144
163
|
}
|
|
145
164
|
}));
|
|
146
165
|
}
|
|
166
|
+
|
|
167
|
+
protected isAllowedSource(proxyEdge: GEdge, element: GModelElement | undefined, role: 'source' | 'target'): boolean {
|
|
168
|
+
return element !== undefined && proxyEdge !== undefined && isConnectable(element) && element.canConnect(proxyEdge, role);
|
|
169
|
+
}
|
|
147
170
|
}
|
|
@@ -38,7 +38,6 @@ import { GEdge } from '../../../model';
|
|
|
38
38
|
import { SelectableBoundsAware } from '../../../utils/gmodel-util';
|
|
39
39
|
import { BaseTool } from '../../tools/base-tools';
|
|
40
40
|
import { RepositionAction } from '../../viewport/reposition';
|
|
41
|
-
import { SearchAutocompletePaletteTool } from '../search/search-tool';
|
|
42
41
|
import { ShowToastMessageAction } from '../toast/toast-handler';
|
|
43
42
|
import { ElementNavigator } from './element-navigator';
|
|
44
43
|
|
|
@@ -144,7 +143,7 @@ export class ElementNavigatorKeyListener extends KeyListener {
|
|
|
144
143
|
if (this.mode !== NavigationMode.POSITION) {
|
|
145
144
|
this.clean();
|
|
146
145
|
this.tool.dispatchActions([
|
|
147
|
-
EnableToolsAction.create([ElementNavigatorTool.ID,
|
|
146
|
+
EnableToolsAction.create([ElementNavigatorTool.ID, AvailableShortcutsTool.ID]),
|
|
148
147
|
ShowToastMessageAction.create({
|
|
149
148
|
id: Symbol.for(ElementNavigatorKeyListener.name),
|
|
150
149
|
message: messages.navigation.local_navigation_mode_activated
|
|
@@ -180,9 +179,8 @@ export class ElementNavigatorKeyListener extends KeyListener {
|
|
|
180
179
|
if (this.matchesActivateDefaultNavigation(event)) {
|
|
181
180
|
if (this.mode !== NavigationMode.DEFAULT) {
|
|
182
181
|
this.clean();
|
|
183
|
-
|
|
184
182
|
this.tool.dispatchActions([
|
|
185
|
-
EnableToolsAction.create([ElementNavigatorTool.ID,
|
|
183
|
+
EnableToolsAction.create([ElementNavigatorTool.ID, AvailableShortcutsTool.ID]),
|
|
186
184
|
ShowToastMessageAction.create({
|
|
187
185
|
id: Symbol.for(ElementNavigatorKeyListener.name),
|
|
188
186
|
message: messages.navigation.default_navigation_mode_activated
|
|
@@ -23,15 +23,19 @@ import {
|
|
|
23
23
|
configureActionHandler
|
|
24
24
|
} from '@eclipse-glsp/sprotty';
|
|
25
25
|
import { SetEdgeTargetSelectionAction } from '../edge-autocomplete/action';
|
|
26
|
-
import { EdgeAutocompletePalette } from '../edge-autocomplete/edge-autocomplete-palette';
|
|
26
|
+
import { EdgeAutocompletePalette, SetEdgeTargetGridSuggestionProvider } from '../edge-autocomplete/edge-autocomplete-palette';
|
|
27
27
|
import { EdgeAutocompletePaletteTool } from '../edge-autocomplete/edge-autocomplete-tool';
|
|
28
28
|
import { GlobalKeyListenerTool } from '../global-keylistener-tool';
|
|
29
29
|
import { EnableKeyboardGridAction, KeyboardGridCellSelectedAction } from '../keyboard-grid/action';
|
|
30
30
|
import { KeyboardGrid } from '../keyboard-grid/keyboard-grid';
|
|
31
|
-
import {
|
|
31
|
+
import {
|
|
32
|
+
GridSearchPalette,
|
|
33
|
+
RevealGridEdgeSuggestionProvider,
|
|
34
|
+
RevealGridNamedElementSuggestionProvider
|
|
35
|
+
} from '../keyboard-grid/keyboard-grid-search-palette';
|
|
32
36
|
import { KeyboardNodeGrid } from '../keyboard-grid/keyboard-node-grid';
|
|
33
|
-
import { SetKeyboardPointerRenderPositionAction } from '
|
|
34
|
-
import { KeyboardPointer } from '
|
|
37
|
+
import { SetKeyboardPointerRenderPositionAction } from '../keyboard-pointer/actions';
|
|
38
|
+
import { KeyboardPointer } from '../keyboard-pointer/keyboard-pointer';
|
|
35
39
|
|
|
36
40
|
/**
|
|
37
41
|
* Handles the pointer used via grid to position new elements.
|
|
@@ -55,6 +59,7 @@ export function configureKeyboardControlTools(context: BindingContext): void {
|
|
|
55
59
|
|
|
56
60
|
bindAsService(context, TYPES.IUIExtension, EdgeAutocompletePalette);
|
|
57
61
|
bindAsService(context, TYPES.IDefaultTool, EdgeAutocompletePaletteTool);
|
|
62
|
+
bindAsService(context, TYPES.IAutocompleteSuggestionProvider, SetEdgeTargetGridSuggestionProvider);
|
|
58
63
|
|
|
59
64
|
configureActionHandler(context, EnableKeyboardGridAction.KIND, KeyboardGrid);
|
|
60
65
|
configureActionHandler(context, KeyboardGridCellSelectedAction.KIND, KeyboardPointer);
|
|
@@ -63,4 +68,6 @@ export function configureKeyboardControlTools(context: BindingContext): void {
|
|
|
63
68
|
configureActionHandler(context, SetEdgeTargetSelectionAction.KIND, EdgeAutocompletePalette);
|
|
64
69
|
|
|
65
70
|
bindAsService(context, TYPES.IUIExtension, GridSearchPalette);
|
|
71
|
+
bindAsService(context, TYPES.IAutocompleteSuggestionProvider, RevealGridEdgeSuggestionProvider);
|
|
72
|
+
bindAsService(context, TYPES.IAutocompleteSuggestionProvider, RevealGridNamedElementSuggestionProvider);
|
|
66
73
|
}
|