@stacksjs/stx 0.2.81 → 0.2.83
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/app-shell.js +15 -5
- package/dist/build-assets.js +13 -3
- package/dist/build-mode-detector.js +16 -6
- package/dist/build-views.js +16 -6
- package/dist/build.js +15 -5
- package/dist/caching.js +13 -3
- package/dist/cli.js +16 -6
- package/dist/component-processing.js +15 -5
- package/dist/component-renderer.js +15 -5
- package/dist/components.js +16 -6
- package/dist/dev-server/index.js +16 -6
- package/dist/dev-server/serve-app.js +15 -5
- package/dist/dev-server/serve-file.js +15 -5
- package/dist/dev-server/serve-markdown.js +16 -6
- package/dist/dev-server/serve-multi.js +15 -5
- package/dist/dev-server.js +15 -5
- package/dist/docs.js +16 -6
- package/dist/dynamic-components.js +15 -5
- package/dist/includes.js +15 -5
- package/dist/index.js +15 -5
- package/dist/interactive.js +16 -6
- package/dist/lazy-loader.js +91 -81
- package/dist/plugin.js +15 -5
- package/dist/process.js +15 -5
- package/dist/production-builder.js +15 -5
- package/dist/production-server.js +15 -5
- package/dist/pwa/index.js +16 -6
- package/dist/pwa/offline.js +16 -6
- package/dist/pwa.js +15 -5
- package/dist/reactive.js +1 -1
- package/dist/render.js +16 -6
- package/dist/runtime-injection.js +13 -3
- package/dist/serve.js +16 -6
- package/dist/signal-processing.js +35 -25
- package/dist/signals.js +13 -3
- package/dist/site-builder/build.js +16 -6
- package/dist/site-builder/index.js +16 -6
- package/dist/ssg.js +15 -5
- package/dist/ssr.js +16 -6
- package/dist/store-loader.js +18 -18
- package/dist/story/cli.js +15 -5
- package/dist/story/commands/dev.js +16 -6
- package/dist/story/commands/index.js +16 -6
- package/dist/story/index.js +16 -6
- package/dist/story/renderer.js +16 -6
- package/dist/story/server.js +16 -6
- package/dist/story/visual-testing.js +16 -6
- package/dist/streaming.js +15 -5
- package/dist/template-compiler.js +16 -6
- package/dist/template-hydrator.js +16 -6
- package/dist/template-tag-balance.js +1 -1
- package/dist/testing.js +140 -130
- package/dist/utils.js +15 -5
- package/dist/web-components.js +16 -6
- package/package.json +5 -5
package/dist/plugin.js
CHANGED
|
@@ -2664,7 +2664,7 @@ window.__stx_reactive = (function() {
|
|
|
2664
2664
|
|
|
2665
2665
|
return { initScope: initScope, reactive: reactive };
|
|
2666
2666
|
})();
|
|
2667
|
-
`}function ZY($,Z){let X=$.replace(/\{!!([\s\S]*?)!!\}/g,(Y,Q)=>{try{let J=f0(Q,Z,!0);if(J===void 0)return Y;return String(J)}catch{return Y}});return X=X.replace(/\{\{([\s\S]*?)\}\}/g,(Y,Q)=>{try{let J=f0(Q,Z,!0);if(J===void 0)return Y;return JSON.stringify(J)}catch{return Y}}),X}function xU($,Z){if($.length===0)return"";let X=$.map((Y)=>{let Q=JSON.stringify(Object.fromEntries(Y.refs)),J=ZY(Y.stateExpr,Z),G=Y.initExpr?ZY(Y.initExpr,Z):null,K=JSON.stringify(J),W=G?JSON.stringify(G):"null";return`
|
|
2667
|
+
`}function ZY($,Z){let X=$.replace(/\{!!([\s\S]*?)!!\}/g,(Y,Q)=>{try{let J=f0(Q,Z,!0);if(J===void 0)return Y;return String(J)}catch{return Y}});return X=X.replace(/\{\{([\s\S]*?)\}\}/g,(Y,Q)=>{try{let J=f0(Q,Z,!0);if(J===void 0)return Y;if(typeof J==="string"){let G=J.trim();if(G.startsWith("{")&&G.endsWith("}")||G.startsWith("[")&&G.endsWith("]"))try{return JSON.parse(G),G}catch{}}return JSON.stringify(J)}catch{return Y}}),X}function xU($,Z){if($.length===0)return"";let X=$.map((Y)=>{let Q=JSON.stringify(Object.fromEntries(Y.refs)),J=ZY(Y.stateExpr,Z),G=Y.initExpr?ZY(Y.initExpr,Z):null,K=JSON.stringify(J),W=G?JSON.stringify(G):"null";return`
|
|
2668
2668
|
(function() {
|
|
2669
2669
|
var scopeEl = document.querySelector('${Y.selector}');
|
|
2670
2670
|
if (!scopeEl) return;
|
|
@@ -4735,6 +4735,13 @@ catch (e2) {
|
|
|
4735
4735
|
|
|
4736
4736
|
// Known directive names to exclude from generic :attr binding
|
|
4737
4737
|
var DIRECTIVE_NAMES = {class:1, style:1, text:1, html:1, show:1, model:1, 'if':1, 'for':1, ref:1};
|
|
4738
|
+
// SVG attributes are case-sensitive, but the HTML parser lowercases
|
|
4739
|
+
// prefixed attribute names \u2014 ':viewBox' arrives as ':viewbox' because
|
|
4740
|
+
// the spec's "adjust SVG attributes" step only covers unprefixed names.
|
|
4741
|
+
// Without restoring the canonical casing, setAttribute('viewbox') creates
|
|
4742
|
+
// a dead duplicate attribute and the real viewBox never updates.
|
|
4743
|
+
var SVG_ATTR_CASE = {attributename:'attributeName', attributetype:'attributeType', basefrequency:'baseFrequency', baseprofile:'baseProfile', calcmode:'calcMode', clippathunits:'clipPathUnits', diffuseconstant:'diffuseConstant', edgemode:'edgeMode', filterunits:'filterUnits', glyphref:'glyphRef', gradienttransform:'gradientTransform', gradientunits:'gradientUnits', kernelmatrix:'kernelMatrix', kernelunitlength:'kernelUnitLength', keypoints:'keyPoints', keysplines:'keySplines', keytimes:'keyTimes', lengthadjust:'lengthAdjust', limitingconeangle:'limitingConeAngle', markerheight:'markerHeight', markerunits:'markerUnits', markerwidth:'markerWidth', maskcontentunits:'maskContentUnits', maskunits:'maskUnits', numoctaves:'numOctaves', pathlength:'pathLength', patterncontentunits:'patternContentUnits', patterntransform:'patternTransform', patternunits:'patternUnits', pointsatx:'pointsAtX', pointsaty:'pointsAtY', pointsatz:'pointsAtZ', preservealpha:'preserveAlpha', preserveaspectratio:'preserveAspectRatio', primitiveunits:'primitiveUnits', refx:'refX', refy:'refY', repeatcount:'repeatCount', repeatdur:'repeatDur', requiredextensions:'requiredExtensions', requiredfeatures:'requiredFeatures', specularconstant:'specularConstant', specularexponent:'specularExponent', spreadmethod:'spreadMethod', startoffset:'startOffset', stddeviation:'stdDeviation', stitchtiles:'stitchTiles', surfacescale:'surfaceScale', systemlanguage:'systemLanguage', tablevalues:'tableValues', targetx:'targetX', targety:'targetY', textlength:'textLength', viewbox:'viewBox', viewtarget:'viewTarget', xchannelselector:'xChannelSelector', ychannelselector:'yChannelSelector', zoomandpan:'zoomAndPan'};
|
|
4744
|
+
var SVG_NS = 'http://www.w3.org/2000/svg';
|
|
4738
4745
|
var EVENT_RE = /^(click|dblclick|mousedown|mouseup|mousemove|mouseenter|mouseleave|keydown|keyup|keypress|input|change|submit|focus|blur|scroll|resize|touchstart|touchend|touchmove|contextmenu|wheel|pointerdown|pointerup|pointermove)/;
|
|
4739
4746
|
var KEY_MAP = {enter:'Enter', tab:'Tab', escape:'Escape', space:' ', up:'ArrowUp', down:'ArrowDown', left:'ArrowLeft', right:'ArrowRight', 'delete':'Delete', backspace:'Backspace'};
|
|
4740
4747
|
|
|
@@ -4759,7 +4766,8 @@ catch (e2) {
|
|
|
4759
4766
|
if (name.startsWith('@bind:') || name.startsWith('x-bind:')
|
|
4760
4767
|
|| (name.startsWith(':') && !name.startsWith('::') && !DIRECTIVE_NAMES[name.slice(1).split('.')[0]] && !EVENT_RE.test(name.slice(1)))
|
|
4761
4768
|
|| (name.startsWith('x-') && !X_HANDLED[name.split('.')[0]] && !X_HANDLED[name])) {
|
|
4762
|
-
|
|
4769
|
+
let attrName = name.startsWith('@bind:') ? name.slice(6) : name.startsWith('x-bind:') ? name.slice(7) : name.startsWith('x-') ? name.slice(2) : name.slice(1);
|
|
4770
|
+
if (el.namespaceURI === SVG_NS && SVG_ATTR_CASE[attrName]) attrName = SVG_ATTR_CASE[attrName];
|
|
4763
4771
|
effect(() => {
|
|
4764
4772
|
const v = evalAttrExpr(value);
|
|
4765
4773
|
if (v === false || v === null || v === undefined) {
|
|
@@ -5138,10 +5146,12 @@ else {
|
|
|
5138
5146
|
});
|
|
5139
5147
|
}
|
|
5140
5148
|
else if (Array.isArray(value)) {
|
|
5141
|
-
|
|
5149
|
+
var _clsArr = originalClasses + ' ' + value.filter(Boolean).join(' ');
|
|
5150
|
+
if (typeof el.className === 'string') el.className = _clsArr; else el.setAttribute('class', _clsArr);
|
|
5142
5151
|
}
|
|
5143
5152
|
else {
|
|
5144
|
-
|
|
5153
|
+
var _clsStr = originalClasses + (value ? ' ' + value : '');
|
|
5154
|
+
if (typeof el.className === 'string') el.className = _clsStr; else el.setAttribute('class', _clsStr);
|
|
5145
5155
|
}
|
|
5146
5156
|
});
|
|
5147
5157
|
}
|
|
@@ -8274,7 +8284,7 @@ ${z}${U}
|
|
|
8274
8284
|
return { ${_} };
|
|
8275
8285
|
}
|
|
8276
8286
|
if(window.stx)window.stx._latestSetup=${G};
|
|
8277
|
-
</script>`,j=$;for(let H of J)j=j.split(H.fullMatch).join("");if(j.includes("<body"))j=j.replace(/<body([^>]*)>/,`<body$1 data-stx="${G}">`);else{let H=["script","style","html","head","meta","link","title","!doctype"];j=j.replace(/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*)>/
|
|
8287
|
+
</script>`,j=$;for(let H of J)j=j.split(H.fullMatch).join("");if(j.includes("<body"))j=j.replace(/<body([^>]*)>/,`<body$1 data-stx="${G}">`);else{let H=["script","style","html","head","meta","link","title","!doctype"],L=!1;j=j.replace(/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*)>/gi,(F,O,V)=>{if(L||H.includes(O.toLowerCase()))return F;return L=!0,`<${O}${V} data-stx="${G}">`})}return{output:j,setupCode:q}}function Y2($){let Z=$,X=[],Y=new Set,Q=0,J=0,G=Z.length,K="",W=()=>{J++;let j=!1;while(J<G){let H=Z[J];if(H==="\\"){J+=2;continue}if(H==="["&&!j){j=!0,J++;continue}if(H==="]"&&j){j=!1,J++;continue}if(H==="/"&&!j){J++;while(J<G&&/[gimsuyd]/.test(Z[J]))J++;return}if(H===`
|
|
8278
8288
|
`)return;J++}},B=()=>{if(!K)return!0;if(/[\w)\]]/.test(K))return!1;return!0},U=(j)=>{J++;while(J<G){if(Z[J]==="\\"){J+=2;continue}if(Z[J]===j){J++;return}J++}},_=()=>{J++;while(J<G){if(Z[J]==="\\"){J+=2;continue}if(Z[J]==="`"){J++;return}if(Z[J]==="$"&&Z[J+1]==="{"){J+=2;let j=1;while(J<G&&j>0)if(Z[J]==="{")j++,J++;else if(Z[J]==="}")j--,J++;else if(Z[J]==="'"||Z[J]==='"')U(Z[J]);else if(Z[J]==="`")_();else J++;continue}J++}},z=()=>{if(Z[J]==="/"&&Z[J+1]==="/"){while(J<G&&Z[J]!==`
|
|
8279
8289
|
`)J++;return!0}if(Z[J]==="/"&&Z[J+1]==="*"){J+=2;while(J<G-1&&!(Z[J]==="*"&&Z[J+1]==="/"))J++;return J+=2,!0}return!1},q=()=>{if(Q!==0)return;let j=Z.slice(J).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(j){let V=j[2];if(!Y.has(V))X.push(V),Y.add(V);return}let H=Z.slice(J).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(H){H[1].split(",").forEach((V)=>{let N=V.trim();if(!N)return;let A=N.indexOf(":"),R=(A>=0?N.slice(A+1).trim():N).split(/[\s=]/)[0];if(R&&!Y.has(R))X.push(R),Y.add(R)});return}let L=Z.slice(J).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(L){L[1].split(",").forEach((V)=>{let N=V.trim().replace(/^\.\.\./,"");if(!N)return;let A=N.split(/[\s=]/)[0];if(A&&!Y.has(A))X.push(A),Y.add(A)});return}let F=Z.slice(J).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(F){let V=F[1];if(!Y.has(V))X.push(V),Y.add(V);return}let O=Z.slice(J).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let V=O[1];if(!Y.has(V))X.push(V),Y.add(V)}};while(J<G){if(z())continue;if(Z[J]==="'"||Z[J]==='"'){U(Z[J]),K=Z[J-1];continue}if(Z[J]==="`"){_(),K="`";continue}if(Z[J]==="/"&&Z[J+1]!=="/"&&Z[J+1]!=="*"&&B()){W(),K="/";continue}if(Z[J]==="{"){Q++,K="{",J++;continue}if(Z[J]==="}"){Q--,K="}",J++;continue}if(Q===0&&/[a-z]/i.test(Z[J])&&(J===0||/\s|[;{}()]/.test(Z[J-1])))q();if(!/\s/.test(Z[J]))K=Z[J];J++}return X.join(", ")}async function K8($,Z,X,Y){if(!J4($))return $;let Q=$;if(Z.skipSignalsRuntime)return Q;let{output:J,setupCode:G}=await X2(Q,X,Y);if(Q=J,Q=await sJ(Q,Z),Q=rJ(Q),G)if(Q.includes("</head>"))Q=Q.replace("</head>",`${G}
|
|
8280
8290
|
</head>`);else if(Q.includes("<body"))Q=Q.replace(/<body([^>]*)>/,`<body$1>
|
package/dist/process.js
CHANGED
|
@@ -2498,7 +2498,7 @@ window.__stx_reactive = (function() {
|
|
|
2498
2498
|
|
|
2499
2499
|
return { initScope: initScope, reactive: reactive };
|
|
2500
2500
|
})();
|
|
2501
|
-
`}function m8($,Z){let Y=$.replace(/\{!!([\s\S]*?)!!\}/g,(X,Q)=>{try{let J=x0(Q,Z,!0);if(J===void 0)return X;return String(J)}catch{return X}});return Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(X,Q)=>{try{let J=x0(Q,Z,!0);if(J===void 0)return X;return JSON.stringify(J)}catch{return X}}),Y}function zK($,Z){if($.length===0)return"";let Y=$.map((X)=>{let Q=JSON.stringify(Object.fromEntries(X.refs)),J=m8(X.stateExpr,Z),G=X.initExpr?m8(X.initExpr,Z):null,K=JSON.stringify(J),q=G?JSON.stringify(G):"null";return`
|
|
2501
|
+
`}function m8($,Z){let Y=$.replace(/\{!!([\s\S]*?)!!\}/g,(X,Q)=>{try{let J=x0(Q,Z,!0);if(J===void 0)return X;return String(J)}catch{return X}});return Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(X,Q)=>{try{let J=x0(Q,Z,!0);if(J===void 0)return X;if(typeof J==="string"){let G=J.trim();if(G.startsWith("{")&&G.endsWith("}")||G.startsWith("[")&&G.endsWith("]"))try{return JSON.parse(G),G}catch{}}return JSON.stringify(J)}catch{return X}}),Y}function zK($,Z){if($.length===0)return"";let Y=$.map((X)=>{let Q=JSON.stringify(Object.fromEntries(X.refs)),J=m8(X.stateExpr,Z),G=X.initExpr?m8(X.initExpr,Z):null,K=JSON.stringify(J),q=G?JSON.stringify(G):"null";return`
|
|
2502
2502
|
(function() {
|
|
2503
2503
|
var scopeEl = document.querySelector('${X.selector}');
|
|
2504
2504
|
if (!scopeEl) return;
|
|
@@ -4543,6 +4543,13 @@ catch (e2) {
|
|
|
4543
4543
|
|
|
4544
4544
|
// Known directive names to exclude from generic :attr binding
|
|
4545
4545
|
var DIRECTIVE_NAMES = {class:1, style:1, text:1, html:1, show:1, model:1, 'if':1, 'for':1, ref:1};
|
|
4546
|
+
// SVG attributes are case-sensitive, but the HTML parser lowercases
|
|
4547
|
+
// prefixed attribute names \u2014 ':viewBox' arrives as ':viewbox' because
|
|
4548
|
+
// the spec's "adjust SVG attributes" step only covers unprefixed names.
|
|
4549
|
+
// Without restoring the canonical casing, setAttribute('viewbox') creates
|
|
4550
|
+
// a dead duplicate attribute and the real viewBox never updates.
|
|
4551
|
+
var SVG_ATTR_CASE = {attributename:'attributeName', attributetype:'attributeType', basefrequency:'baseFrequency', baseprofile:'baseProfile', calcmode:'calcMode', clippathunits:'clipPathUnits', diffuseconstant:'diffuseConstant', edgemode:'edgeMode', filterunits:'filterUnits', glyphref:'glyphRef', gradienttransform:'gradientTransform', gradientunits:'gradientUnits', kernelmatrix:'kernelMatrix', kernelunitlength:'kernelUnitLength', keypoints:'keyPoints', keysplines:'keySplines', keytimes:'keyTimes', lengthadjust:'lengthAdjust', limitingconeangle:'limitingConeAngle', markerheight:'markerHeight', markerunits:'markerUnits', markerwidth:'markerWidth', maskcontentunits:'maskContentUnits', maskunits:'maskUnits', numoctaves:'numOctaves', pathlength:'pathLength', patterncontentunits:'patternContentUnits', patterntransform:'patternTransform', patternunits:'patternUnits', pointsatx:'pointsAtX', pointsaty:'pointsAtY', pointsatz:'pointsAtZ', preservealpha:'preserveAlpha', preserveaspectratio:'preserveAspectRatio', primitiveunits:'primitiveUnits', refx:'refX', refy:'refY', repeatcount:'repeatCount', repeatdur:'repeatDur', requiredextensions:'requiredExtensions', requiredfeatures:'requiredFeatures', specularconstant:'specularConstant', specularexponent:'specularExponent', spreadmethod:'spreadMethod', startoffset:'startOffset', stddeviation:'stdDeviation', stitchtiles:'stitchTiles', surfacescale:'surfaceScale', systemlanguage:'systemLanguage', tablevalues:'tableValues', targetx:'targetX', targety:'targetY', textlength:'textLength', viewbox:'viewBox', viewtarget:'viewTarget', xchannelselector:'xChannelSelector', ychannelselector:'yChannelSelector', zoomandpan:'zoomAndPan'};
|
|
4552
|
+
var SVG_NS = 'http://www.w3.org/2000/svg';
|
|
4546
4553
|
var EVENT_RE = /^(click|dblclick|mousedown|mouseup|mousemove|mouseenter|mouseleave|keydown|keyup|keypress|input|change|submit|focus|blur|scroll|resize|touchstart|touchend|touchmove|contextmenu|wheel|pointerdown|pointerup|pointermove)/;
|
|
4547
4554
|
var KEY_MAP = {enter:'Enter', tab:'Tab', escape:'Escape', space:' ', up:'ArrowUp', down:'ArrowDown', left:'ArrowLeft', right:'ArrowRight', 'delete':'Delete', backspace:'Backspace'};
|
|
4548
4555
|
|
|
@@ -4567,7 +4574,8 @@ catch (e2) {
|
|
|
4567
4574
|
if (name.startsWith('@bind:') || name.startsWith('x-bind:')
|
|
4568
4575
|
|| (name.startsWith(':') && !name.startsWith('::') && !DIRECTIVE_NAMES[name.slice(1).split('.')[0]] && !EVENT_RE.test(name.slice(1)))
|
|
4569
4576
|
|| (name.startsWith('x-') && !X_HANDLED[name.split('.')[0]] && !X_HANDLED[name])) {
|
|
4570
|
-
|
|
4577
|
+
let attrName = name.startsWith('@bind:') ? name.slice(6) : name.startsWith('x-bind:') ? name.slice(7) : name.startsWith('x-') ? name.slice(2) : name.slice(1);
|
|
4578
|
+
if (el.namespaceURI === SVG_NS && SVG_ATTR_CASE[attrName]) attrName = SVG_ATTR_CASE[attrName];
|
|
4571
4579
|
effect(() => {
|
|
4572
4580
|
const v = evalAttrExpr(value);
|
|
4573
4581
|
if (v === false || v === null || v === undefined) {
|
|
@@ -4946,10 +4954,12 @@ else {
|
|
|
4946
4954
|
});
|
|
4947
4955
|
}
|
|
4948
4956
|
else if (Array.isArray(value)) {
|
|
4949
|
-
|
|
4957
|
+
var _clsArr = originalClasses + ' ' + value.filter(Boolean).join(' ');
|
|
4958
|
+
if (typeof el.className === 'string') el.className = _clsArr; else el.setAttribute('class', _clsArr);
|
|
4950
4959
|
}
|
|
4951
4960
|
else {
|
|
4952
|
-
|
|
4961
|
+
var _clsStr = originalClasses + (value ? ' ' + value : '');
|
|
4962
|
+
if (typeof el.className === 'string') el.className = _clsStr; else el.setAttribute('class', _clsStr);
|
|
4953
4963
|
}
|
|
4954
4964
|
});
|
|
4955
4965
|
}
|
|
@@ -8082,7 +8092,7 @@ ${_}${z}
|
|
|
8082
8092
|
return { ${U} };
|
|
8083
8093
|
}
|
|
8084
8094
|
if(window.stx)window.stx._latestSetup=${G};
|
|
8085
|
-
</script>`,j=$;for(let H of J)j=j.split(H.fullMatch).join("");if(j.includes("<body"))j=j.replace(/<body([^>]*)>/,`<body$1 data-stx="${G}">`);else{let H=["script","style","html","head","meta","link","title","!doctype"];j=j.replace(/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*)>/
|
|
8095
|
+
</script>`,j=$;for(let H of J)j=j.split(H.fullMatch).join("");if(j.includes("<body"))j=j.replace(/<body([^>]*)>/,`<body$1 data-stx="${G}">`);else{let H=["script","style","html","head","meta","link","title","!doctype"],L=!1;j=j.replace(/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*)>/gi,(F,O,V)=>{if(L||H.includes(O.toLowerCase()))return F;return L=!0,`<${O}${V} data-stx="${G}">`})}return{output:j,setupCode:B}}function l2($){let Z=$,Y=[],X=new Set,Q=0,J=0,G=Z.length,K="",q=()=>{J++;let j=!1;while(J<G){let H=Z[J];if(H==="\\"){J+=2;continue}if(H==="["&&!j){j=!0,J++;continue}if(H==="]"&&j){j=!1,J++;continue}if(H==="/"&&!j){J++;while(J<G&&/[gimsuyd]/.test(Z[J]))J++;return}if(H===`
|
|
8086
8096
|
`)return;J++}},W=()=>{if(!K)return!0;if(/[\w)\]]/.test(K))return!1;return!0},z=(j)=>{J++;while(J<G){if(Z[J]==="\\"){J+=2;continue}if(Z[J]===j){J++;return}J++}},U=()=>{J++;while(J<G){if(Z[J]==="\\"){J+=2;continue}if(Z[J]==="`"){J++;return}if(Z[J]==="$"&&Z[J+1]==="{"){J+=2;let j=1;while(J<G&&j>0)if(Z[J]==="{")j++,J++;else if(Z[J]==="}")j--,J++;else if(Z[J]==="'"||Z[J]==='"')z(Z[J]);else if(Z[J]==="`")U();else J++;continue}J++}},_=()=>{if(Z[J]==="/"&&Z[J+1]==="/"){while(J<G&&Z[J]!==`
|
|
8087
8097
|
`)J++;return!0}if(Z[J]==="/"&&Z[J+1]==="*"){J+=2;while(J<G-1&&!(Z[J]==="*"&&Z[J+1]==="/"))J++;return J+=2,!0}return!1},B=()=>{if(Q!==0)return;let j=Z.slice(J).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(j){let V=j[2];if(!X.has(V))Y.push(V),X.add(V);return}let H=Z.slice(J).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(H){H[1].split(",").forEach((V)=>{let w=V.trim();if(!w)return;let A=w.indexOf(":"),N=(A>=0?w.slice(A+1).trim():w).split(/[\s=]/)[0];if(N&&!X.has(N))Y.push(N),X.add(N)});return}let L=Z.slice(J).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(L){L[1].split(",").forEach((V)=>{let w=V.trim().replace(/^\.\.\./,"");if(!w)return;let A=w.split(/[\s=]/)[0];if(A&&!X.has(A))Y.push(A),X.add(A)});return}let F=Z.slice(J).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(F){let V=F[1];if(!X.has(V))Y.push(V),X.add(V);return}let O=Z.slice(J).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let V=O[1];if(!X.has(V))Y.push(V),X.add(V)}};while(J<G){if(_())continue;if(Z[J]==="'"||Z[J]==='"'){z(Z[J]),K=Z[J-1];continue}if(Z[J]==="`"){U(),K="`";continue}if(Z[J]==="/"&&Z[J+1]!=="/"&&Z[J+1]!=="*"&&W()){q(),K="/";continue}if(Z[J]==="{"){Q++,K="{",J++;continue}if(Z[J]==="}"){Q--,K="}",J++;continue}if(Q===0&&/[a-z]/i.test(Z[J])&&(J===0||/\s|[;{}()]/.test(Z[J-1])))B();if(!/\s/.test(Z[J]))K=Z[J];J++}return Y.join(", ")}async function b3($,Z,Y,X){if(!J4($))return $;let Q=$;if(Z.skipSignalsRuntime)return Q;let{output:J,setupCode:G}=await p2(Q,Y,X);if(Q=J,Q=await x2(Q,Z),Q=v2(Q),G)if(Q.includes("</head>"))Q=Q.replace("</head>",`${G}
|
|
8088
8098
|
</head>`);else if(Q.includes("<body"))Q=Q.replace(/<body([^>]*)>/,`<body$1>
|
|
@@ -1703,6 +1703,13 @@ catch (e2) {
|
|
|
1703
1703
|
|
|
1704
1704
|
// Known directive names to exclude from generic :attr binding
|
|
1705
1705
|
var DIRECTIVE_NAMES = {class:1, style:1, text:1, html:1, show:1, model:1, 'if':1, 'for':1, ref:1};
|
|
1706
|
+
// SVG attributes are case-sensitive, but the HTML parser lowercases
|
|
1707
|
+
// prefixed attribute names \u2014 ':viewBox' arrives as ':viewbox' because
|
|
1708
|
+
// the spec's "adjust SVG attributes" step only covers unprefixed names.
|
|
1709
|
+
// Without restoring the canonical casing, setAttribute('viewbox') creates
|
|
1710
|
+
// a dead duplicate attribute and the real viewBox never updates.
|
|
1711
|
+
var SVG_ATTR_CASE = {attributename:'attributeName', attributetype:'attributeType', basefrequency:'baseFrequency', baseprofile:'baseProfile', calcmode:'calcMode', clippathunits:'clipPathUnits', diffuseconstant:'diffuseConstant', edgemode:'edgeMode', filterunits:'filterUnits', glyphref:'glyphRef', gradienttransform:'gradientTransform', gradientunits:'gradientUnits', kernelmatrix:'kernelMatrix', kernelunitlength:'kernelUnitLength', keypoints:'keyPoints', keysplines:'keySplines', keytimes:'keyTimes', lengthadjust:'lengthAdjust', limitingconeangle:'limitingConeAngle', markerheight:'markerHeight', markerunits:'markerUnits', markerwidth:'markerWidth', maskcontentunits:'maskContentUnits', maskunits:'maskUnits', numoctaves:'numOctaves', pathlength:'pathLength', patterncontentunits:'patternContentUnits', patterntransform:'patternTransform', patternunits:'patternUnits', pointsatx:'pointsAtX', pointsaty:'pointsAtY', pointsatz:'pointsAtZ', preservealpha:'preserveAlpha', preserveaspectratio:'preserveAspectRatio', primitiveunits:'primitiveUnits', refx:'refX', refy:'refY', repeatcount:'repeatCount', repeatdur:'repeatDur', requiredextensions:'requiredExtensions', requiredfeatures:'requiredFeatures', specularconstant:'specularConstant', specularexponent:'specularExponent', spreadmethod:'spreadMethod', startoffset:'startOffset', stddeviation:'stdDeviation', stitchtiles:'stitchTiles', surfacescale:'surfaceScale', systemlanguage:'systemLanguage', tablevalues:'tableValues', targetx:'targetX', targety:'targetY', textlength:'textLength', viewbox:'viewBox', viewtarget:'viewTarget', xchannelselector:'xChannelSelector', ychannelselector:'yChannelSelector', zoomandpan:'zoomAndPan'};
|
|
1712
|
+
var SVG_NS = 'http://www.w3.org/2000/svg';
|
|
1706
1713
|
var EVENT_RE = /^(click|dblclick|mousedown|mouseup|mousemove|mouseenter|mouseleave|keydown|keyup|keypress|input|change|submit|focus|blur|scroll|resize|touchstart|touchend|touchmove|contextmenu|wheel|pointerdown|pointerup|pointermove)/;
|
|
1707
1714
|
var KEY_MAP = {enter:'Enter', tab:'Tab', escape:'Escape', space:' ', up:'ArrowUp', down:'ArrowDown', left:'ArrowLeft', right:'ArrowRight', 'delete':'Delete', backspace:'Backspace'};
|
|
1708
1715
|
|
|
@@ -1727,7 +1734,8 @@ catch (e2) {
|
|
|
1727
1734
|
if (name.startsWith('@bind:') || name.startsWith('x-bind:')
|
|
1728
1735
|
|| (name.startsWith(':') && !name.startsWith('::') && !DIRECTIVE_NAMES[name.slice(1).split('.')[0]] && !EVENT_RE.test(name.slice(1)))
|
|
1729
1736
|
|| (name.startsWith('x-') && !X_HANDLED[name.split('.')[0]] && !X_HANDLED[name])) {
|
|
1730
|
-
|
|
1737
|
+
let attrName = name.startsWith('@bind:') ? name.slice(6) : name.startsWith('x-bind:') ? name.slice(7) : name.startsWith('x-') ? name.slice(2) : name.slice(1);
|
|
1738
|
+
if (el.namespaceURI === SVG_NS && SVG_ATTR_CASE[attrName]) attrName = SVG_ATTR_CASE[attrName];
|
|
1731
1739
|
effect(() => {
|
|
1732
1740
|
const v = evalAttrExpr(value);
|
|
1733
1741
|
if (v === false || v === null || v === undefined) {
|
|
@@ -2106,10 +2114,12 @@ else {
|
|
|
2106
2114
|
});
|
|
2107
2115
|
}
|
|
2108
2116
|
else if (Array.isArray(value)) {
|
|
2109
|
-
|
|
2117
|
+
var _clsArr = originalClasses + ' ' + value.filter(Boolean).join(' ');
|
|
2118
|
+
if (typeof el.className === 'string') el.className = _clsArr; else el.setAttribute('class', _clsArr);
|
|
2110
2119
|
}
|
|
2111
2120
|
else {
|
|
2112
|
-
|
|
2121
|
+
var _clsStr = originalClasses + (value ? ' ' + value : '');
|
|
2122
|
+
if (typeof el.className === 'string') el.className = _clsStr; else el.setAttribute('class', _clsStr);
|
|
2113
2123
|
}
|
|
2114
2124
|
});
|
|
2115
2125
|
}
|
|
@@ -7709,7 +7719,7 @@ window.__stx_reactive = (function() {
|
|
|
7709
7719
|
|
|
7710
7720
|
return { initScope: initScope, reactive: reactive };
|
|
7711
7721
|
})();
|
|
7712
|
-
`}function XZ($,Z){let Y=$.replace(/\{!!([\s\S]*?)!!\}/g,(X,Q)=>{try{let J=f0(Q,Z,!0);if(J===void 0)return X;return String(J)}catch{return X}});return Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(X,Q)=>{try{let J=f0(Q,Z,!0);if(J===void 0)return X;return JSON.stringify(J)}catch{return X}}),Y}function fK($,Z){if($.length===0)return"";let Y=$.map((X)=>{let Q=JSON.stringify(Object.fromEntries(X.refs)),J=XZ(X.stateExpr,Z),G=X.initExpr?XZ(X.initExpr,Z):null,K=JSON.stringify(J),q=G?JSON.stringify(G):"null";return`
|
|
7722
|
+
`}function XZ($,Z){let Y=$.replace(/\{!!([\s\S]*?)!!\}/g,(X,Q)=>{try{let J=f0(Q,Z,!0);if(J===void 0)return X;return String(J)}catch{return X}});return Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(X,Q)=>{try{let J=f0(Q,Z,!0);if(J===void 0)return X;if(typeof J==="string"){let G=J.trim();if(G.startsWith("{")&&G.endsWith("}")||G.startsWith("[")&&G.endsWith("]"))try{return JSON.parse(G),G}catch{}}return JSON.stringify(J)}catch{return X}}),Y}function fK($,Z){if($.length===0)return"";let Y=$.map((X)=>{let Q=JSON.stringify(Object.fromEntries(X.refs)),J=XZ(X.stateExpr,Z),G=X.initExpr?XZ(X.initExpr,Z):null,K=JSON.stringify(J),q=G?JSON.stringify(G):"null";return`
|
|
7713
7723
|
(function() {
|
|
7714
7724
|
var scopeEl = document.querySelector('${X.selector}');
|
|
7715
7725
|
if (!scopeEl) return;
|
|
@@ -8080,7 +8090,7 @@ ${B}${z}
|
|
|
8080
8090
|
return { ${U} };
|
|
8081
8091
|
}
|
|
8082
8092
|
if(window.stx)window.stx._latestSetup=${G};
|
|
8083
|
-
</script>`,j=$;for(let H of J)j=j.split(H.fullMatch).join("");if(j.includes("<body"))j=j.replace(/<body([^>]*)>/,`<body$1 data-stx="${G}">`);else{let H=["script","style","html","head","meta","link","title","!doctype"];j=j.replace(/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*)>/
|
|
8093
|
+
</script>`,j=$;for(let H of J)j=j.split(H.fullMatch).join("");if(j.includes("<body"))j=j.replace(/<body([^>]*)>/,`<body$1 data-stx="${G}">`);else{let H=["script","style","html","head","meta","link","title","!doctype"],F=!1;j=j.replace(/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*)>/gi,(L,O,V)=>{if(F||H.includes(O.toLowerCase()))return L;return F=!0,`<${O}${V} data-stx="${G}">`})}return{output:j,setupCode:_}}function JY($){let Z=$,Y=[],X=new Set,Q=0,J=0,G=Z.length,K="",q=()=>{J++;let j=!1;while(J<G){let H=Z[J];if(H==="\\"){J+=2;continue}if(H==="["&&!j){j=!0,J++;continue}if(H==="]"&&j){j=!1,J++;continue}if(H==="/"&&!j){J++;while(J<G&&/[gimsuyd]/.test(Z[J]))J++;return}if(H===`
|
|
8084
8094
|
`)return;J++}},W=()=>{if(!K)return!0;if(/[\w)\]]/.test(K))return!1;return!0},z=(j)=>{J++;while(J<G){if(Z[J]==="\\"){J+=2;continue}if(Z[J]===j){J++;return}J++}},U=()=>{J++;while(J<G){if(Z[J]==="\\"){J+=2;continue}if(Z[J]==="`"){J++;return}if(Z[J]==="$"&&Z[J+1]==="{"){J+=2;let j=1;while(J<G&&j>0)if(Z[J]==="{")j++,J++;else if(Z[J]==="}")j--,J++;else if(Z[J]==="'"||Z[J]==='"')z(Z[J]);else if(Z[J]==="`")U();else J++;continue}J++}},B=()=>{if(Z[J]==="/"&&Z[J+1]==="/"){while(J<G&&Z[J]!==`
|
|
8085
8095
|
`)J++;return!0}if(Z[J]==="/"&&Z[J+1]==="*"){J+=2;while(J<G-1&&!(Z[J]==="*"&&Z[J+1]==="/"))J++;return J+=2,!0}return!1},_=()=>{if(Q!==0)return;let j=Z.slice(J).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(j){let V=j[2];if(!X.has(V))Y.push(V),X.add(V);return}let H=Z.slice(J).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(H){H[1].split(",").forEach((V)=>{let w=V.trim();if(!w)return;let N=w.indexOf(":"),R=(N>=0?w.slice(N+1).trim():w).split(/[\s=]/)[0];if(R&&!X.has(R))Y.push(R),X.add(R)});return}let F=Z.slice(J).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(F){F[1].split(",").forEach((V)=>{let w=V.trim().replace(/^\.\.\./,"");if(!w)return;let N=w.split(/[\s=]/)[0];if(N&&!X.has(N))Y.push(N),X.add(N)});return}let L=Z.slice(J).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let V=L[1];if(!X.has(V))Y.push(V),X.add(V);return}let O=Z.slice(J).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let V=O[1];if(!X.has(V))Y.push(V),X.add(V)}};while(J<G){if(B())continue;if(Z[J]==="'"||Z[J]==='"'){z(Z[J]),K=Z[J-1];continue}if(Z[J]==="`"){U(),K="`";continue}if(Z[J]==="/"&&Z[J+1]!=="/"&&Z[J+1]!=="*"&&W()){q(),K="/";continue}if(Z[J]==="{"){Q++,K="{",J++;continue}if(Z[J]==="}"){Q--,K="}",J++;continue}if(Q===0&&/[a-z]/i.test(Z[J])&&(J===0||/\s|[;{}()]/.test(Z[J-1])))_();if(!/\s/.test(Z[J]))K=Z[J];J++}return Y.join(", ")}async function h3($,Z,Y,X){if(!W4($))return $;let Q=$;if(Z.skipSignalsRuntime)return Q;let{output:J,setupCode:G}=await XY(Q,Y,X);if(Q=J,Q=await r2(Q,Z),Q=s2(Q),G)if(Q.includes("</head>"))Q=Q.replace("</head>",`${G}
|
|
8086
8096
|
</head>`);else if(Q.includes("<body"))Q=Q.replace(/<body([^>]*)>/,`<body$1>
|
|
@@ -2444,7 +2444,7 @@ window.__stx_reactive = (function() {
|
|
|
2444
2444
|
|
|
2445
2445
|
return { initScope: initScope, reactive: reactive };
|
|
2446
2446
|
})();
|
|
2447
|
-
`}function I8($,Z){let Y=$.replace(/\{!!([\s\S]*?)!!\}/g,(X,Q)=>{try{let J=E0(Q,Z,!0);if(J===void 0)return X;return String(J)}catch{return X}});return Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(X,Q)=>{try{let J=E0(Q,Z,!0);if(J===void 0)return X;return JSON.stringify(J)}catch{return X}}),Y}function aG($,Z){if($.length===0)return"";let Y=$.map((X)=>{let Q=JSON.stringify(Object.fromEntries(X.refs)),J=I8(X.stateExpr,Z),G=X.initExpr?I8(X.initExpr,Z):null,K=JSON.stringify(J),z=G?JSON.stringify(G):"null";return`
|
|
2447
|
+
`}function I8($,Z){let Y=$.replace(/\{!!([\s\S]*?)!!\}/g,(X,Q)=>{try{let J=E0(Q,Z,!0);if(J===void 0)return X;return String(J)}catch{return X}});return Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(X,Q)=>{try{let J=E0(Q,Z,!0);if(J===void 0)return X;if(typeof J==="string"){let G=J.trim();if(G.startsWith("{")&&G.endsWith("}")||G.startsWith("[")&&G.endsWith("]"))try{return JSON.parse(G),G}catch{}}return JSON.stringify(J)}catch{return X}}),Y}function aG($,Z){if($.length===0)return"";let Y=$.map((X)=>{let Q=JSON.stringify(Object.fromEntries(X.refs)),J=I8(X.stateExpr,Z),G=X.initExpr?I8(X.initExpr,Z):null,K=JSON.stringify(J),z=G?JSON.stringify(G):"null";return`
|
|
2448
2448
|
(function() {
|
|
2449
2449
|
var scopeEl = document.querySelector('${X.selector}');
|
|
2450
2450
|
if (!scopeEl) return;
|
|
@@ -4495,6 +4495,13 @@ catch (e2) {
|
|
|
4495
4495
|
|
|
4496
4496
|
// Known directive names to exclude from generic :attr binding
|
|
4497
4497
|
var DIRECTIVE_NAMES = {class:1, style:1, text:1, html:1, show:1, model:1, 'if':1, 'for':1, ref:1};
|
|
4498
|
+
// SVG attributes are case-sensitive, but the HTML parser lowercases
|
|
4499
|
+
// prefixed attribute names \u2014 ':viewBox' arrives as ':viewbox' because
|
|
4500
|
+
// the spec's "adjust SVG attributes" step only covers unprefixed names.
|
|
4501
|
+
// Without restoring the canonical casing, setAttribute('viewbox') creates
|
|
4502
|
+
// a dead duplicate attribute and the real viewBox never updates.
|
|
4503
|
+
var SVG_ATTR_CASE = {attributename:'attributeName', attributetype:'attributeType', basefrequency:'baseFrequency', baseprofile:'baseProfile', calcmode:'calcMode', clippathunits:'clipPathUnits', diffuseconstant:'diffuseConstant', edgemode:'edgeMode', filterunits:'filterUnits', glyphref:'glyphRef', gradienttransform:'gradientTransform', gradientunits:'gradientUnits', kernelmatrix:'kernelMatrix', kernelunitlength:'kernelUnitLength', keypoints:'keyPoints', keysplines:'keySplines', keytimes:'keyTimes', lengthadjust:'lengthAdjust', limitingconeangle:'limitingConeAngle', markerheight:'markerHeight', markerunits:'markerUnits', markerwidth:'markerWidth', maskcontentunits:'maskContentUnits', maskunits:'maskUnits', numoctaves:'numOctaves', pathlength:'pathLength', patterncontentunits:'patternContentUnits', patterntransform:'patternTransform', patternunits:'patternUnits', pointsatx:'pointsAtX', pointsaty:'pointsAtY', pointsatz:'pointsAtZ', preservealpha:'preserveAlpha', preserveaspectratio:'preserveAspectRatio', primitiveunits:'primitiveUnits', refx:'refX', refy:'refY', repeatcount:'repeatCount', repeatdur:'repeatDur', requiredextensions:'requiredExtensions', requiredfeatures:'requiredFeatures', specularconstant:'specularConstant', specularexponent:'specularExponent', spreadmethod:'spreadMethod', startoffset:'startOffset', stddeviation:'stdDeviation', stitchtiles:'stitchTiles', surfacescale:'surfaceScale', systemlanguage:'systemLanguage', tablevalues:'tableValues', targetx:'targetX', targety:'targetY', textlength:'textLength', viewbox:'viewBox', viewtarget:'viewTarget', xchannelselector:'xChannelSelector', ychannelselector:'yChannelSelector', zoomandpan:'zoomAndPan'};
|
|
4504
|
+
var SVG_NS = 'http://www.w3.org/2000/svg';
|
|
4498
4505
|
var EVENT_RE = /^(click|dblclick|mousedown|mouseup|mousemove|mouseenter|mouseleave|keydown|keyup|keypress|input|change|submit|focus|blur|scroll|resize|touchstart|touchend|touchmove|contextmenu|wheel|pointerdown|pointerup|pointermove)/;
|
|
4499
4506
|
var KEY_MAP = {enter:'Enter', tab:'Tab', escape:'Escape', space:' ', up:'ArrowUp', down:'ArrowDown', left:'ArrowLeft', right:'ArrowRight', 'delete':'Delete', backspace:'Backspace'};
|
|
4500
4507
|
|
|
@@ -4519,7 +4526,8 @@ catch (e2) {
|
|
|
4519
4526
|
if (name.startsWith('@bind:') || name.startsWith('x-bind:')
|
|
4520
4527
|
|| (name.startsWith(':') && !name.startsWith('::') && !DIRECTIVE_NAMES[name.slice(1).split('.')[0]] && !EVENT_RE.test(name.slice(1)))
|
|
4521
4528
|
|| (name.startsWith('x-') && !X_HANDLED[name.split('.')[0]] && !X_HANDLED[name])) {
|
|
4522
|
-
|
|
4529
|
+
let attrName = name.startsWith('@bind:') ? name.slice(6) : name.startsWith('x-bind:') ? name.slice(7) : name.startsWith('x-') ? name.slice(2) : name.slice(1);
|
|
4530
|
+
if (el.namespaceURI === SVG_NS && SVG_ATTR_CASE[attrName]) attrName = SVG_ATTR_CASE[attrName];
|
|
4523
4531
|
effect(() => {
|
|
4524
4532
|
const v = evalAttrExpr(value);
|
|
4525
4533
|
if (v === false || v === null || v === undefined) {
|
|
@@ -4898,10 +4906,12 @@ else {
|
|
|
4898
4906
|
});
|
|
4899
4907
|
}
|
|
4900
4908
|
else if (Array.isArray(value)) {
|
|
4901
|
-
|
|
4909
|
+
var _clsArr = originalClasses + ' ' + value.filter(Boolean).join(' ');
|
|
4910
|
+
if (typeof el.className === 'string') el.className = _clsArr; else el.setAttribute('class', _clsArr);
|
|
4902
4911
|
}
|
|
4903
4912
|
else {
|
|
4904
|
-
|
|
4913
|
+
var _clsStr = originalClasses + (value ? ' ' + value : '');
|
|
4914
|
+
if (typeof el.className === 'string') el.className = _clsStr; else el.setAttribute('class', _clsStr);
|
|
4905
4915
|
}
|
|
4906
4916
|
});
|
|
4907
4917
|
}
|
|
@@ -8034,7 +8044,7 @@ ${B}${W}
|
|
|
8034
8044
|
return { ${U} };
|
|
8035
8045
|
}
|
|
8036
8046
|
if(window.stx)window.stx._latestSetup=${G};
|
|
8037
|
-
</script>`,j=$;for(let H of J)j=j.split(H.fullMatch).join("");if(j.includes("<body"))j=j.replace(/<body([^>]*)>/,`<body$1 data-stx="${G}">`);else{let H=["script","style","html","head","meta","link","title","!doctype"];j=j.replace(/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*)>/
|
|
8047
|
+
</script>`,j=$;for(let H of J)j=j.split(H.fullMatch).join("");if(j.includes("<body"))j=j.replace(/<body([^>]*)>/,`<body$1 data-stx="${G}">`);else{let H=["script","style","html","head","meta","link","title","!doctype"],F=!1;j=j.replace(/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*)>/gi,(L,O,V)=>{if(F||H.includes(O.toLowerCase()))return L;return F=!0,`<${O}${V} data-stx="${G}">`})}return{output:j,setupCode:_}}function P2($){let Z=$,Y=[],X=new Set,Q=0,J=0,G=Z.length,K="",z=()=>{J++;let j=!1;while(J<G){let H=Z[J];if(H==="\\"){J+=2;continue}if(H==="["&&!j){j=!0,J++;continue}if(H==="]"&&j){j=!1,J++;continue}if(H==="/"&&!j){J++;while(J<G&&/[gimsuyd]/.test(Z[J]))J++;return}if(H===`
|
|
8038
8048
|
`)return;J++}},q=()=>{if(!K)return!0;if(/[\w)\]]/.test(K))return!1;return!0},W=(j)=>{J++;while(J<G){if(Z[J]==="\\"){J+=2;continue}if(Z[J]===j){J++;return}J++}},U=()=>{J++;while(J<G){if(Z[J]==="\\"){J+=2;continue}if(Z[J]==="`"){J++;return}if(Z[J]==="$"&&Z[J+1]==="{"){J+=2;let j=1;while(J<G&&j>0)if(Z[J]==="{")j++,J++;else if(Z[J]==="}")j--,J++;else if(Z[J]==="'"||Z[J]==='"')W(Z[J]);else if(Z[J]==="`")U();else J++;continue}J++}},B=()=>{if(Z[J]==="/"&&Z[J+1]==="/"){while(J<G&&Z[J]!==`
|
|
8039
8049
|
`)J++;return!0}if(Z[J]==="/"&&Z[J+1]==="*"){J+=2;while(J<G-1&&!(Z[J]==="*"&&Z[J+1]==="/"))J++;return J+=2,!0}return!1},_=()=>{if(Q!==0)return;let j=Z.slice(J).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(j){let V=j[2];if(!X.has(V))Y.push(V),X.add(V);return}let H=Z.slice(J).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(H){H[1].split(",").forEach((V)=>{let w=V.trim();if(!w)return;let A=w.indexOf(":"),R=(A>=0?w.slice(A+1).trim():w).split(/[\s=]/)[0];if(R&&!X.has(R))Y.push(R),X.add(R)});return}let F=Z.slice(J).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(F){F[1].split(",").forEach((V)=>{let w=V.trim().replace(/^\.\.\./,"");if(!w)return;let A=w.split(/[\s=]/)[0];if(A&&!X.has(A))Y.push(A),X.add(A)});return}let L=Z.slice(J).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let V=L[1];if(!X.has(V))Y.push(V),X.add(V);return}let O=Z.slice(J).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let V=O[1];if(!X.has(V))Y.push(V),X.add(V)}};while(J<G){if(B())continue;if(Z[J]==="'"||Z[J]==='"'){W(Z[J]),K=Z[J-1];continue}if(Z[J]==="`"){U(),K="`";continue}if(Z[J]==="/"&&Z[J+1]!=="/"&&Z[J+1]!=="*"&&q()){z(),K="/";continue}if(Z[J]==="{"){Q++,K="{",J++;continue}if(Z[J]==="}"){Q--,K="}",J++;continue}if(Q===0&&/[a-z]/i.test(Z[J])&&(J===0||/\s|[;{}()]/.test(Z[J-1])))_();if(!/\s/.test(Z[J]))K=Z[J];J++}return Y.join(", ")}async function C3($,Z,Y,X){if(!K4($))return $;let Q=$;if(Z.skipSignalsRuntime)return Q;let{output:J,setupCode:G}=await C2(Q,Y,X);if(Q=J,Q=await M2(Q,Z),Q=T2(Q),G)if(Q.includes("</head>"))Q=Q.replace("</head>",`${G}
|
|
8040
8050
|
</head>`);else if(Q.includes("<body"))Q=Q.replace(/<body([^>]*)>/,`<body$1>
|
package/dist/pwa/index.js
CHANGED
|
@@ -3756,7 +3756,7 @@ window.__stx_reactive = (function() {
|
|
|
3756
3756
|
|
|
3757
3757
|
return { initScope: initScope, reactive: reactive };
|
|
3758
3758
|
})();
|
|
3759
|
-
`}function J2($,Z){let Y=$.replace(/\{!!([\s\S]*?)!!\}/g,(X,J)=>{try{let Q=g0(J,Z,!0);if(Q===void 0)return X;return String(Q)}catch{return X}});return Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(X,J)=>{try{let Q=g0(J,Z,!0);if(Q===void 0)return X;return JSON.stringify(Q)}catch{return X}}),Y}function LU($,Z){if($.length===0)return"";let Y=$.map((X)=>{let J=JSON.stringify(Object.fromEntries(X.refs)),Q=J2(X.stateExpr,Z),G=X.initExpr?J2(X.initExpr,Z):null,K=JSON.stringify(Q),q=G?JSON.stringify(G):"null";return`
|
|
3759
|
+
`}function J2($,Z){let Y=$.replace(/\{!!([\s\S]*?)!!\}/g,(X,J)=>{try{let Q=g0(J,Z,!0);if(Q===void 0)return X;return String(Q)}catch{return X}});return Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(X,J)=>{try{let Q=g0(J,Z,!0);if(Q===void 0)return X;if(typeof Q==="string"){let G=Q.trim();if(G.startsWith("{")&&G.endsWith("}")||G.startsWith("[")&&G.endsWith("]"))try{return JSON.parse(G),G}catch{}}return JSON.stringify(Q)}catch{return X}}),Y}function LU($,Z){if($.length===0)return"";let Y=$.map((X)=>{let J=JSON.stringify(Object.fromEntries(X.refs)),Q=J2(X.stateExpr,Z),G=X.initExpr?J2(X.initExpr,Z):null,K=JSON.stringify(Q),q=G?JSON.stringify(G):"null";return`
|
|
3760
3760
|
(function() {
|
|
3761
3761
|
var scopeEl = document.querySelector('${X.selector}');
|
|
3762
3762
|
if (!scopeEl) return;
|
|
@@ -4020,7 +4020,7 @@ else {
|
|
|
4020
4020
|
${q?`{${q}}`:"{}"}
|
|
4021
4021
|
</script>
|
|
4022
4022
|
</div>`}}});var a2={};l(a2,{warnUnbalancedTags:()=>$6,findUnbalancedTags:()=>r2});function F1($){return $.replace(/[^\n]/g," ")}function r2($){let Z=$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,F1).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,F1).replace(/<!--[\s\S]*?-->/g,F1).replace(/\{\{\{[\s\S]*?\}\}\}/g,F1).replace(/\{\{[\s\S]*?\}\}/g,F1).replace(/\{!![\s\S]*?!!\}/g,F1).replace(/"[^"]*"/g,F1).replace(/'[^']*'/g,F1),Y=new Map,X=new Map,J=/<(\/?)([A-Za-z][\w-]*)\b[^>]*?(\/?)>/g,Q;while((Q=J.exec(Z))!==null){let K=Q[1]==="/",q=Q[2],U=Q[3]==="/";if($z.has(q.toLowerCase()))continue;if(U)continue;if(K)X.set(q,(X.get(q)??0)+1);else{let W=Y.get(q);if(W)W.count++;else{let z=Z.slice(0,Q.index).split(`
|
|
4023
|
-
`).length;Y.set(q,{count:1,firstLine:z})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(Zz.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,U=X.get(K)??0;if(q!==U)G.push({tag:K,opened:q,closed:U,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function $6($,Z){let Y;try{Y=r2($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(s2.has(X))return;s2.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let U=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${U}
|
|
4023
|
+
`).length;Y.set(q,{count:1,firstLine:z})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(Zz.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,U=X.get(K)??0;if(q!==U)G.push({tag:K,opened:q,closed:U,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function $6($,Z){let Y;try{Y=r2($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(s2.has(X))return;s2.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let U=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${U} may swallow the content that follows it.`)}else console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 ${K-G} stray </${Q}>.`)}var $z,Zz,s2;var Z6=P(()=>{$z=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Zz=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);s2=new Set});import h0 from"path";import Y6 from"fs";function t2($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function e2($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class $Y{builtins=new Map;registerBuiltin($){this.builtins.set($.name.toLowerCase(),$);for(let Z of $.aliases)this.builtins.set(Z.toLowerCase(),$)}isBuiltin($){return this.builtins.has($.toLowerCase())}getBuiltin($){return this.builtins.get($.toLowerCase())??null}async resolveFile($,Z,Y,X){let J=$.endsWith(".stx")?$.slice(0,-4):$,Q=X?.__importedComponents;if(Q){let _=[J,J.toLowerCase(),t2(J),e2(J)];for(let j of _)if(Q.has(j))return Q.get(j)}let G=[...new Set([`${J}.stx`,`${t2(J)}.stx`,`${e2(J)}.stx`])];if(J.startsWith("./")||J.startsWith("../")){let _=h0.resolve(h0.dirname(Z),`${J}.stx`);if(await i(_))return _;return null}let K=[],q=Y.componentsDir||"",U=X?.__originalFilePath;if(U)K.push(h0.join(h0.dirname(U),"components"));if(q)K.push(q);let W=h0.join(h0.dirname(Z),"components");if(!K.includes(W))K.push(W);let z=process.cwd(),B=[h0.resolve(z,"src/components"),h0.resolve(z,"components"),h0.resolve(import.meta.dir,"components")];for(let _ of B)if(!K.includes(_))K.push(_);for(let _ of K){if(!_)continue;for(let j of G){let H=h0.join(_,j);if(await i(H))return H}try{if(!Y6.statSync(_,{throwIfNoEntry:!1})?.isDirectory())continue;let H=Y6.readdirSync(_,{withFileTypes:!0});for(let L of H)if(L.isDirectory()){let F=h0.join(_,L.name);for(let O of G){let V=h0.join(F,O);if(await i(V))return V}}}catch{}}return null}}var S0;var X6=P(()=>{V0();S0=new $Y});function V1($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Yz($){if($.clientReactive.to)return{value:$.clientReactive.to,reactive:!0};if($.serverDynamic.to!==void 0)return{value:String($.serverDynamic.to),reactive:!1};if(typeof $.static.to==="string")return{value:$.static.to,reactive:!1};return{value:"#",reactive:!1}}var J6;var Q6=P(()=>{J6={name:"StxLink",aliases:["stx-link"],render($,Z,Y){let X=Yz($),J=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Q=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",K=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,q=[];if(X.reactive)q.push(`:href="${V1(X.value)}"`);else q.push(`href="${V1(X.value)}"`);if(J)q.push(`class="${V1(J)}"`);if(q.push("data-stx-link"),q.push(`data-stx-active-class="${V1(Q)}"`),q.push(`data-stx-exact-active-class="${V1(G)}"`),K)q.push("data-stx-prefetch");let U=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);for(let[W,z]of Object.entries($.static)){if(U.has(W))continue;if(typeof z==="boolean"){if(z)q.push(V1(W))}else q.push(`${V1(W)}="${V1(z)}"`)}return`<a ${q.join(" ")}>${Z}</a>`}}});function B0($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function I0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let Y=$.static[Z];if(typeof Y==="string")return Y;return}function K6($,Z,Y=!1){let X=$.serverDynamic[Z];if(X!==void 0)return X!==!1&&X!=="false";let J=$.static[Z];if(J!==void 0)return J!=="false"&&J!==!1;return Y}function ZY($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),Y=[];for(let X of Z)if(X.includes(":")){let[J,Q]=X.split(":"),G=Xz[J];if(G)Y.push(`(max-width: ${G}px) ${Q}`);else{let K=Number.parseInt(J);if(!Number.isNaN(K))Y.push(`(max-width: ${K}px) ${Q}`)}}else Y.push(X);return Y.join(", ")}function q6($,Z,Y,X){return Z.map((J)=>`${o5($,J,void 0,Y,X)} ${J}w`).join(", ")}function Jz($,Z,Y,X,J){return Z.map((Q)=>{let G=Y?Y*Q:void 0;return`${o5($,G,void 0,X,J)} ${Q}x`}).join(", ")}function o5($,Z,Y,X,J){if(!X||X==="local"||X==="static")return $;if(X==="cloudinary"){let Q=[];if(Z)Q.push(`w_${Z}`);if(Y)Q.push(`h_${Y}`);if(J)Q.push(`f_${J}`);Q.push("q_auto");let G=Q.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(X==="imgix"){let Q=new URLSearchParams;if(Z)Q.set("w",String(Z));if(Y)Q.set("h",String(Y));if(J)Q.set("fm",J);Q.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}if(X==="bunny"){let Q=new URLSearchParams;if(Z)Q.set("width",String(Z));if(Y)Q.set("height",String(Y));if(J)Q.set("format",J);let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}return $}function Qz($,Z,Y="#e5e7eb"){let X=`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${Z}"><rect width="100%" height="100%" fill="${Y}"/></svg>`;return`data:image/svg+xml;base64,${btoa(X)}`}var Xz,G6,U6;var W6=P(()=>{Xz={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},G6=[320,640,768,1024,1280,1536,1920];U6={name:"StxImage",aliases:["stx-image","stx-img"],render($,Z,Y){let X=I0($,"src")||"",J=I0($,"alt")||"",Q=I0($,"width"),G=I0($,"height"),K=I0($,"sizes"),q=I0($,"srcset"),U=I0($,"densities"),W=I0($,"format"),z=I0($,"placeholder"),B=I0($,"placeholderColor")||"#e5e7eb",_=I0($,"provider"),j=I0($,"class")||I0($,"className")||"",H=I0($,"style")||"",L=I0($,"quality"),F=K6($,"lazy",!0),O=K6($,"preload",!1),V=K6($,"picture",!1)||!!W,R=Q?Number.parseInt(Q):void 0,w=G?Number.parseInt(G):void 0,A=q||"",N="";if(!A&&K)A=q6(X,G6,_,W),N=ZY(K);else if(!A&&U){let S=U.split(/\s+/).map((b)=>Number.parseFloat(b.replace("x","")));A=Jz(X,S,R,_,W)}else if(K)N=ZY(K);let M=[];if(H)M.push(H);if(R&&w)M.push(`aspect-ratio:${R}/${w}`);if(z==="blur"||z==="color"||z==="thumbhash"){let S=Qz(R||16,w||9,B);M.push(`background-image:url(${S})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat")}else if(z&&z!=="empty"&&z!=="none")M.push(`background-image:url(${B0(z)})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat");let T=o5(X,R,w,_,W),I=[];if(I.push(`src="${B0(T)}"`),I.push(`alt="${B0(J)}"`),Q)I.push(`width="${B0(Q)}"`);if(G)I.push(`height="${B0(G)}"`);if(F)I.push('loading="lazy"');if(I.push('decoding="async"'),j)I.push(`class="${B0(j)}"`);if(M.length>0)I.push(`style="${B0(M.join(";"))}"`);if(A)I.push(`srcset="${B0(A)}"`);if(N)I.push(`sizes="${B0(N)}"`);let D=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","picture"]);for(let[S,b]of Object.entries($.static)){if(D.has(S))continue;if(typeof b==="boolean"){if(b)I.push(B0(S))}else I.push(`${B0(S)}="${B0(b)}"`)}let E=`<img ${I.join(" ")} />`,k="";if(O){let b=W==="webp"?"image/webp":W==="avif"?"image/avif":"";k=`<link rel="preload" as="image" href="${B0(T)}"${b?` type="${b}"`:""}${A?` imagesrcset="${B0(A)}"`:""}${N?` imagesizes="${B0(N)}"`:""} />
|
|
4024
4024
|
`}if(V){let S=[];if(W==="avif"||W==="auto"){let b=o5(X,R,w,_,"avif"),y=A?q6(X,G6,_,"avif"):`${b}`;S.push(`<source type="image/avif" srcset="${B0(y)}"${N?` sizes="${B0(N)}"`:""} />`)}if(W==="webp"||W==="auto"){let b=o5(X,R,w,_,"webp"),y=A?q6(X,G6,_,"webp"):`${b}`;S.push(`<source type="image/webp" srcset="${B0(y)}"${N?` sizes="${B0(N)}"`:""} />`)}return`${k}<picture>
|
|
4025
4025
|
${S.join(`
|
|
4026
4026
|
`)}
|
|
@@ -5996,6 +5996,13 @@ catch (e2) {
|
|
|
5996
5996
|
|
|
5997
5997
|
// Known directive names to exclude from generic :attr binding
|
|
5998
5998
|
var DIRECTIVE_NAMES = {class:1, style:1, text:1, html:1, show:1, model:1, 'if':1, 'for':1, ref:1};
|
|
5999
|
+
// SVG attributes are case-sensitive, but the HTML parser lowercases
|
|
6000
|
+
// prefixed attribute names \u2014 ':viewBox' arrives as ':viewbox' because
|
|
6001
|
+
// the spec's "adjust SVG attributes" step only covers unprefixed names.
|
|
6002
|
+
// Without restoring the canonical casing, setAttribute('viewbox') creates
|
|
6003
|
+
// a dead duplicate attribute and the real viewBox never updates.
|
|
6004
|
+
var SVG_ATTR_CASE = {attributename:'attributeName', attributetype:'attributeType', basefrequency:'baseFrequency', baseprofile:'baseProfile', calcmode:'calcMode', clippathunits:'clipPathUnits', diffuseconstant:'diffuseConstant', edgemode:'edgeMode', filterunits:'filterUnits', glyphref:'glyphRef', gradienttransform:'gradientTransform', gradientunits:'gradientUnits', kernelmatrix:'kernelMatrix', kernelunitlength:'kernelUnitLength', keypoints:'keyPoints', keysplines:'keySplines', keytimes:'keyTimes', lengthadjust:'lengthAdjust', limitingconeangle:'limitingConeAngle', markerheight:'markerHeight', markerunits:'markerUnits', markerwidth:'markerWidth', maskcontentunits:'maskContentUnits', maskunits:'maskUnits', numoctaves:'numOctaves', pathlength:'pathLength', patterncontentunits:'patternContentUnits', patterntransform:'patternTransform', patternunits:'patternUnits', pointsatx:'pointsAtX', pointsaty:'pointsAtY', pointsatz:'pointsAtZ', preservealpha:'preserveAlpha', preserveaspectratio:'preserveAspectRatio', primitiveunits:'primitiveUnits', refx:'refX', refy:'refY', repeatcount:'repeatCount', repeatdur:'repeatDur', requiredextensions:'requiredExtensions', requiredfeatures:'requiredFeatures', specularconstant:'specularConstant', specularexponent:'specularExponent', spreadmethod:'spreadMethod', startoffset:'startOffset', stddeviation:'stdDeviation', stitchtiles:'stitchTiles', surfacescale:'surfaceScale', systemlanguage:'systemLanguage', tablevalues:'tableValues', targetx:'targetX', targety:'targetY', textlength:'textLength', viewbox:'viewBox', viewtarget:'viewTarget', xchannelselector:'xChannelSelector', ychannelselector:'yChannelSelector', zoomandpan:'zoomAndPan'};
|
|
6005
|
+
var SVG_NS = 'http://www.w3.org/2000/svg';
|
|
5999
6006
|
var EVENT_RE = /^(click|dblclick|mousedown|mouseup|mousemove|mouseenter|mouseleave|keydown|keyup|keypress|input|change|submit|focus|blur|scroll|resize|touchstart|touchend|touchmove|contextmenu|wheel|pointerdown|pointerup|pointermove)/;
|
|
6000
6007
|
var KEY_MAP = {enter:'Enter', tab:'Tab', escape:'Escape', space:' ', up:'ArrowUp', down:'ArrowDown', left:'ArrowLeft', right:'ArrowRight', 'delete':'Delete', backspace:'Backspace'};
|
|
6001
6008
|
|
|
@@ -6020,7 +6027,8 @@ catch (e2) {
|
|
|
6020
6027
|
if (name.startsWith('@bind:') || name.startsWith('x-bind:')
|
|
6021
6028
|
|| (name.startsWith(':') && !name.startsWith('::') && !DIRECTIVE_NAMES[name.slice(1).split('.')[0]] && !EVENT_RE.test(name.slice(1)))
|
|
6022
6029
|
|| (name.startsWith('x-') && !X_HANDLED[name.split('.')[0]] && !X_HANDLED[name])) {
|
|
6023
|
-
|
|
6030
|
+
let attrName = name.startsWith('@bind:') ? name.slice(6) : name.startsWith('x-bind:') ? name.slice(7) : name.startsWith('x-') ? name.slice(2) : name.slice(1);
|
|
6031
|
+
if (el.namespaceURI === SVG_NS && SVG_ATTR_CASE[attrName]) attrName = SVG_ATTR_CASE[attrName];
|
|
6024
6032
|
effect(() => {
|
|
6025
6033
|
const v = evalAttrExpr(value);
|
|
6026
6034
|
if (v === false || v === null || v === undefined) {
|
|
@@ -6399,10 +6407,12 @@ else {
|
|
|
6399
6407
|
});
|
|
6400
6408
|
}
|
|
6401
6409
|
else if (Array.isArray(value)) {
|
|
6402
|
-
|
|
6410
|
+
var _clsArr = originalClasses + ' ' + value.filter(Boolean).join(' ');
|
|
6411
|
+
if (typeof el.className === 'string') el.className = _clsArr; else el.setAttribute('class', _clsArr);
|
|
6403
6412
|
}
|
|
6404
6413
|
else {
|
|
6405
|
-
|
|
6414
|
+
var _clsStr = originalClasses + (value ? ' ' + value : '');
|
|
6415
|
+
if (typeof el.className === 'string') el.className = _clsStr; else el.setAttribute('class', _clsStr);
|
|
6406
6416
|
}
|
|
6407
6417
|
});
|
|
6408
6418
|
}
|
|
@@ -9535,7 +9545,7 @@ ${B}${W}
|
|
|
9535
9545
|
return { ${z} };
|
|
9536
9546
|
}
|
|
9537
9547
|
if(window.stx)window.stx._latestSetup=${G};
|
|
9538
|
-
</script>`,j=$;for(let H of Q)j=j.split(H.fullMatch).join("");if(j.includes("<body"))j=j.replace(/<body([^>]*)>/,`<body$1 data-stx="${G}">`);else{let H=["script","style","html","head","meta","link","title","!doctype"];j=j.replace(/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*)>/
|
|
9548
|
+
</script>`,j=$;for(let H of Q)j=j.split(H.fullMatch).join("");if(j.includes("<body"))j=j.replace(/<body([^>]*)>/,`<body$1 data-stx="${G}">`);else{let H=["script","style","html","head","meta","link","title","!doctype"],L=!1;j=j.replace(/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*)>/gi,(F,O,V)=>{if(L||H.includes(O.toLowerCase()))return F;return L=!0,`<${O}${V} data-stx="${G}">`})}return{output:j,setupCode:_}}function bX($){let Z=$,Y=[],X=new Set,J=0,Q=0,G=Z.length,K="",q=()=>{Q++;let j=!1;while(Q<G){let H=Z[Q];if(H==="\\"){Q+=2;continue}if(H==="["&&!j){j=!0,Q++;continue}if(H==="]"&&j){j=!1,Q++;continue}if(H==="/"&&!j){Q++;while(Q<G&&/[gimsuyd]/.test(Z[Q]))Q++;return}if(H===`
|
|
9539
9549
|
`)return;Q++}},U=()=>{if(!K)return!0;if(/[\w)\]]/.test(K))return!1;return!0},W=(j)=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]===j){Q++;return}Q++}},z=()=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]==="`"){Q++;return}if(Z[Q]==="$"&&Z[Q+1]==="{"){Q+=2;let j=1;while(Q<G&&j>0)if(Z[Q]==="{")j++,Q++;else if(Z[Q]==="}")j--,Q++;else if(Z[Q]==="'"||Z[Q]==='"')W(Z[Q]);else if(Z[Q]==="`")z();else Q++;continue}Q++}},B=()=>{if(Z[Q]==="/"&&Z[Q+1]==="/"){while(Q<G&&Z[Q]!==`
|
|
9540
9550
|
`)Q++;return!0}if(Z[Q]==="/"&&Z[Q+1]==="*"){Q+=2;while(Q<G-1&&!(Z[Q]==="*"&&Z[Q+1]==="/"))Q++;return Q+=2,!0}return!1},_=()=>{if(J!==0)return;let j=Z.slice(Q).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(j){let V=j[2];if(!X.has(V))Y.push(V),X.add(V);return}let H=Z.slice(Q).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(H){H[1].split(",").forEach((V)=>{let R=V.trim();if(!R)return;let w=R.indexOf(":"),N=(w>=0?R.slice(w+1).trim():R).split(/[\s=]/)[0];if(N&&!X.has(N))Y.push(N),X.add(N)});return}let L=Z.slice(Q).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(L){L[1].split(",").forEach((V)=>{let R=V.trim().replace(/^\.\.\./,"");if(!R)return;let w=R.split(/[\s=]/)[0];if(w&&!X.has(w))Y.push(w),X.add(w)});return}let F=Z.slice(Q).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(F){let V=F[1];if(!X.has(V))Y.push(V),X.add(V);return}let O=Z.slice(Q).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let V=O[1];if(!X.has(V))Y.push(V),X.add(V)}};while(Q<G){if(B())continue;if(Z[Q]==="'"||Z[Q]==='"'){W(Z[Q]),K=Z[Q-1];continue}if(Z[Q]==="`"){z(),K="`";continue}if(Z[Q]==="/"&&Z[Q+1]!=="/"&&Z[Q+1]!=="*"&&U()){q(),K="/";continue}if(Z[Q]==="{"){J++,K="{",Q++;continue}if(Z[Q]==="}"){J--,K="}",Q++;continue}if(J===0&&/[a-z]/i.test(Z[Q])&&(Q===0||/\s|[;{}()]/.test(Z[Q-1])))_();if(!/\s/.test(Z[Q]))K=Z[Q];Q++}return Y.join(", ")}async function $9($,Z,Y,X){if(!n4($))return $;let J=$;if(Z.skipSignalsRuntime)return J;let{output:Q,setupCode:G}=await SX(J,Y,X);if(J=Q,J=await AX(J,Z),J=RX(J),G)if(J.includes("</head>"))J=J.replace("</head>",`${G}
|
|
9541
9551
|
</head>`);else if(J.includes("<body"))J=J.replace(/<body([^>]*)>/,`<body$1>
|
package/dist/pwa/offline.js
CHANGED
|
@@ -3756,7 +3756,7 @@ window.__stx_reactive = (function() {
|
|
|
3756
3756
|
|
|
3757
3757
|
return { initScope: initScope, reactive: reactive };
|
|
3758
3758
|
})();
|
|
3759
|
-
`}function cZ($,Z){let Y=$.replace(/\{!!([\s\S]*?)!!\}/g,(X,J)=>{try{let Q=g0(J,Z,!0);if(Q===void 0)return X;return String(Q)}catch{return X}});return Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(X,J)=>{try{let Q=g0(J,Z,!0);if(Q===void 0)return X;return JSON.stringify(Q)}catch{return X}}),Y}function Yz($,Z){if($.length===0)return"";let Y=$.map((X)=>{let J=JSON.stringify(Object.fromEntries(X.refs)),Q=cZ(X.stateExpr,Z),G=X.initExpr?cZ(X.initExpr,Z):null,K=JSON.stringify(Q),q=G?JSON.stringify(G):"null";return`
|
|
3759
|
+
`}function cZ($,Z){let Y=$.replace(/\{!!([\s\S]*?)!!\}/g,(X,J)=>{try{let Q=g0(J,Z,!0);if(Q===void 0)return X;return String(Q)}catch{return X}});return Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(X,J)=>{try{let Q=g0(J,Z,!0);if(Q===void 0)return X;if(typeof Q==="string"){let G=Q.trim();if(G.startsWith("{")&&G.endsWith("}")||G.startsWith("[")&&G.endsWith("]"))try{return JSON.parse(G),G}catch{}}return JSON.stringify(Q)}catch{return X}}),Y}function Yz($,Z){if($.length===0)return"";let Y=$.map((X)=>{let J=JSON.stringify(Object.fromEntries(X.refs)),Q=cZ(X.stateExpr,Z),G=X.initExpr?cZ(X.initExpr,Z):null,K=JSON.stringify(Q),q=G?JSON.stringify(G):"null";return`
|
|
3760
3760
|
(function() {
|
|
3761
3761
|
var scopeEl = document.querySelector('${X.selector}');
|
|
3762
3762
|
if (!scopeEl) return;
|
|
@@ -4020,7 +4020,7 @@ else {
|
|
|
4020
4020
|
${q?`{${q}}`:"{}"}
|
|
4021
4021
|
</script>
|
|
4022
4022
|
</div>`}}});var g2={};l(g2,{warnUnbalancedTags:()=>n3,findUnbalancedTags:()=>f2});function L1($){return $.replace(/[^\n]/g," ")}function f2($){let Z=$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,L1).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,L1).replace(/<!--[\s\S]*?-->/g,L1).replace(/\{\{\{[\s\S]*?\}\}\}/g,L1).replace(/\{\{[\s\S]*?\}\}/g,L1).replace(/\{!![\s\S]*?!!\}/g,L1).replace(/"[^"]*"/g,L1).replace(/'[^']*'/g,L1),Y=new Map,X=new Map,J=/<(\/?)([A-Za-z][\w-]*)\b[^>]*?(\/?)>/g,Q;while((Q=J.exec(Z))!==null){let K=Q[1]==="/",q=Q[2],z=Q[3]==="/";if(hU.has(q.toLowerCase()))continue;if(z)continue;if(K)X.set(q,(X.get(q)??0)+1);else{let U=Y.get(q);if(U)U.count++;else{let W=Z.slice(0,Q.index).split(`
|
|
4023
|
-
`).length;Y.set(q,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(dU.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,z=X.get(K)??0;if(q!==z)G.push({tag:K,opened:q,closed:z,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function n3($,Z){let Y;try{Y=f2($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(x2.has(X))return;x2.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let z=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${z}
|
|
4023
|
+
`).length;Y.set(q,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(dU.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,z=X.get(K)??0;if(q!==z)G.push({tag:K,opened:q,closed:z,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function n3($,Z){let Y;try{Y=f2($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(x2.has(X))return;x2.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let z=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${z} may swallow the content that follows it.`)}else console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 ${K-G} stray </${Q}>.`)}var hU,dU,x2;var o3=C(()=>{hU=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),dU=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);x2=new Set});import h0 from"path";import s3 from"fs";function h2($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function d2($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class m2{builtins=new Map;registerBuiltin($){this.builtins.set($.name.toLowerCase(),$);for(let Z of $.aliases)this.builtins.set(Z.toLowerCase(),$)}isBuiltin($){return this.builtins.has($.toLowerCase())}getBuiltin($){return this.builtins.get($.toLowerCase())??null}async resolveFile($,Z,Y,X){let J=$.endsWith(".stx")?$.slice(0,-4):$,Q=X?.__importedComponents;if(Q){let B=[J,J.toLowerCase(),h2(J),d2(J)];for(let j of B)if(Q.has(j))return Q.get(j)}let G=[...new Set([`${J}.stx`,`${h2(J)}.stx`,`${d2(J)}.stx`])];if(J.startsWith("./")||J.startsWith("../")){let B=h0.resolve(h0.dirname(Z),`${J}.stx`);if(await i(B))return B;return null}let K=[],q=Y.componentsDir||"",z=X?.__originalFilePath;if(z)K.push(h0.join(h0.dirname(z),"components"));if(q)K.push(q);let U=h0.join(h0.dirname(Z),"components");if(!K.includes(U))K.push(U);let W=process.cwd(),_=[h0.resolve(W,"src/components"),h0.resolve(W,"components"),h0.resolve(import.meta.dir,"components")];for(let B of _)if(!K.includes(B))K.push(B);for(let B of K){if(!B)continue;for(let j of G){let H=h0.join(B,j);if(await i(H))return H}try{if(!s3.statSync(B,{throwIfNoEntry:!1})?.isDirectory())continue;let H=s3.readdirSync(B,{withFileTypes:!0});for(let L of H)if(L.isDirectory()){let F=h0.join(B,L.name);for(let O of G){let V=h0.join(F,O);if(await i(V))return V}}}catch{}}return null}}var S0;var r3=C(()=>{V0();S0=new m2});function F1($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function mU($){if($.clientReactive.to)return{value:$.clientReactive.to,reactive:!0};if($.serverDynamic.to!==void 0)return{value:String($.serverDynamic.to),reactive:!1};if(typeof $.static.to==="string")return{value:$.static.to,reactive:!1};return{value:"#",reactive:!1}}var a3;var t3=C(()=>{a3={name:"StxLink",aliases:["stx-link"],render($,Z,Y){let X=mU($),J=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Q=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",K=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,q=[];if(X.reactive)q.push(`:href="${F1(X.value)}"`);else q.push(`href="${F1(X.value)}"`);if(J)q.push(`class="${F1(J)}"`);if(q.push("data-stx-link"),q.push(`data-stx-active-class="${F1(Q)}"`),q.push(`data-stx-exact-active-class="${F1(G)}"`),K)q.push("data-stx-prefetch");let z=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);for(let[U,W]of Object.entries($.static)){if(z.has(U))continue;if(typeof W==="boolean"){if(W)q.push(F1(U))}else q.push(`${F1(U)}="${F1(W)}"`)}return`<a ${q.join(" ")}>${Z}</a>`}}});function _0($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function I0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let Y=$.static[Z];if(typeof Y==="string")return Y;return}function $6($,Z,Y=!1){let X=$.serverDynamic[Z];if(X!==void 0)return X!==!1&&X!=="false";let J=$.static[Z];if(J!==void 0)return J!=="false"&&J!==!1;return Y}function u2($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),Y=[];for(let X of Z)if(X.includes(":")){let[J,Q]=X.split(":"),G=uU[J];if(G)Y.push(`(max-width: ${G}px) ${Q}`);else{let K=Number.parseInt(J);if(!Number.isNaN(K))Y.push(`(max-width: ${K}px) ${Q}`)}}else Y.push(X);return Y.join(", ")}function Z6($,Z,Y,X){return Z.map((J)=>`${c5($,J,void 0,Y,X)} ${J}w`).join(", ")}function lU($,Z,Y,X,J){return Z.map((Q)=>{let G=Y?Y*Q:void 0;return`${c5($,G,void 0,X,J)} ${Q}x`}).join(", ")}function c5($,Z,Y,X,J){if(!X||X==="local"||X==="static")return $;if(X==="cloudinary"){let Q=[];if(Z)Q.push(`w_${Z}`);if(Y)Q.push(`h_${Y}`);if(J)Q.push(`f_${J}`);Q.push("q_auto");let G=Q.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(X==="imgix"){let Q=new URLSearchParams;if(Z)Q.set("w",String(Z));if(Y)Q.set("h",String(Y));if(J)Q.set("fm",J);Q.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}if(X==="bunny"){let Q=new URLSearchParams;if(Z)Q.set("width",String(Z));if(Y)Q.set("height",String(Y));if(J)Q.set("format",J);let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}return $}function pU($,Z,Y="#e5e7eb"){let X=`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${Z}"><rect width="100%" height="100%" fill="${Y}"/></svg>`;return`data:image/svg+xml;base64,${btoa(X)}`}var uU,e3,Y6;var X6=C(()=>{uU={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},e3=[320,640,768,1024,1280,1536,1920];Y6={name:"StxImage",aliases:["stx-image","stx-img"],render($,Z,Y){let X=I0($,"src")||"",J=I0($,"alt")||"",Q=I0($,"width"),G=I0($,"height"),K=I0($,"sizes"),q=I0($,"srcset"),z=I0($,"densities"),U=I0($,"format"),W=I0($,"placeholder"),_=I0($,"placeholderColor")||"#e5e7eb",B=I0($,"provider"),j=I0($,"class")||I0($,"className")||"",H=I0($,"style")||"",L=I0($,"quality"),F=$6($,"lazy",!0),O=$6($,"preload",!1),V=$6($,"picture",!1)||!!U,A=Q?Number.parseInt(Q):void 0,w=G?Number.parseInt(G):void 0,R=q||"",N="";if(!R&&K)R=Z6(X,e3,B,U),N=u2(K);else if(!R&&z){let S=z.split(/\s+/).map((b)=>Number.parseFloat(b.replace("x","")));R=lU(X,S,A,B,U)}else if(K)N=u2(K);let M=[];if(H)M.push(H);if(A&&w)M.push(`aspect-ratio:${A}/${w}`);if(W==="blur"||W==="color"||W==="thumbhash"){let S=pU(A||16,w||9,_);M.push(`background-image:url(${S})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat")}else if(W&&W!=="empty"&&W!=="none")M.push(`background-image:url(${_0(W)})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat");let T=c5(X,A,w,B,U),I=[];if(I.push(`src="${_0(T)}"`),I.push(`alt="${_0(J)}"`),Q)I.push(`width="${_0(Q)}"`);if(G)I.push(`height="${_0(G)}"`);if(F)I.push('loading="lazy"');if(I.push('decoding="async"'),j)I.push(`class="${_0(j)}"`);if(M.length>0)I.push(`style="${_0(M.join(";"))}"`);if(R)I.push(`srcset="${_0(R)}"`);if(N)I.push(`sizes="${_0(N)}"`);let D=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","picture"]);for(let[S,b]of Object.entries($.static)){if(D.has(S))continue;if(typeof b==="boolean"){if(b)I.push(_0(S))}else I.push(`${_0(S)}="${_0(b)}"`)}let E=`<img ${I.join(" ")} />`,k="";if(O){let b=U==="webp"?"image/webp":U==="avif"?"image/avif":"";k=`<link rel="preload" as="image" href="${_0(T)}"${b?` type="${b}"`:""}${R?` imagesrcset="${_0(R)}"`:""}${N?` imagesizes="${_0(N)}"`:""} />
|
|
4024
4024
|
`}if(V){let S=[];if(U==="avif"||U==="auto"){let b=c5(X,A,w,B,"avif"),y=R?Z6(X,e3,B,"avif"):`${b}`;S.push(`<source type="image/avif" srcset="${_0(y)}"${N?` sizes="${_0(N)}"`:""} />`)}if(U==="webp"||U==="auto"){let b=c5(X,A,w,B,"webp"),y=R?Z6(X,e3,B,"webp"):`${b}`;S.push(`<source type="image/webp" srcset="${_0(y)}"${N?` sizes="${_0(N)}"`:""} />`)}return`${k}<picture>
|
|
4025
4025
|
${S.join(`
|
|
4026
4026
|
`)}
|
|
@@ -5996,6 +5996,13 @@ catch (e2) {
|
|
|
5996
5996
|
|
|
5997
5997
|
// Known directive names to exclude from generic :attr binding
|
|
5998
5998
|
var DIRECTIVE_NAMES = {class:1, style:1, text:1, html:1, show:1, model:1, 'if':1, 'for':1, ref:1};
|
|
5999
|
+
// SVG attributes are case-sensitive, but the HTML parser lowercases
|
|
6000
|
+
// prefixed attribute names \u2014 ':viewBox' arrives as ':viewbox' because
|
|
6001
|
+
// the spec's "adjust SVG attributes" step only covers unprefixed names.
|
|
6002
|
+
// Without restoring the canonical casing, setAttribute('viewbox') creates
|
|
6003
|
+
// a dead duplicate attribute and the real viewBox never updates.
|
|
6004
|
+
var SVG_ATTR_CASE = {attributename:'attributeName', attributetype:'attributeType', basefrequency:'baseFrequency', baseprofile:'baseProfile', calcmode:'calcMode', clippathunits:'clipPathUnits', diffuseconstant:'diffuseConstant', edgemode:'edgeMode', filterunits:'filterUnits', glyphref:'glyphRef', gradienttransform:'gradientTransform', gradientunits:'gradientUnits', kernelmatrix:'kernelMatrix', kernelunitlength:'kernelUnitLength', keypoints:'keyPoints', keysplines:'keySplines', keytimes:'keyTimes', lengthadjust:'lengthAdjust', limitingconeangle:'limitingConeAngle', markerheight:'markerHeight', markerunits:'markerUnits', markerwidth:'markerWidth', maskcontentunits:'maskContentUnits', maskunits:'maskUnits', numoctaves:'numOctaves', pathlength:'pathLength', patterncontentunits:'patternContentUnits', patterntransform:'patternTransform', patternunits:'patternUnits', pointsatx:'pointsAtX', pointsaty:'pointsAtY', pointsatz:'pointsAtZ', preservealpha:'preserveAlpha', preserveaspectratio:'preserveAspectRatio', primitiveunits:'primitiveUnits', refx:'refX', refy:'refY', repeatcount:'repeatCount', repeatdur:'repeatDur', requiredextensions:'requiredExtensions', requiredfeatures:'requiredFeatures', specularconstant:'specularConstant', specularexponent:'specularExponent', spreadmethod:'spreadMethod', startoffset:'startOffset', stddeviation:'stdDeviation', stitchtiles:'stitchTiles', surfacescale:'surfaceScale', systemlanguage:'systemLanguage', tablevalues:'tableValues', targetx:'targetX', targety:'targetY', textlength:'textLength', viewbox:'viewBox', viewtarget:'viewTarget', xchannelselector:'xChannelSelector', ychannelselector:'yChannelSelector', zoomandpan:'zoomAndPan'};
|
|
6005
|
+
var SVG_NS = 'http://www.w3.org/2000/svg';
|
|
5999
6006
|
var EVENT_RE = /^(click|dblclick|mousedown|mouseup|mousemove|mouseenter|mouseleave|keydown|keyup|keypress|input|change|submit|focus|blur|scroll|resize|touchstart|touchend|touchmove|contextmenu|wheel|pointerdown|pointerup|pointermove)/;
|
|
6000
6007
|
var KEY_MAP = {enter:'Enter', tab:'Tab', escape:'Escape', space:' ', up:'ArrowUp', down:'ArrowDown', left:'ArrowLeft', right:'ArrowRight', 'delete':'Delete', backspace:'Backspace'};
|
|
6001
6008
|
|
|
@@ -6020,7 +6027,8 @@ catch (e2) {
|
|
|
6020
6027
|
if (name.startsWith('@bind:') || name.startsWith('x-bind:')
|
|
6021
6028
|
|| (name.startsWith(':') && !name.startsWith('::') && !DIRECTIVE_NAMES[name.slice(1).split('.')[0]] && !EVENT_RE.test(name.slice(1)))
|
|
6022
6029
|
|| (name.startsWith('x-') && !X_HANDLED[name.split('.')[0]] && !X_HANDLED[name])) {
|
|
6023
|
-
|
|
6030
|
+
let attrName = name.startsWith('@bind:') ? name.slice(6) : name.startsWith('x-bind:') ? name.slice(7) : name.startsWith('x-') ? name.slice(2) : name.slice(1);
|
|
6031
|
+
if (el.namespaceURI === SVG_NS && SVG_ATTR_CASE[attrName]) attrName = SVG_ATTR_CASE[attrName];
|
|
6024
6032
|
effect(() => {
|
|
6025
6033
|
const v = evalAttrExpr(value);
|
|
6026
6034
|
if (v === false || v === null || v === undefined) {
|
|
@@ -6399,10 +6407,12 @@ else {
|
|
|
6399
6407
|
});
|
|
6400
6408
|
}
|
|
6401
6409
|
else if (Array.isArray(value)) {
|
|
6402
|
-
|
|
6410
|
+
var _clsArr = originalClasses + ' ' + value.filter(Boolean).join(' ');
|
|
6411
|
+
if (typeof el.className === 'string') el.className = _clsArr; else el.setAttribute('class', _clsArr);
|
|
6403
6412
|
}
|
|
6404
6413
|
else {
|
|
6405
|
-
|
|
6414
|
+
var _clsStr = originalClasses + (value ? ' ' + value : '');
|
|
6415
|
+
if (typeof el.className === 'string') el.className = _clsStr; else el.setAttribute('class', _clsStr);
|
|
6406
6416
|
}
|
|
6407
6417
|
});
|
|
6408
6418
|
}
|
|
@@ -9535,7 +9545,7 @@ ${_}${U}
|
|
|
9535
9545
|
return { ${W} };
|
|
9536
9546
|
}
|
|
9537
9547
|
if(window.stx)window.stx._latestSetup=${G};
|
|
9538
|
-
</script>`,j=$;for(let H of Q)j=j.split(H.fullMatch).join("");if(j.includes("<body"))j=j.replace(/<body([^>]*)>/,`<body$1 data-stx="${G}">`);else{let H=["script","style","html","head","meta","link","title","!doctype"];j=j.replace(/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*)>/
|
|
9548
|
+
</script>`,j=$;for(let H of Q)j=j.split(H.fullMatch).join("");if(j.includes("<body"))j=j.replace(/<body([^>]*)>/,`<body$1 data-stx="${G}">`);else{let H=["script","style","html","head","meta","link","title","!doctype"],L=!1;j=j.replace(/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*)>/gi,(F,O,V)=>{if(L||H.includes(O.toLowerCase()))return F;return L=!0,`<${O}${V} data-stx="${G}">`})}return{output:j,setupCode:B}}function FX($){let Z=$,Y=[],X=new Set,J=0,Q=0,G=Z.length,K="",q=()=>{Q++;let j=!1;while(Q<G){let H=Z[Q];if(H==="\\"){Q+=2;continue}if(H==="["&&!j){j=!0,Q++;continue}if(H==="]"&&j){j=!1,Q++;continue}if(H==="/"&&!j){Q++;while(Q<G&&/[gimsuyd]/.test(Z[Q]))Q++;return}if(H===`
|
|
9539
9549
|
`)return;Q++}},z=()=>{if(!K)return!0;if(/[\w)\]]/.test(K))return!1;return!0},U=(j)=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]===j){Q++;return}Q++}},W=()=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]==="`"){Q++;return}if(Z[Q]==="$"&&Z[Q+1]==="{"){Q+=2;let j=1;while(Q<G&&j>0)if(Z[Q]==="{")j++,Q++;else if(Z[Q]==="}")j--,Q++;else if(Z[Q]==="'"||Z[Q]==='"')U(Z[Q]);else if(Z[Q]==="`")W();else Q++;continue}Q++}},_=()=>{if(Z[Q]==="/"&&Z[Q+1]==="/"){while(Q<G&&Z[Q]!==`
|
|
9540
9550
|
`)Q++;return!0}if(Z[Q]==="/"&&Z[Q+1]==="*"){Q+=2;while(Q<G-1&&!(Z[Q]==="*"&&Z[Q+1]==="/"))Q++;return Q+=2,!0}return!1},B=()=>{if(J!==0)return;let j=Z.slice(Q).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(j){let V=j[2];if(!X.has(V))Y.push(V),X.add(V);return}let H=Z.slice(Q).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(H){H[1].split(",").forEach((V)=>{let A=V.trim();if(!A)return;let w=A.indexOf(":"),N=(w>=0?A.slice(w+1).trim():A).split(/[\s=]/)[0];if(N&&!X.has(N))Y.push(N),X.add(N)});return}let L=Z.slice(Q).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(L){L[1].split(",").forEach((V)=>{let A=V.trim().replace(/^\.\.\./,"");if(!A)return;let w=A.split(/[\s=]/)[0];if(w&&!X.has(w))Y.push(w),X.add(w)});return}let F=Z.slice(Q).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(F){let V=F[1];if(!X.has(V))Y.push(V),X.add(V);return}let O=Z.slice(Q).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let V=O[1];if(!X.has(V))Y.push(V),X.add(V)}};while(Q<G){if(_())continue;if(Z[Q]==="'"||Z[Q]==='"'){U(Z[Q]),K=Z[Q-1];continue}if(Z[Q]==="`"){W(),K="`";continue}if(Z[Q]==="/"&&Z[Q+1]!=="/"&&Z[Q+1]!=="*"&&z()){q(),K="/";continue}if(Z[Q]==="{"){J++,K="{",Q++;continue}if(Z[Q]==="}"){J--,K="}",Q++;continue}if(J===0&&/[a-z]/i.test(Z[Q])&&(Q===0||/\s|[;{}()]/.test(Z[Q-1])))B();if(!/\s/.test(Z[Q]))K=Z[Q];Q++}return Y.join(", ")}async function n6($,Z,Y,X){if(!u4($))return $;let J=$;if(Z.skipSignalsRuntime)return J;let{output:Q,setupCode:G}=await LX(J,Y,X);if(J=Q,J=await zX(J,Z),J=qX(J),G)if(J.includes("</head>"))J=J.replace("</head>",`${G}
|
|
9541
9551
|
</head>`);else if(J.includes("<body"))J=J.replace(/<body([^>]*)>/,`<body$1>
|