@aquera/nile-elements 0.1.67-beta-2.2 → 0.1.67-beta-2.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/demo/index.html +2 -2
- package/dist/index.js +151 -148
- package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js.map +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js.map +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.css.esm.js +120 -119
- package/dist/nile-rich-text-editor/nile-rich-text-editor.esm.js +1 -1
- package/dist/nile-rich-text-editor/nile-rte-select.cjs.js +1 -1
- package/dist/nile-rich-text-editor/nile-rte-select.cjs.js.map +1 -1
- package/dist/nile-rich-text-editor/nile-rte-select.esm.js +4 -2
- package/dist/nile-rich-text-editor/nile-rte-toolbar.cjs.js.map +1 -1
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js +119 -118
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js.map +1 -1
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.d.ts +4 -3
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js +67 -31
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js.map +1 -1
- package/dist/src/nile-rich-text-editor/nile-rte-select.js +5 -3
- package/dist/src/nile-rich-text-editor/nile-rte-select.js.map +1 -1
- package/dist/src/nile-rich-text-editor/nile-rte-toolbar.js +2 -2
- package/dist/src/nile-rich-text-editor/nile-rte-toolbar.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-rich-text-editor/nile-rich-text-editor.css.ts +120 -119
- package/src/nile-rich-text-editor/nile-rich-text-editor.ts +87 -52
- package/src/nile-rich-text-editor/nile-rte-select.ts +5 -3
- package/src/nile-rich-text-editor/nile-rte-toolbar.ts +2 -2
- package/vscode-html-custom-data.json +8 -3
package/package.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
"description": "Webcomponent nile-elements following open-wc recommendations",
|
4
4
|
"license": "MIT",
|
5
5
|
"author": "nile-elements",
|
6
|
-
"version": "0.1.67-beta-2.
|
6
|
+
"version": "0.1.67-beta-2.4",
|
7
7
|
"main": "dist/src/index.js",
|
8
8
|
"type": "module",
|
9
9
|
"module": "dist/src/index.js",
|
@@ -1,133 +1,134 @@
|
|
1
|
-
// rte-styles.ts
|
1
|
+
// FILE: src/components/rte-styles.ts
|
2
2
|
import { css } from 'lit';
|
3
3
|
|
4
4
|
export const styles = css`
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
.toolbar, nile-rte-toolbar {
|
26
|
-
|
27
|
-
width:486px;
|
28
|
-
display:flex; align-items:center; gap:6px; padding:8px;
|
29
|
-
border:1px solid #e5e7eb; border-bottom:none; border-radius:8px 8px 0 0; background:#fff;
|
30
|
-
}
|
31
|
-
|
32
|
-
nile-rte-toolbar-item > button, .toolbar button, nile-rte-toolbar button {
|
33
|
-
border:1px solid #e5e7eb; background:#fff; border-radius:6px;
|
34
|
-
cursor:pointer;
|
35
|
-
}
|
36
|
-
|
37
|
-
|
38
|
-
/* Ensure clicks hit the button (not nested icon internals) */
|
39
|
-
nile-rte-toolbar-item > button nile-icon { pointer-events:none; }
|
40
|
-
|
41
|
-
nile-rte-toolbar-item > button.active { border-color:#2563eb; background:#eff6ff; }
|
42
|
-
nile-rte-select select { height:32px; border:1px solid #e5e7eb; border-radius:6px; background:#fff; }
|
43
|
-
nile-rte-color input[type="color"] { height:32px; width:36px; border:1px solid #e5e7eb; padding:0; border-radius:6px; background:#fff; }
|
44
|
-
nile-rte-divider { width:1px; height:20px; background:#e5e7eb; display:inline-block; margin:0 4px; }
|
45
|
-
|
46
|
-
.editor p { margin:1em 0; }
|
47
|
-
.editor h1, .preview h1 { all: revert; font-size:2em, display: block;
|
48
|
-
font-size: 2em;
|
49
|
-
margin-top: 0.67em;
|
50
|
-
margin-bottom: 0.67em;
|
51
|
-
margin-left: 0;
|
52
|
-
margin-right: 0;
|
53
|
-
font-weight: bold; }
|
54
|
-
.editor h2, .preview h2 { all: revert; display: block;
|
55
|
-
font-size: 1.5em;
|
56
|
-
margin-top: 0.83em;
|
57
|
-
margin-bottom: 0.83em;
|
58
|
-
margin-left: 0;
|
59
|
-
margin-right: 0;
|
60
|
-
font-weight: bold;}
|
61
|
-
.editor h3 { font-size:1.17em }
|
62
|
-
.editor h4 { font-size:1em }
|
63
|
-
.editor h5 { font-size:0.83em }
|
64
|
-
.editor h6 { font-size:0.67em }
|
65
|
-
|
66
|
-
.editor { min-height:160px; max-width:478px; padding:12px; border:1px solid #e5e7eb; border-radius:0 0 8px 8px; background:#fff; outline:none;
|
67
|
-
tab-size: 4;
|
68
|
-
-moz-tab-size: 4;
|
69
|
-
word-break: break-word;
|
70
|
-
}
|
71
|
-
nile-rte-preview { display:block; margin-top:10px; padding:10px; border:1px dashed #cbd5e1; border-radius:8px; background:#fafafa; max-width:478px; }
|
72
|
-
|
73
|
-
.rte-color-trigger {
|
74
|
-
display: inline-flex;
|
5
|
+
.editor { all: revert; }
|
6
|
+
|
7
|
+
nile-rich-text-editor {
|
8
|
+
position: relative;
|
9
|
+
display: block;
|
10
|
+
font-family: inherit;
|
11
|
+
}
|
12
|
+
|
13
|
+
/* --- Card 1: Toolbar + Editor --- */
|
14
|
+
.rte-container {
|
15
|
+
width: 100%;
|
16
|
+
border: 1px solid #e5e7eb;
|
17
|
+
border-radius: 8px;
|
18
|
+
background: #fff;
|
19
|
+
box-sizing: border-box;
|
20
|
+
}
|
21
|
+
|
22
|
+
/* Toolbar inside container */
|
23
|
+
.rte-container nile-rte-toolbar {
|
24
|
+
display: flex;
|
75
25
|
align-items: center;
|
76
|
-
|
77
|
-
|
78
|
-
border-
|
26
|
+
gap: 6px;
|
27
|
+
padding: 8px;
|
28
|
+
border-bottom: 1px solid #e5e7eb;
|
79
29
|
background: #fff;
|
80
|
-
|
81
|
-
border:none;
|
82
|
-
|
30
|
+
border-radius: 8px 8px 0 0;
|
83
31
|
|
84
|
-
|
85
|
-
|
86
|
-
width:32px; height:32px; padding:0px 6px;
|
87
|
-
}
|
88
|
-
.rte-color-trigger .glyph-stack {
|
89
|
-
display: grid; /* stack vertically */
|
90
|
-
grid-auto-rows: max-content;
|
91
|
-
align-items: center;
|
92
|
-
justify-items: center;
|
93
|
-
line-height: 1;
|
32
|
+
width: 100%;
|
33
|
+
box-sizing: border-box;
|
94
34
|
}
|
95
35
|
|
96
|
-
.rte-color-trigger .glyph {
|
97
|
-
font-size: 14px;
|
98
|
-
line-height: 1;
|
99
|
-
margin-bottom: 2px;
|
100
|
-
}
|
101
|
-
|
102
|
-
.rte-color-trigger .underline {
|
103
|
-
width: 18px;
|
104
|
-
height: 3px;
|
105
|
-
border-radius: 2px;
|
106
|
-
background: currentColor;
|
107
|
-
}
|
108
|
-
|
109
|
-
|
110
|
-
.rte-color-trigger .swatch-box {
|
111
|
-
width: 18px;
|
112
|
-
height: 16px;
|
113
|
-
border-radius: 4px;
|
114
|
-
border: 1px solid rgba(0,0,0,0.35);
|
115
|
-
background: currentColor; /* overridden via JS */
|
116
|
-
}
|
117
36
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
37
|
+
.rte-container .editor {
|
38
|
+
min-height: 160px;
|
39
|
+
width: 100%;
|
40
|
+
padding: 12px;
|
41
|
+
background: #fff;
|
42
|
+
border-radius: 0 0 8px 8px;
|
43
|
+
outline: none;
|
44
|
+
tab-size: 4;
|
45
|
+
-moz-tab-size: 4;
|
46
|
+
word-break: break-word;
|
47
|
+
box-sizing: border-box;
|
48
|
+
border-radius: 8px;
|
49
|
+
}
|
50
|
+
|
51
|
+
/* --- Card 2: Preview --- */
|
52
|
+
/* Preview card */
|
53
|
+
nile-rte-preview {
|
54
|
+
display: block;
|
55
|
+
width: 100%;
|
56
|
+
margin-top: 16px;
|
57
|
+
padding: 12px;
|
58
|
+
border: 1px dashed #e5e7eb;
|
59
|
+
border-radius: 8px;
|
60
|
+
background: #fafafa;
|
61
|
+
box-sizing: border-box;
|
62
|
+
word-wrap: break-word;
|
127
63
|
}
|
128
64
|
|
129
65
|
|
130
|
-
|
66
|
+
/* Toolbar button styling */
|
67
|
+
nile-rte-toolbar-item nile-button::part(base) {
|
68
|
+
width: 32px;
|
69
|
+
height: 32px;
|
70
|
+
padding: 0px 6px;
|
71
|
+
border: none;
|
72
|
+
}
|
73
|
+
|
74
|
+
nile-rte-toolbar-item > button,
|
75
|
+
nile-rte-toolbar button {
|
76
|
+
border: 1px solid #e5e7eb;
|
77
|
+
background: #fff;
|
78
|
+
border-radius: 6px;
|
79
|
+
cursor: pointer;
|
80
|
+
}
|
81
|
+
|
82
|
+
nile-rte-toolbar-item > button nile-icon { pointer-events: none; }
|
83
|
+
|
84
|
+
nile-rte-toolbar-item > button.active {
|
85
|
+
border-color: #2563eb;
|
86
|
+
background: #eff6ff;
|
87
|
+
}
|
88
|
+
|
89
|
+
/* Heading normalization */
|
90
|
+
.editor p { margin: 1em 0; }
|
91
|
+
.editor h1, .preview h1 {
|
92
|
+
font-size: 2em;
|
93
|
+
margin: 0.67em 0;
|
94
|
+
font-weight: bold;
|
95
|
+
}
|
96
|
+
.editor h2, .preview h2 {
|
97
|
+
font-size: 1.5em;
|
98
|
+
margin: 0.83em 0;
|
99
|
+
font-weight: bold;
|
100
|
+
}
|
101
|
+
.editor h3 { font-size: 1.17em; }
|
102
|
+
.editor h4 { font-size: 1em; }
|
103
|
+
.editor h5 { font-size: 0.83em; }
|
104
|
+
.editor h6 { font-size: 0.67em; }
|
105
|
+
|
106
|
+
/* Single-line variant */
|
107
|
+
.editor.single-line {
|
108
|
+
min-height: 50px;
|
109
|
+
max-height: 50px;
|
110
|
+
overflow-x: auto;
|
111
|
+
white-space: nowrap;
|
112
|
+
padding: 0px 12px 0px 12px;
|
113
|
+
scrollbar-width: none;
|
114
|
+
-ms-overflow-style: none;
|
115
|
+
}
|
116
|
+
nile-rte-preview.single-line {
|
117
|
+
min-height: 50px;
|
118
|
+
max-height: 50px;
|
119
|
+
padding: 0px 12px 0px 12px;
|
120
|
+
overflow-x: auto;
|
121
|
+
white-space: nowrap;
|
122
|
+
scrollbar-width: none;
|
123
|
+
-ms-overflow-style: none;
|
124
|
+
}
|
125
|
+
nile-rte-divider {
|
126
|
+
margin: 0 4px;
|
127
|
+
display: inline-block;
|
128
|
+
height: 24px;
|
129
|
+
width: 1px;
|
130
|
+
background: #E6E9EB;
|
131
|
+
}
|
131
132
|
`;
|
132
133
|
|
133
|
-
export default [styles];
|
134
|
+
export default [styles];
|
@@ -21,10 +21,11 @@ import {styles} from './nile-rich-text-editor.css';
|
|
21
21
|
|
22
22
|
type MentionsConfig = Record<string, { key: string; label: string }[]>;
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
28
29
|
const DEFAULT_ICONS: Record<string, string> = {
|
29
30
|
bold: 'format_bold',
|
30
31
|
italic: 'format_italic',
|
@@ -42,12 +43,13 @@ const DEFAULT_ICONS: Record<string, string> = {
|
|
42
43
|
@customElement('nile-rich-text-editor')
|
43
44
|
export class NileRichTextEditor extends LitElement {
|
44
45
|
protected createRenderRoot() { return this; }
|
45
|
-
protected shouldUpdate() { return false; }
|
46
|
+
// protected shouldUpdate() { return false; }
|
46
47
|
|
47
|
-
|
48
|
+
|
48
49
|
@property({ type: String }) value = '';
|
50
|
+
@property({ type: Boolean, attribute: 'singlelineeditor' })singleLineEditor = false;
|
49
51
|
|
50
|
-
|
52
|
+
|
51
53
|
@property({
|
52
54
|
attribute: 'mentions',
|
53
55
|
converter: {
|
@@ -71,7 +73,7 @@ export class NileRichTextEditor extends LitElement {
|
|
71
73
|
})
|
72
74
|
mentions: MentionsConfig = {};
|
73
75
|
|
74
|
-
|
76
|
+
|
75
77
|
@state() private content = '';
|
76
78
|
private editorEl!: HTMLElement;
|
77
79
|
private previewEl: HTMLElement | null = null;
|
@@ -79,7 +81,7 @@ export class NileRichTextEditor extends LitElement {
|
|
79
81
|
|
80
82
|
private lastRange: Range | null = null;
|
81
83
|
|
82
|
-
|
84
|
+
|
83
85
|
private buttonMap = new Map<string, HTMLElement[]>();
|
84
86
|
private headingSelect: HTMLSelectElement | null = null;
|
85
87
|
private fontSelect: HTMLSelectElement | null = null;
|
@@ -87,9 +89,11 @@ export class NileRichTextEditor extends LitElement {
|
|
87
89
|
private bgColorInput: HTMLInputElement | null = null;
|
88
90
|
private colorSwatchEl: HTMLElement | null = null;
|
89
91
|
private bgSwatchEl: HTMLElement | null = null;
|
92
|
+
private containerEl: HTMLElement | null = null;
|
90
93
|
|
91
94
|
|
92
|
-
|
95
|
+
|
96
|
+
|
93
97
|
private mentionsEl: HTMLElement | null = null;
|
94
98
|
|
95
99
|
|
@@ -104,52 +108,61 @@ private bgSwatchEl: HTMLElement | null = null;
|
|
104
108
|
|
105
109
|
connectedCallback(): void {
|
106
110
|
super.connectedCallback();
|
111
|
+
this.injectCss(styles.cssText);
|
112
|
+
this.ensureStructure();
|
107
113
|
|
108
|
-
|
109
|
-
this.injectCss(styles.cssText);
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
this.toolbarEl = this.querySelector('nile-rte-toolbar');
|
114
|
-
this.previewEl = this.querySelector('nile-rte-preview');
|
115
|
-
|
116
|
-
|
117
|
-
this.ensureEditor();
|
118
|
-
|
119
|
-
|
120
114
|
if (this.value && !this.editorEl.innerHTML.trim()) {
|
121
115
|
this.editorEl.innerHTML = this.value;
|
122
116
|
}
|
123
117
|
this.content = this.editorEl.innerHTML;
|
124
118
|
|
125
|
-
|
126
119
|
if (this.toolbarEl) this.wireAuthoredToolbar(this.toolbarEl);
|
127
|
-
|
128
|
-
|
129
120
|
this.mentionsEl = this.querySelector('nile-rte-mentions');
|
130
121
|
if (this.mentionsEl) {
|
131
|
-
|
132
122
|
(this.mentionsEl as any).attach?.(this.editorEl, this as HTMLElement);
|
133
|
-
|
134
123
|
(this.mentionsEl as any).setExternalConfig?.(this.mentions);
|
135
124
|
}
|
136
125
|
|
137
|
-
|
138
126
|
this.wireEditor();
|
139
|
-
|
140
|
-
|
141
127
|
this.updateToolbarState();
|
142
128
|
this.syncPreview();
|
129
|
+
}
|
143
130
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
131
|
+
private ensureStructure() {
|
132
|
+
this.toolbarEl = this.querySelector('nile-rte-toolbar');
|
133
|
+
this.previewEl = this.querySelector('nile-rte-preview');
|
134
|
+
|
135
|
+
// container for toolbar + editor
|
136
|
+
this.containerEl = this.querySelector('.rte-container') as HTMLElement;
|
137
|
+
if (!this.containerEl) {
|
138
|
+
this.containerEl = document.createElement('div');
|
139
|
+
this.containerEl.className = 'rte-container';
|
140
|
+
this.appendChild(this.containerEl);
|
141
|
+
}
|
142
|
+
|
143
|
+
// ensure editor
|
144
|
+
this.ensureEditor();
|
145
|
+
|
146
|
+
// put toolbar + editor inside container
|
147
|
+
if (this.toolbarEl && this.toolbarEl.parentElement !== this.containerEl) {
|
148
|
+
this.containerEl.appendChild(this.toolbarEl);
|
149
|
+
}
|
150
|
+
if (this.editorEl.parentElement !== this.containerEl) {
|
151
|
+
this.containerEl.appendChild(this.editorEl);
|
152
|
+
}
|
153
|
+
|
154
|
+
// 👉 move preview OUTSIDE container, right after it
|
155
|
+
if (this.previewEl) {
|
156
|
+
if (this.previewEl.parentElement !== this) {
|
157
|
+
this.appendChild(this.previewEl);
|
158
|
+
}
|
159
|
+
// ensure preview is placed AFTER container
|
160
|
+
if (this.previewEl.previousElementSibling !== this.containerEl) {
|
161
|
+
this.insertBefore(this.previewEl, this.containerEl.nextSibling);
|
162
|
+
}
|
150
163
|
}
|
151
|
-
|
152
164
|
}
|
165
|
+
|
153
166
|
|
154
167
|
private updateContentWithMention(mentionDetail: any) {
|
155
168
|
this.updateContent();
|
@@ -172,30 +185,30 @@ private bgSwatchEl: HTMLElement | null = null;
|
|
172
185
|
}
|
173
186
|
super.disconnectedCallback();
|
174
187
|
}
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
188
|
+
protected updated(changed: Map<string, any>) {
|
189
|
+
if (changed.has('singleLineEditor')) {
|
190
|
+
if (this.editorEl) {
|
191
|
+
this.editorEl.classList.toggle('single-line', this.singleLineEditor);
|
192
|
+
}
|
193
|
+
if (this.previewEl) {
|
194
|
+
this.previewEl.classList.toggle('single-line', this.singleLineEditor);
|
195
|
+
}
|
196
|
+
}
|
197
|
+
}
|
198
|
+
|
179
199
|
private ensureEditor() {
|
180
200
|
this.editorEl = this.querySelector('.editor') as HTMLElement;
|
181
201
|
if (!this.editorEl) {
|
182
202
|
const editor = document.createElement('article');
|
183
203
|
editor.className = 'editor';
|
184
|
-
editor.setAttribute('contenteditable','true');
|
185
|
-
if (this.toolbarEl?.nextSibling) {
|
186
|
-
this.insertBefore(editor, this.toolbarEl.nextSibling);
|
187
|
-
} else if (this.previewEl) {
|
188
|
-
this.insertBefore(editor, this.previewEl);
|
189
|
-
} else {
|
190
|
-
this.appendChild(editor);
|
191
|
-
}
|
204
|
+
editor.setAttribute('contenteditable', 'true');
|
192
205
|
this.editorEl = editor;
|
193
206
|
}
|
194
207
|
if (!this.editorEl.innerHTML.trim()) {
|
195
208
|
this.editorEl.innerHTML = '<p><br></p>';
|
196
209
|
}
|
197
|
-
this.ensureAtLeastOneParagraph();
|
198
210
|
}
|
211
|
+
|
199
212
|
|
200
213
|
|
201
214
|
private unwrapMention(span: HTMLElement, preserveText = true) {
|
@@ -251,6 +264,22 @@ private bgSwatchEl: HTMLElement | null = null;
|
|
251
264
|
|
252
265
|
|
253
266
|
private onEditorKeydown = (e: KeyboardEvent) => {
|
267
|
+
if (this.singleLineEditor && e.key === 'Enter' && e.shiftKey) {
|
268
|
+
e.preventDefault();
|
269
|
+
return;
|
270
|
+
}
|
271
|
+
if (e.ctrlKey && e.key.toLowerCase() === 'i') {
|
272
|
+
e.preventDefault();
|
273
|
+
toggleInlineTag(this.editorEl, 'em');
|
274
|
+
this.updateContent();
|
275
|
+
this.updateToolbarState();
|
276
|
+
}
|
277
|
+
|
278
|
+
|
279
|
+
if (this.singleLineEditor && e.key === 'Enter' ) {
|
280
|
+
e.preventDefault();
|
281
|
+
return;
|
282
|
+
}
|
254
283
|
if (e.key !== 'Tab') return;
|
255
284
|
|
256
285
|
e.preventDefault();
|
@@ -365,8 +394,14 @@ private bgSwatchEl: HTMLElement | null = null;
|
|
365
394
|
child.innerHTML = '';
|
366
395
|
}
|
367
396
|
|
368
|
-
|
369
|
-
|
397
|
+
// Mount button inside tooltip
|
398
|
+
if (!btn.isConnected) {
|
399
|
+
const tooltip = document.createElement('nile-tooltip');
|
400
|
+
tooltip.setAttribute('content', label);
|
401
|
+
tooltip.appendChild(btn);
|
402
|
+
child.appendChild(tooltip);
|
403
|
+
}
|
404
|
+
|
370
405
|
|
371
406
|
// Interactions
|
372
407
|
btn.setAttribute('aria-label', label);
|
@@ -129,10 +129,11 @@ export class NileRteSelect extends LitElement {
|
|
129
129
|
box-shadow: none;
|
130
130
|
}
|
131
131
|
nile-button.rte-align-trigger::part(base) {
|
132
|
-
|
133
132
|
|
134
133
|
border: none;
|
135
134
|
}
|
135
|
+
|
136
|
+
|
136
137
|
`;
|
137
138
|
this.insertBefore(style, this.firstChild);
|
138
139
|
}
|
@@ -159,7 +160,9 @@ export class NileRteSelect extends LitElement {
|
|
159
160
|
class="rte-align-item"
|
160
161
|
?active=${o.value === this.selectedValue}
|
161
162
|
@click=${() => this.onSelect(o.value)}>
|
162
|
-
<nile-
|
163
|
+
<nile-tooltip hoist content="${o.label}">
|
164
|
+
<nile-icon name="${o.icon}"></nile-icon>
|
165
|
+
</nile-tooltip>
|
163
166
|
</nile-menu-item>
|
164
167
|
`)}
|
165
168
|
</nile-menu>
|
@@ -167,7 +170,6 @@ export class NileRteSelect extends LitElement {
|
|
167
170
|
`;
|
168
171
|
}
|
169
172
|
|
170
|
-
// ► Font: show labels, preview fonts in items and trigger
|
171
173
|
if (this.type === 'font') {
|
172
174
|
const triggerText = current?.label || this.label || 'Font';
|
173
175
|
return html`
|
@@ -3,7 +3,7 @@ import { customElement } from 'lit/decorators.js';
|
|
3
3
|
|
4
4
|
@customElement('nile-rte-toolbar')
|
5
5
|
export class NileRteToolbar extends LitElement {
|
6
|
-
protected createRenderRoot() { return this; }
|
7
|
-
protected shouldUpdate() { return false; }
|
6
|
+
protected createRenderRoot() { return this; }
|
7
|
+
protected shouldUpdate() { return false; }
|
8
8
|
}
|
9
9
|
declare global { interface HTMLElementTagNameMap { 'nile-rte-toolbar': NileRteToolbar; } }
|
@@ -2953,15 +2953,20 @@
|
|
2953
2953
|
},
|
2954
2954
|
{
|
2955
2955
|
"name": "nile-rich-text-editor",
|
2956
|
-
"description": "Events:\n\n * `content-changed` {`CustomEvent<{ content: string; mention: any; }>`} - \n\nAttributes:\n\n * `value` {`string`} -
|
2956
|
+
"description": "Events:\n\n * `content-changed` {`CustomEvent<{ content: string; mention: any; }>`} - \n\nAttributes:\n\n * `value` {`string`} - \n\n * `singlelineeditor` {`boolean`} - \n\n * `mentions` - \n\nProperties:\n\n * `value` {`string`} - \n\n * `singleLineEditor` {`boolean`} - \n\n * `mentions` - \n\n * `content` {`string`} - \n\n * `editorEl` {`HTMLElement`} - \n\n * `previewEl` {`HTMLElement | null`} - \n\n * `toolbarEl` {`HTMLElement | null`} - \n\n * `lastRange` {`Range | null`} - \n\n * `buttonMap` {`Map<string, HTMLElement[]>`} - \n\n * `headingSelect` {`HTMLSelectElement | null`} - \n\n * `fontSelect` {`HTMLSelectElement | null`} - \n\n * `colorInput` {`HTMLInputElement | null`} - \n\n * `bgColorInput` {`HTMLInputElement | null`} - \n\n * `colorSwatchEl` {`HTMLElement | null`} - \n\n * `bgSwatchEl` {`HTMLElement | null`} - \n\n * `containerEl` {`HTMLElement | null`} - \n\n * `mentionsEl` {`HTMLElement | null`} - \n\n * `onEditorKeydown` - \n\n * `onSelectionChange` - ",
|
2957
2957
|
"attributes": [
|
2958
2958
|
{
|
2959
2959
|
"name": "value",
|
2960
|
-
"description": "`value` {`string`} -
|
2960
|
+
"description": "`value` {`string`} - \n\nProperty: value\n\nDefault: "
|
2961
|
+
},
|
2962
|
+
{
|
2963
|
+
"name": "singlelineeditor",
|
2964
|
+
"description": "`singlelineeditor` {`boolean`} - \n\nProperty: singleLineEditor\n\nDefault: false",
|
2965
|
+
"valueSet": "v"
|
2961
2966
|
},
|
2962
2967
|
{
|
2963
2968
|
"name": "mentions",
|
2964
|
-
"description": "`mentions` -
|
2969
|
+
"description": "`mentions` - \n\nProperty: mentions\n\nDefault: [object Object]"
|
2965
2970
|
},
|
2966
2971
|
{
|
2967
2972
|
"name": "oncontent-changed",
|