@opensumi/ide-core-browser 2.27.3-rc-1715223126.0 → 3.0.0-alpha.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/bootstrap/connection.js +1 -1
- package/lib/bootstrap/connection.js.map +1 -1
- package/lib/components/ai-native/thumbs/index.d.ts.map +1 -1
- package/lib/components/ai-native/thumbs/index.js +11 -3
- package/lib/components/ai-native/thumbs/index.js.map +1 -1
- package/lib/components/portal/index.d.ts +2 -1
- package/lib/components/portal/index.d.ts.map +1 -1
- package/lib/components/portal/index.js +2 -2
- package/lib/components/portal/index.js.map +1 -1
- package/lib/components/resize/resize.module.less +1 -1
- package/lib/design/rule.d.ts +3 -1
- package/lib/design/rule.d.ts.map +1 -1
- package/lib/design/rule.js +2 -0
- package/lib/design/rule.js.map +1 -1
- package/lib/react-hooks/git/use-in-merge-changes.d.ts +3 -0
- package/lib/react-hooks/git/use-in-merge-changes.d.ts.map +1 -0
- package/lib/react-hooks/git/use-in-merge-changes.js +28 -0
- package/lib/react-hooks/git/use-in-merge-changes.js.map +1 -0
- package/lib/react-hooks/index.d.ts +1 -0
- package/lib/react-hooks/index.d.ts.map +1 -1
- package/lib/react-hooks/index.js +1 -0
- package/lib/react-hooks/index.js.map +1 -1
- package/lib/react-hooks/portal-hooks.d.ts +1 -1
- package/lib/react-hooks/portal-hooks.d.ts.map +1 -1
- package/lib/react-hooks/portal-hooks.js +7 -4
- package/lib/react-hooks/portal-hooks.js.map +1 -1
- package/lib/react-hooks/uuid.d.ts +2 -0
- package/lib/react-hooks/uuid.d.ts.map +1 -0
- package/lib/react-hooks/uuid.js +11 -0
- package/lib/react-hooks/uuid.js.map +1 -0
- package/package.json +5 -5
- package/src/bootstrap/connection.ts +1 -1
- package/src/components/ai-native/thumbs/index.tsx +16 -6
- package/src/components/portal/index.tsx +4 -3
- package/src/components/resize/resize.module.less +1 -1
- package/src/design/rule.ts +4 -0
- package/src/react-hooks/git/use-in-merge-changes.ts +31 -0
- package/src/react-hooks/index.ts +1 -0
- package/src/react-hooks/portal-hooks.tsx +7 -4
- package/src/react-hooks/uuid.tsx +8 -0
|
@@ -25,7 +25,7 @@ async function createConnectionService(injector, modules, onReconnect, connectio
|
|
|
25
25
|
channelHandler.connection.onOpen(() => {
|
|
26
26
|
onOpen();
|
|
27
27
|
});
|
|
28
|
-
channelHandler.connection.
|
|
28
|
+
channelHandler.connection.onClose(() => {
|
|
29
29
|
stateService.reachedState('core_module_initialized').then(() => {
|
|
30
30
|
eventBus.fire(new ide_core_common_1.BrowserConnectionCloseEvent());
|
|
31
31
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/bootstrap/connection.ts"],"names":[],"mappings":";;;AACA,6DAAuF;AACvF,kEAAwE;AAGxE,uFAA2F;AAC3F,+DAQmC;AAGnC,gDAAuD;AAMvD,MAAM,aAAa,GAAG,IAAA,gCAAc,GAAE,CAAC;AAEhC,KAAK,UAAU,uBAAuB,CAC3C,QAAkB,EAClB,OAA4B,EAC5B,WAAuB,EACvB,UAAiE,EACjE,QAAgB;IAEhB,MAAM,eAAe,GAAqB,QAAQ,CAAC,GAAG,CAAC,kCAAgB,CAAC,CAAC;IACzE,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,2BAAS,CAAC,CAAC;IACzC,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,mCAAqB,CAAC,CAAC;IAEzD,MAAM,cAAc,GAAG,IAAI,0BAAgB,CAAC,UAAU,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;IACjF,cAAc,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAG,GAAG,EAAE;QAClB,YAAY,CAAC,YAAY,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YAC7D,QAAQ,CAAC,IAAI,CAAC,IAAI,4CAA0B,EAAE,CA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UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;QAE9C,MAAM,aAAa,GAAG;YACpB,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,UAAU;SACT,CAAC;QAEd,QAAQ,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QACrC,mDAAmD;QACnD,IAAI,WAAW,CAAC,WAAW,EAAE;YAC3B,wBAAwB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC5C;KACF;IAED,KAAK,MAAM,WAAW,IAAI,wBAAwB,EAAE;QAClD,MAAM,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;QACpC,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;QAC9C,IAAI,WAAW,CAAC,WAAW,EAAE;YAC3B,MAAM,aAAa,GAAG,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;YAC5D,UAAU,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;SAC5C;KACF;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ai-native/thumbs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ai-native/thumbs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAUrD,UAAU,WAAW;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACtC;AAED,eAAO,MAAM,MAAM,UAAW,WAAW,sBAsExC,CAAC"}
|
|
@@ -28,17 +28,25 @@ const Thumbs = (props) => {
|
|
|
28
28
|
setThumbsdownIcon(false);
|
|
29
29
|
report(true);
|
|
30
30
|
}
|
|
31
|
+
if (type === 'up' && thumbsupIcon === 'thumbs-fill') {
|
|
32
|
+
setThumbsupIcon('thumbs');
|
|
33
|
+
setThumbsdownIcon('thumbsdown');
|
|
34
|
+
}
|
|
31
35
|
if (type === 'down' && thumbsdownIcon === 'thumbsdown') {
|
|
32
36
|
setThumbsdownIcon('thumbsdown-fill');
|
|
33
37
|
setThumbsupIcon(false);
|
|
34
38
|
report(false);
|
|
35
39
|
}
|
|
40
|
+
if (type === 'down' && thumbsdownIcon === 'thumbsdown-fill') {
|
|
41
|
+
setThumbsdownIcon('thumbsdown');
|
|
42
|
+
setThumbsupIcon('thumbs');
|
|
43
|
+
}
|
|
36
44
|
}, [thumbsupIcon, thumbsdownIcon]);
|
|
37
|
-
const
|
|
45
|
+
const id = (0, react_hooks_1.useUUID)();
|
|
38
46
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
39
|
-
typeof thumbsupIcon === 'string' && (react_1.default.createElement(components_1.Popover, { id: `ai-chat-thumbsup-${
|
|
47
|
+
typeof thumbsupIcon === 'string' && (react_1.default.createElement(components_1.Popover, { id: `ai-chat-thumbsup-${id}`, title: (0, ide_core_common_1.localize)('aiNative.inline.chat.operate.thumbsup.title') },
|
|
40
48
|
react_1.default.createElement(enhanceIcon_1.EnhanceIcon, { wrapperClassName: wrapperClassName, onClick: () => handleClick('up'), className: (0, icon_1.getExternalIcon)(thumbsupIcon, icon_1.KTICON_OWNER) }))),
|
|
41
|
-
typeof thumbsdownIcon === 'string' && (react_1.default.createElement(components_1.Popover, { id: `ai-chat-thumbsdown-${
|
|
49
|
+
typeof thumbsdownIcon === 'string' && (react_1.default.createElement(components_1.Popover, { id: `ai-chat-thumbsdown-${id}`, title: (0, ide_core_common_1.localize)('aiNative.inline.chat.operate.thumbsdown.title') },
|
|
42
50
|
react_1.default.createElement(enhanceIcon_1.EnhanceIcon, { wrapperClassName: wrapperClassName, onClick: () => handleClick('down'), className: (0, icon_1.getExternalIcon)(thumbsdownIcon, icon_1.KTICON_OWNER) })))));
|
|
43
51
|
};
|
|
44
52
|
exports.Thumbs = Thumbs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ai-native/thumbs/index.tsx"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ai-native/thumbs/index.tsx"],"names":[],"mappings":";;;;AAAA,uDAAqD;AAErD,+DAAqD;AAErD,kDAA0D;AAC1D,oDAA8C;AAC9C,sDAA8D;AAC9D,mDAAyE;AACzE,gDAA6C;AAQtC,MAAM,MAAM,GAAG,CAAC,KAAkB,EAAE,EAAE;IAC3C,MAAM,mBAAmB,GAAG,IAAA,2BAAa,EAAuB,gCAAoB,CAAC,CAAC;IACtF,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAC;IAExD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAmB,QAAQ,CAAC,CAAC;IAC7E,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,IAAA,gBAAQ,EAAmB,YAAY,CAAC,CAAC;IAErF,MAAM,MAAM,GAAG,IAAA,mBAAW,EACxB,CAAC,MAAe,EAAE,EAAE;QAClB,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,MAAM,CAAC,CAAC;SACjB;QACD,IAAI,mBAAmB,EAAE;YACvB,mBAAmB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;SAC7C;IACH,CAAC,EACD,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAClC,CAAC;IAEF,MAAM,WAAW,GAAG,IAAA,mBAAW,EAC7B,CAAC,IAAmB,EAAE,EAAE;QACtB,IAAI,IAAI,KAAK,IAAI,IAAI,YAAY,KAAK,QAAQ,EAAE;YAC9C,eAAe,CAAC,aAAa,CAAC,CAAC;YAC/B,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,MAAM,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,sBAAe,EAAC,cAAc,EAAE,mBAAY,CAAC,GACxD,CACM,CACX,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAtEW,QAAA,MAAM,UAsEjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/portal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/portal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;CAC9B,CAGA,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_dom_1 = tslib_1.__importDefault(require("react-dom"));
|
|
5
5
|
const react_hooks_1 = require("../../react-hooks");
|
|
6
|
-
const Portal = ({ id, children }) => {
|
|
7
|
-
const target = (0, react_hooks_1.usePortal)(id);
|
|
6
|
+
const Portal = ({ id, className, children }) => {
|
|
7
|
+
const target = (0, react_hooks_1.usePortal)(id, className);
|
|
8
8
|
return react_dom_1.default.createPortal(children, target);
|
|
9
9
|
};
|
|
10
10
|
exports.default = Portal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/portal/index.tsx"],"names":[],"mappings":";;;AACA,kEAAiC;AAEjC,mDAA8C;AAE9C,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/portal/index.tsx"],"names":[],"mappings":";;;AACA,kEAAiC;AAEjC,mDAA8C;AAE9C,MAAM,MAAM,GAIP,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE;IACnC,MAAM,MAAM,GAAG,IAAA,uBAAS,EAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IACxC,OAAO,mBAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF,kBAAe,MAAM,CAAC"}
|
package/lib/design/rule.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export declare const StackingLevel: {
|
|
|
11
11
|
readonly WorkbenchEditor: 1;
|
|
12
12
|
readonly Toolbar: 2;
|
|
13
13
|
readonly ToolbarDropdown: 10;
|
|
14
|
+
readonly ResizeHandle: 12;
|
|
15
|
+
readonly EditorFloatingContainer: 20;
|
|
14
16
|
/**
|
|
15
17
|
* 一级弹窗
|
|
16
18
|
*/
|
|
@@ -20,5 +22,5 @@ export declare const StackingLevel: {
|
|
|
20
22
|
readonly Overlay: 800;
|
|
21
23
|
readonly OverlayTop: 1000;
|
|
22
24
|
};
|
|
23
|
-
export declare const StackingLevelStr: Record<"Background" | "Base" | "Workbench" | "WorkbenchEditor" | "Toolbar" | "ToolbarDropdown" | "Popup" | "PopoverComponent" | "PopoverComponentArrow" | "Overlay" | "OverlayTop", string>;
|
|
25
|
+
export declare const StackingLevelStr: Record<"Background" | "Base" | "Workbench" | "WorkbenchEditor" | "Toolbar" | "ToolbarDropdown" | "ResizeHandle" | "EditorFloatingContainer" | "Popup" | "PopoverComponent" | "PopoverComponentArrow" | "Overlay" | "OverlayTop", string>;
|
|
24
26
|
//# sourceMappingURL=rule.d.ts.map
|
package/lib/design/rule.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule.d.ts","sourceRoot":"","sources":["../../src/design/rule.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG
|
|
1
|
+
{"version":3,"file":"rule.d.ts","sourceRoot":"","sources":["../../src/design/rule.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;;;;;;;;;IAcH;;OAEG;;;;;;CAMK,CAAC;AAEX,eAAO,MAAM,gBAAgB,0OAEkB,CAAC"}
|
package/lib/design/rule.js
CHANGED
package/lib/design/rule.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule.js","sourceRoot":"","sources":["../../src/design/rule.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,aAAa,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,CAAC;IACP,UAAU,EAAE,CAAC;IAEb,SAAS,EAAE,CAAC;IACZ,eAAe,EAAE,CAAC;IAElB,OAAO,EAAE,CAAC;IACV,eAAe,EAAE,EAAE;IAEnB;;OAEG;IACH,KAAK,EAAE,GAAG;IACV,gBAAgB,EAAE,IAAI;IACtB,qBAAqB,EAAE,IAAI;IAC3B,OAAO,EAAE,GAAG;IACZ,UAAU,EAAE,IAAI;CACR,CAAC;AAEE,QAAA,gBAAgB,GAAG,MAAM,CAAC,WAAW,CAChD,MAAM,CAAC,OAAO,CAAC,qBAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAC/B,CAAC"}
|
|
1
|
+
{"version":3,"file":"rule.js","sourceRoot":"","sources":["../../src/design/rule.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,aAAa,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,CAAC;IACP,UAAU,EAAE,CAAC;IAEb,SAAS,EAAE,CAAC;IACZ,eAAe,EAAE,CAAC;IAElB,OAAO,EAAE,CAAC;IACV,eAAe,EAAE,EAAE;IAEnB,YAAY,EAAE,EAAE;IAEhB,uBAAuB,EAAE,EAAE;IAE3B;;OAEG;IACH,KAAK,EAAE,GAAG;IACV,gBAAgB,EAAE,IAAI;IACtB,qBAAqB,EAAE,IAAI;IAC3B,OAAO,EAAE,GAAG;IACZ,UAAU,EAAE,IAAI;CACR,CAAC;AAEE,QAAA,gBAAgB,GAAG,MAAM,CAAC,WAAW,CAChD,MAAM,CAAC,OAAO,CAAC,qBAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAC/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-in-merge-changes.d.ts","sourceRoot":"","sources":["../../../src/react-hooks/git/use-in-merge-changes.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,kBAAkB,aAAwB,CAAC;AAExD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,WAqB/C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useInMergeChanges = exports.gitMergeChangesSet = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const context_key_1 = require("../../context-key");
|
|
6
|
+
const injectable_hooks_1 = require("../injectable-hooks");
|
|
7
|
+
const contextKey = 'git.mergeChangesObj';
|
|
8
|
+
exports.gitMergeChangesSet = new Set([contextKey]);
|
|
9
|
+
function useInMergeChanges(uriStr) {
|
|
10
|
+
const contextKeyService = (0, injectable_hooks_1.useInjectable)(context_key_1.IContextKeyService);
|
|
11
|
+
const [inMergeChanges, setInMergeChanges] = (0, react_1.useState)(false);
|
|
12
|
+
(0, react_1.useEffect)(() => {
|
|
13
|
+
function run() {
|
|
14
|
+
const mergeChanges = contextKeyService.getValue(contextKey) || {};
|
|
15
|
+
setInMergeChanges(mergeChanges[uriStr] || false);
|
|
16
|
+
}
|
|
17
|
+
run();
|
|
18
|
+
const disposed = contextKeyService.onDidChangeContext(({ payload }) => {
|
|
19
|
+
if (payload.affectsSome(exports.gitMergeChangesSet)) {
|
|
20
|
+
run();
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return () => disposed.dispose();
|
|
24
|
+
}, [uriStr]);
|
|
25
|
+
return inMergeChanges;
|
|
26
|
+
}
|
|
27
|
+
exports.useInMergeChanges = useInMergeChanges;
|
|
28
|
+
//# sourceMappingURL=use-in-merge-changes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-in-merge-changes.js","sourceRoot":"","sources":["../../../src/react-hooks/git/use-in-merge-changes.ts"],"names":[],"mappings":";;;AAAA,iCAA4C;AAE5C,mDAAuD;AACvD,0DAAoD;AAEpD,MAAM,UAAU,GAAG,qBAAqB,CAAC;AAE5B,QAAA,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AAExD,SAAgB,iBAAiB,CAAC,MAAc;IAC9C,MAAM,iBAAiB,GAAG,IAAA,gCAAa,EAAqB,gCAAkB,CAAC,CAAC;IAEhF,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAE5D,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,SAAS,GAAG;YACV,MAAM,YAAY,GAAG,iBAAiB,CAAC,QAAQ,CAA0B,UAAU,CAAC,IAAI,EAAE,CAAC;YAC3F,iBAAiB,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC;QACnD,CAAC;QACD,GAAG,EAAE,CAAC;QAEN,MAAM,QAAQ,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;YACpE,IAAI,OAAO,CAAC,WAAW,CAAC,0BAAkB,CAAC,EAAE;gBAC3C,GAAG,EAAE,CAAC;aACP;QACH,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IAClC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,cAAc,CAAC;AACxB,CAAC;AArBD,8CAqBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react-hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react-hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
|
package/lib/react-hooks/index.js
CHANGED
|
@@ -6,4 +6,5 @@ tslib_1.__exportStar(require("./portal-hooks"), exports);
|
|
|
6
6
|
tslib_1.__exportStar(require("./event"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./use-change"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./hover"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./uuid"), exports);
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react-hooks/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,yDAA+B;AAC/B,kDAAwB;AACxB,uDAA6B;AAC7B,kDAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react-hooks/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,yDAA+B;AAC/B,kDAAwB;AACxB,uDAA6B;AAC7B,kDAAwB;AACxB,iDAAuB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function usePortal(id: string): HTMLDivElement;
|
|
1
|
+
export declare function usePortal(id: string, className?: string): HTMLDivElement;
|
|
2
2
|
//# sourceMappingURL=portal-hooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal-hooks.d.ts","sourceRoot":"","sources":["../../src/react-hooks/portal-hooks.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"portal-hooks.d.ts","sourceRoot":"","sources":["../../src/react-hooks/portal-hooks.tsx"],"names":[],"mappings":"AAWA,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,kBA6BvD"}
|
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.usePortal = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
function createRootElement(id) {
|
|
5
|
+
function createRootElement(id, className) {
|
|
6
6
|
const rootContainer = document.createElement('div');
|
|
7
|
-
rootContainer.
|
|
7
|
+
rootContainer.id = id;
|
|
8
|
+
if (className) {
|
|
9
|
+
rootContainer.className = className;
|
|
10
|
+
}
|
|
8
11
|
return rootContainer;
|
|
9
12
|
}
|
|
10
|
-
function usePortal(id) {
|
|
13
|
+
function usePortal(id, className) {
|
|
11
14
|
const rootElemRef = (0, react_1.useRef)(null);
|
|
12
15
|
(0, react_1.useEffect)(() => {
|
|
13
16
|
const existingParent = document.querySelector(`#${id}`);
|
|
14
|
-
const parentElem = existingParent || createRootElement(id);
|
|
17
|
+
const parentElem = existingParent || createRootElement(id, className);
|
|
15
18
|
if (!existingParent) {
|
|
16
19
|
document.body.appendChild(parentElem);
|
|
17
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal-hooks.js","sourceRoot":"","sources":["../../src/react-hooks/portal-hooks.tsx"],"names":[],"mappings":";;;AAAA,iCAA0C;AAE1C,SAAS,iBAAiB,CAAC,EAAU;
|
|
1
|
+
{"version":3,"file":"portal-hooks.js","sourceRoot":"","sources":["../../src/react-hooks/portal-hooks.tsx"],"names":[],"mappings":";;;AAAA,iCAA0C;AAE1C,SAAS,iBAAiB,CAAC,EAAU,EAAE,SAAkB;IACvD,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACpD,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC;IACtB,IAAI,SAAS,EAAE;QACb,aAAa,CAAC,SAAS,GAAG,SAAS,CAAC;KACrC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,SAAgB,SAAS,CAAC,EAAU,EAAE,SAAkB;IACtD,MAAM,WAAW,GAAG,IAAA,cAAM,EAAwB,IAAI,CAAC,CAAC;IAExD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACxD,MAAM,UAAU,GAAG,cAAc,IAAI,iBAAiB,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QAEtE,IAAI,CAAC,cAAc,EAAE;YACnB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;SACvC;QAED,IAAI,WAAW,CAAC,OAAO,EAAE;YACvB,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;SAC7C;QAED,OAAO,GAAG,EAAE;YACV,IAAI,WAAW,CAAC,OAAO,EAAE;gBACvB,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;aAC9B;YACD,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE;gBACvC,UAAU,CAAC,MAAM,EAAE,CAAC;aACrB;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE;QACxB,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;KACrD;IACD,OAAO,WAAW,CAAC,OAAO,CAAC;AAC7B,CAAC;AA7BD,8BA6BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src/react-hooks/uuid.tsx"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,IAAI,MAAM,CAGhC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useUUID = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const ide_core_common_1 = require("@opensumi/ide-core-common");
|
|
6
|
+
function useUUID() {
|
|
7
|
+
const id = (0, react_1.useMemo)(() => (0, ide_core_common_1.uuid)(6), []);
|
|
8
|
+
return id;
|
|
9
|
+
}
|
|
10
|
+
exports.useUUID = useUUID;
|
|
11
|
+
//# sourceMappingURL=uuid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../src/react-hooks/uuid.tsx"],"names":[],"mappings":";;;AAAA,iCAAgC;AAEhC,+DAAiD;AAEjD,SAAgB,OAAO;IACrB,MAAM,EAAE,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,IAAA,sBAAI,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACtC,OAAO,EAAE,CAAC;AACZ,CAAC;AAHD,0BAGC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/ide-core-browser",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.0",
|
|
4
4
|
"description": "@opensumi/ide-core-browser",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"build": "tsc --build ../../configs/ts/references/tsconfig.core-browser.json"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@opensumi/ide-components": "
|
|
22
|
-
"@opensumi/ide-connection": "
|
|
23
|
-
"@opensumi/ide-core-common": "
|
|
21
|
+
"@opensumi/ide-components": "3.0.0-alpha.0",
|
|
22
|
+
"@opensumi/ide-connection": "3.0.0-alpha.0",
|
|
23
|
+
"@opensumi/ide-core-common": "3.0.0-alpha.0",
|
|
24
24
|
"@opensumi/vscode-debugprotocol": "1.49.0-beta.1",
|
|
25
25
|
"@vscode/codicons": "0.0.35",
|
|
26
26
|
"ajv": "^6.10.0",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"react": "^18.2.0",
|
|
48
48
|
"react-dom": "^18.2.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "54cd29a63e083491dbbdd34fde188f936504bc3b"
|
|
51
51
|
}
|
|
@@ -52,7 +52,7 @@ export async function createConnectionService(
|
|
|
52
52
|
onOpen();
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
channelHandler.connection.
|
|
55
|
+
channelHandler.connection.onClose(() => {
|
|
56
56
|
stateService.reachedState('core_module_initialized').then(() => {
|
|
57
57
|
eventBus.fire(new BrowserConnectionCloseEvent());
|
|
58
58
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { useCallback,
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import { localize
|
|
3
|
+
import { localize } from '@opensumi/ide-core-common';
|
|
4
4
|
|
|
5
5
|
import { IAIInlineChatService } from '../../../ai-native';
|
|
6
6
|
import { Popover } from '../../../components';
|
|
7
|
-
import { useInjectable } from '../../../react-hooks';
|
|
7
|
+
import { useInjectable, useUUID } from '../../../react-hooks';
|
|
8
8
|
import { KTICON_OWNER, getExternalIcon } from '../../../style/icon/icon';
|
|
9
9
|
import { EnhanceIcon } from '../enhanceIcon';
|
|
10
10
|
|
|
@@ -41,21 +41,31 @@ export const Thumbs = (props: ThumbsProps) => {
|
|
|
41
41
|
report(true);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
if (type === 'up' && thumbsupIcon === 'thumbs-fill') {
|
|
45
|
+
setThumbsupIcon('thumbs');
|
|
46
|
+
setThumbsdownIcon('thumbsdown');
|
|
47
|
+
}
|
|
48
|
+
|
|
44
49
|
if (type === 'down' && thumbsdownIcon === 'thumbsdown') {
|
|
45
50
|
setThumbsdownIcon('thumbsdown-fill');
|
|
46
51
|
setThumbsupIcon(false);
|
|
47
52
|
report(false);
|
|
48
53
|
}
|
|
54
|
+
|
|
55
|
+
if (type === 'down' && thumbsdownIcon === 'thumbsdown-fill') {
|
|
56
|
+
setThumbsdownIcon('thumbsdown');
|
|
57
|
+
setThumbsupIcon('thumbs');
|
|
58
|
+
}
|
|
49
59
|
},
|
|
50
60
|
[thumbsupIcon, thumbsdownIcon],
|
|
51
61
|
);
|
|
52
62
|
|
|
53
|
-
const
|
|
63
|
+
const id = useUUID();
|
|
54
64
|
|
|
55
65
|
return (
|
|
56
66
|
<>
|
|
57
67
|
{typeof thumbsupIcon === 'string' && (
|
|
58
|
-
<Popover id={`ai-chat-thumbsup-${
|
|
68
|
+
<Popover id={`ai-chat-thumbsup-${id}`} title={localize('aiNative.inline.chat.operate.thumbsup.title')}>
|
|
59
69
|
<EnhanceIcon
|
|
60
70
|
wrapperClassName={wrapperClassName}
|
|
61
71
|
onClick={() => handleClick('up')}
|
|
@@ -64,7 +74,7 @@ export const Thumbs = (props: ThumbsProps) => {
|
|
|
64
74
|
</Popover>
|
|
65
75
|
)}
|
|
66
76
|
{typeof thumbsdownIcon === 'string' && (
|
|
67
|
-
<Popover id={`ai-chat-thumbsdown-${
|
|
77
|
+
<Popover id={`ai-chat-thumbsdown-${id}`} title={localize('aiNative.inline.chat.operate.thumbsdown.title')}>
|
|
68
78
|
<EnhanceIcon
|
|
69
79
|
wrapperClassName={wrapperClassName}
|
|
70
80
|
onClick={() => handleClick('down')}
|
|
@@ -5,9 +5,10 @@ import { usePortal } from '../../react-hooks';
|
|
|
5
5
|
|
|
6
6
|
const Portal: React.FC<{
|
|
7
7
|
id: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
className?: string;
|
|
9
|
+
children: React.ReactElement;
|
|
10
|
+
}> = ({ id, className, children }) => {
|
|
11
|
+
const target = usePortal(id, className);
|
|
11
12
|
return ReactDOM.createPortal(children, target);
|
|
12
13
|
};
|
|
13
14
|
|
package/src/design/rule.ts
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { IContextKeyService } from '../../context-key';
|
|
4
|
+
import { useInjectable } from '../injectable-hooks';
|
|
5
|
+
|
|
6
|
+
const contextKey = 'git.mergeChangesObj';
|
|
7
|
+
|
|
8
|
+
export const gitMergeChangesSet = new Set([contextKey]);
|
|
9
|
+
|
|
10
|
+
export function useInMergeChanges(uriStr: string) {
|
|
11
|
+
const contextKeyService = useInjectable<IContextKeyService>(IContextKeyService);
|
|
12
|
+
|
|
13
|
+
const [inMergeChanges, setInMergeChanges] = useState(false);
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
function run() {
|
|
17
|
+
const mergeChanges = contextKeyService.getValue<Record<string, boolean>>(contextKey) || {};
|
|
18
|
+
setInMergeChanges(mergeChanges[uriStr] || false);
|
|
19
|
+
}
|
|
20
|
+
run();
|
|
21
|
+
|
|
22
|
+
const disposed = contextKeyService.onDidChangeContext(({ payload }) => {
|
|
23
|
+
if (payload.affectsSome(gitMergeChangesSet)) {
|
|
24
|
+
run();
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return () => disposed.dispose();
|
|
28
|
+
}, [uriStr]);
|
|
29
|
+
|
|
30
|
+
return inMergeChanges;
|
|
31
|
+
}
|
package/src/react-hooks/index.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
2
|
|
|
3
|
-
function createRootElement(id: string) {
|
|
3
|
+
function createRootElement(id: string, className?: string) {
|
|
4
4
|
const rootContainer = document.createElement('div');
|
|
5
|
-
rootContainer.
|
|
5
|
+
rootContainer.id = id;
|
|
6
|
+
if (className) {
|
|
7
|
+
rootContainer.className = className;
|
|
8
|
+
}
|
|
6
9
|
return rootContainer;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
|
-
export function usePortal(id: string) {
|
|
12
|
+
export function usePortal(id: string, className?: string) {
|
|
10
13
|
const rootElemRef = useRef<HTMLDivElement | null>(null);
|
|
11
14
|
|
|
12
15
|
useEffect(() => {
|
|
13
16
|
const existingParent = document.querySelector(`#${id}`);
|
|
14
|
-
const parentElem = existingParent || createRootElement(id);
|
|
17
|
+
const parentElem = existingParent || createRootElement(id, className);
|
|
15
18
|
|
|
16
19
|
if (!existingParent) {
|
|
17
20
|
document.body.appendChild(parentElem);
|