ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
1 lines • 26.3 kB
Source Map (JSON)
{"version":3,"file":"ng-zorro-antd-code-editor.mjs","names":[],"sources":["../../components/code-editor/typings.ts","../../components/code-editor/code-editor.service.ts","../../components/code-editor/code-editor.component.ts","../../components/code-editor/code-editor.module.ts"],"sourcesContent":["/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { editor } from 'monaco-editor';\n\nimport IStandAloneEditorConstructionOptions = editor.IStandaloneEditorConstructionOptions;\nimport IDiffEditorConstructionOptions = editor.IDiffEditorConstructionOptions;\n\nexport type EditorOptions = IStandAloneEditorConstructionOptions;\nexport type DiffEditorOptions = IDiffEditorConstructionOptions;\nexport type JoinedEditorOptions = EditorOptions | DiffEditorOptions;\n\nexport type NzEditorMode = 'normal' | 'diff';\n\nexport const NzCodeEditorLoadingStatus = {\n UNLOAD: 'unload',\n LOADING: 'loading',\n LOADED: 'LOADED'\n} as const;\n\nexport type NzCodeEditorLoadingStatus = (typeof NzCodeEditorLoadingStatus)[keyof typeof NzCodeEditorLoadingStatus];\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { DOCUMENT, inject, Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable, of, ReplaySubject } from 'rxjs';\nimport { map, tap } from 'rxjs/operators';\n\nimport { CodeEditorConfig, NzConfigService, onConfigChangeEventForComponent } from 'ng-zorro-antd/core/config';\nimport { PREFIX, warn } from 'ng-zorro-antd/core/logger';\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { JoinedEditorOptions, NzCodeEditorLoadingStatus } from './typings';\n\ndeclare const monaco: NzSafeAny;\n\nconst NZ_CONFIG_MODULE_NAME = 'codeEditor';\n\nfunction tryTriggerFunc(fn?: (...args: NzSafeAny[]) => NzSafeAny): (...args: NzSafeAny) => void {\n return (...args: NzSafeAny[]) => {\n if (fn) {\n fn(...args);\n }\n };\n}\n\n// Caretaker note: previously, these were `NzCodeEditorService` properties.\n// They're kept as static variables because this will allow loading Monaco only once.\n// This applies to micro frontend apps with multiple Angular apps or a single Angular app\n// that can be bootstrapped and destroyed multiple times (e.g. using Webpack module federation).\n// Root providers are re-initialized each time the app is bootstrapped. Platform providers aren't.\n// We can't make the `NzCodeEditorService` to be a platform provider (`@Injectable({ providedIn: 'platform' })`)\n// since it depends on other root providers.\nconst loaded$ = new ReplaySubject<boolean>(1);\nlet loadingStatus: NzCodeEditorLoadingStatus = NzCodeEditorLoadingStatus.UNLOAD;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NzCodeEditorService {\n private readonly nzConfigService = inject(NzConfigService);\n private document: Document = inject(DOCUMENT);\n private firstEditorInitialized = false;\n private option: JoinedEditorOptions = {};\n private config: CodeEditorConfig;\n\n option$ = new BehaviorSubject<JoinedEditorOptions>(this.option);\n\n constructor() {\n const globalConfig = this.nzConfigService.getConfigForComponent(NZ_CONFIG_MODULE_NAME);\n\n this.config = { ...globalConfig };\n if (this.config.monacoEnvironment) {\n (this.document.defaultView as NzSafeAny).MonacoEnvironment = { ...this.config.monacoEnvironment };\n }\n this.option = this.config.defaultEditorOption || {};\n\n onConfigChangeEventForComponent(NZ_CONFIG_MODULE_NAME, () => {\n const newGlobalConfig: NzSafeAny = this.nzConfigService.getConfigForComponent(NZ_CONFIG_MODULE_NAME);\n if (newGlobalConfig) {\n this._updateDefaultOption(newGlobalConfig.defaultEditorOption);\n }\n });\n }\n\n private _updateDefaultOption(option: JoinedEditorOptions): void {\n this.option = { ...this.option, ...option };\n this.option$.next(this.option);\n\n if ('theme' in option && option.theme) {\n monaco.editor.setTheme(option.theme);\n }\n }\n\n requestToInit(): Observable<JoinedEditorOptions> {\n if (loadingStatus === NzCodeEditorLoadingStatus.LOADED) {\n this.onInit();\n return of(this.getLatestOption());\n }\n\n if (loadingStatus === NzCodeEditorLoadingStatus.UNLOAD) {\n if (this.config.useStaticLoading && typeof monaco === 'undefined') {\n warn(\n 'You choose to use static loading but it seems that you forget ' +\n 'to config webpack plugin correctly. Please refer to our official website' +\n 'for more details about static loading.'\n );\n } else {\n this.loadMonacoScript();\n }\n }\n\n return loaded$.pipe(\n tap(() => this.onInit()),\n map(() => this.getLatestOption())\n );\n }\n\n private loadMonacoScript(): void {\n if (this.config.useStaticLoading) {\n Promise.resolve().then(() => this.onLoad());\n return;\n }\n\n if (loadingStatus === NzCodeEditorLoadingStatus.LOADING) {\n return;\n }\n\n loadingStatus = NzCodeEditorLoadingStatus.LOADING;\n\n const assetsRoot = this.config.assetsRoot;\n const vs = assetsRoot ? `${assetsRoot}/vs` : 'assets/vs';\n const windowAsAny = window as NzSafeAny;\n const loadScript = this.document.createElement('script');\n\n loadScript.type = 'text/javascript';\n loadScript.src = `${vs}/loader.js`;\n\n const onLoad = (): void => {\n cleanup();\n windowAsAny.require.config({\n paths: { vs },\n ...this.config.extraConfig\n });\n windowAsAny.require(['vs/editor/editor.main'], () => {\n this.onLoad();\n });\n };\n\n const onError = (): void => {\n cleanup();\n throw new Error(`${PREFIX} cannot load assets of monaco editor from source \"${vs}\".`);\n };\n\n const cleanup = (): void => {\n // Caretaker note: we have to remove these listeners once the `<script>` is loaded successfully\n // or not since the `onLoad` listener captures `this`, which will prevent the `NzCodeEditorService`\n // from being garbage collected.\n loadScript.removeEventListener('load', onLoad);\n loadScript.removeEventListener('error', onError);\n // We don't need to keep the `<script>` element within the `<body>` since JavaScript has\n // been executed and Monaco is available globally. E.g. Webpack, always removes `<script>`\n // elements after loading chunks (see its `LoadScriptRuntimeModule`).\n this.document.documentElement.removeChild(loadScript);\n };\n\n loadScript.addEventListener('load', onLoad);\n loadScript.addEventListener('error', onError);\n\n this.document.documentElement.appendChild(loadScript);\n }\n\n private onLoad(): void {\n loadingStatus = NzCodeEditorLoadingStatus.LOADED;\n loaded$.next(true);\n loaded$.complete();\n\n tryTriggerFunc(this.config.onLoad)();\n }\n\n private onInit(): void {\n if (!this.firstEditorInitialized) {\n this.firstEditorInitialized = true;\n tryTriggerFunc(this.config.onFirstEditorInit)();\n }\n\n tryTriggerFunc(this.config.onInit)();\n }\n\n private getLatestOption(): JoinedEditorOptions {\n return { ...this.option };\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Platform } from '@angular/cdk/platform';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n AfterViewInit,\n booleanAttribute,\n Component,\n DestroyRef,\n ElementRef,\n EventEmitter,\n forwardRef,\n inject,\n Input,\n NgZone,\n Output,\n TemplateRef,\n ViewEncapsulation\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BehaviorSubject, combineLatest, Subject } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, filter, map } from 'rxjs/operators';\n\nimport type { editor, IDisposable } from 'monaco-editor';\n\nimport { warn } from 'ng-zorro-antd/core/logger';\nimport { NzSafeAny, OnChangeType, OnTouchedType } from 'ng-zorro-antd/core/types';\nimport { fromEventOutsideAngular, inNextTick } from 'ng-zorro-antd/core/util';\nimport { NzSpinComponent } from 'ng-zorro-antd/spin';\n\nimport { NzCodeEditorService } from './code-editor.service';\nimport { DiffEditorOptions, EditorOptions, JoinedEditorOptions, NzEditorMode } from './typings';\n\n// Import types from monaco editor.\ntype ITextModel = editor.ITextModel;\ntype IStandaloneCodeEditor = editor.IStandaloneCodeEditor;\ntype IStandaloneDiffEditor = editor.IStandaloneDiffEditor;\n\ndeclare const monaco: NzSafeAny;\n\n@Component({\n selector: 'nz-code-editor',\n exportAs: 'nzCodeEditor',\n encapsulation: ViewEncapsulation.None,\n template: `\n @if (nzLoading) {\n <div class=\"ant-code-editor-loading\">\n <nz-spin />\n </div>\n }\n @if (nzToolkit) {\n <div class=\"ant-code-editor-toolkit\">\n <ng-template [ngTemplateOutlet]=\"nzToolkit\" />\n </div>\n }\n `,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NzCodeEditorComponent),\n multi: true\n }\n ],\n imports: [NzSpinComponent, NgTemplateOutlet]\n})\nexport class NzCodeEditorComponent implements AfterViewInit, ControlValueAccessor {\n private nzCodeEditorService = inject(NzCodeEditorService);\n private ngZone = inject(NgZone);\n private platform = inject(Platform);\n private destroyRef = inject(DestroyRef);\n\n @Input() nzEditorMode: NzEditorMode = 'normal';\n @Input() nzOriginalText = '';\n @Input({ transform: booleanAttribute }) nzLoading = false;\n @Input({ transform: booleanAttribute }) nzFullControl = false;\n @Input() nzToolkit?: TemplateRef<void>;\n\n @Input() set nzEditorOption(value: JoinedEditorOptions) {\n this.editorOption$.next(value);\n }\n\n @Output() readonly nzEditorInitialized = new EventEmitter<IStandaloneCodeEditor | IStandaloneDiffEditor>();\n\n editorOptionCached: JoinedEditorOptions = {};\n\n private readonly el: HTMLElement = inject(ElementRef<HTMLElement>).nativeElement;\n private resize$ = new Subject<void>();\n private editorOption$ = new BehaviorSubject<JoinedEditorOptions>({});\n private editorInstance: IStandaloneCodeEditor | IStandaloneDiffEditor | null = null;\n private value = '';\n private modelSet = false;\n private onDidChangeContentDisposable: IDisposable | null = null;\n\n constructor() {\n this.el.classList.add('ant-code-editor');\n this.destroyRef.onDestroy(() => {\n if (this.onDidChangeContentDisposable) {\n this.onDidChangeContentDisposable.dispose();\n this.onDidChangeContentDisposable = null;\n }\n\n if (this.editorInstance) {\n this.editorInstance.dispose();\n this.editorInstance = null;\n }\n });\n }\n\n /**\n * Initialize a monaco editor instance.\n */\n ngAfterViewInit(): void {\n if (!this.platform.isBrowser) {\n return;\n }\n\n this.nzCodeEditorService\n .requestToInit()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(option => this.setup(option));\n }\n\n writeValue(value: string): void {\n this.value = value;\n this.setValue();\n }\n\n registerOnChange(fn: OnChangeType): NzSafeAny {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: OnTouchedType): void {\n this.onTouch = fn;\n }\n\n onChange: OnChangeType = (_value: string) => {};\n\n onTouch: OnTouchedType = () => {};\n\n layout(): void {\n this.resize$.next();\n }\n\n private setup(option: JoinedEditorOptions): void {\n // The `setup()` is invoked when the Monaco editor is loaded. This may happen asynchronously for the first\n // time, and it'll always happen synchronously afterwards. The first `setup()` invokation is outside the Angular\n // zone, but further invokations will happen within the Angular zone. We call the `setModel()` on the editor\n // instance, which tells Monaco to add event listeners lazily internally (`mousemove`, `mouseout`, etc.).\n // We should avoid adding them within the Angular zone since this will drastically affect the performance.\n this.ngZone.runOutsideAngular(() =>\n inNextTick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.editorOptionCached = option;\n this.registerOptionChanges();\n this.initMonacoEditorInstance();\n this.registerResizeChange();\n this.setValue();\n\n if (!this.nzFullControl) {\n this.setValueEmitter();\n }\n\n if (this.nzEditorInitialized.observers.length) {\n this.ngZone.run(() => this.nzEditorInitialized.emit(this.editorInstance!));\n }\n })\n );\n }\n\n private registerOptionChanges(): void {\n combineLatest([this.editorOption$, this.nzCodeEditorService.option$])\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(([selfOpt, defaultOpt]) => {\n this.editorOptionCached = {\n ...this.editorOptionCached,\n ...defaultOpt,\n ...selfOpt\n };\n this.updateOptionToMonaco();\n });\n }\n\n private initMonacoEditorInstance(): void {\n this.ngZone.runOutsideAngular(() => {\n this.editorInstance =\n this.nzEditorMode === 'normal'\n ? monaco.editor.create(this.el, { ...this.editorOptionCached })\n : monaco.editor.createDiffEditor(this.el, {\n ...(this.editorOptionCached as DiffEditorOptions)\n });\n });\n }\n\n private registerResizeChange(): void {\n fromEventOutsideAngular(window, 'resize')\n .pipe(debounceTime(300), takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.layout();\n });\n\n this.resize$\n .pipe(\n takeUntilDestroyed(this.destroyRef),\n filter(() => !!this.editorInstance),\n map(() => ({\n width: this.el.clientWidth,\n height: this.el.clientHeight\n })),\n distinctUntilChanged((a, b) => a.width === b.width && a.height === b.height),\n debounceTime(50)\n )\n .subscribe(() => {\n this.editorInstance!.layout();\n });\n }\n\n private setValue(): void {\n if (!this.editorInstance) {\n return;\n }\n\n if (this.nzFullControl && this.value) {\n warn(`should not set value when you are using full control mode! It would result in ambiguous data flow!`);\n return;\n }\n\n if (this.nzEditorMode === 'normal') {\n if (this.modelSet) {\n const model = this.editorInstance.getModel() as ITextModel;\n this.preservePositionAndSelections(() => model.setValue(this.value));\n } else {\n (this.editorInstance as IStandaloneCodeEditor).setModel(\n monaco.editor.createModel(this.value, (this.editorOptionCached as EditorOptions).language)\n );\n this.modelSet = true;\n }\n } else {\n if (this.modelSet) {\n const model = (this.editorInstance as IStandaloneDiffEditor).getModel()!;\n this.preservePositionAndSelections(() => {\n model.modified.setValue(this.value);\n model.original.setValue(this.nzOriginalText);\n });\n } else {\n const language = (this.editorOptionCached as EditorOptions).language;\n (this.editorInstance as IStandaloneDiffEditor).setModel({\n original: monaco.editor.createModel(this.nzOriginalText, language),\n modified: monaco.editor.createModel(this.value, language)\n });\n this.modelSet = true;\n }\n }\n }\n\n /**\n * {@link editor.ICodeEditor}#setValue resets the cursor position to the start of the document.\n * This helper memorizes the cursor position and selections and restores them after the given\n * function has been called.\n */\n private preservePositionAndSelections(fn: () => unknown): void {\n if (!this.editorInstance) {\n fn();\n return;\n }\n\n const position = this.editorInstance.getPosition();\n const selections = this.editorInstance.getSelections();\n\n fn();\n\n if (position) {\n this.editorInstance.setPosition(position);\n }\n if (selections) {\n this.editorInstance.setSelections(selections);\n }\n }\n\n private setValueEmitter(): void {\n const model = (\n this.nzEditorMode === 'normal'\n ? (this.editorInstance as IStandaloneCodeEditor).getModel()\n : (this.editorInstance as IStandaloneDiffEditor).getModel()!.modified\n ) as ITextModel;\n\n // The `onDidChangeContent` returns a disposable object (an object with `dispose()` method) which will cleanup\n // the listener. The callback, that we pass to `onDidChangeContent`, captures `this`. This leads to a circular reference\n // (`nz-code-editor -> monaco -> nz-code-editor`) and prevents the `nz-code-editor` from being GC'd.\n this.onDidChangeContentDisposable = model.onDidChangeContent(() => {\n this.emitValue(model.getValue());\n });\n }\n\n private emitValue(value: string): void {\n if (this.value === value) {\n // If the value didn't change there's no reason to send an update.\n // Specifically this may happen during an update from the model (writeValue) where sending an update to the model would actually be incorrect.\n return;\n }\n\n this.value = value;\n // We're re-entering the Angular zone only if the value has been changed since there's a `return` expression previously.\n // This won't cause \"dead\" change detections (basically when the `tick()` has been run, but there's nothing to update).\n this.ngZone.run(() => {\n this.onChange(value);\n });\n }\n\n private updateOptionToMonaco(): void {\n if (this.editorInstance) {\n this.editorInstance.updateOptions({ ...this.editorOptionCached });\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { NzCodeEditorComponent } from './code-editor.component';\n\n@NgModule({\n imports: [NzCodeEditorComponent],\n exports: [NzCodeEditorComponent]\n})\nexport class NzCodeEditorModule {}\n"],"mappings":";;;;;;;;;;;;AAgBA,MAAa,4BAA4B;CACvC,QAAQ;CACR,SAAS;CACT,QAAQ;AACA;ACHV,MAAM,wBAAwB;AAE9B,SAAS,eAAe,IAAwC;CAC9D,QAAQ,GAAG,SAAqB;EAC9B,IAAI,IACF,GAAG,GAAG,IAAI;CAEd;AACF;AASA,MAAM,UAAU,IAAI,cAAuB,CAAC;AAC5C,IAAI,gBAA2C,0BAA0B;AAKzE,IAAa,sBAAb,MAAa,oBAAmB;CACb,kBAAkB,OAAO,eAAe;CACjD,WAAqB,OAAO,QAAQ;CACpC,yBAAyB;CACzB,SAA8B,CAAA;CAC9B;CAER,UAAU,IAAI,gBAAqC,K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