@live-codes/browser-compilers 0.19.0 → 0.20.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/autoprefixer/autoprefixer.js +14 -14
- package/dist/cssnano/cssnano.js +32 -32
- package/dist/lightningcss/lightningcss.js +1 -1
- package/dist/lightningcss/lightningcss_node.wasm +0 -0
- package/dist/postcss/postcss.js +10 -10
- package/dist/postcss-modules/postcss-modules.js +15 -15
- package/dist/postcss-preset-env/postcss-preset-env.js +15 -15
- package/dist/prettier/parser-pug.js +36 -36
- package/dist/pug/pug.min.js +38 -38
- package/dist/purgecss/purgecss.js +38 -38
- package/dist/tailwindcss/monaco-tailwindcss.js +131 -0
- package/dist/tailwindcss/monaco-tailwindcss.worker.js +551 -0
- package/dist/tokencss/tokencss.js +17 -17
- package/package.json +3 -2
- package/scripts/vendors.js +14 -0
- package/vendor_modules/imports/lightningcss.js +7 -2
- package/vendor_modules/imports/monaco-tailwindcss.js +1 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
var B;function d(){if(!B)throw new Error("Monaco is undefined. Call setMonaco(monaco) first.");return B}function K(t){B=t}function G(t){let{MarkerSeverity:r}=d();return t===r.Error?1:t===r.Warning?2:t===r.Info?3:4}function q(t){let{MarkerSeverity:r}=d();return t===1?r.Error:t===2?r.Warning:t===3?r.Info:r.Hint}function z(t){return t}function Z(t){return t}function m(t){return{start:{line:t.startLineNumber-1,character:t.startColumn-1},end:{line:t.endLineNumber-1,character:t.endColumn-1}}}function p(t){return{startLineNumber:t.start.line+1,startColumn:t.start.character+1,endLineNumber:t.end.line+1,endColumn:t.end.character+1}}function J(t){return{location:{range:m(t),uri:String(t.resource)},message:t.message}}function Q(t){let{Uri:r}=d();return{...p(t.location.range),message:t.message,resource:r.parse(t.location.uri)}}function U(t){let r={message:t.message,range:m(t),severity:G(t.severity)};return typeof t.code=="string"?r.code=t.code:t.code!=null&&(r.code=t.code.value,r.codeDescription={href:String(t.code.target)}),t.relatedInformation&&(r.relatedInformation=t.relatedInformation.map(J)),t.tags&&(r.tags=t.tags.map(z)),t.source!=null&&(r.source=t.source),r}function A(t,r){var e;let{MarkerSeverity:o,Uri:n}=d(),i={...p(t.range),message:t.message,severity:t.severity?q(t.severity):(e=r?.defaultSeverity)!==null&&e!==void 0?e:o.Error};return t.code!=null&&(i.code=t.codeDescription==null?String(t.code):{value:String(t.code),target:n.parse(t.codeDescription.href)}),t.relatedInformation&&(i.relatedInformation=t.relatedInformation.map(Q)),t.tags&&(i.tags=t.tags.map(Z)),t.source!=null&&(i.source=t.source),i}function P(t){return{range:p(t.range),text:t.newText}}function X(t){let r={};return t.ignoreIfExists!=null&&(r.ignoreIfExists=t.ignoreIfExists),t.ignoreIfNotExists!=null&&(r.ignoreIfNotExists=t.ignoreIfNotExists),t.overwrite!=null&&(r.overwrite=t.overwrite),t.recursive!=null&&(r.recursive=t.recursive),r}function Y(t){let{Uri:r}=d(),e=t.kind==="create"?{newResource:r.parse(t.uri)}:t.kind==="delete"?{oldResource:r.parse(t.uri)}:{oldResource:r.parse(t.oldUri),newResource:r.parse(t.newUri)};return t.options&&(e.options=X(t.options)),e}function Rt(t,r,e){let{Uri:o}=d();return{resource:o.parse(r),versionId:e,textEdit:P(t)}}function rt(t){var r;let e=[];if(t.changes)for(let[o,n]of Object.entries(t.changes))for(let i of n)e.push(Rt(i,o));if(t.documentChanges)for(let o of t.documentChanges)if("textDocument"in o)for(let n of o.edits)e.push(Rt(n,o.textDocument.uri,(r=o.textDocument.version)!==null&&r!==void 0?r:void 0));else e.push(Y(o));return{edits:e}}function et(t,r){let e={title:t.title,isPreferred:t.isPreferred};return t.diagnostics&&(e.diagnostics=t.diagnostics.map(o=>A(o,r))),t.disabled&&(e.disabled=t.disabled.reason),t.edit&&(e.edit=rt(t.edit)),t.isPreferred!=null&&(e.isPreferred=t.isPreferred),t.kind&&(e.kind=t.kind),e}function ot(t){let r={diagnostics:t.markers.map(U),triggerKind:t.trigger};return t.only!=null&&(r.only=[t.only]),r}function W(t){let r={title:t.title,command:t.id};return t.arguments&&(r.arguments=t.arguments),r}function F(t){let r={title:t.title,id:t.command};return t.arguments&&(r.arguments=t.arguments),r}function nt(t){return{red:t.red,blue:t.blue,green:t.green,alpha:t.alpha}}function it(t){return{range:p(t.range),color:nt(t.color)}}function at(t){let{CompletionTriggerKind:r}=d().languages;return t===r.Invoke?1:t===r.TriggerCharacter?2:3}function st(t){let r={triggerKind:at(t.triggerKind)};return t.triggerCharacter!=null&&(r.triggerCharacter=t.triggerCharacter),r}function ft(t){let{CompletionItemKind:r}=d().languages;if(t===r.Text)return 1;if(t===r.Method)return 2;if(t===r.Function)return 3;if(t===r.Constructor)return 4;if(t===r.Field)return 5;if(t===r.Variable)return 6;if(t===r.Class)return 7;if(t===r.Interface)return 8;if(t===r.Module)return 9;if(t===r.Property)return 10;if(t===r.Unit)return 11;if(t===r.Value)return 12;if(t===r.Enum)return 13;if(t===r.Keyword)return 14;if(t===r.Snippet)return 15;if(t===r.Color)return 16;if(t===r.File)return 17;if(t===r.Reference)return 18;if(t===r.Folder)return 19;if(t===r.EnumMember)return 20;if(t===r.Constant)return 21;if(t===r.Struct)return 22;if(t===r.Event)return 23;if(t===r.Operator)return 24;if(t===r.TypeParameter)return 25}function ut(t){let{CompletionItemKind:r}=d().languages;return t===1?r.Text:t===2?r.Method:t===3?r.Function:t===4?r.Constructor:t===5?r.Field:t===6?r.Variable:t===7?r.Class:t===8?r.Interface:t===9?r.Module:t===10?r.Property:t===11?r.Unit:t===12?r.Value:t===13?r.Enum:t===14?r.Keyword:t===15?r.Snippet:t===16?r.Color:t===17?r.File:t===18?r.Reference:t===19?r.Folder:t===20?r.EnumMember:t===21?r.Constant:t===22?r.Struct:t===23?r.Event:t===24?r.Operator:r.TypeParameter}function lt(t){return t}function gt(t){return t}function k(t){return{kind:"markdown",value:t.value}}function M(t){return{value:t.value}}function ct(t){var r;return{newText:(r=t.text)!==null&&r!==void 0?r:"",range:m(t.range)}}function dt(t){return{range:p(t.range),text:t.newText}}function Gt(t,r){return"insert"in t?{newText:r,insert:m(t.insert),replace:m(t.replace)}:{newText:r,range:m(t)}}function $(t){let{CompletionItemInsertTextRule:r}=d().languages,e={kind:ft(t.kind),label:typeof t.label=="string"?t.label:t.label.label,textEdit:Gt(t.range,t.insertText)};return t.additionalTextEdits&&(e.additionalTextEdits=t.additionalTextEdits.map(ct)),t.command&&(e.command=W(t.command)),t.commitCharacters&&(e.commitCharacters=t.commitCharacters),t.detail!=null&&(e.detail=t.detail),typeof t.documentation=="string"?e.documentation=t.documentation:t.documentation&&(e.documentation=k(t.documentation)),t.filterText!=null&&(e.filterText=t.filterText),t.insertTextRules===r.InsertAsSnippet?e.insertTextFormat=2:t.insertTextRules===r.KeepWhitespace&&(e.insertTextMode=2),t.preselect!=null&&(e.preselect=t.preselect),t.sortText!=null&&(e.sortText=t.sortText),t.tags&&(e.tags=t.tags.map(lt)),e}function qt(t){return"range"in t?p(t.range):"insert"in t&&"replace"in t?{insert:p(t.insert),replace:p(t.replace)}:p(t)}function H(t,r){var e,o,n,i,a;let{CompletionItemInsertTextRule:l,CompletionItemKind:c}=d().languages,x=(e=r.itemDefaults)!==null&&e!==void 0?e:{},h=(o=t.textEdit)!==null&&o!==void 0?o:x.editRange,g=(n=t.commitCharacters)!==null&&n!==void 0?n:x.commitCharacters,v=(i=t.insertTextFormat)!==null&&i!==void 0?i:x.insertTextFormat,y=(a=t.insertTextMode)!==null&&a!==void 0?a:x.insertTextMode,O=t.insertText,V;h?(V=qt(h),"newText"in h&&(O=h.newText)):V={...r.range};let C={insertText:O??"",kind:t.kind==null?c.Text:ut(t.kind),label:t.label,range:V};return t.additionalTextEdits&&(C.additionalTextEdits=t.additionalTextEdits.map(dt)),t.command&&(C.command=F(t.command)),g&&(C.commitCharacters=g),t.detail!=null&&(C.detail=t.detail),typeof t.documentation=="string"?C.documentation=t.documentation:t.documentation&&(C.documentation=M(t.documentation)),t.filterText!=null&&(C.filterText=t.filterText),v===2?C.insertTextRules=l.InsertAsSnippet:y===2&&(C.insertTextRules=l.KeepWhitespace),t.preselect!=null&&(C.preselect=t.preselect),t.sortText!=null&&(C.sortText=t.sortText),t.tags&&(C.tags=t.tags.map(gt)),C}function pt(t,r){return{incomplete:!!t.isIncomplete,suggestions:t.items.map(e=>H(e,{range:r.range,itemDefaults:t.itemDefaults}))}}function Dt(t){return typeof t=="string"?{value:t}:{value:`\`\`\`${t.language}
|
|
2
|
+
${t.value}
|
|
3
|
+
\`\`\``}}function tr(t){return typeof t=="string"||"language"in t?[Dt(t)]:Array.isArray(t)?t.map(Dt):[M(t)]}function mt(t){let r={contents:tr(t.contents)};return t.range&&(r.range=p(t.range)),r}function N(t){return{character:t.column-1,line:t.lineNumber-1}}function It(t,r,e){let o=new Map,n=g=>{if(r==="*")return!0;let v=g.getLanguageId();return Array.isArray(r)?r.includes(v):r===v},i=async g=>{let v=g.getVersionId(),y=await e.provideMarkerData(g);!g.isDisposed()&&v===g.getVersionId()&&n(g)&&t.editor.setModelMarkers(g,e.owner,y??[])},a=g=>{if(!n(g))return;let v,y=g.onDidChangeContent(()=>{clearTimeout(v),v=setTimeout(()=>{i(g)},500)});o.set(g,{dispose(){clearTimeout(v),y.dispose()}}),i(g)},l=g=>{t.editor.setModelMarkers(g,e.owner,[]);let v=o.get(g);v&&(v.dispose(),o.delete(g))},c=t.editor.onDidCreateModel(a),x=t.editor.onWillDisposeModel(g=>{l(g),e.doReset?.(g)}),h=t.editor.onDidChangeModelLanguage(({model:g})=>{l(g),a(g),e.doReset?.(g)});for(let g of t.editor.getModels())a(g);return{dispose(){for(let g of o.keys())l(g);c.dispose(),x.dispose(),h.dispose()},async revalidate(){await Promise.all(t.editor.getModels().map(i))}}}function At(t,r){let{createData:e,interval:o=3e4,label:n,moduleId:i,stopWhenIdleFor:a=12e4}=r,l,c=0,x=!1,h=()=>{l&&(l.dispose(),l=void 0)},g=setInterval(()=>{if(!l)return;Date.now()-c>a&&h()},o);return{dispose(){x=!0,clearInterval(g),h()},getWorker(...v){if(x)throw new Error("Worker manager has been disposed");return c=Date.now(),l||(l=t.editor.createWebWorker({createData:e,label:n,moduleId:i})),l.withSyncedResources(v)},updateCreateData(v){e=v,h()}}}function b(t,r){dr(t)&&(t="100%");var e=pr(t);return t=r===360?t:Math.min(r,Math.max(0,parseFloat(t))),e&&(t=parseInt(String(t*r),10)/100),Math.abs(t-r)<1e-6?1:(r===360?t=(t<0?t%r+r:t%r)/parseFloat(String(r)):t=t%r/parseFloat(String(r)),t)}function L(t){return Math.min(1,Math.max(0,t))}function dr(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function pr(t){return typeof t=="string"&&t.indexOf("%")!==-1}function j(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function T(t){return t<=1?"".concat(Number(t)*100,"%"):t}function E(t){return t.length===1?"0"+t:String(t)}function Pt(t,r,e){return{r:b(t,255)*255,g:b(r,255)*255,b:b(e,255)*255}}function xt(t,r,e){t=b(t,255),r=b(r,255),e=b(e,255);var o=Math.max(t,r,e),n=Math.min(t,r,e),i=0,a=0,l=(o+n)/2;if(o===n)a=0,i=0;else{var c=o-n;switch(a=l>.5?c/(2-o-n):c/(o+n),o){case t:i=(r-e)/c+(r<e?6:0);break;case r:i=(e-t)/c+2;break;case e:i=(t-r)/c+4;break;default:break}i/=6}return{h:i,s:a,l}}function ht(t,r,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?t+(r-t)*(6*e):e<1/2?r:e<2/3?t+(r-t)*(2/3-e)*6:t}function Wt(t,r,e){var o,n,i;if(t=b(t,360),r=b(r,100),e=b(e,100),r===0)n=e,i=e,o=e;else{var a=e<.5?e*(1+r):e+r-e*r,l=2*e-a;o=ht(l,a,t+1/3),n=ht(l,a,t),i=ht(l,a,t-1/3)}return{r:o*255,g:n*255,b:i*255}}function vt(t,r,e){t=b(t,255),r=b(r,255),e=b(e,255);var o=Math.max(t,r,e),n=Math.min(t,r,e),i=0,a=o,l=o-n,c=o===0?0:l/o;if(o===n)i=0;else{switch(o){case t:i=(r-e)/l+(r<e?6:0);break;case r:i=(e-t)/l+2;break;case e:i=(t-r)/l+4;break;default:break}i/=6}return{h:i,s:c,v:a}}function Ft(t,r,e){t=b(t,360)*6,r=b(r,100),e=b(e,100);var o=Math.floor(t),n=t-o,i=e*(1-r),a=e*(1-n*r),l=e*(1-(1-n)*r),c=o%6,x=[e,a,i,i,l,e][c],h=[l,e,e,a,i,i][c],g=[i,i,l,e,e,a][c];return{r:x*255,g:h*255,b:g*255}}function bt(t,r,e,o){var n=[E(Math.round(t).toString(16)),E(Math.round(r).toString(16)),E(Math.round(e).toString(16))];return o&&n[0].startsWith(n[0].charAt(1))&&n[1].startsWith(n[1].charAt(1))&&n[2].startsWith(n[2].charAt(1))?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function Ht(t,r,e,o,n){var i=[E(Math.round(t).toString(16)),E(Math.round(r).toString(16)),E(Math.round(e).toString(16)),E(mr(o))];return n&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function mr(t){return Math.round(parseFloat(t)*255).toString(16)}function St(t){return S(t)/255}function S(t){return parseInt(t,16)}function Nt(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var I={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Lt(t){var r={r:0,g:0,b:0},e=1,o=null,n=null,i=null,a=!1,l=!1;return typeof t=="string"&&(t=vr(t)),typeof t=="object"&&(R(t.r)&&R(t.g)&&R(t.b)?(r=Pt(t.r,t.g,t.b),a=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):R(t.h)&&R(t.s)&&R(t.v)?(o=T(t.s),n=T(t.v),r=Ft(t.h,o,n),a=!0,l="hsv"):R(t.h)&&R(t.s)&&R(t.l)&&(o=T(t.s),i=T(t.l),r=Wt(t.h,o,i),a=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(e=t.a)),e=j(e),{ok:a,format:t.format||l,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a:e}}var hr="[-\\+]?\\d+%?",xr="[-\\+]?\\d*\\.\\d+%?",D="(?:".concat(xr,")|(?:").concat(hr,")"),Ct="[\\s|\\(]+(".concat(D,")[,|\\s]+(").concat(D,")[,|\\s]+(").concat(D,")\\s*\\)?"),wt="[\\s|\\(]+(".concat(D,")[,|\\s]+(").concat(D,")[,|\\s]+(").concat(D,")[,|\\s]+(").concat(D,")\\s*\\)?"),w={CSS_UNIT:new RegExp(D),rgb:new RegExp("rgb"+Ct),rgba:new RegExp("rgba"+wt),hsl:new RegExp("hsl"+Ct),hsla:new RegExp("hsla"+wt),hsv:new RegExp("hsv"+Ct),hsva:new RegExp("hsva"+wt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function vr(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var r=!1;if(I[t])t=I[t],r=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e=w.rgb.exec(t);return e?{r:e[1],g:e[2],b:e[3]}:(e=w.rgba.exec(t),e?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=w.hsl.exec(t),e?{h:e[1],s:e[2],l:e[3]}:(e=w.hsla.exec(t),e?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=w.hsv.exec(t),e?{h:e[1],s:e[2],v:e[3]}:(e=w.hsva.exec(t),e?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=w.hex8.exec(t),e?{r:S(e[1]),g:S(e[2]),b:S(e[3]),a:St(e[4]),format:r?"name":"hex8"}:(e=w.hex6.exec(t),e?{r:S(e[1]),g:S(e[2]),b:S(e[3]),format:r?"name":"hex"}:(e=w.hex4.exec(t),e?{r:S(e[1]+e[1]),g:S(e[2]+e[2]),b:S(e[3]+e[3]),a:St(e[4]+e[4]),format:r?"name":"hex8"}:(e=w.hex3.exec(t),e?{r:S(e[1]+e[1]),g:S(e[2]+e[2]),b:S(e[3]+e[3]),format:r?"name":"hex"}:!1)))))))))}function R(t){return!!w.CSS_UNIT.exec(String(t))}var Ot=function(){function t(r,e){r===void 0&&(r=""),e===void 0&&(e={});var o;if(r instanceof t)return r;typeof r=="number"&&(r=Nt(r)),this.originalInput=r;var n=Lt(r);this.originalInput=r,this.r=n.r,this.g=n.g,this.b=n.b,this.a=n.a,this.roundA=Math.round(100*this.a)/100,this.format=(o=e.format)!==null&&o!==void 0?o:n.format,this.gradientType=e.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=n.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var r=this.toRgb();return(r.r*299+r.g*587+r.b*114)/1e3},t.prototype.getLuminance=function(){var r=this.toRgb(),e,o,n,i=r.r/255,a=r.g/255,l=r.b/255;return i<=.03928?e=i/12.92:e=Math.pow((i+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),l<=.03928?n=l/12.92:n=Math.pow((l+.055)/1.055,2.4),.2126*e+.7152*o+.0722*n},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(r){return this.a=j(r),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){var r=this.toHsl().s;return r===0},t.prototype.toHsv=function(){var r=vt(this.r,this.g,this.b);return{h:r.h*360,s:r.s,v:r.v,a:this.a}},t.prototype.toHsvString=function(){var r=vt(this.r,this.g,this.b),e=Math.round(r.h*360),o=Math.round(r.s*100),n=Math.round(r.v*100);return this.a===1?"hsv(".concat(e,", ").concat(o,"%, ").concat(n,"%)"):"hsva(".concat(e,", ").concat(o,"%, ").concat(n,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var r=xt(this.r,this.g,this.b);return{h:r.h*360,s:r.s,l:r.l,a:this.a}},t.prototype.toHslString=function(){var r=xt(this.r,this.g,this.b),e=Math.round(r.h*360),o=Math.round(r.s*100),n=Math.round(r.l*100);return this.a===1?"hsl(".concat(e,", ").concat(o,"%, ").concat(n,"%)"):"hsla(".concat(e,", ").concat(o,"%, ").concat(n,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(r){return r===void 0&&(r=!1),bt(this.r,this.g,this.b,r)},t.prototype.toHexString=function(r){return r===void 0&&(r=!1),"#"+this.toHex(r)},t.prototype.toHex8=function(r){return r===void 0&&(r=!1),Ht(this.r,this.g,this.b,this.a,r)},t.prototype.toHex8String=function(r){return r===void 0&&(r=!1),"#"+this.toHex8(r)},t.prototype.toHexShortString=function(r){return r===void 0&&(r=!1),this.a===1?this.toHexString(r):this.toHex8String(r)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var r=Math.round(this.r),e=Math.round(this.g),o=Math.round(this.b);return this.a===1?"rgb(".concat(r,", ").concat(e,", ").concat(o,")"):"rgba(".concat(r,", ").concat(e,", ").concat(o,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var r=function(e){return"".concat(Math.round(b(e,255)*100),"%")};return{r:r(this.r),g:r(this.g),b:r(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var r=function(e){return Math.round(b(e,255)*100)};return this.a===1?"rgb(".concat(r(this.r),"%, ").concat(r(this.g),"%, ").concat(r(this.b),"%)"):"rgba(".concat(r(this.r),"%, ").concat(r(this.g),"%, ").concat(r(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var r="#"+bt(this.r,this.g,this.b,!1),e=0,o=Object.entries(I);e<o.length;e++){var n=o[e],i=n[0],a=n[1];if(r===a)return i}return!1},t.prototype.toString=function(r){var e=!!r;r=r??this.format;var o=!1,n=this.a<1&&this.a>=0,i=!e&&n&&(r.startsWith("hex")||r==="name");return i?r==="name"&&this.a===0?this.toName():this.toRgbString():(r==="rgb"&&(o=this.toRgbString()),r==="prgb"&&(o=this.toPercentageRgbString()),(r==="hex"||r==="hex6")&&(o=this.toHexString()),r==="hex3"&&(o=this.toHexString(!0)),r==="hex4"&&(o=this.toHex8String(!0)),r==="hex8"&&(o=this.toHex8String()),r==="name"&&(o=this.toName()),r==="hsl"&&(o=this.toHslString()),r==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(r){r===void 0&&(r=10);var e=this.toHsl();return e.l+=r/100,e.l=L(e.l),new t(e)},t.prototype.brighten=function(r){r===void 0&&(r=10);var e=this.toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(255*-(r/100)))),e.g=Math.max(0,Math.min(255,e.g-Math.round(255*-(r/100)))),e.b=Math.max(0,Math.min(255,e.b-Math.round(255*-(r/100)))),new t(e)},t.prototype.darken=function(r){r===void 0&&(r=10);var e=this.toHsl();return e.l-=r/100,e.l=L(e.l),new t(e)},t.prototype.tint=function(r){return r===void 0&&(r=10),this.mix("white",r)},t.prototype.shade=function(r){return r===void 0&&(r=10),this.mix("black",r)},t.prototype.desaturate=function(r){r===void 0&&(r=10);var e=this.toHsl();return e.s-=r/100,e.s=L(e.s),new t(e)},t.prototype.saturate=function(r){r===void 0&&(r=10);var e=this.toHsl();return e.s+=r/100,e.s=L(e.s),new t(e)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(r){var e=this.toHsl(),o=(e.h+r)%360;return e.h=o<0?360+o:o,new t(e)},t.prototype.mix=function(r,e){e===void 0&&(e=50);var o=this.toRgb(),n=new t(r).toRgb(),i=e/100,a={r:(n.r-o.r)*i+o.r,g:(n.g-o.g)*i+o.g,b:(n.b-o.b)*i+o.b,a:(n.a-o.a)*i+o.a};return new t(a)},t.prototype.analogous=function(r,e){r===void 0&&(r=6),e===void 0&&(e=30);var o=this.toHsl(),n=360/e,i=[this];for(o.h=(o.h-(n*r>>1)+720)%360;--r;)o.h=(o.h+n)%360,i.push(new t(o));return i},t.prototype.complement=function(){var r=this.toHsl();return r.h=(r.h+180)%360,new t(r)},t.prototype.monochromatic=function(r){r===void 0&&(r=6);for(var e=this.toHsv(),o=e.h,n=e.s,i=e.v,a=[],l=1/r;r--;)a.push(new t({h:o,s:n,v:i})),i=(i+l)%1;return a},t.prototype.splitcomplement=function(){var r=this.toHsl(),e=r.h;return[this,new t({h:(e+72)%360,s:r.s,l:r.l}),new t({h:(e+216)%360,s:r.s,l:r.l})]},t.prototype.onBackground=function(r){var e=this.toRgb(),o=new t(r).toRgb(),n=e.a+o.a*(1-e.a);return new t({r:(e.r*e.a+o.r*o.a*(1-e.a))/n,g:(e.g*e.a+o.g*o.a*(1-e.a))/n,b:(e.b*e.a+o.b*o.a*(1-e.a))/n,a:n})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(r){for(var e=this.toHsl(),o=e.h,n=[this],i=360/r,a=1;a<r;a++)n.push(new t({h:(o+a*i)%360,s:e.s,l:e.l}));return n},t.prototype.equals=function(r){return this.toRgbString()===new t(r).toRgbString()},t}();function Ut(t,r){var e={r:T(t.r),g:T(t.g),b:T(t.b)};return t.a!==void 0&&(e.a=Number(t.a)),new Ot(e,r)}var Mt=Object.values(I),br=new RegExp(`-\\[(${Mt.join("|")}|((?:#|rgba?\\(|hsla?\\())[^\\]]+)\\]$`),Tt=document.createElement("style");document.head.append(Tt);function yt(t){return Math.round(t*255).toString(16).padStart(2,"0")}function Sr(t){let r=`${yt(t.red)}${yt(t.green)}${yt(t.blue)}`,e=`tailwindcss-color-decoration-${r}`,o=`.${e}`;for(let n of Tt.sheet.cssRules)if(n.selectorText===o)return e;return Tt.sheet.insertRule(`${o}{background-color:#${r}}`),e}function Cr(t,r){let e=new WeakMap;return t.editor.onWillDisposeModel(o=>{e.delete(o)}),{async provideDocumentColors(o){let n=await r(o.uri),i=[],a=[],l=await n.getDocumentColors(String(o.uri),o.getLanguageId());if(l)for(let c of l){let x=it(c),h=o.getValueInRange(x.range);br.test(h)?i.push(x):a.push(x)}return e.set(o,o.deltaDecorations(e.get(o)??[],a.map(({color:c,range:x})=>({range:x,options:{before:{content:"\xA0",inlineClassName:`${Sr(c)} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0}}})))),i},provideColorPresentations(o,n){let i=o.getValueInRange(n.range),a=new RegExp(`-\\[(${Mt.join("|")}|(?:(?:#|rgba?\\(|hsla?\\())[^\\]]+)\\]$`,"i").exec(i);if(!a)return[];let[l]=a,c=Mt.includes(l),x=Ut({r:n.color.red,g:n.color.green,b:n.color.blue,a:n.color.alpha}),h=x.toHex8String(!c&&(l.length===4||l.length===5));h.length===5?h=h.replace(/f$/,""):h.length===9&&(h=h.replace(/ff$/,""));let g=x.toRgbString().replaceAll(" ",""),v=x.toHslString().replaceAll(" ",""),y=i.slice(0,Math.max(0,a.index));return[{label:`${y}-[${h}]`},{label:`${y}-[${g}]`},{label:`${y}-[${v}]`}]}}}function wr(t){return{async provideHover(r,e){let n=await(await t(r.uri)).doHover(String(r.uri),r.getLanguageId(),N(e));return n&&mt(n)}}}function yr(t){return{async provideCodeActions(r,e,o){let i=await(await t(r.uri)).doCodeActions(String(r.uri),r.getLanguageId(),m(e),ot(o));if(i)return{actions:i.map(a=>et(a)),dispose(){}}}}}function Mr(t){return{async provideCompletionItems(r,e,o){let i=await(await t(r.uri)).doComplete(String(r.uri),r.getLanguageId(),N(e),st(o));if(!i)return;let a=r.getWordUntilPosition(e);return pt(i,{range:{startLineNumber:e.lineNumber,startColumn:a.startColumn,endLineNumber:e.lineNumber,endColumn:a.endColumn}})},async resolveCompletionItem(r){let o=await(await t()).resolveCompletionItem($(r));return H(o,{range:r.range})}}}function Tr(t){return{owner:"tailwindcss",async provideMarkerData(r){return(await(await t(r.uri)).doValidate(String(r.uri),r.getLanguageId()))?.map(n=>A(n))}}}function _(t,r){return{name:`@${t}`,description:{kind:"markdown",value:r},references:[{name:`@${t} documentation`,url:`https://tailwindcss.com/docs/functions-and-directives#${t}`}]}}var Rr=_("tailwind",`Use the \`@tailwind\` directive to insert Tailwind's \`base\`, \`components\`, \`utilities\` and \`variants\` styles into your CSS.
|
|
4
|
+
|
|
5
|
+
\`\`\`css
|
|
6
|
+
/**
|
|
7
|
+
* This injects Tailwind's base styles and any base styles registered by
|
|
8
|
+
* plugins.
|
|
9
|
+
*/
|
|
10
|
+
@tailwind base;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This injects Tailwind's component classes and any component classes
|
|
14
|
+
* registered by plugins.
|
|
15
|
+
*/
|
|
16
|
+
@tailwind components;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This injects Tailwind's utility classes and any utility classes registered
|
|
20
|
+
* by plugins.
|
|
21
|
+
*/
|
|
22
|
+
@tailwind utilities;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Use this directive to control where Tailwind injects the hover, focus,
|
|
26
|
+
* responsive, dark mode, and other variants of each class.
|
|
27
|
+
*
|
|
28
|
+
* If omitted, Tailwind will append these classes to the very end of
|
|
29
|
+
* your stylesheet by default.
|
|
30
|
+
*/
|
|
31
|
+
@tailwind variants;
|
|
32
|
+
\`\`\``),kr=_("layer",`Use the \`@layer\` directive to tell Tailwind which "bucket" a set of custom styles belong to. Valid layers are \`base\`, \`components\`, and \`utilities\`.
|
|
33
|
+
|
|
34
|
+
\`\`\`css
|
|
35
|
+
@tailwind base;
|
|
36
|
+
@tailwind components;
|
|
37
|
+
@tailwind utilities;
|
|
38
|
+
|
|
39
|
+
@layer base {
|
|
40
|
+
h1 {
|
|
41
|
+
@apply text-2xl;
|
|
42
|
+
}
|
|
43
|
+
h2 {
|
|
44
|
+
@apply text-xl;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@layer components {
|
|
49
|
+
.btn-blue {
|
|
50
|
+
@apply bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@layer utilities {
|
|
55
|
+
.filter-none {
|
|
56
|
+
filter: none;
|
|
57
|
+
}
|
|
58
|
+
.filter-grayscale {
|
|
59
|
+
filter: grayscale(100%);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
\`\`\`
|
|
63
|
+
|
|
64
|
+
Tailwind will automatically move any CSS within a \`@layer\` directive to the same place as the corresponding \`@tailwind\` rule, so you don't have to worry about authoring your CSS in a specific order to avoid specificity issues.
|
|
65
|
+
|
|
66
|
+
Any custom CSS added to a layer will only be included in the final build if that CSS is actually used in your HTML, just like all of the classes built in to Tailwind by default.
|
|
67
|
+
|
|
68
|
+
Wrapping any custom CSS in a \`@layer\` directive also makes it possible to use modifiers with those rules, like \`hover:\` and \`focus:\` or responsive modifiers like \`md:\` and \`lg:\`.`),Er=_("apply",`Use \`@apply\` to inline any existing utility classes into your own custom CSS.
|
|
69
|
+
|
|
70
|
+
This is useful when you need to write custom CSS (like to override the styles in a third-party library) but still want to work with your design tokens and use the same syntax you're used to using in your HTML.
|
|
71
|
+
|
|
72
|
+
\`\`\`css
|
|
73
|
+
.select2-dropdown {
|
|
74
|
+
@apply rounded-b-lg shadow-md;
|
|
75
|
+
}
|
|
76
|
+
.select2-search {
|
|
77
|
+
@apply border border-gray-300 rounded;
|
|
78
|
+
}
|
|
79
|
+
.select2-results__group {
|
|
80
|
+
@apply text-lg font-bold text-gray-900;
|
|
81
|
+
}
|
|
82
|
+
\`\`\`
|
|
83
|
+
|
|
84
|
+
Any rules inlined with \`@apply\` will have \`!important\` **removed** by default to avoid specificity issues:
|
|
85
|
+
|
|
86
|
+
\`\`\`css
|
|
87
|
+
/* Input */
|
|
88
|
+
.foo {
|
|
89
|
+
color: blue !important;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.bar {
|
|
93
|
+
@apply foo;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Output */
|
|
97
|
+
.foo {
|
|
98
|
+
color: blue !important;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.bar {
|
|
102
|
+
color: blue;
|
|
103
|
+
}
|
|
104
|
+
\`\`\`
|
|
105
|
+
|
|
106
|
+
If you'd like to \`@apply\` an existing class and make it \`!important\`, simply add \`!important\` to the end of the declaration:
|
|
107
|
+
|
|
108
|
+
\`\`\`css
|
|
109
|
+
/* Input */
|
|
110
|
+
.btn {
|
|
111
|
+
@apply font-bold py-2 px-4 rounded !important;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Output */
|
|
115
|
+
.btn {
|
|
116
|
+
font-weight: 700 !important;
|
|
117
|
+
padding-top: .5rem !important;
|
|
118
|
+
padding-bottom: .5rem !important;
|
|
119
|
+
padding-right: 1rem !important;
|
|
120
|
+
padding-left: 1rem !important;
|
|
121
|
+
border-radius: .25rem !important;
|
|
122
|
+
}
|
|
123
|
+
\`\`\`
|
|
124
|
+
|
|
125
|
+
Note that if you're using Sass/SCSS, you'll need to use Sass' interpolation feature to get this to work:
|
|
126
|
+
|
|
127
|
+
\`\`\`css
|
|
128
|
+
.btn {
|
|
129
|
+
@apply font-bold py-2 px-4 rounded #{!important};
|
|
130
|
+
}
|
|
131
|
+
\`\`\``),Dr=_("config",'Use the `@config` directive to specify which config file Tailwind should use when compiling CSS file. This is useful for projects that need to use different configuration files for different CSS entry points.\n\n```css\n@config "./tailwind.site.config.js";\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n```\n\n```css\n@config "./tailwind.admin.config.js";\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n```\n\nThe path you provide to the `@config` directive is relative to that CSS file, and will take precedence over a path defined in your PostCSS configuration or in the Tailwind CLI.'),Ir={version:1.1,atDirectives:[Rr,kr,Er,Dr]},Ar=["css","javascript","html","mdx","typescript"],Pr=(t,{languageSelector:r=Ar,tailwindConfig:e}={})=>{K(t);let o=At(t,{label:"tailwindcss",moduleId:"monaco-tailwindcss/tailwindcss.worker",createData:{tailwindConfig:e}}),n=[o,t.languages.registerCodeActionProvider(r,yr(o.getWorker)),t.languages.registerColorProvider(r,Cr(t,o.getWorker)),t.languages.registerCompletionItemProvider(r,Mr(o.getWorker)),t.languages.registerHoverProvider(r,wr(o.getWorker))];for(let i of Array.isArray(r)?r:[r])typeof i=="string"&&n.push(It(t,i,Tr(o.getWorker)));return{dispose(){for(let i of n)i.dispose()},setTailwindConfig(i){o.updateCreateData({tailwindConfig:i})},async generateStylesFromContent(i,a){return(await o.getWorker()).generateStylesFromContent(i,a.map(c=>typeof c=="string"?{content:c}:c))}}};export{Pr as configureMonacoTailwindcss,Ir as tailwindcssData};
|