artifactuse 0.1.27 → 0.1.29
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/README.md +20 -1
- package/dist/{index-D56xsAnF.js → index-DogWZVep.js} +370 -358
- package/dist/index.js +1 -1
- package/dist/react/index.js +44 -43
- package/dist/styles/components/inline-preview.css +9 -0
- package/dist/styles/components/panel.css +5 -0
- package/dist/svelte/index.js +2 -1
- package/dist/vue/index.js +84 -83
- package/dist/vue2/index.js +40 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -434,13 +434,23 @@ By default, extracted code blocks render as compact artifact cards. With `inline
|
|
|
434
434
|
- Configurable per language — unlisted languages still render as cards
|
|
435
435
|
- Requires [Prism.js](https://prismjs.com/) for syntax highlighting (see [Syntax Highlighting](#syntax-highlighting))
|
|
436
436
|
- `smartdiff` artifacts use the actual language for full syntax highlighting with deleted/inserted backgrounds
|
|
437
|
-
- Truncated previews show a fade gradient with
|
|
437
|
+
- Truncated previews show a fade gradient with customizable action labels
|
|
438
|
+
- Short code can be made non-clickable via `minClickableLines` (languages like HTML/markdown can be exempt)
|
|
438
439
|
|
|
439
440
|
```js
|
|
440
441
|
provideArtifactuse({
|
|
441
442
|
inlinePreview: {
|
|
442
443
|
maxLines: 15,
|
|
443
444
|
languages: ['smartdiff', 'html', 'javascript'],
|
|
445
|
+
minClickableLines: {
|
|
446
|
+
lines: 10, // code < 10 lines is non-clickable
|
|
447
|
+
ignoreLanguages: ['html', 'markdown'], // always clickable (panel renders preview)
|
|
448
|
+
},
|
|
449
|
+
actionLabel: {
|
|
450
|
+
html: 'Open preview',
|
|
451
|
+
markdown: 'Open document',
|
|
452
|
+
default: 'View full code', // fallback for unlisted languages
|
|
453
|
+
},
|
|
444
454
|
},
|
|
445
455
|
});
|
|
446
456
|
```
|
|
@@ -632,6 +642,15 @@ provideArtifactuse({
|
|
|
632
642
|
inlinePreview: {
|
|
633
643
|
maxLines: 15, // max lines before truncation
|
|
634
644
|
languages: ['smartdiff', 'html', 'javascript', 'jsx'], // or true for all extracted languages
|
|
645
|
+
minClickableLines: { // disable clicking for short code (optional)
|
|
646
|
+
lines: 10, // code < N lines is non-clickable
|
|
647
|
+
ignoreLanguages: ['html', 'markdown'], // always clickable (panel renders preview)
|
|
648
|
+
},
|
|
649
|
+
actionLabel: { // customize fade overlay label (optional)
|
|
650
|
+
html: 'Open preview', // per-language labels
|
|
651
|
+
markdown: 'Open document',
|
|
652
|
+
default: 'View full code', // fallback for unlisted languages
|
|
653
|
+
},
|
|
635
654
|
},
|
|
636
655
|
|
|
637
656
|
// Inline code: show full code inline with Prism highlighting, no extraction (optional)
|