@threadlabs/looma 0.23.13 → 0.23.15

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.
@@ -9561,10 +9561,10 @@ function arrayEquals(left, right) {
9561
9561
  }
9562
9562
  function readRenderedColumnWidths(tableElement) {
9563
9563
  const colElements = Array.from(tableElement.querySelectorAll("colgroup col"));
9564
- if (colElements.length > 0) return colElements.map((column) => Math.max(1, Math.round(column.getBoundingClientRect().width)));
9564
+ if (colElements.length > 0) return colElements.map((column) => Math.max(1, column.getBoundingClientRect().width));
9565
9565
  const firstRow = tableElement.rows.item(0);
9566
9566
  if (!firstRow) return [];
9567
- return Array.from(firstRow.cells).map((cell) => Math.max(1, Math.round(cell.getBoundingClientRect().width)));
9567
+ return Array.from(firstRow.cells).map((cell) => Math.max(1, cell.getBoundingClientRect().width));
9568
9568
  }
9569
9569
  function distributeWidthDelta(widths, availableWidth, minWidth) {
9570
9570
  const normalized = [...widths];
@@ -9672,8 +9672,8 @@ function insertTableAtRange(editor, range, options = {}) {
9672
9672
  * Browser layout is the source of truth at the end of a pointer resize, but
9673
9673
  * ProseMirror must persist integer widths in the document. The algorithm keeps
9674
9674
  * proportions, enforces a minimum, and distributes rounding error so the final
9675
- * sum still equals the rendered table width. Spanning cells are updated once at
9676
- * their top-left map coordinate rather than once per covered grid position.
9675
+ * sum fits the rendered column grid, excluding the outer table border. Spanning
9676
+ * cells are updated once at their top-left map coordinate rather than once per covered grid position.
9677
9677
  *
9678
9678
  * @invariant Every persisted width is an integer at least `minWidth`, and each
9679
9679
  * spanning cell receives one width per logical column from its top-left origin.
@@ -9685,7 +9685,7 @@ function normalizeActiveTableColumnWidths(editor, tableElement, minWidth = 25) {
9685
9685
  if (!tableInfo) return false;
9686
9686
  const renderedColumnWidths = readRenderedColumnWidths(tableElement);
9687
9687
  if (renderedColumnWidths.length === 0) return false;
9688
- const normalizedColumnWidths = normalizeColumnWidths(renderedColumnWidths, Math.max(1, Math.round(tableElement.getBoundingClientRect().width)), minWidth);
9688
+ const normalizedColumnWidths = normalizeColumnWidths(renderedColumnWidths, Math.max(1, Math.floor(renderedColumnWidths.reduce((sum, width) => sum + width, 0))), minWidth);
9689
9689
  const { pos: tablePos, node: table } = tableInfo;
9690
9690
  const map = TableMap.get(table);
9691
9691
  const tableStart = tablePos + 1;
@@ -95,8 +95,8 @@ export declare function insertTableAtRange(editor: Editor, range: Range, options
95
95
  * Browser layout is the source of truth at the end of a pointer resize, but
96
96
  * ProseMirror must persist integer widths in the document. The algorithm keeps
97
97
  * proportions, enforces a minimum, and distributes rounding error so the final
98
- * sum still equals the rendered table width. Spanning cells are updated once at
99
- * their top-left map coordinate rather than once per covered grid position.
98
+ * sum fits the rendered column grid, excluding the outer table border. Spanning
99
+ * cells are updated once at their top-left map coordinate rather than once per covered grid position.
100
100
  *
101
101
  * @invariant Every persisted width is an integer at least `minWidth`, and each
102
102
  * spanning cell receives one width per logical column from its top-left origin.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.23.13",
3
+ "version": "0.23.15",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",
@@ -95,9 +95,14 @@
95
95
  /* Under touch a small field is still a touch-sized target, as a small button is, and keeps
96
96
  body-size text: below 16px, iOS zooms the page into the focused field. */
97
97
  @media (pointer: coarse) {
98
+ :scope,
99
+ :scope[data-ui-input-state~="size=sm"],
100
+ :scope[data-ui-input-state~="size=lg"] {
101
+ font-size: var(--ui-font-size-md);
102
+ }
103
+
98
104
  :scope[data-ui-input-state~="size=sm"] {
99
105
  min-block-size: var(--ui-input-min-block-size, var(--_ui-default-input-min-block-size, var(--ui-control-min-block-size)));
100
- font-size: inherit;
101
106
  }
102
107
  }
103
108
 
@@ -337,7 +337,7 @@
337
337
  }
338
338
 
339
339
  /* Without hover there is no reveal, so the controls keep their own column. */
340
- @media (hover: none) {
340
+ @media (hover: none), (pointer: coarse) {
341
341
  .row {
342
342
  grid-template-columns: var(--_tree-disclosure-size) auto minmax(0, 1fr) auto;
343
343
  }
@@ -351,6 +351,37 @@
351
351
  opacity: 1;
352
352
  pointer-events: auto;
353
353
  }
354
+
355
+ .row:is(:hover, :focus-within) > .label,
356
+ .row:is(:hover, :focus-within) > .label:dir(rtl),
357
+ :scope[data-move-source] > .row > .label,
358
+ :scope[data-move-source] > .row > .label:dir(rtl) {
359
+ mask-image: none;
360
+ }
361
+
362
+ .row[data-ui-marquee] > .label {
363
+ mask-image: linear-gradient(
364
+ to right,
365
+ transparent var(--_marquee-icon-width, 0px),
366
+ #000 calc(var(--_marquee-lead, 0px) + var(--_ui-tree-item-label-padding-inline, var(--ui-space-2)))
367
+ );
368
+ }
369
+
370
+ .row[data-ui-marquee] > .label:dir(rtl) {
371
+ mask-image: linear-gradient(
372
+ to left,
373
+ transparent var(--_marquee-icon-width, 0px),
374
+ #000 calc(var(--_marquee-lead, 0px) + var(--_ui-tree-item-label-padding-inline, var(--ui-space-2)))
375
+ );
376
+ }
377
+
378
+ :scope[data-selection-mode="multiple"] > .row {
379
+ grid-template-columns: var(--_tree-disclosure-size) 1.25rem auto minmax(0, 1fr) auto;
380
+ }
381
+
382
+ :scope[data-selection-mode="multiple"] > .row > .actions {
383
+ grid-column: 5;
384
+ }
354
385
  }
355
386
 
356
387
  /* The handle sits beside what it drags. A leaf row has no disclosure, so the handle takes that
@@ -492,6 +523,24 @@
492
523
  grid-column: 5;
493
524
  }
494
525
 
526
+ @media (hover: none), (pointer: coarse) {
527
+ html[data-ui-input-modality="touch"] :scope .row {
528
+ grid-template-columns: 44px var(--_tree-disclosure-size) auto minmax(0, 1fr) auto;
529
+ }
530
+
531
+ html[data-ui-input-modality="touch"] :scope .actions {
532
+ grid-column: 5;
533
+ }
534
+
535
+ html[data-ui-input-modality="touch"] :scope[data-selection-mode="multiple"] > .row {
536
+ grid-template-columns: 44px var(--_tree-disclosure-size) 44px auto minmax(0, 1fr) auto;
537
+ }
538
+
539
+ html[data-ui-input-modality="touch"] :scope[data-selection-mode="multiple"] > .row > .actions {
540
+ grid-column: 6;
541
+ }
542
+ }
543
+
495
544
  @media (prefers-reduced-motion: reduce) {
496
545
  .row,
497
546
  .disclosure-icon,
@@ -570,7 +619,7 @@
570
619
  }
571
620
 
572
621
  /* Without hover there is no reveal, so the controls keep their own column. */
573
- @media (hover: none) {
622
+ @media (hover: none), (pointer: coarse) {
574
623
  }
575
624
 
576
625
  /* The handle sits beside what it drags. A leaf row has no disclosure, so the handle takes that
@@ -578,6 +627,9 @@
578
627
  outside the row. It is bare until pointed at: a resting surface behind it read as a faint
579
628
  patch rather than as a control. */
580
629
 
630
+ @media (hover: none), (pointer: coarse) {
631
+ }
632
+
581
633
  @media (prefers-reduced-motion: reduce) {
582
634
  }
583
635
 
package/vue/UiInput.vue CHANGED
@@ -602,12 +602,17 @@ useComponentHost(() => import('../components/ui-input/ui-input.js'), {
602
602
  /* Under touch a small field is still a touch-sized target, as a small button is, and keeps
603
603
  body-size text: below 16px, iOS zooms the page into the focused field. */
604
604
  @media (pointer: coarse) {
605
+ [data-component~="ui-input"],
606
+ [data-component~="ui-input"][data-ui-input-state~="size=sm"],
607
+ [data-component~="ui-input"][data-ui-input-state~="size=lg"] {
608
+ font-size: var(--ui-font-size-md);
609
+ }
610
+
605
611
  [data-component~="ui-input"][data-ui-input-state~="size=sm"] {
606
612
  min-block-size: var(
607
613
  --ui-input-min-block-size,
608
614
  var(--_ui-default-input-min-block-size, var(--ui-control-min-block-size))
609
615
  );
610
- font-size: inherit;
611
616
  }
612
617
  }
613
618
 
@@ -925,7 +925,7 @@ function attribute(value: unknown): any {
925
925
  }
926
926
 
927
927
  /* Without hover there is no reveal, so the controls keep their own column. */
928
- @media (hover: none) {
928
+ @media (hover: none), (pointer: coarse) {
929
929
  .row {
930
930
  grid-template-columns: var(--_tree-disclosure-size) auto minmax(0, 1fr) auto;
931
931
  }
@@ -939,6 +939,41 @@ function attribute(value: unknown): any {
939
939
  opacity: 1;
940
940
  pointer-events: auto;
941
941
  }
942
+
943
+ .row:is(:hover, :focus-within) > .label,
944
+ .row:is(:hover, :focus-within) > .label:dir(rtl),
945
+ [data-component~="ui-tree-item"][data-move-source] > .row > .label,
946
+ [data-component~="ui-tree-item"][data-move-source] > .row > .label:dir(rtl) {
947
+ mask-image: none;
948
+ }
949
+
950
+ .row[data-ui-marquee] > .label {
951
+ mask-image: linear-gradient(
952
+ to right,
953
+ transparent var(--_marquee-icon-width, 0px),
954
+ #000 calc(
955
+ var(--_marquee-lead, 0px) + var(--_ui-tree-item-label-padding-inline, var(--ui-space-2))
956
+ )
957
+ );
958
+ }
959
+
960
+ .row[data-ui-marquee] > .label:dir(rtl) {
961
+ mask-image: linear-gradient(
962
+ to left,
963
+ transparent var(--_marquee-icon-width, 0px),
964
+ #000 calc(
965
+ var(--_marquee-lead, 0px) + var(--_ui-tree-item-label-padding-inline, var(--ui-space-2))
966
+ )
967
+ );
968
+ }
969
+
970
+ [data-component~="ui-tree-item"][data-selection-mode="multiple"] > .row {
971
+ grid-template-columns: var(--_tree-disclosure-size) 1.25rem auto minmax(0, 1fr) auto;
972
+ }
973
+
974
+ [data-component~="ui-tree-item"][data-selection-mode="multiple"] > .row > .actions {
975
+ grid-column: 5;
976
+ }
942
977
  }
943
978
 
944
979
  /* The handle sits beside what it drags. A leaf row has no disclosure, so the handle takes that
@@ -1094,6 +1129,29 @@ html[data-ui-input-modality="touch"]
1094
1129
  grid-column: 5;
1095
1130
  }
1096
1131
 
1132
+ @media (hover: none), (pointer: coarse) {
1133
+ html[data-ui-input-modality="touch"] [data-component~="ui-tree-item"] .row {
1134
+ grid-template-columns: 44px var(--_tree-disclosure-size) auto minmax(0, 1fr) auto;
1135
+ }
1136
+
1137
+ html[data-ui-input-modality="touch"] [data-component~="ui-tree-item"] .actions {
1138
+ grid-column: 5;
1139
+ }
1140
+
1141
+ html[data-ui-input-modality="touch"]
1142
+ [data-component~="ui-tree-item"][data-selection-mode="multiple"]
1143
+ > .row {
1144
+ grid-template-columns: 44px var(--_tree-disclosure-size) 44px auto minmax(0, 1fr) auto;
1145
+ }
1146
+
1147
+ html[data-ui-input-modality="touch"]
1148
+ [data-component~="ui-tree-item"][data-selection-mode="multiple"]
1149
+ > .row
1150
+ > .actions {
1151
+ grid-column: 6;
1152
+ }
1153
+ }
1154
+
1097
1155
  @media (prefers-reduced-motion: reduce) {
1098
1156
  .row,
1099
1157
  .disclosure-icon,
@@ -690,6 +690,6 @@ var UiInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
690
690
  }]]);
691
691
  };
692
692
  }
693
- }), [["__scopeId", "data-v-762209e1"]]);
693
+ }), [["__scopeId", "data-v-e45d8c3f"]]);
694
694
  //#endregion
695
695
  export { UiInput_default as t };
@@ -610,6 +610,6 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
610
610
  }]]);
611
611
  };
612
612
  }
613
- }), [["__scopeId", "data-v-d2b1bbe0"]]);
613
+ }), [["__scopeId", "data-v-fd74ff6c"]]);
614
614
  //#endregion
615
615
  export { UiTreeItem_default as t };