ngssm-ace-editor 22.1.0 → 22.2.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.
@@ -1,184 +1,227 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, DOCUMENT, Injectable, EventEmitter, NgZone, Input, Output, ViewChild, Component } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
- import { BehaviorSubject, filter, take } from 'rxjs';
6
- import { NgssmComponentOverlayDirective } from 'ngssm-toolkit';
7
- import { Logger } from 'ngssm-store';
8
-
9
- class AceBuildsLoader {
10
- document = inject(DOCUMENT);
11
- logger = inject(Logger);
12
- _loading$ = new BehaviorSubject(true);
13
- _initialized = false;
14
- get loading$() {
15
- return this._loading$.asObservable();
16
- }
17
- loadScripts() {
18
- this.logger.debug(`[ace-editor] trying to get ace, isInitialized=${this._initialized}`);
19
- if (this._initialized) {
20
- return this._loading$.asObservable();
21
- }
22
- const script = this.document.createElement('script');
23
- script.type = 'text/javascript';
24
- script.src = 'ace-builds/ace.js';
25
- script.onload = () => {
26
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
- window.ace.config.set('basePath', 'ace-builds');
28
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
- window.ace.config.set('workerPath', 'ace-builds');
30
- this.logger.information(`[ace-editor] ace loaded.`);
31
- this._loading$.next(false);
32
- };
33
- this.logger.information(`[ace-editor] loading ace.`);
34
- this.document.body.appendChild(script);
35
- this._initialized = true;
36
- return this._loading$.asObservable();
37
- }
38
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: AceBuildsLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
39
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: AceBuildsLoader, providedIn: 'root' });
40
- }
41
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: AceBuildsLoader, decorators: [{
42
- type: Injectable,
43
- args: [{
44
- providedIn: 'root'
45
- }]
46
- }] });
47
-
48
- /* eslint-disable @typescript-eslint/no-explicit-any */
49
- class NgssmAceEditorApi {
50
- aceEditor;
51
- markerIds = [];
52
- constructor(aceEditor) {
53
- this.aceEditor = aceEditor;
54
- }
55
- addRowsMarker(firstRow, lastRow, cssClass) {
56
- const result = window.ace.require('ace/range');
57
- const markerId = this.aceEditor.getSession().addMarker(new result.Range(firstRow, 0, lastRow, Infinity), cssClass, 'fullLine');
58
- this.markerIds.push(markerId);
59
- }
60
- clearAllRowsMarkers() {
61
- this.markerIds.forEach((markerId) => this.aceEditor.getSession().removeMarker(markerId));
62
- this.markerIds.splice(0);
63
- }
64
- }
65
-
1
+ import * as i0 from "@angular/core";
2
+ import { Component, DOCUMENT, EventEmitter, Injectable, Input, NgZone, Output, ViewChild, inject } from "@angular/core";
3
+ import * as i1 from "@angular/common";
4
+ import { CommonModule } from "@angular/common";
5
+ import { BehaviorSubject, filter, take } from "rxjs";
6
+ import { NgssmComponentOverlayDirective } from "ngssm-toolkit";
7
+ import { Logger } from "ngssm-store";
8
+ var AceBuildsLoader = class AceBuildsLoader {
9
+ document = inject(DOCUMENT);
10
+ logger = inject(Logger);
11
+ _loading$ = new BehaviorSubject(true);
12
+ _initialized = false;
13
+ get loading$() {
14
+ return this._loading$.asObservable();
15
+ }
16
+ loadScripts() {
17
+ this.logger.debug(`[ace-editor] trying to get ace, isInitialized=${this._initialized}`);
18
+ if (this._initialized) return this._loading$.asObservable();
19
+ const script = this.document.createElement("script");
20
+ script.type = "text/javascript";
21
+ script.src = "ace-builds/ace.js";
22
+ script.onload = () => {
23
+ window.ace.config.set("basePath", "ace-builds");
24
+ window.ace.config.set("workerPath", "ace-builds");
25
+ this.logger.information(`[ace-editor] ace loaded.`);
26
+ this._loading$.next(false);
27
+ };
28
+ this.logger.information(`[ace-editor] loading ace.`);
29
+ this.document.body.appendChild(script);
30
+ this._initialized = true;
31
+ return this._loading$.asObservable();
32
+ }
33
+ static ɵfac = i0.ɵɵngDeclareFactory({
34
+ minVersion: "12.0.0",
35
+ version: "22.2.0",
36
+ ngImport: i0,
37
+ type: AceBuildsLoader,
38
+ deps: [],
39
+ target: i0.ɵɵFactoryTarget.Injectable
40
+ });
41
+ static ɵprov = i0.ɵɵngDeclareInjectable({
42
+ minVersion: "12.0.0",
43
+ version: "22.2.0",
44
+ ngImport: i0,
45
+ type: AceBuildsLoader,
46
+ providedIn: "root"
47
+ });
48
+ };
49
+ i0.ɵɵngDeclareClassMetadata({
50
+ minVersion: "12.0.0",
51
+ version: "22.2.0",
52
+ ngImport: i0,
53
+ type: AceBuildsLoader,
54
+ decorators: [{
55
+ type: Injectable,
56
+ args: [{ providedIn: "root" }]
57
+ }]
58
+ });
59
+ var NgssmAceEditorApi = class {
60
+ aceEditor;
61
+ markerIds = [];
62
+ constructor(aceEditor) {
63
+ this.aceEditor = aceEditor;
64
+ }
65
+ addRowsMarker(firstRow, lastRow, cssClass) {
66
+ const result = window.ace.require("ace/range");
67
+ const markerId = this.aceEditor.getSession().addMarker(new result.Range(firstRow, 0, lastRow, Infinity), cssClass, "fullLine");
68
+ this.markerIds.push(markerId);
69
+ }
70
+ clearAllRowsMarkers() {
71
+ this.markerIds.forEach((markerId) => this.aceEditor.getSession().removeMarker(markerId));
72
+ this.markerIds.splice(0);
73
+ }
74
+ };
66
75
  var NgssmAceEditorMode;
67
- (function (NgssmAceEditorMode) {
68
- NgssmAceEditorMode["text"] = "ace/mode/text";
69
- NgssmAceEditorMode["javascript"] = "ace/mode/javascript";
70
- NgssmAceEditorMode["python"] = "ace/mode/python";
71
- NgssmAceEditorMode["json"] = "ace/mode/json";
76
+ (function(NgssmAceEditorMode) {
77
+ NgssmAceEditorMode["text"] = "ace/mode/text";
78
+ NgssmAceEditorMode["javascript"] = "ace/mode/javascript";
79
+ NgssmAceEditorMode["python"] = "ace/mode/python";
80
+ NgssmAceEditorMode["json"] = "ace/mode/json";
72
81
  })(NgssmAceEditorMode || (NgssmAceEditorMode = {}));
73
-
74
- /* eslint-disable @typescript-eslint/no-explicit-any */
75
- class NgssmAceEditorComponent {
76
- aceEditorDiv;
77
- contentChanged = new EventEmitter();
78
- isValidChanged = new EventEmitter();
79
- editorReady = new EventEmitter();
80
- api;
81
- aceBuildsLoader = inject(AceBuildsLoader);
82
- zone = inject(NgZone);
83
- initialContent = '';
84
- initialReadonly = true;
85
- initialEditorMode = NgssmAceEditorMode.text;
86
- silentContentUpdate = false;
87
- get loading$() {
88
- return this.aceBuildsLoader.loading$;
89
- }
90
- set content(value) {
91
- if (this.api?.aceEditor) {
92
- this.silentContentUpdate = true;
93
- this.api.aceEditor.setValue(value, -1);
94
- this.silentContentUpdate = false;
95
- }
96
- else {
97
- this.initialContent = value;
98
- }
99
- }
100
- set readonly(value) {
101
- if (this.api?.aceEditor) {
102
- this.api.aceEditor.setReadOnly(value);
103
- }
104
- else {
105
- this.initialReadonly = value;
106
- }
107
- }
108
- set editorMode(value) {
109
- if (this.api?.aceEditor) {
110
- this.api.aceEditor.session.setMode(value);
111
- }
112
- else {
113
- this.initialEditorMode = value;
114
- }
115
- }
116
- ngAfterViewInit() {
117
- this.aceBuildsLoader
118
- .loadScripts()
119
- .pipe(filter((v) => !v), take(1))
120
- .subscribe(() => {
121
- this.zone.runOutsideAngular(() => {
122
- const ace = window.ace;
123
- const aceEditor = ace.edit(this.aceEditorDiv?.nativeElement);
124
- if (aceEditor) {
125
- this.api = new NgssmAceEditorApi(aceEditor);
126
- this.api.aceEditor.$blockScrolling = Infinity;
127
- this.api.aceEditor.setTheme('ace/theme/github');
128
- this.api.aceEditor.session.setMode(this.initialEditorMode);
129
- this.api.aceEditor.setReadOnly(this.initialReadonly);
130
- this.api.aceEditor.setValue(this.initialContent, -1);
131
- this.api.aceEditor.on('change', () => {
132
- if (this.api && !this.silentContentUpdate) {
133
- this.zone.run(() => this.contentChanged.emit(this.api?.aceEditor.getValue()));
134
- }
135
- });
136
- this.api.aceEditor.getSession().on('changeAnnotation', () => {
137
- if (this.api) {
138
- const annotations = this.api.aceEditor.getSession().getAnnotations();
139
- const isValid = annotations.findIndex((annotation) => annotation.type === 'error') === -1;
140
- this.zone.run(() => this.isValidChanged.emit(isValid));
141
- }
142
- });
143
- this.editorReady.emit(this.api);
144
- }
145
- });
146
- });
147
- }
148
- ngOnDestroy() {
149
- this.api?.aceEditor?.destroy();
150
- this.api = undefined;
151
- }
152
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: NgssmAceEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
153
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: NgssmAceEditorComponent, isStandalone: true, selector: "ngssm-ace-editor", inputs: { content: "content", readonly: "readonly", editorMode: "editorMode" }, outputs: { contentChanged: "contentChanged", isValidChanged: "isValidChanged", editorReady: "editorReady" }, viewQueries: [{ propertyName: "aceEditorDiv", first: true, predicate: ["aceEditor"], descendants: true }], ngImport: i0, template: "<div #aceEditor class=\"ngssm-ace-editor-container\" [ngssmDisplayOverlay]=\"(loading$ | async) === true\"></div>", styles: [":host{display:flex;flex-direction:column}:host .ngssm-ace-editor-container{flex:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgssmComponentOverlayDirective, selector: "[ngssmDisplayOverlay]", inputs: ["overlayTemplate", "overlayComponent", "overlayMessage", "ngssmDisplayOverlay"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
154
- }
155
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: NgssmAceEditorComponent, decorators: [{
156
- type: Component,
157
- args: [{ selector: 'ngssm-ace-editor', imports: [CommonModule, NgssmComponentOverlayDirective], template: "<div #aceEditor class=\"ngssm-ace-editor-container\" [ngssmDisplayOverlay]=\"(loading$ | async) === true\"></div>", styles: [":host{display:flex;flex-direction:column}:host .ngssm-ace-editor-container{flex:1}\n"] }]
158
- }], propDecorators: { aceEditorDiv: [{
159
- type: ViewChild,
160
- args: ['aceEditor']
161
- }], contentChanged: [{
162
- type: Output
163
- }], isValidChanged: [{
164
- type: Output
165
- }], editorReady: [{
166
- type: Output
167
- }], content: [{
168
- type: Input
169
- }], readonly: [{
170
- type: Input
171
- }], editorMode: [{
172
- type: Input
173
- }] } });
174
-
175
- /*
176
- * Public API Surface of ngssm-ace-editor
177
- */
178
-
179
- /**
180
- * Generated bundle index. Do not edit.
181
- */
182
-
82
+ var NgssmAceEditorComponent = class NgssmAceEditorComponent {
83
+ aceEditorDiv;
84
+ contentChanged = new EventEmitter();
85
+ isValidChanged = new EventEmitter();
86
+ editorReady = new EventEmitter();
87
+ api;
88
+ aceBuildsLoader = inject(AceBuildsLoader);
89
+ zone = inject(NgZone);
90
+ initialContent = "";
91
+ initialReadonly = true;
92
+ initialEditorMode = NgssmAceEditorMode.text;
93
+ silentContentUpdate = false;
94
+ get loading$() {
95
+ return this.aceBuildsLoader.loading$;
96
+ }
97
+ set content(value) {
98
+ if (this.api?.aceEditor) {
99
+ this.silentContentUpdate = true;
100
+ this.api.aceEditor.setValue(value, -1);
101
+ this.silentContentUpdate = false;
102
+ } else this.initialContent = value;
103
+ }
104
+ set readonly(value) {
105
+ if (this.api?.aceEditor) this.api.aceEditor.setReadOnly(value);
106
+ else this.initialReadonly = value;
107
+ }
108
+ set editorMode(value) {
109
+ if (this.api?.aceEditor) this.api.aceEditor.session.setMode(value);
110
+ else this.initialEditorMode = value;
111
+ }
112
+ ngAfterViewInit() {
113
+ this.aceBuildsLoader.loadScripts().pipe(filter((v) => !v), take(1)).subscribe(() => {
114
+ this.zone.runOutsideAngular(() => {
115
+ const aceEditor = window.ace.edit(this.aceEditorDiv?.nativeElement);
116
+ if (aceEditor) {
117
+ this.api = new NgssmAceEditorApi(aceEditor);
118
+ this.api.aceEditor.$blockScrolling = Infinity;
119
+ this.api.aceEditor.setTheme("ace/theme/github");
120
+ this.api.aceEditor.session.setMode(this.initialEditorMode);
121
+ this.api.aceEditor.setReadOnly(this.initialReadonly);
122
+ this.api.aceEditor.setValue(this.initialContent, -1);
123
+ this.api.aceEditor.on("change", () => {
124
+ if (this.api && !this.silentContentUpdate) this.zone.run(() => this.contentChanged.emit(this.api?.aceEditor.getValue()));
125
+ });
126
+ this.api.aceEditor.getSession().on("changeAnnotation", () => {
127
+ if (this.api) {
128
+ const isValid = this.api.aceEditor.getSession().getAnnotations().findIndex((annotation) => annotation.type === "error") === -1;
129
+ this.zone.run(() => this.isValidChanged.emit(isValid));
130
+ }
131
+ });
132
+ this.editorReady.emit(this.api);
133
+ }
134
+ });
135
+ });
136
+ }
137
+ ngOnDestroy() {
138
+ this.api?.aceEditor?.destroy();
139
+ this.api = void 0;
140
+ }
141
+ static ɵfac = i0.ɵɵngDeclareFactory({
142
+ minVersion: "12.0.0",
143
+ version: "22.2.0",
144
+ ngImport: i0,
145
+ type: NgssmAceEditorComponent,
146
+ deps: [],
147
+ target: i0.ɵɵFactoryTarget.Component
148
+ });
149
+ static ɵcmp = i0.ɵɵngDeclareComponent({
150
+ minVersion: "14.0.0",
151
+ version: "22.2.0",
152
+ type: NgssmAceEditorComponent,
153
+ isStandalone: true,
154
+ selector: "ngssm-ace-editor",
155
+ inputs: {
156
+ content: "content",
157
+ readonly: "readonly",
158
+ editorMode: "editorMode"
159
+ },
160
+ outputs: {
161
+ contentChanged: "contentChanged",
162
+ isValidChanged: "isValidChanged",
163
+ editorReady: "editorReady"
164
+ },
165
+ viewQueries: [{
166
+ propertyName: "aceEditorDiv",
167
+ first: true,
168
+ predicate: ["aceEditor"],
169
+ descendants: true
170
+ }],
171
+ ngImport: i0,
172
+ template: "<div #aceEditor class=\"ngssm-ace-editor-container\" [ngssmDisplayOverlay]=\"(loading$ | async) === true\"></div>",
173
+ styles: [":host{display:flex;flex-direction:column}:host .ngssm-ace-editor-container{flex:1}\n"],
174
+ dependencies: [
175
+ {
176
+ kind: "ngmodule",
177
+ type: CommonModule
178
+ },
179
+ {
180
+ kind: "directive",
181
+ type: NgssmComponentOverlayDirective,
182
+ selector: "[ngssmDisplayOverlay]",
183
+ inputs: [
184
+ "overlayTemplate",
185
+ "overlayComponent",
186
+ "overlayMessage",
187
+ "ngssmDisplayOverlay"
188
+ ]
189
+ },
190
+ {
191
+ kind: "pipe",
192
+ type: i1.AsyncPipe,
193
+ name: "async"
194
+ }
195
+ ]
196
+ });
197
+ };
198
+ i0.ɵɵngDeclareClassMetadata({
199
+ minVersion: "12.0.0",
200
+ version: "22.2.0",
201
+ ngImport: i0,
202
+ type: NgssmAceEditorComponent,
203
+ decorators: [{
204
+ type: Component,
205
+ args: [{
206
+ selector: "ngssm-ace-editor",
207
+ imports: [CommonModule, NgssmComponentOverlayDirective],
208
+ template: "<div #aceEditor class=\"ngssm-ace-editor-container\" [ngssmDisplayOverlay]=\"(loading$ | async) === true\"></div>",
209
+ styles: [":host{display:flex;flex-direction:column}:host .ngssm-ace-editor-container{flex:1}\n"]
210
+ }]
211
+ }],
212
+ propDecorators: {
213
+ aceEditorDiv: [{
214
+ type: ViewChild,
215
+ args: ["aceEditor"]
216
+ }],
217
+ contentChanged: [{ type: Output }],
218
+ isValidChanged: [{ type: Output }],
219
+ editorReady: [{ type: Output }],
220
+ content: [{ type: Input }],
221
+ readonly: [{ type: Input }],
222
+ editorMode: [{ type: Input }]
223
+ }
224
+ });
183
225
  export { AceBuildsLoader, NgssmAceEditorApi, NgssmAceEditorComponent, NgssmAceEditorMode };
184
- //# sourceMappingURL=ngssm-ace-editor.mjs.map
226
+
227
+ //# sourceMappingURL=ngssm-ace-editor.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngssm-ace-editor.mjs","sources":["../../../projects/ngssm-ace-editor/src/lib/ace-builds-loader.ts","../../../projects/ngssm-ace-editor/src/lib/ngssm-ace-editor-api.ts","../../../projects/ngssm-ace-editor/src/lib/ngssm-ace-editor-mode.ts","../../../projects/ngssm-ace-editor/src/lib/ngssm-ace-editor/ngssm-ace-editor.component.ts","../../../projects/ngssm-ace-editor/src/lib/ngssm-ace-editor/ngssm-ace-editor.component.html","../../../projects/ngssm-ace-editor/src/public-api.ts","../../../projects/ngssm-ace-editor/src/ngssm-ace-editor.ts"],"sourcesContent":["import { Injectable, DOCUMENT, inject } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\nimport { Logger } from 'ngssm-store';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AceBuildsLoader {\n private readonly document = inject(DOCUMENT);\n private readonly logger = inject(Logger);\n\n private _loading$ = new BehaviorSubject<boolean>(true);\n private _initialized = false;\n\n public get loading$(): Observable<boolean> {\n return this._loading$.asObservable();\n }\n\n public loadScripts(): Observable<boolean> {\n this.logger.debug(`[ace-editor] trying to get ace, isInitialized=${this._initialized}`);\n if (this._initialized) {\n return this._loading$.asObservable();\n }\n\n const script = this.document.createElement('script');\n script.type = 'text/javascript';\n script.src = 'ace-builds/ace.js';\n script.onload = () => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window as any).ace.config.set('basePath', 'ace-builds');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window as any).ace.config.set('workerPath', 'ace-builds');\n this.logger.information(`[ace-editor] ace loaded.`);\n this._loading$.next(false);\n };\n\n this.logger.information(`[ace-editor] loading ace.`);\n this.document.body.appendChild(script);\n\n this._initialized = true;\n return this._loading$.asObservable();\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nexport class NgssmAceEditorApi {\n private readonly markerIds: number[] = [];\n\n constructor(public aceEditor: any) {}\n\n public addRowsMarker(firstRow: number, lastRow: number, cssClass: string): void {\n const result = (window as any).ace.require('ace/range');\n const markerId = this.aceEditor.getSession().addMarker(new result.Range(firstRow, 0, lastRow, Infinity), cssClass, 'fullLine');\n this.markerIds.push(markerId);\n }\n\n public clearAllRowsMarkers(): void {\n this.markerIds.forEach((markerId) => this.aceEditor.getSession().removeMarker(markerId));\n this.markerIds.splice(0);\n }\n}\n","export enum NgssmAceEditorMode {\n text = 'ace/mode/text',\n javascript = 'ace/mode/javascript',\n python = 'ace/mode/python',\n json = 'ace/mode/json'\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { AfterViewInit, Component, ElementRef, EventEmitter, Input, NgZone, OnDestroy, Output, ViewChild, inject } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { Observable, filter, take } from 'rxjs';\n\nimport { NgssmComponentOverlayDirective } from 'ngssm-toolkit';\n\nimport { AceBuildsLoader } from '../ace-builds-loader';\nimport { NgssmAceEditorApi } from '../ngssm-ace-editor-api';\nimport { NgssmAceEditorMode } from '../ngssm-ace-editor-mode';\n\n@Component({\n selector: 'ngssm-ace-editor',\n imports: [CommonModule, NgssmComponentOverlayDirective],\n templateUrl: './ngssm-ace-editor.component.html',\n styleUrls: ['./ngssm-ace-editor.component.scss']\n})\nexport class NgssmAceEditorComponent implements AfterViewInit, OnDestroy {\n @ViewChild('aceEditor') public aceEditorDiv: ElementRef | undefined;\n @Output() public contentChanged = new EventEmitter<string>();\n @Output() public isValidChanged = new EventEmitter<boolean>();\n @Output() public editorReady = new EventEmitter<NgssmAceEditorApi>();\n\n public api: NgssmAceEditorApi | undefined;\n\n private readonly aceBuildsLoader = inject(AceBuildsLoader);\n private readonly zone = inject(NgZone);\n\n private initialContent = '';\n private initialReadonly = true;\n private initialEditorMode: string = NgssmAceEditorMode.text;\n private silentContentUpdate = false;\n\n public get loading$(): Observable<boolean> {\n return this.aceBuildsLoader.loading$;\n }\n\n @Input() public set content(value: string) {\n if (this.api?.aceEditor) {\n this.silentContentUpdate = true;\n this.api.aceEditor.setValue(value, -1);\n this.silentContentUpdate = false;\n } else {\n this.initialContent = value;\n }\n }\n\n @Input() public set readonly(value: boolean) {\n if (this.api?.aceEditor) {\n this.api.aceEditor.setReadOnly(value);\n } else {\n this.initialReadonly = value;\n }\n }\n\n @Input() public set editorMode(value: string) {\n if (this.api?.aceEditor) {\n this.api.aceEditor.session.setMode(value);\n } else {\n this.initialEditorMode = value;\n }\n }\n\n public ngAfterViewInit(): void {\n this.aceBuildsLoader\n .loadScripts()\n .pipe(\n filter((v) => !v),\n take(1)\n )\n .subscribe(() => {\n this.zone.runOutsideAngular(() => {\n const ace: any = (window as any).ace;\n const aceEditor = ace.edit(this.aceEditorDiv?.nativeElement);\n if (aceEditor) {\n this.api = new NgssmAceEditorApi(aceEditor);\n this.api.aceEditor.$blockScrolling = Infinity;\n this.api.aceEditor.setTheme('ace/theme/github');\n this.api.aceEditor.session.setMode(this.initialEditorMode);\n this.api.aceEditor.setReadOnly(this.initialReadonly);\n this.api.aceEditor.setValue(this.initialContent, -1);\n\n this.api.aceEditor.on('change', () => {\n if (this.api && !this.silentContentUpdate) {\n this.zone.run(() => this.contentChanged.emit(this.api?.aceEditor.getValue()));\n }\n });\n this.api.aceEditor.getSession().on('changeAnnotation', () => {\n if (this.api) {\n const annotations: any[] = this.api.aceEditor.getSession().getAnnotations();\n const isValid = annotations.findIndex((annotation) => annotation.type === 'error') === -1;\n this.zone.run(() => this.isValidChanged.emit(isValid));\n }\n });\n\n this.editorReady.emit(this.api);\n }\n });\n });\n }\n\n public ngOnDestroy(): void {\n this.api?.aceEditor?.destroy();\n this.api = undefined;\n }\n}\n","<div #aceEditor class=\"ngssm-ace-editor-container\" [ngssmDisplayOverlay]=\"(loading$ | async) === true\"></div>","/*\n * Public API Surface of ngssm-ace-editor\n */\n\nexport * from './lib/ngssm-ace-editor/ngssm-ace-editor.component';\nexport * from './lib/ace-builds-loader';\nexport * from './lib/ngssm-ace-editor-mode';\nexport * from './lib/ngssm-ace-editor-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAQa,eAAe,CAAA;AACT,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,IAAA,MAAM,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ib/ace-builds-loader.ts","../../../projects/ngssm-ace-editor/src/lib/ngssm-ace-editor-api.ts","../../../projects/ngssm-ace-editor/src/lib/ngssm-ace-editor-mode.ts","../../../projects/ngssm-ace-editor/src/lib/ngssm-ace-editor/ngssm-ace-editor.component.ts","../../../projects/ngssm-ace-editor/src/lib/ngssm-ace-editor/ngssm-ace-editor.component.html"],"sourcesContent":["import { Injectable, DOCUMENT, inject } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\nimport { Logger } from 'ngssm-store';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AceBuildsLoader {\n private readonly document = inject(DOCUMENT);\n private readonly logger = inject(Logger);\n\n private _loading$ = new BehaviorSubject<boolean>(true);\n private _initialized = false;\n\n public get loading$(): Observable<boolean> {\n return this._loading$.asObservable();\n }\n\n public loadScripts(): Observable<boolean> {\n this.logger.debug(`[ace-editor] trying to get ace, isInitialized=${this._initialized}`);\n if (this._initialized) {\n return this._loading$.asObservable();\n }\n\n const script = this.document.createElement('script');\n script.type = 'text/javascript';\n script.src = 'ace-builds/ace.js';\n script.onload = () => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window as any).ace.config.set('basePath', 'ace-builds');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window as any).ace.config.set('workerPath', 'ace-builds');\n this.logger.information(`[ace-editor] ace loaded.`);\n this._loading$.next(false);\n };\n\n this.logger.information(`[ace-editor] loading ace.`);\n this.document.body.appendChild(script);\n\n this._initialized = true;\n return this._loading$.asObservable();\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nexport class NgssmAceEditorApi {\n private readonly markerIds: number[] = [];\n\n constructor(public aceEditor: any) {}\n\n public addRowsMarker(firstRow: number, lastRow: number, cssClass: string): void {\n const result = (window as any).ace.require('ace/range');\n const markerId = this.aceEditor.getSession().addMarker(new result.Range(firstRow, 0, lastRow, Infinity), cssClass, 'fullLine');\n this.markerIds.push(markerId);\n }\n\n public clearAllRowsMarkers(): void {\n this.markerIds.forEach((markerId) => this.aceEditor.getSession().removeMarker(markerId));\n this.markerIds.splice(0);\n }\n}\n","export enum NgssmAceEditorMode {\n text = 'ace/mode/text',\n javascript = 'ace/mode/javascript',\n python = 'ace/mode/python',\n json = 'ace/mode/json'\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { AfterViewInit, Component, ElementRef, EventEmitter, Input, NgZone, OnDestroy, Output, ViewChild, inject } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { Observable, filter, take } from 'rxjs';\n\nimport { NgssmComponentOverlayDirective } from 'ngssm-toolkit';\n\nimport { AceBuildsLoader } from '../ace-builds-loader';\nimport { NgssmAceEditorApi } from '../ngssm-ace-editor-api';\nimport { NgssmAceEditorMode } from '../ngssm-ace-editor-mode';\n\n@Component({\n selector: 'ngssm-ace-editor',\n imports: [CommonModule, NgssmComponentOverlayDirective],\n templateUrl: './ngssm-ace-editor.component.html',\n styleUrls: ['./ngssm-ace-editor.component.scss']\n})\nexport class NgssmAceEditorComponent implements AfterViewInit, OnDestroy {\n @ViewChild('aceEditor') public aceEditorDiv: ElementRef | undefined;\n @Output() public contentChanged = new EventEmitter<string>();\n @Output() public isValidChanged = new EventEmitter<boolean>();\n @Output() public editorReady = new EventEmitter<NgssmAceEditorApi>();\n\n public api: NgssmAceEditorApi | undefined;\n\n private readonly aceBuildsLoader = inject(AceBuildsLoader);\n private readonly zone = inject(NgZone);\n\n private initialContent = '';\n private initialReadonly = true;\n private initialEditorMode: string = NgssmAceEditorMode.text;\n private silentContentUpdate = false;\n\n public get loading$(): Observable<boolean> {\n return this.aceBuildsLoader.loading$;\n }\n\n @Input() public set content(value: string) {\n if (this.api?.aceEditor) {\n this.silentContentUpdate = true;\n this.api.aceEditor.setValue(value, -1);\n this.silentContentUpdate = false;\n } else {\n this.initialContent = value;\n }\n }\n\n @Input() public set readonly(value: boolean) {\n if (this.api?.aceEditor) {\n this.api.aceEditor.setReadOnly(value);\n } else {\n this.initialReadonly = value;\n }\n }\n\n @Input() public set editorMode(value: string) {\n if (this.api?.aceEditor) {\n this.api.aceEditor.session.setMode(value);\n } else {\n this.initialEditorMode = value;\n }\n }\n\n public ngAfterViewInit(): void {\n this.aceBuildsLoader\n .loadScripts()\n .pipe(\n filter((v) => !v),\n take(1)\n )\n .subscribe(() => {\n this.zone.runOutsideAngular(() => {\n const ace: any = (window as any).ace;\n const aceEditor = ace.edit(this.aceEditorDiv?.nativeElement);\n if (aceEditor) {\n this.api = new NgssmAceEditorApi(aceEditor);\n this.api.aceEditor.$blockScrolling = Infinity;\n this.api.aceEditor.setTheme('ace/theme/github');\n this.api.aceEditor.session.setMode(this.initialEditorMode);\n this.api.aceEditor.setReadOnly(this.initialReadonly);\n this.api.aceEditor.setValue(this.initialContent, -1);\n\n this.api.aceEditor.on('change', () => {\n if (this.api && !this.silentContentUpdate) {\n this.zone.run(() => this.contentChanged.emit(this.api?.aceEditor.getValue()));\n }\n });\n this.api.aceEditor.getSession().on('changeAnnotation', () => {\n if (this.api) {\n const annotations: any[] = this.api.aceEditor.getSession().getAnnotations();\n const isValid = annotations.findIndex((annotation) => annotation.type === 'error') === -1;\n this.zone.run(() => this.isValidChanged.emit(isValid));\n }\n });\n\n this.editorReady.emit(this.api);\n }\n });\n });\n }\n\n public ngOnDestroy(): void {\n this.api?.aceEditor?.destroy();\n this.api = undefined;\n }\n}\n","<div #aceEditor class=\"ngssm-ace-editor-container\" [ngssmDisplayOverlay]=\"(loading$ | async) === true\"></div>"],"mappings":";;;;;;;AAQA,IAAa,kBAAb,MAAa,gBAAe;CACT,WAAW,OAAO,QAAQ;CAC1B,SAAS,OAAO,MAAM;CAE/B,YAAY,IAAI,gBAAyB,IAAI;CAC7C,eAAe;CAEvB,IAAW,WAAQ;EACjB,OAAO,KAAK,UAAU,aAAY;CACpC;CAEO,cAAW;EAChB,KAAK,OAAO,MAAM,iDAAiD,KAAK,cAAc;EACtF,IAAI,KAAK,cACP,OAAO,KAAK,UAAU,aAA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IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAA,GAAA;IAAA,MAAA;GAAA;EAAA;CAAA,CAAA;;AAI3C,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAuB,YAAA,CAAA;EANnC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAkB,SACnB,CAAC,cAAc,8BAA8B;GAAC,UAAA;GAAA,QAAA,CAAA,sFAAA;EAAA,CAAA;;;;GAKtD,MAAA;GAAU,MAAA,CAAA,WAAW;;EACrB,gBAAA,CAAA,EAAA,MAAA,OAAA,CAAA;EACA,gBAAA,CAAA,EAAA,MAAA,OAAA,CAAA;EACA,aAAA,CAAA,EAAA,MAAA,OAAA,CAAA;EAgBA,SAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EAUA,UAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EAQA,YAAA,CAAA,EAAA,MAAA,MAAA,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngssm-ace-editor",
3
- "version": "22.1.0",
3
+ "version": "22.2.0",
4
4
  "description": "NgSsm - Simple warpper of ace-editor.",
5
5
  "author": "Lion Marc",
6
6
  "license": "MIT",
@@ -1,53 +1,64 @@
1
- import * as i0 from '@angular/core';
2
- import { AfterViewInit, OnDestroy, ElementRef, EventEmitter } from '@angular/core';
3
- import { Observable } from 'rxjs';
4
-
5
- declare class NgssmAceEditorApi {
6
- aceEditor: any;
7
- private readonly markerIds;
8
- constructor(aceEditor: any);
9
- addRowsMarker(firstRow: number, lastRow: number, cssClass: string): void;
10
- clearAllRowsMarkers(): void;
1
+ import * as i0 from "@angular/core";
2
+ import { AfterViewInit, ElementRef, EventEmitter, OnDestroy } from "@angular/core";
3
+ import { Observable } from "rxjs";
4
+ export declare class NgssmAceEditorApi {
5
+ aceEditor: any;
6
+ private readonly markerIds;
7
+ constructor(aceEditor: any);
8
+ addRowsMarker(firstRow: number, lastRow: number, cssClass: string): void;
9
+ clearAllRowsMarkers(): void;
11
10
  }
12
-
13
- declare class NgssmAceEditorComponent implements AfterViewInit, OnDestroy {
14
- aceEditorDiv: ElementRef | undefined;
15
- contentChanged: EventEmitter<string>;
16
- isValidChanged: EventEmitter<boolean>;
17
- editorReady: EventEmitter<NgssmAceEditorApi>;
18
- api: NgssmAceEditorApi | undefined;
19
- private readonly aceBuildsLoader;
20
- private readonly zone;
21
- private initialContent;
22
- private initialReadonly;
23
- private initialEditorMode;
24
- private silentContentUpdate;
25
- get loading$(): Observable<boolean>;
26
- set content(value: string);
27
- set readonly(value: boolean);
28
- set editorMode(value: string);
29
- ngAfterViewInit(): void;
30
- ngOnDestroy(): void;
31
- static ɵfac: i0.ɵɵFactoryDeclaration<NgssmAceEditorComponent, never>;
32
- static ɵcmp: i0.ɵɵComponentDeclaration<NgssmAceEditorComponent, "ngssm-ace-editor", never, { "content": { "alias": "content"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "editorMode": { "alias": "editorMode"; "required": false; }; }, { "contentChanged": "contentChanged"; "isValidChanged": "isValidChanged"; "editorReady": "editorReady"; }, never, never, true, never>;
11
+ export declare class NgssmAceEditorComponent implements AfterViewInit, OnDestroy {
12
+ aceEditorDiv: ElementRef | undefined;
13
+ contentChanged: EventEmitter<string>;
14
+ isValidChanged: EventEmitter<boolean>;
15
+ editorReady: EventEmitter<NgssmAceEditorApi>;
16
+ api: NgssmAceEditorApi | undefined;
17
+ private readonly aceBuildsLoader;
18
+ private readonly zone;
19
+ private initialContent;
20
+ private initialReadonly;
21
+ private initialEditorMode;
22
+ private silentContentUpdate;
23
+ get loading$(): Observable<boolean>;
24
+ set content(value: string);
25
+ set readonly(value: boolean);
26
+ set editorMode(value: string);
27
+ ngAfterViewInit(): void;
28
+ ngOnDestroy(): void;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgssmAceEditorComponent, never>;
30
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgssmAceEditorComponent, "ngssm-ace-editor", never, {
31
+ "content": {
32
+ "alias": "content";
33
+ "required": false;
34
+ };
35
+ "readonly": {
36
+ "alias": "readonly";
37
+ "required": false;
38
+ };
39
+ "editorMode": {
40
+ "alias": "editorMode";
41
+ "required": false;
42
+ };
43
+ }, {
44
+ "contentChanged": "contentChanged";
45
+ "isValidChanged": "isValidChanged";
46
+ "editorReady": "editorReady";
47
+ }, never, never, true, never>;
33
48
  }
34
-
35
- declare class AceBuildsLoader {
36
- private readonly document;
37
- private readonly logger;
38
- private _loading$;
39
- private _initialized;
40
- get loading$(): Observable<boolean>;
41
- loadScripts(): Observable<boolean>;
42
- static ɵfac: i0.ɵɵFactoryDeclaration<AceBuildsLoader, never>;
43
- static ɵprov: i0.ɵɵInjectableDeclaration<AceBuildsLoader>;
49
+ export declare class AceBuildsLoader {
50
+ private readonly document;
51
+ private readonly logger;
52
+ private _loading$;
53
+ private _initialized;
54
+ get loading$(): Observable<boolean>;
55
+ loadScripts(): Observable<boolean>;
56
+ static ɵfac: i0.ɵɵFactoryDeclaration<AceBuildsLoader, never>;
57
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
44
58
  }
45
-
46
- declare enum NgssmAceEditorMode {
47
- text = "ace/mode/text",
48
- javascript = "ace/mode/javascript",
49
- python = "ace/mode/python",
50
- json = "ace/mode/json"
51
- }
52
-
53
- export { AceBuildsLoader, NgssmAceEditorApi, NgssmAceEditorComponent, NgssmAceEditorMode };
59
+ export declare enum NgssmAceEditorMode {
60
+ text = "ace/mode/text",
61
+ javascript = "ace/mode/javascript",
62
+ python = "ace/mode/python",
63
+ json = "ace/mode/json"
64
+ }