@kolkrabbi/kol-component 0.279.0 → 0.280.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-component",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.280.0",
|
|
4
4
|
"description": "The core component library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"embla-carousel-react": "^8.6.0",
|
|
27
27
|
"pdfjs-dist": "^6.3.289",
|
|
28
28
|
"react-syntax-highlighter": "^16.1.1",
|
|
29
|
-
"@kolkrabbi/kol-
|
|
30
|
-
"@kolkrabbi/kol-
|
|
29
|
+
"@kolkrabbi/kol-search": "^0.3.0",
|
|
30
|
+
"@kolkrabbi/kol-markdown": "^0.1.3"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@kolkrabbi/kol-icons": ">=0.22.0",
|
|
@@ -190,6 +190,8 @@ export default function ActionButton({
|
|
|
190
190
|
</button>
|
|
191
191
|
)
|
|
192
192
|
/* The label shows as the DS Tooltip, not a native `title` (kol-client-olina 2026-09-22) — and
|
|
193
|
-
* it follows the swap, so a Copy URL reads "Copied" while the check is up.
|
|
194
|
-
|
|
193
|
+
* it follows the swap, so a Copy URL reads "Copied" while the check is up. `asChild` anchors it to
|
|
194
|
+
* the control itself: a positioned control (CodeBlock's `kol-frame-control`) leaves the wrapper span
|
|
195
|
+
* behind in flow (kol-atlas 2026-10-19). */
|
|
196
|
+
return aria ? <Tooltip label={aria} asChild>{control}</Tooltip> : control
|
|
195
197
|
}
|
|
@@ -636,6 +636,9 @@ export function MediaInspector({ files, index, onClose, onPrev, onNext, mediaUrl
|
|
|
636
636
|
* which remounts whenever the kind changes */
|
|
637
637
|
const [size, setSize] = useState(null)
|
|
638
638
|
const shownDims = dims && dims.key === o?.key ? dims : null
|
|
639
|
+
/* fill width is per file: paging lands on a key that is not this one, so it opens in fit */
|
|
640
|
+
const [fillKey, setFillKey] = useState(null)
|
|
641
|
+
const fill = fillKey != null && fillKey === o?.key
|
|
639
642
|
useEffect(() => {
|
|
640
643
|
const onKey = (e) => { if (e.shiftKey) return; if (e.key === 'ArrowLeft') onPrev(); if (e.key === 'ArrowRight') onNext() }
|
|
641
644
|
window.addEventListener('keydown', onKey)
|
|
@@ -694,11 +697,14 @@ export function MediaInspector({ files, index, onClose, onPrev, onNext, mediaUrl
|
|
|
694
697
|
</QuickLookFrame>
|
|
695
698
|
) : isImage(o.contentType) ? (
|
|
696
699
|
<QuickLookFrame {...frame}>
|
|
697
|
-
{/* A VECTOR HAS NO PIXEL SIZE (user 2026-09-24: a 32px logo.svg opened as a 32px
|
|
698
|
-
*
|
|
700
|
+
{/* A SMALL VECTOR HAS NO USEFUL PIXEL SIZE (user 2026-09-24: a 32px logo.svg opened as a 32px
|
|
701
|
+
* window). One under 640 wide — or with no size at all — is drawn in a 640 box, the window's
|
|
702
|
+
* max if that is smaller; a big one fits the window like a raster (kol-atlas 2026-10-19: its
|
|
703
|
+
* 1200×800 cards sat in the 640 box). A click toggles fit ↔ fill width; paging resets to fit. */}
|
|
699
704
|
<img src={mediaUrl(o.key)} alt={o.displayKey}
|
|
700
|
-
className=
|
|
701
|
-
style={extOf(o.key) === 'svg' || o.contentType === 'image/svg+xml' ? { width: 'min(var(--kol-ql-max-w), 640px)', height: 'min(var(--kol-ql-media-h), 640px)' } : undefined}
|
|
705
|
+
className={`kol-quicklook-media${fill ? ' kol-quicklook-media--fill' : ''}`}
|
|
706
|
+
style={!fill && (extOf(o.key) === 'svg' || o.contentType === 'image/svg+xml') && !(shownDims?.w >= 640) ? { width: 'min(var(--kol-ql-max-w), 640px)', height: 'min(var(--kol-ql-media-h), 640px)' } : undefined}
|
|
707
|
+
onClick={() => setFillKey(fill ? null : o.key)}
|
|
702
708
|
onLoad={(e) => setDims({ key: o.key, w: e.target.naturalWidth, h: e.target.naturalHeight })} />
|
|
703
709
|
</QuickLookFrame>
|
|
704
710
|
) : isVideo(o.contentType) ? (
|