@vizejs/vite-plugin-musea 0.213.0 → 0.215.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.
Files changed (32) hide show
  1. package/README.md +45 -0
  2. package/client.d.ts +19 -0
  3. package/dist/gallery/assets/{MonacoEditor-DDaVVCDS.js → MonacoEditor-CFvlW1hH.js} +2 -2
  4. package/dist/gallery/assets/{cssMode-CKViSGi9.js → cssMode-CakihE-X.js} +1 -1
  5. package/dist/gallery/assets/{editor.api2-JLPIid3z.js → editor.api2-Cy8xN_Vy.js} +1 -1
  6. package/dist/gallery/assets/{editor.main-Bq_ctcW5.js → editor.main-BLvJY5pY.js} +2 -2
  7. package/dist/gallery/assets/{freemarker2-Ch47yFcF.js → freemarker2-8JKQlxkN.js} +1 -1
  8. package/dist/gallery/assets/{handlebars-FXhbY-x_.js → handlebars-DswXPT5M.js} +1 -1
  9. package/dist/gallery/assets/{html-C0HtpPJN.js → html-CHz-ZCgY.js} +1 -1
  10. package/dist/gallery/assets/{htmlMode-CG2rAkzX.js → htmlMode-DSb6gosw.js} +1 -1
  11. package/dist/gallery/assets/{index-BiffEg37.js → index-CfyRpnTg.js} +3 -3
  12. package/dist/gallery/assets/index-DrcH3Amz.css +1 -0
  13. package/dist/gallery/assets/{javascript-jKsG4cGd.js → javascript-93Vdo_Zi.js} +1 -1
  14. package/dist/gallery/assets/{jsonMode-C5r8Zpre.js → jsonMode-C41SvLGl.js} +1 -1
  15. package/dist/gallery/assets/{liquid-DmBC_f_t.js → liquid-Ba4G1nCV.js} +1 -1
  16. package/dist/gallery/assets/{lspLanguageFeatures-CG46WfMo.js → lspLanguageFeatures-DQpvFrJR.js} +1 -1
  17. package/dist/gallery/assets/{mdx-B5QE5lNU.js → mdx-kar2jls9.js} +1 -1
  18. package/dist/gallery/assets/{monaco.contribution-B3jBCkTa.js → monaco.contribution-D9SaY72O.js} +2 -2
  19. package/dist/gallery/assets/{python-BvMcq-jA.js → python-Cl3SeCHc.js} +1 -1
  20. package/dist/gallery/assets/{razor-DSc3s6wR.js → razor-BddYKQ4w.js} +1 -1
  21. package/dist/gallery/assets/{tsMode-CLuaQ4mz.js → tsMode-CHpNkjIG.js} +1 -1
  22. package/dist/gallery/assets/{typescript-Cv22HOTq.js → typescript-CiUtldbq.js} +1 -1
  23. package/dist/gallery/assets/{workers-asCHrC9z.js → workers-BsJar7qW.js} +1 -1
  24. package/dist/gallery/assets/{xml-8-9t-9Fe.js → xml-B2FG-0eD.js} +1 -1
  25. package/dist/gallery/assets/{yaml-Cbg_VNtl.js → yaml-Dt-gwFST.js} +1 -1
  26. package/dist/gallery/index.html +2 -2
  27. package/dist/index.d.mts +5 -5
  28. package/dist/index.d.mts.map +1 -1
  29. package/dist/index.mjs +294 -59
  30. package/dist/index.mjs.map +1 -1
  31. package/package.json +9 -5
  32. package/dist/gallery/assets/index-BiMZ3Oo8.css +0 -1
@@ -1 +1 @@
1
- import{h as e}from"./editor.api2-JLPIid3z.js";var t={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:`//`,blockComment:[`/*`,`*/`]},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:e.IndentAction.IndentOutdent,appendText:` * `}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:e.IndentAction.None,appendText:` * `}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:e.IndentAction.None,appendText:`* `}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:e.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`,notIn:[`string`]},{open:`'`,close:`'`,notIn:[`string`,`comment`]},{open:"`",close:"`",notIn:[`string`,`comment`]},{open:`/**`,close:` */`,notIn:[`string`]}],folding:{markers:{start:RegExp(`^\\s*//\\s*#?region\\b`),end:RegExp(`^\\s*//\\s*#?endregion\\b`)}}},n={defaultToken:`invalid`,tokenPostfix:`.ts`,keywords:`abstract.any.as.asserts.bigint.boolean.break.case.catch.class.continue.const.constructor.debugger.declare.default.delete.do.else.enum.export.extends.false.finally.for.from.function.get.if.implements.import.in.infer.instanceof.interface.is.keyof.let.module.namespace.never.new.null.number.object.out.package.private.protected.public.override.readonly.require.global.return.satisfies.set.static.string.super.switch.symbol.this.throw.true.try.type.typeof.undefined.unique.unknown.var.void.while.with.yield.async.await.of`.split(`.`),operators:`<=.>=.==.!=.===.!==.=>.+.-.**.*./.%.++.--.<<.</.>>.>>>.&.|.^.!.~.&&.||.??.?.:.=.+=.-=.*=.**=./=.%=.<<=.>>=.>>>=.&=.|=.^=.@`.split(`.`),symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/[{}]/,`delimiter.bracket`],{include:`common`}],common:[[/#?[a-z_$][\w$]*/,{cases:{"@keywords":`keyword`,"@default":`identifier`}}],[/[A-Z][\w\$]*/,`type.identifier`],{include:`@whitespace`},[/\/(?=([^\\\/]|\\.)+\/([dgimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,{token:`regexp`,bracket:`@open`,next:`@regexp`}],[/[()\[\]]/,`@brackets`],[/[<>](?!@symbols)/,`@brackets`],[/!(?=([^=]|$))/,`delimiter`],[/@symbols/,{cases:{"@operators":`delimiter`,"@default":``}}],[/(@digits)[eE]([\-+]?(@digits))?/,`number.float`],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,`number.float`],[/0[xX](@hexdigits)n?/,`number.hex`],[/0[oO]?(@octaldigits)n?/,`number.octal`],[/0[bB](@binarydigits)n?/,`number.binary`],[/(@digits)n?/,`number`],[/[;,.]/,`delimiter`],[/"([^"\\]|\\.)*$/,`string.invalid`],[/'([^'\\]|\\.)*$/,`string.invalid`],[/"/,`string`,`@string_double`],[/'/,`string`,`@string_single`],[/`/,`string`,`@string_backtick`]],whitespace:[[/[ \t\r\n]+/,``],[/\/\*\*(?!\/)/,`comment.doc`,`@jsdoc`],[/\/\*/,`comment`,`@comment`],[/\/\/.*$/,`comment`]],comment:[[/[^\/*]+/,`comment`],[/\*\//,`comment`,`@pop`],[/[\/*]/,`comment`]],jsdoc:[[/[^\/*]+/,`comment.doc`],[/\*\//,`comment.doc`,`@pop`],[/[\/*]/,`comment.doc`]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,[`regexp.escape.control`,`regexp.escape.control`,`regexp.escape.control`]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,[`regexp.escape.control`,{token:`regexp.escape.control`,next:`@regexrange`}]],[/(\()(\?:|\?=|\?!)/,[`regexp.escape.control`,`regexp.escape.control`]],[/[()]/,`regexp.escape.control`],[/@regexpctl/,`regexp.escape.control`],[/[^\\\/]/,`regexp`],[/@regexpesc/,`regexp.escape`],[/\\\./,`regexp.invalid`],[/(\/)([dgimsuy]*)/,[{token:`regexp`,bracket:`@close`,next:`@pop`},`keyword.other`]]],regexrange:[[/-/,`regexp.escape.control`],[/\^/,`regexp.invalid`],[/@regexpesc/,`regexp.escape`],[/[^\]]/,`regexp`],[/\]/,{token:`regexp.escape.control`,next:`@pop`,bracket:`@close`}]],string_double:[[/[^\\"]+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/"/,`string`,`@pop`]],string_single:[[/[^\\']+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/'/,`string`,`@pop`]],string_backtick:[[/\$\{/,{token:`delimiter.bracket`,next:`@bracketCounting`}],[/[^\\`$]+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/`/,`string`,`@pop`]],bracketCounting:[[/\{/,`delimiter.bracket`,`@bracketCounting`],[/\}/,`delimiter.bracket`,`@pop`],{include:`common`}]}};export{t as conf,n as language};
1
+ import{h as e}from"./editor.api2-Cy8xN_Vy.js";var t={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:`//`,blockComment:[`/*`,`*/`]},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:e.IndentAction.IndentOutdent,appendText:` * `}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:e.IndentAction.None,appendText:` * `}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:e.IndentAction.None,appendText:`* `}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:e.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`,notIn:[`string`]},{open:`'`,close:`'`,notIn:[`string`,`comment`]},{open:"`",close:"`",notIn:[`string`,`comment`]},{open:`/**`,close:` */`,notIn:[`string`]}],folding:{markers:{start:RegExp(`^\\s*//\\s*#?region\\b`),end:RegExp(`^\\s*//\\s*#?endregion\\b`)}}},n={defaultToken:`invalid`,tokenPostfix:`.ts`,keywords:`abstract.any.as.asserts.bigint.boolean.break.case.catch.class.continue.const.constructor.debugger.declare.default.delete.do.else.enum.export.extends.false.finally.for.from.function.get.if.implements.import.in.infer.instanceof.interface.is.keyof.let.module.namespace.never.new.null.number.object.out.package.private.protected.public.override.readonly.require.global.return.satisfies.set.static.string.super.switch.symbol.this.throw.true.try.type.typeof.undefined.unique.unknown.var.void.while.with.yield.async.await.of`.split(`.`),operators:`<=.>=.==.!=.===.!==.=>.+.-.**.*./.%.++.--.<<.</.>>.>>>.&.|.^.!.~.&&.||.??.?.:.=.+=.-=.*=.**=./=.%=.<<=.>>=.>>>=.&=.|=.^=.@`.split(`.`),symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/[{}]/,`delimiter.bracket`],{include:`common`}],common:[[/#?[a-z_$][\w$]*/,{cases:{"@keywords":`keyword`,"@default":`identifier`}}],[/[A-Z][\w\$]*/,`type.identifier`],{include:`@whitespace`},[/\/(?=([^\\\/]|\\.)+\/([dgimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,{token:`regexp`,bracket:`@open`,next:`@regexp`}],[/[()\[\]]/,`@brackets`],[/[<>](?!@symbols)/,`@brackets`],[/!(?=([^=]|$))/,`delimiter`],[/@symbols/,{cases:{"@operators":`delimiter`,"@default":``}}],[/(@digits)[eE]([\-+]?(@digits))?/,`number.float`],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,`number.float`],[/0[xX](@hexdigits)n?/,`number.hex`],[/0[oO]?(@octaldigits)n?/,`number.octal`],[/0[bB](@binarydigits)n?/,`number.binary`],[/(@digits)n?/,`number`],[/[;,.]/,`delimiter`],[/"([^"\\]|\\.)*$/,`string.invalid`],[/'([^'\\]|\\.)*$/,`string.invalid`],[/"/,`string`,`@string_double`],[/'/,`string`,`@string_single`],[/`/,`string`,`@string_backtick`]],whitespace:[[/[ \t\r\n]+/,``],[/\/\*\*(?!\/)/,`comment.doc`,`@jsdoc`],[/\/\*/,`comment`,`@comment`],[/\/\/.*$/,`comment`]],comment:[[/[^\/*]+/,`comment`],[/\*\//,`comment`,`@pop`],[/[\/*]/,`comment`]],jsdoc:[[/[^\/*]+/,`comment.doc`],[/\*\//,`comment.doc`,`@pop`],[/[\/*]/,`comment.doc`]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,[`regexp.escape.control`,`regexp.escape.control`,`regexp.escape.control`]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,[`regexp.escape.control`,{token:`regexp.escape.control`,next:`@regexrange`}]],[/(\()(\?:|\?=|\?!)/,[`regexp.escape.control`,`regexp.escape.control`]],[/[()]/,`regexp.escape.control`],[/@regexpctl/,`regexp.escape.control`],[/[^\\\/]/,`regexp`],[/@regexpesc/,`regexp.escape`],[/\\\./,`regexp.invalid`],[/(\/)([dgimsuy]*)/,[{token:`regexp`,bracket:`@close`,next:`@pop`},`keyword.other`]]],regexrange:[[/-/,`regexp.escape.control`],[/\^/,`regexp.invalid`],[/@regexpesc/,`regexp.escape`],[/[^\]]/,`regexp`],[/\]/,{token:`regexp.escape.control`,next:`@pop`,bracket:`@close`}]],string_double:[[/[^\\"]+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/"/,`string`,`@pop`]],string_single:[[/[^\\']+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/'/,`string`,`@pop`]],string_backtick:[[/\$\{/,{token:`delimiter.bracket`,next:`@bracketCounting`}],[/[^\\`$]+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/`/,`string`,`@pop`]],bracketCounting:[[/\{/,`delimiter.bracket`,`@bracketCounting`],[/\}/,`delimiter.bracket`,`@pop`],{include:`common`}]}};export{t as conf,n as language};
@@ -1 +1 @@
1
- import{p as e}from"./editor.api2-JLPIid3z.js";function t(e,t){let n=globalThis.MonacoEnvironment;if(n?.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(e,t)}catch(e){console.error(e);return}try{return globalThis.trustedTypes?.createPolicy(e,t)}catch(e){console.error(e);return}}var n=typeof self==`object`&&self.constructor&&self.constructor.name===`DedicatedWorkerGlobalScope`&&globalThis.workerttPolicy!==void 0?globalThis.workerttPolicy:t(`defaultWorkerFactory`,{createScriptURL:e=>e});function r(e){let t=e.label,r=globalThis.MonacoEnvironment;if(r){if(typeof r.getWorker==`function`)return r.getWorker(`workerMain.js`,t);if(typeof r.getWorkerUrl==`function`){let e=r.getWorkerUrl(`workerMain.js`,t);return new Worker(n?n.createScriptURL(e):e,{name:t,type:`module`})}}if(e.createWorker)return e.createWorker();throw Error(`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker`)}function i(t){let n=Promise.resolve(r({label:t.label??`monaco-editor-worker`,moduleId:t.moduleId,createWorker:t.createWorker})).then(e=>(e.postMessage(`ignore`),e.postMessage(t.createData),e));return e.createWebWorker({worker:n,host:t.host,keepIdleModels:t.keepIdleModels})}export{i as t};
1
+ import{p as e}from"./editor.api2-Cy8xN_Vy.js";function t(e,t){let n=globalThis.MonacoEnvironment;if(n?.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(e,t)}catch(e){console.error(e);return}try{return globalThis.trustedTypes?.createPolicy(e,t)}catch(e){console.error(e);return}}var n=typeof self==`object`&&self.constructor&&self.constructor.name===`DedicatedWorkerGlobalScope`&&globalThis.workerttPolicy!==void 0?globalThis.workerttPolicy:t(`defaultWorkerFactory`,{createScriptURL:e=>e});function r(e){let t=e.label,r=globalThis.MonacoEnvironment;if(r){if(typeof r.getWorker==`function`)return r.getWorker(`workerMain.js`,t);if(typeof r.getWorkerUrl==`function`){let e=r.getWorkerUrl(`workerMain.js`,t);return new Worker(n?n.createScriptURL(e):e,{name:t,type:`module`})}}if(e.createWorker)return e.createWorker();throw Error(`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker`)}function i(t){let n=Promise.resolve(r({label:t.label??`monaco-editor-worker`,moduleId:t.moduleId,createWorker:t.createWorker})).then(e=>(e.postMessage(`ignore`),e.postMessage(t.createData),e));return e.createWebWorker({worker:n,host:t.host,keepIdleModels:t.keepIdleModels})}export{i as t};
@@ -1 +1 @@
1
- import{h as e}from"./editor.api2-JLPIid3z.js";var t={comments:{blockComment:[`<!--`,`-->`]},brackets:[[`<`,`>`]],autoClosingPairs:[{open:`<`,close:`>`},{open:`'`,close:`'`},{open:`"`,close:`"`}],surroundingPairs:[{open:`<`,close:`>`},{open:`'`,close:`'`},{open:`"`,close:`"`}],onEnterRules:[{beforeText:RegExp(`<([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`<(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),action:{indentAction:e.IndentAction.Indent}}]},n={defaultToken:``,tokenPostfix:`.xml`,ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,``],{include:`@whitespace`},[/(<)(@qualifiedName)/,[{token:`delimiter`},{token:`tag`,next:`@tag`}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:`delimiter`},{token:`tag`},``,{token:`delimiter`}]],[/(<\?)(@qualifiedName)/,[{token:`delimiter`},{token:`metatag`,next:`@tag`}]],[/(<\!)(@qualifiedName)/,[{token:`delimiter`},{token:`metatag`,next:`@tag`}]],[/<\!\[CDATA\[/,{token:`delimiter.cdata`,next:`@cdata`}],[/&\w+;/,`string.escape`]],cdata:[[/[^\]]+/,``],[/\]\]>/,{token:`delimiter.cdata`,next:`@pop`}],[/\]/,``]],tag:[[/[ \t\r\n]+/,``],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,[`attribute.name`,``,`attribute.value`]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,[`attribute.name`,``,`attribute.value`]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,[`attribute.name`,``,`attribute.value`]],[/@qualifiedName/,`attribute.name`],[/\?>/,{token:`delimiter`,next:`@pop`}],[/(\/)(>)/,[{token:`tag`},{token:`delimiter`,next:`@pop`}]],[/>/,{token:`delimiter`,next:`@pop`}]],whitespace:[[/[ \t\r\n]+/,``],[/<!--/,{token:`comment`,next:`@comment`}]],comment:[[/[^<\-]+/,`comment.content`],[/-->/,{token:`comment`,next:`@pop`}],[/<!--/,`comment.content.invalid`],[/[<\-]/,`comment.content`]]}};export{t as conf,n as language};
1
+ import{h as e}from"./editor.api2-Cy8xN_Vy.js";var t={comments:{blockComment:[`<!--`,`-->`]},brackets:[[`<`,`>`]],autoClosingPairs:[{open:`<`,close:`>`},{open:`'`,close:`'`},{open:`"`,close:`"`}],surroundingPairs:[{open:`<`,close:`>`},{open:`'`,close:`'`},{open:`"`,close:`"`}],onEnterRules:[{beforeText:RegExp(`<([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`<(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),action:{indentAction:e.IndentAction.Indent}}]},n={defaultToken:``,tokenPostfix:`.xml`,ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,``],{include:`@whitespace`},[/(<)(@qualifiedName)/,[{token:`delimiter`},{token:`tag`,next:`@tag`}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:`delimiter`},{token:`tag`},``,{token:`delimiter`}]],[/(<\?)(@qualifiedName)/,[{token:`delimiter`},{token:`metatag`,next:`@tag`}]],[/(<\!)(@qualifiedName)/,[{token:`delimiter`},{token:`metatag`,next:`@tag`}]],[/<\!\[CDATA\[/,{token:`delimiter.cdata`,next:`@cdata`}],[/&\w+;/,`string.escape`]],cdata:[[/[^\]]+/,``],[/\]\]>/,{token:`delimiter.cdata`,next:`@pop`}],[/\]/,``]],tag:[[/[ \t\r\n]+/,``],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,[`attribute.name`,``,`attribute.value`]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,[`attribute.name`,``,`attribute.value`]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,[`attribute.name`,``,`attribute.value`]],[/@qualifiedName/,`attribute.name`],[/\?>/,{token:`delimiter`,next:`@pop`}],[/(\/)(>)/,[{token:`tag`},{token:`delimiter`,next:`@pop`}]],[/>/,{token:`delimiter`,next:`@pop`}]],whitespace:[[/[ \t\r\n]+/,``],[/<!--/,{token:`comment`,next:`@comment`}]],comment:[[/[^<\-]+/,`comment.content`],[/-->/,{token:`comment`,next:`@pop`}],[/<!--/,`comment.content.invalid`],[/[<\-]/,`comment.content`]]}};export{t as conf,n as language};
@@ -1 +1 @@
1
- import{h as e}from"./editor.api2-JLPIid3z.js";var t={comments:{lineComment:`#`},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:e.IndentAction.Indent}}]},n={tokenPostfix:`.yaml`,brackets:[{token:`delimiter.bracket`,open:`{`,close:`}`},{token:`delimiter.square`,open:`[`,close:`]`}],keywords:[`true`,`True`,`TRUE`,`false`,`False`,`FALSE`,`null`,`Null`,`Null`,`~`],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:`@whitespace`},{include:`@comment`},[/%[^ ]+.*$/,`meta.directive`],[/---/,`operators.directivesEnd`],[/\.{3}/,`operators.documentEnd`],[/[-?:](?= )/,`operators`],{include:`@anchor`},{include:`@tagHandle`},{include:`@flowCollections`},{include:`@blockStyle`},[/@numberInteger(?![ \t]*\S+)/,`number`],[/@numberFloat(?![ \t]*\S+)/,`number.float`],[/@numberOctal(?![ \t]*\S+)/,`number.octal`],[/@numberHex(?![ \t]*\S+)/,`number.hex`],[/@numberInfinity(?![ \t]*\S+)/,`number.infinity`],[/@numberNaN(?![ \t]*\S+)/,`number.nan`],[/@numberDate(?![ \t]*\S+)/,`number.date`],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,[`type`,`white`,`operators`,`white`]],{include:`@flowScalars`},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],object:[{include:`@whitespace`},{include:`@comment`},[/\}/,`@brackets`,`@pop`],[/,/,`delimiter.comma`],[/:(?= )/,`operators`],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,`type`],{include:`@flowCollections`},{include:`@flowScalars`},{include:`@tagHandle`},{include:`@anchor`},{include:`@flowNumber`},[/[^\},]+/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],array:[{include:`@whitespace`},{include:`@comment`},[/\]/,`@brackets`,`@pop`],[/,/,`delimiter.comma`],{include:`@flowCollections`},{include:`@flowScalars`},{include:`@tagHandle`},{include:`@anchor`},{include:`@flowNumber`},[/[^\],]+/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],multiString:[[/^( +).+$/,`string`,`@multiStringContinued.$1`]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":`string`,"@default":{token:`@rematch`,next:`@popall`}}}]],whitespace:[[/[ \t\r\n]+/,`white`]],comment:[[/#.*$/,`comment`]],flowCollections:[[/\[/,`@brackets`,`@array`],[/\{/,`@brackets`,`@object`]],flowScalars:[[/"([^"\\]|\\.)*$/,`string.invalid`],[/'([^'\\]|\\.)*$/,`string.invalid`],[/'[^']*'/,`string`],[/"/,`string`,`@doubleQuotedString`]],doubleQuotedString:[[/[^\\"]+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/"/,`string`,`@pop`]],blockStyle:[[/[>|][0-9]*[+-]?$/,`operators`,`@multiString`]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,`number`],[/@numberFloat(?=[ \t]*[,\]\}])/,`number.float`],[/@numberOctal(?=[ \t]*[,\]\}])/,`number.octal`],[/@numberHex(?=[ \t]*[,\]\}])/,`number.hex`],[/@numberInfinity(?=[ \t]*[,\]\}])/,`number.infinity`],[/@numberNaN(?=[ \t]*[,\]\}])/,`number.nan`],[/@numberDate(?=[ \t]*[,\]\}])/,`number.date`]],tagHandle:[[/\![^ ]*/,`tag`]],anchor:[[/[&*][^ ]+/,`namespace`]]}};export{t as conf,n as language};
1
+ import{h as e}from"./editor.api2-Cy8xN_Vy.js";var t={comments:{lineComment:`#`},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:e.IndentAction.Indent}}]},n={tokenPostfix:`.yaml`,brackets:[{token:`delimiter.bracket`,open:`{`,close:`}`},{token:`delimiter.square`,open:`[`,close:`]`}],keywords:[`true`,`True`,`TRUE`,`false`,`False`,`FALSE`,`null`,`Null`,`Null`,`~`],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:`@whitespace`},{include:`@comment`},[/%[^ ]+.*$/,`meta.directive`],[/---/,`operators.directivesEnd`],[/\.{3}/,`operators.documentEnd`],[/[-?:](?= )/,`operators`],{include:`@anchor`},{include:`@tagHandle`},{include:`@flowCollections`},{include:`@blockStyle`},[/@numberInteger(?![ \t]*\S+)/,`number`],[/@numberFloat(?![ \t]*\S+)/,`number.float`],[/@numberOctal(?![ \t]*\S+)/,`number.octal`],[/@numberHex(?![ \t]*\S+)/,`number.hex`],[/@numberInfinity(?![ \t]*\S+)/,`number.infinity`],[/@numberNaN(?![ \t]*\S+)/,`number.nan`],[/@numberDate(?![ \t]*\S+)/,`number.date`],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,[`type`,`white`,`operators`,`white`]],{include:`@flowScalars`},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],object:[{include:`@whitespace`},{include:`@comment`},[/\}/,`@brackets`,`@pop`],[/,/,`delimiter.comma`],[/:(?= )/,`operators`],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,`type`],{include:`@flowCollections`},{include:`@flowScalars`},{include:`@tagHandle`},{include:`@anchor`},{include:`@flowNumber`},[/[^\},]+/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],array:[{include:`@whitespace`},{include:`@comment`},[/\]/,`@brackets`,`@pop`],[/,/,`delimiter.comma`],{include:`@flowCollections`},{include:`@flowScalars`},{include:`@tagHandle`},{include:`@anchor`},{include:`@flowNumber`},[/[^\],]+/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],multiString:[[/^( +).+$/,`string`,`@multiStringContinued.$1`]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":`string`,"@default":{token:`@rematch`,next:`@popall`}}}]],whitespace:[[/[ \t\r\n]+/,`white`]],comment:[[/#.*$/,`comment`]],flowCollections:[[/\[/,`@brackets`,`@array`],[/\{/,`@brackets`,`@object`]],flowScalars:[[/"([^"\\]|\\.)*$/,`string.invalid`],[/'([^'\\]|\\.)*$/,`string.invalid`],[/'[^']*'/,`string`],[/"/,`string`,`@doubleQuotedString`]],doubleQuotedString:[[/[^\\"]+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/"/,`string`,`@pop`]],blockStyle:[[/[>|][0-9]*[+-]?$/,`operators`,`@multiString`]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,`number`],[/@numberFloat(?=[ \t]*[,\]\}])/,`number.float`],[/@numberOctal(?=[ \t]*[,\]\}])/,`number.octal`],[/@numberHex(?=[ \t]*[,\]\}])/,`number.hex`],[/@numberInfinity(?=[ \t]*[,\]\}])/,`number.infinity`],[/@numberNaN(?=[ \t]*[,\]\}])/,`number.nan`],[/@numberDate(?=[ \t]*[,\]\}])/,`number.date`]],tagHandle:[[/\![^ ]*/,`tag`]],anchor:[[/[&*][^ ]+/,`namespace`]]}};export{t as conf,n as language};
@@ -10,8 +10,8 @@
10
10
  href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
11
11
  rel="stylesheet"
12
12
  />
13
- <script type="module" crossorigin src="/__musea__/assets/index-BiffEg37.js"></script>
14
- <link rel="stylesheet" crossorigin href="/__musea__/assets/index-BiMZ3Oo8.css">
13
+ <script type="module" crossorigin src="/__musea__/assets/index-CfyRpnTg.js"></script>
14
+ <link rel="stylesheet" crossorigin href="/__musea__/assets/index-DrcH3Amz.css">
15
15
  </head>
16
16
  <body>
17
17
  <div id="app"></div>
package/dist/index.d.mts CHANGED
@@ -80,9 +80,9 @@ interface MuseaOptions {
80
80
  */
81
81
  vrt?: VrtOptions;
82
82
  /**
83
- * Path to Style Dictionary tokens JSON file or directory.
84
- * Supports standard Style Dictionary format.
85
- * @example 'src/tokens.json' or 'src/tokens/'
83
+ * Path to a Style Dictionary tokens JSON file/directory or Tailwind CSS theme file.
84
+ * Supports standard Style Dictionary format and Tailwind v4 `@theme` CSS variables.
85
+ * @example 'src/tokens.json', 'src/tokens/', or 'src/styles/main.css'
86
86
  */
87
87
  tokensPath?: string;
88
88
  /**
@@ -164,7 +164,7 @@ interface StyleDictionaryOutput {
164
164
  */
165
165
  interface StyleDictionaryConfig {
166
166
  /**
167
- * Path to tokens JSON/JS file or directory.
167
+ * Path to tokens JSON file/directory or Tailwind CSS theme file.
168
168
  */
169
169
  tokensPath: string;
170
170
  /**
@@ -187,7 +187,7 @@ interface StyleDictionaryConfig {
187
187
  */
188
188
  type TokenTransform = (token: DesignToken, path: string[]) => DesignToken;
189
189
  /**
190
- * Parse Style Dictionary tokens file or directory.
190
+ * Parse Style Dictionary tokens file/directory or Tailwind CSS theme variables.
191
191
  */
192
192
  declare function parseTokens(tokensPath: string): Promise<TokenCategory[]>;
193
193
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types/plugin.ts","../src/plugin/index.ts","../src/tokens/parser.ts","../src/tokens/usage.ts","../src/tokens/resolver.ts","../src/tokens/generator.ts"],"mappings":";;;;;;;;;;UAMiB,gBAAA;EACf,SAAA;EACA,WAAA;EACA,UAAA;EACA,UAAA;EACA,MAAA;EACA,WAAA;EACA,cAAA;EACA,YAAA;EACA,IAAA;EACA,aAAA;EACA,SAAA;EACA,MAAA;EACA,YAAA;EACA,OAAA;EACA,KAAA;EACA,IAAA;EACA,OAAA;EACA,MAAA;AAAA;;;;UAMe,UAAA;EANT;EAQN,IAAA;EAFyB;EAIzB,IAAA;EAEwB;EAAxB,MAAA,EAAQ,gBAAA;AAAA;;;;UAMO,YAAA;EAAA;;;;EAKf,OAAA;EAsDmD;;;;EAhDnD,OAAA;EAMA;;;;EAAA,QAAA;EAyBM;;;;EAnBN,eAAA;EA8CA;;;;EAxCA,eAAA;;;ACoCF;;;;ED5BE,SAAA;EC4BoB;;;EDvBpB,GAAA,GAAM,UAAA;;;;AEzER;;EFgFE,UAAA;EE5EmB;;;;;;;;EFsFnB,KAAA,iCAAsC,UAAA,GAAa,UAAA;EEnFrC;;AAMhB;;;;;;EFuFE,UAAA;EEpF6B;;;;;;;;;AAM/B;EF0FE,YAAA;AAAA;;;;;;iBChBc,KAAA,CAAM,OAAA,GAAS,YAAA,GAAoB,MAAA;;;;;;;;;ADrGnD;;UEKiB,WAAA;EACf,KAAA;EACA,IAAA;EACA,WAAA;EACA,UAAA,GAAa,MAAA;EACb,KAAA;EACA,UAAA;EACA,cAAA;AAAA;;;;UAMe,aAAA;EACf,IAAA;EACA,MAAA,EAAQ,MAAA,SAAe,WAAA;EACvB,aAAA,GAAgB,aAAA;AAAA;;;;UAMD,qBAAA;EACf,UAAA,EAAY,aAAA;EACZ,QAAA;IACE,IAAA;IACA,OAAA;IACA,WAAA;EAAA;AAAA;;;;UAOa,qBAAA;EFHA;;;EEOf,UAAA;EFoDsC;;;;EE9CtC,YAAA;EFFA;;;;EEQA,SAAA;EFuBA;;;EElBA,UAAA,GAAa,cAAA;AAAA;;;;KAMH,cAAA,IAAkB,KAAA,EAAO,WAAA,EAAa,IAAA,eAAmB,WAAA;;;;iBAK/C,WAAA,CAAY,UAAA,WAAqB,OAAA,CAAQ,aAAA;;;;;;iBCrC/C,cAAA,CACd,QAAA,EAAU,GAAA;EAAc,IAAA;EAAc,QAAA;IAAY,KAAA;IAAe,QAAA;EAAA;AAAA,IACjE,QAAA,EAAU,MAAA,SAAe,WAAA,IACxB,aAAA;;;;;;UCzBc,eAAA;EACf,IAAA;EACA,WAAA;EACA,QAAA;AAAA;;;;UAMe,eAAA;EACf,OAAA;EACA,QAAA;EACA,WAAA;EACA,OAAA,EAAS,eAAA;AAAA;;;;KAMC,aAAA,GAAgB,MAAA,SAAe,eAAA;;AJP3C;;iBI4BgB,aAAA,CAAc,UAAA,EAAY,aAAA,KAAkB,MAAA,SAAe,WAAA;;;;iBAO3D,iBAAA,CACd,UAAA,EAAY,aAAA,IACZ,SAAA,EAAW,MAAA,SAAe,WAAA;;;;;;iBC7BZ,kBAAA,CAAmB,UAAA,EAAY,aAAA;;;;iBAgI/B,sBAAA,CAAuB,UAAA,EAAY,aAAA;;;;;iBAQ7B,sBAAA,CACpB,MAAA,EAAQ,qBAAA,GACP,OAAA,CAAQ,qBAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types/plugin.ts","../src/plugin/index.ts","../src/tokens/parser.ts","../src/tokens/usage.ts","../src/tokens/resolver.ts","../src/tokens/generator.ts"],"mappings":";;;;;;;;;;UAMiB,gBAAA;EACf,SAAA;EACA,WAAA;EACA,UAAA;EACA,UAAA;EACA,MAAA;EACA,WAAA;EACA,cAAA;EACA,YAAA;EACA,IAAA;EACA,aAAA;EACA,SAAA;EACA,MAAA;EACA,YAAA;EACA,OAAA;EACA,KAAA;EACA,IAAA;EACA,OAAA;EACA,MAAA;AAAA;;;;UAMe,UAAA;EANT;EAQN,IAAA;EAFyB;EAIzB,IAAA;EAEwB;EAAxB,MAAA,EAAQ,gBAAA;AAAA;;;;UAMO,YAAA;EAAA;;;;EAKf,OAAA;EAsDmD;;;;EAhDnD,OAAA;EAMA;;;;EAAA,QAAA;EAyBM;;;;EAnBN,eAAA;EA8CA;;;;EAxCA,eAAA;;;ACoCF;;;;ED5BE,SAAA;EC4BoB;;;EDvBpB,GAAA,GAAM,UAAA;;;;AExER;;EF+EE,UAAA;EE3EmB;;;;;;;;EFqFnB,KAAA,iCAAsC,UAAA,GAAa,UAAA;EElFrC;;AAMhB;;;;;;EFsFE,UAAA;EEnF6B;;;;;;;;;AAM/B;EFyFE,YAAA;AAAA;;;;;;iBChBc,KAAA,CAAM,OAAA,GAAS,YAAA,GAAoB,MAAA;;;;;;;;;ADrGnD;;UEMiB,WAAA;EACf,KAAA;EACA,IAAA;EACA,WAAA;EACA,UAAA,GAAa,MAAA;EACb,KAAA;EACA,UAAA;EACA,cAAA;AAAA;;;;UAMe,aAAA;EACf,IAAA;EACA,MAAA,EAAQ,MAAA,SAAe,WAAA;EACvB,aAAA,GAAgB,aAAA;AAAA;;;;UAMD,qBAAA;EACf,UAAA,EAAY,aAAA;EACZ,QAAA;IACE,IAAA;IACA,OAAA;IACA,WAAA;EAAA;AAAA;;;;UAOa,qBAAA;EFJA;;;EEQf,UAAA;EFmDsC;;;;EE7CtC,YAAA;EFHA;;;;EESA,SAAA;EFsBA;;;EEjBA,UAAA,GAAa,cAAA;AAAA;;;;KAMH,cAAA,IAAkB,KAAA,EAAO,WAAA,EAAa,IAAA,eAAmB,WAAA;;;;iBAK/C,WAAA,CAAY,UAAA,WAAqB,OAAA,CAAQ,aAAA;;;;;;iBCtC/C,cAAA,CACd,QAAA,EAAU,GAAA;EAAc,IAAA;EAAc,QAAA;IAAY,KAAA;IAAe,QAAA;EAAA;AAAA,IACjE,QAAA,EAAU,MAAA,SAAe,WAAA,IACxB,aAAA;;;;;;UCtBc,eAAA;EACf,IAAA;EACA,WAAA;EACA,QAAA;AAAA;;;;UAMe,eAAA;EACf,OAAA;EACA,QAAA;EACA,WAAA;EACA,OAAA,EAAS,eAAA;AAAA;;;;KAMC,aAAA,GAAgB,MAAA,SAAe,eAAA;;AJV3C;;iBI+BgB,aAAA,CAAc,UAAA,EAAY,aAAA,KAAkB,MAAA,SAAe,WAAA;;;;iBAO3D,iBAAA,CACd,UAAA,EAAY,aAAA,IACZ,SAAA,EAAW,MAAA,SAAe,WAAA;;;;;;iBC/BZ,kBAAA,CAAmB,UAAA,EAAY,aAAA;;;;iBAgI/B,sBAAA,CAAuB,UAAA,EAAY,aAAA;;;;;iBAQ7B,sBAAA,CACpB,MAAA,EAAQ,qBAAA,GACP,OAAA,CAAQ,qBAAA"}
package/dist/index.mjs CHANGED
@@ -876,63 +876,70 @@ function generatePreviewHtml(art, variant, _basePath, viteBase) {
876
876
  <title>${escapeHtml(art.metadata.title)} - ${escapeHtml(variant.name)}</title>
877
877
  <script type="module" src="${base}/@vite/client"><\/script>
878
878
  <style>
879
- * { box-sizing: border-box; margin: 0; padding: 0; }
880
- :root {
881
- --musea-preview-padding: clamp(1rem, 2vw, 1.5rem);
882
- }
883
- html, body {
884
- width: 100%;
885
- height: 100%;
886
- }
887
- body {
888
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
889
- background: #ffffff;
890
- padding: var(--musea-preview-padding);
891
- overflow: auto;
892
- }
893
- .musea-variant {
894
- width: 100%;
895
- min-height: calc(100vh - (var(--musea-preview-padding) * 2));
896
- }
897
- .musea-error {
898
- color: #dc2626;
899
- background: #fef2f2;
900
- border: 1px solid #fecaca;
901
- border-radius: 8px;
902
- padding: 1rem;
903
- font-size: 0.875rem;
904
- max-width: 400px;
905
- }
906
- .musea-error-title {
907
- font-weight: 600;
908
- margin-bottom: 0.5rem;
909
- }
910
- .musea-error pre {
911
- font-family: monospace;
912
- font-size: 0.75rem;
913
- white-space: pre-wrap;
914
- word-break: break-all;
915
- margin-top: 0.5rem;
916
- padding: 0.5rem;
917
- background: #fff;
918
- border-radius: 4px;
919
- }
920
- .musea-loading {
921
- display: flex;
922
- align-items: center;
923
- gap: 0.75rem;
924
- color: #6b7280;
925
- font-size: 0.875rem;
926
- }
927
- .musea-spinner {
928
- width: 20px;
929
- height: 20px;
930
- border: 2px solid #e5e7eb;
931
- border-top-color: #3b82f6;
932
- border-radius: 50%;
933
- animation: spin 0.8s linear infinite;
879
+ @layer musea-preview {
880
+ *,
881
+ *::before,
882
+ *::after {
883
+ box-sizing: border-box;
884
+ }
885
+ :root {
886
+ --musea-preview-padding: clamp(1rem, 2vw, 1.5rem);
887
+ }
888
+ html, body {
889
+ width: 100%;
890
+ height: 100%;
891
+ margin: 0;
892
+ }
893
+ body {
894
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
895
+ background: #ffffff;
896
+ padding: var(--musea-preview-padding);
897
+ overflow: auto;
898
+ }
899
+ .musea-variant {
900
+ width: 100%;
901
+ min-height: calc(100vh - (var(--musea-preview-padding) * 2));
902
+ }
903
+ .musea-error {
904
+ color: #dc2626;
905
+ background: #fef2f2;
906
+ border: 1px solid #fecaca;
907
+ border-radius: 8px;
908
+ padding: 1rem;
909
+ font-size: 0.875rem;
910
+ max-width: 400px;
911
+ }
912
+ .musea-error-title {
913
+ font-weight: 600;
914
+ margin-bottom: 0.5rem;
915
+ }
916
+ .musea-error pre {
917
+ font-family: monospace;
918
+ font-size: 0.75rem;
919
+ white-space: pre-wrap;
920
+ word-break: break-all;
921
+ margin-top: 0.5rem;
922
+ padding: 0.5rem;
923
+ background: #fff;
924
+ border-radius: 4px;
925
+ }
926
+ .musea-loading {
927
+ display: flex;
928
+ align-items: center;
929
+ gap: 0.75rem;
930
+ color: #6b7280;
931
+ font-size: 0.875rem;
932
+ }
933
+ .musea-spinner {
934
+ width: 20px;
935
+ height: 20px;
936
+ border: 2px solid #e5e7eb;
937
+ border-top-color: #3b82f6;
938
+ border-radius: 50%;
939
+ animation: musea-preview-spin 0.8s linear infinite;
940
+ }
934
941
  }
935
- @keyframes spin { to { transform: rotate(360deg); } }
942
+ @keyframes musea-preview-spin { to { transform: rotate(360deg); } }
936
943
 
937
944
  /* Musea Addons: Checkerboard background for transparent mode */
938
945
  .musea-bg-checkerboard {
@@ -1483,6 +1490,220 @@ function nullRecord(record) {
1483
1490
  return Object.assign(Object.create(null), record);
1484
1491
  }
1485
1492
  //#endregion
1493
+ //#region src/tokens/tailwind.ts
1494
+ const TAILWIND_TOKEN_EXTENSIONS = new Set([
1495
+ ".css",
1496
+ ".pcss",
1497
+ ".postcss"
1498
+ ]);
1499
+ const VARIABLE_DECLARATION_RE = /(--[A-Za-z0-9_-]+)\s*:\s*([^;{}]+);/g;
1500
+ const CSS_COMMENT_RE = /\/\*[\s\S]*?\*\//g;
1501
+ const NAMESPACE_MAPPINGS = [
1502
+ {
1503
+ prefix: "inset-shadow",
1504
+ category: "shadow",
1505
+ pathPrefix: ["inset"],
1506
+ type: "shadow"
1507
+ },
1508
+ {
1509
+ prefix: "drop-shadow",
1510
+ category: "shadow",
1511
+ pathPrefix: ["drop"],
1512
+ type: "shadow"
1513
+ },
1514
+ {
1515
+ prefix: "font-weight",
1516
+ category: "typography",
1517
+ pathPrefix: ["fontWeight"],
1518
+ type: "fontWeight"
1519
+ },
1520
+ {
1521
+ prefix: "color",
1522
+ category: "color",
1523
+ type: "color"
1524
+ },
1525
+ {
1526
+ prefix: "spacing",
1527
+ category: "spacing",
1528
+ type: "dimension"
1529
+ },
1530
+ {
1531
+ prefix: "font",
1532
+ category: "typography",
1533
+ pathPrefix: ["font"],
1534
+ type: "fontFamily"
1535
+ },
1536
+ {
1537
+ prefix: "text",
1538
+ category: "typography",
1539
+ pathPrefix: ["fontSize"],
1540
+ type: "dimension"
1541
+ },
1542
+ {
1543
+ prefix: "leading",
1544
+ category: "typography",
1545
+ pathPrefix: ["lineHeight"],
1546
+ type: "number"
1547
+ },
1548
+ {
1549
+ prefix: "tracking",
1550
+ category: "typography",
1551
+ pathPrefix: ["letterSpacing"],
1552
+ type: "dimension"
1553
+ },
1554
+ {
1555
+ prefix: "radius",
1556
+ category: "radius",
1557
+ type: "dimension"
1558
+ },
1559
+ {
1560
+ prefix: "shadow",
1561
+ category: "shadow",
1562
+ type: "shadow"
1563
+ },
1564
+ {
1565
+ prefix: "breakpoint",
1566
+ category: "breakpoint",
1567
+ type: "dimension"
1568
+ },
1569
+ {
1570
+ prefix: "container",
1571
+ category: "container",
1572
+ type: "dimension"
1573
+ },
1574
+ {
1575
+ prefix: "ease",
1576
+ category: "easing",
1577
+ type: "cubicBezier"
1578
+ },
1579
+ {
1580
+ prefix: "animate",
1581
+ category: "animation",
1582
+ type: "transition"
1583
+ },
1584
+ {
1585
+ prefix: "blur",
1586
+ category: "blur",
1587
+ type: "dimension"
1588
+ },
1589
+ {
1590
+ prefix: "perspective",
1591
+ category: "perspective",
1592
+ type: "dimension"
1593
+ },
1594
+ {
1595
+ prefix: "aspect",
1596
+ category: "aspectRatio",
1597
+ type: "number"
1598
+ }
1599
+ ];
1600
+ async function isTailwindTokenPath(tokensPath) {
1601
+ const stat = await fs.promises.stat(tokensPath).catch(() => null);
1602
+ if (!stat) return false;
1603
+ if (stat.isFile()) return TAILWIND_TOKEN_EXTENSIONS.has(path.extname(tokensPath));
1604
+ if (!stat.isDirectory()) return false;
1605
+ return (await fs.promises.readdir(tokensPath, { withFileTypes: true })).some((entry) => entry.isFile() && TAILWIND_TOKEN_EXTENSIONS.has(path.extname(entry.name)));
1606
+ }
1607
+ async function parseTailwindTokens(tokensPath) {
1608
+ const files = await collectTailwindTokenFiles(tokensPath);
1609
+ const candidates = [];
1610
+ for (const file of files) {
1611
+ const css = await fs.promises.readFile(file, "utf-8");
1612
+ candidates.push(...extractTailwindTokenCandidates(css));
1613
+ }
1614
+ return normalizeCategories(buildCategories(candidates));
1615
+ }
1616
+ async function collectTailwindTokenFiles(tokensPath) {
1617
+ if ((await fs.promises.stat(tokensPath)).isFile()) return [tokensPath];
1618
+ return (await fs.promises.readdir(tokensPath, { withFileTypes: true })).filter((entry) => entry.isFile() && TAILWIND_TOKEN_EXTENSIONS.has(path.extname(entry.name))).map((entry) => path.join(tokensPath, entry.name)).sort();
1619
+ }
1620
+ function extractTailwindTokenCandidates(css) {
1621
+ const source = css.replace(CSS_COMMENT_RE, "");
1622
+ const candidates = [];
1623
+ let match;
1624
+ VARIABLE_DECLARATION_RE.lastIndex = 0;
1625
+ while ((match = VARIABLE_DECLARATION_RE.exec(source)) !== null) {
1626
+ const variable = match[1];
1627
+ const value = match[2].trim();
1628
+ const mapped = mapTailwindVariable(variable);
1629
+ if (!mapped || !value) continue;
1630
+ candidates.push({
1631
+ variable,
1632
+ value,
1633
+ ...mapped
1634
+ });
1635
+ }
1636
+ return candidates;
1637
+ }
1638
+ function mapTailwindVariable(variable) {
1639
+ const name = variable.replace(/^--/, "");
1640
+ const mapping = NAMESPACE_MAPPINGS.find((candidate) => name === candidate.prefix || name.startsWith(`${candidate.prefix}-`));
1641
+ if (!mapping) return null;
1642
+ const rest = name === mapping.prefix ? "DEFAULT" : name.slice(mapping.prefix.length + 1);
1643
+ const pathParts = [...mapping.pathPrefix ?? [], ...tailwindNameToPath(rest)];
1644
+ if (pathParts.length === 0) return null;
1645
+ return {
1646
+ category: mapping.category,
1647
+ path: pathParts,
1648
+ type: mapping.type
1649
+ };
1650
+ }
1651
+ function tailwindNameToPath(name) {
1652
+ if (!name || name === "DEFAULT") return ["DEFAULT"];
1653
+ const parts = name.split("-").filter(Boolean);
1654
+ if (parts.length <= 1) return parts;
1655
+ const last = parts[parts.length - 1];
1656
+ if (/^\d+$/.test(last)) return [...parts.slice(0, -1), last];
1657
+ return [parts.join("-")];
1658
+ }
1659
+ function buildCategories(candidates) {
1660
+ const variableToPath = /* @__PURE__ */ new Map();
1661
+ for (const candidate of candidates) variableToPath.set(candidate.variable, [candidate.category, ...candidate.path].join("."));
1662
+ const categoryMap = /* @__PURE__ */ new Map();
1663
+ for (const candidate of candidates) {
1664
+ const category = categoryMap.get(candidate.category) ?? {
1665
+ name: candidate.category,
1666
+ tokens: nullRecord({})
1667
+ };
1668
+ categoryMap.set(candidate.category, category);
1669
+ const valueReference = parseTailwindVariableReference(candidate.value);
1670
+ const referencedPath = valueReference ? variableToPath.get(valueReference) : void 0;
1671
+ const token = {
1672
+ value: referencedPath ? `{${referencedPath}}` : candidate.value,
1673
+ type: candidate.type,
1674
+ description: `Tailwind theme variable ${candidate.variable}`,
1675
+ attributes: { tailwindVariable: candidate.variable },
1676
+ $tier: referencedPath ? "semantic" : "primitive",
1677
+ ...referencedPath ? { $reference: referencedPath } : {}
1678
+ };
1679
+ setCategoryToken(category, candidate.path, token);
1680
+ }
1681
+ return [...categoryMap.values()];
1682
+ }
1683
+ function parseTailwindVariableReference(value) {
1684
+ return value.match(/^var\(\s*(--[A-Za-z0-9_-]+)\s*(?:,[^)]+)?\)$/)?.[1];
1685
+ }
1686
+ function setCategoryToken(category, pathParts, token) {
1687
+ if (pathParts.length === 1) {
1688
+ category.tokens[pathParts[0]] = token;
1689
+ return;
1690
+ }
1691
+ let current = category;
1692
+ for (const part of pathParts.slice(0, -1)) {
1693
+ current.subcategories ??= [];
1694
+ let next = current.subcategories.find((subcategory) => subcategory.name === part);
1695
+ if (!next) {
1696
+ next = {
1697
+ name: part,
1698
+ tokens: nullRecord({})
1699
+ };
1700
+ current.subcategories.push(next);
1701
+ }
1702
+ current = next;
1703
+ }
1704
+ current.tokens[pathParts[pathParts.length - 1]] = token;
1705
+ }
1706
+ //#endregion
1486
1707
  //#region src/tokens/parser.ts
1487
1708
  /**
1488
1709
  * Token parsing utilities for Style Dictionary integration.
@@ -1490,9 +1711,10 @@ function nullRecord(record) {
1490
1711
  * Thin native binding for design token files (JSON) and directories.
1491
1712
  */
1492
1713
  /**
1493
- * Parse Style Dictionary tokens file or directory.
1714
+ * Parse Style Dictionary tokens file/directory or Tailwind CSS theme variables.
1494
1715
  */
1495
1716
  async function parseTokens(tokensPath) {
1717
+ if (await isTailwindTokenPath(tokensPath)) return parseTailwindTokens(tokensPath);
1496
1718
  return normalizeCategories(tokenNative().parseDesignTokensFromPath(tokensPath));
1497
1719
  }
1498
1720
  //#endregion
@@ -1532,6 +1754,13 @@ function scanTokenUsage(artFiles, tokenMap) {
1532
1754
  const existing = valueLookup.get(normalized);
1533
1755
  if (existing) existing.push(tokenPath);
1534
1756
  else valueLookup.set(normalized, [tokenPath]);
1757
+ const tailwindVariable = token.attributes?.tailwindVariable;
1758
+ if (typeof tailwindVariable === "string") {
1759
+ const normalizedVariable = normalizeTokenValue(`var(${tailwindVariable})`);
1760
+ const variableMatches = valueLookup.get(normalizedVariable);
1761
+ if (variableMatches) variableMatches.push(tokenPath);
1762
+ else valueLookup.set(normalizedVariable, [tokenPath]);
1763
+ }
1535
1764
  }
1536
1765
  const usageMap = {};
1537
1766
  for (const [artPath, artInfo] of artFiles) {
@@ -1600,6 +1829,7 @@ function scanTokenUsage(artFiles, tokenMap) {
1600
1829
  * Handles building flat token maps from categories, resolving reference chains,
1601
1830
  * reading/writing raw token files, and validating semantic references.
1602
1831
  */
1832
+ const JSON_TOKEN_EXTENSIONS = new Set([".json", ".tokens.json"]);
1603
1833
  const UNSAFE_TOKEN_PATH_SEGMENTS = new Set([
1604
1834
  "__proto__",
1605
1835
  "prototype",
@@ -1629,6 +1859,7 @@ function resolveReferences(categories, _tokenMap) {
1629
1859
  * Read raw JSON token file.
1630
1860
  */
1631
1861
  async function readRawTokenFile(tokensPath) {
1862
+ if (!isJsonTokenPath(tokensPath)) throw new Error("Token editing is only supported for JSON token files");
1632
1863
  const content = await fs.promises.readFile(tokensPath, "utf-8");
1633
1864
  return JSON.parse(content);
1634
1865
  }
@@ -1636,10 +1867,14 @@ async function readRawTokenFile(tokensPath) {
1636
1867
  * Write raw JSON token file atomically (write tmp, rename).
1637
1868
  */
1638
1869
  async function writeRawTokenFile(tokensPath, data) {
1870
+ if (!isJsonTokenPath(tokensPath)) throw new Error("Token editing is only supported for JSON token files");
1639
1871
  const tmpPath = tokensPath + ".tmp";
1640
1872
  await fs.promises.writeFile(tmpPath, JSON.stringify(data, null, 2) + "\n", "utf-8");
1641
1873
  await fs.promises.rename(tmpPath, tokensPath);
1642
1874
  }
1875
+ function isJsonTokenPath(tokensPath) {
1876
+ return JSON_TOKEN_EXTENSIONS.has(path.extname(tokensPath)) || tokensPath.endsWith(".tokens.json");
1877
+ }
1643
1878
  /**
1644
1879
  * Set a token at a dot-separated path in the raw JSON structure.
1645
1880
  */
@@ -1707,7 +1942,7 @@ function findDependentTokens(tokenMap, targetPath) {
1707
1942
  * Generates HTML, Markdown, and JSON documentation from parsed token categories,
1708
1943
  * and provides the main processStyleDictionary orchestrator function.
1709
1944
  */
1710
- const SAFE_CSS_COLOR_PATTERN = /^(?:#[0-9a-fA-F]{3,8}|(?:rgb|hsl)a?\(\s*[-+.\d,%\s]+\))$/;
1945
+ const SAFE_CSS_COLOR_PATTERN = /^(?:#[0-9a-fA-F]{3,8}|(?:rgb|hsl)a?\(\s*[-+.\d,%\s/]+\)|(?:oklch|oklab|lab|lch)\(\s*[-+.\d,%\s/]+\))$/;
1711
1946
  const DANGEROUS_PROTOCOL_PATTERN = /\b(javascript|vbscript):/gi;
1712
1947
  function escapeTokenText(value) {
1713
1948
  return escapeHtml(value).replace(DANGEROUS_PROTOCOL_PATTERN, "$1&#58;");
@@ -1879,7 +2114,7 @@ function sendTokenMutationError(e, sendError) {
1879
2114
  sendError(e.message, e.status);
1880
2115
  return;
1881
2116
  }
1882
- if (e instanceof Error && /token path/i.test(e.message)) {
2117
+ if (e instanceof Error && /(token path|token editing)/i.test(e.message)) {
1883
2118
  sendError(e.message, 400);
1884
2119
  return;
1885
2120
  }