artifactuse 0.1.28 → 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 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 "View full code (N lines)" label
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)