Initial commit

This commit is contained in:
mats committed 2026-09-22 08:41:20 +02:00
commit 89053153cc
8152 files changed
+2086461

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports):"function"==typeof define&&define.amd?define(["exports"],s):s((t="undefined"!=typeof globalThis?globalThis:t||self).cssTools={})}(this,function(t){"use strict";class s extends Error{reason;filename;line;column;source;constructor(t,s,e,i,n){super(`${t}:${e}:${i}: ${s}`),this.reason=s,this.filename=t,this.line=e,this.column=i,this.source=n}}class e{start;end;source;constructor(t,s,e){this.start=t,this.end=s,this.source=e}}var i;t.CssTypes=void 0,(i=t.CssTypes||(t.CssTypes={})).stylesheet="stylesheet",i.rule="rule",i.declaration="declaration",i.comment="comment",i.atRule="at-rule",i.container="container",i.charset="charset",i.counterStyle="counter-style",i.document="document",i.customMedia="custom-media",i.fontFace="font-face",i.fontFeatureValues="font-feature-values",i.host="host",i.import="import",i.keyframes="keyframes",i.keyframe="keyframe",i.layer="layer",i.media="media",i.namespace="namespace",i.page="page",i.pageMarginBox="page-margin-box",i.positionTry="position-try",i.property="property",i.scope="scope",i.startingStyle="starting-style",i.supports="supports",i.viewTransition="view-transition";const n=(t,s,e)=>{let i=e,n=1e4;do{const e=s.map(s=>t.indexOf(s,i));e.push(t.indexOf("\\",i));const r=e.filter(t=>-1!==t);if(0===r.length)return-1;const o=Math.min(...r);if("\\"!==t[o])return o;i=o+2,n--}while(n>0);throw new Error("Too many escaping")},r=(t,s,e)=>{let i=e,o=1e4;do{const e=s.map(s=>t.indexOf(s,i));e.push(t.indexOf("(",i)),e.push(t.indexOf('"',i)),e.push(t.indexOf("'",i)),e.push(t.indexOf("\\",i));const c=e.filter(t=>-1!==t);if(0===c.length)return-1;const h=Math.min(...c);switch(t[h]){case"\\":i=h+2;break;case"(":{const s=r(t,[")"],h+1);if(-1===s)return-1;i=s+1}break;case'"':{const s=n(t,['"'],h+1);if(-1===s)return-1;i=s+1}break;case"'":{const s=n(t,["'"],h+1);if(-1===s)return-1;i=s+1}break;default:return h}o--}while(o>0);throw new Error("Too many escaping")},o=/\/\*[^]*?(?:\*\/|$)/g;function c(t){return t?t.trim():""}function h(t,s){const e=t&&"string"==typeof t.type,i=e?t:s;for(const s in t){const e=t[s];Array.isArray(e)?e.forEach(t=>{h(t,i)}):e&&"object"==typeof e&&h(e,i)}return e&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:s||null}),t}class a{level=0;indentation=" ";compress=!1;constructor(t){"string"==typeof t?.indent&&(this.indentation=t?.indent),t?.compress&&(this.compress=!0)}emit(t,s){return t}indent(t){return this.level=this.level||1,t?(this.level+=t,""):Array(this.level).join(this.indentation)}visit(s){switch(s.type){case t.CssTypes.stylesheet:return this.stylesheet(s);case t.CssTypes.rule:return this.rule(s);case t.CssTypes.declaration:return this.declaration(s);case t.CssTypes.comment:return this.comment(s);case t.CssTypes.container:return this.container(s);case t.CssTypes.charset:return this.charset(s);case t.CssTypes.counterStyle:return this.counterStyle(s);case t.CssTypes.document:return this.document(s);case t.CssTypes.customMedia:return this.customMedia(s);case t.CssTypes.fontFace:return this.fontFace(s);case t.CssTypes.fontFeatureValues:return this.fontFeatureValues(s);case t.CssTypes.host:return this.host(s);case t.CssTypes.import:return this.import(s);case t.CssTypes.keyframes:return this.keyframes(s);case t.CssTypes.keyframe:return this.keyframe(s);case t.CssTypes.layer:return this.layer(s);case t.CssTypes.media:return this.media(s);case t.CssTypes.namespace:return this.namespace(s);case t.CssTypes.page:return this.page(s);case t.CssTypes.pageMarginBox:return this.pageMarginBox(s);case t.CssTypes.positionTry:return this.positionTry(s);case t.CssTypes.property:return this.property(s);case t.CssTypes.scope:return this.scope(s);case t.CssTypes.startingStyle:return this.startingStyle(s);case t.CssTypes.supports:return this.supports(s);case t.CssTypes.viewTransition:return this.viewTransition(s);case t.CssTypes.atRule:return this.genericAtRule(s)}}mapVisit(t,s){let e="";s=s||"";for(let i=0,n=t.length;i<n;i++)e+=this.visit(t[i]),s&&i<n-1&&(e+=this.emit(s));return e}compile(t){return this.compress?t.stylesheet.rules.map(this.visit,this).join(""):this.stylesheet(t)}stylesheet(t){return this.mapVisit(t.stylesheet.rules,"\n\n")}comment(t){return this.compress?this.emit("",t.position):this.emit(`${this.indent()}/*${t.comment}*/`,t.position)}container(t){return this.compress?this.emit(`@container ${t.container}`,t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}"):this.emit(`${this.indent()}@container ${t.container}`,t.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(t.rules,"\n\n")+this.emit(`\n${this.indent(-1)}${this.indent()}}`)}layer(t){return this.compress?this.emit(`@layer ${t.layer}`,t.position)+(t.rules?this.emit("{")+this.mapVisit(t.rules)+this.emit("}"):";"):this.emit(`${this.indent()}@layer ${t.layer}`,t.position)+(t.rules?this.emit(` {\n${this.indent(1)}`)+this.mapVisit(t.rules,"\n\n")+this.emit(`\n${this.indent(-1)}${this.indent()}}`):"Line truncated
//# sourceMappingURL=adobe-css-tools.js.map