@tectra-ng/editor 0.0.1 → 0.1.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tectra-ng/editor",
3
- "version": "0.0.1",
4
- "description": "Rich text editor for tectra. The first real version comes with the next tectra release.",
3
+ "version": "0.1.4",
4
+ "description": "Rich text editor for tectra: toolbar, menus, links, images, mentions and a renderer for saved HTML.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://tectra-ng.com",
7
7
  "repository": {
@@ -9,7 +9,50 @@
9
9
  "url": "git+https://github.com/kulakovskyi/tectra-ng.git",
10
10
  "directory": "packages/editor"
11
11
  },
12
+ "bugs": "https://github.com/kulakovskyi/tectra-ng/issues",
13
+ "keywords": [
14
+ "tectra",
15
+ "angular",
16
+ "editor",
17
+ "rich-text",
18
+ "wysiwyg"
19
+ ],
20
+ "peerDependencies": {
21
+ "@angular/cdk": "^22.0.0",
22
+ "@angular/common": "^22.0.0",
23
+ "@angular/core": "^22.0.0",
24
+ "@angular/forms": "^22.0.0",
25
+ "@tectra-ng/core": "^0.1.4",
26
+ "@tectra-ng/icons": "^0.1.4",
27
+ "@tectra-ng/themes": "^0.1.4",
28
+ "@tectra-ng/ui": "^0.1.4",
29
+ "@angular/platform-browser": "^22.0.0"
30
+ },
31
+ "dependencies": {
32
+ "prosemirror-model": "^1.25.12",
33
+ "prosemirror-state": "^1.4.4",
34
+ "prosemirror-transform": "^1.12.5",
35
+ "prosemirror-view": "^1.42.9",
36
+ "tslib": "^2.3.0"
37
+ },
12
38
  "publishConfig": {
13
39
  "access": "public"
14
- }
15
- }
40
+ },
41
+ "module": "fesm2022/tectra-ng-editor.mjs",
42
+ "typings": "types/tectra-ng-editor.d.ts",
43
+ "exports": {
44
+ "./package.json": {
45
+ "default": "./package.json"
46
+ },
47
+ ".": {
48
+ "types": "./types/tectra-ng-editor.d.ts",
49
+ "default": "./fesm2022/tectra-ng-editor.mjs"
50
+ },
51
+ "./content": {
52
+ "types": "./types/tectra-ng-editor-content.d.ts",
53
+ "default": "./fesm2022/tectra-ng-editor-content.mjs"
54
+ }
55
+ },
56
+ "sideEffects": false,
57
+ "type": "module"
58
+ }
@@ -0,0 +1,184 @@
1
+ import * as i0 from "@angular/core";
2
+ import { TxPassThroughOptions } from "@tectra-ng/core/config";
3
+ import { TectraDeepPartial } from "@tectra-ng/themes";
4
+ export type TxEditorFormat = 'html' | 'quill';
5
+ export type TxEditorContentPart = 'root' | 'body';
6
+ export interface TxEditorImageClickEvent {
7
+ originalEvent: MouseEvent | KeyboardEvent;
8
+ src: string;
9
+ alt: string;
10
+ }
11
+ export declare function isQuillHtml(html: string | null | undefined): boolean;
12
+ export declare function fromQuillHtml(html: string | null | undefined): string;
13
+ export declare function toQuillHtml(html: string | null | undefined): string;
14
+ export declare function toEditorHtml(html: string | null | undefined): string;
15
+ export declare function formatEditorHtml(html: string, format: TxEditorFormat): string;
16
+ export declare function sanitizeEditorHtml(html: string | null | undefined): string;
17
+ export declare class TxEditorProseStyles {
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<TxEditorProseStyles, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<TxEditorProseStyles, "tx-editor-prose-styles", never, {}, {}, never, never, true, never>;
20
+ }
21
+ export declare class TxEditorContent {
22
+ private sanitizer;
23
+ readonly html: import("@angular/core").InputSignal<string | null | undefined>;
24
+ readonly previewImages: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
25
+ readonly dt: import("@angular/core").InputSignal<TectraDeepPartial<{
26
+ root: {
27
+ color: string;
28
+ fontSize: string;
29
+ lineHeight: string;
30
+ paragraphGap: string;
31
+ blockGap: string;
32
+ };
33
+ heading: {
34
+ fontWeight: string;
35
+ lineHeight: string;
36
+ spaceBefore: string;
37
+ spaceAfter: string;
38
+ h1Size: string;
39
+ h2Size: string;
40
+ h3Size: string;
41
+ h4Size: string;
42
+ h5Size: string;
43
+ h6Size: string;
44
+ h6Color: string;
45
+ };
46
+ link: {
47
+ color: string;
48
+ underlineColor: string;
49
+ hoverUnderlineColor: string;
50
+ };
51
+ list: {
52
+ indent: string;
53
+ itemGap: string;
54
+ markerColor: string;
55
+ };
56
+ task: {
57
+ size: string;
58
+ gap: string;
59
+ borderRadius: string;
60
+ borderColor: string;
61
+ checkedBackground: string;
62
+ checkedColor: string;
63
+ doneColor: string;
64
+ };
65
+ quote: {
66
+ borderWidth: string;
67
+ borderColor: string;
68
+ padding: string;
69
+ color: string;
70
+ };
71
+ code: {
72
+ fontFamily: string;
73
+ fontSize: string;
74
+ padding: string;
75
+ borderRadius: string;
76
+ background: string;
77
+ color: string;
78
+ };
79
+ codeBlock: {
80
+ padding: string;
81
+ borderRadius: string;
82
+ background: string;
83
+ borderColor: string;
84
+ fontSize: string;
85
+ lineHeight: string;
86
+ };
87
+ rule: {
88
+ color: string;
89
+ spacing: string;
90
+ };
91
+ image: {
92
+ borderRadius: string;
93
+ selectedOutline: string;
94
+ };
95
+ video: {
96
+ borderRadius: string;
97
+ aspectRatio: string;
98
+ };
99
+ mention: {
100
+ padding: string;
101
+ borderRadius: string;
102
+ background: string;
103
+ color: string;
104
+ fontWeight: string;
105
+ };
106
+ callout: {
107
+ paddingBlock: string;
108
+ paddingInlineEnd: string;
109
+ paddingInlineStart: string;
110
+ borderRadius: string;
111
+ tint: string;
112
+ markerSize: string;
113
+ markerStart: string;
114
+ markerFontSize: string;
115
+ infoColor: string;
116
+ successColor: string;
117
+ warnColor: string;
118
+ dangerColor: string;
119
+ markerColor: string;
120
+ };
121
+ table: {
122
+ borderColor: string;
123
+ headerBackground: string;
124
+ cellPadding: string;
125
+ };
126
+ }> | undefined>;
127
+ readonly pt: import("@angular/core").InputSignal<Partial<Record<TxEditorContentPart, import("@tectra-ng/core/config").TxPassThroughValue<TxEditorContent>>> | undefined>;
128
+ readonly ptOptions: import("@angular/core").InputSignal<TxPassThroughOptions | undefined>;
129
+ readonly unstyled: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
130
+ readonly imageClick: import("@angular/core").OutputEmitterRef<TxEditorImageClickEvent>;
131
+ readonly translations: import("@angular/core").Signal<import("@tectra-ng/core/config").TxTranslations>;
132
+ readonly isUnstyled: import("@angular/core").Signal<boolean>;
133
+ readonly passThrough: import("@angular/core").Signal<Partial<Record<TxEditorContentPart, import("@tectra-ng/core/config").TxPassThroughPart>>>;
134
+ private readonly body;
135
+ protected readonly preview: import("@angular/core").WritableSignal<{
136
+ src: string;
137
+ alt: string;
138
+ } | null>;
139
+ protected readonly previewOpen: import("@angular/core").WritableSignal<boolean>;
140
+ protected readonly safeHtml: import("@angular/core").Signal<import("@angular/platform-browser").SafeHtml>;
141
+ readonly hostStyle: import("@angular/core").Signal<{
142
+ [x: string]: string;
143
+ }>;
144
+ constructor();
145
+ protected onClick(event: MouseEvent): void;
146
+ protected onKeydown(event: KeyboardEvent): void;
147
+ private open;
148
+ static ɵfac: i0.ɵɵFactoryDeclaration<TxEditorContent, never>;
149
+ static ɵcmp: i0.ɵɵComponentDeclaration<TxEditorContent, "tx-editor-content", never, {
150
+ "html": {
151
+ "alias": "html";
152
+ "required": false;
153
+ "isSignal": true;
154
+ };
155
+ "previewImages": {
156
+ "alias": "previewImages";
157
+ "required": false;
158
+ "isSignal": true;
159
+ };
160
+ "dt": {
161
+ "alias": "dt";
162
+ "required": false;
163
+ "isSignal": true;
164
+ };
165
+ "pt": {
166
+ "alias": "pt";
167
+ "required": false;
168
+ "isSignal": true;
169
+ };
170
+ "ptOptions": {
171
+ "alias": "ptOptions";
172
+ "required": false;
173
+ "isSignal": true;
174
+ };
175
+ "unstyled": {
176
+ "alias": "unstyled";
177
+ "required": false;
178
+ "isSignal": true;
179
+ };
180
+ }, {
181
+ "imageClick": "imageClick";
182
+ }, never, never, true, never>;
183
+ }
184
+ //# sourceMappingURL=tectra-ng-editor-content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tectra-ng-editor-content.d.ts","names":[],"sources":["../../../../packages/editor/content/src/editor-content.types.ts","../../../../packages/editor/content/src/editor-html.ts","../../../../packages/editor/content/src/editor-sanitizer.ts","../../../../packages/editor/content/src/editor-prose-styles.component.ts","../../../../packages/editor/content/src/editor-content.component.ts"],"mappings":";;;YAAY;YAEA;iBAEK;EACf,eAAe,aAAa;EAC5B;EACA;;wBCoHc,YAAY;wBAIZ,cAAc;wBA0Fd,YAAY;wBAiFZ,aAAa;wBAIb,iBAAiB,cAAc,QAAQ;wBCnMvC,mBAAmB;qBClGtB;SAAA,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;;qBC0CA;UACH;WAEC,8BAAI;WACJ,uCAAa;WACb,4BAAE,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WACF,4BAAE,YAAA,QAAA,OAAA,sDAAA,mBAAA;WACF,mCAAS,YAAA;WACT,kCAAQ;WAER,oCAAU,iBAAA;WAEV,sCAAY,wCAAA;WACZ,oCAAU;WACV,qCAAW,OAAA,QAAA,OAAA,sDAAA;mBACH;qBACE,iCAAO;IAAiB;IAAa;;qBACrC,qCAAW;qBACX,kCAAQ,2CAAA;WAClB,mCAAS;;;;YAqBR,QAAQ,OAAO;YAOf,UAAU,OAAO;UAQnB;SAvDG,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAe;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;;IAAA"}