@duet3d/monacotokens 3.7.0-alpha.15 → 3.7.0-alpha.16
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/providers.js +23 -10
- package/package.json +1 -1
package/dist/providers.js
CHANGED
|
@@ -752,18 +752,23 @@ function installSuggestWidgetWidth() {
|
|
|
752
752
|
// Also relax Monaco's built-in max-height on the parameter-hints widget so our summary doc (which lists
|
|
753
753
|
// all parameters when no parameter is active) can grow vertically instead of getting an internal scrollbar
|
|
754
754
|
style.textContent = [
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
//
|
|
755
|
+
// suggest, parameter-hints and hover are overflow widgets: a consumer that sets
|
|
756
|
+
// `fixedOverflowWidgets: true` re-parents them to a body-level node outside `.monaco-editor`, so
|
|
757
|
+
// scoping selectors to `.monaco-editor <widget>` silently stops matching. Target the widget classes
|
|
758
|
+
// directly so the rules apply wherever the editor mounts its overflow widgets (and still match the
|
|
759
|
+
// in-editor case when the flag is off)
|
|
760
|
+
".suggest-widget { min-width: min(600px, 90vw); }",
|
|
761
|
+
".suggest-widget .monaco-list { min-width: min(600px, 90vw); }",
|
|
762
|
+
".parameter-hints-widget { max-width: min(800px, 90vw) !important; }",
|
|
763
|
+
".parameter-hints-widget > .phwrapper { max-width: min(800px, 90vw) !important; }",
|
|
764
|
+
// Hover widget: cap width at 800px (90vw on narrow screens so phones don't overflow), and cap height
|
|
760
765
|
// at 50vh so Monaco's positioning math always finds a fit either above or below the cursor. Without
|
|
761
766
|
// a height cap it can compute a height that doesn't fit above when hovering near the top of the file,
|
|
762
767
|
// leaving the tooltip clipped at negative Y. Long docs (M106, M950) scroll internally, which is the
|
|
763
768
|
// right trade-off - forcing inner containers to ignore the computed max-height makes the widget grow
|
|
764
769
|
// past its reserved slot and overlap the source line, hiding the cursor
|
|
765
|
-
".monaco-
|
|
766
|
-
".monaco-
|
|
770
|
+
".monaco-hover { max-width: min(800px, 90vw) !important; max-height: 50vh !important; }",
|
|
771
|
+
".monaco-hover .hover-contents { overflow-wrap: break-word; }",
|
|
767
772
|
// Pin every box in the hover to the same integer pixel height (19 px - matches Monaco's intended
|
|
768
773
|
// `1.35714 * 14` line-height, just rounded). Monaco's default ratio resolves to 18.99996 px at 14 px
|
|
769
774
|
// font; inline phrasing elements (<code>, <strong>, ...) have their own intrinsic metrics that
|
|
@@ -773,16 +778,24 @@ function installSuggestWidgetWidth() {
|
|
|
773
778
|
// inline blocks + an explicit <li> height kills the rounding mismatch at every level. Also mirror
|
|
774
779
|
// the implicit left gutter (from the <ul> bullet indent) on the right so text doesn't butt up against
|
|
775
780
|
// the tooltip edge
|
|
776
|
-
".monaco-
|
|
781
|
+
".monaco-hover .monaco-hover-content { line-height: 19px !important; box-sizing: border-box; overflow-x: hidden; }",
|
|
777
782
|
// Add right-side padding only when the hover renders more than a single line (multi-paragraph
|
|
778
783
|
// content, or a bullet/numbered list). Single-line hovers (just one `<p>`) don't need it and the
|
|
779
784
|
// extra gutter would look off-balance against the natural left margin
|
|
780
|
-
".monaco-
|
|
785
|
+
".monaco-hover .monaco-hover-content:has(p + p, ul, ol) { padding-right: 12px; }",
|
|
781
786
|
// Pin <li> to a clean 19 px integer floor (matches the parent's pinned line-height). Browser default
|
|
782
787
|
// padding/margin gives a fractional ~17.4167 px row that, in lists with many items, accumulates into a
|
|
783
788
|
// half-pixel overflow at the bottom and brings back the phantom scrollbar. min-height (not height) so
|
|
784
789
|
// long parameter descriptions that wrap can grow vertically instead of overlapping the next item
|
|
785
|
-
".monaco-
|
|
790
|
+
".monaco-hover li { min-height: 19px; box-sizing: border-box; }",
|
|
791
|
+
// Re-assert Monaco's own paragraph/list spacing (it ships margin: 8px 0 on these, with the first/last
|
|
792
|
+
// child gaps trimmed and a 20 px bullet indent). Host CSS resets - e.g. Vuetify 4's global reset, which
|
|
793
|
+
// zeroes <p>/<ul> margins - cascade into this body-level hover widget and collapse the gaps between the
|
|
794
|
+
// path, summary and value list. !important keeps the rhythm regardless of the embedding app's reset
|
|
795
|
+
".monaco-hover p, .monaco-hover ul { margin: 8px 0 !important; }",
|
|
796
|
+
".monaco-hover p:first-child, .monaco-hover ul:first-child { margin-top: 0 !important; }",
|
|
797
|
+
".monaco-hover p:last-child, .monaco-hover ul:last-child { margin-bottom: 0 !important; }",
|
|
798
|
+
".monaco-hover ul { padding-left: 20px !important; }"
|
|
786
799
|
].join(" ");
|
|
787
800
|
document.head.appendChild(style);
|
|
788
801
|
suggestWidgetStyleInstalled = true;
|
package/package.json
CHANGED