@codeauradev/ngx-wind-editor 1.0.0 → 1.0.2
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/README.md +27 -9
- package/{dist/fesm2022 → fesm2022}/codeauradev-ngx-wind-editor.mjs +222 -76
- package/fesm2022/codeauradev-ngx-wind-editor.mjs.map +1 -0
- package/ngx-wind-editor.css +512 -0
- package/package.json +10 -22
- package/{dist/types → types}/codeauradev-ngx-wind-editor.d.ts +51 -5
- package/.idea/workspace.xml +0 -120
- package/dist/LICENSE +0 -21
- package/dist/README.md +0 -90
- package/dist/fesm2022/codeauradev-ngx-wind-editor.mjs.map +0 -1
- package/dist/ngx-wind-editor.css +0 -184
- package/dist/package.json +0 -48
- package/ng-package.json +0 -15
- package/scripts/patch-dist.mjs +0 -11
- package/src/catalog.ts +0 -27
- package/src/delta.ts +0 -115
- package/src/html.ts +0 -327
- package/src/public-api.ts +0 -8
- package/src/session.ts +0 -843
- package/src/styles/ngx-wind-editor.css +0 -184
- package/src/surface.ts +0 -499
- package/src/toolbar.ts +0 -53
- package/src/types.ts +0 -69
- package/src/wind-editor.ts +0 -357
- package/src/wind-icon.ts +0 -32
- package/test/editor.test.ts +0 -58
- package/tsconfig.json +0 -27
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
wind-editor,
|
|
2
|
+
.wind-editor {
|
|
3
|
+
display: block;
|
|
4
|
+
min-width: 0;
|
|
5
|
+
color: #1c1917;
|
|
6
|
+
font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.wind-frame {
|
|
10
|
+
position: relative;
|
|
11
|
+
min-width: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.wind-doc {
|
|
15
|
+
min-height: 12rem;
|
|
16
|
+
padding: 1rem 1.15rem 1.5rem;
|
|
17
|
+
outline: none;
|
|
18
|
+
color: var(--color-stone-900, #1c1917);
|
|
19
|
+
font-family: var(--font-serif, Georgia, "Iowan Old Style", "Palatino Linotype", serif);
|
|
20
|
+
font-size: 1.0625rem;
|
|
21
|
+
line-height: 1.65;
|
|
22
|
+
caret-color: var(--color-teal-700, #0f766e);
|
|
23
|
+
overflow-wrap: anywhere;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.wind-doc > * + * {
|
|
27
|
+
margin-top: 0.75rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.wind-doc p,
|
|
31
|
+
.wind-doc h1,
|
|
32
|
+
.wind-doc h2,
|
|
33
|
+
.wind-doc h3,
|
|
34
|
+
.wind-doc blockquote,
|
|
35
|
+
.wind-doc pre,
|
|
36
|
+
.wind-doc li {
|
|
37
|
+
margin: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.wind-doc h1,
|
|
41
|
+
.wind-doc h2,
|
|
42
|
+
.wind-doc h3 {
|
|
43
|
+
font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
|
|
44
|
+
line-height: 1.2;
|
|
45
|
+
letter-spacing: -0.03em;
|
|
46
|
+
color: var(--color-stone-950, #0c0a09);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.wind-doc h1 { font-size: 1.875rem; font-weight: 600; }
|
|
50
|
+
.wind-doc h2 { font-size: 1.5rem; font-weight: 600; }
|
|
51
|
+
.wind-doc h3 { font-size: 1.25rem; font-weight: 600; }
|
|
52
|
+
|
|
53
|
+
.wind-doc blockquote {
|
|
54
|
+
border-left: 2px solid var(--color-teal-700, #0f766e);
|
|
55
|
+
padding-left: 0.9rem;
|
|
56
|
+
color: var(--color-stone-600, #57534e);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.wind-doc ul,
|
|
60
|
+
.wind-doc ol {
|
|
61
|
+
margin: 0;
|
|
62
|
+
padding-left: 1.25rem;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.wind-doc li + li {
|
|
66
|
+
margin-top: 0.25rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.wind-doc pre {
|
|
70
|
+
overflow-x: auto;
|
|
71
|
+
border-radius: 0.6rem;
|
|
72
|
+
background: color-mix(in oklab, var(--color-stone-900, #1c1917) 6%, transparent);
|
|
73
|
+
padding: 0.8rem 0.9rem;
|
|
74
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
75
|
+
font-size: 0.875rem;
|
|
76
|
+
line-height: 1.55;
|
|
77
|
+
white-space: pre-wrap;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.wind-doc pre code {
|
|
81
|
+
font: inherit;
|
|
82
|
+
background: none;
|
|
83
|
+
padding: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.wind-doc a {
|
|
87
|
+
color: var(--color-teal-800, #115e59);
|
|
88
|
+
text-decoration: underline;
|
|
89
|
+
text-underline-offset: 2px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.wind-doc code {
|
|
93
|
+
border-radius: 0.3rem;
|
|
94
|
+
background: color-mix(in oklab, var(--color-stone-900, #1c1917) 8%, transparent);
|
|
95
|
+
padding: 0.05em 0.3em;
|
|
96
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
97
|
+
font-size: 0.88em;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.wind-doc img {
|
|
101
|
+
display: block;
|
|
102
|
+
max-width: 100%;
|
|
103
|
+
border-radius: 0.6rem;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.wind-doc figure {
|
|
107
|
+
margin: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.wind-doc hr {
|
|
111
|
+
border: 0;
|
|
112
|
+
border-top: 1px solid var(--color-stone-300, #d6d3d1);
|
|
113
|
+
margin: 0.25rem 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.wind-doc [data-atomic].is-selected {
|
|
117
|
+
outline: 2px solid var(--color-teal-700, #0f766e);
|
|
118
|
+
outline-offset: 3px;
|
|
119
|
+
border-radius: 0.4rem;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.wind-doc[data-empty='true'] > p[data-placeholder]:before {
|
|
123
|
+
content: attr(data-placeholder);
|
|
124
|
+
float: left;
|
|
125
|
+
height: 0;
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
color: var(--color-stone-400, #a8a29e);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.wind-carets {
|
|
131
|
+
position: absolute;
|
|
132
|
+
inset: 0;
|
|
133
|
+
pointer-events: none;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.wind-caret,
|
|
138
|
+
.wind-remote {
|
|
139
|
+
position: absolute;
|
|
140
|
+
pointer-events: none;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.wind-caret {
|
|
144
|
+
width: 2px;
|
|
145
|
+
background: var(--peer);
|
|
146
|
+
border-radius: 1px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.wind-caret i {
|
|
150
|
+
position: absolute;
|
|
151
|
+
top: -1.15rem;
|
|
152
|
+
left: -1px;
|
|
153
|
+
border-radius: 0.3rem;
|
|
154
|
+
background: var(--peer);
|
|
155
|
+
color: white;
|
|
156
|
+
padding: 0.05rem 0.3rem;
|
|
157
|
+
font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
|
|
158
|
+
font-size: 0.65rem;
|
|
159
|
+
font-style: normal;
|
|
160
|
+
line-height: 1.3;
|
|
161
|
+
letter-spacing: 0.01em;
|
|
162
|
+
white-space: nowrap;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.wind-remote {
|
|
166
|
+
background: color-mix(in oklab, var(--peer) 32%, transparent);
|
|
167
|
+
border-radius: 0.1rem;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.wind-frame.is-readonly .wind-doc {
|
|
171
|
+
caret-color: transparent;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.dark .wind-doc {
|
|
175
|
+
color: var(--color-stone-100, #f5f5f4);
|
|
176
|
+
caret-color: var(--color-teal-300, #5eead4);
|
|
177
|
+
}
|
|
178
|
+
.dark .wind-doc h1,
|
|
179
|
+
.dark .wind-doc h2,
|
|
180
|
+
.dark .wind-doc h3 { color: var(--color-stone-50, #fafaf9); }
|
|
181
|
+
.dark .wind-doc blockquote { color: var(--color-stone-400, #a8a29e); }
|
|
182
|
+
.dark .wind-doc a { color: var(--color-teal-300, #5eead4); }
|
|
183
|
+
.dark .wind-doc hr { border-top-color: var(--color-stone-700, #44403c); }
|
|
184
|
+
.dark .wind-doc pre,
|
|
185
|
+
.dark .wind-doc code {
|
|
186
|
+
background: color-mix(in oklab, white 8%, transparent);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.wind-editor.is-disabled {
|
|
190
|
+
opacity: 0.7;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.wind-shell {
|
|
194
|
+
border: 1px solid #e7e5e4;
|
|
195
|
+
border-radius: 0.75rem;
|
|
196
|
+
background: #fff;
|
|
197
|
+
color: #1c1917;
|
|
198
|
+
box-shadow: 0 1px 2px rgb(28 25 23 / 0.06);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.wind-editor.is-invalid .wind-shell {
|
|
202
|
+
border-color: #b91c1c;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.wind-toolbar,
|
|
206
|
+
.wind-pop,
|
|
207
|
+
.wind-meta,
|
|
208
|
+
.wind-error,
|
|
209
|
+
.wind-source {
|
|
210
|
+
border-color: #e7e5e4;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.wind-toolbar {
|
|
214
|
+
display: flex;
|
|
215
|
+
gap: 0.125rem;
|
|
216
|
+
overflow-x: auto;
|
|
217
|
+
border-bottom: 1px solid #e7e5e4;
|
|
218
|
+
padding: 0.375rem;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.wind-tool,
|
|
222
|
+
.wind-primary,
|
|
223
|
+
.wind-quiet,
|
|
224
|
+
.wind-field,
|
|
225
|
+
.wind-source-input {
|
|
226
|
+
font: inherit;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.wind-tool {
|
|
230
|
+
display: inline-flex;
|
|
231
|
+
height: 2.25rem;
|
|
232
|
+
flex: 0 0 auto;
|
|
233
|
+
align-items: center;
|
|
234
|
+
justify-content: center;
|
|
235
|
+
gap: 0.25rem;
|
|
236
|
+
border: 0;
|
|
237
|
+
border-radius: 0.375rem;
|
|
238
|
+
background: transparent;
|
|
239
|
+
padding: 0 0.5rem;
|
|
240
|
+
color: #57534e;
|
|
241
|
+
font-size: 0.875rem;
|
|
242
|
+
line-height: 1;
|
|
243
|
+
cursor: pointer;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.wind-tool:hover {
|
|
247
|
+
background: #f5f5f4;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.wind-tool:disabled {
|
|
251
|
+
opacity: 0.4;
|
|
252
|
+
cursor: default;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.wind-tool[aria-pressed='true'] {
|
|
256
|
+
background: #0f766e;
|
|
257
|
+
color: #fff;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.wind-tool-label {
|
|
261
|
+
padding: 0 0.125rem;
|
|
262
|
+
font-size: 0.75rem;
|
|
263
|
+
font-weight: 600;
|
|
264
|
+
letter-spacing: 0.04em;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.wind-pop,
|
|
268
|
+
.wind-source {
|
|
269
|
+
display: flex;
|
|
270
|
+
flex-wrap: wrap;
|
|
271
|
+
align-items: center;
|
|
272
|
+
gap: 0.5rem;
|
|
273
|
+
border-bottom: 1px solid #e7e5e4;
|
|
274
|
+
padding: 0.5rem 0.75rem;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.wind-source {
|
|
278
|
+
display: block;
|
|
279
|
+
border-bottom: 0;
|
|
280
|
+
border-top: 1px solid #e7e5e4;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.wind-field,
|
|
284
|
+
.wind-source-input {
|
|
285
|
+
height: 2.25rem;
|
|
286
|
+
min-width: 0;
|
|
287
|
+
flex: 1 1 12rem;
|
|
288
|
+
border: 1px solid #d6d3d1;
|
|
289
|
+
border-radius: 0.375rem;
|
|
290
|
+
background: #fff;
|
|
291
|
+
padding: 0 0.5rem;
|
|
292
|
+
color: inherit;
|
|
293
|
+
font-size: 0.875rem;
|
|
294
|
+
outline: none;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.wind-field-short {
|
|
298
|
+
flex: 0 1 9rem;
|
|
299
|
+
width: 9rem;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.wind-field:focus,
|
|
303
|
+
.wind-source-input:focus {
|
|
304
|
+
border-color: #0f766e;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.wind-source-input {
|
|
308
|
+
display: block;
|
|
309
|
+
box-sizing: border-box;
|
|
310
|
+
width: 100%;
|
|
311
|
+
height: 10rem;
|
|
312
|
+
resize: vertical;
|
|
313
|
+
padding: 0.5rem;
|
|
314
|
+
background: #fafaf9;
|
|
315
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
316
|
+
font-size: 0.75rem;
|
|
317
|
+
line-height: 1.5;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.wind-primary,
|
|
321
|
+
.wind-quiet {
|
|
322
|
+
height: 2.25rem;
|
|
323
|
+
border: 0;
|
|
324
|
+
border-radius: 0.375rem;
|
|
325
|
+
cursor: pointer;
|
|
326
|
+
font-size: 0.875rem;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.wind-primary {
|
|
330
|
+
background: #0f766e;
|
|
331
|
+
padding: 0 0.75rem;
|
|
332
|
+
color: #fff;
|
|
333
|
+
font-weight: 500;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.wind-quiet {
|
|
337
|
+
background: transparent;
|
|
338
|
+
padding: 0 0.5rem;
|
|
339
|
+
color: #57534e;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.wind-source .wind-primary {
|
|
343
|
+
margin-top: 0.5rem;
|
|
344
|
+
background: #1c1917;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.wind-surface {
|
|
348
|
+
position: relative;
|
|
349
|
+
min-height: 12rem;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.wind-menu {
|
|
353
|
+
position: fixed;
|
|
354
|
+
z-index: 30;
|
|
355
|
+
max-height: 16rem;
|
|
356
|
+
width: 14rem;
|
|
357
|
+
overflow: auto;
|
|
358
|
+
margin: 0;
|
|
359
|
+
border: 1px solid #e7e5e4;
|
|
360
|
+
border-radius: 0.5rem;
|
|
361
|
+
background: #fff;
|
|
362
|
+
padding: 0.25rem 0;
|
|
363
|
+
list-style: none;
|
|
364
|
+
box-shadow: 0 10px 24px rgb(28 25 23 / 0.12);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.wind-option {
|
|
368
|
+
display: flex;
|
|
369
|
+
width: 100%;
|
|
370
|
+
align-items: baseline;
|
|
371
|
+
justify-content: space-between;
|
|
372
|
+
gap: 0.75rem;
|
|
373
|
+
border: 0;
|
|
374
|
+
background: transparent;
|
|
375
|
+
padding: 0.375rem 0.75rem;
|
|
376
|
+
color: inherit;
|
|
377
|
+
font: inherit;
|
|
378
|
+
font-size: 0.875rem;
|
|
379
|
+
text-align: left;
|
|
380
|
+
cursor: pointer;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.wind-option:hover,
|
|
384
|
+
.wind-option.is-active {
|
|
385
|
+
background: #f5f5f4;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.wind-option.is-active {
|
|
389
|
+
background: #0f766e;
|
|
390
|
+
color: #fff;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.wind-option-hint {
|
|
394
|
+
font-size: 0.75rem;
|
|
395
|
+
opacity: 0.7;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.wind-meta,
|
|
399
|
+
.wind-error {
|
|
400
|
+
display: flex;
|
|
401
|
+
align-items: center;
|
|
402
|
+
justify-content: space-between;
|
|
403
|
+
gap: 0.75rem;
|
|
404
|
+
border-top: 1px solid #e7e5e4;
|
|
405
|
+
padding: 0.375rem 0.75rem;
|
|
406
|
+
color: #78716c;
|
|
407
|
+
font-size: 0.75rem;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.wind-meta-hint {
|
|
411
|
+
color: #a8a29e;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.wind-error {
|
|
415
|
+
color: #b91c1c;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.wind-sr {
|
|
419
|
+
position: absolute;
|
|
420
|
+
width: 1px;
|
|
421
|
+
height: 1px;
|
|
422
|
+
padding: 0;
|
|
423
|
+
margin: -1px;
|
|
424
|
+
overflow: hidden;
|
|
425
|
+
clip: rect(0, 0, 0, 0);
|
|
426
|
+
white-space: nowrap;
|
|
427
|
+
border: 0;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.dark .wind-shell,
|
|
431
|
+
.dark.wind-editor .wind-shell {
|
|
432
|
+
border-color: #292524;
|
|
433
|
+
background: #0c0a09;
|
|
434
|
+
color: #f5f5f4;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.dark .wind-editor.is-invalid .wind-shell,
|
|
438
|
+
.dark.wind-editor.is-invalid .wind-shell {
|
|
439
|
+
border-color: #f87171;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
.dark .wind-toolbar,
|
|
443
|
+
.dark .wind-pop,
|
|
444
|
+
.dark .wind-meta,
|
|
445
|
+
.dark .wind-source,
|
|
446
|
+
.dark.wind-editor .wind-toolbar,
|
|
447
|
+
.dark.wind-editor .wind-pop,
|
|
448
|
+
.dark.wind-editor .wind-meta,
|
|
449
|
+
.dark.wind-editor .wind-source {
|
|
450
|
+
border-color: #292524;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.dark .wind-tool,
|
|
454
|
+
.dark .wind-quiet,
|
|
455
|
+
.dark.wind-editor .wind-tool,
|
|
456
|
+
.dark.wind-editor .wind-quiet {
|
|
457
|
+
color: #d6d3d1;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.dark .wind-tool:hover,
|
|
461
|
+
.dark.wind-editor .wind-tool:hover {
|
|
462
|
+
background: #1c1917;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.dark .wind-tool[aria-pressed='true'],
|
|
466
|
+
.dark.wind-editor .wind-tool[aria-pressed='true'] {
|
|
467
|
+
background: #0d9488;
|
|
468
|
+
color: #fff;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.dark .wind-field,
|
|
472
|
+
.dark .wind-source-input,
|
|
473
|
+
.dark.wind-editor .wind-field,
|
|
474
|
+
.dark.wind-editor .wind-source-input {
|
|
475
|
+
border-color: #44403c;
|
|
476
|
+
background: #1c1917;
|
|
477
|
+
color: #f5f5f4;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.dark .wind-source .wind-primary,
|
|
481
|
+
.dark.wind-editor .wind-source .wind-primary {
|
|
482
|
+
background: #f5f5f4;
|
|
483
|
+
color: #1c1917;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.dark .wind-menu,
|
|
487
|
+
.dark.wind-editor .wind-menu {
|
|
488
|
+
border-color: #44403c;
|
|
489
|
+
background: #1c1917;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.dark .wind-option:hover,
|
|
493
|
+
.dark.wind-editor .wind-option:hover {
|
|
494
|
+
background: #292524;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.dark .wind-option.is-active,
|
|
498
|
+
.dark.wind-editor .wind-option.is-active {
|
|
499
|
+
background: #0f766e;
|
|
500
|
+
color: #fff;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.dark .wind-meta,
|
|
504
|
+
.dark.wind-editor .wind-meta {
|
|
505
|
+
color: #a8a29e;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.dark .wind-error,
|
|
509
|
+
.dark.wind-editor .wind-error {
|
|
510
|
+
border-color: #7f1d1d;
|
|
511
|
+
color: #fca5a5;
|
|
512
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeauradev/ngx-wind-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "WYSIWYG HTML editor for Angular 22, styled with Tailwind CSS v4.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -20,19 +20,21 @@
|
|
|
20
20
|
"styles.css"
|
|
21
21
|
],
|
|
22
22
|
"type": "module",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"types": "./src/public-api.ts",
|
|
26
|
-
"typings": "./src/public-api.ts",
|
|
23
|
+
"module": "fesm2022/codeauradev-ngx-wind-editor.mjs",
|
|
24
|
+
"typings": "types/codeauradev-ngx-wind-editor.d.ts",
|
|
27
25
|
"exports": {
|
|
28
26
|
".": {
|
|
29
|
-
"types": "./
|
|
30
|
-
"default": "./
|
|
27
|
+
"types": "./types/codeauradev-ngx-wind-editor.d.ts",
|
|
28
|
+
"default": "./fesm2022/codeauradev-ngx-wind-editor.mjs"
|
|
31
29
|
},
|
|
32
|
-
"./styles.css": "./
|
|
30
|
+
"./styles.css": "./ngx-wind-editor.css",
|
|
31
|
+
"./package.json": {
|
|
32
|
+
"default": "./package.json"
|
|
33
|
+
}
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|
|
35
36
|
"@angular/core": "^22.0.0",
|
|
37
|
+
"@angular/forms": "^22.0.0",
|
|
36
38
|
"tailwindcss": "^4.0.0"
|
|
37
39
|
},
|
|
38
40
|
"peerDependenciesMeta": {
|
|
@@ -43,19 +45,5 @@
|
|
|
43
45
|
"dependencies": {
|
|
44
46
|
"tslib": "^2.8.1",
|
|
45
47
|
"yjs": "^13.6.27"
|
|
46
|
-
},
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"@angular/compiler": "22.2.3",
|
|
49
|
-
"@angular/compiler-cli": "22.2.3",
|
|
50
|
-
"@angular/core": "22.2.3",
|
|
51
|
-
"ng-packagr": "22.2.3",
|
|
52
|
-
"rxjs": "7.8.2",
|
|
53
|
-
"tsx": "^4.20.5",
|
|
54
|
-
"typescript": "6.0.3",
|
|
55
|
-
"yjs": "13.6.27"
|
|
56
|
-
},
|
|
57
|
-
"scripts": {
|
|
58
|
-
"build": "ng-packagr -p ng-package.json -c tsconfig.json && node scripts/patch-dist.mjs",
|
|
59
|
-
"test": "tsx --test test/*.test.ts"
|
|
60
48
|
}
|
|
61
49
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Y from "yjs";
|
|
2
|
+
import { FormValueControl, ValidationError } from "@angular/forms/signals";
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
declare const BLOCK_TYPES: readonly ["paragraph", "heading", "blockquote", "code", "bullet", "ordered", "rule", "image"];
|
|
4
5
|
type BlockType = (typeof BLOCK_TYPES)[number];
|
|
@@ -179,7 +180,7 @@ type WindCommand = {
|
|
|
179
180
|
};
|
|
180
181
|
interface WindMount {
|
|
181
182
|
destroy(): void;
|
|
182
|
-
focus(): void;
|
|
183
|
+
focus(options?: FocusOptions): void;
|
|
183
184
|
exec(command: WindCommand): void;
|
|
184
185
|
setReadonly(readonly: boolean): void;
|
|
185
186
|
setPlaceholder(value: string): void;
|
|
@@ -202,10 +203,19 @@ interface Tool {
|
|
|
202
203
|
label: string;
|
|
203
204
|
icon: string;
|
|
204
205
|
}
|
|
205
|
-
export declare class WindEditor {
|
|
206
|
+
export declare class WindEditor implements FormValueControl<string> {
|
|
207
|
+
/** Signal forms bind this model. `[formField]` requires the public name `value`. */
|
|
208
|
+
readonly value: import("@angular/core").ModelSignal<string>;
|
|
209
|
+
/** Same document as `value`, so existing `[(html)]` bindings keep working. */
|
|
206
210
|
readonly html: import("@angular/core").ModelSignal<string>;
|
|
207
211
|
readonly placeholder: import("@angular/core").InputSignal<string>;
|
|
208
|
-
readonly
|
|
212
|
+
readonly readonly: import("@angular/core").InputSignal<boolean>;
|
|
213
|
+
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
214
|
+
readonly invalid: import("@angular/core").InputSignal<boolean>;
|
|
215
|
+
readonly required: import("@angular/core").InputSignal<boolean>;
|
|
216
|
+
readonly touched: import("@angular/core").InputSignal<boolean>;
|
|
217
|
+
readonly errors: import("@angular/core").InputSignal<readonly ValidationError.WithOptionalFieldTree[]>;
|
|
218
|
+
readonly touch: import("@angular/core").OutputEmitterRef<void>;
|
|
209
219
|
readonly showToolbar: import("@angular/core").InputSignal<boolean>;
|
|
210
220
|
/** Preset name, or the buttons to show, in order. */
|
|
211
221
|
readonly toolbar: import("@angular/core").InputSignal<readonly ("paragraph" | "code" | "bullet" | "ordered" | "rule" | "image" | "bold" | "italic" | "underline" | "strike" | "link" | "source" | "h1" | "h2" | "quote" | "undo" | "redo" | "codeblock" | "clear")[] | WindToolbarPreset>;
|
|
@@ -219,6 +229,7 @@ export declare class WindEditor {
|
|
|
219
229
|
protected readonly sourceOpen: import("@angular/core").WritableSignal<boolean>;
|
|
220
230
|
protected readonly sourceDraft: import("@angular/core").WritableSignal<string>;
|
|
221
231
|
protected readonly slashIndex: import("@angular/core").WritableSignal<number>;
|
|
232
|
+
protected readonly errorText: import("@angular/core").Signal<string>;
|
|
222
233
|
protected readonly slashItems: import("@angular/core").Signal<SlashItem[]>;
|
|
223
234
|
private readonly surfaceRef;
|
|
224
235
|
private readonly destroyRef;
|
|
@@ -226,7 +237,7 @@ export declare class WindEditor {
|
|
|
226
237
|
private echo;
|
|
227
238
|
constructor();
|
|
228
239
|
protected pressed(id: string): boolean;
|
|
229
|
-
protected
|
|
240
|
+
protected toolDisabled(id: string): boolean;
|
|
230
241
|
protected run(id: string): void;
|
|
231
242
|
protected pickSlash(item: SlashItem): void;
|
|
232
243
|
protected applyLink(event: Event): void;
|
|
@@ -235,9 +246,17 @@ export declare class WindEditor {
|
|
|
235
246
|
protected applySource(): void;
|
|
236
247
|
protected onDraft(event: Event, field: 'link' | 'src' | 'alt' | 'source'): void;
|
|
237
248
|
private attach;
|
|
249
|
+
/** Signal forms calls this when the bound field should take focus. */
|
|
250
|
+
focus(options?: FocusOptions): void;
|
|
251
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
238
252
|
private onKey;
|
|
239
253
|
static ɵfac: i0.ɵɵFactoryDeclaration<WindEditor, never>;
|
|
240
254
|
static ɵcmp: i0.ɵɵComponentDeclaration<WindEditor, "wind-editor", never, {
|
|
255
|
+
"value": {
|
|
256
|
+
"alias": "value";
|
|
257
|
+
"required": false;
|
|
258
|
+
"isSignal": true;
|
|
259
|
+
};
|
|
241
260
|
"html": {
|
|
242
261
|
"alias": "html";
|
|
243
262
|
"required": false;
|
|
@@ -248,11 +267,36 @@ export declare class WindEditor {
|
|
|
248
267
|
"required": false;
|
|
249
268
|
"isSignal": true;
|
|
250
269
|
};
|
|
251
|
-
"
|
|
270
|
+
"readonly": {
|
|
252
271
|
"alias": "readonly";
|
|
253
272
|
"required": false;
|
|
254
273
|
"isSignal": true;
|
|
255
274
|
};
|
|
275
|
+
"disabled": {
|
|
276
|
+
"alias": "disabled";
|
|
277
|
+
"required": false;
|
|
278
|
+
"isSignal": true;
|
|
279
|
+
};
|
|
280
|
+
"invalid": {
|
|
281
|
+
"alias": "invalid";
|
|
282
|
+
"required": false;
|
|
283
|
+
"isSignal": true;
|
|
284
|
+
};
|
|
285
|
+
"required": {
|
|
286
|
+
"alias": "required";
|
|
287
|
+
"required": false;
|
|
288
|
+
"isSignal": true;
|
|
289
|
+
};
|
|
290
|
+
"touched": {
|
|
291
|
+
"alias": "touched";
|
|
292
|
+
"required": false;
|
|
293
|
+
"isSignal": true;
|
|
294
|
+
};
|
|
295
|
+
"errors": {
|
|
296
|
+
"alias": "errors";
|
|
297
|
+
"required": false;
|
|
298
|
+
"isSignal": true;
|
|
299
|
+
};
|
|
256
300
|
"showToolbar": {
|
|
257
301
|
"alias": "showToolbar";
|
|
258
302
|
"required": false;
|
|
@@ -264,7 +308,9 @@ export declare class WindEditor {
|
|
|
264
308
|
"isSignal": true;
|
|
265
309
|
};
|
|
266
310
|
}, {
|
|
311
|
+
"value": "valueChange";
|
|
267
312
|
"html": "htmlChange";
|
|
313
|
+
"touch": "touch";
|
|
268
314
|
}, never, never, true, never>;
|
|
269
315
|
}
|
|
270
316
|
export type { BlockData, BlockType, EditorSnapshot, MarkName, Selection, SlashChoice, SlashItem, TextAttrs, WindTool, WindToolbarPreset };
|