@lijian-ui/dsh-term 0.3.1 → 0.3.2

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.
@@ -19,7 +19,7 @@ export function appendToConversationDraft(ctx: ClientContext, text: string): boo
19
19
  if (sessionId === undefined) return false
20
20
  const actx = ctx.sessions.scope(sessionId)
21
21
  if (actx === undefined) return false
22
- const conversation = (ctx as unknown as { conversation?: { input: { for(c: unknown): { state: { getSnapshot(): { draft: string } }; setDraft(s: string): void } } } }).conversation
22
+ const conversation = (ctx as unknown as { get(name: string): unknown }).get('conversation') as { input: { for(c: unknown): { state: { getSnapshot(): { draft: string } }; setDraft(s: string): void } } } | undefined
23
23
  if (conversation === undefined) return false
24
24
  const input = conversation.input.for(actx as unknown as ClientContext)
25
25
  const draft = input.state.getSnapshot().draft
@@ -6,6 +6,12 @@
6
6
  */
7
7
 
8
8
  .col {
9
+ /* Positioned anchor: the floating “添加到对话” button is absolutely
10
+ positioned with panel-relative coordinates (TerminalPanel onMouseUp),
11
+ so this element must be its offset parent — without it the button
12
+ resolves against whatever outer ancestor happens to be positioned
13
+ (the app frame / shell chrome) and lands near the far-left dock. */
14
+ position: relative;
9
15
  width: 100%;
10
16
  height: 100%;
11
17
  display: flex;
@@ -13,7 +19,7 @@
13
19
  border-left: 1px solid var(--dsw-alias-border-l2);
14
20
  background: var(--dsw-alias-bg-layer-1);
15
21
  overflow: hidden;
16
- font-family: var(--aion-font-sans, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif);
22
+ font-family: var(--dsw-font-family);
17
23
  }
18
24
 
19
25
  .title {
@@ -279,7 +285,7 @@
279
285
  font-size: 12px;
280
286
  font-weight: 500;
281
287
  cursor: pointer;
282
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
288
+ box-shadow: var(--dsw-shadow-lv1);
283
289
  white-space: nowrap;
284
290
  }
285
291
 
@@ -1,182 +1,182 @@
1
- /**
2
- * Inlined xterm.js 5.3.0 core styles (MIT) — injected as a <style> tag at
3
- * runtime because the client build compiles only *.module.css and the
4
- * shell's css-modules pipeline rejects a raw :global block with xterm's
5
- * class names.
6
- * @module dsh-term/client/term/xterm-styles
7
- */
8
-
9
- export const XTERM_CSS: string = `
10
- .xterm {
11
- cursor: text;
12
- position: relative;
13
- user-select: none;
14
- -ms-user-select: none;
15
- -webkit-user-select: none;
16
- }
17
-
18
- .xterm.focus,
19
- .xterm:focus {
20
- outline: none;
21
- }
22
-
23
- .xterm .xterm-helpers {
24
- position: absolute;
25
- top: 0;
26
- /**
27
- * The z-index of the helpers must be higher than the canvases in order for
28
- * IMEs to appear on top.
29
- */
30
- z-index: 5;
31
- }
32
-
33
- .xterm .xterm-helper-textarea {
34
- padding: 0;
35
- border: 0;
36
- margin: 0;
37
- /* Move textarea out of the screen to the far left, so that the cursor is not visible */
38
- position: absolute;
39
- opacity: 0;
40
- left: -9999em;
41
- top: 0;
42
- width: 0;
43
- height: 0;
44
- z-index: -5;
45
- /** Prevent wrapping so the IME appears against the textarea at the correct position */
46
- white-space: nowrap;
47
- overflow: hidden;
48
- resize: none;
49
- }
50
-
51
- .xterm .composition-view {
52
- /* TODO: Composition position got messed up somewhere */
53
- background: #000;
54
- color: #FFF;
55
- display: none;
56
- position: absolute;
57
- white-space: nowrap;
58
- z-index: 1;
59
- }
60
-
61
- .xterm .composition-view.active {
62
- display: block;
63
- }
64
-
65
- .xterm .xterm-viewport {
66
- /* On OS X this is required in order for the scroll bar to appear fully opaque */
67
- background-color: #000;
68
- overflow-y: scroll;
69
- cursor: default;
70
- position: absolute;
71
- right: 0;
72
- left: 0;
73
- top: 0;
74
- bottom: 0;
75
- }
76
-
77
- .xterm .xterm-screen {
78
- position: relative;
79
- }
80
-
81
- .xterm .xterm-screen canvas {
82
- position: absolute;
83
- left: 0;
84
- top: 0;
85
- }
86
-
87
- .xterm .xterm-scroll-area {
88
- visibility: hidden;
89
- }
90
-
91
- .xterm-char-measure-element {
92
- display: inline-block;
93
- visibility: hidden;
94
- position: absolute;
95
- top: 0;
96
- left: -9999em;
97
- line-height: normal;
98
- }
99
-
100
- .xterm.enable-mouse-events {
101
- /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
102
- cursor: default;
103
- }
104
-
105
- .xterm.xterm-cursor-pointer,
106
- .xterm .xterm-cursor-pointer {
107
- cursor: pointer;
108
- }
109
-
110
- .xterm.column-select.focus {
111
- /* Column selection mode */
112
- cursor: crosshair;
113
- }
114
-
115
- .xterm .xterm-accessibility,
116
- .xterm .xterm-message {
117
- position: absolute;
118
- left: 0;
119
- top: 0;
120
- bottom: 0;
121
- right: 0;
122
- z-index: 10;
123
- color: transparent;
124
- pointer-events: none;
125
- }
126
-
127
- .xterm .live-region {
128
- position: absolute;
129
- left: -9999px;
130
- width: 1px;
131
- height: 1px;
132
- overflow: hidden;
133
- }
134
-
135
- .xterm-dim {
136
- /* Dim should not apply to background, so the opacity of the foreground color is applied
137
- * explicitly in the generated class and reset to 1 here */
138
- opacity: 1 !important;
139
- }
140
-
141
- .xterm-underline-1 { text-decoration: underline; }
142
- .xterm-underline-2 { text-decoration: double underline; }
143
- .xterm-underline-3 { text-decoration: wavy underline; }
144
- .xterm-underline-4 { text-decoration: dotted underline; }
145
- .xterm-underline-5 { text-decoration: dashed underline; }
146
-
147
- .xterm-overline {
148
- text-decoration: overline;
149
- }
150
-
151
- .xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
152
- .xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
153
- .xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
154
- .xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
155
- .xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }
156
-
157
- .xterm-strikethrough {
158
- text-decoration: line-through;
159
- }
160
-
161
- .xterm-screen .xterm-decoration-container .xterm-decoration {
162
- z-index: 6;
163
- position: absolute;
164
- }
165
-
166
- .xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
167
- z-index: 7;
168
- }
169
-
170
- .xterm-decoration-overview-ruler {
171
- z-index: 8;
172
- position: absolute;
173
- top: 0;
174
- right: 0;
175
- pointer-events: none;
176
- }
177
-
178
- .xterm-decoration-top {
179
- z-index: 2;
180
- position: relative;
181
- }
182
- `
1
+ /**
2
+ * Inlined xterm.js 5.3.0 core styles (MIT) — injected as a <style> tag at
3
+ * runtime because the client build compiles only *.module.css and the
4
+ * shell's css-modules pipeline rejects a raw :global block with xterm's
5
+ * class names.
6
+ * @module dsh-term/client/term/xterm-styles
7
+ */
8
+
9
+ export const XTERM_CSS: string = `
10
+ .xterm {
11
+ cursor: text;
12
+ position: relative;
13
+ user-select: none;
14
+ -ms-user-select: none;
15
+ -webkit-user-select: none;
16
+ }
17
+
18
+ .xterm.focus,
19
+ .xterm:focus {
20
+ outline: none;
21
+ }
22
+
23
+ .xterm .xterm-helpers {
24
+ position: absolute;
25
+ top: 0;
26
+ /**
27
+ * The z-index of the helpers must be higher than the canvases in order for
28
+ * IMEs to appear on top.
29
+ */
30
+ z-index: 5;
31
+ }
32
+
33
+ .xterm .xterm-helper-textarea {
34
+ padding: 0;
35
+ border: 0;
36
+ margin: 0;
37
+ /* Move textarea out of the screen to the far left, so that the cursor is not visible */
38
+ position: absolute;
39
+ opacity: 0;
40
+ left: -9999em;
41
+ top: 0;
42
+ width: 0;
43
+ height: 0;
44
+ z-index: -5;
45
+ /** Prevent wrapping so the IME appears against the textarea at the correct position */
46
+ white-space: nowrap;
47
+ overflow: hidden;
48
+ resize: none;
49
+ }
50
+
51
+ .xterm .composition-view {
52
+ /* TODO: Composition position got messed up somewhere */
53
+ background: #000;
54
+ color: #FFF;
55
+ display: none;
56
+ position: absolute;
57
+ white-space: nowrap;
58
+ z-index: 1;
59
+ }
60
+
61
+ .xterm .composition-view.active {
62
+ display: block;
63
+ }
64
+
65
+ .xterm .xterm-viewport {
66
+ /* On OS X this is required in order for the scroll bar to appear fully opaque */
67
+ background-color: var(--dsw-alias-bg-base);
68
+ overflow-y: scroll;
69
+ cursor: default;
70
+ position: absolute;
71
+ right: 0;
72
+ left: 0;
73
+ top: 0;
74
+ bottom: 0;
75
+ }
76
+
77
+ .xterm .xterm-screen {
78
+ position: relative;
79
+ }
80
+
81
+ .xterm .xterm-screen canvas {
82
+ position: absolute;
83
+ left: 0;
84
+ top: 0;
85
+ }
86
+
87
+ .xterm .xterm-scroll-area {
88
+ visibility: hidden;
89
+ }
90
+
91
+ .xterm-char-measure-element {
92
+ display: inline-block;
93
+ visibility: hidden;
94
+ position: absolute;
95
+ top: 0;
96
+ left: -9999em;
97
+ line-height: normal;
98
+ }
99
+
100
+ .xterm.enable-mouse-events {
101
+ /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
102
+ cursor: default;
103
+ }
104
+
105
+ .xterm.xterm-cursor-pointer,
106
+ .xterm .xterm-cursor-pointer {
107
+ cursor: pointer;
108
+ }
109
+
110
+ .xterm.column-select.focus {
111
+ /* Column selection mode */
112
+ cursor: crosshair;
113
+ }
114
+
115
+ .xterm .xterm-accessibility,
116
+ .xterm .xterm-message {
117
+ position: absolute;
118
+ left: 0;
119
+ top: 0;
120
+ bottom: 0;
121
+ right: 0;
122
+ z-index: 10;
123
+ color: transparent;
124
+ pointer-events: none;
125
+ }
126
+
127
+ .xterm .live-region {
128
+ position: absolute;
129
+ left: -9999px;
130
+ width: 1px;
131
+ height: 1px;
132
+ overflow: hidden;
133
+ }
134
+
135
+ .xterm-dim {
136
+ /* Dim should not apply to background, so the opacity of the foreground color is applied
137
+ * explicitly in the generated class and reset to 1 here */
138
+ opacity: 1 !important;
139
+ }
140
+
141
+ .xterm-underline-1 { text-decoration: underline; }
142
+ .xterm-underline-2 { text-decoration: double underline; }
143
+ .xterm-underline-3 { text-decoration: wavy underline; }
144
+ .xterm-underline-4 { text-decoration: dotted underline; }
145
+ .xterm-underline-5 { text-decoration: dashed underline; }
146
+
147
+ .xterm-overline {
148
+ text-decoration: overline;
149
+ }
150
+
151
+ .xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
152
+ .xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
153
+ .xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
154
+ .xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
155
+ .xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }
156
+
157
+ .xterm-strikethrough {
158
+ text-decoration: line-through;
159
+ }
160
+
161
+ .xterm-screen .xterm-decoration-container .xterm-decoration {
162
+ z-index: 6;
163
+ position: absolute;
164
+ }
165
+
166
+ .xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
167
+ z-index: 7;
168
+ }
169
+
170
+ .xterm-decoration-overview-ruler {
171
+ z-index: 8;
172
+ position: absolute;
173
+ top: 0;
174
+ right: 0;
175
+ pointer-events: none;
176
+ }
177
+
178
+ .xterm-decoration-top {
179
+ z-index: 2;
180
+ position: relative;
181
+ }
182
+ `