@viveeditor/angular 0.0.0-stage → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +33 -2
- package/fesm2022/viveeditor-angular.mjs +220 -0
- package/fesm2022/viveeditor-angular.mjs.map +1 -0
- package/package.json +63 -3
- package/types/viveeditor-angular.d.ts +54 -0
- package/types/viveeditor-angular.d.ts.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 viveEditor contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @viveeditor/angular
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Angular component for viveEditor with ngModel and reactive forms, toolbar and every feature included.
|
|
4
|
+
|
|
5
|
+
Part of [viveEditor](https://github.com/mtvrkan/viveeditor#readme), a free, open-source rich text editor.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install @viveeditor/angular viveeditor
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { Component } from '@angular/core'
|
|
17
|
+
import { FormControl, ReactiveFormsModule } from '@angular/forms'
|
|
18
|
+
import { ViveEditorComponent } from '@viveeditor/angular'
|
|
19
|
+
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'app-article-form',
|
|
22
|
+
imports: [ViveEditorComponent, ReactiveFormsModule],
|
|
23
|
+
template: `<vive-ng-editor [formControl]="body" locale="tr" label="Article body" />`,
|
|
24
|
+
})
|
|
25
|
+
export class ArticleForm {
|
|
26
|
+
body = new FormControl('')
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Angular 21 and 22, with `ngModel` or reactive forms. Add `node_modules/viveeditor/dist/viveeditor.css` to the `styles` in `angular.json`.
|
|
31
|
+
|
|
32
|
+
## License
|
|
33
|
+
|
|
34
|
+
MIT
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, DestroyRef, ElementRef, afterNextRender, booleanAttribute, computed, effect, forwardRef, inject, input, output, signal } from "@angular/core";
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
4
|
+
import { mountEditor } from "viveeditor";
|
|
5
|
+
var ViveEditorComponent = class ViveEditorComponent {
|
|
6
|
+
extensions = input(...ngDevMode ? [void 0, { debugName: "extensions" }] : /* istanbul ignore next */ []);
|
|
7
|
+
ui = input(...ngDevMode ? [void 0, { debugName: "ui" }] : /* istanbul ignore next */ []);
|
|
8
|
+
locale = input(...ngDevMode ? [void 0, { debugName: "locale" }] : /* istanbul ignore next */ []);
|
|
9
|
+
label = input(...ngDevMode ? [void 0, { debugName: "label" }] : /* istanbul ignore next */ []);
|
|
10
|
+
readonly = input(false, {
|
|
11
|
+
...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
|
|
12
|
+
transform: booleanAttribute
|
|
13
|
+
});
|
|
14
|
+
ready = output();
|
|
15
|
+
editorFocus = output();
|
|
16
|
+
editorBlur = output();
|
|
17
|
+
#host = inject(ElementRef);
|
|
18
|
+
#changes = inject(ChangeDetectorRef);
|
|
19
|
+
#disabled = signal(false, ...ngDevMode ? [{ debugName: "#disabled" }] : /* istanbul ignore next */ []);
|
|
20
|
+
#editable = computed(() => !this.readonly() && !this.#disabled(), ...ngDevMode ? [{ debugName: "#editable" }] : /* istanbul ignore next */ []);
|
|
21
|
+
#mount = null;
|
|
22
|
+
#value = "";
|
|
23
|
+
#onChange = () => void 0;
|
|
24
|
+
#onTouched = () => void 0;
|
|
25
|
+
constructor() {
|
|
26
|
+
afterNextRender(() => {
|
|
27
|
+
const extensions = this.extensions();
|
|
28
|
+
const ui = this.ui();
|
|
29
|
+
const locale = this.locale();
|
|
30
|
+
const label = this.label();
|
|
31
|
+
this.#mount = mountEditor(this.#host.nativeElement, {
|
|
32
|
+
value: this.#value,
|
|
33
|
+
editable: this.#editable(),
|
|
34
|
+
...extensions === void 0 ? {} : { extensions },
|
|
35
|
+
...ui === void 0 ? {} : { ui },
|
|
36
|
+
...locale === void 0 ? {} : { locale },
|
|
37
|
+
...label === void 0 ? {} : { label },
|
|
38
|
+
onChange: (html) => {
|
|
39
|
+
this.#value = html;
|
|
40
|
+
this.#onChange(html);
|
|
41
|
+
this.#changes.markForCheck();
|
|
42
|
+
},
|
|
43
|
+
onReady: (editor) => this.ready.emit(editor),
|
|
44
|
+
onFocus: (editor) => this.editorFocus.emit(editor),
|
|
45
|
+
onBlur: (editor) => {
|
|
46
|
+
this.#onTouched();
|
|
47
|
+
this.#changes.markForCheck();
|
|
48
|
+
this.editorBlur.emit(editor);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
effect(() => {
|
|
53
|
+
const editable = this.#editable();
|
|
54
|
+
this.#mount?.setEditable(editable);
|
|
55
|
+
});
|
|
56
|
+
inject(DestroyRef).onDestroy(() => {
|
|
57
|
+
this.#mount?.destroy();
|
|
58
|
+
this.#mount = null;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
get editor() {
|
|
62
|
+
return this.#mount?.editor ?? null;
|
|
63
|
+
}
|
|
64
|
+
writeValue(value) {
|
|
65
|
+
this.#value = typeof value === "string" ? value : "";
|
|
66
|
+
this.#mount?.setValue(this.#value);
|
|
67
|
+
}
|
|
68
|
+
registerOnChange(fn) {
|
|
69
|
+
this.#onChange = fn;
|
|
70
|
+
}
|
|
71
|
+
registerOnTouched(fn) {
|
|
72
|
+
this.#onTouched = fn;
|
|
73
|
+
}
|
|
74
|
+
setDisabledState(disabled) {
|
|
75
|
+
this.#disabled.set(disabled);
|
|
76
|
+
}
|
|
77
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
78
|
+
minVersion: "12.0.0",
|
|
79
|
+
version: "22.2.3",
|
|
80
|
+
ngImport: i0,
|
|
81
|
+
type: ViveEditorComponent,
|
|
82
|
+
deps: [],
|
|
83
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
84
|
+
});
|
|
85
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
86
|
+
minVersion: "17.1.0",
|
|
87
|
+
version: "22.2.3",
|
|
88
|
+
type: ViveEditorComponent,
|
|
89
|
+
isStandalone: true,
|
|
90
|
+
selector: "vive-ng-editor",
|
|
91
|
+
inputs: {
|
|
92
|
+
extensions: {
|
|
93
|
+
classPropertyName: "extensions",
|
|
94
|
+
publicName: "extensions",
|
|
95
|
+
isSignal: true,
|
|
96
|
+
isRequired: false,
|
|
97
|
+
transformFunction: null
|
|
98
|
+
},
|
|
99
|
+
ui: {
|
|
100
|
+
classPropertyName: "ui",
|
|
101
|
+
publicName: "ui",
|
|
102
|
+
isSignal: true,
|
|
103
|
+
isRequired: false,
|
|
104
|
+
transformFunction: null
|
|
105
|
+
},
|
|
106
|
+
locale: {
|
|
107
|
+
classPropertyName: "locale",
|
|
108
|
+
publicName: "locale",
|
|
109
|
+
isSignal: true,
|
|
110
|
+
isRequired: false,
|
|
111
|
+
transformFunction: null
|
|
112
|
+
},
|
|
113
|
+
label: {
|
|
114
|
+
classPropertyName: "label",
|
|
115
|
+
publicName: "label",
|
|
116
|
+
isSignal: true,
|
|
117
|
+
isRequired: false,
|
|
118
|
+
transformFunction: null
|
|
119
|
+
},
|
|
120
|
+
readonly: {
|
|
121
|
+
classPropertyName: "readonly",
|
|
122
|
+
publicName: "readonly",
|
|
123
|
+
isSignal: true,
|
|
124
|
+
isRequired: false,
|
|
125
|
+
transformFunction: null
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
outputs: {
|
|
129
|
+
ready: "ready",
|
|
130
|
+
editorFocus: "editorFocus",
|
|
131
|
+
editorBlur: "editorBlur"
|
|
132
|
+
},
|
|
133
|
+
providers: [{
|
|
134
|
+
provide: NG_VALUE_ACCESSOR,
|
|
135
|
+
useExisting: forwardRef(() => ViveEditorComponent),
|
|
136
|
+
multi: true
|
|
137
|
+
}],
|
|
138
|
+
ngImport: i0,
|
|
139
|
+
template: "",
|
|
140
|
+
isInline: true,
|
|
141
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
145
|
+
minVersion: "12.0.0",
|
|
146
|
+
version: "22.2.3",
|
|
147
|
+
ngImport: i0,
|
|
148
|
+
type: ViveEditorComponent,
|
|
149
|
+
decorators: [{
|
|
150
|
+
type: Component,
|
|
151
|
+
args: [{
|
|
152
|
+
selector: "vive-ng-editor",
|
|
153
|
+
template: "",
|
|
154
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
155
|
+
providers: [{
|
|
156
|
+
provide: NG_VALUE_ACCESSOR,
|
|
157
|
+
useExisting: forwardRef(() => ViveEditorComponent),
|
|
158
|
+
multi: true
|
|
159
|
+
}]
|
|
160
|
+
}]
|
|
161
|
+
}],
|
|
162
|
+
ctorParameters: () => [],
|
|
163
|
+
propDecorators: {
|
|
164
|
+
extensions: [{
|
|
165
|
+
type: i0.Input,
|
|
166
|
+
args: [{
|
|
167
|
+
isSignal: true,
|
|
168
|
+
alias: "extensions",
|
|
169
|
+
required: false
|
|
170
|
+
}]
|
|
171
|
+
}],
|
|
172
|
+
ui: [{
|
|
173
|
+
type: i0.Input,
|
|
174
|
+
args: [{
|
|
175
|
+
isSignal: true,
|
|
176
|
+
alias: "ui",
|
|
177
|
+
required: false
|
|
178
|
+
}]
|
|
179
|
+
}],
|
|
180
|
+
locale: [{
|
|
181
|
+
type: i0.Input,
|
|
182
|
+
args: [{
|
|
183
|
+
isSignal: true,
|
|
184
|
+
alias: "locale",
|
|
185
|
+
required: false
|
|
186
|
+
}]
|
|
187
|
+
}],
|
|
188
|
+
label: [{
|
|
189
|
+
type: i0.Input,
|
|
190
|
+
args: [{
|
|
191
|
+
isSignal: true,
|
|
192
|
+
alias: "label",
|
|
193
|
+
required: false
|
|
194
|
+
}]
|
|
195
|
+
}],
|
|
196
|
+
readonly: [{
|
|
197
|
+
type: i0.Input,
|
|
198
|
+
args: [{
|
|
199
|
+
isSignal: true,
|
|
200
|
+
alias: "readonly",
|
|
201
|
+
required: false
|
|
202
|
+
}]
|
|
203
|
+
}],
|
|
204
|
+
ready: [{
|
|
205
|
+
type: i0.Output,
|
|
206
|
+
args: ["ready"]
|
|
207
|
+
}],
|
|
208
|
+
editorFocus: [{
|
|
209
|
+
type: i0.Output,
|
|
210
|
+
args: ["editorFocus"]
|
|
211
|
+
}],
|
|
212
|
+
editorBlur: [{
|
|
213
|
+
type: i0.Output,
|
|
214
|
+
args: ["editorBlur"]
|
|
215
|
+
}]
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
export { ViveEditorComponent };
|
|
219
|
+
|
|
220
|
+
//# sourceMappingURL=viveeditor-angular.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viveeditor-angular.mjs","names":[],"sources":["../../src/editor.component.ts"],"sourcesContent":["import {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n effect,\n forwardRef,\n type InputSignal,\n type InputSignalWithTransform,\n inject,\n input,\n type OutputEmitterRef,\n output,\n type Signal,\n signal,\n type WritableSignal,\n} from '@angular/core'\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport { type Editor, type EditorMount, type MountOptions, mountEditor } from 'viveeditor'\n\n@Component({\n selector: 'vive-ng-editor',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ViveEditorComponent),\n multi: true,\n },\n ],\n})\nexport class ViveEditorComponent implements ControlValueAccessor {\n readonly extensions: InputSignal<MountOptions['extensions']> = input<MountOptions['extensions']>()\n readonly ui: InputSignal<MountOptions['ui']> = input<MountOptions['ui']>()\n readonly locale: InputSignal<string | undefined> = input<string>()\n readonly label: InputSignal<string | undefined> = input<string>()\n readonly readonly: InputSignalWithTransform<boolean, unknown> = input(false, {\n transform: booleanAttribute,\n })\n\n readonly ready: OutputEmitterRef<Editor> = output<Editor>()\n readonly editorFocus: OutputEmitterRef<Editor> = output<Editor>()\n readonly editorBlur: OutputEmitterRef<Editor> = output<Editor>()\n\n readonly #host: ElementRef<HTMLElement> = inject(ElementRef)\n readonly #changes: ChangeDetectorRef = inject(ChangeDetectorRef)\n readonly #disabled: WritableSignal<boolean> = signal(false)\n readonly #editable: Signal<boolean> = computed(() => !this.readonly() && !this.#disabled())\n #mount: EditorMount | null = null\n #value = ''\n #onChange: (html: string) => void = () => undefined\n #onTouched: () => void = () => undefined\n\n constructor() {\n afterNextRender(() => {\n const extensions = this.extensions()\n const ui = this.ui()\n const locale = this.locale()\n const label = this.label()\n this.#mount = mountEditor(this.#host.nativeElement, {\n value: this.#value,\n editable: this.#editable(),\n ...(extensions === undefined ? {} : { extensions }),\n ...(ui === undefined ? {} : { ui }),\n ...(locale === undefined ? {} : { locale }),\n ...(label === undefined ? {} : { label }),\n onChange: (html) => {\n this.#value = html\n this.#onChange(html)\n this.#changes.markForCheck()\n },\n onReady: (editor) => this.ready.emit(editor),\n onFocus: (editor) => this.editorFocus.emit(editor),\n onBlur: (editor) => {\n this.#onTouched()\n this.#changes.markForCheck()\n this.editorBlur.emit(editor)\n },\n })\n })\n effect(() => {\n const editable = this.#editable()\n this.#mount?.setEditable(editable)\n })\n inject(DestroyRef).onDestroy(() => {\n this.#mount?.destroy()\n this.#mount = null\n })\n }\n\n get editor(): Editor | null {\n return this.#mount?.editor ?? null\n }\n\n writeValue(value: unknown): void {\n this.#value = typeof value === 'string' ? value : ''\n this.#mount?.setValue(this.#value)\n }\n\n registerOnChange(fn: (html: string) => void): void {\n this.#onChange = fn\n }\n\n registerOnTouched(fn: () => void): void {\n this.#onTouched = fn\n }\n\n setDisabledState(disabled: boolean): void {\n this.#disabled.set(disabled)\n }\n}\n"],"mappings":";;;;AAoCA,IAAa,sBAAb,MAAa,oBAAmB;CACrB,aAAsD,MAAmC,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CACzF,KAAsC,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CACjE,SAA0C,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA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;EAAA;EAAA,SAAA;GAAA,OAAA;GAAA,aAAA;GAAA,YAAA;EAAA;EAAA,WARnB,CACT;GACE,SAAS;GACT,aAAa,iBAAiB,mBAAmB;GACjD,OAAO;EACR,CACF;EAAA,UAAA;EAAA,UARS;EAAE,UAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAUD,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EAZ/B,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,iBAAiB,wBAAwB;GACzC,WAAW,CACT;IACE,SAAS;IACT,aAAa,iBAAgB,mBAAoB;IACjD,OAAO;GACR,CACF;EACF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viveeditor/angular",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
|
+
"description": "Angular component for viveEditor with ngModel and reactive forms, toolbar and every feature included.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"viveeditor",
|
|
8
|
+
"rich-text-editor",
|
|
9
|
+
"wysiwyg",
|
|
10
|
+
"editor",
|
|
11
|
+
"prosemirror",
|
|
12
|
+
"angular",
|
|
13
|
+
"ngmodel",
|
|
14
|
+
"reactive-forms"
|
|
15
|
+
],
|
|
16
|
+
"homepage": "https://editor.vivepdf.com/en/docs/frameworks/",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/mtvrkan/viveeditor/issues"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/mtvrkan/viveeditor.git",
|
|
23
|
+
"directory": "packages/angular"
|
|
24
|
+
},
|
|
25
|
+
"type": "module",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"tslib": "^2.3.0",
|
|
28
|
+
"viveeditor": "^1.0.0-rc.1"
|
|
29
|
+
},
|
|
30
|
+
"size-limit": [
|
|
31
|
+
{
|
|
32
|
+
"name": "@viveeditor/angular",
|
|
33
|
+
"path": "dist/fesm2022/viveeditor-angular.mjs",
|
|
34
|
+
"ignore": [
|
|
35
|
+
"viveeditor",
|
|
36
|
+
"@angular/core",
|
|
37
|
+
"@angular/forms"
|
|
38
|
+
],
|
|
39
|
+
"limit": "2 KB"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@angular/core": "^21.0.0 || ^22.0.0",
|
|
44
|
+
"@angular/forms": "^21.0.0 || ^22.0.0"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"directory": "dist",
|
|
48
|
+
"access": "public",
|
|
49
|
+
"provenance": true
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=22.12"
|
|
53
|
+
},
|
|
54
|
+
"module": "fesm2022/viveeditor-angular.mjs",
|
|
55
|
+
"typings": "types/viveeditor-angular.d.ts",
|
|
56
|
+
"exports": {
|
|
57
|
+
"./package.json": {
|
|
58
|
+
"default": "./package.json"
|
|
59
|
+
},
|
|
60
|
+
".": {
|
|
61
|
+
"types": "./types/viveeditor-angular.d.ts",
|
|
62
|
+
"default": "./fesm2022/viveeditor-angular.mjs"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"sideEffects": false
|
|
6
66
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { InputSignal, InputSignalWithTransform, OutputEmitterRef } from "@angular/core";
|
|
3
|
+
import { ControlValueAccessor } from "@angular/forms";
|
|
4
|
+
import { Editor, MountOptions } from "viveeditor";
|
|
5
|
+
export declare class ViveEditorComponent implements ControlValueAccessor {
|
|
6
|
+
#private;
|
|
7
|
+
readonly extensions: InputSignal<MountOptions['extensions']>;
|
|
8
|
+
readonly ui: InputSignal<MountOptions['ui']>;
|
|
9
|
+
readonly locale: InputSignal<string | undefined>;
|
|
10
|
+
readonly label: InputSignal<string | undefined>;
|
|
11
|
+
readonly readonly: InputSignalWithTransform<boolean, unknown>;
|
|
12
|
+
readonly ready: OutputEmitterRef<Editor>;
|
|
13
|
+
readonly editorFocus: OutputEmitterRef<Editor>;
|
|
14
|
+
readonly editorBlur: OutputEmitterRef<Editor>;
|
|
15
|
+
constructor();
|
|
16
|
+
get editor(): Editor | null;
|
|
17
|
+
writeValue(value: unknown): void;
|
|
18
|
+
registerOnChange(fn: (html: string) => void): void;
|
|
19
|
+
registerOnTouched(fn: () => void): void;
|
|
20
|
+
setDisabledState(disabled: boolean): void;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ViveEditorComponent, never>;
|
|
22
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ViveEditorComponent, "vive-ng-editor", never, {
|
|
23
|
+
"extensions": {
|
|
24
|
+
"alias": "extensions";
|
|
25
|
+
"required": false;
|
|
26
|
+
"isSignal": true;
|
|
27
|
+
};
|
|
28
|
+
"ui": {
|
|
29
|
+
"alias": "ui";
|
|
30
|
+
"required": false;
|
|
31
|
+
"isSignal": true;
|
|
32
|
+
};
|
|
33
|
+
"locale": {
|
|
34
|
+
"alias": "locale";
|
|
35
|
+
"required": false;
|
|
36
|
+
"isSignal": true;
|
|
37
|
+
};
|
|
38
|
+
"label": {
|
|
39
|
+
"alias": "label";
|
|
40
|
+
"required": false;
|
|
41
|
+
"isSignal": true;
|
|
42
|
+
};
|
|
43
|
+
"readonly": {
|
|
44
|
+
"alias": "readonly";
|
|
45
|
+
"required": false;
|
|
46
|
+
"isSignal": true;
|
|
47
|
+
};
|
|
48
|
+
}, {
|
|
49
|
+
"ready": "ready";
|
|
50
|
+
"editorFocus": "editorFocus";
|
|
51
|
+
"editorBlur": "editorBlur";
|
|
52
|
+
}, never, never, true, never>;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=viveeditor-angular.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viveeditor-angular.d.ts","names":[],"sources":["../../src/editor.component.ts"],"mappings":";;;;qBAoCa,+BAA+B;;WACjC,YAAY,YAAY;WACxB,IAAI,YAAY;WAChB,QAAQ;WACR,OAAO;WACP,UAAU;WAIV,OAAO,iBAAiB;WACxB,aAAa,iBAAiB;WAC9B,YAAY,iBAAiB;;MAgDlC,UAAU;EAId,WAAW;EAKX,iBAAiB,KAAK;EAItB,kBAAkB;EAIlB,iBAAiB;SA5EN,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAmB;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;;IAAA;IAAA;IAAA"}
|