@opensumi/ide-addons 2.12.1-next-47fa8bf2

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.
Files changed (55) hide show
  1. package/README.md +1 -0
  2. package/lib/browser/file-content-update-time.contribution.d.ts +53 -0
  3. package/lib/browser/file-content-update-time.contribution.d.ts.map +1 -0
  4. package/lib/browser/file-content-update-time.contribution.js +219 -0
  5. package/lib/browser/file-content-update-time.contribution.js.map +1 -0
  6. package/lib/browser/file-drop.contribution.d.ts +7 -0
  7. package/lib/browser/file-drop.contribution.d.ts.map +1 -0
  8. package/lib/browser/file-drop.contribution.js +29 -0
  9. package/lib/browser/file-drop.contribution.js.map +1 -0
  10. package/lib/browser/file-drop.service.d.ts +22 -0
  11. package/lib/browser/file-drop.service.d.ts.map +1 -0
  12. package/lib/browser/file-drop.service.js +136 -0
  13. package/lib/browser/file-drop.service.js.map +1 -0
  14. package/lib/browser/file-search.contribution.d.ts +58 -0
  15. package/lib/browser/file-search.contribution.d.ts.map +1 -0
  16. package/lib/browser/file-search.contribution.js +536 -0
  17. package/lib/browser/file-search.contribution.js.map +1 -0
  18. package/lib/browser/index.d.ts +17 -0
  19. package/lib/browser/index.d.ts.map +1 -0
  20. package/lib/browser/index.js +39 -0
  21. package/lib/browser/index.js.map +1 -0
  22. package/lib/browser/langauge-change.contribution.d.ts +9 -0
  23. package/lib/browser/langauge-change.contribution.d.ts.map +1 -0
  24. package/lib/browser/langauge-change.contribution.js +42 -0
  25. package/lib/browser/langauge-change.contribution.js.map +1 -0
  26. package/lib/browser/status-bar-contribution.d.ts +9 -0
  27. package/lib/browser/status-bar-contribution.d.ts.map +1 -0
  28. package/lib/browser/status-bar-contribution.js +37 -0
  29. package/lib/browser/status-bar-contribution.js.map +1 -0
  30. package/lib/browser/toolbar-customize/style.module.less +54 -0
  31. package/lib/browser/toolbar-customize/toolbar-customize.contribution.d.ts +11 -0
  32. package/lib/browser/toolbar-customize/toolbar-customize.contribution.d.ts.map +1 -0
  33. package/lib/browser/toolbar-customize/toolbar-customize.contribution.js +53 -0
  34. package/lib/browser/toolbar-customize/toolbar-customize.contribution.js.map +1 -0
  35. package/lib/browser/toolbar-customize/toolbar-customize.d.ts +11 -0
  36. package/lib/browser/toolbar-customize/toolbar-customize.d.ts.map +1 -0
  37. package/lib/browser/toolbar-customize/toolbar-customize.js +107 -0
  38. package/lib/browser/toolbar-customize/toolbar-customize.js.map +1 -0
  39. package/lib/common/index.d.ts +30 -0
  40. package/lib/common/index.d.ts.map +1 -0
  41. package/lib/common/index.js +7 -0
  42. package/lib/common/index.js.map +1 -0
  43. package/lib/index.d.ts +2 -0
  44. package/lib/index.d.ts.map +1 -0
  45. package/lib/index.js +5 -0
  46. package/lib/index.js.map +1 -0
  47. package/lib/node/file-drop.service.d.ts +7 -0
  48. package/lib/node/file-drop.service.d.ts.map +1 -0
  49. package/lib/node/file-drop.service.js +39 -0
  50. package/lib/node/file-drop.service.js.map +1 -0
  51. package/lib/node/index.d.ts +10 -0
  52. package/lib/node/index.d.ts.map +1 -0
  53. package/lib/node/index.js +30 -0
  54. package/lib/node/index.js.map +1 -0
  55. package/package.json +40 -0
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LanguageChangeHintContribution = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const ide_core_browser_1 = require("@opensumi/ide-core-browser");
6
+ const di_1 = require("@opensumi/di");
7
+ const ide_overlay_1 = require("@opensumi/ide-overlay");
8
+ let LanguageChangeHintContribution = class LanguageChangeHintContribution {
9
+ onStart() {
10
+ this.preferenceService.onPreferenceChanged(async (change) => {
11
+ if (change.preferenceName === 'general.language') {
12
+ const shouldAsk = this.preferenceService.get('general.askReloadOnLanguageChange');
13
+ if (shouldAsk) {
14
+ const msg = await this.dialogService.info((0, ide_core_browser_1.localize)('preference.general.language.change.refresh.info', '更改语言后需重启后生效,是否立即刷新?'), [
15
+ (0, ide_core_browser_1.localize)('preference.general.language.change.refresh.later', '稍后自己刷新'),
16
+ (0, ide_core_browser_1.localize)('preference.general.language.change.refresh.now', '立即刷新'),
17
+ ]);
18
+ if (msg === (0, ide_core_browser_1.localize)('preference.general.language.change.refresh.now', '立即刷新')) {
19
+ this.clientApp.fireOnReload();
20
+ }
21
+ }
22
+ }
23
+ });
24
+ }
25
+ };
26
+ (0, tslib_1.__decorate)([
27
+ (0, di_1.Autowired)(ide_core_browser_1.PreferenceService),
28
+ (0, tslib_1.__metadata)("design:type", Object)
29
+ ], LanguageChangeHintContribution.prototype, "preferenceService", void 0);
30
+ (0, tslib_1.__decorate)([
31
+ (0, di_1.Autowired)(ide_core_browser_1.IClientApp),
32
+ (0, tslib_1.__metadata)("design:type", Object)
33
+ ], LanguageChangeHintContribution.prototype, "clientApp", void 0);
34
+ (0, tslib_1.__decorate)([
35
+ (0, di_1.Autowired)(ide_overlay_1.IDialogService),
36
+ (0, tslib_1.__metadata)("design:type", Object)
37
+ ], LanguageChangeHintContribution.prototype, "dialogService", void 0);
38
+ LanguageChangeHintContribution = (0, tslib_1.__decorate)([
39
+ (0, ide_core_browser_1.Domain)(ide_core_browser_1.ClientAppContribution)
40
+ ], LanguageChangeHintContribution);
41
+ exports.LanguageChangeHintContribution = LanguageChangeHintContribution;
42
+ //# sourceMappingURL=langauge-change.contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"langauge-change.contribution.js","sourceRoot":"","sources":["../../src/browser/langauge-change.contribution.ts"],"names":[],"mappings":";;;;AAAA,iEAAoH;AACpH,qCAAyC;AACzC,uDAAuD;AAGvD,IAAa,8BAA8B,GAA3C,MAAa,8BAA8B;IAWzC,OAAO;QACL,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAC1D,IAAI,MAAM,CAAC,cAAc,KAAK,kBAAkB,EAAE;gBAChD,MAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;gBAClF,IAAI,SAAS,EAAE;oBACb,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CACvC,IAAA,2BAAQ,EAAC,iDAAiD,EAAE,qBAAqB,CAAC,EAClF;wBACE,IAAA,2BAAQ,EAAC,kDAAkD,EAAE,QAAQ,CAAC;wBACtE,IAAA,2BAAQ,EAAC,gDAAgD,EAAE,MAAM,CAAC;qBACnE,CACF,CAAC;oBACF,IAAI,GAAG,KAAK,IAAA,2BAAQ,EAAC,gDAAgD,EAAE,MAAM,CAAC,EAAE;wBAC9E,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;qBAC/B;iBACF;aACF;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA3BC;IADC,IAAA,cAAS,EAAC,oCAAiB,CAAC;;yEACQ;AAGrC;IADC,IAAA,cAAS,EAAC,6BAAU,CAAC;;iEACA;AAGtB;IADC,IAAA,cAAS,EAAC,4BAAc,CAAC;;qEACI;AATnB,8BAA8B;IAD1C,IAAA,yBAAM,EAAC,wCAAqB,CAAC;GACjB,8BAA8B,CA8B1C;AA9BY,wEAA8B"}
@@ -0,0 +1,9 @@
1
+ import { WithEventBus } from '@opensumi/ide-core-common';
2
+ import { ClientAppContribution } from '@opensumi/ide-core-browser';
3
+ export declare class StatusBarContribution extends WithEventBus implements ClientAppContribution {
4
+ private readonly commandService;
5
+ onStart(): void;
6
+ handleBrowserConnectionOpen(): void;
7
+ handleBrowserConnectionClose(): void;
8
+ }
9
+ //# sourceMappingURL=status-bar-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-bar-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/status-bar-contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAAoE,YAAY,EAA0B,MAAM,2BAA2B,CAAC;AACnJ,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,qBACa,qBAAsB,SAAQ,YAAa,YAAW,qBAAqB;IAEtF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAEhD,OAAO;IAGP,2BAA2B;IAK3B,4BAA4B;CAG7B"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StatusBarContribution = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const di_1 = require("@opensumi/di");
6
+ const ide_core_common_1 = require("@opensumi/ide-core-common");
7
+ const ide_core_browser_1 = require("@opensumi/ide-core-browser");
8
+ let StatusBarContribution = class StatusBarContribution extends ide_core_common_1.WithEventBus {
9
+ onStart() { }
10
+ handleBrowserConnectionOpen() {
11
+ this.commandService.executeCommand('statusbar.changeBackgroundColor', 'var(--statusBar-background)');
12
+ }
13
+ handleBrowserConnectionClose() {
14
+ this.commandService.executeCommand('statusbar.changeBackgroundColor', 'var(--kt-statusbar-offline-background)');
15
+ }
16
+ };
17
+ (0, tslib_1.__decorate)([
18
+ (0, di_1.Autowired)(ide_core_common_1.CommandService),
19
+ (0, tslib_1.__metadata)("design:type", Object)
20
+ ], StatusBarContribution.prototype, "commandService", void 0);
21
+ (0, tslib_1.__decorate)([
22
+ (0, ide_core_common_1.OnEvent)(ide_core_common_1.BrowserConnectionOpenEvent),
23
+ (0, tslib_1.__metadata)("design:type", Function),
24
+ (0, tslib_1.__metadata)("design:paramtypes", []),
25
+ (0, tslib_1.__metadata)("design:returntype", void 0)
26
+ ], StatusBarContribution.prototype, "handleBrowserConnectionOpen", null);
27
+ (0, tslib_1.__decorate)([
28
+ (0, ide_core_common_1.OnEvent)(ide_core_common_1.BrowserConnectionCloseEvent),
29
+ (0, tslib_1.__metadata)("design:type", Function),
30
+ (0, tslib_1.__metadata)("design:paramtypes", []),
31
+ (0, tslib_1.__metadata)("design:returntype", void 0)
32
+ ], StatusBarContribution.prototype, "handleBrowserConnectionClose", null);
33
+ StatusBarContribution = (0, tslib_1.__decorate)([
34
+ (0, ide_core_common_1.Domain)(ide_core_browser_1.ClientAppContribution)
35
+ ], StatusBarContribution);
36
+ exports.StatusBarContribution = StatusBarContribution;
37
+ //# sourceMappingURL=status-bar-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-bar-contribution.js","sourceRoot":"","sources":["../../src/browser/status-bar-contribution.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AACzC,+DAAmJ;AACnJ,iEAAmE;AAGnE,IAAa,qBAAqB,GAAlC,MAAa,qBAAsB,SAAQ,8BAAY;IAIrD,OAAO,KAAI,CAAC;IAGZ,2BAA2B;QACzB,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,iCAAiC,EAAE,6BAA6B,CAAC,CAAC;IACvG,CAAC;IAGD,4BAA4B;QAC1B,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,iCAAiC,EAAE,wCAAwC,CAAC,CAAC;IAClH,CAAC;CACF,CAAA;AAbC;IADC,IAAA,cAAS,EAAC,gCAAc,CAAC;;6DACsB;AAKhD;IADC,IAAA,yBAAO,EAAC,4CAA0B,CAAC;;;;wEAGnC;AAGD;IADC,IAAA,yBAAO,EAAC,6CAA2B,CAAC;;;;yEAGpC;AAdU,qBAAqB;IADjC,IAAA,wBAAM,EAAC,wCAAqB,CAAC;GACjB,qBAAqB,CAejC;AAfY,sDAAqB"}
@@ -0,0 +1,54 @@
1
+
2
+ @import "~@opensumi/ide-components/lib/style/mixins.less";
3
+
4
+ .toolbar-customize-overlay {
5
+ position: fixed;
6
+ width: 100%;
7
+ height: 100%;
8
+ left:0;
9
+ top:0;
10
+ z-index: 1000;
11
+ .toolbar-customize {
12
+ position: fixed;
13
+ width: 720px;
14
+ margin-left: -360px;
15
+ left: 50%;
16
+ top: 30px;
17
+ z-index: 1001;
18
+ .overlay-shadow();
19
+ background-color: var(--kt-modal-background);
20
+ color: var(--kt-modal-foreground);
21
+ min-height: 200px;
22
+ .toolbar-customize-location {
23
+ display: flex;
24
+ flex-wrap: wrap;
25
+ border-bottom: 1px solid var(--kt-modal-separatorBackground);
26
+ .action-item {
27
+ margin-right: 10px;
28
+ margin-bottom: 5px;
29
+ margin-top: 5px;
30
+ }
31
+ padding: 15px 20px;
32
+ }
33
+ .button-display {
34
+ padding: 20px;
35
+ display: flex;
36
+ justify-content: left;
37
+ align-items: center;
38
+ > div:first-child {
39
+ margin-right: 10px;
40
+ font-size:12px;
41
+ }
42
+ .button-display-select {
43
+ width: 200px;
44
+ }
45
+ }
46
+ .customize-complete {
47
+ display: flex;
48
+ justify-content: center;
49
+ align-items: center;
50
+ padding: 20px;
51
+ }
52
+ }
53
+
54
+ }
@@ -0,0 +1,11 @@
1
+ import { CommandContribution, CommandRegistry, ComponentContribution, ComponentRegistry, AppConfig } from '@opensumi/ide-core-browser';
2
+ import { ToolbarCustomizeViewService } from './toolbar-customize';
3
+ import { MenuContribution, IMenuRegistry } from '@opensumi/ide-core-browser/lib/menu/next';
4
+ export declare class ToolbarCustomizeContribution implements CommandContribution, ComponentContribution, MenuContribution {
5
+ config: AppConfig;
6
+ viewService: ToolbarCustomizeViewService;
7
+ registerCommands(registry: CommandRegistry): void;
8
+ registerComponent(registry: ComponentRegistry): void;
9
+ registerMenus(registry: IMenuRegistry): void;
10
+ }
11
+ //# sourceMappingURL=toolbar-customize.contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbar-customize.contribution.d.ts","sourceRoot":"","sources":["../../../src/browser/toolbar-customize/toolbar-customize.contribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,mBAAmB,EAAE,eAAe,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,SAAS,EAA0B,MAAM,4BAA4B,CAAC;AAEvK,OAAO,EAA6B,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAU,MAAM,0CAA0C,CAAC;AAEnG,qBACa,4BAA6B,YAAW,mBAAmB,EAAE,qBAAqB,EAAE,gBAAgB;IAG/G,MAAM,EAAE,SAAS,CAAC;IAGlB,WAAW,EAAE,2BAA2B,CAAC;IAEzC,gBAAgB,CAAC,QAAQ,EAAE,eAAe;IAW1C,iBAAiB,CAAC,QAAQ,EAAE,iBAAiB;IAa7C,aAAa,CAAC,QAAQ,EAAE,aAAa;CAStC"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToolbarCustomizeContribution = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const ide_core_browser_1 = require("@opensumi/ide-core-browser");
6
+ const di_1 = require("@opensumi/di");
7
+ const toolbar_customize_1 = require("./toolbar-customize");
8
+ const next_1 = require("@opensumi/ide-core-browser/lib/menu/next");
9
+ let ToolbarCustomizeContribution = class ToolbarCustomizeContribution {
10
+ registerCommands(registry) {
11
+ registry.registerCommand({
12
+ id: 'toolbar.showCustomizePanel',
13
+ label: 'Show Toolbar Customization',
14
+ }, {
15
+ execute: () => {
16
+ this.viewService.setVisible(true);
17
+ },
18
+ });
19
+ }
20
+ registerComponent(registry) {
21
+ registry.register('addon/toolbar-customize', {
22
+ id: 'addon/toolbar-customize',
23
+ component: toolbar_customize_1.ToolbarCustomizeComponent,
24
+ });
25
+ if (!this.config.layoutConfig[ide_core_browser_1.SlotLocation.extra]) {
26
+ this.config.layoutConfig[ide_core_browser_1.SlotLocation.extra] = {
27
+ modules: [],
28
+ };
29
+ }
30
+ this.config.layoutConfig[ide_core_browser_1.SlotLocation.extra].modules.push('addon/toolbar-customize');
31
+ }
32
+ registerMenus(registry) {
33
+ registry.registerMenuItem(next_1.MenuId.KTToolbarLocationContext, {
34
+ command: {
35
+ id: 'toolbar.showCustomizePanel',
36
+ label: (0, ide_core_browser_1.localize)('toolbar.customize.menu'),
37
+ },
38
+ });
39
+ }
40
+ };
41
+ (0, tslib_1.__decorate)([
42
+ (0, di_1.Autowired)(ide_core_browser_1.AppConfig),
43
+ (0, tslib_1.__metadata)("design:type", Object)
44
+ ], ToolbarCustomizeContribution.prototype, "config", void 0);
45
+ (0, tslib_1.__decorate)([
46
+ (0, di_1.Autowired)(toolbar_customize_1.ToolbarCustomizeViewService),
47
+ (0, tslib_1.__metadata)("design:type", toolbar_customize_1.ToolbarCustomizeViewService)
48
+ ], ToolbarCustomizeContribution.prototype, "viewService", void 0);
49
+ ToolbarCustomizeContribution = (0, tslib_1.__decorate)([
50
+ (0, ide_core_browser_1.Domain)(ide_core_browser_1.CommandContribution, ide_core_browser_1.ComponentContribution, next_1.MenuContribution)
51
+ ], ToolbarCustomizeContribution);
52
+ exports.ToolbarCustomizeContribution = ToolbarCustomizeContribution;
53
+ //# sourceMappingURL=toolbar-customize.contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbar-customize.contribution.js","sourceRoot":"","sources":["../../../src/browser/toolbar-customize/toolbar-customize.contribution.ts"],"names":[],"mappings":";;;;AAAA,iEAAuK;AACvK,qCAAyC;AACzC,2DAA6F;AAC7F,mEAAmG;AAGnG,IAAa,4BAA4B,GAAzC,MAAa,4BAA4B;IAQvC,gBAAgB,CAAC,QAAyB;QACxC,QAAQ,CAAC,eAAe,CAAC;YACvB,EAAE,EAAE,4BAA4B;YAChC,KAAK,EAAE,4BAA4B;SACpC,EAAE;YACD,OAAO,EAAE,GAAG,EAAE;gBACZ,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACpC,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED,iBAAiB,CAAC,QAA2B;QAC3C,QAAQ,CAAC,QAAQ,CAAC,yBAAyB,EAAE;YAC3C,EAAE,EAAE,yBAAyB;YAC7B,SAAS,EAAE,6CAAyB;SACrC,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,+BAAY,CAAC,KAAK,CAAC,EAAE;YACjD,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,+BAAY,CAAC,KAAK,CAAC,GAAG;gBAC7C,OAAO,EAAE,EAAE;aACZ,CAAC;SACH;QACD,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,+BAAY,CAAC,KAAK,CAAE,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IACxF,CAAC;IAED,aAAa,CAAC,QAAuB;QACnC,QAAQ,CAAC,gBAAgB,CAAC,aAAM,CAAC,wBAAwB,EAAE;YACzD,OAAO,EAAE;gBACP,EAAE,EAAE,4BAA4B;gBAChC,KAAK,EAAE,IAAA,2BAAQ,EAAC,wBAAwB,CAAC;aAC1C;SACF,CAAC,CAAC;IACL,CAAC;CAEF,CAAA;AAtCC;IADC,IAAA,cAAS,EAAC,4BAAS,CAAC;;4DACH;AAGlB;IADC,IAAA,cAAS,EAAC,+CAA2B,CAAC;2CAC1B,+CAA2B;iEAAC;AAN9B,4BAA4B;IADxC,IAAA,yBAAM,EAAC,sCAAmB,EAAE,wCAAqB,EAAE,uBAAgB,CAAC;GACxD,4BAA4B,CAyCxC;AAzCY,oEAA4B"}
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { PreferenceService } from '@opensumi/ide-core-browser';
3
+ export declare class ToolbarCustomizeViewService {
4
+ private _setVisible;
5
+ preferenceService: PreferenceService;
6
+ bindSetVisibleHandle(setVisible: (visible: boolean) => void): void;
7
+ setVisible(visible: boolean): void;
8
+ toggleActionVisibility(location: string, actionId: string, visible: boolean): Promise<void>;
9
+ }
10
+ export declare const ToolbarCustomizeComponent: () => JSX.Element | null;
11
+ //# sourceMappingURL=toolbar-customize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbar-customize.d.ts","sourceRoot":"","sources":["../../../src/browser/toolbar-customize/toolbar-customize.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAiB,iBAAiB,EAA+C,MAAM,4BAA4B,CAAC;AAI3H,qBACa,2BAA2B;IAEtC,OAAO,CAAC,WAAW,CAA6B;IAGhD,iBAAiB,EAAE,iBAAiB,CAAC;IAE9B,oBAAoB,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI;IAIlE,UAAU,CAAC,OAAO,EAAE,OAAO;IAIrB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;CAmBlF;AAED,eAAO,MAAM,yBAAyB,0BA8ErC,CAAC"}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToolbarCustomizeComponent = exports.ToolbarCustomizeViewService = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = (0, tslib_1.__importDefault)(require("react"));
6
+ const di_1 = require("@opensumi/di");
7
+ const ide_core_browser_1 = require("@opensumi/ide-core-browser");
8
+ const style_module_less_1 = (0, tslib_1.__importDefault)(require("./style.module.less"));
9
+ const ide_components_1 = require("@opensumi/ide-components");
10
+ let ToolbarCustomizeViewService = class ToolbarCustomizeViewService {
11
+ bindSetVisibleHandle(setVisible) {
12
+ this._setVisible = setVisible;
13
+ }
14
+ setVisible(visible) {
15
+ this._setVisible(visible);
16
+ }
17
+ async toggleActionVisibility(location, actionId, visible) {
18
+ const prev = this.preferenceService.get('toolbar.ignoreActions') || {};
19
+ if (!prev[location]) {
20
+ prev[location] = [];
21
+ }
22
+ if (!visible) {
23
+ if (prev[location].indexOf(actionId) === -1) {
24
+ prev[location].push(actionId);
25
+ }
26
+ }
27
+ else {
28
+ const index = prev[location].indexOf(actionId);
29
+ if (index !== -1) {
30
+ prev[location].splice(index, 1);
31
+ }
32
+ }
33
+ const effectingScope = this.preferenceService.inspect('toolbar.ignoreActions').workspaceValue ? ide_core_browser_1.PreferenceScope.Workspace : ide_core_browser_1.PreferenceScope.User;
34
+ await this.preferenceService.set('toolbar.ignoreActions', prev, effectingScope);
35
+ }
36
+ };
37
+ (0, tslib_1.__decorate)([
38
+ (0, di_1.Autowired)(ide_core_browser_1.PreferenceService),
39
+ (0, tslib_1.__metadata)("design:type", Object)
40
+ ], ToolbarCustomizeViewService.prototype, "preferenceService", void 0);
41
+ ToolbarCustomizeViewService = (0, tslib_1.__decorate)([
42
+ (0, di_1.Injectable)()
43
+ ], ToolbarCustomizeViewService);
44
+ exports.ToolbarCustomizeViewService = ToolbarCustomizeViewService;
45
+ const ToolbarCustomizeComponent = () => {
46
+ const [visible, setVisible] = react_1.default.useState(false);
47
+ const service = (0, ide_core_browser_1.useInjectable)(ToolbarCustomizeViewService);
48
+ const registry = (0, ide_core_browser_1.useInjectable)(ide_core_browser_1.IToolbarRegistry);
49
+ const preferenceService = (0, ide_core_browser_1.useInjectable)(ide_core_browser_1.PreferenceService);
50
+ service.bindSetVisibleHandle(setVisible);
51
+ if (!visible) {
52
+ return null;
53
+ }
54
+ const locations = registry.getAllLocations();
55
+ const currentPref = preferenceService.get('toolbar.ignoreActions') || {};
56
+ let currentDisplayPref = preferenceService.get('toolbar.buttonDisplay', 'iconAndText');
57
+ function renderLocationPref(location) {
58
+ const groups = [{ id: '_head' }, ...(registry.getActionGroups(location) || []), { id: '_tail' }];
59
+ const result = [];
60
+ const pref = currentPref[location] || [];
61
+ groups.forEach((group, gi) => {
62
+ const actions = registry.getToolbarActions({ location, group: group.id });
63
+ if (actions && actions.actions.length > 0) {
64
+ if (result.length > 0) {
65
+ result.push(react_1.default.createElement("div", { className: style_module_less_1.default['group-split'], key: 'split-' + gi }));
66
+ }
67
+ actions.actions.forEach((action, i) => {
68
+ let visible = pref.indexOf(action.id) === -1;
69
+ const id = 'action-toggle-' + action.id;
70
+ result.push(react_1.default.createElement("div", { className: style_module_less_1.default['action-item'], key: i + '_' + action.id },
71
+ react_1.default.createElement(ide_components_1.CheckBox, { onChange: () => {
72
+ service.toggleActionVisibility(location, action.id, !visible);
73
+ visible = !visible;
74
+ }, defaultChecked: visible, id: id, label: action.description })));
75
+ });
76
+ }
77
+ });
78
+ if (result.length === 0) {
79
+ return null;
80
+ }
81
+ return react_1.default.createElement("div", { key: location, className: style_module_less_1.default['toolbar-customize-location'] }, result);
82
+ }
83
+ return react_1.default.createElement("div", { className: style_module_less_1.default['toolbar-customize-overlay'] },
84
+ react_1.default.createElement("div", { className: style_module_less_1.default['toolbar-customize'] },
85
+ locations.map((location) => {
86
+ return renderLocationPref(location);
87
+ }),
88
+ react_1.default.createElement("div", { className: style_module_less_1.default['button-display'] },
89
+ react_1.default.createElement("div", null, (0, ide_core_browser_1.localize)('toolbar-customize.buttonDisplay.description')),
90
+ react_1.default.createElement(ide_components_1.Select, { options: [
91
+ {
92
+ label: (0, ide_core_browser_1.localize)('toolbar-customize.buttonDisplay.icon'),
93
+ value: 'icon',
94
+ }, {
95
+ label: (0, ide_core_browser_1.localize)('toolbar-customize.buttonDisplay.iconAndText'),
96
+ value: 'iconAndText',
97
+ },
98
+ ], value: currentDisplayPref, onChange: (v) => {
99
+ const effectingScope = preferenceService.inspect('toolbar.buttonDisplay').workspaceValue ? ide_core_browser_1.PreferenceScope.Workspace : ide_core_browser_1.PreferenceScope.User;
100
+ preferenceService.set('toolbar.buttonDisplay', v, effectingScope);
101
+ currentDisplayPref = v;
102
+ }, className: style_module_less_1.default['button-display-select'] })),
103
+ react_1.default.createElement("div", { className: style_module_less_1.default['customize-complete'] },
104
+ react_1.default.createElement(ide_components_1.Button, { type: 'primary', onClick: () => setVisible(false) }, (0, ide_core_browser_1.localize)('toolbar-customize.complete')))));
105
+ };
106
+ exports.ToolbarCustomizeComponent = ToolbarCustomizeComponent;
107
+ //# sourceMappingURL=toolbar-customize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbar-customize.js","sourceRoot":"","sources":["../../../src/browser/toolbar-customize/toolbar-customize.tsx"],"names":[],"mappings":";;;;AAAA,+DAA0B;AAC1B,qCAAqD;AACrD,iEAA2H;AAC3H,yFAAyC;AACzC,6DAAoE;AAGpE,IAAa,2BAA2B,GAAxC,MAAa,2BAA2B;IAO/B,oBAAoB,CAAC,UAAsC;QAChE,IAAI,CAAC,WAAW,GAAG,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export declare const FileDropServicePath = "FileFropServicePath";
3
+ export declare const IFileDropServiceToken: unique symbol;
4
+ export interface IFileDropBackendService {
5
+ ensureFileExist(fileName: string, targetDir: string): Promise<boolean>;
6
+ writeStream(chunk: string | ArrayBuffer, fileName: string, targetDir: string, done: boolean): Promise<void>;
7
+ }
8
+ export declare const IFileDropFrontendServiceToken: unique symbol;
9
+ export interface IFileDropFrontendService {
10
+ onDidDropFile(e: FileTreeDropEvent): void;
11
+ }
12
+ export interface IWebkitDataTransfer {
13
+ items: IWebkitDataTransferItem[];
14
+ }
15
+ export interface IWebkitDataTransferItem {
16
+ webkitGetAsEntry(): IWebkitDataTransferItemEntry;
17
+ }
18
+ export interface IWebkitDataTransferItemEntry {
19
+ name: string | undefined;
20
+ fullPath: string;
21
+ isFile: boolean;
22
+ isDirectory: boolean;
23
+ type: string;
24
+ file(resolve: (file: File) => void, reject: () => void): void;
25
+ createReader(): IWebkitDataTransferItemEntryReader;
26
+ }
27
+ export interface IWebkitDataTransferItemEntryReader {
28
+ readEntries(resolve: (file: IWebkitDataTransferItemEntry[]) => void, reject: () => void): void;
29
+ }
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAEzD,eAAO,MAAM,qBAAqB,eAA6B,CAAC;AAEhE,MAAM,WAAW,uBAAuB;IACtC,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvE,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7G;AAED,eAAO,MAAM,6BAA6B,eAAqC,CAAC;AAChF,MAAM,WAAW,wBAAwB;IACvC,aAAa,CAAC,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC3C;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,uBAAuB,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,uBAAuB;IACtC,gBAAgB,IAAI,4BAA4B,CAAC;CAClD;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,EAAE,MAAM,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAC9D,YAAY,IAAI,kCAAkC,CAAC;CACpD;AAED,MAAM,WAAW,kCAAkC;IACjD,WAAW,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,4BAA4B,EAAE,KAAK,IAAI,EAAE,MAAM,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CAChG"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IFileDropFrontendServiceToken = exports.IFileDropServiceToken = exports.FileDropServicePath = void 0;
4
+ exports.FileDropServicePath = 'FileFropServicePath';
5
+ exports.IFileDropServiceToken = Symbol('IFileDropService');
6
+ exports.IFileDropFrontendServiceToken = Symbol('IFileDropFrontendService');
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;AAEa,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAE5C,QAAA,qBAAqB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAOnD,QAAA,6BAA6B,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './node';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ (0, tslib_1.__exportStar)(require("./node"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,sDAAuB"}
@@ -0,0 +1,7 @@
1
+ import { IFileDropBackendService } from '../common';
2
+ export declare class FileDropService implements IFileDropBackendService {
3
+ private writeableStreams;
4
+ ensureFileExist(fileName: string, targetDir: string): Promise<boolean>;
5
+ writeStream(chunk: string | ArrayBuffer, fileName: string, targetDir: string, done: boolean): Promise<void>;
6
+ }
7
+ //# sourceMappingURL=file-drop.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-drop.service.d.ts","sourceRoot":"","sources":["../../src/node/file-drop.service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACpD,qBACa,eAAgB,YAAW,uBAAuB;IAC7D,OAAO,CAAC,gBAAgB,CAA0C;IAE5D,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAM5E,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAgB5G"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FileDropService = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
6
+ const path_1 = (0, tslib_1.__importDefault)(require("path"));
7
+ const ide_core_common_1 = require("@opensumi/ide-core-common");
8
+ const di_1 = require("@opensumi/di");
9
+ let FileDropService = class FileDropService {
10
+ constructor() {
11
+ this.writeableStreams = new Map();
12
+ }
13
+ async ensureFileExist(fileName, targetDir) {
14
+ const targetPath = ide_core_common_1.Uri.file(path_1.default.join(targetDir, fileName)).path;
15
+ this.writeableStreams.set(targetPath, fs_1.default.createWriteStream(targetPath));
16
+ return true;
17
+ }
18
+ writeStream(chunk, fileName, targetDir, done) {
19
+ const targetPath = ide_core_common_1.Uri.file(path_1.default.join(targetDir, fileName)).path;
20
+ const stream = this.writeableStreams.get(targetPath);
21
+ return new Promise((resolve, reject) => {
22
+ stream === null || stream === void 0 ? void 0 : stream.write(chunk, 'binary', (err) => {
23
+ if (err) {
24
+ reject(err);
25
+ }
26
+ resolve();
27
+ if (done) {
28
+ stream.close();
29
+ this.writeableStreams.delete(targetPath);
30
+ }
31
+ });
32
+ });
33
+ }
34
+ };
35
+ FileDropService = (0, tslib_1.__decorate)([
36
+ (0, di_1.Injectable)()
37
+ ], FileDropService);
38
+ exports.FileDropService = FileDropService;
39
+ //# sourceMappingURL=file-drop.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-drop.service.js","sourceRoot":"","sources":["../../src/node/file-drop.service.ts"],"names":[],"mappings":";;;;AAAA,yDAAoB;AACpB,6DAAwB;AACxB,+DAAgD;AAChD,qCAA0C;AAI1C,IAAa,eAAe,GAA5B,MAAa,eAAe;IAA5B;QACU,qBAAgB,GAAgC,IAAI,GAAG,EAAE,CAAC;IAwBpE,CAAC;IAtBC,KAAK,CAAC,eAAe,CAAC,QAAgB,EAAE,SAAiB;QACvD,MAAM,UAAU,GAAG,qBAAG,CAAC,IAAI,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;QACjE,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAU,EAAE,YAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;QACxE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,WAAW,CAAC,KAA2B,EAAE,QAAgB,EAAE,SAAiB,EAAE,IAAa;QACzF,MAAM,UAAU,GAAG,qBAAG,CAAC,IAAI,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;QACjE,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACrD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE;gBACrC,IAAI,GAAG,EAAE;oBACP,MAAM,CAAC,GAAG,CAAC,CAAC;iBACb;gBACD,OAAO,EAAE,CAAC;gBACV,IAAI,IAAI,EAAE;oBACR,MAAM,CAAC,KAAK,EAAE,CAAC;oBACf,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;iBAC1C;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAzBY,eAAe;IAD3B,IAAA,eAAU,GAAE;GACA,eAAe,CAyB3B;AAzBY,0CAAe"}
@@ -0,0 +1,10 @@
1
+ import { Provider } from '@opensumi/di';
2
+ import { NodeModule } from '@opensumi/ide-core-node';
3
+ export declare class AddonsModule extends NodeModule {
4
+ providers: Provider[];
5
+ backServices: {
6
+ servicePath: string;
7
+ token: symbol;
8
+ }[];
9
+ }
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD,qBACa,YAAa,SAAQ,UAAU;IAC1C,SAAS,EAAE,QAAQ,EAAE,CAKnB;IAEF,YAAY;;;QAKV;CACH"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddonsModule = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const di_1 = require("@opensumi/di");
6
+ const ide_core_node_1 = require("@opensumi/ide-core-node");
7
+ const file_drop_service_1 = require("./file-drop.service");
8
+ const common_1 = require("../common");
9
+ let AddonsModule = class AddonsModule extends ide_core_node_1.NodeModule {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.providers = [
13
+ {
14
+ token: common_1.IFileDropServiceToken,
15
+ useClass: file_drop_service_1.FileDropService,
16
+ },
17
+ ];
18
+ this.backServices = [
19
+ {
20
+ servicePath: common_1.FileDropServicePath,
21
+ token: common_1.IFileDropServiceToken,
22
+ },
23
+ ];
24
+ }
25
+ };
26
+ AddonsModule = (0, tslib_1.__decorate)([
27
+ (0, di_1.Injectable)()
28
+ ], AddonsModule);
29
+ exports.AddonsModule = AddonsModule;
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";;;;AAAA,qCAAoD;AACpD,2DAAqD;AACrD,2DAAsD;AACtD,sCAAuE;AAGvE,IAAa,YAAY,GAAzB,MAAa,YAAa,SAAQ,0BAAU;IAA5C;;QACE,cAAS,GAAe;YACtB;gBACE,KAAK,EAAE,8BAAqB;gBAC5B,QAAQ,EAAE,mCAAe;aAC1B;SACF,CAAC;QAEF,iBAAY,GAAG;YACb;gBACE,WAAW,EAAE,4BAAmB;gBAChC,KAAK,EAAE,8BAAqB;aAC7B;SACF,CAAC;IACJ,CAAC;CAAA,CAAA;AAdY,YAAY;IADxB,IAAA,eAAU,GAAE;GACA,YAAY,CAcxB;AAdY,oCAAY"}
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@opensumi/ide-addons",
3
+ "version": "2.12.1-next-47fa8bf2",
4
+ "files": [
5
+ "lib"
6
+ ],
7
+ "license": "MIT",
8
+ "main": "lib/index.js",
9
+ "typings": "lib/index.d.ts",
10
+ "scripts": {
11
+ "prepublishOnly": "npm run build",
12
+ "build": "tsc -v",
13
+ "start": "run-p start:client start:server",
14
+ "start:client": "webpack-dev-server --config ./webpack.config.js",
15
+ "start:server": "node --inspect -r ts-node/register ./entry/server.ts"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git@github.com:opensumi/core.git"
20
+ },
21
+ "dependencies": {
22
+ "@opensumi/ide-core-common": "2.12.1-next-47fa8bf2",
23
+ "@opensumi/ide-core-node": "2.12.1-next-47fa8bf2"
24
+ },
25
+ "devDependencies": {
26
+ "@opensumi/ide-components": "2.12.1-next-47fa8bf2",
27
+ "@opensumi/ide-core-browser": "2.12.1-next-47fa8bf2",
28
+ "@opensumi/ide-dev-tool": "^1.1.0",
29
+ "@opensumi/ide-editor": "2.12.1-next-47fa8bf2",
30
+ "@opensumi/ide-file-search": "2.12.1-next-47fa8bf2",
31
+ "@opensumi/ide-file-service": "2.12.1-next-47fa8bf2",
32
+ "@opensumi/ide-overlay": "2.12.1-next-47fa8bf2",
33
+ "@opensumi/ide-quick-open": "2.12.1-next-47fa8bf2",
34
+ "@opensumi/ide-workspace": "2.12.1-next-47fa8bf2",
35
+ "@opensumi/ide-workspace-edit": "2.12.1-next-47fa8bf2",
36
+ "npm-run-all": "^4.1.5",
37
+ "ts-node": "8.0.2",
38
+ "webpack-dev-server": "^3.3.1"
39
+ }
40
+ }