@opensumi/ide-core-browser 2.25.4 → 2.26.0
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/lib/common/common.command.d.ts +5 -0
- package/lib/common/common.command.d.ts.map +1 -1
- package/lib/common/common.command.js +17 -1
- package/lib/common/common.command.js.map +1 -1
- package/lib/components/actions/index.d.ts +2 -0
- package/lib/components/actions/index.d.ts.map +1 -1
- package/lib/components/actions/index.js +11 -11
- package/lib/components/actions/index.js.map +1 -1
- package/lib/components/actions/styles.module.less +1 -1
- package/lib/components/layout/layout.d.ts +5 -5
- package/lib/components/layout/split-panel.d.ts.map +1 -1
- package/lib/components/layout/split-panel.js +40 -39
- package/lib/components/layout/split-panel.js.map +1 -1
- package/lib/components/resize/resize.module.less +5 -2
- package/lib/core-preferences.d.ts +1 -0
- package/lib/core-preferences.d.ts.map +1 -1
- package/lib/core-preferences.js +5 -0
- package/lib/core-preferences.js.map +1 -1
- package/lib/layout/layout.interface.d.ts +2 -0
- package/lib/layout/layout.interface.d.ts.map +1 -1
- package/lib/layout/layout.interface.js.map +1 -1
- package/lib/markdown/index.d.ts.map +1 -1
- package/lib/markdown/index.js +0 -1
- package/lib/markdown/index.js.map +1 -1
- package/lib/menu/next/menu-id.d.ts +2 -1
- package/lib/menu/next/menu-id.d.ts.map +1 -1
- package/lib/menu/next/menu-id.js +2 -0
- package/lib/menu/next/menu-id.js.map +1 -1
- package/lib/preferences/settings.d.ts +4 -0
- package/lib/preferences/settings.d.ts.map +1 -1
- package/lib/react-providers/config-provider.d.ts +3 -2
- package/lib/react-providers/config-provider.d.ts.map +1 -1
- package/lib/style/entry.less +1 -1
- package/lib/style/icon.less +3 -3
- package/lib/style/override.less +1 -1
- package/lib/style/toolbar.less +1 -1
- package/package.json +5 -5
- package/src/common/common.command.ts +17 -0
- package/src/components/actions/index.tsx +31 -11
- package/src/components/actions/styles.module.less +1 -1
- package/src/components/layout/split-panel.tsx +204 -168
- package/src/components/resize/resize.module.less +5 -2
- package/src/core-preferences.ts +6 -0
- package/src/layout/layout.interface.ts +2 -0
- package/src/markdown/index.tsx +0 -1
- package/src/menu/next/menu-id.ts +2 -0
- package/src/preferences/settings.ts +4 -0
- package/src/react-providers/config-provider.tsx +4 -2
- package/src/style/entry.less +1 -1
- package/src/style/icon.less +3 -3
- package/src/style/override.less +1 -1
- package/src/style/toolbar.less +1 -1
|
@@ -79,6 +79,18 @@ export interface SplitPanelProps extends SplitChildProps {
|
|
|
79
79
|
const getProp = (child: React.ReactNode, prop: string) =>
|
|
80
80
|
child && child['props'] && (child['props'][prop] ?? child['props'][`data-sp-${prop}`]);
|
|
81
81
|
|
|
82
|
+
function getElementSize(element: any, totalFlexNum: number) {
|
|
83
|
+
if (getProp(element, 'savedSize')) {
|
|
84
|
+
return getProp(element, 'savedSize') + 'px';
|
|
85
|
+
} else if (getProp(element, 'defaultSize') !== undefined) {
|
|
86
|
+
return getProp(element, 'defaultSize') + 'px';
|
|
87
|
+
} else if (getProp(element, 'flex')) {
|
|
88
|
+
return (getProp(element, 'flex') / totalFlexNum) * 100 + '%';
|
|
89
|
+
} else {
|
|
90
|
+
return (1 / totalFlexNum) * 100 + '%';
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
82
94
|
export const SplitPanel: React.FC<SplitPanelProps> = ({
|
|
83
95
|
id,
|
|
84
96
|
className,
|
|
@@ -95,12 +107,17 @@ export const SplitPanel: React.FC<SplitPanelProps> = ({
|
|
|
95
107
|
}) => {
|
|
96
108
|
const ResizeHandle = Layout.getResizeHandle(direction);
|
|
97
109
|
// convert children to list
|
|
98
|
-
const childList = React.Children.toArray(children);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
110
|
+
const childList = React.useMemo(() => React.Children.toArray(children), [children]);
|
|
111
|
+
|
|
112
|
+
const totalFlexNum = React.useMemo(
|
|
113
|
+
() =>
|
|
114
|
+
childList.reduce(
|
|
115
|
+
(accumulator, item) => accumulator + (getProp(item, 'flex') !== undefined ? getProp(item, 'flex') : 1),
|
|
116
|
+
0,
|
|
117
|
+
),
|
|
118
|
+
[childList],
|
|
102
119
|
);
|
|
103
|
-
|
|
120
|
+
|
|
104
121
|
const resizeDelegates = React.useRef<IResizeHandleDelegate[]>([]);
|
|
105
122
|
const eventBus = useInjectable<IEventBus>(IEventBus);
|
|
106
123
|
const rootRef = React.useRef<HTMLElement>();
|
|
@@ -115,178 +132,197 @@ export const SplitPanel: React.FC<SplitPanelProps> = ({
|
|
|
115
132
|
splitPanelService.panels = [];
|
|
116
133
|
|
|
117
134
|
// 获取setSize的handle,对于最右端或最底部的视图,取上一个位置的handle
|
|
118
|
-
const setSizeHandle = (
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
delegate
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const delegate = resizeDelegates.current[targetIndex];
|
|
133
|
-
if (delegate) {
|
|
134
|
-
delegate.setRelativeSize(prev, next);
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
const getSizeHandle = (index) => (isLatter?: boolean) => {
|
|
139
|
-
const targetIndex = isLatter ? index - 1 : index;
|
|
140
|
-
const delegate = resizeDelegates.current[targetIndex];
|
|
141
|
-
if (delegate) {
|
|
142
|
-
return delegate.getAbsoluteSize(isLatter);
|
|
143
|
-
}
|
|
144
|
-
return 0;
|
|
145
|
-
};
|
|
135
|
+
const setSizeHandle = React.useCallback(
|
|
136
|
+
(index) => (size?: number, isLatter?: boolean) => {
|
|
137
|
+
const targetIndex = isLatter ? index - 1 : index;
|
|
138
|
+
const delegate = resizeDelegates.current[targetIndex];
|
|
139
|
+
if (delegate) {
|
|
140
|
+
delegate.setAbsoluteSize(
|
|
141
|
+
size !== undefined ? size : getProp(childList[index], 'defaultSize'),
|
|
142
|
+
isLatter,
|
|
143
|
+
resizeKeep,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
[resizeDelegates.current],
|
|
148
|
+
);
|
|
146
149
|
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
const setRelativeSizeHandle = React.useCallback(
|
|
151
|
+
(index) => (prev: number, next: number, isLatter?: boolean) => {
|
|
152
|
+
const targetIndex = isLatter ? index - 1 : index;
|
|
153
|
+
const delegate = resizeDelegates.current[targetIndex];
|
|
154
|
+
if (delegate) {
|
|
155
|
+
delegate.setRelativeSize(prev, next);
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
[resizeDelegates.current],
|
|
159
|
+
);
|
|
155
160
|
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
const getSizeHandle = React.useCallback(
|
|
162
|
+
(index) => (isLatter?: boolean) => {
|
|
163
|
+
const targetIndex = isLatter ? index - 1 : index;
|
|
164
|
+
const delegate = resizeDelegates.current[targetIndex];
|
|
165
|
+
if (delegate) {
|
|
166
|
+
return delegate.getAbsoluteSize(isLatter);
|
|
167
|
+
}
|
|
168
|
+
return 0;
|
|
169
|
+
},
|
|
170
|
+
[resizeDelegates.current],
|
|
171
|
+
);
|
|
164
172
|
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
173
|
+
const getRelativeSizeHandle = React.useCallback(
|
|
174
|
+
(index) => (isLatter?: boolean) => {
|
|
175
|
+
const targetIndex = isLatter ? index - 1 : index;
|
|
176
|
+
const delegate = resizeDelegates.current[targetIndex];
|
|
177
|
+
if (delegate) {
|
|
178
|
+
return delegate.getRelativeSize();
|
|
179
|
+
}
|
|
180
|
+
return [0, 0];
|
|
181
|
+
},
|
|
182
|
+
[resizeDelegates.current],
|
|
183
|
+
);
|
|
172
184
|
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
185
|
+
const lockResizeHandle = React.useCallback(
|
|
186
|
+
(index) => (lock: boolean | undefined, isLatter?: boolean) => {
|
|
187
|
+
const targetIndex = isLatter ? index - 1 : index;
|
|
188
|
+
const newResizeState = resizeLockState.current.map((state, idx) =>
|
|
189
|
+
idx === targetIndex ? (lock !== undefined ? lock : !state) : state,
|
|
190
|
+
);
|
|
191
|
+
resizeLockState.current = newResizeState;
|
|
192
|
+
setLocks(newResizeState);
|
|
193
|
+
},
|
|
194
|
+
[resizeDelegates.current],
|
|
195
|
+
);
|
|
184
196
|
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
197
|
+
const setMaxSizeHandle = React.useCallback(
|
|
198
|
+
(index) => (lock: boolean | undefined, isLatter?: boolean) => {
|
|
199
|
+
const newMaxState = maxLockState.current.map((state, idx) =>
|
|
200
|
+
idx === index ? (lock !== undefined ? lock : !state) : state,
|
|
201
|
+
);
|
|
202
|
+
maxLockState.current = newMaxState;
|
|
203
|
+
setMaxLocks(newMaxState);
|
|
204
|
+
},
|
|
205
|
+
[resizeDelegates.current],
|
|
206
|
+
);
|
|
190
207
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
208
|
+
const hidePanelHandle = React.useCallback(
|
|
209
|
+
(index: number) => (show?: boolean) => {
|
|
210
|
+
const newHideState = hideState.current.map((state, idx) =>
|
|
211
|
+
idx === index ? (show !== undefined ? !show : !state) : state,
|
|
212
|
+
);
|
|
213
|
+
hideState.current = newHideState;
|
|
214
|
+
const location = getProp(childList[index], 'slot') || getProp(childList[index], 'id');
|
|
215
|
+
if (location) {
|
|
216
|
+
fireResizeEvent(location);
|
|
199
217
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
fireResizeEvent(nextLocation!);
|
|
210
|
-
}}
|
|
211
|
-
noColor={true}
|
|
212
|
-
findNextElement={
|
|
213
|
-
dynamicTarget
|
|
214
|
-
? (direction: boolean) => splitPanelService.getFirstResizablePanel(index - 1, direction)
|
|
215
|
-
: undefined
|
|
216
|
-
}
|
|
217
|
-
findPrevElement={
|
|
218
|
-
dynamicTarget
|
|
219
|
-
? (direction: boolean) => splitPanelService.getFirstResizablePanel(index - 1, direction, true)
|
|
220
|
-
: undefined
|
|
221
|
-
}
|
|
222
|
-
key={`split-handle-${index}`}
|
|
223
|
-
delegate={(delegate) => {
|
|
224
|
-
resizeDelegates.current.push(delegate);
|
|
225
|
-
}}
|
|
226
|
-
flexMode={flexMode}
|
|
227
|
-
/>,
|
|
228
|
-
);
|
|
218
|
+
setHides(newHideState);
|
|
219
|
+
},
|
|
220
|
+
[childList, hideState.current],
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
const fireResizeEvent = React.useCallback(
|
|
224
|
+
(location?: string) => {
|
|
225
|
+
if (location) {
|
|
226
|
+
eventBus.fire(new ResizeEvent({ slotLocation: location }));
|
|
229
227
|
}
|
|
230
|
-
}
|
|
228
|
+
},
|
|
229
|
+
[eventBus],
|
|
230
|
+
);
|
|
231
231
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
setSize: setSizeHandle(index),
|
|
237
|
-
getSize: getSizeHandle(index),
|
|
238
|
-
setRelativeSize: setRelativeSizeHandle(index),
|
|
239
|
-
getRelativeSize: getRelativeSizeHandle(index),
|
|
240
|
-
lockSize: lockResizeHandle(index),
|
|
241
|
-
setMaxSize: setMaxSizeHandle(index),
|
|
242
|
-
hidePanel: hidePanelHandle(index),
|
|
243
|
-
}}
|
|
244
|
-
>
|
|
245
|
-
<div
|
|
246
|
-
data-min-resize={getProp(element, 'minResize')}
|
|
247
|
-
data-max-resize={getProp(element, 'maxResize')}
|
|
248
|
-
ref={(ele) => {
|
|
249
|
-
if (ele && splitPanelService.panels.indexOf(ele) === -1) {
|
|
250
|
-
splitPanelService.panels.push(ele);
|
|
251
|
-
}
|
|
252
|
-
}}
|
|
253
|
-
id={getProp(element, 'id') /* @deprecated: query by data-view-id */}
|
|
254
|
-
style={{
|
|
255
|
-
// 手风琴场景,固定尺寸和 flex 尺寸混合布局;需要在 Resize Flex 模式下禁用
|
|
256
|
-
...(getProp(element, 'flex') &&
|
|
257
|
-
!getProp(element, 'savedSize') &&
|
|
258
|
-
!childList.find((item) => getProp(item, 'flexGrow'))
|
|
259
|
-
? { flex: getProp(element, 'flex') }
|
|
260
|
-
: { [Layout.getSizeProperty(direction)]: getElementSize(element) }),
|
|
261
|
-
// 相对尺寸带来的问题,必须限制最小最大尺寸
|
|
262
|
-
[Layout.getMinSizeProperty(direction)]: getProp(element, 'minSize')
|
|
263
|
-
? getProp(element, 'minSize') + 'px'
|
|
264
|
-
: '-1px',
|
|
265
|
-
[Layout.getMaxSizeProperty(direction)]:
|
|
266
|
-
maxLocks[index] && getProp(element, 'maxSize') ? getProp(element, 'maxSize') + 'px' : 'unset',
|
|
267
|
-
// Resize Flex 模式下应用 flexGrow
|
|
268
|
-
...(getProp(element, 'flexGrow') !== undefined ? { flexGrow: getProp(element, 'flexGrow') } : {}),
|
|
269
|
-
display: hides[index] ? 'none' : 'block',
|
|
270
|
-
backgroundColor: getProp(element, 'backgroundColor'),
|
|
271
|
-
}}
|
|
272
|
-
>
|
|
273
|
-
{element}
|
|
274
|
-
</div>
|
|
275
|
-
</PanelContext.Provider>,
|
|
276
|
-
);
|
|
277
|
-
});
|
|
232
|
+
const elements: React.ReactNodeArray = React.useMemo(
|
|
233
|
+
() =>
|
|
234
|
+
childList.map((element, index) => {
|
|
235
|
+
const result: JSX.Element[] = [];
|
|
278
236
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
237
|
+
if (index !== 0) {
|
|
238
|
+
const targetElement = index === 1 ? childList[index - 1] : childList[index];
|
|
239
|
+
let flexMode: ResizeFlexMode | undefined;
|
|
240
|
+
if (getProp(element, 'flexGrow')) {
|
|
241
|
+
flexMode = ResizeFlexMode.Prev;
|
|
242
|
+
} else if (getProp(childList[index - 1], 'flexGrow')) {
|
|
243
|
+
flexMode = ResizeFlexMode.Next;
|
|
244
|
+
}
|
|
245
|
+
const noResize = getProp(targetElement, 'noResize') || locks[index - 1];
|
|
246
|
+
if (!noResize) {
|
|
247
|
+
result.push(
|
|
248
|
+
<ResizeHandle
|
|
249
|
+
className={resizeHandleClassName}
|
|
250
|
+
onResize={(prev, next) => {
|
|
251
|
+
const prevLocation = getProp(childList[index - 1], 'slot') || getProp(childList[index - 1], 'id');
|
|
252
|
+
const nextLocation = getProp(childList[index], 'slot') || getProp(childList[index], 'id');
|
|
253
|
+
fireResizeEvent(prevLocation!);
|
|
254
|
+
fireResizeEvent(nextLocation!);
|
|
255
|
+
}}
|
|
256
|
+
noColor={true}
|
|
257
|
+
findNextElement={
|
|
258
|
+
dynamicTarget
|
|
259
|
+
? (direction: boolean) => splitPanelService.getFirstResizablePanel(index - 1, direction)
|
|
260
|
+
: undefined
|
|
261
|
+
}
|
|
262
|
+
findPrevElement={
|
|
263
|
+
dynamicTarget
|
|
264
|
+
? (direction: boolean) => splitPanelService.getFirstResizablePanel(index - 1, direction, true)
|
|
265
|
+
: undefined
|
|
266
|
+
}
|
|
267
|
+
key={`split-handle-${index}`}
|
|
268
|
+
delegate={(delegate) => {
|
|
269
|
+
resizeDelegates.current.push(delegate);
|
|
270
|
+
}}
|
|
271
|
+
flexMode={flexMode}
|
|
272
|
+
/>,
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
result.push(
|
|
278
|
+
<PanelContext.Provider
|
|
279
|
+
key={index}
|
|
280
|
+
value={{
|
|
281
|
+
setSize: setSizeHandle(index),
|
|
282
|
+
getSize: getSizeHandle(index),
|
|
283
|
+
setRelativeSize: setRelativeSizeHandle(index),
|
|
284
|
+
getRelativeSize: getRelativeSizeHandle(index),
|
|
285
|
+
lockSize: lockResizeHandle(index),
|
|
286
|
+
setMaxSize: setMaxSizeHandle(index),
|
|
287
|
+
hidePanel: hidePanelHandle(index),
|
|
288
|
+
}}
|
|
289
|
+
>
|
|
290
|
+
<div
|
|
291
|
+
data-min-resize={getProp(element, 'minResize')}
|
|
292
|
+
data-max-resize={getProp(element, 'maxResize')}
|
|
293
|
+
ref={(ele) => {
|
|
294
|
+
if (ele && splitPanelService.panels.indexOf(ele) === -1) {
|
|
295
|
+
splitPanelService.panels.push(ele);
|
|
296
|
+
}
|
|
297
|
+
}}
|
|
298
|
+
id={getProp(element, 'id') /* @deprecated: query by data-view-id */}
|
|
299
|
+
style={{
|
|
300
|
+
// 手风琴场景,固定尺寸和 flex 尺寸混合布局;需要在 Resize Flex 模式下禁用
|
|
301
|
+
...(getProp(element, 'flex') &&
|
|
302
|
+
!getProp(element, 'savedSize') &&
|
|
303
|
+
!childList.find((item) => getProp(item, 'flexGrow'))
|
|
304
|
+
? { flex: getProp(element, 'flex') }
|
|
305
|
+
: { [Layout.getSizeProperty(direction)]: getElementSize(element, totalFlexNum) }),
|
|
306
|
+
// 相对尺寸带来的问题,必须限制最小最大尺寸
|
|
307
|
+
[Layout.getMinSizeProperty(direction)]: getProp(element, 'minSize')
|
|
308
|
+
? getProp(element, 'minSize') + 'px'
|
|
309
|
+
: '-1px',
|
|
310
|
+
[Layout.getMaxSizeProperty(direction)]:
|
|
311
|
+
maxLocks[index] && getProp(element, 'maxSize') ? getProp(element, 'maxSize') + 'px' : 'unset',
|
|
312
|
+
// Resize Flex 模式下应用 flexGrow
|
|
313
|
+
...(getProp(element, 'flexGrow') !== undefined ? { flexGrow: getProp(element, 'flexGrow') } : {}),
|
|
314
|
+
display: hides[index] ? 'none' : 'block',
|
|
315
|
+
backgroundColor: getProp(element, 'backgroundColor'),
|
|
316
|
+
}}
|
|
317
|
+
>
|
|
318
|
+
{element}
|
|
319
|
+
</div>
|
|
320
|
+
</PanelContext.Provider>,
|
|
321
|
+
);
|
|
322
|
+
return result;
|
|
323
|
+
}),
|
|
324
|
+
[children, childList, resizeHandleClassName, dynamicTarget, resizeDelegates.current, hides],
|
|
325
|
+
);
|
|
290
326
|
|
|
291
327
|
React.useEffect(() => {
|
|
292
328
|
if (rootRef.current) {
|
|
@@ -311,7 +347,7 @@ export const SplitPanel: React.FC<SplitPanelProps> = ({
|
|
|
311
347
|
className={clsx(styles['split-panel'], className)}
|
|
312
348
|
style={{ flexDirection: Layout.getFlexDirection(direction), ...style }}
|
|
313
349
|
>
|
|
314
|
-
{elements}
|
|
350
|
+
{elements.filter(Boolean)}
|
|
315
351
|
</div>
|
|
316
352
|
);
|
|
317
353
|
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
.resize-handle-horizontal,
|
|
2
|
+
.resize-handle-vertical {
|
|
3
|
+
z-index: 12;
|
|
4
|
+
}
|
|
5
|
+
|
|
1
6
|
.resize-handle-horizontal {
|
|
2
7
|
cursor: col-resize;
|
|
3
8
|
position: relative;
|
|
4
9
|
height: 100%;
|
|
5
10
|
margin-right: -2px;
|
|
6
11
|
margin-left: -2px;
|
|
7
|
-
z-index: 4;
|
|
8
12
|
width: 4px;
|
|
9
13
|
transition: background-color 0.1s ease-out;
|
|
10
14
|
background: transparent;
|
|
@@ -31,7 +35,6 @@
|
|
|
31
35
|
margin-top: -2px;
|
|
32
36
|
margin-bottom: -2px;
|
|
33
37
|
height: 4px;
|
|
34
|
-
z-index: 4;
|
|
35
38
|
transition: background-color 0.1s ease-out;
|
|
36
39
|
background: transparent;
|
|
37
40
|
&:hover {
|
package/src/core-preferences.ts
CHANGED
|
@@ -159,6 +159,11 @@ export const corePreferenceSchema: PreferenceSchema = {
|
|
|
159
159
|
default: true,
|
|
160
160
|
description: '%preference.debug.breakpoint.editorHint%',
|
|
161
161
|
},
|
|
162
|
+
'debug.breakpoint.showBreakpointsInOverviewRuler': {
|
|
163
|
+
type: 'boolean',
|
|
164
|
+
default: false,
|
|
165
|
+
description: '%preference.debug.breakpoint.showBreakpointsInOverviewRuler%',
|
|
166
|
+
},
|
|
162
167
|
'debug.toolbar.top': {
|
|
163
168
|
type: 'number',
|
|
164
169
|
default: 0,
|
|
@@ -305,6 +310,7 @@ export interface CoreConfiguration {
|
|
|
305
310
|
'explorer.compactFolders': boolean;
|
|
306
311
|
'debug.toolbar.float': boolean;
|
|
307
312
|
'debug.breakpoint.editorHint': boolean;
|
|
313
|
+
'debug.breakpoint.showBreakpointsInOverviewRuler': boolean;
|
|
308
314
|
'debug.toolbar.top': number;
|
|
309
315
|
'debug.toolbar.height': number;
|
|
310
316
|
'files.watcherExclude': { [key: string]: boolean };
|
|
@@ -2,6 +2,7 @@ import type React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { MaybeNull, BasicEvent } from '@opensumi/ide-core-common';
|
|
4
4
|
|
|
5
|
+
import { Layout } from '../components/layout/index';
|
|
5
6
|
import type { IMenu, IContextMenu } from '../menu/next';
|
|
6
7
|
import type { SlotLocation } from '../react-providers';
|
|
7
8
|
|
|
@@ -75,6 +76,7 @@ export interface ExtViewContainerOptions {
|
|
|
75
76
|
fromExtension?: boolean;
|
|
76
77
|
// viewContainer 最小高度,默认 120
|
|
77
78
|
miniSize?: number;
|
|
79
|
+
alignment?: Layout.alignment;
|
|
78
80
|
}
|
|
79
81
|
export const ComponentRegistry = Symbol('ComponentRegistry');
|
|
80
82
|
|
package/src/markdown/index.tsx
CHANGED
package/src/menu/next/menu-id.ts
CHANGED
|
@@ -84,6 +84,8 @@ export enum MenuId {
|
|
|
84
84
|
// setting.json
|
|
85
85
|
SettingJSONGlyphMarginContext = 'settingJson/glyphMargin/context',
|
|
86
86
|
SubSettingJSONGlyphMarginContext = 'sub/settingJson/glyphMargin/context',
|
|
87
|
+
// merge editor context
|
|
88
|
+
MergeEditorResultTitleContext = 'mergeEditor/result/title/context',
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
export function getTabbarCommonMenuId(location: string) {
|
|
@@ -160,7 +160,7 @@ export interface AppConfig {
|
|
|
160
160
|
/**
|
|
161
161
|
* @ClientOption
|
|
162
162
|
* 额外的 ConfigProvider
|
|
163
|
-
* 可以让
|
|
163
|
+
* 可以让 OpenSumi 内部的 ReactDOM.render 调用时
|
|
164
164
|
* 都被其包裹一层,以达到额外的 context 传递效果
|
|
165
165
|
*/
|
|
166
166
|
extraContextProvider?: React.ComponentType<React.PropsWithChildren<any>>;
|
|
@@ -216,7 +216,7 @@ export interface AppConfig {
|
|
|
216
216
|
* 视图组件内默认的组件样式资源 CDN 来源
|
|
217
217
|
* 默认值为 'alipay'
|
|
218
218
|
*/
|
|
219
|
-
componentCDNType?:
|
|
219
|
+
componentCDNType?: TComponentCDNType;
|
|
220
220
|
/**
|
|
221
221
|
* 指定前端是否为 Electron 环境 (Electron Renderer)
|
|
222
222
|
* 为兼容老的逻辑,若不兼容则 fallback 到 isElectronRenderer 的判断
|
|
@@ -277,3 +277,5 @@ export function ConfigProvider(props: React.PropsWithChildren<{ value: AppConfig
|
|
|
277
277
|
|
|
278
278
|
return React.createElement(extraContextProvider, { children: app });
|
|
279
279
|
}
|
|
280
|
+
|
|
281
|
+
export type TComponentCDNType = 'unpkg' | 'jsdelivr' | 'alipay' | 'npmmirror';
|
package/src/style/entry.less
CHANGED
package/src/style/icon.less
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// 本地IDE
|
|
2
|
-
@import '
|
|
1
|
+
// 本地 IDE 集成时需引入该文件: @opensumi/ide-core-browser/lib/style/icon.less
|
|
2
|
+
@import '@opensumi/ide-components/lib/icon/iconfont/iconfont.css';
|
|
3
3
|
@import './octicons/octicons.css';
|
|
4
|
-
@import '
|
|
4
|
+
@import '@vscode/codicons/dist/codicon.css';
|
|
5
5
|
|
|
6
6
|
.kaitian-icon {
|
|
7
7
|
font-size: 14px;
|
package/src/style/override.less
CHANGED
package/src/style/toolbar.less
CHANGED