@eclipse-glsp/client 2.2.0-next.346 → 2.2.0-next.348
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/grid.css +6 -1
- package/lib/base/auto-complete/base-autocomplete-palette.d.ts +3 -2
- package/lib/base/auto-complete/base-autocomplete-palette.d.ts.map +1 -1
- package/lib/base/auto-complete/base-autocomplete-palette.js +3 -2
- package/lib/base/auto-complete/base-autocomplete-palette.js.map +1 -1
- package/lib/features/accessibility/key-shortcut/accessible-key-shortcut.d.ts +3 -2
- package/lib/features/accessibility/key-shortcut/accessible-key-shortcut.d.ts.map +1 -1
- package/lib/features/accessibility/key-shortcut/accessible-key-shortcut.js +3 -2
- package/lib/features/accessibility/key-shortcut/accessible-key-shortcut.js.map +1 -1
- package/lib/features/accessibility/keyboard-grid/keyboard-grid.d.ts +3 -2
- package/lib/features/accessibility/keyboard-grid/keyboard-grid.d.ts.map +1 -1
- package/lib/features/accessibility/keyboard-grid/keyboard-grid.js +4 -3
- package/lib/features/accessibility/keyboard-grid/keyboard-grid.js.map +1 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer.d.ts +19 -3
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer.d.ts.map +1 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer.js +6 -5
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer.js.map +1 -1
- package/lib/features/accessibility/toast/toast-tool.d.ts +4 -3
- package/lib/features/accessibility/toast/toast-tool.d.ts.map +1 -1
- package/lib/features/accessibility/toast/toast-tool.js +3 -2
- package/lib/features/accessibility/toast/toast-tool.js.map +1 -1
- package/lib/features/grid/grid-style.d.ts +25 -0
- package/lib/features/grid/grid-style.d.ts.map +1 -0
- package/lib/features/grid/grid-style.js +29 -0
- package/lib/features/grid/grid-style.js.map +1 -0
- package/lib/features/label-edit-ui/label-edit-ui.d.ts.map +1 -1
- package/lib/features/label-edit-ui/label-edit-ui.js +1 -0
- package/lib/features/label-edit-ui/label-edit-ui.js.map +1 -1
- package/lib/features/status/status-overlay.d.ts +18 -2
- package/lib/features/status/status-overlay.d.ts.map +1 -1
- package/lib/features/status/status-overlay.js +3 -2
- package/lib/features/status/status-overlay.js.map +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts +3 -2
- package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
- package/lib/features/tool-palette/tool-palette.js +2 -1
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/views/ggraph-view.d.ts +2 -2
- package/lib/views/ggraph-view.d.ts.map +1 -1
- package/lib/views/ggraph-view.js +14 -7
- package/lib/views/ggraph-view.js.map +1 -1
- package/lib/views/glsp-projection-view.d.ts +2 -2
- package/lib/views/glsp-projection-view.d.ts.map +1 -1
- package/lib/views/glsp-projection-view.js +14 -7
- package/lib/views/glsp-projection-view.js.map +1 -1
- package/package.json +3 -3
- package/src/base/auto-complete/base-autocomplete-palette.ts +3 -2
- package/src/features/accessibility/key-shortcut/accessible-key-shortcut.ts +3 -2
- package/src/features/accessibility/keyboard-grid/keyboard-grid.ts +9 -9
- package/src/features/accessibility/keyboard-pointer/keyboard-pointer.ts +6 -13
- package/src/features/accessibility/toast/toast-tool.ts +5 -4
- package/src/features/grid/grid-style.ts +25 -0
- package/src/features/label-edit-ui/label-edit-ui.ts +1 -0
- package/src/features/status/status-overlay.ts +3 -2
- package/src/features/tool-palette/tool-palette.ts +2 -2
- package/src/index.ts +1 -0
- package/src/views/ggraph-view.tsx +14 -7
- package/src/views/glsp-projection-view.tsx +14 -7
package/src/index.ts
CHANGED
|
@@ -142,6 +142,7 @@ export * from './features/grid/grid-manager';
|
|
|
142
142
|
export * from './features/grid/grid-model';
|
|
143
143
|
export * from './features/grid/grid-module';
|
|
144
144
|
export * from './features/grid/grid-snapper';
|
|
145
|
+
export * from './features/grid/grid-style';
|
|
145
146
|
export * from './features/helper-lines/helper-line-feedback';
|
|
146
147
|
export * from './features/helper-lines/helper-line-manager';
|
|
147
148
|
export * from './features/helper-lines/helper-line-manager-default';
|
|
@@ -17,6 +17,7 @@ import { Bounds, Dimension, Point, RenderingContext, SGraphImpl, SGraphView, Wri
|
|
|
17
17
|
import { inject, injectable, optional } from 'inversify';
|
|
18
18
|
import { VNode } from 'snabbdom';
|
|
19
19
|
import { GridManager, GridStyle } from '../features/grid/grid-manager';
|
|
20
|
+
import { GridProperty } from '../features/grid/grid-style';
|
|
20
21
|
|
|
21
22
|
@injectable()
|
|
22
23
|
export class GGraphView extends SGraphView {
|
|
@@ -30,16 +31,21 @@ export class GGraphView extends SGraphView {
|
|
|
30
31
|
return graph;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
protected getGridStyle(
|
|
34
|
+
protected getGridStyle(viewport: Readonly<SGraphImpl>, context: RenderingContext): GridStyle {
|
|
34
35
|
if (context.targetKind === 'hidden' || !this.gridManager?.isGridVisible) {
|
|
35
36
|
return {};
|
|
36
37
|
}
|
|
37
|
-
const bounds = this.getBackgroundBounds(
|
|
38
|
+
const bounds = this.getBackgroundBounds(viewport, context, this.gridManager);
|
|
38
39
|
return {
|
|
40
|
+
[GridProperty.GRID_BACKGROUND_X]: bounds.x + 'px',
|
|
41
|
+
[GridProperty.GRID_BACKGROUND_Y]: bounds.y + 'px',
|
|
42
|
+
[GridProperty.GRID_BACKGROUND_WIDTH]: bounds.width + 'px',
|
|
43
|
+
[GridProperty.GRID_BACKGROUND_HEIGHT]: bounds.height + 'px',
|
|
44
|
+
[GridProperty.GRID_BACKGROUND_ZOOM]: viewport.zoom + '',
|
|
45
|
+
[GridProperty.GRID_BACKGROUND_IMAGE]: this.getBackgroundImage(viewport, context, this.gridManager),
|
|
39
46
|
backgroundPosition: `${bounds.x}px ${bounds.y}px`,
|
|
40
|
-
backgroundSize: `${bounds.width}px ${bounds.height}px
|
|
41
|
-
// we do not set the background
|
|
42
|
-
'--grid-background-image': this.getBackgroundImage(model, context, this.gridManager)
|
|
47
|
+
backgroundSize: `${bounds.width}px ${bounds.height}px`
|
|
48
|
+
// we do not set the background-image directly in the style object, because we want to toggle it on and off via CSS
|
|
43
49
|
};
|
|
44
50
|
}
|
|
45
51
|
|
|
@@ -49,8 +55,9 @@ export class GGraphView extends SGraphView {
|
|
|
49
55
|
return { ...position, ...size };
|
|
50
56
|
}
|
|
51
57
|
|
|
52
|
-
protected getBackgroundImage(
|
|
58
|
+
protected getBackgroundImage(viewport: Readonly<SGraphImpl>, context: RenderingContext, gridManager: GridManager): string {
|
|
59
|
+
const color = getComputedStyle(document.documentElement).getPropertyValue(GridProperty.GRID_COLOR).trim().replace(/#/g, '%23');
|
|
53
60
|
// eslint-disable-next-line max-len
|
|
54
|
-
return `url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${gridManager.grid.x} ${gridManager.grid.y}"><rect width="${gridManager.grid.x}" height="${gridManager.grid.y}" x="0" y="0" fill="none" stroke="
|
|
61
|
+
return `url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${gridManager.grid.x} ${gridManager.grid.y}"><rect width="${gridManager.grid.x}" height="${gridManager.grid.y}" x="0" y="0" fill="none" stroke="${color}" stroke-width="1" /></svg>')`;
|
|
55
62
|
}
|
|
56
63
|
}
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
import { inject, injectable, optional } from 'inversify';
|
|
35
35
|
import { VNode, VNodeStyle, h } from 'snabbdom';
|
|
36
36
|
import { GridManager, GridStyle } from '../features/grid/grid-manager';
|
|
37
|
+
import { GridProperty } from '../features/grid/grid-style';
|
|
37
38
|
|
|
38
39
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
39
40
|
const JSX = { createElement: html };
|
|
@@ -71,16 +72,21 @@ export class GLSPProjectionView extends ProjectedViewportView {
|
|
|
71
72
|
return svg;
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
protected getGridStyle(
|
|
75
|
+
protected getGridStyle(viewport: Readonly<SGraphImpl>, context: RenderingContext): GridStyle {
|
|
75
76
|
if (context.targetKind === 'hidden' || !this.gridManager?.isGridVisible) {
|
|
76
77
|
return {};
|
|
77
78
|
}
|
|
78
|
-
const bounds = this.getBackgroundBounds(
|
|
79
|
+
const bounds = this.getBackgroundBounds(viewport, context, this.gridManager);
|
|
79
80
|
return {
|
|
81
|
+
[GridProperty.GRID_BACKGROUND_X]: bounds.x + 'px',
|
|
82
|
+
[GridProperty.GRID_BACKGROUND_Y]: bounds.y + 'px',
|
|
83
|
+
[GridProperty.GRID_BACKGROUND_WIDTH]: bounds.width + 'px',
|
|
84
|
+
[GridProperty.GRID_BACKGROUND_HEIGHT]: bounds.height + 'px',
|
|
85
|
+
[GridProperty.GRID_BACKGROUND_ZOOM]: viewport.zoom + '',
|
|
86
|
+
[GridProperty.GRID_BACKGROUND_IMAGE]: this.getBackgroundImage(viewport, context, this.gridManager),
|
|
80
87
|
backgroundPosition: `${bounds.x}px ${bounds.y}px`,
|
|
81
|
-
backgroundSize: `${bounds.width}px ${bounds.height}px
|
|
82
|
-
// we do not set the background
|
|
83
|
-
'--grid-background-image': this.getBackgroundImage(model, context, this.gridManager)
|
|
88
|
+
backgroundSize: `${bounds.width}px ${bounds.height}px`
|
|
89
|
+
// we do not set the background-image directly in the style object, because we want to toggle it on and off via CSS
|
|
84
90
|
};
|
|
85
91
|
}
|
|
86
92
|
|
|
@@ -90,9 +96,10 @@ export class GLSPProjectionView extends ProjectedViewportView {
|
|
|
90
96
|
return { ...position, ...size };
|
|
91
97
|
}
|
|
92
98
|
|
|
93
|
-
protected getBackgroundImage(
|
|
99
|
+
protected getBackgroundImage(viewport: Readonly<SGraphImpl>, context: RenderingContext, gridManager: GridManager): string {
|
|
100
|
+
const color = getComputedStyle(document.documentElement).getPropertyValue(GridProperty.GRID_COLOR).trim().replace(/#/g, '%23');
|
|
94
101
|
// eslint-disable-next-line max-len
|
|
95
|
-
return `url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${gridManager.grid.x} ${gridManager.grid.y}"><rect width="${gridManager.grid.x}" height="${gridManager.grid.y}" x="0" y="0" fill="none" stroke="
|
|
102
|
+
return `url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${gridManager.grid.x} ${gridManager.grid.y}"><rect width="${gridManager.grid.x}" height="${gridManager.grid.y}" x="0" y="0" fill="none" stroke="${color}" stroke-width="1" /></svg>')`;
|
|
96
103
|
}
|
|
97
104
|
|
|
98
105
|
protected override renderProjectionBar(
|