artifactuse 0.1.22 → 0.1.24
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 +23 -3
- package/dist/{index-CQXV7Rft.js → index-CdjLieSe.js} +1234 -1197
- package/dist/index.js +1 -1
- package/dist/react/index.js +2 -2
- package/dist/svelte/index.js +2 -2
- package/dist/vue/index.js +2 -2
- package/dist/vue2/index.js +51 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as s, aI as r, as as t, I as d, c, F as o, aZ as i, al as m, j as l, aq as b, ao as E, aj as n, a5 as p, a6 as g, C as h, ad as M, ak as T, l as u, aF as A, W as f, ah as S, ai as C, ac as y, a4 as P, ap as I, $ as G, a0 as L, M as V, N as D, q as k, ae as F, R as z, S as v, a7 as B, U as w, B as K, aN as X, av as x, at as H, ar as O, O as R, a2 as N, Z as U, X as J, V as W, a9 as Y, ag as _, G as j, H as q, a8 as Q, h as Z, ab as $, k as aa, T as ea, Q as sa, an as ra, x as ta, v as da, y as ca, A as oa, z as ia, K as ma, aY as la, aH as ba, e as Ea, aK as na, a_ as pa, aS as ga, aA as ha, aV as Ma, aX as Ta, aW as ua, J as Aa, aO as fa, aw as Sa, aL as Ca, d as ya, aR as Pa, az as Ia, i as Ga, t as La, aP as Va, ax as Da, aU as ka, n as Fa, p as za, af as va, E as Ba, a3 as wa, aa as Ka, _ as Xa, o as xa, m as Ha, am as Oa, L as Ra, aM as Na, aT as Ua, au as Ja, aB as Wa, a1 as Ya, Y as _a, P as ja, aE as qa, w as Qa, s as Za, r as $a, u as ae, aC as ee, aQ as se, ay as re, aJ as te, aG as de, aD as ce } from "./index-
|
|
1
|
+
import { D as s, aI as r, as as t, I as d, c, F as o, aZ as i, al as m, j as l, aq as b, ao as E, aj as n, a5 as p, a6 as g, C as h, ad as M, ak as T, l as u, aF as A, W as f, ah as S, ai as C, ac as y, a4 as P, ap as I, $ as G, a0 as L, M as V, N as D, q as k, ae as F, R as z, S as v, a7 as B, U as w, B as K, aN as X, av as x, at as H, ar as O, O as R, a2 as N, Z as U, X as J, V as W, a9 as Y, ag as _, G as j, H as q, a8 as Q, h as Z, ab as $, k as aa, T as ea, Q as sa, an as ra, x as ta, v as da, y as ca, A as oa, z as ia, K as ma, aY as la, aH as ba, e as Ea, aK as na, a_ as pa, aS as ga, aA as ha, aV as Ma, aX as Ta, aW as ua, J as Aa, aO as fa, aw as Sa, aL as Ca, d as ya, aR as Pa, az as Ia, i as Ga, t as La, aP as Va, ax as Da, aU as ka, n as Fa, p as za, af as va, E as Ba, a3 as wa, aa as Ka, _ as Xa, o as xa, m as Ha, am as Oa, L as Ra, aM as Na, aT as Ua, au as Ja, aB as Wa, a1 as Ya, Y as _a, P as ja, aE as qa, w as Qa, s as Za, r as $a, u as ae, aC as ee, aQ as se, ay as re, aJ as te, aG as de, aD as ce } from "./index-CdjLieSe.js";
|
|
2
2
|
export {
|
|
3
3
|
s as DEFAULT_PANELS,
|
|
4
4
|
r as copyTableToClipboard,
|
package/dist/react/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import e, { useState as b, useMemo as T, useCallback as d, useRef as W, useEffect as q, createContext as Ht, useContext as It } from "react";
|
|
2
|
-
import { g as Te, f as ut, a as Ke, b as Ye, n as Bt, i as Ft, D as dt, c as Wt } from "../index-
|
|
2
|
+
import { g as Te, f as ut, a as Ke, b as Ye, n as Bt, i as Ft, D as dt, c as Wt } from "../index-CdjLieSe.js";
|
|
3
3
|
import { J as Vt } from "../jszip.min-CdmYyw5L.js";
|
|
4
4
|
import { createPortal as zt } from "react-dom";
|
|
5
5
|
function Rt({
|
|
@@ -896,7 +896,7 @@ function pa({
|
|
|
896
896
|
}, [tt, at]), ze = ((it = m.editor) == null ? void 0 : it.isAvailable()) || !1, st = d(() => {
|
|
897
897
|
!ze || !U.current || !a || ($.current && ($.current.destroy(), $.current = null), $.current = m.editor.create(U.current, {
|
|
898
898
|
code: a.code || "",
|
|
899
|
-
language: a.language || "plaintext",
|
|
899
|
+
language: a.editorLanguage || a.language || "plaintext",
|
|
900
900
|
sdkTheme: m.getTheme()
|
|
901
901
|
}));
|
|
902
902
|
}, [ze, a, m]), ht = d(() => {
|
package/dist/svelte/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { writable as ca, derived as Da } from "svelte/store";
|
|
2
2
|
import { createEventDispatcher as oa, onMount as va, onDestroy as Aa, tick as Xt, setContext as Rr, getContext as Dr } from "svelte";
|
|
3
|
-
import { g as Wt, f as ir, a as Va, b as nr, n as yr, i as Vr, D as Ur, c as Or } from "../index-
|
|
3
|
+
import { g as Wt, f as ir, a as Va, b as nr, n as yr, i as Vr, D as Ur, c as Or } from "../index-CdjLieSe.js";
|
|
4
4
|
import "svelte/internal/disclose-version";
|
|
5
5
|
import "svelte/internal/flags/legacy";
|
|
6
6
|
import * as e from "svelte/internal/client";
|
|
@@ -1918,7 +1918,7 @@ function Fn(Be, d) {
|
|
|
1918
1918
|
function S() {
|
|
1919
1919
|
!e.get(y) || !e.get(_e) || !e.get(a) || (ie(), R = m.editor.create(e.get(_e), {
|
|
1920
1920
|
code: e.get(a).code || "",
|
|
1921
|
-
language: e.get(a).language || "plaintext",
|
|
1921
|
+
language: e.get(a).editorLanguage || e.get(a).language || "plaintext",
|
|
1922
1922
|
sdkTheme: m.getTheme()
|
|
1923
1923
|
}));
|
|
1924
1924
|
}
|
package/dist/vue/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as M, computed as b, createElementBlock as s, openBlock as a, normalizeClass as N, createElementVNode as e, toDisplayString as n, withModifiers as he, onMounted as we, watch as fe, Fragment as R, createCommentVNode as d, renderList as ue, createTextVNode as K, h as le, normalizeStyle as $e, createStaticVNode as Pt, createBlock as ke, resolveDynamicComponent as Bt, nextTick as ge, onUnmounted as Oe, Teleport as Et, createVNode as Ae, Transition as Me, withCtx as Le, withKeys as St, onBeforeUnmount as zt, unref as y, withDirectives as Qe, vShow as Ge, reactive as et, provide as It, inject as Ft } from "vue";
|
|
2
|
-
import { g as Te, f as tt, a as Re, b as qe, n as Vt, i as Rt, D as qt, c as at } from "../index-
|
|
2
|
+
import { g as Te, f as tt, a as Re, b as qe, n as Vt, i as Rt, D as qt, c as at } from "../index-CdjLieSe.js";
|
|
3
3
|
import { J as Ot } from "../jszip.min-CdmYyw5L.js";
|
|
4
4
|
const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class: "artifactuse-card__content" }, Nt = { class: "artifactuse-card__title" }, Jt = { class: "artifactuse-card__meta" }, Xt = { class: "artifactuse-card__type" }, Zt = { class: "artifactuse-card__size" }, Wt = { class: "artifactuse-card__actions" }, Kt = ["title"], Yt = {
|
|
5
5
|
key: 0,
|
|
@@ -1840,7 +1840,7 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
|
|
|
1840
1840
|
function je() {
|
|
1841
1841
|
!x.value || !I.value || !l.value || (Pe(), de = $.editor.create(I.value, {
|
|
1842
1842
|
code: l.value.code || "",
|
|
1843
|
-
language: l.value.language || "plaintext",
|
|
1843
|
+
language: l.value.editorLanguage || l.value.language || "plaintext",
|
|
1844
1844
|
sdkTheme: $.getTheme()
|
|
1845
1845
|
}));
|
|
1846
1846
|
}
|
package/dist/vue2/index.js
CHANGED
|
@@ -2051,19 +2051,54 @@ function createEditorManager(editorConfig = {}) {
|
|
|
2051
2051
|
]);
|
|
2052
2052
|
}
|
|
2053
2053
|
|
|
2054
|
+
/**
|
|
2055
|
+
* Language → CodeMirror module mapping
|
|
2056
|
+
* Each entry: { mod: module key in config.editor.modules, fn: factory function name, opts?: options }
|
|
2057
|
+
*/
|
|
2058
|
+
const LANG_MAP = {
|
|
2059
|
+
'javascript': { mod: 'langJavascript', fn: 'javascript' },
|
|
2060
|
+
'js': { mod: 'langJavascript', fn: 'javascript' },
|
|
2061
|
+
'jsx': { mod: 'langJavascript', fn: 'javascript', opts: { jsx: true } },
|
|
2062
|
+
'typescript': { mod: 'langJavascript', fn: 'javascript', opts: { typescript: true } },
|
|
2063
|
+
'ts': { mod: 'langJavascript', fn: 'javascript', opts: { typescript: true } },
|
|
2064
|
+
'tsx': { mod: 'langJavascript', fn: 'javascript', opts: { jsx: true, typescript: true } },
|
|
2065
|
+
'python': { mod: 'langPython', fn: 'python' },
|
|
2066
|
+
'py': { mod: 'langPython', fn: 'python' },
|
|
2067
|
+
'html': { mod: 'langHtml', fn: 'html' },
|
|
2068
|
+
'htm': { mod: 'langHtml', fn: 'html' },
|
|
2069
|
+
'css': { mod: 'langCss', fn: 'css' },
|
|
2070
|
+
'json': { mod: 'langJson', fn: 'json' },
|
|
2071
|
+
'markdown': { mod: 'langMarkdown', fn: 'markdown' },
|
|
2072
|
+
'md': { mod: 'langMarkdown', fn: 'markdown' },
|
|
2073
|
+
'xml': { mod: 'langXml', fn: 'xml' },
|
|
2074
|
+
'yaml': { mod: 'langYaml', fn: 'yaml' },
|
|
2075
|
+
'yml': { mod: 'langYaml', fn: 'yaml' },
|
|
2076
|
+
'sql': { mod: 'langSql', fn: 'sql' },
|
|
2077
|
+
'java': { mod: 'langJava', fn: 'java' },
|
|
2078
|
+
'cpp': { mod: 'langCpp', fn: 'cpp' },
|
|
2079
|
+
'c': { mod: 'langCpp', fn: 'cpp' },
|
|
2080
|
+
'c++': { mod: 'langCpp', fn: 'cpp' },
|
|
2081
|
+
'go': { mod: 'langGo', fn: 'go' },
|
|
2082
|
+
'golang': { mod: 'langGo', fn: 'go' },
|
|
2083
|
+
'rust': { mod: 'langRust', fn: 'rust' },
|
|
2084
|
+
'rs': { mod: 'langRust', fn: 'rust' },
|
|
2085
|
+
'php': { mod: 'langPhp', fn: 'php' },
|
|
2086
|
+
'vue': { mod: 'langVue', fn: 'vue' },
|
|
2087
|
+
'angular': { mod: 'langAngular', fn: 'angular' },
|
|
2088
|
+
'less': { mod: 'langLess', fn: 'less' },
|
|
2089
|
+
'sass': { mod: 'langSass', fn: 'sass', opts: { indented: true } },
|
|
2090
|
+
'scss': { mod: 'langSass', fn: 'sass' },
|
|
2091
|
+
};
|
|
2092
|
+
|
|
2054
2093
|
/**
|
|
2055
2094
|
* Resolve language extension from language string
|
|
2056
2095
|
*/
|
|
2057
2096
|
function getLanguageExtension(lang) {
|
|
2058
|
-
const
|
|
2059
|
-
if (
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
return modules.langPython.python();
|
|
2064
|
-
}
|
|
2065
|
-
// No language extension — plain text
|
|
2066
|
-
return [];
|
|
2097
|
+
const entry = LANG_MAP[lang?.toLowerCase()];
|
|
2098
|
+
if (!entry) return [];
|
|
2099
|
+
const mod = modules[entry.mod];
|
|
2100
|
+
if (!mod || typeof mod[entry.fn] !== 'function') return [];
|
|
2101
|
+
return entry.opts ? mod[entry.fn](entry.opts) : mod[entry.fn]();
|
|
2067
2102
|
}
|
|
2068
2103
|
|
|
2069
2104
|
/**
|
|
@@ -6820,7 +6855,9 @@ function createArtifactuse(userConfig = {}) {
|
|
|
6820
6855
|
const artifact = createArtifact(code, resolvedLang, msgId, 0);
|
|
6821
6856
|
artifact.title = options.title || artifact.title;
|
|
6822
6857
|
artifact.isInline = false;
|
|
6858
|
+
artifact.editorLanguage = language;
|
|
6823
6859
|
if (options.tabs) artifact.tabs = options.tabs;
|
|
6860
|
+
if (options.panelUrl) artifact.panelUrl = options.panelUrl;
|
|
6824
6861
|
state.addArtifact(artifact);
|
|
6825
6862
|
openArtifact(artifact);
|
|
6826
6863
|
if (options.viewMode) state.setViewMode(options.viewMode);
|
|
@@ -6880,7 +6917,10 @@ function createArtifactuse(userConfig = {}) {
|
|
|
6880
6917
|
*/
|
|
6881
6918
|
function getPanelUrl(artifact, options = {}) {
|
|
6882
6919
|
if (!artifact) return null;
|
|
6883
|
-
|
|
6920
|
+
|
|
6921
|
+
// Custom panel URL takes priority over registry lookup
|
|
6922
|
+
if (artifact.panelUrl) return artifact.panelUrl;
|
|
6923
|
+
|
|
6884
6924
|
const { type, language } = artifact;
|
|
6885
6925
|
|
|
6886
6926
|
// Build options for panel URL
|
|
@@ -27089,7 +27129,7 @@ var script$1 = defineComponent({
|
|
|
27089
27129
|
destroyEditor();
|
|
27090
27130
|
editorInstance = instance.editor.create(editorContainerRef.value, {
|
|
27091
27131
|
code: activeArtifact.value.code || '',
|
|
27092
|
-
language: activeArtifact.value.language || 'plaintext',
|
|
27132
|
+
language: activeArtifact.value.editorLanguage || activeArtifact.value.language || 'plaintext',
|
|
27093
27133
|
sdkTheme: instance.getTheme(),
|
|
27094
27134
|
});
|
|
27095
27135
|
}
|