artifactuse 0.2.2 → 0.2.3

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.
@@ -42,6 +42,7 @@ export function provideArtifactuse(config?: {
42
42
  isFullscreen: boolean;
43
43
  openTabs: any[];
44
44
  tabViewModes: {};
45
+ forceEmptyView: boolean;
45
46
  };
46
47
  subscribe: (callback: any) => () => void;
47
48
  addArtifact: (artifact: any) => void;
@@ -57,6 +58,7 @@ export function provideArtifactuse(config?: {
57
58
  setPanelOpen: (isOpen: any) => void;
58
59
  setViewMode: (mode: any) => void;
59
60
  setFullscreen: (isFullscreen: any) => void;
61
+ setForceEmptyView: (value: any) => void;
60
62
  openTab: (artifactId: any) => void;
61
63
  closeTab: (artifactId: any) => void;
62
64
  closeOtherTabs: (keepArtifactId: any) => void;
@@ -72,6 +74,7 @@ export function provideArtifactuse(config?: {
72
74
  isFullscreen: boolean;
73
75
  openTabs: any[];
74
76
  tabViewModes: {};
77
+ forceEmptyView: boolean;
75
78
  };
76
79
  subscribe: (callback: any) => () => void;
77
80
  processMessage: (content: any, messageId: any, overrides?: {}) => {
@@ -109,6 +112,7 @@ export function provideArtifactuse(config?: {
109
112
  createdAt: string;
110
113
  };
111
114
  updateFile: (artifactOrId: any, code: any, options?: {}) => any;
115
+ openPanel: () => void;
112
116
  closePanel: () => void;
113
117
  togglePanel: () => void;
114
118
  toggleFullscreen: () => void;
@@ -190,6 +194,7 @@ export function provideArtifactuse(config?: {
190
194
  isFullscreen: boolean;
191
195
  openTabs: any[];
192
196
  tabViewModes: {};
197
+ forceEmptyView: boolean;
193
198
  };
194
199
  activeArtifact: import("vue").ComputedRef<any>;
195
200
  artifactCount: import("vue").ComputedRef<number>;
@@ -231,6 +236,7 @@ export function provideArtifactuse(config?: {
231
236
  createdAt: string;
232
237
  };
233
238
  updateFile: (artifactOrId: any, code: any, options?: {}) => any;
239
+ openPanel: () => void;
234
240
  closePanel: () => void;
235
241
  togglePanel: () => void;
236
242
  toggleFullscreen: () => void;
@@ -270,6 +276,7 @@ export function createArtifactuseComposable(config?: {}): {
270
276
  isFullscreen: boolean;
271
277
  openTabs: any[];
272
278
  tabViewModes: {};
279
+ forceEmptyView: boolean;
273
280
  };
274
281
  subscribe: (callback: any) => () => void;
275
282
  addArtifact: (artifact: any) => void;
@@ -285,6 +292,7 @@ export function createArtifactuseComposable(config?: {}): {
285
292
  setPanelOpen: (isOpen: any) => void;
286
293
  setViewMode: (mode: any) => void;
287
294
  setFullscreen: (isFullscreen: any) => void;
295
+ setForceEmptyView: (value: any) => void;
288
296
  openTab: (artifactId: any) => void;
289
297
  closeTab: (artifactId: any) => void;
290
298
  closeOtherTabs: (keepArtifactId: any) => void;
@@ -300,6 +308,7 @@ export function createArtifactuseComposable(config?: {}): {
300
308
  isFullscreen: boolean;
301
309
  openTabs: any[];
302
310
  tabViewModes: {};
311
+ forceEmptyView: boolean;
303
312
  };
304
313
  subscribe: (callback: any) => () => void;
305
314
  processMessage: (content: any, messageId: any, overrides?: {}) => {
@@ -337,6 +346,7 @@ export function createArtifactuseComposable(config?: {}): {
337
346
  createdAt: string;
338
347
  };
339
348
  updateFile: (artifactOrId: any, code: any, options?: {}) => any;
349
+ openPanel: () => void;
340
350
  closePanel: () => void;
341
351
  togglePanel: () => void;
342
352
  toggleFullscreen: () => void;
@@ -418,6 +428,7 @@ export function createArtifactuseComposable(config?: {}): {
418
428
  isFullscreen: boolean;
419
429
  openTabs: any[];
420
430
  tabViewModes: {};
431
+ forceEmptyView: boolean;
421
432
  };
422
433
  activeArtifact: import("vue").ComputedRef<any>;
423
434
  artifactCount: import("vue").ComputedRef<number>;
@@ -459,6 +470,7 @@ export function createArtifactuseComposable(config?: {}): {
459
470
  createdAt: string;
460
471
  };
461
472
  updateFile: (artifactOrId: any, code: any, options?: {}) => any;
473
+ openPanel: () => void;
462
474
  closePanel: () => void;
463
475
  togglePanel: () => void;
464
476
  toggleFullscreen: () => void;
@@ -897,6 +897,8 @@ function createState() {
897
897
  // Multi-tab support
898
898
  openTabs: [], // Array of artifact IDs open as tabs (ordered)
899
899
  tabViewModes: {}, // { [artifactId]: 'preview' | 'code' | 'split' | 'edit' }
900
+ // Panel empty view
901
+ forceEmptyView: false, // When true, panel shows empty state regardless of artifacts
900
902
  };
901
903
 
902
904
  // Subscribers
@@ -1021,6 +1023,7 @@ function createState() {
1021
1023
  ...state,
1022
1024
  activeArtifactId: artifactId,
1023
1025
  viewMode,
1026
+ forceEmptyView: false,
1024
1027
  };
1025
1028
 
1026
1029
  notify();
@@ -1086,6 +1089,17 @@ function createState() {
1086
1089
  notify();
1087
1090
  }
1088
1091
 
1092
+ /**
1093
+ * Set force empty view state
1094
+ */
1095
+ function setForceEmptyView(value) {
1096
+ state = {
1097
+ ...state,
1098
+ forceEmptyView: !!value,
1099
+ };
1100
+ notify();
1101
+ }
1102
+
1089
1103
  /**
1090
1104
  * Get artifacts by message ID
1091
1105
  */
@@ -1218,6 +1232,7 @@ function createState() {
1218
1232
  isFullscreen: false,
1219
1233
  openTabs: [],
1220
1234
  tabViewModes: {},
1235
+ forceEmptyView: false,
1221
1236
  };
1222
1237
 
1223
1238
  notify();
@@ -1275,6 +1290,7 @@ function createState() {
1275
1290
  setPanelOpen,
1276
1291
  setViewMode,
1277
1292
  setFullscreen,
1293
+ setForceEmptyView,
1278
1294
 
1279
1295
  // Multi-tab
1280
1296
  openTab,
@@ -7337,6 +7353,7 @@ function createArtifactuse(userConfig = {}) {
7337
7353
  state.setActiveArtifact(artifact.id);
7338
7354
  }
7339
7355
 
7356
+ state.setForceEmptyView(false);
7340
7357
  state.setPanelOpen(true);
7341
7358
  if (artifact.viewMode) {
7342
7359
  state.setViewMode(artifact.viewMode);
@@ -7392,6 +7409,17 @@ function createArtifactuse(userConfig = {}) {
7392
7409
  return state.getArtifact(id);
7393
7410
  }
7394
7411
 
7412
+ /**
7413
+ * Open panel in empty state
7414
+ */
7415
+ function openPanel() {
7416
+ state.clearActiveArtifact();
7417
+ state.setForceEmptyView(true);
7418
+ state.setPanelOpen(true);
7419
+
7420
+ emit('panel:opened');
7421
+ }
7422
+
7395
7423
  /**
7396
7424
  * Close panel
7397
7425
  */
@@ -7629,6 +7657,7 @@ function createArtifactuse(userConfig = {}) {
7629
7657
  openFile,
7630
7658
  openCode,
7631
7659
  updateFile,
7660
+ openPanel,
7632
7661
  closePanel,
7633
7662
  togglePanel,
7634
7663
  toggleFullscreen,
@@ -7768,6 +7797,7 @@ function provideArtifactuse(config = {}) {
7768
7797
  isFullscreen: false,
7769
7798
  openTabs: [],
7770
7799
  tabViewModes: {},
7800
+ forceEmptyView: false,
7771
7801
  });
7772
7802
 
7773
7803
  // Subscribe to state changes
@@ -7779,6 +7809,7 @@ function provideArtifactuse(config = {}) {
7779
7809
  state.isFullscreen = newState.isFullscreen;
7780
7810
  state.openTabs = newState.openTabs;
7781
7811
  state.tabViewModes = newState.tabViewModes;
7812
+ state.forceEmptyView = newState.forceEmptyView;
7782
7813
  });
7783
7814
 
7784
7815
  // Computed
@@ -7822,6 +7853,7 @@ function provideArtifactuse(config = {}) {
7822
7853
  openFile: instance.openFile,
7823
7854
  openCode: instance.openCode,
7824
7855
  updateFile: instance.updateFile,
7856
+ openPanel: instance.openPanel,
7825
7857
  closePanel: instance.closePanel,
7826
7858
  togglePanel: instance.togglePanel,
7827
7859
  toggleFullscreen: instance.toggleFullscreen,
@@ -7890,6 +7922,7 @@ function createArtifactuseComposable(config = {}) {
7890
7922
  isFullscreen: false,
7891
7923
  openTabs: [],
7892
7924
  tabViewModes: {},
7925
+ forceEmptyView: false,
7893
7926
  });
7894
7927
 
7895
7928
  // Subscribe to state changes
@@ -7904,6 +7937,7 @@ function createArtifactuseComposable(config = {}) {
7904
7937
  state.isFullscreen = newState.isFullscreen;
7905
7938
  state.openTabs = newState.openTabs;
7906
7939
  state.tabViewModes = newState.tabViewModes;
7940
+ state.forceEmptyView = newState.forceEmptyView;
7907
7941
  });
7908
7942
 
7909
7943
  // Apply theme
@@ -7952,6 +7986,7 @@ function createArtifactuseComposable(config = {}) {
7952
7986
  openFile: instance.openFile,
7953
7987
  openCode: instance.openCode,
7954
7988
  updateFile: instance.updateFile,
7989
+ openPanel: instance.openPanel,
7955
7990
  closePanel: instance.closePanel,
7956
7991
  togglePanel: instance.togglePanel,
7957
7992
  toggleFullscreen: instance.toggleFullscreen,
@@ -27566,6 +27601,10 @@ var JSZip = /*@__PURE__*/getDefaultExportFromCjs(libExports);
27566
27601
  //
27567
27602
  //
27568
27603
  //
27604
+ //
27605
+ //
27606
+ //
27607
+ //
27569
27608
 
27570
27609
 
27571
27610
  var script$1 = defineComponent({
@@ -27710,7 +27749,7 @@ var script$1 = defineComponent({
27710
27749
 
27711
27750
  // Effective panel width - smaller for list/empty views
27712
27751
  const effectivePanelWidth = computed(() => {
27713
- if (!activeArtifact.value) {
27752
+ if (!activeArtifact.value && !state.forceEmptyView) {
27714
27753
  return Math.min(panelWidth.value, 30);
27715
27754
  }
27716
27755
  return panelWidth.value;
@@ -27719,11 +27758,13 @@ var script$1 = defineComponent({
27719
27758
  const panelClasses = computed(() => {
27720
27759
  return {
27721
27760
  'artifactuse-panel--fullscreen': state.isFullscreen,
27722
- 'artifactuse-panel--list': !activeArtifact.value && hasArtifacts.value,
27723
- 'artifactuse-panel--empty': !hasArtifacts.value,
27761
+ 'artifactuse-panel--list': !activeArtifact.value && hasArtifacts.value && !state.forceEmptyView,
27762
+ 'artifactuse-panel--empty': !hasArtifacts.value && !state.forceEmptyView,
27724
27763
  };
27725
27764
  });
27726
-
27765
+
27766
+ const forceEmptyView = computed(() => state.forceEmptyView);
27767
+
27727
27768
  // Smartdiff: per-line language-aware highlighting
27728
27769
  function highlightSmartDiff(artifact) {
27729
27770
  if (artifact.language !== 'smartdiff') return null;
@@ -28382,6 +28423,7 @@ var script$1 = defineComponent({
28382
28423
  showBranding,
28383
28424
  effectivePanelWidth,
28384
28425
  panelClasses,
28426
+ forceEmptyView,
28385
28427
  sharingEnabled,
28386
28428
  isAuthenticated,
28387
28429
  isEditorAvailable,
@@ -28472,7 +28514,7 @@ var __vue_render__$1 = function () {
28472
28514
  )
28473
28515
  : _vm._e(),
28474
28516
  _vm._v(" "),
28475
- !_vm.hasArtifacts
28517
+ !_vm.hasArtifacts || _vm.forceEmptyView
28476
28518
  ? [
28477
28519
  _c(
28478
28520
  "header",
@@ -28489,26 +28531,51 @@ var __vue_render__$1 = function () {
28489
28531
  "span",
28490
28532
  { staticClass: "artifactuse-panel__icon" },
28491
28533
  [
28492
- _c(
28493
- "svg",
28494
- {
28495
- attrs: {
28496
- viewBox: "0 0 24 24",
28497
- fill: "none",
28498
- stroke: "currentColor",
28499
- "stroke-width": "2",
28500
- },
28501
- },
28502
- [
28503
- _c("polyline", {
28504
- attrs: { points: "16 18 22 12 16 6" },
28505
- }),
28506
- _vm._v(" "),
28507
- _c("polyline", {
28508
- attrs: { points: "8 6 2 12 8 18" },
28509
- }),
28510
- ]
28511
- ),
28534
+ _vm.forceEmptyView
28535
+ ? _c(
28536
+ "svg",
28537
+ {
28538
+ attrs: {
28539
+ viewBox: "0 0 24 24",
28540
+ fill: "none",
28541
+ stroke: "currentColor",
28542
+ "stroke-width": "2",
28543
+ },
28544
+ },
28545
+ [
28546
+ _c("path", {
28547
+ attrs: {
28548
+ d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",
28549
+ },
28550
+ }),
28551
+ _vm._v(" "),
28552
+ _c("polyline", {
28553
+ attrs: { points: "14 2 14 8 20 8" },
28554
+ }),
28555
+ ]
28556
+ )
28557
+ : _c(
28558
+ "svg",
28559
+ {
28560
+ attrs: {
28561
+ viewBox: "0 0 24 24",
28562
+ fill: "none",
28563
+ stroke: "currentColor",
28564
+ "stroke-width": "2",
28565
+ },
28566
+ },
28567
+ [
28568
+ _c("polyline", {
28569
+ attrs: {
28570
+ points: "16 18 22 12 16 6",
28571
+ },
28572
+ }),
28573
+ _vm._v(" "),
28574
+ _c("polyline", {
28575
+ attrs: { points: "8 6 2 12 8 18" },
28576
+ }),
28577
+ ]
28578
+ ),
28512
28579
  ]
28513
28580
  ),
28514
28581
  _vm._v(" "),
@@ -28522,7 +28589,15 @@ var __vue_render__$1 = function () {
28522
28589
  _c(
28523
28590
  "span",
28524
28591
  { staticClass: "artifactuse-panel__name" },
28525
- [_vm._v("Artifacts")]
28592
+ [
28593
+ _vm._v(
28594
+ _vm._s(
28595
+ _vm.forceEmptyView
28596
+ ? "Artifact Viewer"
28597
+ : "Artifacts"
28598
+ )
28599
+ ),
28600
+ ]
28526
28601
  ),
28527
28602
  ]
28528
28603
  ),
@@ -28612,7 +28687,15 @@ var __vue_render__$1 = function () {
28612
28687
  _c(
28613
28688
  "h3",
28614
28689
  { staticClass: "artifactuse-panel__empty-title" },
28615
- [_vm._v("No artifacts yet")]
28690
+ [
28691
+ _vm._v(
28692
+ _vm._s(
28693
+ _vm.forceEmptyView
28694
+ ? "No artifact selected"
28695
+ : "No artifacts yet"
28696
+ )
28697
+ ),
28698
+ ]
28616
28699
  ),
28617
28700
  _vm._v(" "),
28618
28701
  _c(
@@ -28620,7 +28703,13 @@ var __vue_render__$1 = function () {
28620
28703
  { staticClass: "artifactuse-panel__empty-text" },
28621
28704
  [
28622
28705
  _vm._v(
28623
- "\n Code blocks, forms, and other interactive content will appear here as the AI generates them.\n "
28706
+ "\n " +
28707
+ _vm._s(
28708
+ _vm.forceEmptyView
28709
+ ? "Open an artifact to have it appear here"
28710
+ : "Code blocks, forms, and other interactive content will appear here as the AI generates them."
28711
+ ) +
28712
+ "\n "
28624
28713
  ),
28625
28714
  ]
28626
28715
  ),
@@ -28680,7 +28769,7 @@ var __vue_render__$1 = function () {
28680
28769
  ]
28681
28770
  ),
28682
28771
  ]
28683
- : !_vm.activeArtifact
28772
+ : !_vm.activeArtifact && !_vm.forceEmptyView
28684
28773
  ? [
28685
28774
  _c(
28686
28775
  "header",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artifactuse",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "description": "The Artifact SDK for AI Agents - Turn AI outputs into interactive experiences",
6
6
  "author": "Artifactuse",