ipx 4.0.0-beta.1 → 4.0.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/README.md +222 -209
- package/dist/THIRD-PARTY-LICENSES.md.gz +0 -0
- package/dist/_chunks/libs/@fastify/accept-negotiator.mjs +22 -23
- package/dist/_chunks/libs/css-select.mjs +1077 -937
- package/dist/_chunks/libs/css-tree.mjs +107 -191
- package/dist/_chunks/libs/csso.mjs +50 -82
- package/dist/_chunks/libs/h3.mjs +107 -106
- package/dist/_chunks/libs/image-meta.d.mts +2 -2
- package/dist/_chunks/libs/image-meta.mjs +464 -305
- package/dist/_chunks/libs/sax.mjs +61 -60
- package/dist/_chunks/libs/svgo.mjs +933 -1008
- package/dist/_chunks/node-fs.mjs +125 -49
- package/dist/_chunks/rolldown-runtime.mjs +2 -11
- package/dist/cli.mjs +4 -3
- package/dist/index.d.mts +64 -11
- package/package.json +30 -29
- package/dist/THIRD-PARTY-LICENSES.md +0 -593
|
@@ -3,7 +3,7 @@ var n = e(((e) => {
|
|
|
3
3
|
(function(e) {
|
|
4
4
|
e.parser = function(e, t) {
|
|
5
5
|
return new r(e, t);
|
|
6
|
-
}, e.SAXParser = r, e.SAXStream = d, e.createStream = l, e.MAX_BUFFER_LENGTH =
|
|
6
|
+
}, e.SAXParser = r, e.SAXStream = d, e.createStream = l, e.MAX_BUFFER_LENGTH = 65536;
|
|
7
7
|
var n = [
|
|
8
8
|
`comment`,
|
|
9
9
|
`sgmlDecl`,
|
|
@@ -501,7 +501,7 @@ var n = e(((e) => {
|
|
|
501
501
|
return !n || !r ? !0 : r === `utf16` ? n === `utf16le` || n === `utf16be` : n === r;
|
|
502
502
|
}
|
|
503
503
|
function M(e, t) {
|
|
504
|
-
if (
|
|
504
|
+
if (e.strict && e.encoding && t && t.name === `xml`) {
|
|
505
505
|
var n = k(t.body);
|
|
506
506
|
n && !j(e.encoding, n) && R(e, `XML declaration encoding ` + n + ` does not match detected stream encoding ` + e.encoding.toUpperCase());
|
|
507
507
|
}
|
|
@@ -544,26 +544,27 @@ Char: ` + e.c), t = Error(t), e.error = t, O(e, `onerror`, t), e;
|
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
546
|
function V(e) {
|
|
547
|
-
if (e.strict || (e.attribName = e.attribName[e.looseCase]()), e.attribList.indexOf(e.attribName) !== -1 || e.tag.attributes.hasOwnProperty(e.attribName))
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
if (n === `xmlns`) if (r === `xml` && e.attribValue !== m) R(e, `xml: prefix must be bound to ` + m + `
|
|
547
|
+
if (e.strict || (e.attribName = e.attribName[e.looseCase]()), e.attribList.indexOf(e.attribName) !== -1 || e.tag.attributes.hasOwnProperty(e.attribName)) e.attribName = e.attribValue = ``;
|
|
548
|
+
else {
|
|
549
|
+
if (e.opt.xmlns) {
|
|
550
|
+
var t = B(e.attribName, !0), n = t.prefix, r = t.local;
|
|
551
|
+
if (n === `xmlns`) {
|
|
552
|
+
if (r === `xml` && e.attribValue !== m) R(e, `xml: prefix must be bound to ` + m + `
|
|
554
553
|
Actual: ` + e.attribValue);
|
|
555
|
-
|
|
554
|
+
else if (r === `xmlns` && e.attribValue !== h) R(e, `xmlns: prefix must be bound to ` + h + `
|
|
556
555
|
Actual: ` + e.attribValue);
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
556
|
+
else {
|
|
557
|
+
var i = e.tag, a = e.tags[e.tags.length - 1] || e;
|
|
558
|
+
i.ns === a.ns && (i.ns = Object.create(a.ns)), i.ns[r] = e.attribValue;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
e.attribList.push([e.attribName, e.attribValue]);
|
|
562
|
+
} else e.tag.attributes[e.attribName] = e.attribValue, N(e, `onattribute`, {
|
|
563
|
+
name: e.attribName,
|
|
564
|
+
value: e.attribValue
|
|
565
|
+
});
|
|
566
|
+
e.attribName = e.attribValue = ``;
|
|
567
|
+
}
|
|
567
568
|
}
|
|
568
569
|
function H(e, t) {
|
|
569
570
|
if (e.opt.xmlns) {
|
|
@@ -591,40 +592,38 @@ Actual: ` + e.attribValue);
|
|
|
591
592
|
e.tag.isSelfClosing = !!t, e.sawRoot = !0, e.tags.push(e.tag), N(e, `onopentag`, e.tag), t || (e.state = !e.noscript && e.tagName.toLowerCase() === `script` ? E.SCRIPT : E.TEXT, e.tag = null, e.tagName = ``), e.attribName = e.attribValue = ``, e.attribList.length = 0;
|
|
592
593
|
}
|
|
593
594
|
function U(e) {
|
|
594
|
-
if (!e.tagName)
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
595
|
+
if (!e.tagName) R(e, `Weird empty close tag.`), e.textNode += `</>`, e.state = E.TEXT;
|
|
596
|
+
else {
|
|
597
|
+
if (e.script) {
|
|
598
|
+
if (e.tagName !== `script`) {
|
|
599
|
+
e.script += `</` + e.tagName + `>`, e.tagName = ``, e.state = E.SCRIPT;
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
N(e, `onscript`, e.script), e.script = ``;
|
|
603
|
+
}
|
|
604
|
+
var t = e.tags.length, n = e.tagName;
|
|
605
|
+
e.strict || (n = n[e.looseCase]());
|
|
606
|
+
for (var r = n; t-- && e.tags[t].name !== r;) R(e, `Unexpected close tag`);
|
|
607
|
+
if (t < 0) R(e, `Unmatched closing tag: ` + e.tagName), e.textNode += `</` + e.tagName + `>`, e.state = E.TEXT;
|
|
608
|
+
else {
|
|
609
|
+
e.tagName = n;
|
|
610
|
+
for (var i = e.tags.length; i-- > t;) {
|
|
611
|
+
var a = e.tag = e.tags.pop();
|
|
612
|
+
e.tagName = e.tag.name, N(e, `onclosetag`, e.tagName);
|
|
613
|
+
var o = {};
|
|
614
|
+
for (var s in a.ns) o[s] = a.ns[s];
|
|
615
|
+
var c = e.tags[e.tags.length - 1] || e;
|
|
616
|
+
e.opt.xmlns && a.ns !== c.ns && Object.keys(a.ns).forEach(function(t) {
|
|
617
|
+
var n = a.ns[t];
|
|
618
|
+
N(e, `onclosenamespace`, {
|
|
619
|
+
prefix: t,
|
|
620
|
+
uri: n
|
|
621
|
+
});
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
t === 0 && (e.closedRoot = !0), e.tagName = e.attribValue = e.attribName = ``, e.attribList.length = 0, e.state = E.TEXT;
|
|
602
625
|
}
|
|
603
|
-
N(e, `onscript`, e.script), e.script = ``;
|
|
604
|
-
}
|
|
605
|
-
var t = e.tags.length, n = e.tagName;
|
|
606
|
-
e.strict || (n = n[e.looseCase]());
|
|
607
|
-
for (var r = n; t-- && e.tags[t].name !== r;) R(e, `Unexpected close tag`);
|
|
608
|
-
if (t < 0) {
|
|
609
|
-
R(e, `Unmatched closing tag: ` + e.tagName), e.textNode += `</` + e.tagName + `>`, e.state = E.TEXT;
|
|
610
|
-
return;
|
|
611
|
-
}
|
|
612
|
-
e.tagName = n;
|
|
613
|
-
for (var i = e.tags.length; i-- > t;) {
|
|
614
|
-
var a = e.tag = e.tags.pop();
|
|
615
|
-
e.tagName = e.tag.name, N(e, `onclosetag`, e.tagName);
|
|
616
|
-
var o = {};
|
|
617
|
-
for (var s in a.ns) o[s] = a.ns[s];
|
|
618
|
-
var c = e.tags[e.tags.length - 1] || e;
|
|
619
|
-
e.opt.xmlns && a.ns !== c.ns && Object.keys(a.ns).forEach(function(t) {
|
|
620
|
-
var n = a.ns[t];
|
|
621
|
-
N(e, `onclosenamespace`, {
|
|
622
|
-
prefix: t,
|
|
623
|
-
uri: n
|
|
624
|
-
});
|
|
625
|
-
});
|
|
626
626
|
}
|
|
627
|
-
t === 0 && (e.closedRoot = !0), e.tagName = e.attribValue = e.attribName = ``, e.attribList.length = 0, e.state = E.TEXT;
|
|
628
627
|
}
|
|
629
628
|
function W(e) {
|
|
630
629
|
var t = e.entity, n = t.toLowerCase(), r, i = ``;
|
|
@@ -671,15 +670,17 @@ Actual: ` + e.attribValue);
|
|
|
671
670
|
continue;
|
|
672
671
|
case E.OPEN_WAKA:
|
|
673
672
|
if (a === `!`) n.state = E.SGML_DECL, n.sgmlDecl = ``;
|
|
674
|
-
else if (!x(a))
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
673
|
+
else if (!x(a)) {
|
|
674
|
+
if (w(_, a)) n.state = E.OPEN_TAG, n.tagName = a;
|
|
675
|
+
else if (a === `/`) n.state = E.CLOSE_TAG, n.tagName = ``;
|
|
676
|
+
else if (a === `?`) n.state = E.PROC_INST, n.procInstName = n.procInstBody = ``;
|
|
677
|
+
else {
|
|
678
|
+
if (R(n, `Unencoded <`), n.startTagPosition + 1 < n.position) {
|
|
679
|
+
var s = n.position - n.startTagPosition;
|
|
680
|
+
a = Array(s).join(` `) + a;
|
|
681
|
+
}
|
|
682
|
+
n.textNode += `<` + a, n.state = E.TEXT;
|
|
681
683
|
}
|
|
682
|
-
n.textNode += `<` + a, n.state = E.TEXT;
|
|
683
684
|
}
|
|
684
685
|
continue;
|
|
685
686
|
case E.SGML_DECL:
|