@ridit/editor-services
Advanced tools
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
@@ -11,3 +11,3 @@ import { | ||
| WorkbenchService | ||
| } from "../chunk-3ckh5ftd.js"; | ||
| } from "../chunk-m2z3x450.js"; | ||
| import { | ||
@@ -14,0 +14,0 @@ EventEmitter |
@@ -9,3 +9,3 @@ import { | ||
| WorkbenchService | ||
| } from "../chunk-3ckh5ftd.js"; | ||
| } from "../chunk-m2z3x450.js"; | ||
| import { | ||
@@ -46,2 +46,3 @@ EventEmitter | ||
| editorConfig: opts.editorConfig, | ||
| interalServices: opts.internalServicesFactories, | ||
| workerFactories: opts.workerFactories | ||
@@ -77,3 +78,5 @@ }); | ||
| theme: opts.theme ?? "Dark", | ||
| editorConfig: opts.editorConfig | ||
| editorConfig: opts.editorConfig, | ||
| interalServices: opts.internalServicesFactories, | ||
| workerFactories: opts.workerFactories | ||
| }); | ||
@@ -103,2 +106,2 @@ const workbenchService = new WorkbenchService(eventEmitter, { | ||
| //# debugId=F8E0433BCDD6669A64756E2164756E21 | ||
| //# debugId=A91E67EB5EC7615864756E2164756E21 |
@@ -5,7 +5,7 @@ { | ||
| "sourcesContent": [ | ||
| "import { EditorService } from \"./EditorService\";\r\nimport {\r\n MonacoEditorOptions,\r\n MonacoWorkerFactories,\r\n} from \"./EditorService/default-editors/monaco\";\r\nimport { EventEmitter } from \"./emitter\";\r\nimport { ExplorerService } from \"./ExplorerService\";\r\nimport { FileSystemService } from \"./FileSystemService\";\r\nimport { LspService } from \"./LspService\";\r\nimport { StorageService } from \"./StorageService\";\r\nimport { ThemeService } from \"./ThemeService\";\r\nimport { BasicTheme, WorkbenchConfig } from \"./types\";\r\nimport { WorkbenchService } from \"./WorkbenchService\";\r\n\r\nexport type WebPresetOptions = {\r\n rootPath?: string;\r\n config?: Partial<WorkbenchConfig>;\r\n editorConfig?: MonacoEditorOptions;\r\n theme?: BasicTheme;\r\n storeName?: string;\r\n virtualFsName?: string;\r\n workerFactories?: MonacoWorkerFactories;\r\n};\r\n\r\nexport type ElectronPresetOptions = {\r\n rootPath: string;\r\n lsp?: {\r\n disableInBuiltTypescriptWorker?: boolean;\r\n };\r\n config?: Partial<WorkbenchConfig>;\r\n editorConfig?: MonacoEditorOptions;\r\n theme?: BasicTheme;\r\n storeName?: string;\r\n workerFactories?: MonacoWorkerFactories;\r\n};\r\n\r\nexport class Workbench {\r\n static async createElectron(\r\n opts: ElectronPresetOptions,\r\n ): Promise<WorkbenchService> {\r\n const eventEmitter = new EventEmitter();\r\n\r\n const storageService = new StorageService(\r\n window,\r\n \"electron\",\r\n opts.storeName ?? \"workbench\",\r\n );\r\n await storageService.start();\r\n\r\n const lspService = opts.lsp\r\n ? new LspService(eventEmitter, {\r\n disableInBuiltTypescriptWorker:\r\n opts.lsp.disableInBuiltTypescriptWorker ?? false,\r\n defaultWorkspaceFolder: opts.rootPath,\r\n })\r\n : undefined;\r\n\r\n const fileSystem = new FileSystemService(eventEmitter, window, {\r\n mode: \"real\",\r\n });\r\n\r\n const explorerService = new ExplorerService(eventEmitter, {\r\n services: { fileSystem },\r\n rootPath: opts.rootPath,\r\n });\r\n\r\n const themeService = new ThemeService(eventEmitter);\r\n\r\n const editorService = new EditorService(eventEmitter, {\r\n services: {\r\n lspService,\r\n fileSystem,\r\n explorerService,\r\n themeService,\r\n storageService,\r\n },\r\n theme: opts.theme ?? \"Dark\",\r\n editorConfig: opts.editorConfig,\r\n workerFactories: opts.workerFactories,\r\n });\r\n\r\n return new WorkbenchService(eventEmitter, {\r\n services: {\r\n editorService,\r\n explorerService,\r\n storageService,\r\n themeService,\r\n },\r\n config: opts.config,\r\n theme: opts.theme ?? \"Dark\",\r\n });\r\n }\r\n\r\n static async createWeb(opts: WebPresetOptions = {}) {\r\n const eventEmitter = new EventEmitter();\r\n\r\n const storageService = new StorageService(\r\n window,\r\n \"web\",\r\n opts.storeName ?? \"workbench\",\r\n );\r\n await storageService.start();\r\n\r\n const fileSystem = new FileSystemService(eventEmitter, window, {\r\n mode: \"virtual\",\r\n name: opts.virtualFsName ?? \"default\",\r\n });\r\n\r\n const rootPath = opts.rootPath ?? \"/\";\r\n\r\n const explorerService = new ExplorerService(eventEmitter, {\r\n services: { fileSystem },\r\n rootPath,\r\n });\r\n\r\n const themeService = new ThemeService(eventEmitter);\r\n\r\n const editorService = new EditorService(eventEmitter, {\r\n services: { fileSystem, explorerService, themeService, storageService },\r\n theme: opts.theme ?? \"Dark\",\r\n editorConfig: opts.editorConfig,\r\n });\r\n\r\n const workbenchService = new WorkbenchService(eventEmitter, {\r\n services: {\r\n editorService,\r\n explorerService,\r\n storageService,\r\n themeService,\r\n },\r\n config: opts.config,\r\n theme: opts.theme ?? \"Dark\",\r\n });\r\n\r\n return {\r\n workbenchService,\r\n editorService,\r\n explorerService,\r\n fileSystem,\r\n storageService,\r\n };\r\n }\r\n}\r\n" | ||
| "import { EditorService } from \"./EditorService\";\r\nimport {\r\n MonacoEditorOptions,\r\n MonacoInternalServicesFactories,\r\n MonacoWorkerFactories,\r\n} from \"./EditorService/default-editors/monaco\";\r\nimport { EventEmitter } from \"./emitter\";\r\nimport { ExplorerService } from \"./ExplorerService\";\r\nimport { FileSystemService } from \"./FileSystemService\";\r\nimport { LspService } from \"./LspService\";\r\nimport { StorageService } from \"./StorageService\";\r\nimport { ThemeService } from \"./ThemeService\";\r\nimport { BasicTheme, WorkbenchConfig } from \"./types\";\r\nimport { WorkbenchService } from \"./WorkbenchService\";\r\n\r\nexport type WebPresetOptions = {\r\n rootPath?: string;\r\n config?: Partial<WorkbenchConfig>;\r\n editorConfig?: MonacoEditorOptions;\r\n theme?: BasicTheme;\r\n storeName?: string;\r\n virtualFsName?: string;\r\n workerFactories?: MonacoWorkerFactories;\r\n internalServicesFactories?: MonacoInternalServicesFactories;\r\n};\r\n\r\nexport type ElectronPresetOptions = {\r\n rootPath: string;\r\n lsp?: {\r\n disableInBuiltTypescriptWorker?: boolean;\r\n };\r\n config?: Partial<WorkbenchConfig>;\r\n editorConfig?: MonacoEditorOptions;\r\n theme?: BasicTheme;\r\n storeName?: string;\r\n workerFactories?: MonacoWorkerFactories;\r\n internalServicesFactories?: MonacoInternalServicesFactories;\r\n};\r\n\r\nexport class Workbench {\r\n static async createElectron(\r\n opts: ElectronPresetOptions,\r\n ): Promise<WorkbenchService> {\r\n const eventEmitter = new EventEmitter();\r\n\r\n const storageService = new StorageService(\r\n window,\r\n \"electron\",\r\n opts.storeName ?? \"workbench\",\r\n );\r\n await storageService.start();\r\n\r\n const lspService = opts.lsp\r\n ? new LspService(eventEmitter, {\r\n disableInBuiltTypescriptWorker:\r\n opts.lsp.disableInBuiltTypescriptWorker ?? false,\r\n defaultWorkspaceFolder: opts.rootPath,\r\n })\r\n : undefined;\r\n\r\n const fileSystem = new FileSystemService(eventEmitter, window, {\r\n mode: \"real\",\r\n });\r\n\r\n const explorerService = new ExplorerService(eventEmitter, {\r\n services: { fileSystem },\r\n rootPath: opts.rootPath,\r\n });\r\n\r\n const themeService = new ThemeService(eventEmitter);\r\n\r\n const editorService = new EditorService(eventEmitter, {\r\n services: {\r\n lspService,\r\n fileSystem,\r\n explorerService,\r\n themeService,\r\n storageService,\r\n },\r\n theme: opts.theme ?? \"Dark\",\r\n editorConfig: opts.editorConfig,\r\n interalServices: opts.internalServicesFactories,\r\n workerFactories: opts.workerFactories,\r\n });\r\n\r\n return new WorkbenchService(eventEmitter, {\r\n services: {\r\n editorService,\r\n explorerService,\r\n storageService,\r\n themeService,\r\n },\r\n config: opts.config,\r\n theme: opts.theme ?? \"Dark\",\r\n });\r\n }\r\n\r\n static async createWeb(opts: WebPresetOptions = {}) {\r\n const eventEmitter = new EventEmitter();\r\n\r\n const storageService = new StorageService(\r\n window,\r\n \"web\",\r\n opts.storeName ?? \"workbench\",\r\n );\r\n await storageService.start();\r\n\r\n const fileSystem = new FileSystemService(eventEmitter, window, {\r\n mode: \"virtual\",\r\n name: opts.virtualFsName ?? \"default\",\r\n });\r\n\r\n const rootPath = opts.rootPath ?? \"/\";\r\n\r\n const explorerService = new ExplorerService(eventEmitter, {\r\n services: { fileSystem },\r\n rootPath,\r\n });\r\n\r\n const themeService = new ThemeService(eventEmitter);\r\n\r\n const editorService = new EditorService(eventEmitter, {\r\n services: { fileSystem, explorerService, themeService, storageService },\r\n theme: opts.theme ?? \"Dark\",\r\n editorConfig: opts.editorConfig,\r\n interalServices: opts.internalServicesFactories,\r\n workerFactories: opts.workerFactories,\r\n });\r\n\r\n const workbenchService = new WorkbenchService(eventEmitter, {\r\n services: {\r\n editorService,\r\n explorerService,\r\n storageService,\r\n themeService,\r\n },\r\n config: opts.config,\r\n theme: opts.theme ?? \"Dark\",\r\n });\r\n\r\n return {\r\n workbenchService,\r\n editorService,\r\n explorerService,\r\n fileSystem,\r\n storageService,\r\n };\r\n }\r\n}\r\n" | ||
| ], | ||
| "mappings": ";;;;;;;;;;;;;;;;;AAoCO,MAAM,UAAU;AAAA,cACR,eAAc,CACzB,MAC2B;AAAA,IAC3B,MAAM,eAAe,IAAI;AAAA,IAEzB,MAAM,iBAAiB,IAAI,eACzB,QACA,YACA,KAAK,aAAa,WACpB;AAAA,IACA,MAAM,eAAe,MAAM;AAAA,IAE3B,MAAM,aAAa,KAAK,MACpB,IAAI,WAAW,cAAc;AAAA,MAC3B,gCACE,KAAK,IAAI,kCAAkC;AAAA,MAC7C,wBAAwB,KAAK;AAAA,IAC/B,CAAC,IACD;AAAA,IAEJ,MAAM,aAAa,IAAI,kBAAkB,cAAc,QAAQ;AAAA,MAC7D,MAAM;AAAA,IACR,CAAC;AAAA,IAED,MAAM,kBAAkB,IAAI,gBAAgB,cAAc;AAAA,MACxD,UAAU,EAAE,WAAW;AAAA,MACvB,UAAU,KAAK;AAAA,IACjB,CAAC;AAAA,IAED,MAAM,eAAe,IAAI,aAAa,YAAY;AAAA,IAElD,MAAM,gBAAgB,IAAI,cAAc,cAAc;AAAA,MACpD,UAAU;AAAA,QACR;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA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AAe,MAAM;AAAA,IAE3B,MAAM,aAAa,IAAI,kBAAkB,cAAc,QAAQ;AAAA,MAC7D,MAAM;AAAA,MACN,MAAM,KAAK,iBAAiB;AAAA,IAC9B,CAAC;AAAA,IAED,MAAM,WAAW,KAAK,YAAY;AAAA,IAElC,MAAM,kBAAkB,IAAI,gBAAgB,cAAc;AAAA,MACxD,UAAU,EAAE,WAAW;AAAA,MACvB;AAAA,IACF,CAAC;AAAA,IAED,MAAM,eAAe,IAAI,aAAa,YAAY;AAAA,IAElD,MAAM,gBAAgB,IAAI,cAAc,cAAc;AAAA,MACpD,UAAU,EAAE,YAAY,iBAAiB,cAAc,eAAe;AAAA,MACtE,OAAO,KAAK,SAAS;AAAA,MACrB,cAAc,KAAK;AAAA,MACnB,iBAAiB,KAAK;AAAA,MACtB,iBAAiB,KAAK;AAAA,IACxB,CAAC;AAAA,IAED,MAAM,mBAAmB,IAAI,iBAAiB,cAAc;AAAA,MAC1D,UAAU;AAAA,QACR;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,QAAQ,KAAK;AAAA,MACb,OAAO,KAAK,SAAS;AAAA,IACvB,CAAC;AAAA,IAED,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA;AAEJ;", | ||
| "debugId": "A91E67EB5EC7615864756E2164756E21", | ||
| "names": [] | ||
| } |
+1
-1
| { | ||
| "name": "@ridit/editor-services", | ||
| "version": "0.1.6", | ||
| "version": "0.1.7", | ||
| "description": "Your editor, in minutes.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -18,2 +18,3 @@ import * as monaco from "monaco-editor"; | ||
| workerFactories?: MonacoWorkerFactories; | ||
| interalServices?: MonacoInternalServicesFactories; | ||
| }; | ||
@@ -42,2 +43,6 @@ export interface ModelEntry { | ||
| }; | ||
| export type MonacoInternalServicesFactories = { | ||
| standaloneServices: () => any; | ||
| ITextModelService: () => any; | ||
| }; | ||
| export declare class MonacoEditor implements IEditor { | ||
@@ -58,2 +63,3 @@ readonly info: EditorInfo; | ||
| private readonly workerFactories; | ||
| private readonly internalServices; | ||
| constructor(eventEmitter: EventEmitter, config: MonacoEditorConfig); | ||
@@ -60,0 +66,0 @@ mount(container: HTMLElement): Promise<void>; |
@@ -8,3 +8,3 @@ import { Service } from "../service"; | ||
| import { type IEditor, type EditorInfo, type EditorId } from "./types"; | ||
| import { MonacoEditor, type MonacoEditorOptions, type MonacoWorkerFactories } from "./default-editors/monaco"; | ||
| import { MonacoEditor, type MonacoEditorOptions, type MonacoWorkerFactories, type MonacoInternalServicesFactories } from "./default-editors/monaco"; | ||
| import { TabService } from "../TabService"; | ||
@@ -15,2 +15,3 @@ import { ThemeService } from "../ThemeService"; | ||
| export type { MonacoWorkerFactories }; | ||
| export type { MonacoInternalServicesFactories }; | ||
| export type EditorRequiredServices = { | ||
@@ -27,2 +28,3 @@ lspService?: LspService; | ||
| workerFactories?: MonacoWorkerFactories; | ||
| interalServices?: MonacoInternalServicesFactories; | ||
| theme?: "Dark" | "Light"; | ||
@@ -29,0 +31,0 @@ }; |
| import { EditorService } from "./EditorService"; | ||
| import { MonacoEditorOptions, MonacoWorkerFactories } from "./EditorService/default-editors/monaco"; | ||
| import { MonacoEditorOptions, MonacoInternalServicesFactories, MonacoWorkerFactories } from "./EditorService/default-editors/monaco"; | ||
| import { ExplorerService } from "./ExplorerService"; | ||
@@ -16,2 +16,3 @@ import { FileSystemService } from "./FileSystemService"; | ||
| workerFactories?: MonacoWorkerFactories; | ||
| internalServicesFactories?: MonacoInternalServicesFactories; | ||
| }; | ||
@@ -28,2 +29,3 @@ export type ElectronPresetOptions = { | ||
| workerFactories?: MonacoWorkerFactories; | ||
| internalServicesFactories?: MonacoInternalServicesFactories; | ||
| }; | ||
@@ -30,0 +32,0 @@ export declare class Workbench { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2072542
0.18%18869
0.15%