bunnyquery 1.10.1 → 1.10.2
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/bunnyquery.css +20 -0
- package/bunnyquery.js +6 -6
- package/dist/engine.cjs +4 -3
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.mjs +4 -3
- package/dist/engine.mjs.map +1 -1
- package/package.json +1 -1
- package/src/engine/link_markup.ts +11 -4
- package/styles/chat.css +20 -0
package/package.json
CHANGED
|
@@ -77,8 +77,15 @@ export function renderInlineLinkHtml(link: RenderableInlineLink, opts?: InlineLi
|
|
|
77
77
|
if (unavailable) cls.push('is-unavailable');
|
|
78
78
|
if (preview) cls.push('is-image-preview');
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
// The glyph is its own element so chat.css can make it an atomic inline: an
|
|
81
|
+
// underline propagates into every in-flow inline descendant of the anchor and
|
|
82
|
+
// nothing inside can cancel it, so the ↗ was underlined along with the label
|
|
83
|
+
// whenever the chip was. The spacing that used to be a literal space is a
|
|
84
|
+
// margin on the span for the same reason (a space is decorated too).
|
|
85
|
+
var glyphHtml = '<span class="bq-link-glyph" translate="no">'
|
|
86
|
+
+ (unavailable ? INLINE_LINK_UNAVAILABLE_GLYPH : INLINE_LINK_GLYPH) + '</span>';
|
|
87
|
+
var labelHtml = glyphHtml + escapeInlineHtml(link.label
|
|
88
|
+
+ (unavailable ? INLINE_LINK_UNAVAILABLE_SUFFIX : refreshing ? ' (fetching...)' : ''));
|
|
82
89
|
var attrs = ['class="' + cls.join(' ') + '"'];
|
|
83
90
|
// NO href when the file is unavailable. That is what disables the click:
|
|
84
91
|
// an anchor with no href does not navigate, is not a tab stop and takes the
|
|
@@ -99,7 +106,7 @@ export function renderInlineLinkHtml(link: RenderableInlineLink, opts?: InlineLi
|
|
|
99
106
|
if (link.remotePath) attrs.push('data-bq-remote-path="' + escapeInlineHtml(link.remotePath) + '"');
|
|
100
107
|
if (link.fullLabel) attrs.push('data-bq-full-label="' + escapeInlineHtml(link.fullLabel) + '"');
|
|
101
108
|
|
|
102
|
-
if (!preview) return '<a ' + attrs.join(' ') + '>' +
|
|
109
|
+
if (!preview) return '<a ' + attrs.join(' ') + '>' + labelHtml + '</a>';
|
|
103
110
|
|
|
104
111
|
// NO src attribute. A stored file always classifies as the _expired_.url
|
|
105
112
|
// placeholder until something mints a real url, so a src written here would be
|
|
@@ -127,6 +134,6 @@ export function renderInlineLinkHtml(link: RenderableInlineLink, opts?: InlineLi
|
|
|
127
134
|
// dot trail, never the jumping bunny. CSS hides it the moment the <img>
|
|
128
135
|
// gains a src, so no JS removes DOM and nothing re-parses.
|
|
129
136
|
'<span class="bq-loader" data-bq-img-loader="1"></span>' +
|
|
130
|
-
'<span class="bq-img-preview-caption" translate="no">' +
|
|
137
|
+
'<span class="bq-img-preview-caption" translate="no">' + labelHtml + '</span>' +
|
|
131
138
|
'</a>';
|
|
132
139
|
}
|
package/styles/chat.css
CHANGED
|
@@ -419,6 +419,26 @@
|
|
|
419
419
|
text-decoration: none;
|
|
420
420
|
cursor: default;
|
|
421
421
|
}
|
|
422
|
+
/* An assistant bubble's chips are emitted by renderInlineLinkHtml INSIDE the
|
|
423
|
+
v-html `.bq-md` block, where `.bq-md a` below (underline at rest, none on
|
|
424
|
+
hover -- the prose-link convention) is (0,1,1) and outranks .bq-link-button
|
|
425
|
+
at (0,1,0). So those chips rendered the exact inverse of the rule above:
|
|
426
|
+
underlined at rest, underline gone under the pointer, while the same chip on
|
|
427
|
+
a user bubble (outside .bq-md) behaved. Restate the chip rule at a
|
|
428
|
+
specificity that wins inside .bq-md, the dead chip included. */
|
|
429
|
+
.bq-md a.bq-link-button { text-decoration: none; }
|
|
430
|
+
.bq-md a.bq-link-button:hover { text-decoration: underline; }
|
|
431
|
+
.bq-md a.bq-link-button.is-unavailable:hover { text-decoration: none; }
|
|
432
|
+
/* The ↗ / ✕ glyph is never underlined, at rest or on hover. Underlines propagate
|
|
433
|
+
into every in-flow inline descendant and a descendant cannot cancel them, so
|
|
434
|
+
`text-decoration: none` on the glyph alone does nothing; an atomic inline
|
|
435
|
+
(inline-block) is exempt, and the spacing is a margin so no decorated space
|
|
436
|
+
character carries the line up to the glyph. */
|
|
437
|
+
.bq-link-glyph {
|
|
438
|
+
display: inline-block;
|
|
439
|
+
text-decoration: none;
|
|
440
|
+
margin-right: 0.3em;
|
|
441
|
+
}
|
|
422
442
|
|
|
423
443
|
/* ---- inline image previews ----------------------------------------------*/
|
|
424
444
|
/* The anchor IS the preview: picture on top, the ordinary chip underneath as a
|