feat(frontend): add API client, layout, and routing
- Create Axios-based API client with sources, jobs, and dashboard endpoints - Add responsive Layout component with navigation sidebar - Set up React Router with Dashboard, Backups, and Settings routes - Configure TanStack Query provider with default options - Use lucide-react for navigation icons
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
var l=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var q=(t,e)=>{for(var o in e)l(t,o,{get:e[o],enumerable:!0})},u=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!m.call(t,r)&&r!==o&&l(t,r,{get:()=>e[r],enumerable:!(s=n(e,r))||s.enumerable});return t};var w=t=>u(l({},"__esModule",{value:!0}),t);var h={};q(h,{closest:()=>y,matches:()=>x,querySelector:()=>S,querySelectorAll:()=>a});module.exports=w(h);var c=require("./js/matcher.js");/*!
|
||||
* DOM Selector - A CSS selector engine.
|
||||
* @license MIT
|
||||
* @copyright asamuzaK (Kazz)
|
||||
* @see {@link https://github.com/asamuzaK/domSelector/blob/main/LICENSE}
|
||||
*/const x=(t,e,o)=>new c.Matcher(t,e,o).matches(),y=(t,e,o)=>new c.Matcher(t,e,o).closest(),S=(t,e,o)=>new c.Matcher(t,e,o).querySelector(),a=(t,e,o)=>new c.Matcher(t,e,o).querySelectorAll();0&&(module.exports={closest,matches,querySelector,querySelectorAll});
|
||||
//# sourceMappingURL=index.js.map
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../src/index.js"],
|
||||
"sourcesContent": ["/*!\n * DOM Selector - A CSS selector engine.\n * @license MIT\n * @copyright asamuzaK (Kazz)\n * @see {@link https://github.com/asamuzaK/domSelector/blob/main/LICENSE}\n */\n\n/* import */\nimport { Matcher } from './js/matcher.js';\n\n/**\n * matches\n * @param {string} selector - CSS selector\n * @param {object} node - Element node\n * @param {object} [opt] - options\n * @param {boolean} [opt.warn] - console warn e.g. unsupported pseudo-class\n * @returns {boolean} - `true` if matched, `false` otherwise\n */\nexport const matches = (selector, node, opt) =>\n new Matcher(selector, node, opt).matches();\n\n/**\n * closest\n * @param {string} selector - CSS selector\n * @param {object} node - Element node\n * @param {object} [opt] - options\n * @param {boolean} [opt.warn] - console warn e.g. unsupported pseudo-class\n * @returns {?object} - matched node\n */\nexport const closest = (selector, node, opt) =>\n new Matcher(selector, node, opt).closest();\n\n/**\n * querySelector\n * @param {string} selector - CSS selector\n * @param {object} node - Document, DocumentFragment or Element node\n * @param {object} [opt] - options\n * @param {boolean} [opt.warn] - console warn e.g. unsupported pseudo-class\n * @returns {?object} - matched node\n */\nexport const querySelector = (selector, node, opt) =>\n new Matcher(selector, node, opt).querySelector();\n\n/**\n * querySelectorAll\n * NOTE: returns Array, not NodeList\n * @param {string} selector - CSS selector\n * @param {object} node - Document, DocumentFragment or Element node\n * @param {object} [opt] - options\n * @param {boolean} [opt.warn] - console warn e.g. unsupported pseudo-class\n * @returns {Array.<object|undefined>} - array of matched nodes\n */\nexport const querySelectorAll = (selector, node, opt) =>\n new Matcher(selector, node, opt).querySelectorAll();\n"],
|
||||
"mappings": "4ZAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,YAAAC,EAAA,kBAAAC,EAAA,qBAAAC,IAAA,eAAAC,EAAAN,GAQA,IAAAO,EAAwB,2BARxB;AAAA;AAAA;AAAA;AAAA;AAAA,GAkBO,MAAMJ,EAAU,CAACK,EAAUC,EAAMC,IACtC,IAAI,UAAQF,EAAUC,EAAMC,CAAG,EAAE,QAAQ,EAU9BR,EAAU,CAACM,EAAUC,EAAMC,IACtC,IAAI,UAAQF,EAAUC,EAAMC,CAAG,EAAE,QAAQ,EAU9BN,EAAgB,CAACI,EAAUC,EAAMC,IAC5C,IAAI,UAAQF,EAAUC,EAAMC,CAAG,EAAE,cAAc,EAWpCL,EAAmB,CAACG,EAAUC,EAAMC,IAC/C,IAAI,UAAQF,EAAUC,EAAMC,CAAG,EAAE,iBAAiB",
|
||||
"names": ["src_exports", "__export", "closest", "matches", "querySelector", "querySelectorAll", "__toCommonJS", "import_matcher", "selector", "node", "opt"]
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
var E=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var _=(o,t)=>{for(var r in t)E(o,r,{get:t[r],enumerable:!0})},T=(o,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of x(t))!n.call(o,e)&&e!==r&&E(o,e,{get:()=>t[e],enumerable:!(s=c(t,e))||s.enumerable});return o};var p=o=>T(E({},"__esModule",{value:!0}),o);var rt={};_(rt,{ALPHA_NUM:()=>O,AN_PLUS_B:()=>S,BIT_01:()=>W,BIT_02:()=>a,BIT_04:()=>d,BIT_08:()=>i,BIT_16:()=>u,BIT_32:()=>Y,BIT_HYPHEN:()=>h,COMBINATOR:()=>N,DOCUMENT_FRAGMENT_NODE:()=>j,DOCUMENT_NODE:()=>Z,DOCUMENT_POSITION_CONTAINED_BY:()=>v,DOCUMENT_POSITION_CONTAINS:()=>q,DOCUMENT_POSITION_PRECEDING:()=>k,DUO:()=>X,ELEMENT_NODE:()=>y,HEX:()=>$,IDENTIFIER:()=>D,MAX_BIT_16:()=>b,NOT_SUPPORTED_ERR:()=>I,NTH:()=>R,RAW:()=>C,REG_LOGICAL_PSEUDO:()=>V,REG_SHADOW_HOST:()=>tt,REG_SHADOW_MODE:()=>ot,REG_SHADOW_PSEUDO:()=>et,SELECTOR:()=>A,SELECTOR_ATTR:()=>L,SELECTOR_CLASS:()=>P,SELECTOR_ID:()=>M,SELECTOR_LIST:()=>U,SELECTOR_PSEUDO_CLASS:()=>l,SELECTOR_PSEUDO_ELEMENT:()=>F,SELECTOR_TYPE:()=>H,SHOW_ALL:()=>z,SHOW_DOCUMENT:()=>J,SHOW_DOCUMENT_FRAGMENT:()=>K,SHOW_ELEMENT:()=>Q,STRING:()=>B,SYNTAX_ERR:()=>f,TEXT_NODE:()=>g,TYPE_FROM:()=>m,TYPE_TO:()=>w,U_FFFD:()=>G});module.exports=p(rt);const O="[A-Z\\d]+",S="AnPlusB",N="Combinator",D="Identifier",I="NotSupportedError",R="Nth",C="Raw",A="Selector",L="AttributeSelector",P="ClassSelector",M="IdSelector",U="SelectorList",l="PseudoClassSelector",F="PseudoElementSelector",H="TypeSelector",B="String",f="SyntaxError",G="\uFFFD",W=1,a=2,d=4,i=8,u=16,Y=32,h=45,X=2,$=16,b=65535,m=8,w=-1,y=1,g=3,Z=9,j=11,k=2,q=8,v=16,z=4294967295,J=256,K=1024,Q=1,V=/^(?:(?:ha|i)s|not|where)$/,tt=/^host(?:-context)?$/,ot=/^(?:close|open)$/,et=/^part|slotted$/;0&&(module.exports={ALPHA_NUM,AN_PLUS_B,BIT_01,BIT_02,BIT_04,BIT_08,BIT_16,BIT_32,BIT_HYPHEN,COMBINATOR,DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,DOCUMENT_POSITION_CONTAINS,DOCUMENT_POSITION_PRECEDING,DUO,ELEMENT_NODE,HEX,IDENTIFIER,MAX_BIT_16,NOT_SUPPORTED_ERR,NTH,RAW,REG_LOGICAL_PSEUDO,REG_SHADOW_HOST,REG_SHADOW_MODE,REG_SHADOW_PSEUDO,SELECTOR,SELECTOR_ATTR,SELECTOR_CLASS,SELECTOR_ID,SELECTOR_LIST,SELECTOR_PSEUDO_CLASS,SELECTOR_PSEUDO_ELEMENT,SELECTOR_TYPE,SHOW_ALL,SHOW_DOCUMENT,SHOW_DOCUMENT_FRAGMENT,SHOW_ELEMENT,STRING,SYNTAX_ERR,TEXT_NODE,TYPE_FROM,TYPE_TO,U_FFFD});
|
||||
//# sourceMappingURL=constant.js.map
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../../src/js/constant.js"],
|
||||
"sourcesContent": ["/**\n * constant.js\n */\n\n/* string */\nexport const ALPHA_NUM = '[A-Z\\\\d]+';\nexport const AN_PLUS_B = 'AnPlusB';\nexport const COMBINATOR = 'Combinator';\nexport const IDENTIFIER = 'Identifier';\nexport const NOT_SUPPORTED_ERR = 'NotSupportedError';\nexport const NTH = 'Nth';\nexport const RAW = 'Raw';\nexport const SELECTOR = 'Selector';\nexport const SELECTOR_ATTR = 'AttributeSelector';\nexport const SELECTOR_CLASS = 'ClassSelector';\nexport const SELECTOR_ID = 'IdSelector';\nexport const SELECTOR_LIST = 'SelectorList';\nexport const SELECTOR_PSEUDO_CLASS = 'PseudoClassSelector';\nexport const SELECTOR_PSEUDO_ELEMENT = 'PseudoElementSelector';\nexport const SELECTOR_TYPE = 'TypeSelector';\nexport const STRING = 'String';\nexport const SYNTAX_ERR = 'SyntaxError';\nexport const U_FFFD = '\\uFFFD';\n\n/* numeric */\nexport const BIT_01 = 1;\nexport const BIT_02 = 2;\nexport const BIT_04 = 4;\nexport const BIT_08 = 8;\nexport const BIT_16 = 0x10;\nexport const BIT_32 = 0x20;\nexport const BIT_HYPHEN = 0x2D;\nexport const DUO = 2;\nexport const HEX = 16;\nexport const MAX_BIT_16 = 0xFFFF;\nexport const TYPE_FROM = 8;\nexport const TYPE_TO = -1;\n\n/* Node */\nexport const ELEMENT_NODE = 1;\nexport const TEXT_NODE = 3;\nexport const DOCUMENT_NODE = 9;\nexport const DOCUMENT_FRAGMENT_NODE = 11;\nexport const DOCUMENT_POSITION_PRECEDING = 2;\nexport const DOCUMENT_POSITION_CONTAINS = 8;\nexport const DOCUMENT_POSITION_CONTAINED_BY = 0x10;\n\n/* NodeFilter */\nexport const SHOW_ALL = 0xffffffff;\nexport const SHOW_DOCUMENT = 0x100;\nexport const SHOW_DOCUMENT_FRAGMENT = 0x400;\nexport const SHOW_ELEMENT = 1;\n\n/* regexp */\nexport const REG_LOGICAL_PSEUDO = /^(?:(?:ha|i)s|not|where)$/;\nexport const REG_SHADOW_HOST = /^host(?:-context)?$/;\nexport const REG_SHADOW_MODE = /^(?:close|open)$/;\nexport const REG_SHADOW_PSEUDO = /^part|slotted$/;\n"],
|
||||
"mappings": "4ZAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,eAAAE,EAAA,cAAAC,EAAA,WAAAC,EAAA,WAAAC,EAAA,WAAAC,EAAA,WAAAC,EAAA,WAAAC,EAAA,WAAAC,EAAA,eAAAC,EAAA,eAAAC,EAAA,2BAAAC,EAAA,kBAAAC,EAAA,mCAAAC,EAAA,+BAAAC,EAAA,gCAAAC,EAAA,QAAAC,EAAA,iBAAAC,EAAA,QAAAC,EAAA,eAAAC,EAAA,eAAAC,EAAA,sBAAAC,EAAA,QAAAC,EAAA,QAAAC,EAAA,uBAAAC,EAAA,oBAAAC,GAAA,oBAAAC,GAAA,sBAAAC,GAAA,aAAAC,EAAA,kBAAAC,EAAA,mBAAAC,EAAA,gBAAAC,EAAA,kBAAAC,EAAA,0BAAAC,EAAA,4BAAAC,EAAA,kBAAAC,EAAA,aAAAC,EAAA,kBAAAC,EAAA,2BAAAC,EAAA,iBAAAC,EAAA,WAAAC,EAAA,eAAAC,EAAA,cAAAC,EAAA,cAAAC,EAAA,YAAAC,EAAA,WAAAC,IAAA,eAAAC,EAAA/C,IAKO,MAAME,EAAY,YACZC,EAAY,UACZQ,EAAa,aACbS,EAAa,aACbE,EAAoB,oBACpBC,EAAM,MACNC,EAAM,MACNK,EAAW,WACXC,EAAgB,oBAChBC,EAAiB,gBACjBC,EAAc,aACdC,EAAgB,eAChBC,EAAwB,sBACxBC,EAA0B,wBAC1BC,EAAgB,eAChBK,EAAS,SACTC,EAAa,cACbI,EAAS,SAGT1C,EAAS,EACTC,EAAS,EACTC,EAAS,EACTC,EAAS,EACTC,EAAS,GACTC,EAAS,GACTC,EAAa,GACbO,EAAM,EACNE,EAAM,GACNE,EAAa,MACbuB,EAAY,EACZC,EAAU,GAGV3B,EAAe,EACfyB,EAAY,EACZ9B,EAAgB,EAChBD,EAAyB,GACzBI,EAA8B,EAC9BD,EAA6B,EAC7BD,EAAiC,GAGjCuB,EAAW,WACXC,EAAgB,IAChBC,EAAyB,KACzBC,EAAe,EAGff,EAAqB,4BACrBC,GAAkB,sBAClBC,GAAkB,mBAClBC,GAAoB",
|
||||
"names": ["constant_exports", "__export", "ALPHA_NUM", "AN_PLUS_B", "BIT_01", "BIT_02", "BIT_04", "BIT_08", "BIT_16", "BIT_32", "BIT_HYPHEN", "COMBINATOR", "DOCUMENT_FRAGMENT_NODE", "DOCUMENT_NODE", "DOCUMENT_POSITION_CONTAINED_BY", "DOCUMENT_POSITION_CONTAINS", "DOCUMENT_POSITION_PRECEDING", "DUO", "ELEMENT_NODE", "HEX", "IDENTIFIER", "MAX_BIT_16", "NOT_SUPPORTED_ERR", "NTH", "RAW", "REG_LOGICAL_PSEUDO", "REG_SHADOW_HOST", "REG_SHADOW_MODE", "REG_SHADOW_PSEUDO", "SELECTOR", "SELECTOR_ATTR", "SELECTOR_CLASS", "SELECTOR_ID", "SELECTOR_LIST", "SELECTOR_PSEUDO_CLASS", "SELECTOR_PSEUDO_ELEMENT", "SELECTOR_TYPE", "SHOW_ALL", "SHOW_DOCUMENT", "SHOW_DOCUMENT_FRAGMENT", "SHOW_ELEMENT", "STRING", "SYNTAX_ERR", "TEXT_NODE", "TYPE_FROM", "TYPE_TO", "U_FFFD", "__toCommonJS"]
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
var O=Object.create;var f=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var I=(e,t)=>{for(var i in t)f(e,i,{get:t[i],enumerable:!0})},b=(e,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of C(t))!_.call(e,l)&&l!==i&&f(e,l,{get:()=>t[l],enumerable:!(o=h(t,l))||o.enumerable});return e};var w=(e,t,i)=>(i=e!=null?O(g(e)):{},b(t||!e||!e.__esModule?f(i,"default",{value:e,enumerable:!0}):i,e)),M=e=>b(f({},"__esModule",{value:!0}),e);var A={};I(A,{getDirectionality:()=>N,getSlottedTextContent:()=>c,isContentEditable:()=>D,isInShadowTree:()=>x,isInclusive:()=>v,isNamespaceDeclared:()=>k,isPreceding:()=>P,selectorToNodeProps:()=>S});module.exports=M(A);var E=w(require("bidi-js"),1),r=require("./constant.js");const x=(e={})=>{let t;if(e.nodeType===r.ELEMENT_NODE||e.nodeType===r.DOCUMENT_FRAGMENT_NODE){let i=e;for(;i;){const{host:o,mode:l,nodeType:n,parentNode:p}=i;if(o&&l&&n===r.DOCUMENT_FRAGMENT_NODE&&r.REG_SHADOW_MODE.test(l)){t=!0;break}i=p}}return!!t},c=(e={})=>{let t;if(e.localName==="slot"&&x(e)){const i=e.assignedNodes();if(i.length){for(const o of i)if(t=o.textContent.trim(),t)break}else t=e.textContent.trim()}return t??null},N=(e={})=>{let t;if(e.nodeType===r.ELEMENT_NODE){const{dir:i,localName:o,parentNode:l}=e,{getEmbeddingLevels:n}=(0,E.default)(),p=/^(?:ltr|rtl)$/;if(p.test(i))t=i;else if(i==="auto"){let s;switch(o){case"input":{(!e.type||/^(?:(?:butto|hidde)n|(?:emai|te|ur)l|(?:rese|submi|tex)t|password|search)$/.test(e.type))&&(s=e.value);break}case"slot":{s=c(e);break}case"textarea":{s=e.value;break}default:{const a=[].slice.call(e.childNodes);for(const u of a){const{dir:m,localName:T,nodeType:d,textContent:y}=u;if(d===r.TEXT_NODE?s=y.trim():d===r.ELEMENT_NODE&&!/^(?:bdi|s(?:cript|tyle)|textarea)$/.test(T)&&(!m||!p.test(m))&&(T==="slot"?s=c(u):s=y.trim()),s)break}}}if(s){const{paragraphs:[{level:a}]}=n(s);a%2===1?t="rtl":t="ltr"}if(!t)if(l){const{nodeType:a}=l;a===r.ELEMENT_NODE?t=N(l):(a===r.DOCUMENT_NODE||a===r.DOCUMENT_FRAGMENT_NODE)&&(t="ltr")}else t="ltr"}else if(o==="bdi"){const s=e.textContent.trim();if(s){const{paragraphs:[{level:a}]}=n(s);a%2===1?t="rtl":t="ltr"}t||l||(t="ltr")}else if(o==="input"&&e.type==="tel")t="ltr";else if(l){if(o==="slot"){const s=c(e);if(s){const{paragraphs:[{level:a}]}=n(s);a%2===1?t="rtl":t="ltr"}}if(!t){const{nodeType:s}=l;s===r.ELEMENT_NODE?t=N(l):(s===r.DOCUMENT_NODE||s===r.DOCUMENT_FRAGMENT_NODE)&&(t="ltr")}}else t="ltr"}return t??null},D=(e={})=>{let t;if(e.nodeType===r.ELEMENT_NODE){if(typeof e.isContentEditable=="boolean")t=e.isContentEditable;else if(e.ownerDocument.designMode==="on")t=!0;else if(e.hasAttribute("contenteditable")){const i=e.getAttribute("contenteditable");if(i===""||/^(?:plaintext-only|true)$/.test(i))t=!0;else if(i==="inherit"){let o=e.parentNode;for(;o;){if(D(o)){t=!0;break}o=o.parentNode}}}}return!!t},k=(e="",t={})=>{let i;if(e&&typeof e=="string"&&t.nodeType===r.ELEMENT_NODE){const o=`xmlns:${e}`,l=t.ownerDocument.documentElement;let n=t;for(;n;){if(typeof n.hasAttribute=="function"&&n.hasAttribute(o)){i=!0;break}else if(n===l)break;n=n.parentNode}}return!!i},v=(e={},t={})=>{let i;if(e.nodeType===r.ELEMENT_NODE&&t.nodeType===r.ELEMENT_NODE){const o=t.compareDocumentPosition(e);i=o&r.DOCUMENT_POSITION_CONTAINS||o&r.DOCUMENT_POSITION_CONTAINED_BY}return!!i},P=(e={},t={})=>{let i;if(e.nodeType===r.ELEMENT_NODE&&t.nodeType===r.ELEMENT_NODE){const o=t.compareDocumentPosition(e);i=o&r.DOCUMENT_POSITION_PRECEDING||o&r.DOCUMENT_POSITION_CONTAINS}return!!i},S=(e,t)=>{let i,o;if(e&&typeof e=="string")e.indexOf("|")>-1?[i,o]=e.split("|"):(i="*",o=e);else throw new DOMException(`Invalid selector ${e}`,r.SYNTAX_ERR);return{prefix:i,tagName:o}};0&&(module.exports={getDirectionality,getSlottedTextContent,isContentEditable,isInShadowTree,isInclusive,isNamespaceDeclared,isPreceding,selectorToNodeProps});
|
||||
//# sourceMappingURL=dom-util.js.map
|
||||
+7
File diff suppressed because one or more lines are too long
+2
File diff suppressed because one or more lines are too long
+7
File diff suppressed because one or more lines are too long
+3
@@ -0,0 +1,3 @@
|
||||
var E=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var y=(s,e)=>{for(var r in e)E(s,r,{get:e[r],enumerable:!0})},w=(s,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of O(e))!x.call(s,n)&&n!==r&&E(s,n,{get:()=>e[n],enumerable:!(i=m(e,n))||i.enumerable});return s};var $=s=>w(E({},"__esModule",{value:!0}),s);var P={};y(P,{generateCSS:()=>S.generate,parseSelector:()=>d,preprocess:()=>u,unescapeSelector:()=>D,walkAST:()=>_});module.exports=$(P);var g=require("css-tree"),t=require("./constant.js"),S=require("css-tree");const D=(s="")=>{if(typeof s=="string"&&s.indexOf("\\",0)>=0){const e=s.split("\\"),r=e.length;for(let i=1;i<r;i++){let n=e[i];if(n===""&&i===r-1)n=t.U_FFFD;else{const a=/^([\da-f]{1,6}\s?)/i.exec(n);if(a){const[,o]=a;let l;try{const c=parseInt("D800",t.HEX),p=parseInt("DFFF",t.HEX),h=parseInt(o,t.HEX);h===0||h>=c&&h<=p?l=t.U_FFFD:l=String.fromCodePoint(h)}catch{l=t.U_FFFD}let f="";n.length>o.length&&(f=n.substring(o.length)),n=`${l}${f}`}else/^[\n\r\f]/.test(n)&&(n="\\"+n)}e[i]=n}s=e.join("")}return s},u=(...s)=>{if(!s.length)throw new TypeError("1 argument required, but only 0 present.");let[e]=s;if(typeof e=="string"){let r=0;for(;r>=0&&(r=e.indexOf("#",r),!(r<0));){const i=e.substring(0,r+1);let n=e.substring(r+1);const a=n.codePointAt(0);if(a===t.BIT_HYPHEN){if(/^\d$/.test(n.substring(1,2)))throw new DOMException(`Invalid selector ${e}`,t.SYNTAX_ERR)}else if(a>t.MAX_BIT_16){const o=`\\${a.toString(t.HEX)} `;n.length===t.DUO?n=o:n=`${o}${n.substring(t.DUO)}`}e=`${i}${n}`,r++}e=e.replace(/\f|\r\n?/g,`
|
||||
`).replace(/[\0\uD800-\uDFFF]|\\$/g,t.U_FFFD)}else if(e==null)e=Object.prototype.toString.call(e).slice(t.TYPE_FROM,t.TYPE_TO).toLowerCase();else if(Array.isArray(e))e=e.join(",");else if(Object.prototype.hasOwnProperty.call(e,"toString"))e=e.toString();else throw new DOMException(`Invalid selector ${e}`,t.SYNTAX_ERR);return e},d=s=>{if(s=u(s),/^$|^\s*>|,\s*$/.test(s))throw new DOMException(`Invalid selector ${s}`,t.SYNTAX_ERR);let e;try{const r=(0,g.parse)(s,{context:"selectorList",parseCustomProperty:!0});e=(0,g.toPlainObject)(r)}catch(r){const i=/(:lang\(\s*("[A-Za-z\d\-*]+")\s*\))/;if(r.message==="Identifier is expected"&&i.test(s)){const[,n,a]=i.exec(s),o=a.replaceAll("*","\\*").replace(/^"/,"").replace(/"$/,""),l=n.replace(a,o);e=d(s.replace(n,l))}else if(r.message==='"]" is expected'&&!s.endsWith("]"))e=d(`${s}]`);else if(r.message==='")" is expected'&&!s.endsWith(")"))e=d(`${s})`);else throw new DOMException(r.message,t.SYNTAX_ERR)}return e},_=(s={})=>{const e=new Set;let r;return(0,g.walk)(s,{enter:n=>{n.type===t.SELECTOR?e.add(n.children):(n.type===t.SELECTOR_PSEUDO_CLASS&&t.REG_LOGICAL_PSEUDO.test(n.name)||n.type===t.SELECTOR_PSEUDO_ELEMENT&&t.REG_SHADOW_PSEUDO.test(n.name))&&(r=!0)}}),r&&(0,g.findAll)(s,(n,a,o)=>{if(o){if(n.type===t.SELECTOR_PSEUDO_CLASS&&t.REG_LOGICAL_PSEUDO.test(n.name)){const l=o.filter(f=>{const{name:c,type:p}=f;return p===t.SELECTOR_PSEUDO_CLASS&&t.REG_LOGICAL_PSEUDO.test(c)});for(const{children:f}of l)for(const{children:c}of f)for(const{children:p}of c)e.has(p)&&e.delete(p)}else if(n.type===t.SELECTOR_PSEUDO_ELEMENT&&t.REG_SHADOW_PSEUDO.test(n.name)){const l=o.filter(f=>{const{name:c,type:p}=f;return p===t.SELECTOR_PSEUDO_ELEMENT&&t.REG_SHADOW_PSEUDO.test(c)});for(const{children:f}of l)for(const{children:c}of f)e.has(c)&&e.delete(c)}}}),[...e]};0&&(module.exports={generateCSS,parseSelector,preprocess,unescapeSelector,walkAST});
|
||||
//# sourceMappingURL=parser.js.map
|
||||
+7
File diff suppressed because one or more lines are too long
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
Reference in New Issue
Block a user