@zuilib/text-editor 0.3.0 → 0.4.0

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/dist/styles.css CHANGED
@@ -275,18 +275,20 @@
275
275
  /* Tables — artifact-style: rounded outer border, subtle header, tight rules */
276
276
  .zui-table {
277
277
  width: 100%;
278
+ max-width: 100%;
278
279
  margin: 1rem 0;
279
280
  border-collapse: separate;
280
281
  border-spacing: 0;
281
282
  border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
282
283
  border-radius: 0.625rem;
283
284
  overflow: hidden;
284
- font-size: 0.875rem;
285
+ /* Density presets set these custom properties inline (tableSettings.ts) */
286
+ font-size: var(--zui-table-font-size, 0.875rem);
285
287
  table-layout: fixed;
286
288
  }
287
289
 
288
290
  .zui-table-cell {
289
- padding: 0.5rem 0.75rem;
291
+ padding: var(--zui-table-cell-padding, 0.5rem 0.75rem);
290
292
  border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent);
291
293
  border-right: 1px solid color-mix(in srgb, currentColor 10%, transparent);
292
294
  vertical-align: top;
@@ -317,11 +319,42 @@
317
319
  background: color-mix(in srgb, #6965db 14%, transparent);
318
320
  }
319
321
 
322
+ /*
323
+ * Floating table settings (width, density), straddling the top-right corner
324
+ * of the table the caret is in (positioned within .zui-text-editor-main). It
325
+ * stays inside the table's own top margin so it never covers the previous
326
+ * paragraph. The settings themselves are an inline style on the <table>
327
+ * (see tableSettings.ts).
328
+ */
329
+ .zui-table-settings {
330
+ position: absolute;
331
+ z-index: 5;
332
+ display: flex;
333
+ gap: 0.125rem;
334
+ padding: 0.125rem;
335
+ border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
336
+ border-radius: 0.5rem;
337
+ background: #ffffff;
338
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
339
+ transform: translateY(-70%);
340
+ }
341
+
342
+ .dark .zui-table-settings {
343
+ background: #232329;
344
+ border-color: rgba(255, 255, 255, 0.1);
345
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
346
+ }
347
+
320
348
  /* Drawing canvas */
321
349
  .zui-drawing {
322
350
  margin: 1rem 0;
323
351
  }
324
352
 
353
+ .zui-drawing-canvas.is-content-width {
354
+ width: fit-content;
355
+ max-width: 100%;
356
+ }
357
+
325
358
  .zui-drawing-canvas {
326
359
  position: relative;
327
360
  border-radius: 0.75rem;
@@ -333,6 +366,7 @@
333
366
  .zui-drawing-surface {
334
367
  display: block;
335
368
  width: 100%;
369
+ max-width: 100%;
336
370
  touch-action: none;
337
371
  background-color: #ffffff;
338
372
  background-image: radial-gradient(
@@ -416,6 +450,11 @@
416
450
  pointer-events: auto;
417
451
  }
418
452
 
453
+ /* Canvas-level controls (width) sit at the far right of the toolbar row */
454
+ .zui-drawing-toolbar-group-end {
455
+ margin-left: auto;
456
+ }
457
+
419
458
  .zui-drawing-tool {
420
459
  display: inline-flex;
421
460
  align-items: center;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuilib/text-editor",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "ZUI — A markdown editor component wrapping Lexical",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",