@zuilib/text-editor 0.2.1 → 0.3.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/CHANGELOG.md +36 -0
- package/DRAWING_FORMAT.md +7 -2
- package/README.md +122 -3
- package/dist/index.d.ts +156 -10
- package/dist/index.js +1134 -778
- package/dist/styles.css +44 -0
- package/package.json +7 -7
package/dist/styles.css
CHANGED
|
@@ -254,6 +254,12 @@
|
|
|
254
254
|
background: color-mix(in srgb, currentColor 8%, transparent);
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
+
.zui-text-editor-toolbar-button:disabled {
|
|
258
|
+
opacity: 0.3;
|
|
259
|
+
cursor: default;
|
|
260
|
+
background: transparent;
|
|
261
|
+
}
|
|
262
|
+
|
|
257
263
|
.zui-text-editor-toolbar-button.is-active {
|
|
258
264
|
opacity: 1;
|
|
259
265
|
background: color-mix(in srgb, currentColor 12%, transparent);
|
|
@@ -269,6 +275,7 @@
|
|
|
269
275
|
/* Tables — artifact-style: rounded outer border, subtle header, tight rules */
|
|
270
276
|
.zui-table {
|
|
271
277
|
width: 100%;
|
|
278
|
+
max-width: 100%;
|
|
272
279
|
margin: 1rem 0;
|
|
273
280
|
border-collapse: separate;
|
|
274
281
|
border-spacing: 0;
|
|
@@ -311,11 +318,42 @@
|
|
|
311
318
|
background: color-mix(in srgb, #6965db 14%, transparent);
|
|
312
319
|
}
|
|
313
320
|
|
|
321
|
+
/*
|
|
322
|
+
* Floating full-width / content-width toggle, straddling the top-right corner
|
|
323
|
+
* of the table the caret is in (positioned within .zui-text-editor-main). It
|
|
324
|
+
* stays inside the table's own top margin so it never covers the previous
|
|
325
|
+
* paragraph. Content width itself is an inline style on the <table> (see
|
|
326
|
+
* tableWidth.ts).
|
|
327
|
+
*/
|
|
328
|
+
.zui-table-width {
|
|
329
|
+
position: absolute;
|
|
330
|
+
z-index: 5;
|
|
331
|
+
display: flex;
|
|
332
|
+
gap: 0.125rem;
|
|
333
|
+
padding: 0.125rem;
|
|
334
|
+
border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
|
|
335
|
+
border-radius: 0.5rem;
|
|
336
|
+
background: #ffffff;
|
|
337
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
|
|
338
|
+
transform: translateY(-70%);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.dark .zui-table-width {
|
|
342
|
+
background: #232329;
|
|
343
|
+
border-color: rgba(255, 255, 255, 0.1);
|
|
344
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
|
|
345
|
+
}
|
|
346
|
+
|
|
314
347
|
/* Drawing canvas */
|
|
315
348
|
.zui-drawing {
|
|
316
349
|
margin: 1rem 0;
|
|
317
350
|
}
|
|
318
351
|
|
|
352
|
+
.zui-drawing-canvas.is-content-width {
|
|
353
|
+
width: fit-content;
|
|
354
|
+
max-width: 100%;
|
|
355
|
+
}
|
|
356
|
+
|
|
319
357
|
.zui-drawing-canvas {
|
|
320
358
|
position: relative;
|
|
321
359
|
border-radius: 0.75rem;
|
|
@@ -327,6 +365,7 @@
|
|
|
327
365
|
.zui-drawing-surface {
|
|
328
366
|
display: block;
|
|
329
367
|
width: 100%;
|
|
368
|
+
max-width: 100%;
|
|
330
369
|
touch-action: none;
|
|
331
370
|
background-color: #ffffff;
|
|
332
371
|
background-image: radial-gradient(
|
|
@@ -410,6 +449,11 @@
|
|
|
410
449
|
pointer-events: auto;
|
|
411
450
|
}
|
|
412
451
|
|
|
452
|
+
/* Canvas-level controls (width) sit at the far right of the toolbar row */
|
|
453
|
+
.zui-drawing-toolbar-group-end {
|
|
454
|
+
margin-left: auto;
|
|
455
|
+
}
|
|
456
|
+
|
|
413
457
|
.zui-drawing-tool {
|
|
414
458
|
display: inline-flex;
|
|
415
459
|
align-items: center;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuilib/text-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "ZUI — A markdown editor component wrapping Lexical",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
"DRAWING_FORMAT.md",
|
|
14
14
|
"CHANGELOG.md"
|
|
15
15
|
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsup",
|
|
18
|
+
"test": "node tests/roundtrip.mjs"
|
|
19
|
+
},
|
|
16
20
|
"exports": {
|
|
17
21
|
".": {
|
|
18
22
|
"types": "./dist/index.d.ts",
|
|
@@ -61,9 +65,5 @@
|
|
|
61
65
|
"design-system",
|
|
62
66
|
"react",
|
|
63
67
|
"typescript"
|
|
64
|
-
]
|
|
65
|
-
|
|
66
|
-
"build": "tsup",
|
|
67
|
-
"test": "node tests/roundtrip.mjs"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
68
|
+
]
|
|
69
|
+
}
|