@vizejs/vite-plugin-musea 0.564.0 → 0.566.0
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/dist/a11y/index.d.mts +1 -1
- package/dist/a11y/index.mjs +1 -1
- package/dist/{a11y-CYZszxM7.mjs → a11y-CvjgENo9.mjs} +2 -2
- package/dist/{a11y-CYZszxM7.mjs.map → a11y-CvjgENo9.mjs.map} +1 -1
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.mjs +4 -3
- package/dist/cli/index.mjs.map +1 -1
- package/dist/gallery/assets/{MonacoEditor-C-Kz8nJV.js → MonacoEditor-BGVrhc2X.js} +2 -2
- package/dist/gallery/assets/{cssMode-tOL5h2ip.js → cssMode-COgcB_Po.js} +1 -1
- package/dist/gallery/assets/{editor.api-QJB2sGas.js → editor.api-qJSJ7Gzk.js} +1 -1
- package/dist/gallery/assets/{freemarker2-C0VTtNP9.js → freemarker2-CZxq_R_C.js} +1 -1
- package/dist/gallery/assets/{handlebars-BiViO-FR.js → handlebars-B5ngu8JD.js} +1 -1
- package/dist/gallery/assets/{html-lcJVRkaK.js → html-DBLTHxjC.js} +1 -1
- package/dist/gallery/assets/{htmlMode-B3N3KOLc.js → htmlMode-C_F6F2nC.js} +1 -1
- package/dist/gallery/assets/{index-BKBmulOh.js → index-CcXWIUyZ.js} +23 -23
- package/dist/gallery/assets/index-DgbWDrHF.css +1 -0
- package/dist/gallery/assets/{javascript-Hqp8uOPr.js → javascript-BnPalvVR.js} +1 -1
- package/dist/gallery/assets/{jsonMode-CNNTp7Vx.js → jsonMode-B9mP-X5z.js} +1 -1
- package/dist/gallery/assets/{liquid-DOuT761P.js → liquid-CQB9SE7f.js} +1 -1
- package/dist/gallery/assets/{lspLanguageFeatures-CPhp2FL1.js → lspLanguageFeatures-DCCz4pcV.js} +1 -1
- package/dist/gallery/assets/{mdx-BGUk7nH8.js → mdx-YmzWuhKr.js} +1 -1
- package/dist/gallery/assets/{python-xzGnnJ5Z.js → python-QmC9tp9f.js} +1 -1
- package/dist/gallery/assets/{razor-DomCeMH7.js → razor-Lo6W7GI9.js} +1 -1
- package/dist/gallery/assets/{register-B0fw3qCN.js → register-CyJ9awu9.js} +2 -2
- package/dist/gallery/assets/{toggleHighContrast-IyOZiwj0.js → toggleHighContrast-DoKT5tKP.js} +1 -1
- package/dist/gallery/assets/{tsMode-DCmcJQ4C.js → tsMode-DkbE8yJ8.js} +1 -1
- package/dist/gallery/assets/{typescript-CfpzSKnV.js → typescript-RprmrDbF.js} +1 -1
- package/dist/gallery/assets/{vs-C2QHYrig.js → vs-LGo4H9EM.js} +3 -3
- package/dist/gallery/assets/{workers-BvCKICgK.js → workers-CEMoRP2P.js} +1 -1
- package/dist/gallery/assets/{xml-Cgws4LRi.js → xml-B4CO-th0.js} +1 -1
- package/dist/gallery/assets/{yaml-B4z9DVwT.js → yaml-BTEADe-G.js} +1 -1
- package/dist/gallery/index.html +2 -2
- package/dist/{gallery-LgVvVp28.mjs → gallery-DXaH86OI.mjs} +2 -2
- package/dist/{gallery-LgVvVp28.mjs.map → gallery-DXaH86OI.mjs.map} +1 -1
- package/dist/{index-CYEDgY-M.d.mts → index-CxpR3ksr.d.mts} +3 -3
- package/dist/{index-CYEDgY-M.d.mts.map → index-CxpR3ksr.d.mts.map} +1 -1
- package/dist/{index-CbChC9Bf.d.mts → index-KyKZJ6OT.d.mts} +22 -9
- package/dist/{index-CbChC9Bf.d.mts.map → index-KyKZJ6OT.d.mts.map} +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +8 -7
- package/dist/index.mjs.map +1 -1
- package/dist/{options-QDw_2r_3.mjs → options-CEIwZOhA.mjs} +34 -15
- package/dist/{options-QDw_2r_3.mjs.map → options-CEIwZOhA.mjs.map} +1 -1
- package/dist/{template-CpNUvZPp.mjs → template-rlGXzHBV.mjs} +2 -2
- package/dist/{template-CpNUvZPp.mjs.map → template-rlGXzHBV.mjs.map} +1 -1
- package/dist/{utils-BloA9YP9.mjs → utils-BRD_8Qsx.mjs} +23 -3
- package/dist/utils-BRD_8Qsx.mjs.map +1 -0
- package/dist/{vrt-DxXnmy43.mjs → vrt-CUz4NxKK.mjs} +83 -34
- package/dist/vrt-CUz4NxKK.mjs.map +1 -0
- package/dist/{vrt-DNoUalLH.d.mts → vrt-CpKpx_dy.d.mts} +16 -4
- package/dist/vrt-CpKpx_dy.d.mts.map +1 -0
- package/dist/vrt.d.mts +3 -2
- package/dist/vrt.mjs +2 -2
- package/package.json +4 -4
- package/dist/gallery/assets/index-B1qvZxKX.css +0 -1
- package/dist/utils-BloA9YP9.mjs.map +0 -1
- package/dist/vrt-DNoUalLH.d.mts.map +0 -1
- package/dist/vrt-DxXnmy43.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as loadNative, S as resolveTrustedSourcePath, T as analyzeSfcFallback, f as parseJsonBody, g as assertComponentSourcePath, s as toPascalCase, t as escapeHtml, v as decodeUrlComponent, w as HttpError, x as resolveInsideAny, y as isVueSourcePath } from "./utils-
|
|
2
|
-
import {
|
|
1
|
+
import { E as loadNative, S as resolveTrustedSourcePath, T as analyzeSfcFallback, f as parseJsonBody, g as assertComponentSourcePath, s as toPascalCase, t as escapeHtml, v as decodeUrlComponent, w as HttpError, x as resolveInsideAny, y as isVueSourcePath } from "./utils-BRD_8Qsx.mjs";
|
|
2
|
+
import { s as resolveSnapshotIdentity } from "./vrt-CUz4NxKK.mjs";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import ts from "typescript";
|
|
@@ -1772,8 +1772,20 @@ async function handleArtPalette(ctx, match, sendJson, sendError) {
|
|
|
1772
1772
|
const source = await fs.promises.readFile(readableArtPath, "utf-8");
|
|
1773
1773
|
const binding = loadNative();
|
|
1774
1774
|
let palette;
|
|
1775
|
-
if (binding.generateArtPalette)
|
|
1776
|
-
|
|
1775
|
+
if (binding.generateArtPalette) {
|
|
1776
|
+
const generated = binding.generateArtPalette(source, { filename: readableArtPath });
|
|
1777
|
+
palette = {
|
|
1778
|
+
...generated,
|
|
1779
|
+
controls: generated.controls.map(({ defaultValue, ...control }) => ({
|
|
1780
|
+
...control,
|
|
1781
|
+
...defaultValue !== void 0 ? { default_value: defaultValue } : {}
|
|
1782
|
+
}))
|
|
1783
|
+
};
|
|
1784
|
+
palette.json = JSON.stringify({
|
|
1785
|
+
title: palette.title,
|
|
1786
|
+
controls: palette.controls
|
|
1787
|
+
}, null, 2);
|
|
1788
|
+
} else palette = {
|
|
1777
1789
|
title: art.metadata.title,
|
|
1778
1790
|
controls: [],
|
|
1779
1791
|
groups: [],
|
|
@@ -1822,7 +1834,12 @@ function applyPropMetadata(control, prop) {
|
|
|
1822
1834
|
const inferred = inferControl(prop.type);
|
|
1823
1835
|
control.name = prop.name;
|
|
1824
1836
|
control.required = prop.required;
|
|
1825
|
-
if (control.default_value === void 0 && prop.default_value !== void 0) control.default_value =
|
|
1837
|
+
if (control.default_value === void 0 && prop.default_value !== void 0) control.default_value = prop.default_value;
|
|
1838
|
+
if (prop.unsupported_default) {
|
|
1839
|
+
control.unsupported_default = true;
|
|
1840
|
+
control.default_source = prop.default_source;
|
|
1841
|
+
control.description = "The component retains its authored default; this expression is not evaluated for Controls.";
|
|
1842
|
+
}
|
|
1826
1843
|
if (inferred.control !== "text" || control.control === "text") control.control = inferred.control;
|
|
1827
1844
|
if (inferred.options.length > 0) control.options = inferred.options;
|
|
1828
1845
|
}
|
|
@@ -1831,8 +1848,12 @@ function controlFromProp(prop) {
|
|
|
1831
1848
|
return {
|
|
1832
1849
|
name: prop.name,
|
|
1833
1850
|
control: inferred.control,
|
|
1834
|
-
default_value: prop.default_value
|
|
1835
|
-
|
|
1851
|
+
default_value: prop.default_value,
|
|
1852
|
+
...prop.unsupported_default ? {
|
|
1853
|
+
unsupported_default: true,
|
|
1854
|
+
default_source: prop.default_source,
|
|
1855
|
+
description: "The component retains its authored default; this expression is not evaluated for Controls."
|
|
1856
|
+
} : {},
|
|
1836
1857
|
required: prop.required,
|
|
1837
1858
|
options: inferred.options,
|
|
1838
1859
|
range: void 0,
|
|
@@ -1841,6 +1862,10 @@ function controlFromProp(prop) {
|
|
|
1841
1862
|
}
|
|
1842
1863
|
function inferControl(type) {
|
|
1843
1864
|
const normalized = type.trim();
|
|
1865
|
+
if (normalized.includes("=>") || normalized === "Function") return {
|
|
1866
|
+
control: "function",
|
|
1867
|
+
options: []
|
|
1868
|
+
};
|
|
1844
1869
|
const options = literalOptions(normalized);
|
|
1845
1870
|
if (options.length > 0) return {
|
|
1846
1871
|
control: "select",
|
|
@@ -1881,13 +1906,6 @@ function literalOptions(type) {
|
|
|
1881
1906
|
value
|
|
1882
1907
|
}));
|
|
1883
1908
|
}
|
|
1884
|
-
function parseDefault(value) {
|
|
1885
|
-
if (typeof value !== "string") return value;
|
|
1886
|
-
if (value === "true") return true;
|
|
1887
|
-
if (value === "false") return false;
|
|
1888
|
-
if (/^-?\d+(?:\.\d+)?$/.test(value)) return Number(value);
|
|
1889
|
-
return value.replace(/^["']|["']$/g, "");
|
|
1890
|
-
}
|
|
1891
1909
|
function normalizePropName(name) {
|
|
1892
1910
|
return name.replace(/[-_]/g, "").toLowerCase();
|
|
1893
1911
|
}
|
|
@@ -1900,6 +1918,7 @@ function generateTypescript(palette) {
|
|
|
1900
1918
|
function controlTsType(control) {
|
|
1901
1919
|
if (control.control === "boolean") return "boolean";
|
|
1902
1920
|
if (control.control === "number" || control.control === "range") return "number";
|
|
1921
|
+
if (control.control === "function") return "(...args: unknown[]) => unknown";
|
|
1903
1922
|
if (control.control === "array") return "unknown[]";
|
|
1904
1923
|
if (control.control === "object") return "Record<string, unknown>";
|
|
1905
1924
|
if (control.control === "select" && control.options.length > 0) return control.options.map((option) => JSON.stringify(option.value)).join(" | ");
|
|
@@ -2436,4 +2455,4 @@ function readMuseaOptions(plugin) {
|
|
|
2436
2455
|
//#endregion
|
|
2437
2456
|
export { buildTokenMap as A, expandSelfTag as B, handleTokensGet as C, generateTokensHtml as D, resolveTokenPreview as E, parseScriptSetupForArt as F, variantComponentNames as H, rewriteRelativeImportStatement as I, loadArtStyle as L, scanTokenUsage as M, parseTokens as N, generateTokensMarkdown as O, generateArtModule as P, parseArtStyleRequest as R, handleTokensDelete as S, handleTokensUsage as T, resolveArtComponent as V, handleArtAnalysis as _, attachArtReportOwner as a, handleArtPalette as b, rewriteDevGalleryAsset as c, createStaticGalleryPayload as d, joinUrlPath as f, sortedArts as g, staticPreviewId as h, assertArtReportOwnership as i, resolveReferences as j, processStyleDictionary as k, rewriteGalleryBase as l, resolveStaticIdentityRoot as m, readMuseaOptions as n, resolveArtReportTarget as o, resolveStaticArtIdentity as p, processMuseaArtFile as r, publicBasePathFromViteBase as s, attachMuseaOptions as t, rewriteGalleryTextAssetBase as u, handleArtDocs as v, handleTokensUpdate as w, handleTokensCreate as x, handleArtSource as y, transformPreprocessedArtStyle as z };
|
|
2438
2457
|
|
|
2439
|
-
//# sourceMappingURL=options-
|
|
2458
|
+
//# sourceMappingURL=options-CEIwZOhA.mjs.map
|