@stacksjs/stx 0.2.82 → 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/conditionals.js +1 -1
- package/dist/custom-directives.js +1 -1
- 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/error-handling.js +1 -1
- package/dist/errors/formatter.js +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/i18n.js +1 -1
- package/dist/includes.js +15 -5
- package/dist/index.js +15 -5
- package/dist/interactive.js +16 -6
- package/dist/lazy-loader.js +92 -82
- package/dist/misc-directives.js +1 -1
- 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/seo.js +1 -1
- 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 +16 -6
- 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/testing.js +141 -131
- package/dist/utils.js +15 -5
- package/dist/web-components.js +16 -6
- package/package.json +5 -5
package/dist/misc-directives.js
CHANGED
|
@@ -58,7 +58,7 @@ ${H}`)}if(q.suggestion)B.push(`
|
|
|
58
58
|
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),B.join("")}function nq(q,J,Z){let $=q.split(`
|
|
59
59
|
`),X=Math.max(0,J-Z-1),W=Math.min($.length-1,J+Z-1),V=[];for(let Y=X;Y<=W;Y++){let U=(Y+1).toString().padStart(4),B=Y===J-1?">":" ";V.push(`${B}${U} | ${$[Y]}`)}return V.join(`
|
|
60
60
|
`)}function aq(q,J,Z){let $=q.split(`
|
|
61
|
-
`),X=Math.max(0,J-Z-1),W=Math.min($.length-1,J+Z-1),V="\x1B[90m",Y="\x1B[31m",U="\x1B[0m",B=[];for(let G=X;G<=W;G++){let H=(G+1).toString().padStart(4),Q=G===J-1,F=Q?"\x1B[31m>\x1B[0m":" ",M=Q?`\x1B[31m${$[G]}\x1B[0m`:`\x1B[90m${$[G]}`;B.push(`${F}${H}\x1B[0m | ${M}`)}return B.join(`
|
|
61
|
+
`),X=Math.max(0,J-Z-1),W=Math.min($.length-1,J+Z-1),V="\x1B[90m",Y="\x1B[31m",U="\x1B[0m",B=[];for(let G=X;G<=W;G++){let H=(G+1).toString().padStart(4),Q=G===J-1,F=Q?"\x1B[31m>\x1B[0m":" ",M=Q?`\x1B[31m${$[G]}\x1B[0m`:`\x1B[90m${$[G]}\x1B[0m`;B.push(`${F}\x1B[90m${H}\x1B[0m | ${M}`)}return B.join(`
|
|
62
62
|
`)}function Fq(q){return q.replace(/--/g,"- -").replace(/>/g,">")}function Qq(q,J){let $=q.substring(0,J).split(`
|
|
63
63
|
`);return{line:$.length,column:$[$.length-1].length}}function tq(q,J,Z){return p({type:q,message:J,code:Z,format:"html"}).formatted}function eq(q,J,Z,$,X){return p({type:q,message:J,code:X,filePath:Z,line:$,format:"console"}).formatted}function qJ(q,J,Z){let $=Z.template.split(`
|
|
64
64
|
`),X=Qq(Z.template,Z.offset),W=`[${q} Error at line ${X.line} in ${Z.filePath}]: ${J}
|
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
|
@@ -1783,7 +1783,7 @@ ${z}`)}if($.suggestion)U.push(`
|
|
|
1783
1783
|
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),U.join("")}function Gq($,Z,Y){let X=$.split(`
|
|
1784
1784
|
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G=[];for(let K=J;K<=Q;K++){let q=(K+1).toString().padStart(4),U=K===Z-1?">":" ";G.push(`${U}${q} | ${X[K]}`)}return G.join(`
|
|
1785
1785
|
`)}function Kq($,Z,Y){let X=$.split(`
|
|
1786
|
-
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",U=[];for(let W=J;W<=Q;W++){let z=(W+1).toString().padStart(4),B=W===Z-1,_=B?"\x1B[31m>\x1B[0m":" ",j=B?`\x1B[31m${X[W]}\x1B[0m`:`\x1B[90m${X[W]}`;U.push(`${_}${z}\x1B[0m | ${j}`)}return U.join(`
|
|
1786
|
+
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",U=[];for(let W=J;W<=Q;W++){let z=(W+1).toString().padStart(4),B=W===Z-1,_=B?"\x1B[31m>\x1B[0m":" ",j=B?`\x1B[31m${X[W]}\x1B[0m`:`\x1B[90m${X[W]}\x1B[0m`;U.push(`${_}\x1B[90m${z}\x1B[0m | ${j}`)}return U.join(`
|
|
1787
1787
|
`)}function VZ($){return $.replace(/--/g,"- -").replace(/>/g,">")}function wZ($,Z){let X=$.substring(0,Z).split(`
|
|
1788
1788
|
`);return{line:X.length,column:X[X.length-1].length}}function r($,Z,Y){return K3({type:$,message:Z,code:Y,format:"html"}).formatted}function qq($,Z,Y,X,J){return K3({type:$,message:Z,code:J,filePath:Y,line:X,format:"console"}).formatted}function Uq($,Z,Y){let X=Y.template.split(`
|
|
1789
1789
|
`),J=wZ(Y.template,Y.offset),Q=`[${$} Error at line ${J.line} in ${Y.filePath}]: ${Z}
|
|
@@ -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;
|
|
@@ -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
|
@@ -1783,7 +1783,7 @@ ${W}`)}if($.suggestion)z.push(`
|
|
|
1783
1783
|
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),z.join("")}function cK($,Z,Y){let X=$.split(`
|
|
1784
1784
|
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G=[];for(let K=J;K<=Q;K++){let q=(K+1).toString().padStart(4),z=K===Z-1?">":" ";G.push(`${z}${q} | ${X[K]}`)}return G.join(`
|
|
1785
1785
|
`)}function iK($,Z,Y){let X=$.split(`
|
|
1786
|
-
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",z=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}`;z.push(`${B}${W}\x1B[0m | ${j}`)}return z.join(`
|
|
1786
|
+
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",z=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}\x1B[0m`;z.push(`${B}\x1B[90m${W}\x1B[0m | ${j}`)}return z.join(`
|
|
1787
1787
|
`)}function GZ($){return $.replace(/--/g,"- -").replace(/>/g,">")}function KZ($,Z){let X=$.substring(0,Z).split(`
|
|
1788
1788
|
`);return{line:X.length,column:X[X.length-1].length}}function r($,Z,Y){return $3({type:$,message:Z,code:Y,format:"html"}).formatted}function nK($,Z,Y,X,J){return $3({type:$,message:Z,code:J,filePath:Y,line:X,format:"console"}).formatted}function oK($,Z,Y){let X=Y.template.split(`
|
|
1789
1789
|
`),J=KZ(Y.template,Y.offset),Q=`[${$} Error at line ${J.line} in ${Y.filePath}]: ${Z}
|
|
@@ -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;
|
|
@@ -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>
|
package/dist/pwa.js
CHANGED
|
@@ -3689,7 +3689,7 @@ window.__stx_reactive = (function() {
|
|
|
3689
3689
|
|
|
3690
3690
|
return { initScope: initScope, reactive: reactive };
|
|
3691
3691
|
})();
|
|
3692
|
-
`}function AZ($,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 wq($,Z){if($.length===0)return"";let Y=$.map((X)=>{let Q=JSON.stringify(Object.fromEntries(X.refs)),J=AZ(X.stateExpr,Z),G=X.initExpr?AZ(X.initExpr,Z):null,K=JSON.stringify(J),q=G?JSON.stringify(G):"null";return`
|
|
3692
|
+
`}function AZ($,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 wq($,Z){if($.length===0)return"";let Y=$.map((X)=>{let Q=JSON.stringify(Object.fromEntries(X.refs)),J=AZ(X.stateExpr,Z),G=X.initExpr?AZ(X.initExpr,Z):null,K=JSON.stringify(J),q=G?JSON.stringify(G):"null";return`
|
|
3693
3693
|
(function() {
|
|
3694
3694
|
var scopeEl = document.querySelector('${X.selector}');
|
|
3695
3695
|
if (!scopeEl) return;
|
|
@@ -5734,6 +5734,13 @@ catch (e2) {
|
|
|
5734
5734
|
|
|
5735
5735
|
// Known directive names to exclude from generic :attr binding
|
|
5736
5736
|
var DIRECTIVE_NAMES = {class:1, style:1, text:1, html:1, show:1, model:1, 'if':1, 'for':1, ref:1};
|
|
5737
|
+
// SVG attributes are case-sensitive, but the HTML parser lowercases
|
|
5738
|
+
// prefixed attribute names \u2014 ':viewBox' arrives as ':viewbox' because
|
|
5739
|
+
// the spec's "adjust SVG attributes" step only covers unprefixed names.
|
|
5740
|
+
// Without restoring the canonical casing, setAttribute('viewbox') creates
|
|
5741
|
+
// a dead duplicate attribute and the real viewBox never updates.
|
|
5742
|
+
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'};
|
|
5743
|
+
var SVG_NS = 'http://www.w3.org/2000/svg';
|
|
5737
5744
|
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)/;
|
|
5738
5745
|
var KEY_MAP = {enter:'Enter', tab:'Tab', escape:'Escape', space:' ', up:'ArrowUp', down:'ArrowDown', left:'ArrowLeft', right:'ArrowRight', 'delete':'Delete', backspace:'Backspace'};
|
|
5739
5746
|
|
|
@@ -5758,7 +5765,8 @@ catch (e2) {
|
|
|
5758
5765
|
if (name.startsWith('@bind:') || name.startsWith('x-bind:')
|
|
5759
5766
|
|| (name.startsWith(':') && !name.startsWith('::') && !DIRECTIVE_NAMES[name.slice(1).split('.')[0]] && !EVENT_RE.test(name.slice(1)))
|
|
5760
5767
|
|| (name.startsWith('x-') && !X_HANDLED[name.split('.')[0]] && !X_HANDLED[name])) {
|
|
5761
|
-
|
|
5768
|
+
let attrName = name.startsWith('@bind:') ? name.slice(6) : name.startsWith('x-bind:') ? name.slice(7) : name.startsWith('x-') ? name.slice(2) : name.slice(1);
|
|
5769
|
+
if (el.namespaceURI === SVG_NS && SVG_ATTR_CASE[attrName]) attrName = SVG_ATTR_CASE[attrName];
|
|
5762
5770
|
effect(() => {
|
|
5763
5771
|
const v = evalAttrExpr(value);
|
|
5764
5772
|
if (v === false || v === null || v === undefined) {
|
|
@@ -6137,10 +6145,12 @@ else {
|
|
|
6137
6145
|
});
|
|
6138
6146
|
}
|
|
6139
6147
|
else if (Array.isArray(value)) {
|
|
6140
|
-
|
|
6148
|
+
var _clsArr = originalClasses + ' ' + value.filter(Boolean).join(' ');
|
|
6149
|
+
if (typeof el.className === 'string') el.className = _clsArr; else el.setAttribute('class', _clsArr);
|
|
6141
6150
|
}
|
|
6142
6151
|
else {
|
|
6143
|
-
|
|
6152
|
+
var _clsStr = originalClasses + (value ? ' ' + value : '');
|
|
6153
|
+
if (typeof el.className === 'string') el.className = _clsStr; else el.setAttribute('class', _clsStr);
|
|
6144
6154
|
}
|
|
6145
6155
|
});
|
|
6146
6156
|
}
|
|
@@ -9273,7 +9283,7 @@ ${B}${U}
|
|
|
9273
9283
|
return { ${z} };
|
|
9274
9284
|
}
|
|
9275
9285
|
if(window.stx)window.stx._latestSetup=${G};
|
|
9276
|
-
</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([^>]*)>/
|
|
9286
|
+
</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:_}}function IY($){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===`
|
|
9277
9287
|
`)return;J++}},W=()=>{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++}},z=()=>{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]==="`")z();else J++;continue}J++}},B=()=>{if(Z[J]==="/"&&Z[J+1]==="/"){while(J<G&&Z[J]!==`
|
|
9278
9288
|
`)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 R=w.indexOf(":"),N=(R>=0?w.slice(R+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 R=w.split(/[\s=]/)[0];if(R&&!X.has(R))Y.push(R),X.add(R)});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(B())continue;if(Z[J]==="'"||Z[J]==='"'){U(Z[J]),K=Z[J-1];continue}if(Z[J]==="`"){z(),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 e3($,Z,Y,X){if(!L4($))return $;let Q=$;if(Z.skipSignalsRuntime)return Q;let{output:J,setupCode:G}=await MY(Q,Y,X);if(Q=J,Q=await LY(Q,Z),Q=OY(Q),G)if(Q.includes("</head>"))Q=Q.replace("</head>",`${G}
|
|
9279
9289
|
</head>`);else if(Q.includes("<body"))Q=Q.replace(/<body([^>]*)>/,`<body$1>
|
package/dist/reactive.js
CHANGED
|
@@ -1477,7 +1477,7 @@ window.__stx_reactive = (function() {
|
|
|
1477
1477
|
|
|
1478
1478
|
return { initScope: initScope, reactive: reactive };
|
|
1479
1479
|
})();
|
|
1480
|
-
`}function n4($,Z){let Y=$.replace(/\{!!([\s\S]*?)!!\}/g,(J,X)=>{try{let G=q0(X,Z,!0);if(G===void 0)return J;return String(G)}catch{return J}});return Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(J,X)=>{try{let G=q0(X,Z,!0);if(G===void 0)return J;return JSON.stringify(G)}catch{return J}}),Y}function n6($,Z){if($.length===0)return"";let Y=$.map((J)=>{let X=JSON.stringify(Object.fromEntries(J.refs)),G=n4(J.stateExpr,Z),Q=J.initExpr?n4(J.initExpr,Z):null,K=JSON.stringify(G),U=Q?JSON.stringify(Q):"null";return`
|
|
1480
|
+
`}function n4($,Z){let Y=$.replace(/\{!!([\s\S]*?)!!\}/g,(J,X)=>{try{let G=q0(X,Z,!0);if(G===void 0)return J;return String(G)}catch{return J}});return Y=Y.replace(/\{\{([\s\S]*?)\}\}/g,(J,X)=>{try{let G=q0(X,Z,!0);if(G===void 0)return J;if(typeof G==="string"){let Q=G.trim();if(Q.startsWith("{")&&Q.endsWith("}")||Q.startsWith("[")&&Q.endsWith("]"))try{return JSON.parse(Q),Q}catch{}}return JSON.stringify(G)}catch{return J}}),Y}function n6($,Z){if($.length===0)return"";let Y=$.map((J)=>{let X=JSON.stringify(Object.fromEntries(J.refs)),G=n4(J.stateExpr,Z),Q=J.initExpr?n4(J.initExpr,Z):null,K=JSON.stringify(G),U=Q?JSON.stringify(Q):"null";return`
|
|
1481
1481
|
(function() {
|
|
1482
1482
|
var scopeEl = document.querySelector('${J.selector}');
|
|
1483
1483
|
if (!scopeEl) return;
|