artifactuse 0.2.4 → 0.2.6

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.
@@ -6862,6 +6862,10 @@ const DEFAULT_CONFIG = {
6862
6862
  // Can be overridden per-component via props
6863
6863
  splitPosition: 50,
6864
6864
 
6865
+ // Show "Open in new tab" button in panel header to open preview URL externally
6866
+ // Can be overridden per-artifact via openFile/openCode options or per-component via props
6867
+ externalPreview: false,
6868
+
6865
6869
  // Enable multi-tab mode (open multiple artifacts as tabs)
6866
6870
  multiTab: false,
6867
6871
 
@@ -7418,6 +7422,7 @@ function createArtifactuse(userConfig = {}) {
7418
7422
  artifact.editorLanguage = language;
7419
7423
  if (options.tabs) artifact.tabs = options.tabs;
7420
7424
  if (options.panelUrl) artifact.panelUrl = options.panelUrl;
7425
+ if (options.externalPreview !== undefined) artifact.externalPreview = options.externalPreview;
7421
7426
  state.addArtifact(artifact);
7422
7427
  openArtifact(artifact);
7423
7428
  if (options.viewMode) state.setViewMode(options.viewMode);
@@ -7437,6 +7442,7 @@ function createArtifactuse(userConfig = {}) {
7437
7442
  if (options.title !== undefined) updates.title = options.title;
7438
7443
  if (options.tabs !== undefined) updates.tabs = options.tabs;
7439
7444
  if (options.panelUrl !== undefined) updates.panelUrl = options.panelUrl;
7445
+ if (options.externalPreview !== undefined) updates.externalPreview = options.externalPreview;
7440
7446
 
7441
7447
  state.addArtifact(updates);
7442
7448
  emit('artifact:updated', { artifactId: id, artifact: state.getArtifact(id) });
@@ -27639,6 +27645,18 @@ var JSZip = /*@__PURE__*/getDefaultExportFromCjs(libExports);
27639
27645
  //
27640
27646
  //
27641
27647
  //
27648
+ //
27649
+ //
27650
+ //
27651
+ //
27652
+ //
27653
+ //
27654
+ //
27655
+ //
27656
+ //
27657
+ //
27658
+ //
27659
+ //
27642
27660
 
27643
27661
 
27644
27662
  var script$1 = defineComponent({
@@ -27658,6 +27676,10 @@ var script$1 = defineComponent({
27658
27676
  type: Number,
27659
27677
  default: undefined,
27660
27678
  },
27679
+ externalPreview: {
27680
+ type: Boolean,
27681
+ default: undefined,
27682
+ },
27661
27683
  },
27662
27684
 
27663
27685
  setup(props, { emit }) {
@@ -27763,6 +27785,13 @@ var script$1 = defineComponent({
27763
27785
  return instance.config?.branding !== false;
27764
27786
  });
27765
27787
 
27788
+ const showExternalPreview = computed(() => {
27789
+ if (!panelUrl.value) return false;
27790
+ if (activeArtifact.value?.externalPreview !== undefined) return activeArtifact.value.externalPreview;
27791
+ if (props.externalPreview !== undefined) return props.externalPreview;
27792
+ return instance.config?.externalPreview ?? false;
27793
+ });
27794
+
27766
27795
  // Multi-tab computed
27767
27796
  const isMultiTab = computed(() => instance.config?.multiTab === true);
27768
27797
 
@@ -27912,6 +27941,10 @@ var script$1 = defineComponent({
27912
27941
  });
27913
27942
  }
27914
27943
 
27944
+ function handleExternalPreview() {
27945
+ if (panelUrl.value) window.open(panelUrl.value, '_blank', 'noopener,noreferrer');
27946
+ }
27947
+
27915
27948
  function handleIframeLoad() {
27916
27949
  clearTimeout(iframeLoadTimer);
27917
27950
  iframeLoading.value = false;
@@ -28455,6 +28488,7 @@ var script$1 = defineComponent({
28455
28488
  nonInlineArtifacts,
28456
28489
  currentNonInlineIndex,
28457
28490
  showBranding,
28491
+ showExternalPreview,
28458
28492
  effectivePanelWidth,
28459
28493
  panelClasses,
28460
28494
  forceEmptyView,
@@ -28479,6 +28513,7 @@ var script$1 = defineComponent({
28479
28513
  startPanelResize,
28480
28514
  startSplitResize,
28481
28515
  handleEditorSave,
28516
+ handleExternalPreview,
28482
28517
 
28483
28518
  // Multi-tab methods
28484
28519
  selectTab,
@@ -29514,6 +29549,50 @@ var __vue_render__$1 = function () {
29514
29549
  )
29515
29550
  : _vm._e(),
29516
29551
  _vm._v(" "),
29552
+ _vm.showExternalPreview
29553
+ ? _c(
29554
+ "button",
29555
+ {
29556
+ staticClass: "artifactuse-panel__action",
29557
+ attrs: { title: "Open in new tab" },
29558
+ on: { click: _vm.handleExternalPreview },
29559
+ },
29560
+ [
29561
+ _c(
29562
+ "svg",
29563
+ {
29564
+ attrs: {
29565
+ viewBox: "0 0 24 24",
29566
+ fill: "none",
29567
+ stroke: "currentColor",
29568
+ "stroke-width": "2",
29569
+ },
29570
+ },
29571
+ [
29572
+ _c("path", {
29573
+ attrs: {
29574
+ d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",
29575
+ },
29576
+ }),
29577
+ _vm._v(" "),
29578
+ _c("polyline", {
29579
+ attrs: { points: "15 3 21 3 21 9" },
29580
+ }),
29581
+ _vm._v(" "),
29582
+ _c("line", {
29583
+ attrs: {
29584
+ x1: "10",
29585
+ y1: "14",
29586
+ x2: "21",
29587
+ y2: "3",
29588
+ },
29589
+ }),
29590
+ ]
29591
+ ),
29592
+ ]
29593
+ )
29594
+ : _vm._e(),
29595
+ _vm._v(" "),
29517
29596
  _c(
29518
29597
  "button",
29519
29598
  {
@@ -29832,7 +29911,7 @@ var __vue_render__$1 = function () {
29832
29911
  sandbox:
29833
29912
  "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads allow-top-navigation-by-user-activation",
29834
29913
  allow:
29835
- "camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write",
29914
+ "camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write; encrypted-media; gyroscope; accelerometer; picture-in-picture",
29836
29915
  },
29837
29916
  on: {
29838
29917
  load: _vm.handleIframeLoad,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artifactuse",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "type": "module",
5
5
  "description": "The Artifact SDK for AI Agents - Turn AI outputs into interactive experiences",
6
6
  "author": "Artifactuse",