@threadlabs/looma 0.39.4 → 0.39.5

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/docs/catalog.json CHANGED
@@ -458,7 +458,7 @@
458
458
  ],
459
459
  "schemaVersion": 1,
460
460
  "package": "@threadlabs/looma",
461
- "version": "0.39.4",
461
+ "version": "0.39.5",
462
462
  "groups": [
463
463
  {
464
464
  "id": "layout",
@@ -3020,12 +3020,8 @@
3020
3020
  {
3021
3021
  "name": "--ui-callout-surface",
3022
3022
  "declarations": [
3023
- "var(--ui-info-soft)",
3024
- "var(--ui-surface-muted)",
3025
- "var(--ui-success-soft)",
3026
- "var(--ui-accent-soft)",
3027
- "var(--ui-warning-soft)",
3028
- "var(--ui-danger-soft)"
3023
+ "color-mix(in srgb, var(--_callout-border) 19%, var(--ui-surface-default))",
3024
+ "var(--ui-surface-muted)"
3029
3025
  ]
3030
3026
  },
3031
3027
  {
@@ -3039,9 +3035,6 @@
3039
3035
  {
3040
3036
  "name": "--ui-accent-active"
3041
3037
  },
3042
- {
3043
- "name": "--ui-accent-soft"
3044
- },
3045
3038
  {
3046
3039
  "name": "--ui-accent-solid"
3047
3040
  },
@@ -3051,9 +3044,6 @@
3051
3044
  {
3052
3045
  "name": "--ui-border-width"
3053
3046
  },
3054
- {
3055
- "name": "--ui-danger-soft"
3056
- },
3057
3047
  {
3058
3048
  "name": "--ui-danger-solid"
3059
3049
  },
@@ -3069,9 +3059,6 @@
3069
3059
  {
3070
3060
  "name": "--ui-font-size-sm"
3071
3061
  },
3072
- {
3073
- "name": "--ui-info-soft"
3074
- },
3075
3062
  {
3076
3063
  "name": "--ui-info-solid"
3077
3064
  },
@@ -3088,10 +3075,10 @@
3088
3075
  "name": "--ui-space-3"
3089
3076
  },
3090
3077
  {
3091
- "name": "--ui-success-soft"
3078
+ "name": "--ui-success-solid"
3092
3079
  },
3093
3080
  {
3094
- "name": "--ui-success-solid"
3081
+ "name": "--ui-surface-default"
3095
3082
  },
3096
3083
  {
3097
3084
  "name": "--ui-surface-muted"
@@ -3102,9 +3089,6 @@
3102
3089
  {
3103
3090
  "name": "--ui-text-secondary"
3104
3091
  },
3105
- {
3106
- "name": "--ui-warning-soft"
3107
- },
3108
3092
  {
3109
3093
  "name": "--ui-warning-solid"
3110
3094
  }
@@ -11351,6 +11351,15 @@ function setActiveTableCellBackground(editor, backgroundColor) {
11351
11351
  * Default Tiptap extension preset for Looma editor.
11352
11352
  * Uses the Vanilla JS Tiptap API; apps provide @tiptap/core and Looma ships the preset extensions.
11353
11353
  */
11354
+ /** Marks ProseMirror-owned content inside a composed block; surrounding slots may also contain UI.
11355
+ * The marker lives with the node view's contentDOM and never enters the saved document. */
11356
+ function documentContentNodeView(renderer) {
11357
+ return (props) => {
11358
+ const view = renderer(props);
11359
+ view.contentDOM?.setAttribute("data-looma-editor-content", "");
11360
+ return view;
11361
+ };
11362
+ }
11354
11363
  var LoomaCodeBlock = CodeBlockLowlight.extend({
11355
11364
  addAttributes() {
11356
11365
  return {
@@ -11462,12 +11471,12 @@ function getDefaultEditorExtensions(options = {}) {
11462
11471
  TaskList,
11463
11472
  LoomaTaskItem.configure({ nested: false }),
11464
11473
  Blockquote,
11465
- calloutNodeView ? LoomaCallout.extend({ addNodeView: () => calloutNodeView }) : LoomaCallout,
11474
+ calloutNodeView ? LoomaCallout.extend({ addNodeView: () => documentContentNodeView(calloutNodeView) }) : LoomaCallout,
11466
11475
  LoomaChip,
11467
11476
  LoomaTabs,
11468
11477
  LoomaTab,
11469
11478
  ...imageInline ? [] : [LoomaFigure, LoomaFigcaption],
11470
- LoomaExpand.configure({ nodeView: expandNodeView ?? null }),
11479
+ LoomaExpand.configure({ nodeView: expandNodeView ? documentContentNodeView(expandNodeView) : null }),
11471
11480
  LoomaTableOfContents.configure({ nodeView: tableOfContentsNodeView ?? null }),
11472
11481
  LoomaFootnoteReference,
11473
11482
  LoomaFootnotes,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.39.4",
3
+ "version": "0.39.5",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",
@@ -59,7 +59,7 @@
59
59
  --_ui-callout-icon: var(--ui-callout-icon);
60
60
  --_ui-callout-icon-size: var(--ui-callout-icon-size);
61
61
 
62
- --_callout-surface: var(--ui-info-soft);
62
+ --_callout-surface: color-mix(in srgb, var(--_callout-border) 19%, var(--ui-surface-default));
63
63
  --_ui-selection-context-surface: light-dark(
64
64
  oklch(from var(--ui-callout-surface, var(--_callout-surface)) calc(l - 0.045) calc(max(c, min(0.045, c * 3))) h),
65
65
  oklch(from var(--ui-callout-surface, var(--_callout-surface)) calc(l + 0.045) calc(max(c, min(0.045, c * 3))) h)
@@ -127,31 +127,26 @@
127
127
  }
128
128
 
129
129
  :scope:where([data-component~="ui-callout"])[data-ui-callout-state~="tone=tip"] {
130
- --_callout-surface: var(--ui-success-soft);
131
130
  --_callout-border: var(--ui-success-solid);
132
131
  --_callout-icon: var(--ui-success-solid);
133
132
  }
134
133
 
135
134
  :scope:where([data-component~="ui-callout"])[data-ui-callout-state~="tone=important"] {
136
- --_callout-surface: var(--ui-accent-soft);
137
135
  --_callout-border: var(--ui-accent-solid);
138
136
  --_callout-icon: var(--ui-accent-solid);
139
137
  }
140
138
 
141
139
  :scope:where([data-component~="ui-callout"])[data-ui-callout-state~="tone=warning"] {
142
- --_callout-surface: var(--ui-warning-soft);
143
140
  --_callout-border: var(--ui-warning-solid);
144
141
  --_callout-icon: var(--ui-warning-solid);
145
142
  }
146
143
 
147
144
  :scope:where([data-component~="ui-callout"])[data-ui-callout-state~="tone=success"] {
148
- --_callout-surface: var(--ui-success-soft);
149
145
  --_callout-border: var(--ui-success-solid);
150
146
  --_callout-icon: var(--ui-success-solid);
151
147
  }
152
148
 
153
149
  :scope:where([data-component~="ui-callout"])[data-ui-callout-state~="tone=danger"], :scope:where([data-component~="ui-callout"])[data-ui-callout-state~="tone=caution"] {
154
- --_callout-surface: var(--ui-danger-soft);
155
150
  --_callout-border: var(--ui-danger-solid);
156
151
  --_callout-icon: var(--ui-danger-solid);
157
152
  }
package/vue/UiCallout.vue CHANGED
@@ -325,7 +325,7 @@ const hostState = computed(() =>
325
325
  --_ui-callout-icon: var(--ui-callout-icon);
326
326
  --_ui-callout-icon-size: var(--ui-callout-icon-size);
327
327
 
328
- --_callout-surface: var(--ui-info-soft);
328
+ --_callout-surface: color-mix(in srgb, var(--_callout-border) 19%, var(--ui-surface-default));
329
329
  --_ui-selection-context-surface: light-dark(
330
330
  oklch(
331
331
  from var(--ui-callout-surface, var(--_callout-surface))
@@ -414,32 +414,27 @@ const hostState = computed(() =>
414
414
  }
415
415
 
416
416
  :global(:scope[data-ui-callout-state~="tone=tip"]:where([data-hn-ui-callout])) {
417
- --_callout-surface: var(--ui-success-soft);
418
417
  --_callout-border: var(--ui-success-solid);
419
418
  --_callout-icon: var(--ui-success-solid);
420
419
  }
421
420
 
422
421
  :global(:scope[data-ui-callout-state~="tone=important"]:where([data-hn-ui-callout])) {
423
- --_callout-surface: var(--ui-accent-soft);
424
422
  --_callout-border: var(--ui-accent-solid);
425
423
  --_callout-icon: var(--ui-accent-solid);
426
424
  }
427
425
 
428
426
  :global(:scope[data-ui-callout-state~="tone=warning"]:where([data-hn-ui-callout])) {
429
- --_callout-surface: var(--ui-warning-soft);
430
427
  --_callout-border: var(--ui-warning-solid);
431
428
  --_callout-icon: var(--ui-warning-solid);
432
429
  }
433
430
 
434
431
  :global(:scope[data-ui-callout-state~="tone=success"]:where([data-hn-ui-callout])) {
435
- --_callout-surface: var(--ui-success-soft);
436
432
  --_callout-border: var(--ui-success-solid);
437
433
  --_callout-icon: var(--ui-success-solid);
438
434
  }
439
435
 
440
436
  :global(:scope[data-ui-callout-state~="tone=danger"]:where([data-hn-ui-callout])),
441
437
  :global(:scope[data-ui-callout-state~="tone=caution"]:where([data-hn-ui-callout])) {
442
- --_callout-surface: var(--ui-danger-soft);
443
438
  --_callout-border: var(--ui-danger-solid);
444
439
  --_callout-icon: var(--ui-danger-solid);
445
440
  }
@@ -297,6 +297,6 @@ var UiCallout_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
297
297
  }]]);
298
298
  };
299
299
  }
300
- }), [["__scopeId", "data-v-4d92265d"]]);
300
+ }), [["__scopeId", "data-v-63b1b042"]]);
301
301
  //#endregion
302
302
  export { UiCallout_default as t };
@@ -1647,7 +1647,7 @@ html[data-ui-input-modality="touch"]
1647
1647
  --_ui-callout-icon: var(--ui-callout-icon);
1648
1648
  --_ui-callout-icon-size: var(--ui-callout-icon-size);
1649
1649
 
1650
- --_callout-surface: var(--ui-info-soft);
1650
+ --_callout-surface: color-mix(in srgb, var(--_callout-border) 19%, var(--ui-surface-default));
1651
1651
  --_ui-selection-context-surface: light-dark(
1652
1652
  oklch(
1653
1653
  from var(--ui-callout-surface, var(--_callout-surface))
@@ -1730,27 +1730,22 @@ html[data-ui-input-modality="touch"]
1730
1730
  --_callout-icon: var(--ui-text-secondary);
1731
1731
  }
1732
1732
  :scope[data-ui-callout-state~="tone=tip"]:where([data-hn-ui-callout]) {
1733
- --_callout-surface: var(--ui-success-soft);
1734
1733
  --_callout-border: var(--ui-success-solid);
1735
1734
  --_callout-icon: var(--ui-success-solid);
1736
1735
  }
1737
1736
  :scope[data-ui-callout-state~="tone=important"]:where([data-hn-ui-callout]) {
1738
- --_callout-surface: var(--ui-accent-soft);
1739
1737
  --_callout-border: var(--ui-accent-solid);
1740
1738
  --_callout-icon: var(--ui-accent-solid);
1741
1739
  }
1742
1740
  :scope[data-ui-callout-state~="tone=warning"]:where([data-hn-ui-callout]) {
1743
- --_callout-surface: var(--ui-warning-soft);
1744
1741
  --_callout-border: var(--ui-warning-solid);
1745
1742
  --_callout-icon: var(--ui-warning-solid);
1746
1743
  }
1747
1744
  :scope[data-ui-callout-state~="tone=success"]:where([data-hn-ui-callout]) {
1748
- --_callout-surface: var(--ui-success-soft);
1749
1745
  --_callout-border: var(--ui-success-solid);
1750
1746
  --_callout-icon: var(--ui-success-solid);
1751
1747
  }
1752
1748
  :scope[data-ui-callout-state~="tone=danger"]:where([data-hn-ui-callout]),:scope[data-ui-callout-state~="tone=caution"]:where([data-hn-ui-callout]) {
1753
- --_callout-surface: var(--ui-danger-soft);
1754
1749
  --_callout-border: var(--ui-danger-solid);
1755
1750
  --_callout-icon: var(--ui-danger-solid);
1756
1751
  }
@@ -13065,6 +13060,17 @@ html[data-ui-input-modality="touch"]
13065
13060
  background: var(--ui-surface-muted);
13066
13061
  }
13067
13062
  @media (pointer: coarse) { .looma-compact-editor { font-size: var(--ui-font-size-md); } }
13063
+ /* Document whitespace belongs to projected content, not the component templates around it.
13064
+ A low-priority layer preserves each component's explicit wrapping rules. */
13065
+ @layer looma-editor-whitespace {
13066
+ :is([data-component~="ui-editor-surface"], .ui-editor-surface) .ProseMirror :where([data-component]) {
13067
+ white-space: normal;
13068
+ }
13069
+ :is([data-component~="ui-editor-surface"], .ui-editor-surface) .ProseMirror :where([data-looma-editor-content]) {
13070
+ white-space: break-spaces;
13071
+ }
13072
+ }
13073
+
13068
13074
  /* The editor surface owns its renderer canvas. Existing hooks retain their defaults. */
13069
13075
  /* Native TOC wrappers position the composed control beyond the active-block guide.
13070
13076
  The IconButton itself owns its dot, motion, focus and touch treatment. */
@@ -17318,7 +17324,7 @@ html[data-ui-input-modality="touch"]
17318
17324
  --_ui-callout-icon: var(--ui-callout-icon);
17319
17325
  --_ui-callout-icon-size: var(--ui-callout-icon-size);
17320
17326
 
17321
- --_callout-surface: var(--ui-info-soft);
17327
+ --_callout-surface: color-mix(in srgb, var(--_callout-border) 19%, var(--ui-surface-default));
17322
17328
  --_ui-selection-context-surface: light-dark(
17323
17329
  oklch(from var(--ui-callout-surface, var(--_callout-surface)) calc(l - 0.045) calc(max(c, min(0.045, c * 3))) h),
17324
17330
  oklch(from var(--ui-callout-surface, var(--_callout-surface)) calc(l + 0.045) calc(max(c, min(0.045, c * 3))) h)
@@ -17386,31 +17392,26 @@ html[data-ui-input-modality="touch"]
17386
17392
  }
17387
17393
 
17388
17394
  :scope:where([data-component~="ui-callout"])[data-ui-callout-state~="tone=tip"] {
17389
- --_callout-surface: var(--ui-success-soft);
17390
17395
  --_callout-border: var(--ui-success-solid);
17391
17396
  --_callout-icon: var(--ui-success-solid);
17392
17397
  }
17393
17398
 
17394
17399
  :scope:where([data-component~="ui-callout"])[data-ui-callout-state~="tone=important"] {
17395
- --_callout-surface: var(--ui-accent-soft);
17396
17400
  --_callout-border: var(--ui-accent-solid);
17397
17401
  --_callout-icon: var(--ui-accent-solid);
17398
17402
  }
17399
17403
 
17400
17404
  :scope:where([data-component~="ui-callout"])[data-ui-callout-state~="tone=warning"] {
17401
- --_callout-surface: var(--ui-warning-soft);
17402
17405
  --_callout-border: var(--ui-warning-solid);
17403
17406
  --_callout-icon: var(--ui-warning-solid);
17404
17407
  }
17405
17408
 
17406
17409
  :scope:where([data-component~="ui-callout"])[data-ui-callout-state~="tone=success"] {
17407
- --_callout-surface: var(--ui-success-soft);
17408
17410
  --_callout-border: var(--ui-success-solid);
17409
17411
  --_callout-icon: var(--ui-success-solid);
17410
17412
  }
17411
17413
 
17412
17414
  :scope:where([data-component~="ui-callout"])[data-ui-callout-state~="tone=danger"], :scope:where([data-component~="ui-callout"])[data-ui-callout-state~="tone=caution"] {
17413
- --_callout-surface: var(--ui-danger-soft);
17414
17415
  --_callout-border: var(--ui-danger-solid);
17415
17416
  --_callout-icon: var(--ui-danger-solid);
17416
17417
  }