artifactuse 0.1.28 → 0.1.30

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,24 @@ 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
- languages: ['smartdiff', 'html', 'javascript'],
444
+ languages: true, // all languages, or ['html', 'javascript', ...]
445
+ excludeLanguages: ['typescript', 'go'], // exclude from preview when languages: true
446
+ minClickableLines: {
447
+ lines: 10, // code < 10 lines is non-clickable
448
+ ignoreLanguages: ['html', 'markdown'], // always clickable (panel renders preview)
449
+ },
450
+ actionLabel: {
451
+ html: 'Open preview',
452
+ markdown: 'Open document',
453
+ default: 'View full code', // fallback for unlisted languages
454
+ },
444
455
  },
445
456
  });
446
457
  ```
@@ -631,7 +642,17 @@ provideArtifactuse({
631
642
  // Default: null (disabled — all extracted code shows as cards)
632
643
  inlinePreview: {
633
644
  maxLines: 15, // max lines before truncation
634
- languages: ['smartdiff', 'html', 'javascript', 'jsx'], // or true for all extracted languages
645
+ languages: true, // or ['smartdiff', 'html', 'javascript', 'jsx']
646
+ excludeLanguages: ['typescript', 'go'], // exclude from preview when languages: true
647
+ minClickableLines: { // disable clicking for short code (optional)
648
+ lines: 10, // code < N lines is non-clickable
649
+ ignoreLanguages: ['html', 'markdown'], // always clickable (panel renders preview)
650
+ },
651
+ actionLabel: { // customize fade overlay label (optional)
652
+ html: 'Open preview', // per-language labels
653
+ markdown: 'Open document',
654
+ default: 'View full code', // fallback for unlisted languages
655
+ },
635
656
  },
636
657
 
637
658
  // Inline code: show full code inline with Prism highlighting, no extraction (optional)