@opensumi/ide-components 3.4.6-next-1730692409.0 → 3.4.6-next-1733744589.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/dist/index.css +10 -32
- package/dist/index.js +9 -9
- package/lib/dialog/index.d.ts +0 -1
- package/lib/dialog/index.d.ts.map +1 -1
- package/lib/dialog/index.js +5 -5
- package/lib/dialog/index.js.map +1 -1
- package/lib/dialog/styles.less +1 -1
- package/lib/markdown-react/parse.d.ts +0 -1
- package/lib/markdown-react/parse.d.ts.map +1 -1
- package/lib/markdown-react/parse.js +4 -11
- package/lib/markdown-react/parse.js.map +1 -1
- package/lib/markdown-react/render.d.ts +24 -23
- package/lib/markdown-react/render.d.ts.map +1 -1
- package/lib/markdown-react/render.js +5 -5
- package/lib/markdown-react/render.js.map +1 -1
- package/lib/message/style.less +0 -11
- package/lib/notification/notification.less +1 -1
- package/lib/popover/index.d.ts +0 -1
- package/lib/popover/index.d.ts.map +1 -1
- package/lib/popover/index.js +2 -2
- package/lib/popover/index.js.map +1 -1
- package/lib/popover/styles.less +3 -3
- package/package.json +5 -5
package/dist/index.css
CHANGED
|
@@ -339,7 +339,7 @@
|
|
|
339
339
|
}
|
|
340
340
|
.kt-dialog-content .kt-dialog-content_area .kt-dialog-content_title {
|
|
341
341
|
line-height: 22px;
|
|
342
|
-
font-size:
|
|
342
|
+
font-size: 14px;
|
|
343
343
|
margin: 0px 0px 8px 0px;
|
|
344
344
|
}
|
|
345
345
|
.kt-dialog-content .kt-dialog-icon {
|
|
@@ -660,17 +660,6 @@
|
|
|
660
660
|
background: var(--notifications-background);
|
|
661
661
|
color: var(--notifications-foreground);
|
|
662
662
|
}
|
|
663
|
-
.kt-message-custom-content {
|
|
664
|
-
display: flex;
|
|
665
|
-
align-items: flex-start;
|
|
666
|
-
justify-content: center;
|
|
667
|
-
}
|
|
668
|
-
.kt-message-custom-content .anticon {
|
|
669
|
-
height: 21px;
|
|
670
|
-
display: flex;
|
|
671
|
-
align-items: center;
|
|
672
|
-
justify-content: center;
|
|
673
|
-
}
|
|
674
663
|
.kt-message-success .anticon {
|
|
675
664
|
color: #52c41a;
|
|
676
665
|
}
|
|
@@ -932,7 +921,7 @@
|
|
|
932
921
|
overflow: hidden;
|
|
933
922
|
text-overflow: ellipsis;
|
|
934
923
|
padding: 0 5px;
|
|
935
|
-
box-sizing:
|
|
924
|
+
box-sizing: border-box;
|
|
936
925
|
display: inline-block;
|
|
937
926
|
}
|
|
938
927
|
.kt-overlay.kt-modal {
|
|
@@ -1033,9 +1022,9 @@
|
|
|
1033
1022
|
.kt-popover-placement-top .kt-popover-arrow,
|
|
1034
1023
|
.kt-popover-placement-topLeft .kt-popover-arrow,
|
|
1035
1024
|
.kt-popover-placement-topRight .kt-popover-arrow {
|
|
1036
|
-
|
|
1037
|
-
margin-
|
|
1038
|
-
border-width:
|
|
1025
|
+
bottom: 4px;
|
|
1026
|
+
margin-left: -5px;
|
|
1027
|
+
border-width: 5px 5px 0;
|
|
1039
1028
|
border-top-color: var(--kt-popover-background);
|
|
1040
1029
|
}
|
|
1041
1030
|
.kt-popover-placement-top .kt-popover-arrow {
|
|
@@ -2904,7 +2893,7 @@
|
|
|
2904
2893
|
}
|
|
2905
2894
|
.kt-dialog-content .kt-dialog-content_area .kt-dialog-content_title {
|
|
2906
2895
|
line-height: 22px;
|
|
2907
|
-
font-size:
|
|
2896
|
+
font-size: 14px;
|
|
2908
2897
|
margin: 0px 0px 8px 0px;
|
|
2909
2898
|
}
|
|
2910
2899
|
.kt-dialog-content .kt-dialog-icon {
|
|
@@ -3195,7 +3184,7 @@
|
|
|
3195
3184
|
overflow: hidden;
|
|
3196
3185
|
text-overflow: ellipsis;
|
|
3197
3186
|
padding: 0 5px;
|
|
3198
|
-
box-sizing:
|
|
3187
|
+
box-sizing: border-box;
|
|
3199
3188
|
display: inline-block;
|
|
3200
3189
|
}
|
|
3201
3190
|
|
|
@@ -3275,9 +3264,9 @@
|
|
|
3275
3264
|
.kt-popover-placement-top .kt-popover-arrow,
|
|
3276
3265
|
.kt-popover-placement-topLeft .kt-popover-arrow,
|
|
3277
3266
|
.kt-popover-placement-topRight .kt-popover-arrow {
|
|
3278
|
-
|
|
3279
|
-
margin-
|
|
3280
|
-
border-width:
|
|
3267
|
+
bottom: 4px;
|
|
3268
|
+
margin-left: -5px;
|
|
3269
|
+
border-width: 5px 5px 0;
|
|
3281
3270
|
border-top-color: var(--kt-popover-background);
|
|
3282
3271
|
}
|
|
3283
3272
|
.kt-popover-placement-top .kt-popover-arrow {
|
|
@@ -3442,17 +3431,6 @@
|
|
|
3442
3431
|
background: var(--notifications-background);
|
|
3443
3432
|
color: var(--notifications-foreground);
|
|
3444
3433
|
}
|
|
3445
|
-
.kt-message-custom-content {
|
|
3446
|
-
display: flex;
|
|
3447
|
-
align-items: flex-start;
|
|
3448
|
-
justify-content: center;
|
|
3449
|
-
}
|
|
3450
|
-
.kt-message-custom-content .anticon {
|
|
3451
|
-
height: 21px;
|
|
3452
|
-
display: flex;
|
|
3453
|
-
align-items: center;
|
|
3454
|
-
justify-content: center;
|
|
3455
|
-
}
|
|
3456
3434
|
.kt-message-success .anticon {
|
|
3457
3435
|
color: #52c41a;
|
|
3458
3436
|
}
|
package/dist/index.js
CHANGED
|
@@ -5286,7 +5286,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
|
5286
5286
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5287
5287
|
|
|
5288
5288
|
"use strict";
|
|
5289
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Dialog = exports.DialogContent = void 0;\nconst tslib_1 = __webpack_require__(/*! tslib */ \"../../node_modules/tslib/tslib.es6.mjs\");\nconst classnames_1 = tslib_1.__importDefault(__webpack_require__(/*! classnames */ \"../../node_modules/classnames/index.js\"));\nconst react_1 = tslib_1.__importDefault(__webpack_require__(/*! react */ \"../../node_modules/react/index.js\"));\nconst ide_core_common_1 = __webpack_require__(/*! @opensumi/ide-core-common */ \"../core-common/lib/index.js\");\nconst button_1 = __webpack_require__(/*! ../button */ \"./src/button/index.tsx\");\nconst common_1 = __webpack_require__(/*! ../common */ \"./src/common.ts\");\nconst icon_1 = __webpack_require__(/*! ../icon */ \"./src/icon/index.ts\");\nconst overlay_1 = __webpack_require__(/*! ../overlay */ \"./src/overlay/index.tsx\");\n__webpack_require__(/*! ./styles.less */ \"./src/dialog/styles.less\");\nconst DefaultButtons = ({ onCancel, onOk, cancelText, okText }) => (react_1.default.createElement(react_1.default.Fragment, null,\n react_1.default.createElement(button_1.Button, { onClick: onCancel, type: 'secondary' }, cancelText || (0, ide_core_common_1.localize)('ButtonCancel')),\n react_1.default.createElement(button_1.Button, { onClick: onOk }, okText || (0, ide_core_common_1.localize)('ButtonOK'))));\nconst DialogContent = ({ onClose, closable,
|
|
5289
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Dialog = exports.DialogContent = void 0;\nconst tslib_1 = __webpack_require__(/*! tslib */ \"../../node_modules/tslib/tslib.es6.mjs\");\nconst classnames_1 = tslib_1.__importDefault(__webpack_require__(/*! classnames */ \"../../node_modules/classnames/index.js\"));\nconst react_1 = tslib_1.__importDefault(__webpack_require__(/*! react */ \"../../node_modules/react/index.js\"));\nconst ide_core_common_1 = __webpack_require__(/*! @opensumi/ide-core-common */ \"../core-common/lib/index.js\");\nconst button_1 = __webpack_require__(/*! ../button */ \"./src/button/index.tsx\");\nconst common_1 = __webpack_require__(/*! ../common */ \"./src/common.ts\");\nconst icon_1 = __webpack_require__(/*! ../icon */ \"./src/icon/index.ts\");\nconst overlay_1 = __webpack_require__(/*! ../overlay */ \"./src/overlay/index.tsx\");\n__webpack_require__(/*! ./styles.less */ \"./src/dialog/styles.less\");\nconst DefaultButtons = ({ onCancel, onOk, cancelText, okText }) => (react_1.default.createElement(react_1.default.Fragment, null,\n react_1.default.createElement(button_1.Button, { onClick: onCancel, type: 'secondary' }, cancelText || (0, ide_core_common_1.localize)('ButtonCancel')),\n react_1.default.createElement(button_1.Button, { onClick: onOk }, okText || (0, ide_core_common_1.localize)('ButtonOK'))));\nconst DialogContent = ({ onClose, closable, messageType = common_1.MessageType.Info, icon, message, buttons, type = 'confirm', title, onOk, onCancel, okText, cancelText, }) => {\n const { getIcon: getContextIcon } = react_1.default.useContext(icon_1.IconContext);\n return (react_1.default.createElement(react_1.default.Fragment, null,\n react_1.default.createElement(\"div\", { className: 'kt-dialog-content' },\n icon && (react_1.default.createElement(\"div\", { style: { color: icon.color }, className: (0, classnames_1.default)('kt-dialog-icon', (0, icon_1.getIcon)(icon.className) || getContextIcon(icon.className)) })),\n react_1.default.createElement(\"div\", { className: 'kt-dialog-content_area' },\n type !== 'basic' && title && react_1.default.createElement(\"p\", { className: 'kt-dialog-content_title' }, title),\n react_1.default.createElement(\"span\", { className: 'kt-dialog-message' }, message)),\n closable && type !== 'basic' && (react_1.default.createElement(\"button\", { className: (0, classnames_1.default)('kt-dialog-closex', (0, icon_1.getIcon)('close')), onClick: onClose }))),\n messageType !== common_1.MessageType.Empty && type !== 'basic' && (react_1.default.createElement(\"div\", { className: 'kt-dialog-buttonWrap' }, type === 'confirm' ? (buttons || react_1.default.createElement(DefaultButtons, { onCancel: onCancel, onOk: onOk, okText: okText, cancelText: cancelText })) : (react_1.default.createElement(button_1.Button, { onClick: onClose }, \"OK\"))))));\n};\nexports.DialogContent = DialogContent;\nconst Dialog = (_a) => {\n var { visible, onClose, closable, afterClose, messageType, icon, message, buttons, type = 'confirm', title, onOk, onCancel, okText, cancelText, getContainer, keyboard } = _a, restProps = tslib_1.__rest(_a, [\"visible\", \"onClose\", \"closable\", \"afterClose\", \"messageType\", \"icon\", \"message\", \"buttons\", \"type\", \"title\", \"onOk\", \"onCancel\", \"okText\", \"cancelText\", \"getContainer\", \"keyboard\"]);\n return (react_1.default.createElement(overlay_1.Overlay, Object.assign({ visible: visible, onClose: onClose, title: type === 'basic' ? title : null, closable: type === 'basic', getContainer: getContainer, keyboard: keyboard, footer: type === 'basic'\n ? buttons || react_1.default.createElement(DefaultButtons, { onCancel: onCancel, onOk: onOk, okText: okText, cancelText: cancelText })\n : undefined, afterClose: afterClose }, restProps),\n react_1.default.createElement(exports.DialogContent, Object.assign({ message: message, buttons: buttons, visible: visible }, restProps))));\n};\nexports.Dialog = Dialog;\n\n\n//# sourceURL=webpack://@opensumi/ide-components/./src/dialog/index.tsx?");
|
|
5290
5290
|
|
|
5291
5291
|
/***/ }),
|
|
5292
5292
|
|
|
@@ -5594,7 +5594,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
|
5594
5594
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5595
5595
|
|
|
5596
5596
|
"use strict";
|
|
5597
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Popover = exports.PopoverPosition = exports.PopoverTriggerType = void 0;\nconst tslib_1 = __webpack_require__(/*! tslib */ \"../../node_modules/tslib/tslib.es6.mjs\");\nconst classnames_1 = tslib_1.__importDefault(__webpack_require__(/*! classnames */ \"../../node_modules/classnames/index.js\"));\nconst rc_tooltip_1 = tslib_1.__importDefault(__webpack_require__(/*! rc-tooltip */ \"../../node_modules/rc-tooltip/es/index.js\"));\nconst react_1 = tslib_1.__importStar(__webpack_require__(/*! react */ \"../../node_modules/react/index.js\"));\n__webpack_require__(/*! ./styles.less */ \"./src/popover/styles.less\");\nconst button_1 = __webpack_require__(/*! ../button */ \"./src/button/index.tsx\");\nvar PopoverTriggerType;\n(function (PopoverTriggerType) {\n PopoverTriggerType[\"hover\"] = \"hover\";\n PopoverTriggerType[\"click\"] = \"click\";\n PopoverTriggerType[\"focus\"] = \"focus\";\n})(PopoverTriggerType = exports.PopoverTriggerType || (exports.PopoverTriggerType = {}));\nvar PopoverPosition;\n(function (PopoverPosition) {\n PopoverPosition[\"top\"] = \"top\";\n PopoverPosition[\"bottom\"] = \"bottom\";\n PopoverPosition[\"left\"] = \"left\";\n PopoverPosition[\"right\"] = \"right\";\n PopoverPosition[\"topLeft\"] = \"topLeft\";\n PopoverPosition[\"topRight\"] = \"topRight\";\n PopoverPosition[\"bottomLeft\"] = \"bottomLeft\";\n PopoverPosition[\"bottomRight\"] = \"bottomRight\";\n PopoverPosition[\"leftTop\"] = \"leftTop\";\n PopoverPosition[\"leftBottom\"] = \"leftBottom\";\n PopoverPosition[\"rightTop\"] = \"rightTop\";\n PopoverPosition[\"rightBottom\"] = \"rightBottom\";\n})(PopoverPosition = exports.PopoverPosition || (exports.PopoverPosition = {}));\nconst Popover = (_a) => {\n var { children, trigger = PopoverTriggerType.hover, visible, content, position = PopoverPosition.top, showArrow = true, title, titleClassName, overlay, overlayClassName, overlayStyle, action, delay, zIndex = 1000, onClickAction, onVisibleChange
|
|
5597
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Popover = exports.PopoverPosition = exports.PopoverTriggerType = void 0;\nconst tslib_1 = __webpack_require__(/*! tslib */ \"../../node_modules/tslib/tslib.es6.mjs\");\nconst classnames_1 = tslib_1.__importDefault(__webpack_require__(/*! classnames */ \"../../node_modules/classnames/index.js\"));\nconst rc_tooltip_1 = tslib_1.__importDefault(__webpack_require__(/*! rc-tooltip */ \"../../node_modules/rc-tooltip/es/index.js\"));\nconst react_1 = tslib_1.__importStar(__webpack_require__(/*! react */ \"../../node_modules/react/index.js\"));\n__webpack_require__(/*! ./styles.less */ \"./src/popover/styles.less\");\nconst button_1 = __webpack_require__(/*! ../button */ \"./src/button/index.tsx\");\nvar PopoverTriggerType;\n(function (PopoverTriggerType) {\n PopoverTriggerType[\"hover\"] = \"hover\";\n PopoverTriggerType[\"click\"] = \"click\";\n PopoverTriggerType[\"focus\"] = \"focus\";\n})(PopoverTriggerType = exports.PopoverTriggerType || (exports.PopoverTriggerType = {}));\nvar PopoverPosition;\n(function (PopoverPosition) {\n PopoverPosition[\"top\"] = \"top\";\n PopoverPosition[\"bottom\"] = \"bottom\";\n PopoverPosition[\"left\"] = \"left\";\n PopoverPosition[\"right\"] = \"right\";\n PopoverPosition[\"topLeft\"] = \"topLeft\";\n PopoverPosition[\"topRight\"] = \"topRight\";\n PopoverPosition[\"bottomLeft\"] = \"bottomLeft\";\n PopoverPosition[\"bottomRight\"] = \"bottomRight\";\n PopoverPosition[\"leftTop\"] = \"leftTop\";\n PopoverPosition[\"leftBottom\"] = \"leftBottom\";\n PopoverPosition[\"rightTop\"] = \"rightTop\";\n PopoverPosition[\"rightBottom\"] = \"rightBottom\";\n})(PopoverPosition = exports.PopoverPosition || (exports.PopoverPosition = {}));\nconst Popover = (_a) => {\n var { children, trigger = PopoverTriggerType.hover, visible, content, position = PopoverPosition.top, showArrow = true, title, titleClassName, overlay, overlayClassName, overlayStyle, action, delay, zIndex = 1000, onClickAction, onVisibleChange } = _a, restProps = tslib_1.__rest(_a, [\"children\", \"trigger\", \"visible\", \"content\", \"position\", \"showArrow\", \"title\", \"titleClassName\", \"overlay\", \"overlayClassName\", \"overlayStyle\", \"action\", \"delay\", \"zIndex\", \"onClickAction\", \"onVisibleChange\"]);\n const handleActionClick = (0, react_1.useCallback)((event) => {\n if (onClickAction) {\n onClickAction(event);\n }\n }, [onClickAction]);\n const overlayContent = (0, react_1.useMemo)(() => {\n if (overlay) {\n return overlay;\n }\n else {\n if (!title && !content) {\n return null;\n }\n return (react_1.default.createElement(react_1.default.Fragment, null,\n title && (react_1.default.createElement(\"p\", { className: (0, classnames_1.default)('kt-popover-title', titleClassName) },\n title,\n action && (react_1.default.createElement(button_1.Button, { size: 'small', type: 'link', onClick: handleActionClick }, action)))),\n content || ''));\n }\n }, [overlay, content, action, handleActionClick]);\n if (!overlayContent) {\n return children;\n }\n return (react_1.default.createElement(rc_tooltip_1.default, Object.assign({}, restProps, { visible: visible, placement: position, mouseEnterDelay: delay ? delay / 1000 : undefined, trigger: trigger, showArrow: showArrow, onVisibleChange: onVisibleChange, overlayClassName: overlayClassName, prefixCls: 'kt-popover', overlayStyle: overlayStyle, overlay: overlayContent, zIndex: zIndex }),\n react_1.default.createElement(\"div\", { className: 'kt-popover-trigger' }, children)));\n};\nexports.Popover = Popover;\n\n\n//# sourceURL=webpack://@opensumi/ide-components/./src/popover/index.tsx?");
|
|
5598
5598
|
|
|
5599
5599
|
/***/ }),
|
|
5600
5600
|
|
|
@@ -6626,7 +6626,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
|
6626
6626
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6627
6627
|
|
|
6628
6628
|
"use strict";
|
|
6629
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.injectSessionDataStores = exports.injectGDataStores = exports.SessionDataStore = exports.GDataStore = void 0;\nconst di_1 = __webpack_require__(/*! @opensumi/di */ \"../../node_modules/@opensumi/di/dist/index.js\");\nconst store_1 = __webpack_require__(/*! ./store */ \"../core-common/lib/remote-service/data-store/store.js\");\nconst dataStore = {\n
|
|
6629
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.injectSessionDataStores = exports.injectGDataStores = exports.SessionDataStore = exports.GDataStore = void 0;\nconst di_1 = __webpack_require__(/*! @opensumi/di */ \"../../node_modules/@opensumi/di/dist/index.js\");\nconst store_1 = __webpack_require__(/*! ./store */ \"../core-common/lib/remote-service/data-store/store.js\");\nconst dataStore = {\n global: {},\n session: {},\n};\nfunction saveToken(type, token, options) {\n if (dataStore[type][token]) {\n // 同样的 token 只能被注入一次,options 也以第一次为准\n return;\n }\n dataStore[type][token] = options;\n}\nfunction GDataStore(token, options) {\n saveToken('global', token, options);\n return (0, di_1.Autowired)(GDataStore, {\n tag: String(token),\n });\n}\nexports.GDataStore = GDataStore;\nfunction SessionDataStore(token, options) {\n saveToken('session', token, options);\n return (0, di_1.Autowired)(SessionDataStore, {\n tag: String(token),\n });\n}\nexports.SessionDataStore = SessionDataStore;\nfunction _injectDataStores(type, injector) {\n const stores = dataStore[type];\n if (stores) {\n const token = type === 'global' ? GDataStore : SessionDataStore;\n injector.addProviders(...Object.entries(stores).map(([tag, opts]) => ({\n token,\n useValue: new store_1.InMemoryDataStore(opts),\n tag,\n dropdownForTag: false,\n })));\n }\n}\nfunction injectGDataStores(injector) {\n _injectDataStores('global', injector);\n}\nexports.injectGDataStores = injectGDataStores;\nfunction injectSessionDataStores(injector) {\n _injectDataStores('session', injector);\n}\nexports.injectSessionDataStores = injectSessionDataStores;\n//# sourceMappingURL=decorators.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../core-common/lib/remote-service/data-store/decorators.js?");
|
|
6630
6630
|
|
|
6631
6631
|
/***/ }),
|
|
6632
6632
|
|
|
@@ -6659,7 +6659,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
|
6659
6659
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6660
6660
|
|
|
6661
6661
|
"use strict";
|
|
6662
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.InMemoryDataStore = void 0;\nconst tslib_1 = __webpack_require__(/*! tslib */ \"../../node_modules/tslib/tslib.es6.mjs\");\nconst extend_1 = tslib_1.__importDefault(__webpack_require__(/*! lodash/extend */ \"../../node_modules/lodash/extend.js\"));\nconst events_1 = __webpack_require__(/*! @opensumi/events */ \"../../node_modules/@opensumi/events/esm/index.js\");\nconst
|
|
6662
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.InMemoryDataStore = void 0;\nconst tslib_1 = __webpack_require__(/*! tslib */ \"../../node_modules/tslib/tslib.es6.mjs\");\nconst extend_1 = tslib_1.__importDefault(__webpack_require__(/*! lodash/extend */ \"../../node_modules/lodash/extend.js\"));\nconst events_1 = __webpack_require__(/*! @opensumi/events */ \"../../node_modules/@opensumi/events/esm/index.js\");\nconst select_1 = __webpack_require__(/*! ./select */ \"../core-common/lib/remote-service/data-store/select.js\");\nclass InMemoryDataStore extends events_1.EventEmitter {\n constructor(options) {\n super();\n this.options = options;\n this.store = new Map();\n this._uid = 0;\n this.id = (options === null || options === void 0 ? void 0 : options.id) || 'id';\n }\n create(item) {\n const id = item[this.id] || String(this._uid++);\n const result = (0, extend_1.default)({}, item, { [this.id]: id });\n this.store.set(id, result);\n this.emit('created', result);\n return result;\n }\n find(query) {\n return (0, select_1.select)(this.store, query);\n }\n size(query) {\n var _a;\n if (!query) {\n return this.store.size;\n }\n return ((_a = this.find(query)) === null || _a === void 0 ? void 0 : _a.length) || 0;\n }\n get(id) {\n return this.store.get(id);\n }\n has(id) {\n return this.store.has(id);\n }\n update(id, item) {\n const current = this.store.get(id);\n if (!current) {\n return;\n }\n const result = (0, extend_1.default)({}, current, item);\n this.emit('updated', current, result);\n this.store.set(id, result);\n }\n remove(id) {\n const item = this.store.get(id);\n if (item) {\n this.emit('removed', item);\n }\n this.store.delete(id);\n }\n}\nexports.InMemoryDataStore = InMemoryDataStore;\n//# sourceMappingURL=store.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../core-common/lib/remote-service/data-store/store.js?");
|
|
6663
6663
|
|
|
6664
6664
|
/***/ }),
|
|
6665
6665
|
|
|
@@ -6802,7 +6802,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n//#
|
|
|
6802
6802
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6803
6803
|
|
|
6804
6804
|
"use strict";
|
|
6805
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.
|
|
6805
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ChatAgentViewServiceToken = exports.ChatServiceToken = exports.IntelligentCompletionsRegistryToken = exports.TerminalRegistryToken = exports.ProblemFixRegistryToken = exports.RenameCandidatesProviderRegistryToken = exports.ResolveConflictRegistryToken = exports.ChatRenderRegistryToken = exports.ChatFeatureRegistryToken = exports.InlineChatFeatureRegistryToken = exports.CancelResponse = exports.ErrorResponse = exports.ReplyResponse = exports.AIBackSerivcePath = exports.AIBackSerivceToken = exports.ECompletionType = void 0;\nconst tslib_1 = __webpack_require__(/*! tslib */ \"../../node_modules/tslib/tslib.es6.mjs\");\ntslib_1.__exportStar(__webpack_require__(/*! ./reporter */ \"../core-common/lib/types/ai-native/reporter.js\"), exports);\nvar ECompletionType;\n(function (ECompletionType) {\n /**\n * 行补全\n */\n ECompletionType[ECompletionType[\"Line\"] = 0] = \"Line\";\n /**\n * 片段补全\n */\n ECompletionType[ECompletionType[\"Snippet\"] = 1] = \"Snippet\";\n /**\n * 块补全\n */\n ECompletionType[ECompletionType[\"Block\"] = 2] = \"Block\";\n})(ECompletionType = exports.ECompletionType || (exports.ECompletionType = {}));\nexports.AIBackSerivceToken = Symbol('AIBackSerivceToken');\nexports.AIBackSerivcePath = 'AIBackSerivcePath';\nclass ReplyResponse {\n get message() {\n return this._message;\n }\n constructor(_message) {\n this._message = _message;\n }\n static is(response) {\n return response instanceof ReplyResponse || (typeof response === 'object' && response.message !== undefined);\n }\n extractCodeContent() {\n const regex = /```\\w*([\\s\\S]+?)\\s*```/;\n const match = regex.exec(this.message);\n return match ? match[1].trim() : this.message.trim();\n }\n updateMessage(msg) {\n this._message = msg;\n }\n}\nexports.ReplyResponse = ReplyResponse;\nclass ErrorResponse {\n constructor(error, message) {\n this.error = error;\n this.message = message;\n }\n static is(response) {\n return response instanceof ErrorResponse || (typeof response === 'object' && response.error !== undefined);\n }\n}\nexports.ErrorResponse = ErrorResponse;\nclass CancelResponse {\n constructor(message) {\n this.message = message;\n this.cancellation = true;\n }\n static is(response) {\n return response instanceof CancelResponse || (typeof response === 'object' && response.cancellation !== undefined);\n }\n}\nexports.CancelResponse = CancelResponse;\n/**\n * DI Token\n */\nexports.InlineChatFeatureRegistryToken = Symbol('InlineChatFeatureRegistryToken');\nexports.ChatFeatureRegistryToken = Symbol('ChatFeatureRegistryToken');\nexports.ChatRenderRegistryToken = Symbol('ChatRenderRegistryToken');\nexports.ResolveConflictRegistryToken = Symbol('ResolveConflictRegistryToken');\nexports.RenameCandidatesProviderRegistryToken = Symbol('RenameCandidatesProviderRegistryToken');\nexports.ProblemFixRegistryToken = Symbol('ProblemFixRegistryToken');\nexports.TerminalRegistryToken = Symbol('TerminalRegistryToken');\nexports.IntelligentCompletionsRegistryToken = Symbol('IntelligentCompletionsRegistryToken');\nexports.ChatServiceToken = Symbol('ChatServiceToken');\nexports.ChatAgentViewServiceToken = Symbol('ChatAgentViewServiceToken');\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../core-common/lib/types/ai-native/index.js?");
|
|
6806
6806
|
|
|
6807
6807
|
/***/ }),
|
|
6808
6808
|
|
|
@@ -6813,7 +6813,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
|
6813
6813
|
/***/ ((__unused_webpack_module, exports) => {
|
|
6814
6814
|
|
|
6815
6815
|
"use strict";
|
|
6816
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.IAIReporter = exports.MergeConflictEditorMode = exports.ActionTypeEnum = exports.ActionSourceEnum = exports.
|
|
6816
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.IAIReporter = exports.MergeConflictEditorMode = exports.ActionTypeEnum = exports.ActionSourceEnum = exports.AISerivceType = exports.AI_REPORTER_NAME = void 0;\nexports.AI_REPORTER_NAME = 'AI';\nvar AISerivceType;\n(function (AISerivceType) {\n AISerivceType[\"Chat\"] = \"chat\";\n AISerivceType[\"InlineChat\"] = \"inlineChat\";\n AISerivceType[\"CodeAction\"] = \"codeAction\";\n AISerivceType[\"InlineChatInput\"] = \"inlineChatInput\";\n AISerivceType[\"CustomReplay\"] = \"customReplay\";\n AISerivceType[\"Completion\"] = \"completion\";\n AISerivceType[\"Agent\"] = \"agent\";\n AISerivceType[\"MergeConflict\"] = \"mergeConflict\";\n AISerivceType[\"Rename\"] = \"rename\";\n AISerivceType[\"TerminalAICommand\"] = \"terminalAICommand\";\n AISerivceType[\"ProblemFix\"] = \"problemFix\";\n})(AISerivceType = exports.AISerivceType || (exports.AISerivceType = {}));\nvar ActionSourceEnum;\n(function (ActionSourceEnum) {\n // 聊天面板\n ActionSourceEnum[\"Chat\"] = \"chat\";\n // 编辑器内联 Chat\n ActionSourceEnum[\"InlineChat\"] = \"inlineChat\";\n // 编辑器内联 ChatInput\n ActionSourceEnum[\"InlineChatInput\"] = \"inlineChatInput\";\n // 编辑器内 Action\n ActionSourceEnum[\"CodeAction\"] = \"codeAction\";\n // 终端\n ActionSourceEnum[\"Terminal\"] = \"terminal\";\n // 下拉补全 | 自动补全\n ActionSourceEnum[\"Completion\"] = \"completion\";\n // 编辑器内悬停操作\n ActionSourceEnum[\"Hover\"] = \"hover\";\n})(ActionSourceEnum = exports.ActionSourceEnum || (exports.ActionSourceEnum = {}));\nvar ActionTypeEnum;\n(function (ActionTypeEnum) {\n // 自动补全\n ActionTypeEnum[\"Completion\"] = \"completion\";\n // 下拉补全\n ActionTypeEnum[\"DropdownCompletion\"] = \"dropdownCompletion\";\n // ai重命名\n ActionTypeEnum[\"Rename\"] = \"rename\";\n // Chat面板 插入代码\n ActionTypeEnum[\"ChatInsertCode\"] = \"chatInsertCode\";\n // Chat面板 复制代码\n ActionTypeEnum[\"ChatCopyCode\"] = \"chatCopyCode\";\n // Chat面板 欢迎语的Action\n ActionTypeEnum[\"Welcome\"] = \"welcome\";\n // Chat面板 回复消息的Action\n ActionTypeEnum[\"Followup\"] = \"followup\";\n // 发送消息\n ActionTypeEnum[\"Send\"] = \"send\";\n // 生成代码后的行动点:全部采纳\n ActionTypeEnum[\"Accept\"] = \"accept\";\n // 生成代码后的行动点:单模块采纳\n ActionTypeEnum[\"lineAccept\"] = \"lineAccept\";\n // 生成代码后的行动点:全部拒绝\n ActionTypeEnum[\"Discard\"] = \"discard\";\n // 生成代码后的行动点:全部拒绝\n ActionTypeEnum[\"LineDiscard\"] = \"lineDiscard\";\n // 生成代码后的行动点:重新生成\n ActionTypeEnum[\"Regenerate\"] = \"regenerate\";\n // 悬停的问题修复\n ActionTypeEnum[\"HoverFix\"] = \"hoverFix\";\n // 包含业务自定义的Action\n})(ActionTypeEnum = exports.ActionTypeEnum || (exports.ActionTypeEnum = {}));\nvar MergeConflictEditorMode;\n(function (MergeConflictEditorMode) {\n MergeConflictEditorMode[\"3way\"] = \"3way\";\n MergeConflictEditorMode[\"traditional\"] = \"traditional\";\n})(MergeConflictEditorMode = exports.MergeConflictEditorMode || (exports.MergeConflictEditorMode = {}));\nexports.IAIReporter = Symbol('IAIReporter');\n//# sourceMappingURL=reporter.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../core-common/lib/types/ai-native/reporter.js?");
|
|
6817
6817
|
|
|
6818
6818
|
/***/ }),
|
|
6819
6819
|
|
|
@@ -7077,7 +7077,7 @@ eval("\n/* ---------------------------------------------------------------------
|
|
|
7077
7077
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7078
7078
|
|
|
7079
7079
|
"use strict";
|
|
7080
|
-
eval("\n/* ---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n// Some code copied and modified from https://github.com/microsoft/vscode/blob/1.
|
|
7080
|
+
eval("\n/* ---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n// Some code copied and modified from https://github.com/microsoft/vscode/blob/1.44.0/src/vs/base/common/cancellation.ts\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.CancellationTokenSource = exports.CancellationToken = void 0;\nconst event_1 = __webpack_require__(/*! ./event */ \"../utils/lib/event.js\");\nconst shortcutEvent = Object.freeze(function (callback, context) {\n const handle = setTimeout(callback.bind(context), 0);\n return {\n dispose() {\n clearTimeout(handle);\n },\n };\n});\nvar CancellationToken;\n(function (CancellationToken) {\n function isCancellationToken(thing) {\n if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) {\n return true;\n }\n if (thing instanceof MutableToken) {\n return true;\n }\n if (!thing || typeof thing !== 'object') {\n return false;\n }\n return (typeof thing.isCancellationRequested === 'boolean' &&\n typeof thing.onCancellationRequested === 'function');\n }\n CancellationToken.isCancellationToken = isCancellationToken;\n function resolveIfCancelled(token, value) {\n return new Promise((resolve) => {\n const listener = token.onCancellationRequested(() => {\n listener.dispose();\n resolve(value);\n });\n });\n }\n CancellationToken.resolveIfCancelled = resolveIfCancelled;\n CancellationToken.None = Object.freeze({\n isCancellationRequested: false,\n onCancellationRequested: event_1.Event.None,\n });\n CancellationToken.Cancelled = Object.freeze({\n isCancellationRequested: true,\n onCancellationRequested: shortcutEvent,\n });\n})(CancellationToken = exports.CancellationToken || (exports.CancellationToken = {}));\nclass MutableToken {\n constructor() {\n this._isCancelled = false;\n this._emitter = null;\n }\n cancel() {\n if (!this._isCancelled) {\n this._isCancelled = true;\n if (this._emitter) {\n this._emitter.fire(undefined);\n this.dispose();\n }\n }\n }\n get isCancellationRequested() {\n return this._isCancelled;\n }\n get onCancellationRequested() {\n if (this._isCancelled) {\n return shortcutEvent;\n }\n if (!this._emitter) {\n this._emitter = new event_1.Emitter();\n }\n return this._emitter.event;\n }\n dispose() {\n if (this._emitter) {\n this._emitter.dispose();\n this._emitter = null;\n }\n }\n}\nclass CancellationTokenSource {\n constructor(parent) {\n this._token = undefined;\n this._parentListener = undefined;\n this._parentListener = parent && parent.onCancellationRequested(this.cancel, this);\n }\n get token() {\n if (!this._token) {\n // be lazy and create the token only when\n // actually needed\n this._token = new MutableToken();\n }\n return this._token;\n }\n cancel() {\n if (!this._token) {\n // save an object by returning the default\n // cancelled token when cancellation happens\n // before someone asks for the token\n this._token = CancellationToken.Cancelled;\n }\n else if (this._token instanceof MutableToken) {\n // actually cancel\n this._token.cancel();\n }\n }\n dispose(cancel = false) {\n if (cancel) {\n this.cancel();\n }\n if (this._parentListener) {\n this._parentListener.dispose();\n }\n if (!this._token) {\n // ensure to initialize with an empty token if we had none\n this._token = CancellationToken.None;\n }\n else if (this._token instanceof MutableToken) {\n // actually dispose\n this._token.dispose();\n }\n }\n}\nexports.CancellationTokenSource = CancellationTokenSource;\n//# sourceMappingURL=cancellation.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../utils/lib/cancellation.js?");
|
|
7081
7081
|
|
|
7082
7082
|
/***/ }),
|
|
7083
7083
|
|
|
@@ -7154,7 +7154,7 @@ eval("\n/* ---------------------------------------------------------------------
|
|
|
7154
7154
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7155
7155
|
|
|
7156
7156
|
"use strict";
|
|
7157
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.DisposableMap = exports.RefCountedDisposable = exports.MutableDisposable = exports.DisposableCollection = exports.Disposable = exports.toDisposable = exports.combinedDisposable = exports.dispose = exports.isDisposable = exports.DisposableStore = void 0;\nconst event_1 = __webpack_require__(/*! ./event */ \"../utils/lib/event.js\");\nclass DisposableStore {\n constructor() {\n this.toDispose = new Set();\n this._isDisposed = false;\n }\n /**\n * Dispose of all registered disposables and mark this object as disposed.\n *\n * Any future disposables added to this object will be disposed of on `add`.\n */\n dispose() {\n if (this._isDisposed) {\n return;\n }\n markTracked(this);\n this._isDisposed = true;\n this.clear();\n }\n /**\n * Dispose of all registered disposables but do not mark this object as disposed.\n */\n clear() {\n this.toDispose.forEach((item) => item.dispose());\n this.toDispose.clear();\n }\n add(t) {\n if (!t) {\n return t;\n }\n if (t === this) {\n throw new Error('Cannot register a disposable on itself!');\n }\n markTracked(t);\n if (this._isDisposed) {\n // eslint-disable-next-line no-console\n console.warn(new Error('Registering disposable on object that has already been disposed of').stack);\n t.dispose();\n }\n else {\n this.toDispose.add(t);\n }\n return t;\n }\n addAll(disposables) {\n for (const item of disposables) {\n this.add(item);\n }\n }\n}\nexports.DisposableStore = DisposableStore;\nfunction isDisposable(thing) {\n return typeof thing.dispose === 'function' && thing.dispose.length === 0;\n}\nexports.isDisposable = isDisposable;\nfunction dispose(first, ...rest) {\n if (Array.isArray(first)) {\n first.forEach((d) => {\n if (d) {\n markTracked(d);\n d.dispose();\n }\n });\n return [];\n }\n else if (rest.length === 0) {\n if (first) {\n markTracked(first);\n first.dispose();\n return first;\n }\n return undefined;\n }\n else {\n dispose(first);\n dispose(rest);\n return [];\n }\n}\nexports.dispose = dispose;\nfunction combinedDisposable(disposables) {\n disposables.forEach(markTracked);\n return trackDisposable({ dispose: () => dispose(disposables) });\n}\nexports.combinedDisposable = combinedDisposable;\nfunction toDisposable(fn) {\n return {\n dispose() {\n fn();\n },\n };\n}\nexports.toDisposable = toDisposable;\nclass Disposable {\n constructor(...toDispose) {\n this.disposables = [];\n this.onDisposeEmitter = new event_1.Emitter();\n this.disposingElements = false;\n toDispose.forEach((d) => this.addDispose(d));\n }\n static create(func) {\n return {\n dispose: func,\n };\n }\n get onDispose() {\n return this.onDisposeEmitter.event;\n }\n checkDisposed() {\n if (this.disposed && !this.disposingElements) {\n this.onDisposeEmitter.fire(undefined);\n }\n }\n get disposed() {\n return this.disposables.length === 0;\n }\n dispose() {\n if (this.disposed || this.disposingElements) {\n return;\n }\n this.disposingElements = true;\n while (!this.disposed) {\n try {\n this.disposables.pop().dispose();\n }\n catch (e) {\n // eslint-disable-next-line no-console\n console.error(e);\n }\n }\n this.disposingElements = false;\n this.checkDisposed();\n }\n addDispose(disposable) {\n if (Array.isArray(disposable)) {\n const disposables = disposable;\n return disposables.map((disposable) => this.addDispose(disposable));\n }\n else {\n return this.add(disposable);\n }\n }\n registerDispose(disposable) {\n if (disposable === this) {\n throw new Error('Cannot register a disposable on itself!');\n }\n this.add(disposable);\n return disposable;\n }\n add(disposable) {\n const disposables = this.disposables;\n disposables.push(disposable);\n const originalDispose = disposable.dispose.bind(disposable);\n const toRemove = Disposable.create(() => {\n const index = disposables.indexOf(disposable);\n if (index !== -1) {\n disposables.splice(index, 1);\n }\n this.checkDisposed();\n });\n disposable.dispose = () => {\n toRemove.dispose();\n originalDispose();\n };\n return toRemove;\n }\n}\nexports.Disposable = Disposable;\nDisposable.NULL = Disposable.create(() => { });\nDisposable.None = Object.freeze({ dispose() { } });\nclass DisposableCollection {\n constructor(...toDispose) {\n this.disposables = [];\n this.onDisposeEmitter = new event_1.Emitter();\n this.disposingElements = false;\n toDispose.forEach((d) => this.push(d));\n }\n get onDispose() {\n return this.onDisposeEmitter.event;\n }\n checkDisposed() {\n if (this.disposed && !this.disposingElements) {\n this.onDisposeEmitter.fire(undefined);\n }\n }\n get disposed() {\n return this.disposables.length === 0;\n }\n dispose() {\n if (this.disposed || this.disposingElements) {\n return;\n }\n const toPromise = [];\n this.disposingElements = true;\n while (!this.disposed) {\n try {\n const maybePromise = this.disposables.pop().dispose();\n if (maybePromise) {\n toPromise.push(maybePromise);\n }\n }\n catch (e) {\n // eslint-disable-next-line no-console\n console.error('DisposableCollection.dispose error', e);\n }\n }\n this.disposingElements = false;\n this.checkDisposed();\n return Promise.all(toPromise);\n }\n push(disposable) {\n const disposables = this.disposables;\n disposables.push(disposable);\n const originalDispose = disposable.dispose.bind(disposable);\n const toRemove = Disposable.create(() => {\n const index = disposables.indexOf(disposable);\n if (index !== -1) {\n disposables.splice(index, 1);\n }\n this.checkDisposed();\n });\n disposable.dispose = () => {\n toRemove.dispose();\n originalDispose();\n };\n return toRemove;\n }\n pushAll(disposables) {\n return disposables.map((disposable) => this.push(disposable));\n }\n}\nexports.DisposableCollection = DisposableCollection;\n/**\n * Enables logging of potentially leaked disposables.\n *\n * A disposable is considered leaked if it is not disposed or not registered as the child of\n * another disposable. This tracking is very simple an only works for classes that either\n * extend Disposable or use a DisposableStore. This means there are a lot of false positives.\n */\nconst TRACK_DISPOSABLES = false;\nconst __is_disposable_tracked__ = '__is_disposable_tracked__';\nfunction markTracked(x) {\n if (!TRACK_DISPOSABLES) {\n return;\n }\n if (x && x !== Disposable.None) {\n try {\n x[__is_disposable_tracked__] = true;\n }\n catch (_e) {\n // noop\n }\n }\n}\nfunction trackDisposable(x) {\n if (!TRACK_DISPOSABLES) {\n return x;\n }\n const stack = new Error('Potentially leaked disposable').stack;\n setTimeout(() => {\n if (!x[__is_disposable_tracked__]) {\n // eslint-disable-next-line no-console\n console.log(stack);\n }\n }, 3000);\n return x;\n}\n/**\n * Manages the lifecycle of a disposable value that may be changed.\n *\n * This ensures that when the the disposable value is changed, the previously held disposable is disposed of. You can\n * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.\n */\nclass MutableDisposable {\n constructor() {\n this._isDisposed = false;\n trackDisposable(this);\n }\n get value() {\n return this._isDisposed ? undefined : this._value;\n }\n set value(value) {\n if (this._isDisposed || value === this._value) {\n return;\n }\n if (this._value) {\n this._value.dispose();\n }\n if (value) {\n markTracked(value);\n }\n this._value = value;\n }\n clear() {\n this.value = undefined;\n }\n dispose() {\n this._isDisposed = true;\n markTracked(this);\n if (this._value) {\n this._value.dispose();\n }\n this._value = undefined;\n }\n}\nexports.MutableDisposable = MutableDisposable;\nclass RefCountedDisposable {\n constructor(_disposable) {\n this._disposable = _disposable;\n this._counter = 1;\n }\n get disposed() {\n return this._counter <= 0;\n }\n acquire() {\n this._counter++;\n return this;\n }\n release() {\n if (--this._counter === 0) {\n this._disposable.dispose();\n }\n return this;\n }\n}\nexports.RefCountedDisposable = RefCountedDisposable;\nclass DisposableMap extends Map {\n disposeKey(key) {\n const disposable = this.get(key);\n if (disposable) {\n disposable.dispose();\n }\n this.delete(key);\n }\n dispose() {\n for (const disposable of this.values()) {\n disposable.dispose();\n }\n this.clear();\n }\n}\nexports.DisposableMap = DisposableMap;\n//# sourceMappingURL=disposable.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../utils/lib/disposable.js?");
|
|
7157
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.DisposableMap = exports.RefCountedDisposable = exports.MutableDisposable = exports.DisposableCollection = exports.Disposable = exports.toDisposable = exports.combinedDisposable = exports.dispose = exports.isDisposable = exports.DisposableStore = void 0;\nconst event_1 = __webpack_require__(/*! ./event */ \"../utils/lib/event.js\");\nclass DisposableStore {\n constructor() {\n this.toDispose = new Set();\n this._isDisposed = false;\n }\n /**\n * Dispose of all registered disposables and mark this object as disposed.\n *\n * Any future disposables added to this object will be disposed of on `add`.\n */\n dispose() {\n if (this._isDisposed) {\n return;\n }\n markTracked(this);\n this._isDisposed = true;\n this.clear();\n }\n /**\n * Dispose of all registered disposables but do not mark this object as disposed.\n */\n clear() {\n this.toDispose.forEach((item) => item.dispose());\n this.toDispose.clear();\n }\n add(t) {\n if (!t) {\n return t;\n }\n if (t === this) {\n throw new Error('Cannot register a disposable on itself!');\n }\n markTracked(t);\n if (this._isDisposed) {\n // eslint-disable-next-line no-console\n console.warn(new Error('Registering disposable on object that has already been disposed of').stack);\n t.dispose();\n }\n else {\n this.toDispose.add(t);\n }\n return t;\n }\n addAll(disposables) {\n for (const item of disposables) {\n this.add(item);\n }\n }\n}\nexports.DisposableStore = DisposableStore;\nfunction isDisposable(thing) {\n return typeof thing.dispose === 'function' && thing.dispose.length === 0;\n}\nexports.isDisposable = isDisposable;\nfunction dispose(first, ...rest) {\n if (Array.isArray(first)) {\n first.forEach((d) => {\n if (d) {\n markTracked(d);\n d.dispose();\n }\n });\n return [];\n }\n else if (rest.length === 0) {\n if (first) {\n markTracked(first);\n first.dispose();\n return first;\n }\n return undefined;\n }\n else {\n dispose(first);\n dispose(rest);\n return [];\n }\n}\nexports.dispose = dispose;\nfunction combinedDisposable(disposables) {\n disposables.forEach(markTracked);\n return trackDisposable({ dispose: () => dispose(disposables) });\n}\nexports.combinedDisposable = combinedDisposable;\nfunction toDisposable(fn) {\n return {\n dispose() {\n fn();\n },\n };\n}\nexports.toDisposable = toDisposable;\nclass Disposable {\n constructor(...toDispose) {\n this.disposables = [];\n this.onDisposeEmitter = new event_1.Emitter();\n this.disposingElements = false;\n toDispose.forEach((d) => this.addDispose(d));\n }\n static create(func) {\n return {\n dispose: func,\n };\n }\n get onDispose() {\n return this.onDisposeEmitter.event;\n }\n checkDisposed() {\n if (this.disposed && !this.disposingElements) {\n this.onDisposeEmitter.fire(undefined);\n }\n }\n get disposed() {\n return this.disposables.length === 0;\n }\n dispose() {\n if (this.disposed || this.disposingElements) {\n return;\n }\n this.disposingElements = true;\n while (!this.disposed) {\n try {\n this.disposables.pop().dispose();\n }\n catch (e) {\n // eslint-disable-next-line no-console\n console.error(e);\n }\n }\n this.disposingElements = false;\n this.checkDisposed();\n }\n addDispose(disposable) {\n if (Array.isArray(disposable)) {\n const disposables = disposable;\n return disposables.map((disposable) => this.addDispose(disposable));\n }\n else {\n return this.add(disposable);\n }\n }\n registerDispose(disposable) {\n if (disposable === this) {\n throw new Error('Cannot register a disposable on itself!');\n }\n this.add(disposable);\n return disposable;\n }\n add(disposable) {\n const disposables = this.disposables;\n disposables.push(disposable);\n const originalDispose = disposable.dispose.bind(disposable);\n const toRemove = Disposable.create(() => {\n const index = disposables.indexOf(disposable);\n if (index !== -1) {\n disposables.splice(index, 1);\n }\n this.checkDisposed();\n });\n disposable.dispose = () => {\n toRemove.dispose();\n originalDispose();\n };\n return toRemove;\n }\n}\nexports.Disposable = Disposable;\nDisposable.NULL = Disposable.create(() => { });\nDisposable.None = Object.freeze({ dispose() { } });\nclass DisposableCollection {\n constructor(...toDispose) {\n this.disposables = [];\n this.onDisposeEmitter = new event_1.Emitter();\n this.disposingElements = false;\n toDispose.forEach((d) => this.push(d));\n }\n get onDispose() {\n return this.onDisposeEmitter.event;\n }\n checkDisposed() {\n if (this.disposed && !this.disposingElements) {\n this.onDisposeEmitter.fire(undefined);\n }\n }\n get disposed() {\n return this.disposables.length === 0;\n }\n dispose() {\n if (this.disposed || this.disposingElements) {\n return;\n }\n const toPromise = [];\n this.disposingElements = true;\n while (!this.disposed) {\n try {\n const maybePromise = this.disposables.pop().dispose();\n if (maybePromise) {\n toPromise.push(maybePromise);\n }\n }\n catch (e) {\n // eslint-disable-next-line no-console\n console.error('DisposableCollection.dispose error', e);\n }\n }\n this.disposingElements = false;\n this.checkDisposed();\n return Promise.all(toPromise);\n }\n push(disposable) {\n const disposables = this.disposables;\n disposables.push(disposable);\n const originalDispose = disposable.dispose.bind(disposable);\n const toRemove = Disposable.create(() => {\n const index = disposables.indexOf(disposable);\n if (index !== -1) {\n disposables.splice(index, 1);\n }\n this.checkDisposed();\n });\n disposable.dispose = () => {\n toRemove.dispose();\n originalDispose();\n };\n return toRemove;\n }\n pushAll(disposables) {\n return disposables.map((disposable) => this.push(disposable));\n }\n}\nexports.DisposableCollection = DisposableCollection;\n/**\n * Enables logging of potentially leaked disposables.\n *\n * A disposable is considered leaked if it is not disposed or not registered as the child of\n * another disposable. This tracking is very simple an only works for classes that either\n * extend Disposable or use a DisposableStore. This means there are a lot of false positives.\n */\nconst TRACK_DISPOSABLES = false;\nconst __is_disposable_tracked__ = '__is_disposable_tracked__';\nfunction markTracked(x) {\n if (!TRACK_DISPOSABLES) {\n return;\n }\n if (x && x !== Disposable.None) {\n try {\n x[__is_disposable_tracked__] = true;\n }\n catch (_e) {\n // noop\n }\n }\n}\nfunction trackDisposable(x) {\n if (!TRACK_DISPOSABLES) {\n return x;\n }\n const stack = new Error('Potentially leaked disposable').stack;\n setTimeout(() => {\n if (!x[__is_disposable_tracked__]) {\n // eslint-disable-next-line no-console\n console.log(stack);\n }\n }, 3000);\n return x;\n}\n/**\n * Manages the lifecycle of a disposable value that may be changed.\n *\n * This ensures that when the the disposable value is changed, the previously held disposable is disposed of. You can\n * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.\n */\nclass MutableDisposable {\n constructor() {\n this._isDisposed = false;\n trackDisposable(this);\n }\n get value() {\n return this._isDisposed ? undefined : this._value;\n }\n set value(value) {\n if (this._isDisposed || value === this._value) {\n return;\n }\n if (this._value) {\n this._value.dispose();\n }\n if (value) {\n markTracked(value);\n }\n this._value = value;\n }\n clear() {\n this.value = undefined;\n }\n dispose() {\n this._isDisposed = true;\n markTracked(this);\n if (this._value) {\n this._value.dispose();\n }\n this._value = undefined;\n }\n}\nexports.MutableDisposable = MutableDisposable;\nclass RefCountedDisposable {\n constructor(_disposable) {\n this._disposable = _disposable;\n this._counter = 1;\n }\n acquire() {\n this._counter++;\n return this;\n }\n release() {\n if (--this._counter === 0) {\n this._disposable.dispose();\n }\n return this;\n }\n}\nexports.RefCountedDisposable = RefCountedDisposable;\nclass DisposableMap extends Map {\n disposeKey(key) {\n const disposable = this.get(key);\n if (disposable) {\n disposable.dispose();\n }\n this.delete(key);\n }\n dispose() {\n for (const disposable of this.values()) {\n disposable.dispose();\n }\n this.clear();\n }\n}\nexports.DisposableMap = DisposableMap;\n//# sourceMappingURL=disposable.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../utils/lib/disposable.js?");
|
|
7158
7158
|
|
|
7159
7159
|
/***/ }),
|
|
7160
7160
|
|
|
@@ -7187,7 +7187,7 @@ eval("\n/* ---------------------------------------------------------------------
|
|
|
7187
7187
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7188
7188
|
|
|
7189
7189
|
"use strict";
|
|
7190
|
-
eval("\n/* ---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n// Some code copied and modified from https://github.com/microsoft/vscode/blob/1.44.0/src/vs/base/common/event.ts\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.EventQueue = exports.Dispatcher = exports.ReadyEvent = exports.Relay = exports.EventBufferer = exports.EventMultiplexer = exports.AsyncEmitter = exports.WaitUntilEvent = exports.PauseableEmitter = exports.Emitter = exports.setGlobalLeakWarningThreshold = exports.Event = void 0;\nconst disposable_1 = __webpack_require__(/*! ./disposable */ \"../utils/lib/disposable.js\");\nconst errors_1 = __webpack_require__(/*! ./errors */ \"../utils/lib/errors.js\");\nconst functional_1 = __webpack_require__(/*! ./functional */ \"../utils/lib/functional.js\");\nconst linked_list_1 = __webpack_require__(/*! ./linked-list */ \"../utils/lib/linked-list.js\");\nconst uuid_1 = __webpack_require__(/*! ./uuid */ \"../utils/lib/uuid.js\");\nvar Event;\n(function (Event) {\n const _disposable = { dispose() { } };\n Event.None = function () {\n return _disposable;\n };\n /**\n * Given an event, returns another event which only fires once.\n */\n function once(event) {\n return (listener, thisArgs = null, disposables) => {\n // we need this, in case the event fires during the listener call\n let didFire = false;\n const result = event((e) => {\n if (didFire) {\n return;\n }\n else if (result) {\n result.dispose();\n }\n else {\n didFire = true;\n }\n return listener.call(thisArgs, e);\n }, null, disposables);\n if (didFire) {\n result.dispose();\n }\n return result;\n };\n }\n Event.once = once;\n /**\n * Given an event and a `map` function, returns another event which maps each element\n * throught the mapping function.\n */\n function map(event, map) {\n return snapshot((listener, thisArgs = null, disposables) => event((i) => listener.call(thisArgs, map(i)), null, disposables));\n }\n Event.map = map;\n /**\n * Given an event and an `each` function, returns another identical event and calls\n * the `each` function per each element.\n */\n function forEach(event, each) {\n return snapshot((listener, thisArgs = null, disposables) => event((i) => {\n each(i);\n listener.call(thisArgs, i);\n }, null, disposables));\n }\n Event.forEach = forEach;\n function filter(event, filter) {\n return snapshot((listener, thisArgs = null, disposables) => event((e) => filter(e) && listener.call(thisArgs, e), null, disposables));\n }\n Event.filter = filter;\n /**\n * Given an event, returns the same event but typed as `Event<void>`.\n */\n function signal(event) {\n return event;\n }\n Event.signal = signal;\n /**\n * Given a collection of events, returns a single event which emits\n * whenever any of the provided events emit.\n */\n function any(...events) {\n return (listener, thisArgs = null, disposables) => (0, disposable_1.combinedDisposable)(events.map((event) => event((e) => listener.call(thisArgs, e), null, disposables)));\n }\n Event.any = any;\n /**\n * Given an event and a `merge` function, returns another event which maps each element\n * and the cummulative result throught the `merge` function. Similar to `map`, but with memory.\n */\n function reduce(event, merge, initial) {\n let output = initial;\n return map(event, (e) => {\n output = merge(output, e);\n return output;\n });\n }\n Event.reduce = reduce;\n /**\n * Given a chain of event processing functions (filter, map, etc), each\n * function will be invoked per event & per listener. Snapshotting an event\n * chain allows each function to be invoked just once per event.\n */\n function snapshot(event) {\n let listener;\n const emitter = new Emitter({\n onFirstListenerAdd() {\n listener = event(emitter.fire, emitter);\n },\n onLastListenerRemove() {\n listener.dispose();\n },\n });\n return emitter.event;\n }\n Event.snapshot = snapshot;\n function debounce(event, merge, delay = 100, leading = false, leakWarningThreshold) {\n let subscription;\n let output;\n let handle;\n let numDebouncedCalls = 0;\n const emitter = new Emitter({\n leakWarningThreshold,\n onFirstListenerAdd() {\n subscription = event((cur) => {\n numDebouncedCalls++;\n output = merge(output, cur);\n if (leading && !handle) {\n emitter.fire(output);\n }\n clearTimeout(handle);\n handle = setTimeout(() => {\n const _output = output;\n output = undefined;\n handle = undefined;\n if (!leading || numDebouncedCalls > 1) {\n emitter.fire(_output);\n }\n numDebouncedCalls = 0;\n }, delay);\n });\n },\n onLastListenerRemove() {\n subscription.dispose();\n },\n });\n return emitter.event;\n }\n Event.debounce = debounce;\n /**\n * Given an event, it returns another event which fires only once and as soon as\n * the input event emits. The event data is the number of millis it took for the\n * event to fire.\n */\n function stopwatch(event) {\n const start = new Date().getTime();\n return map(once(event), (_) => new Date().getTime() - start);\n }\n Event.stopwatch = stopwatch;\n /**\n * Given an event, it returns another event which fires only when the event\n * element changes.\n */\n function latch(event) {\n let firstCall = true;\n let cache;\n return filter(event, (value) => {\n const shouldEmit = firstCall || value !== cache;\n firstCall = false;\n cache = value;\n return shouldEmit;\n });\n }\n Event.latch = latch;\n /**\n * Buffers the provided event until a first listener comes\n * along, at which point fire all the events at once and\n * pipe the event from then on.\n *\n * ```typescript\n * const emitter = new Emitter<number>();\n * const event = emitter.event;\n * const bufferedEvent = buffer(event);\n *\n * emitter.fire(1);\n * emitter.fire(2);\n * emitter.fire(3);\n * // nothing...\n *\n * const listener = bufferedEvent(num => console.log(num));\n * // 1, 2, 3\n *\n * emitter.fire(4);\n * // 4\n * ```\n */\n function buffer(event, nextTick = false, _buffer = []) {\n let buffer = _buffer.slice();\n let listener = event((e) => {\n if (buffer) {\n buffer.push(e);\n }\n else {\n emitter.fire(e);\n }\n });\n const flush = () => {\n if (buffer) {\n buffer.forEach((e) => emitter.fire(e));\n }\n buffer = null;\n };\n const emitter = new Emitter({\n onFirstListenerAdd() {\n if (!listener) {\n listener = event((e) => emitter.fire(e));\n }\n },\n onFirstListenerDidAdd() {\n if (buffer) {\n if (nextTick) {\n setTimeout(flush);\n }\n else {\n flush();\n }\n }\n },\n onLastListenerRemove() {\n if (listener) {\n listener.dispose();\n }\n listener = null;\n },\n });\n return emitter.event;\n }\n Event.buffer = buffer;\n class ChainableEvent {\n constructor(event) {\n this.event = event;\n }\n map(fn) {\n return new ChainableEvent(map(this.event, fn));\n }\n forEach(fn) {\n return new ChainableEvent(forEach(this.event, fn));\n }\n filter(fn) {\n return new ChainableEvent(filter(this.event, fn));\n }\n reduce(merge, initial) {\n return new ChainableEvent(reduce(this.event, merge, initial));\n }\n latch() {\n return new ChainableEvent(latch(this.event));\n }\n on(listener, thisArgs, disposables) {\n return this.event(listener, thisArgs, disposables);\n }\n once(listener, thisArgs, disposables) {\n return once(this.event)(listener, thisArgs, disposables);\n }\n }\n function chain(event) {\n return new ChainableEvent(event);\n }\n Event.chain = chain;\n function fromNodeEventEmitter(emitter, eventName, map = (id) => id) {\n const fn = (...args) => result.fire(map(...args));\n const onFirstListenerAdd = () => emitter.on(eventName, fn);\n const onLastListenerRemove = () => emitter.removeListener(eventName, fn);\n const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove });\n return result.event;\n }\n Event.fromNodeEventEmitter = fromNodeEventEmitter;\n function fromPromise(promise) {\n const emitter = new Emitter();\n let shouldEmit = false;\n promise\n .then(undefined, () => null)\n .then(() => {\n if (!shouldEmit) {\n setTimeout(() => emitter.fire(undefined), 0);\n }\n else {\n emitter.fire(undefined);\n }\n });\n shouldEmit = true;\n return emitter.event;\n }\n Event.fromPromise = fromPromise;\n function toPromise(event) {\n return new Promise((c) => once(event)(c));\n }\n Event.toPromise = toPromise;\n})(Event = exports.Event || (exports.Event = {}));\nlet _globalLeakWarningThreshold = -1;\nfunction setGlobalLeakWarningThreshold(n) {\n const oldValue = _globalLeakWarningThreshold;\n _globalLeakWarningThreshold = n;\n return {\n dispose() {\n _globalLeakWarningThreshold = oldValue;\n },\n };\n}\nexports.setGlobalLeakWarningThreshold = setGlobalLeakWarningThreshold;\nclass LeakageMonitor {\n constructor(customThreshold, name = (0, uuid_1.randomString)(3)) {\n this.customThreshold = customThreshold;\n this.name = name;\n this._warnCountdown = 0;\n }\n dispose() {\n if (this._stacks) {\n this._stacks.clear();\n }\n }\n check(listenerCount) {\n let threshold = _globalLeakWarningThreshold;\n if (typeof this.customThreshold === 'number') {\n threshold = this.customThreshold;\n }\n if (threshold <= 0 || listenerCount < threshold) {\n return undefined;\n }\n if (!this._stacks) {\n this._stacks = new Map();\n }\n const stack = new Error().stack.split('\\n').slice(3).join('\\n');\n const count = this._stacks.get(stack) || 0;\n this._stacks.set(stack, count + 1);\n this._warnCountdown -= 1;\n if (this._warnCountdown <= 0) {\n // only warn on first exceed and then every time the limit\n // is exceeded by 50% again\n this._warnCountdown = threshold * 0.5;\n // find most frequent listener and print warning\n let topStack = '';\n let topCount = 0;\n this._stacks.forEach((count, stack) => {\n if (!topStack || topCount < count) {\n topStack = stack;\n topCount = count;\n }\n });\n // eslint-disable-next-line no-console\n console.warn(`[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`);\n // eslint-disable-next-line no-console\n console.warn(topStack);\n }\n return () => {\n const count = this._stacks.get(stack) || 0;\n this._stacks.set(stack, count - 1);\n };\n }\n}\nclass Emitter {\n constructor(options) {\n this._disposed = false;\n this._options = options;\n this._leakageMon =\n _globalLeakWarningThreshold > 0\n ? new LeakageMonitor(this._options && this._options.leakWarningThreshold)\n : undefined;\n }\n /**\n * For the public to allow to subscribe\n * to events from this Emitter\n */\n get event() {\n if (!this._event) {\n this._event = (listener, thisArgs, disposables) => {\n if (!this._listeners) {\n this._listeners = new linked_list_1.LinkedList();\n }\n const firstListener = this._listeners.isEmpty();\n if (firstListener && this._options && this._options.onFirstListenerAdd) {\n this._options.onFirstListenerAdd(this);\n }\n const remove = this._listeners.push(!thisArgs ? listener : [listener, thisArgs]);\n if (firstListener && this._options && this._options.onFirstListenerDidAdd) {\n this._options.onFirstListenerDidAdd(this);\n }\n if (this._options && this._options.onListenerDidAdd) {\n this._options.onListenerDidAdd(this, listener, thisArgs);\n }\n // check and record this emitter for potential leakage\n let removeMonitor;\n if (this._leakageMon) {\n removeMonitor = this._leakageMon.check(this._listeners.size);\n }\n let result;\n result = {\n dispose: () => {\n if (removeMonitor) {\n removeMonitor();\n }\n result.dispose = Emitter._noop;\n if (!this._disposed) {\n remove();\n if (this._options && this._options.onLastListenerRemove) {\n const hasListeners = this._listeners && !this._listeners.isEmpty();\n if (!hasListeners) {\n this._options.onLastListenerRemove(this);\n }\n }\n }\n },\n };\n if (disposables instanceof disposable_1.DisposableStore) {\n disposables.add(result);\n }\n else if (Array.isArray(disposables)) {\n disposables.push(result);\n }\n return result;\n };\n }\n return this._event;\n }\n /**\n * To be kept private to fire an event to\n * subscribers\n */\n fire(event) {\n if (this._listeners) {\n // put all [listener,event]-pairs into delivery queue\n // then emit all event. an inner/nested event might be\n // the driver of this\n if (!this._deliveryQueue) {\n this._deliveryQueue = new linked_list_1.LinkedList();\n }\n for (let iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) {\n this._deliveryQueue.push([e.value, event]);\n }\n while (this._deliveryQueue.size > 0) {\n const [listener, event] = this._deliveryQueue.shift();\n try {\n if (typeof listener === 'function') {\n listener.call(undefined, event);\n }\n else {\n listener[0].call(listener[1], event);\n }\n }\n catch (e) {\n (0, errors_1.onUnexpectedError)(e);\n }\n }\n }\n }\n /**\n * 发送一个异步事件,等待所有监听器返回,并收集返回值\n * @param e\n * @param timeout\n */\n async fireAndAwait(event, timeout = 2000) {\n if (this._listeners) {\n if (!this._deliveryQueue) {\n this._deliveryQueue = new linked_list_1.LinkedList();\n }\n for (let iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) {\n this._deliveryQueue.push([e.value, event]);\n }\n const promises = [];\n const timeoutPromise = new Promise((resolve) => {\n setTimeout(() => {\n resolve({\n err: new Error('timeout'),\n });\n }, timeout);\n });\n while (this._deliveryQueue.size > 0) {\n const [listener, event] = this._deliveryQueue.shift();\n try {\n const promise = (async () => {\n try {\n if (typeof listener === 'function') {\n return {\n result: (await listener.call(undefined, event)),\n };\n }\n else {\n return {\n result: (await listener[0].call(listener[1], event)),\n };\n }\n }\n catch (e) {\n return {\n err: e,\n };\n }\n })();\n promises.push(Promise.race([timeoutPromise, promise]));\n }\n catch (e) {\n (0, errors_1.onUnexpectedError)(e);\n }\n }\n return Promise.all(promises);\n }\n else {\n return [];\n }\n }\n get listenerSize() {\n return this._listeners ? this._listeners.size : 0;\n }\n dispose() {\n if (this._listeners) {\n this._listeners.clear();\n }\n if (this._deliveryQueue) {\n this._deliveryQueue.clear();\n }\n if (this._leakageMon) {\n this._leakageMon.dispose();\n }\n this._disposed = true;\n }\n}\nexports.Emitter = Emitter;\nEmitter._noop = function () { };\nclass PauseableEmitter extends Emitter {\n constructor(options) {\n super(options);\n this._isPaused = 0;\n this._eventQueue = new linked_list_1.LinkedList();\n this._mergeFn = options && options.merge;\n }\n pause() {\n this._isPaused++;\n }\n resume() {\n if (this._isPaused !== 0 && --this._isPaused === 0) {\n if (this._mergeFn) {\n // use the merge function to create a single composite\n // event. make a copy in case firing pauses this emitter\n const events = this._eventQueue.toArray();\n this._eventQueue.clear();\n super.fire(this._mergeFn(events));\n }\n else {\n // no merging, fire each event individually and test\n // that this emitter isn't paused halfway through\n while (!this._isPaused && this._eventQueue.size !== 0) {\n super.fire(this._eventQueue.shift());\n }\n }\n }\n }\n fire(event) {\n if (this._listeners) {\n if (this._isPaused !== 0) {\n this._eventQueue.push(event);\n }\n else {\n super.fire(event);\n }\n }\n }\n}\nexports.PauseableEmitter = PauseableEmitter;\nvar WaitUntilEvent;\n(function (WaitUntilEvent) {\n async function fire(emitter, event, timeout = undefined) {\n const waitables = [];\n const asyncEvent = Object.assign(event, {\n waitUntil: (thenable) => {\n if (Object.isFrozen(waitables)) {\n throw new Error('waitUntil cannot be called asynchronously.');\n }\n waitables.push(thenable);\n },\n });\n emitter.fire(asyncEvent);\n // Asynchronous calls to `waitUntil` should fail.\n Object.freeze(waitables);\n // ts 要求 delete 的属性是 optional\n delete asyncEvent.waitUntil;\n if (!waitables.length) {\n return;\n }\n if (timeout !== undefined) {\n await Promise.race([Promise.all(waitables), new Promise((resolve) => setTimeout(resolve, timeout))]);\n }\n else {\n await Promise.all(waitables);\n }\n }\n WaitUntilEvent.fire = fire;\n})(WaitUntilEvent = exports.WaitUntilEvent || (exports.WaitUntilEvent = {}));\nclass AsyncEmitter extends Emitter {\n async fireAsync(data, token, promiseJoin) {\n if (!this._listeners) {\n return;\n }\n if (!this._asyncDeliveryQueue) {\n this._asyncDeliveryQueue = new linked_list_1.LinkedList();\n }\n for (let iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) {\n this._asyncDeliveryQueue.push([e.value, data]);\n }\n while (this._asyncDeliveryQueue.size > 0 && !token.isCancellationRequested) {\n const [listener, data] = this._asyncDeliveryQueue.shift();\n const thenables = [];\n const event = Object.assign(Object.assign({}, data), { waitUntil: (p) => {\n if (Object.isFrozen(thenables)) {\n throw new Error('waitUntil can NOT be called asynchronous');\n }\n if (promiseJoin) {\n p = promiseJoin(p, typeof listener === 'function' ? listener : listener[0]);\n }\n thenables.push(p);\n } });\n try {\n if (typeof listener === 'function') {\n listener.call(undefined, event);\n }\n else {\n listener[0].call(listener[1], event);\n }\n }\n catch (e) {\n (0, errors_1.onUnexpectedError)(e);\n continue;\n }\n // freeze thenables-collection to enforce sync-calls to\n // wait until and then wait for all thenables to resolve\n Object.freeze(thenables);\n await Promise.all(\n // Promise.allSettled 只有 core-js3 才支持,先手动加 catch 处理下\n thenables.map((thenable) => thenable.catch((e) => e))).catch((e) => (0, errors_1.onUnexpectedError)(e));\n }\n }\n}\nexports.AsyncEmitter = AsyncEmitter;\nclass EventMultiplexer {\n constructor() {\n this.hasListeners = false;\n this.events = [];\n this.emitter = new Emitter({\n onFirstListenerAdd: () => this.onFirstListenerAdd(),\n onLastListenerRemove: () => this.onLastListenerRemove(),\n });\n }\n get event() {\n return this.emitter.event;\n }\n add(event) {\n const e = { event, listener: null };\n this.events.push(e);\n if (this.hasListeners) {\n this.hook(e);\n }\n const dispose = () => {\n if (this.hasListeners) {\n this.unhook(e);\n }\n const idx = this.events.indexOf(e);\n this.events.splice(idx, 1);\n };\n return (0, disposable_1.toDisposable)((0, functional_1.once)(dispose));\n }\n onFirstListenerAdd() {\n this.hasListeners = true;\n this.events.forEach((e) => this.hook(e));\n }\n onLastListenerRemove() {\n this.hasListeners = false;\n this.events.forEach((e) => this.unhook(e));\n }\n hook(e) {\n e.listener = e.event((r) => this.emitter.fire(r));\n }\n unhook(e) {\n if (e.listener) {\n e.listener.dispose();\n }\n e.listener = null;\n }\n dispose() {\n this.emitter.dispose();\n }\n}\nexports.EventMultiplexer = EventMultiplexer;\n/**\n * The EventBufferer is useful in situations in which you want\n * to delay firing your events during some code.\n * You can wrap that code and be sure that the event will not\n * be fired during that wrap.\n *\n * ```\n * const emitter: Emitter;\n * const delayer = new EventDelayer();\n * const delayedEvent = delayer.wrapEvent(emitter.event);\n *\n * delayedEvent(console.log);\n *\n * delayer.bufferEvents(() => {\n * emitter.fire(); // event will not be fired yet\n * });\n *\n * // event will only be fired at this point\n * ```\n */\nclass EventBufferer {\n constructor() {\n this.buffers = [];\n }\n wrapEvent(event) {\n return (listener, thisArgs, disposables) => event((i) => {\n const buffer = this.buffers[this.buffers.length - 1];\n if (buffer) {\n buffer.push(() => listener.call(thisArgs, i));\n }\n else {\n listener.call(thisArgs, i);\n }\n }, undefined, disposables);\n }\n bufferEvents(fn) {\n const buffer = [];\n this.buffers.push(buffer);\n const r = fn();\n this.buffers.pop();\n buffer.forEach((flush) => flush());\n return r;\n }\n}\nexports.EventBufferer = EventBufferer;\n/**\n * A Relay is an event forwarder which functions as a replugabble event pipe.\n * Once created, you can connect an input event to it and it will simply forward\n * events from that input event through its own `event` property. The `input`\n * can be changed at any point in time.\n */\nclass Relay {\n constructor() {\n this.listening = false;\n this.inputEvent = Event.None;\n this.inputEventListener = disposable_1.Disposable.None;\n this.emitter = new Emitter({\n onFirstListenerDidAdd: () => {\n this.listening = true;\n this.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter);\n },\n onLastListenerRemove: () => {\n this.listening = false;\n this.inputEventListener.dispose();\n },\n });\n this.event = this.emitter.event;\n }\n set input(event) {\n this.inputEvent = event;\n if (this.listening) {\n this.inputEventListener.dispose();\n this.inputEventListener = event(this.emitter.fire, this.emitter);\n }\n }\n dispose() {\n this.inputEventListener.dispose();\n this.emitter.dispose();\n }\n}\nexports.Relay = Relay;\n/**\n * 同步执行的 Ready, 对 ready 的实时响应比 promise 快,多用在需要快速响应初始化回调的场景\n */\nclass ReadyEvent {\n constructor() {\n this._isReady = false;\n this._param = undefined;\n this._emitter = new Emitter();\n }\n onceReady(cb) {\n if (this._isReady) {\n try {\n return Promise.resolve(cb(this._param));\n }\n catch (e) {\n return Promise.reject(e);\n }\n }\n else {\n return new Promise((resolve, reject) => {\n this._emitter.event((param) => {\n try {\n resolve(cb(param));\n }\n catch (e) {\n reject(e);\n }\n });\n });\n }\n }\n ready(param) {\n if (!this._isReady) {\n this._isReady = true;\n this._param = param;\n }\n this._emitter.fire(param);\n this._emitter.dispose();\n this._emitter = null;\n }\n dispose() {\n if (this._emitter) {\n this._emitter.dispose();\n }\n }\n}\nexports.ReadyEvent = ReadyEvent;\nclass Dispatcher {\n constructor() {\n this._emitter = new Emitter();\n }\n on(type) {\n return Event.map(Event.filter(this._emitter.event, (e) => e.type === type), (v) => v.data);\n }\n dispatch(type, data) {\n this._emitter.fire({\n type,\n data,\n });\n }\n dispose() {\n this._emitter.dispose();\n }\n}\nexports.Dispatcher = Dispatcher;\nclass EventQueue {\n constructor() {\n this._listeners = new linked_list_1.LinkedList();\n this.queue = [];\n this.isOpened = false;\n this.open = () => {\n this.isOpened = true;\n this.queue.forEach((data) => {\n this.fire(data);\n });\n this.queue = [];\n };\n this.close = () => {\n this.isOpened = false;\n };\n this.push = (data) => {\n if (this.isOpened) {\n this.fire(data);\n }\n else {\n this.queue.push(data);\n }\n };\n this.fire = (data) => {\n this._listeners.forEach((listener) => {\n listener(data);\n });\n };\n this.on = (cb) => {\n const toRemove = this._listeners.push(cb);\n if (!this.isOpened) {\n this.open();\n }\n return disposable_1.Disposable.create(() => {\n toRemove();\n if (this._listeners.size === 0) {\n this.close();\n }\n });\n };\n this.dispose = () => {\n this._listeners.clear();\n };\n }\n}\nexports.EventQueue = EventQueue;\n//# sourceMappingURL=event.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../utils/lib/event.js?");
|
|
7190
|
+
eval("\n/* ---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n// Some code copied and modified from https://github.com/microsoft/vscode/blob/1.44.0/src/vs/base/common/event.ts\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.EventQueue = exports.Dispatcher = exports.ReadyEvent = exports.Relay = exports.EventBufferer = exports.EventMultiplexer = exports.AsyncEmitter = exports.WaitUntilEvent = exports.PauseableEmitter = exports.Emitter = exports.setGlobalLeakWarningThreshold = exports.Event = void 0;\nconst disposable_1 = __webpack_require__(/*! ./disposable */ \"../utils/lib/disposable.js\");\nconst errors_1 = __webpack_require__(/*! ./errors */ \"../utils/lib/errors.js\");\nconst functional_1 = __webpack_require__(/*! ./functional */ \"../utils/lib/functional.js\");\nconst linked_list_1 = __webpack_require__(/*! ./linked-list */ \"../utils/lib/linked-list.js\");\nconst uuid_1 = __webpack_require__(/*! ./uuid */ \"../utils/lib/uuid.js\");\nvar Event;\n(function (Event) {\n const _disposable = { dispose() { } };\n Event.None = function () {\n return _disposable;\n };\n /**\n * Given an event, returns another event which only fires once.\n */\n function once(event) {\n return (listener, thisArgs = null, disposables) => {\n // we need this, in case the event fires during the listener call\n let didFire = false;\n const result = event((e) => {\n if (didFire) {\n return;\n }\n else if (result) {\n result.dispose();\n }\n else {\n didFire = true;\n }\n return listener.call(thisArgs, e);\n }, null, disposables);\n if (didFire) {\n result.dispose();\n }\n return result;\n };\n }\n Event.once = once;\n /**\n * Given an event and a `map` function, returns another event which maps each element\n * throught the mapping function.\n */\n function map(event, map) {\n return snapshot((listener, thisArgs = null, disposables) => event((i) => listener.call(thisArgs, map(i)), null, disposables));\n }\n Event.map = map;\n /**\n * Given an event and an `each` function, returns another identical event and calls\n * the `each` function per each element.\n */\n function forEach(event, each) {\n return snapshot((listener, thisArgs = null, disposables) => event((i) => {\n each(i);\n listener.call(thisArgs, i);\n }, null, disposables));\n }\n Event.forEach = forEach;\n function filter(event, filter) {\n return snapshot((listener, thisArgs = null, disposables) => event((e) => filter(e) && listener.call(thisArgs, e), null, disposables));\n }\n Event.filter = filter;\n /**\n * Given an event, returns the same event but typed as `Event<void>`.\n */\n function signal(event) {\n return event;\n }\n Event.signal = signal;\n /**\n * Given a collection of events, returns a single event which emits\n * whenever any of the provided events emit.\n */\n function any(...events) {\n return (listener, thisArgs = null, disposables) => (0, disposable_1.combinedDisposable)(events.map((event) => event((e) => listener.call(thisArgs, e), null, disposables)));\n }\n Event.any = any;\n /**\n * Given an event and a `merge` function, returns another event which maps each element\n * and the cummulative result throught the `merge` function. Similar to `map`, but with memory.\n */\n function reduce(event, merge, initial) {\n let output = initial;\n return map(event, (e) => {\n output = merge(output, e);\n return output;\n });\n }\n Event.reduce = reduce;\n /**\n * Given a chain of event processing functions (filter, map, etc), each\n * function will be invoked per event & per listener. Snapshotting an event\n * chain allows each function to be invoked just once per event.\n */\n function snapshot(event) {\n let listener;\n const emitter = new Emitter({\n onFirstListenerAdd() {\n listener = event(emitter.fire, emitter);\n },\n onLastListenerRemove() {\n listener.dispose();\n },\n });\n return emitter.event;\n }\n Event.snapshot = snapshot;\n function debounce(event, merge, delay = 100, leading = false, leakWarningThreshold) {\n let subscription;\n let output;\n let handle;\n let numDebouncedCalls = 0;\n const emitter = new Emitter({\n leakWarningThreshold,\n onFirstListenerAdd() {\n subscription = event((cur) => {\n numDebouncedCalls++;\n output = merge(output, cur);\n if (leading && !handle) {\n emitter.fire(output);\n }\n clearTimeout(handle);\n handle = setTimeout(() => {\n const _output = output;\n output = undefined;\n handle = undefined;\n if (!leading || numDebouncedCalls > 1) {\n emitter.fire(_output);\n }\n numDebouncedCalls = 0;\n }, delay);\n });\n },\n onLastListenerRemove() {\n subscription.dispose();\n },\n });\n return emitter.event;\n }\n Event.debounce = debounce;\n /**\n * Given an event, it returns another event which fires only once and as soon as\n * the input event emits. The event data is the number of millis it took for the\n * event to fire.\n */\n function stopwatch(event) {\n const start = new Date().getTime();\n return map(once(event), (_) => new Date().getTime() - start);\n }\n Event.stopwatch = stopwatch;\n /**\n * Given an event, it returns another event which fires only when the event\n * element changes.\n */\n function latch(event) {\n let firstCall = true;\n let cache;\n return filter(event, (value) => {\n const shouldEmit = firstCall || value !== cache;\n firstCall = false;\n cache = value;\n return shouldEmit;\n });\n }\n Event.latch = latch;\n /**\n * Buffers the provided event until a first listener comes\n * along, at which point fire all the events at once and\n * pipe the event from then on.\n *\n * ```typescript\n * const emitter = new Emitter<number>();\n * const event = emitter.event;\n * const bufferedEvent = buffer(event);\n *\n * emitter.fire(1);\n * emitter.fire(2);\n * emitter.fire(3);\n * // nothing...\n *\n * const listener = bufferedEvent(num => console.log(num));\n * // 1, 2, 3\n *\n * emitter.fire(4);\n * // 4\n * ```\n */\n function buffer(event, nextTick = false, _buffer = []) {\n let buffer = _buffer.slice();\n let listener = event((e) => {\n if (buffer) {\n buffer.push(e);\n }\n else {\n emitter.fire(e);\n }\n });\n const flush = () => {\n if (buffer) {\n buffer.forEach((e) => emitter.fire(e));\n }\n buffer = null;\n };\n const emitter = new Emitter({\n onFirstListenerAdd() {\n if (!listener) {\n listener = event((e) => emitter.fire(e));\n }\n },\n onFirstListenerDidAdd() {\n if (buffer) {\n if (nextTick) {\n setTimeout(flush);\n }\n else {\n flush();\n }\n }\n },\n onLastListenerRemove() {\n if (listener) {\n listener.dispose();\n }\n listener = null;\n },\n });\n return emitter.event;\n }\n Event.buffer = buffer;\n class ChainableEvent {\n constructor(event) {\n this.event = event;\n }\n map(fn) {\n return new ChainableEvent(map(this.event, fn));\n }\n forEach(fn) {\n return new ChainableEvent(forEach(this.event, fn));\n }\n filter(fn) {\n return new ChainableEvent(filter(this.event, fn));\n }\n reduce(merge, initial) {\n return new ChainableEvent(reduce(this.event, merge, initial));\n }\n latch() {\n return new ChainableEvent(latch(this.event));\n }\n on(listener, thisArgs, disposables) {\n return this.event(listener, thisArgs, disposables);\n }\n once(listener, thisArgs, disposables) {\n return once(this.event)(listener, thisArgs, disposables);\n }\n }\n function chain(event) {\n return new ChainableEvent(event);\n }\n Event.chain = chain;\n function fromNodeEventEmitter(emitter, eventName, map = (id) => id) {\n const fn = (...args) => result.fire(map(...args));\n const onFirstListenerAdd = () => emitter.on(eventName, fn);\n const onLastListenerRemove = () => emitter.removeListener(eventName, fn);\n const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove });\n return result.event;\n }\n Event.fromNodeEventEmitter = fromNodeEventEmitter;\n function fromPromise(promise) {\n const emitter = new Emitter();\n let shouldEmit = false;\n promise\n .then(undefined, () => null)\n .then(() => {\n if (!shouldEmit) {\n setTimeout(() => emitter.fire(undefined), 0);\n }\n else {\n emitter.fire(undefined);\n }\n });\n shouldEmit = true;\n return emitter.event;\n }\n Event.fromPromise = fromPromise;\n function toPromise(event) {\n return new Promise((c) => once(event)(c));\n }\n Event.toPromise = toPromise;\n})(Event = exports.Event || (exports.Event = {}));\nlet _globalLeakWarningThreshold = -1;\nfunction setGlobalLeakWarningThreshold(n) {\n const oldValue = _globalLeakWarningThreshold;\n _globalLeakWarningThreshold = n;\n return {\n dispose() {\n _globalLeakWarningThreshold = oldValue;\n },\n };\n}\nexports.setGlobalLeakWarningThreshold = setGlobalLeakWarningThreshold;\nclass LeakageMonitor {\n constructor(customThreshold, name = (0, uuid_1.randomString)(3)) {\n this.customThreshold = customThreshold;\n this.name = name;\n this._warnCountdown = 0;\n }\n dispose() {\n if (this._stacks) {\n this._stacks.clear();\n }\n }\n check(listenerCount) {\n let threshold = _globalLeakWarningThreshold;\n if (typeof this.customThreshold === 'number') {\n threshold = this.customThreshold;\n }\n if (threshold <= 0 || listenerCount < threshold) {\n return undefined;\n }\n if (!this._stacks) {\n this._stacks = new Map();\n }\n const stack = new Error().stack.split('\\n').slice(3).join('\\n');\n const count = this._stacks.get(stack) || 0;\n this._stacks.set(stack, count + 1);\n this._warnCountdown -= 1;\n if (this._warnCountdown <= 0) {\n // only warn on first exceed and then every time the limit\n // is exceeded by 50% again\n this._warnCountdown = threshold * 0.5;\n // find most frequent listener and print warning\n let topStack = '';\n let topCount = 0;\n this._stacks.forEach((count, stack) => {\n if (!topStack || topCount < count) {\n topStack = stack;\n topCount = count;\n }\n });\n // eslint-disable-next-line no-console\n console.warn(`[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`);\n // eslint-disable-next-line no-console\n console.warn(topStack);\n }\n return () => {\n const count = this._stacks.get(stack) || 0;\n this._stacks.set(stack, count - 1);\n };\n }\n}\nclass Emitter {\n constructor(options) {\n this._disposed = false;\n this._options = options;\n this._leakageMon =\n _globalLeakWarningThreshold > 0\n ? new LeakageMonitor(this._options && this._options.leakWarningThreshold)\n : undefined;\n }\n /**\n * For the public to allow to subscribe\n * to events from this Emitter\n */\n get event() {\n if (!this._event) {\n this._event = (listener, thisArgs, disposables) => {\n if (!this._listeners) {\n this._listeners = new linked_list_1.LinkedList();\n }\n const firstListener = this._listeners.isEmpty();\n if (firstListener && this._options && this._options.onFirstListenerAdd) {\n this._options.onFirstListenerAdd(this);\n }\n const remove = this._listeners.push(!thisArgs ? listener : [listener, thisArgs]);\n if (firstListener && this._options && this._options.onFirstListenerDidAdd) {\n this._options.onFirstListenerDidAdd(this);\n }\n if (this._options && this._options.onListenerDidAdd) {\n this._options.onListenerDidAdd(this, listener, thisArgs);\n }\n // check and record this emitter for potential leakage\n let removeMonitor;\n if (this._leakageMon) {\n removeMonitor = this._leakageMon.check(this._listeners.size);\n }\n let result;\n result = {\n dispose: () => {\n if (removeMonitor) {\n removeMonitor();\n }\n result.dispose = Emitter._noop;\n if (!this._disposed) {\n remove();\n if (this._options && this._options.onLastListenerRemove) {\n const hasListeners = this._listeners && !this._listeners.isEmpty();\n if (!hasListeners) {\n this._options.onLastListenerRemove(this);\n }\n }\n }\n },\n };\n if (disposables instanceof disposable_1.DisposableStore) {\n disposables.add(result);\n }\n else if (Array.isArray(disposables)) {\n disposables.push(result);\n }\n return result;\n };\n }\n return this._event;\n }\n /**\n * To be kept private to fire an event to\n * subscribers\n */\n fire(event) {\n if (this._listeners) {\n // put all [listener,event]-pairs into delivery queue\n // then emit all event. an inner/nested event might be\n // the driver of this\n if (!this._deliveryQueue) {\n this._deliveryQueue = new linked_list_1.LinkedList();\n }\n for (let iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) {\n this._deliveryQueue.push([e.value, event]);\n }\n while (this._deliveryQueue.size > 0) {\n const [listener, event] = this._deliveryQueue.shift();\n try {\n if (typeof listener === 'function') {\n listener.call(undefined, event);\n }\n else {\n listener[0].call(listener[1], event);\n }\n }\n catch (e) {\n (0, errors_1.onUnexpectedError)(e);\n }\n }\n }\n }\n /**\n * 发送一个异步事件,等待所有监听器返回,并收集返回值\n * @param e\n * @param timeout\n */\n async fireAndAwait(event, timeout = 2000) {\n if (this._listeners) {\n if (!this._deliveryQueue) {\n this._deliveryQueue = new linked_list_1.LinkedList();\n }\n for (let iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) {\n this._deliveryQueue.push([e.value, event]);\n }\n const promises = [];\n const timeoutPromise = new Promise((resolve) => {\n setTimeout(() => {\n resolve({\n err: new Error('timeout'),\n });\n }, timeout);\n });\n while (this._deliveryQueue.size > 0) {\n const [listener, event] = this._deliveryQueue.shift();\n try {\n const promise = (async () => {\n try {\n if (typeof listener === 'function') {\n return {\n result: (await listener.call(undefined, event)),\n };\n }\n else {\n return {\n result: (await listener[0].call(listener[1], event)),\n };\n }\n }\n catch (e) {\n return {\n err: e,\n };\n }\n })();\n promises.push(Promise.race([timeoutPromise, promise]));\n }\n catch (e) {\n (0, errors_1.onUnexpectedError)(e);\n }\n }\n return Promise.all(promises);\n }\n else {\n return [];\n }\n }\n get listenerSize() {\n return this._listeners ? this._listeners.size : 0;\n }\n dispose() {\n if (this._listeners) {\n this._listeners.clear();\n }\n if (this._deliveryQueue) {\n this._deliveryQueue.clear();\n }\n if (this._leakageMon) {\n this._leakageMon.dispose();\n }\n this._disposed = true;\n }\n}\nexports.Emitter = Emitter;\nEmitter._noop = function () { };\nclass PauseableEmitter extends Emitter {\n constructor(options) {\n super(options);\n this._isPaused = 0;\n this._eventQueue = new linked_list_1.LinkedList();\n this._mergeFn = options && options.merge;\n }\n pause() {\n this._isPaused++;\n }\n resume() {\n if (this._isPaused !== 0 && --this._isPaused === 0) {\n if (this._mergeFn) {\n // use the merge function to create a single composite\n // event. make a copy in case firing pauses this emitter\n const events = this._eventQueue.toArray();\n this._eventQueue.clear();\n super.fire(this._mergeFn(events));\n }\n else {\n // no merging, fire each event individually and test\n // that this emitter isn't paused halfway through\n while (!this._isPaused && this._eventQueue.size !== 0) {\n super.fire(this._eventQueue.shift());\n }\n }\n }\n }\n fire(event) {\n if (this._listeners) {\n if (this._isPaused !== 0) {\n this._eventQueue.push(event);\n }\n else {\n super.fire(event);\n }\n }\n }\n}\nexports.PauseableEmitter = PauseableEmitter;\nvar WaitUntilEvent;\n(function (WaitUntilEvent) {\n async function fire(emitter, event, timeout = undefined) {\n const waitables = [];\n const asyncEvent = Object.assign(event, {\n waitUntil: (thenable) => {\n if (Object.isFrozen(waitables)) {\n throw new Error('waitUntil cannot be called asynchronously.');\n }\n waitables.push(thenable);\n },\n });\n emitter.fire(asyncEvent);\n // Asynchronous calls to `waitUntil` should fail.\n Object.freeze(waitables);\n // ts 要求 delete 的属性是 optional\n delete asyncEvent.waitUntil;\n if (!waitables.length) {\n return;\n }\n if (timeout !== undefined) {\n await Promise.race([Promise.all(waitables), new Promise((resolve) => setTimeout(resolve, timeout))]);\n }\n else {\n await Promise.all(waitables);\n }\n }\n WaitUntilEvent.fire = fire;\n})(WaitUntilEvent = exports.WaitUntilEvent || (exports.WaitUntilEvent = {}));\nclass AsyncEmitter extends Emitter {\n async fireAsync(data, token, promiseJoin) {\n if (!this._listeners) {\n return;\n }\n if (!this._asyncDeliveryQueue) {\n this._asyncDeliveryQueue = new linked_list_1.LinkedList();\n }\n for (let iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) {\n this._asyncDeliveryQueue.push([e.value, data]);\n }\n while (this._asyncDeliveryQueue.size > 0 && !token.isCancellationRequested) {\n const [listener, data] = this._asyncDeliveryQueue.shift();\n const thenables = [];\n const event = Object.assign(Object.assign({}, data), { waitUntil: (p) => {\n if (Object.isFrozen(thenables)) {\n throw new Error('waitUntil can NOT be called asynchronous');\n }\n if (promiseJoin) {\n p = promiseJoin(p, typeof listener === 'function' ? listener : listener[0]);\n }\n thenables.push(p);\n } });\n try {\n if (typeof listener === 'function') {\n listener.call(undefined, event);\n }\n else {\n listener[0].call(listener[1], event);\n }\n }\n catch (e) {\n (0, errors_1.onUnexpectedError)(e);\n continue;\n }\n // freeze thenables-collection to enforce sync-calls to\n // wait until and then wait for all thenables to resolve\n Object.freeze(thenables);\n await Promise.all(\n // Promise.allSettled 只有 core-js3 才支持,先手动加 catch 处理下\n thenables.map((thenable) => thenable.catch((e) => e))).catch((e) => (0, errors_1.onUnexpectedError)(e));\n }\n }\n}\nexports.AsyncEmitter = AsyncEmitter;\nclass EventMultiplexer {\n constructor() {\n this.hasListeners = false;\n this.events = [];\n this.emitter = new Emitter({\n onFirstListenerAdd: () => this.onFirstListenerAdd(),\n onLastListenerRemove: () => this.onLastListenerRemove(),\n });\n }\n get event() {\n return this.emitter.event;\n }\n add(event) {\n const e = { event, listener: null };\n this.events.push(e);\n if (this.hasListeners) {\n this.hook(e);\n }\n const dispose = () => {\n if (this.hasListeners) {\n this.unhook(e);\n }\n const idx = this.events.indexOf(e);\n this.events.splice(idx, 1);\n };\n return (0, disposable_1.toDisposable)((0, functional_1.once)(dispose));\n }\n onFirstListenerAdd() {\n this.hasListeners = true;\n this.events.forEach((e) => this.hook(e));\n }\n onLastListenerRemove() {\n this.hasListeners = false;\n this.events.forEach((e) => this.unhook(e));\n }\n hook(e) {\n e.listener = e.event((r) => this.emitter.fire(r));\n }\n unhook(e) {\n if (e.listener) {\n e.listener.dispose();\n }\n e.listener = null;\n }\n dispose() {\n this.emitter.dispose();\n }\n}\nexports.EventMultiplexer = EventMultiplexer;\n/**\n * The EventBufferer is useful in situations in which you want\n * to delay firing your events during some code.\n * You can wrap that code and be sure that the event will not\n * be fired during that wrap.\n *\n * ```\n * const emitter: Emitter;\n * const delayer = new EventDelayer();\n * const delayedEvent = delayer.wrapEvent(emitter.event);\n *\n * delayedEvent(console.log);\n *\n * delayer.bufferEvents(() => {\n * emitter.fire(); // event will not be fired yet\n * });\n *\n * // event will only be fired at this point\n * ```\n */\nclass EventBufferer {\n constructor() {\n this.buffers = [];\n }\n wrapEvent(event) {\n return (listener, thisArgs, disposables) => event((i) => {\n const buffer = this.buffers[this.buffers.length - 1];\n if (buffer) {\n buffer.push(() => listener.call(thisArgs, i));\n }\n else {\n listener.call(thisArgs, i);\n }\n }, undefined, disposables);\n }\n bufferEvents(fn) {\n const buffer = [];\n this.buffers.push(buffer);\n const r = fn();\n this.buffers.pop();\n buffer.forEach((flush) => flush());\n return r;\n }\n}\nexports.EventBufferer = EventBufferer;\n/**\n * A Relay is an event forwarder which functions as a replugabble event pipe.\n * Once created, you can connect an input event to it and it will simply forward\n * events from that input event through its own `event` property. The `input`\n * can be changed at any point in time.\n */\nclass Relay {\n constructor() {\n this.listening = false;\n this.inputEvent = Event.None;\n this.inputEventListener = disposable_1.Disposable.None;\n this.emitter = new Emitter({\n onFirstListenerDidAdd: () => {\n this.listening = true;\n this.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter);\n },\n onLastListenerRemove: () => {\n this.listening = false;\n this.inputEventListener.dispose();\n },\n });\n this.event = this.emitter.event;\n }\n set input(event) {\n this.inputEvent = event;\n if (this.listening) {\n this.inputEventListener.dispose();\n this.inputEventListener = event(this.emitter.fire, this.emitter);\n }\n }\n dispose() {\n this.inputEventListener.dispose();\n this.emitter.dispose();\n }\n}\nexports.Relay = Relay;\n/**\n * 同步执行的 Ready, 对 ready 的实时响应比 promise 快,多用在需要快速响应初始化回调的场景\n */\nclass ReadyEvent {\n constructor() {\n this._isReady = false;\n this._param = undefined;\n this._emitter = new Emitter();\n }\n onceReady(cb) {\n if (this._isReady) {\n try {\n return Promise.resolve(cb(this._param));\n }\n catch (e) {\n return Promise.reject(e);\n }\n }\n else {\n return new Promise((resolve, reject) => {\n this._emitter.event((param) => {\n try {\n resolve(cb(param));\n }\n catch (e) {\n reject(e);\n }\n });\n });\n }\n }\n ready(param) {\n if (!this._isReady) {\n this._isReady = true;\n this._param = param;\n }\n this._emitter.fire(param);\n this._emitter.dispose();\n this._emitter = null;\n }\n dispose() {\n if (this._emitter) {\n this._emitter.dispose();\n }\n }\n}\nexports.ReadyEvent = ReadyEvent;\nclass Dispatcher {\n constructor() {\n this._emitter = new Emitter();\n }\n on(type) {\n return Event.map(Event.filter(this._emitter.event, (e) => e.type === type), (v) => v.data);\n }\n dispatch(type, data) {\n this._emitter.fire({\n type,\n data,\n });\n }\n dispose() {\n if (this._emitter) {\n this._emitter.dispose();\n }\n }\n}\nexports.Dispatcher = Dispatcher;\nclass EventQueue {\n constructor() {\n this._listeners = new linked_list_1.LinkedList();\n this.queue = [];\n this.isOpened = false;\n this.open = () => {\n this.isOpened = true;\n this.queue.forEach((data) => {\n this.fire(data);\n });\n this.queue = [];\n };\n this.close = () => {\n this.isOpened = false;\n };\n this.push = (data) => {\n if (this.isOpened) {\n this.fire(data);\n }\n else {\n this.queue.push(data);\n }\n };\n this.fire = (data) => {\n this._listeners.forEach((listener) => {\n listener(data);\n });\n };\n this.on = (cb) => {\n const toRemove = this._listeners.push(cb);\n if (!this.isOpened) {\n this.open();\n }\n return disposable_1.Disposable.create(() => {\n toRemove();\n if (this._listeners.size === 0) {\n this.close();\n }\n });\n };\n this.dispose = () => {\n this._listeners.clear();\n };\n }\n}\nexports.EventQueue = EventQueue;\n//# sourceMappingURL=event.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../utils/lib/event.js?");
|
|
7191
7191
|
|
|
7192
7192
|
/***/ }),
|
|
7193
7193
|
|
package/lib/dialog/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dialog/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,aAAa,EAAW,MAAM,YAAY,CAAC;AAEpD,OAAO,eAAe,CAAC;AAEvB,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAErD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,OAAO,MAAM,gBAAgB,GAAG,MAAM,WAAW,CA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CAAC,EAAE,OAAO,CAAC;CACpB;AAWD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA4ChD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAoCzC,CAAC"}
|
package/lib/dialog/index.js
CHANGED
|
@@ -13,24 +13,24 @@ require("./styles.less");
|
|
|
13
13
|
const DefaultButtons = ({ onCancel, onOk, cancelText, okText }) => (react_1.default.createElement(react_1.default.Fragment, null,
|
|
14
14
|
react_1.default.createElement(button_1.Button, { onClick: onCancel, type: 'secondary' }, cancelText || (0, ide_core_common_1.localize)('ButtonCancel')),
|
|
15
15
|
react_1.default.createElement(button_1.Button, { onClick: onOk }, okText || (0, ide_core_common_1.localize)('ButtonOK'))));
|
|
16
|
-
const DialogContent = ({ onClose, closable,
|
|
16
|
+
const DialogContent = ({ onClose, closable, messageType = common_1.MessageType.Info, icon, message, buttons, type = 'confirm', title, onOk, onCancel, okText, cancelText, }) => {
|
|
17
17
|
const { getIcon: getContextIcon } = react_1.default.useContext(icon_1.IconContext);
|
|
18
18
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
19
19
|
react_1.default.createElement("div", { className: 'kt-dialog-content' },
|
|
20
20
|
icon && (react_1.default.createElement("div", { style: { color: icon.color }, className: (0, classnames_1.default)('kt-dialog-icon', (0, icon_1.getIcon)(icon.className) || getContextIcon(icon.className)) })),
|
|
21
21
|
react_1.default.createElement("div", { className: 'kt-dialog-content_area' },
|
|
22
|
-
react_1.default.createElement("p", { className: 'kt-dialog-content_title' }, title),
|
|
23
|
-
|
|
22
|
+
type !== 'basic' && title && react_1.default.createElement("p", { className: 'kt-dialog-content_title' }, title),
|
|
23
|
+
react_1.default.createElement("span", { className: 'kt-dialog-message' }, message)),
|
|
24
24
|
closable && type !== 'basic' && (react_1.default.createElement("button", { className: (0, classnames_1.default)('kt-dialog-closex', (0, icon_1.getIcon)('close')), onClick: onClose }))),
|
|
25
25
|
messageType !== common_1.MessageType.Empty && type !== 'basic' && (react_1.default.createElement("div", { className: 'kt-dialog-buttonWrap' }, type === 'confirm' ? (buttons || react_1.default.createElement(DefaultButtons, { onCancel: onCancel, onOk: onOk, okText: okText, cancelText: cancelText })) : (react_1.default.createElement(button_1.Button, { onClick: onClose }, "OK"))))));
|
|
26
26
|
};
|
|
27
27
|
exports.DialogContent = DialogContent;
|
|
28
28
|
const Dialog = (_a) => {
|
|
29
|
-
var { visible, onClose, closable, afterClose, messageType, icon, message,
|
|
29
|
+
var { visible, onClose, closable, afterClose, messageType, icon, message, buttons, type = 'confirm', title, onOk, onCancel, okText, cancelText, getContainer, keyboard } = _a, restProps = tslib_1.__rest(_a, ["visible", "onClose", "closable", "afterClose", "messageType", "icon", "message", "buttons", "type", "title", "onOk", "onCancel", "okText", "cancelText", "getContainer", "keyboard"]);
|
|
30
30
|
return (react_1.default.createElement(overlay_1.Overlay, Object.assign({ visible: visible, onClose: onClose, title: type === 'basic' ? title : null, closable: type === 'basic', getContainer: getContainer, keyboard: keyboard, footer: type === 'basic'
|
|
31
31
|
? buttons || react_1.default.createElement(DefaultButtons, { onCancel: onCancel, onOk: onOk, okText: okText, cancelText: cancelText })
|
|
32
32
|
: undefined, afterClose: afterClose }, restProps),
|
|
33
|
-
react_1.default.createElement(exports.DialogContent, Object.assign({
|
|
33
|
+
react_1.default.createElement(exports.DialogContent, Object.assign({ message: message, buttons: buttons, visible: visible }, restProps))));
|
|
34
34
|
};
|
|
35
35
|
exports.Dialog = Dialog;
|
|
36
36
|
//# sourceMappingURL=index.js.map
|
package/lib/dialog/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dialog/index.tsx"],"names":[],"mappings":";;;;AAAA,oEAA6B;AAC7B,0DAA0B;AAE1B,+DAAqD;AAErD,sCAAmC;AACnC,sCAAwC;AACxC,kCAA+C;AAC/C,wCAAoD;AAEpD,yBAAuB;
|
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AAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,MAAM,EACJ,IAAI,KAAK,OAAO;YACd,CAAC,CAAC,OAAO,IAAI,8BAAC,cAAc,IAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAI;YACvG,CAAC,CAAC,SAAS,EAEf,UAAU,EAAE,UAAU,IAClB,SAAS;QAEb,8BAAC,qBAAa,kBAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,IAAM,SAAS,EAAkB,CAC5F,CACX,CAAA;CAAA,CAAC;AApCW,QAAA,MAAM,UAoCjB"}
|
package/lib/dialog/styles.less
CHANGED
|
@@ -10,7 +10,6 @@ export declare class MarkdownReactParser extends marked.Renderer {
|
|
|
10
10
|
renderer: MarkdownReactRenderer;
|
|
11
11
|
});
|
|
12
12
|
parse(tokens: marked.Token[]): ReactNode[];
|
|
13
|
-
private unescapeInfo;
|
|
14
13
|
parseInline(tokens?: marked.Token[]): ReactNode[];
|
|
15
14
|
}
|
|
16
15
|
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/markdown-react/parse.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/markdown-react/parse.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAiB,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEhE;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,MAAM,CAAC,QAAQ;IACtD,OAAO,CAAC,QAAQ,CAAwB;gBAE5B,OAAO,EAAE;QAAE,QAAQ,EAAE,qBAAqB,CAAA;KAAE;IAMxD,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,GAAG,SAAS,EAAE;IA2F1C,WAAW,CAAC,MAAM,GAAE,MAAM,CAAC,KAAK,EAAO,GAAG,SAAS,EAAE;CAmDtD"}
|
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MarkdownReactParser = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const marked_1 = require("marked");
|
|
6
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
7
|
/**
|
|
6
8
|
* 这里通过重新实现 marked.Renderer 的所有方法,实现一个能直接渲染 React 的 Markdown 渲染器
|
|
7
9
|
*/
|
|
8
10
|
class MarkdownReactParser extends marked_1.marked.Renderer {
|
|
9
11
|
constructor(options) {
|
|
10
12
|
super();
|
|
11
|
-
this.unescapeInfo = new Map([
|
|
12
|
-
['"', '"'],
|
|
13
|
-
[' ', ' '],
|
|
14
|
-
['&', '&'],
|
|
15
|
-
[''', "'"],
|
|
16
|
-
['<', '<'],
|
|
17
|
-
['>', '>'],
|
|
18
|
-
]);
|
|
19
13
|
this.renderer = options.renderer;
|
|
20
14
|
}
|
|
21
15
|
parse(tokens) {
|
|
22
16
|
return tokens.map((token) => {
|
|
23
17
|
switch (token.type) {
|
|
24
18
|
case 'html': {
|
|
25
|
-
return
|
|
19
|
+
return react_1.default.createElement("div", { dangerouslySetInnerHTML: { __html: token.raw } });
|
|
26
20
|
}
|
|
27
21
|
case 'space': {
|
|
28
22
|
return null;
|
|
@@ -89,8 +83,7 @@ class MarkdownReactParser extends marked_1.marked.Renderer {
|
|
|
89
83
|
return tokens.map((token) => {
|
|
90
84
|
switch (token.type) {
|
|
91
85
|
case 'text': {
|
|
92
|
-
|
|
93
|
-
return this.renderer.text(text);
|
|
86
|
+
return this.renderer.text(unescape(token.text));
|
|
94
87
|
}
|
|
95
88
|
case 'strong': {
|
|
96
89
|
return this.renderer.strong(this.parseInline(token.tokens));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/markdown-react/parse.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/markdown-react/parse.tsx"],"names":[],"mappings":";;;;AAAA,mCAAgC;AAChC,0DAAyC;AAIzC;;GAEG;AACH,MAAa,mBAAoB,SAAQ,eAAM,CAAC,QAAQ;IAGtD,YAAY,OAA4C;QACtD,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,MAAsB;QAC1B,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YAC1B,QAAQ,KAAK,CAAC,IAAI,EAAE;gBAClB,KAAK,MAAM,CAAC,CAAC;oBACX,OAAO,uCAAK,uBAAuB,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,EAAE,GAAI,CAAC;iBAChE;gBAED,KAAK,OAAO,CAAC,CAAC;oBACZ,OAAO,IAAI,CAAC;iBACb;gBAED,KAAK,SAAS,CAAC,CAAC;oBACd,MAAM,KAAK,GAAG,KAAK,CAAC,KAAsB,CAAC;oBAC3C,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;iBACrE;gBAED,KAAK,WAAW,CAAC,CAAC;oBAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;iBAChE;gBAED,KAAK,MAAM,CAAC,CAAC;oBACX,MAAM,SAAS,GAAG,KAA2B,CAAC;oBAC9C,OA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CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;iBACjE;gBAED,KAAK,MAAM,CAAC,CAAC;oBACX,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;iBACvC;gBAED,KAAK,IAAI,CAAC,CAAC;oBACT,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;iBAC3B;gBAED,KAAK,QAAQ,CAAC,CAAC;oBACb,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;iBACvC;gBAED,OAAO,CAAC,CAAC;oBACP,sCAAsC;oBACtC,OAAO,CAAC,IAAI,CAAC,eAAe,KAAK,CAAC,IAAI,sBAAsB,CAAC,CAAC;oBAC9D,OAAO,IAAI,CAAC;iBACb;aACF;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAvJD,kDAuJC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
export type HeadingLevels = 1 | 2 | 3 | 4 | 5 | 6;
|
|
3
3
|
export interface TableFlags {
|
|
4
4
|
header?: boolean;
|
|
@@ -8,6 +8,7 @@ export type CustomReactRenderer = Partial<MarkdownReactRenderer>;
|
|
|
8
8
|
export type RendererMethods = keyof MarkdownReactRenderer;
|
|
9
9
|
export interface ReactRendererOptions {
|
|
10
10
|
baseURL?: string;
|
|
11
|
+
openLinksInNewTab?: boolean;
|
|
11
12
|
langPrefix?: string;
|
|
12
13
|
renderer?: CustomReactRenderer;
|
|
13
14
|
}
|
|
@@ -17,28 +18,28 @@ export declare class MarkdownReactRenderer {
|
|
|
17
18
|
constructor(options?: ReactRendererOptions);
|
|
18
19
|
private node;
|
|
19
20
|
private incrementUID;
|
|
20
|
-
heading(children: ReactNode, level: HeadingLevels):
|
|
21
|
-
paragraph(children: ReactNode):
|
|
21
|
+
heading(children: ReactNode, level: HeadingLevels): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
22
|
+
paragraph(children: ReactNode): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
22
23
|
private joinBase;
|
|
23
|
-
link(href: string, text: ReactNode):
|
|
24
|
-
image(src: string, alt: string, title?: string | null):
|
|
25
|
-
codespan(code: ReactNode, lang?: string | null):
|
|
26
|
-
code(code: ReactNode | string, lang: string | undefined):
|
|
27
|
-
blockquote(children: ReactNode):
|
|
28
|
-
list(children: ReactNode, ordered: boolean):
|
|
29
|
-
listItem(children: ReactNode[]):
|
|
30
|
-
checkbox(checked: ReactNode):
|
|
31
|
-
table(children: ReactNode[]):
|
|
32
|
-
tableHeader(children: ReactNode):
|
|
33
|
-
tableBody(children: ReactNode[]):
|
|
34
|
-
tableRow(children: ReactNode[]):
|
|
35
|
-
tableCell(children: ReactNode[], flags: TableFlags):
|
|
36
|
-
strong(children: ReactNode):
|
|
37
|
-
em(children: ReactNode):
|
|
38
|
-
del(children: ReactNode):
|
|
39
|
-
text(text: ReactNode):
|
|
40
|
-
html(
|
|
41
|
-
hr():
|
|
42
|
-
br():
|
|
24
|
+
link(href: string, text: ReactNode): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
25
|
+
image(src: string, alt: string, title?: string | null): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
26
|
+
codespan(code: ReactNode, lang?: string | null): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
27
|
+
code(code: ReactNode | string, lang: string | undefined): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
28
|
+
blockquote(children: ReactNode): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
29
|
+
list(children: ReactNode, ordered: boolean): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
30
|
+
listItem(children: ReactNode[]): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
31
|
+
checkbox(checked: ReactNode): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
32
|
+
table(children: ReactNode[]): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
33
|
+
tableHeader(children: ReactNode): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
34
|
+
tableBody(children: ReactNode[]): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
35
|
+
tableRow(children: ReactNode[]): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
36
|
+
tableCell(children: ReactNode[], flags: TableFlags): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
37
|
+
strong(children: ReactNode): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
38
|
+
em(children: ReactNode): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
39
|
+
del(children: ReactNode): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
40
|
+
text(text: ReactNode): ReactNode;
|
|
41
|
+
html(html: ReactNode): ReactNode;
|
|
42
|
+
hr(): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
43
|
+
br(): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
43
44
|
}
|
|
44
45
|
//# sourceMappingURL=render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/markdown-react/render.
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/markdown-react/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,SAAS,EAAiB,MAAM,OAAO,CAAC;AAE5E,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,GAAG,MAA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,QAAQ,EAAE,SAAS,EAAE;IAI/B,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE;IAI9B,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,UAAU;IAKlD,MAAM,CAAC,QAAQ,EAAE,SAAS;IAI1B,EAAE,CAAC,QAAQ,EAAE,SAAS;IAItB,GAAG,CAAC,QAAQ,EAAE,SAAS;IAIvB,IAAI,CAAC,IAAI,EAAE,SAAS;IAIpB,IAAI,CAAC,IAAI,EAAE,SAAS;IAIpB,EAAE;IAIF,EAAE;CAGH"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MarkdownReactRenderer = void 0;
|
|
4
|
-
const
|
|
5
|
-
const react_1 = tslib_1.__importStar(require("react"));
|
|
4
|
+
const react_1 = require("react");
|
|
6
5
|
class MarkdownReactRenderer {
|
|
7
6
|
constructor(options = {}) {
|
|
8
7
|
this.uid = 0;
|
|
@@ -37,7 +36,8 @@ class MarkdownReactRenderer {
|
|
|
37
36
|
}
|
|
38
37
|
link(href, text) {
|
|
39
38
|
const url = this.joinBase(href, this.options.baseURL);
|
|
40
|
-
|
|
39
|
+
const target = this.options.openLinksInNewTab ? '_blank' : null;
|
|
40
|
+
return this.node('a', text, { href: url, target });
|
|
41
41
|
}
|
|
42
42
|
image(src, alt, title = null) {
|
|
43
43
|
const url = this.joinBase(src, this.options.baseURL);
|
|
@@ -90,8 +90,8 @@ class MarkdownReactRenderer {
|
|
|
90
90
|
text(text) {
|
|
91
91
|
return text;
|
|
92
92
|
}
|
|
93
|
-
html(
|
|
94
|
-
return
|
|
93
|
+
html(html) {
|
|
94
|
+
return html;
|
|
95
95
|
}
|
|
96
96
|
hr() {
|
|
97
97
|
return this.node('hr');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/markdown-react/render.
|
|
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IACpC,CAAC;IAED,IAAI,CAAC,IAAe;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,IAAe;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,EAAE;QACA,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAED,EAAE;QACA,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;CACF;AA7HD,sDA6HC"}
|
package/lib/message/style.less
CHANGED
|
@@ -30,17 +30,6 @@
|
|
|
30
30
|
background: var(--notifications-background);
|
|
31
31
|
color: var(--notifications-foreground);
|
|
32
32
|
}
|
|
33
|
-
&-custom-content {
|
|
34
|
-
display: flex;
|
|
35
|
-
align-items: flex-start;
|
|
36
|
-
justify-content: center;
|
|
37
|
-
.anticon {
|
|
38
|
-
height: 21px;
|
|
39
|
-
display: flex;
|
|
40
|
-
align-items: center;
|
|
41
|
-
justify-content: center;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
33
|
|
|
45
34
|
&-success .@{iconfont-css-prefix} {
|
|
46
35
|
color: @success-color;
|
package/lib/popover/index.d.ts
CHANGED
|
@@ -37,7 +37,6 @@ export interface IPopoverProps {
|
|
|
37
37
|
zIndex?: number;
|
|
38
38
|
onClickAction?: (args: any) => void;
|
|
39
39
|
onVisibleChange?: (visible: boolean) => void;
|
|
40
|
-
getTooltipContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
41
40
|
[key: string]: any;
|
|
42
41
|
}
|
|
43
42
|
export declare const Popover: React.FC<IPopoverProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popover/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,eAAe,CAAC;AAIvB,oBAAY,kBAAkB;IAC5B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;CACh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/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var PopoverPosition;
|
|
|
29
29
|
PopoverPosition["rightBottom"] = "rightBottom";
|
|
30
30
|
})(PopoverPosition = exports.PopoverPosition || (exports.PopoverPosition = {}));
|
|
31
31
|
const Popover = (_a) => {
|
|
32
|
-
var { children, trigger = PopoverTriggerType.hover, visible, content, position = PopoverPosition.top, showArrow = true, title, titleClassName, overlay, overlayClassName, overlayStyle, action, delay, zIndex = 1000, onClickAction, onVisibleChange
|
|
32
|
+
var { children, trigger = PopoverTriggerType.hover, visible, content, position = PopoverPosition.top, showArrow = true, title, titleClassName, overlay, overlayClassName, overlayStyle, action, delay, zIndex = 1000, onClickAction, onVisibleChange } = _a, restProps = tslib_1.__rest(_a, ["children", "trigger", "visible", "content", "position", "showArrow", "title", "titleClassName", "overlay", "overlayClassName", "overlayStyle", "action", "delay", "zIndex", "onClickAction", "onVisibleChange"]);
|
|
33
33
|
const handleActionClick = (0, react_1.useCallback)((event) => {
|
|
34
34
|
if (onClickAction) {
|
|
35
35
|
onClickAction(event);
|
|
@@ -53,7 +53,7 @@ const Popover = (_a) => {
|
|
|
53
53
|
if (!overlayContent) {
|
|
54
54
|
return children;
|
|
55
55
|
}
|
|
56
|
-
return (react_1.default.createElement(rc_tooltip_1.default, Object.assign({}, restProps, { visible: visible, placement: position, mouseEnterDelay: delay ? delay / 1000 : undefined, trigger: trigger, showArrow: showArrow, onVisibleChange: onVisibleChange, overlayClassName: overlayClassName, prefixCls: 'kt-popover', overlayStyle: overlayStyle,
|
|
56
|
+
return (react_1.default.createElement(rc_tooltip_1.default, Object.assign({}, restProps, { visible: visible, placement: position, mouseEnterDelay: delay ? delay / 1000 : undefined, trigger: trigger, showArrow: showArrow, onVisibleChange: onVisibleChange, overlayClassName: overlayClassName, prefixCls: 'kt-popover', overlayStyle: overlayStyle, overlay: overlayContent, zIndex: zIndex }),
|
|
57
57
|
react_1.default.createElement("div", { className: 'kt-popover-trigger' }, children)));
|
|
58
58
|
};
|
|
59
59
|
exports.Popover = Popover;
|
package/lib/popover/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/popover/index.tsx"],"names":[],"mappings":";;;;AAAA,oEAA6B;AAC7B,oEAAiC;AACjC,uDAAoD;AAEpD,yBAAuB;AAEvB,sCAAmC;AAEnC,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;IACf,qCAAe,CAAA;IACf,qCAAe,CAAA;AACjB,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B;AAED,IAAY,eAaX;AAbD,WAAY,eAAe;IACzB,8BAAW,CAAA;IACX,oCAAiB,CAAA;IACjB,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,wCAAqB,CAAA;IACrB,4CAAyB,CAAA;IACzB,8CAA2B,CAAA;IAC3B,sCAAmB,CAAA;IACnB,4CAAyB,CAAA;IACzB,wCAAqB,CAAA;IACrB,8CAA2B,CAAA;AAC7B,CAAC,EAbW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAa1B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/popover/index.tsx"],"names":[],"mappings":";;;;AAAA,oEAA6B;AAC7B,oEAAiC;AACjC,uDAAoD;AAEpD,yBAAuB;AAEvB,sCAAmC;AAEnC,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;IACf,qCAAe,CAAA;IACf,qCAAe,CAAA;AACjB,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B;AAED,IAAY,eAaX;AAbD,WAAY,eAAe;IACzB,8BAAW,CAAA;IACX,oCAAiB,CAAA;IACjB,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,wCAAqB,CAAA;IACrB,4CAAyB,CAAA;IACzB,8CAA2B,CAAA;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E,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAElD,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,QAAQ,CAAC;KACjB;IAED,OAAO,CACL,8BAAC,oBAAO,oBACF,SAAS,IACb,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,QAAQ,EACnB,eAAe,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,EACjD,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAC,YAAY,EACtB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,MAAM;QAEd,uCAAK,SAAS,EAAC,oBAAoB,IAAE,QAAQ,CAAO,CAC5C,CACX,CAAC;AACJ,CAAC,CAAC;AA3EW,QAAA,OAAO,WA2ElB"}
|
package/lib/popover/styles.less
CHANGED
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
.@{prefix}-popover-placement-top .@{prefix}-popover-arrow,
|
|
80
80
|
.@{prefix}-popover-placement-topLeft .@{prefix}-popover-arrow,
|
|
81
81
|
.@{prefix}-popover-placement-topRight .@{prefix}-popover-arrow {
|
|
82
|
-
|
|
83
|
-
margin-
|
|
84
|
-
border-width:
|
|
82
|
+
bottom: 4px;
|
|
83
|
+
margin-left: -5px;
|
|
84
|
+
border-width: 5px 5px 0;
|
|
85
85
|
border-top-color: var(--kt-popover-background);
|
|
86
86
|
}
|
|
87
87
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/ide-components",
|
|
3
|
-
"version": "3.4.6-next-
|
|
3
|
+
"version": "3.4.6-next-1733744589.0",
|
|
4
4
|
"description": "@opensumi/ide-components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@ant-design/icons": "^4.6.4",
|
|
19
|
-
"@opensumi/ide-core-common": "3.4.6-next-
|
|
20
|
-
"@opensumi/ide-utils": "3.4.6-next-
|
|
19
|
+
"@opensumi/ide-core-common": "3.4.6-next-1733744589.0",
|
|
20
|
+
"@opensumi/ide-utils": "3.4.6-next-1733744589.0",
|
|
21
21
|
"@opensumi/react-custom-scrollbars-2": "^4.3.4",
|
|
22
22
|
"@rc-component/mini-decimal": "^1.0.1",
|
|
23
23
|
"fuzzy": "^0.1.3",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"react-window": "^1.8.5"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@opensumi/ide-dev-tool": "3.4.6-next-
|
|
41
|
+
"@opensumi/ide-dev-tool": "3.4.6-next-1733744589.0",
|
|
42
42
|
"@types/marked": "^4.0.7",
|
|
43
43
|
"@types/react-window": "^1.8.5",
|
|
44
44
|
"prop-types": "^15.8.1"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "a7889f36c6a1491d134713f2275d2fd6e2b96e09"
|
|
47
47
|
}
|