solely 0.4.14 → 0.4.16
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/compiler/ir/buildIR.cjs +1 -1
- package/dist/compiler/ir/buildIR.js +1 -1
- package/dist/compiler/parser/parser.cjs +1 -1
- package/dist/compiler/parser/parser.js +1 -1
- package/dist/components/elements/steps/index.html.cjs +1 -1
- package/dist/components/elements/steps/index.html.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/runtime/component/base-element.cjs +1 -1
- package/dist/runtime/component/base-element.js +1 -1
- package/dist/runtime/component/decorators.cjs +1 -1
- package/dist/runtime/component/decorators.js +1 -1
- package/dist/runtime/reactivity/observe.cjs +1 -1
- package/dist/runtime/reactivity/observe.js +1 -1
- package/dist/runtime/renderer/html-decode.cjs +1 -1
- package/dist/runtime/renderer/html-decode.d.ts +1 -2
- package/dist/runtime/renderer/html-decode.js +1 -1
- package/dist/runtime/renderer/renderIR.cjs +1 -1
- package/dist/runtime/renderer/renderIR.js +1 -1
- package/dist/shared/case-convert.cjs +1 -0
- package/dist/shared/case-convert.d.ts +1 -0
- package/dist/shared/case-convert.js +1 -0
- package/dist/shared/index.cjs +1 -1
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +1 -1
- package/dist/shared/is-object.cjs +1 -1
- package/dist/shared/is-object.d.ts +0 -5
- package/dist/shared/is-object.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=Object.defineProperty,t=(t,n,o)=>((t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o)(t,"symbol"!=typeof n?n+"":n,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../shared/gen-function.cjs"),o=require("../../shared/env.cjs"),c=require("../../types/ast.cjs"),l=require("../../types/lifecycle.cjs"),i=/\{\{[\s\S]*?\}\}/,s={"solely-checkbox":{prop:"checked",event:"change"},"solely-switch":{prop:"checked",event:"change"},"solely-radio":{prop:"checked",event:"change"}},r=new class{constructor(){t(this,"compilers",new Map)}get(e="anonymous"){let t=this.compilers.get(e);return t||(t=new a,this.compilers.set(e,t)),t}clear(e){var t;if(e)null==(t=this.compilers.get(e))||t.clear(),this.compilers.delete(e);else{for(const e of this.compilers.values())e.clear();this.compilers.clear()}}};class a{constructor(){t(this,"cache",new Map),t(this,"functions",[])}makeCacheKey(e,t,n){return 0===n.length?`${e}:${t}`:`${e}:${t}:${n.map(e
|
|
1
|
+
"use strict";var e=Object.defineProperty,t=(t,n,o)=>((t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o)(t,"symbol"!=typeof n?n+"":n,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../shared/gen-function.cjs"),o=require("../../shared/env.cjs"),c=require("../../types/ast.cjs"),l=require("../../types/lifecycle.cjs"),i=/\{\{[\s\S]*?\}\}/,s={"solely-checkbox":{prop:"checked",event:"change"},"solely-switch":{prop:"checked",event:"change"},"solely-radio":{prop:"checked",event:"change"}},r=new class{constructor(){t(this,"compilers",new Map)}get(e="anonymous"){let t=this.compilers.get(e);return t||(t=new a,this.compilers.set(e,t)),t}clear(e){var t;if(e)null==(t=this.compilers.get(e))||t.clear(),this.compilers.delete(e);else{for(const e of this.compilers.values())e.clear();this.compilers.clear()}}};class a{constructor(){t(this,"cache",new Map),t(this,"functions",[])}makeCacheKey(e,t,n){return 0===n.length?`${e}:${t}`:`${e}:${t}:${n.map(e=>`${e.i}:${e.x}`).join(";")}`}compile(e,t,c){const l=null==t?void 0:t.trim();if(!l)return 0;const i=this.makeCacheKey(e,l,c),s=this.cache.get(i);if(void 0!==s)return s;let r;try{r=n.genFunction(l,e,c)}catch(u){o.IS_DEV&&console.error(`[Solely] IR Compile Error - Type: ${e}, Expr: "${l}"`,u),r=()=>""}const a=this.functions.push(r);return this.cache.set(i,a),a}getFunctions(){return this.functions}getStats(){return{total:this.functions.length,cached:this.cache.size}}clear(){this.cache.clear(),this.functions=[]}}function u(e){const t=e[0];return":"===t?{isDynamic:!0,type:"expression"}:"@"===t?{isDynamic:!0,type:"handler"}:l.isLifecycleKind(e)?{isDynamic:!0,type:"lifecycle"}:{isDynamic:!1,type:null}}function d(e,t,n){e.__m={expr:t??"",loc:n??void 0}}function f(e){if(!e.attrs)return;const t=e.attrs.find(e=>"s-model"===e.key);if(!t)return;const n=t.value.trim(),o=n.startsWith("$data.")?n:`$data.${n.replace(/^this\./,"")}`,c=t.loc,l=(e.tag||"").toLowerCase(),i=e.attrs.find(e=>"type"===e.key),r=(null==i?void 0:i.value)??"text";e.attrs=e.attrs.filter(e=>e!==t);const a=(t,n,o)=>{var l;null==(l=e.attrs)||l.push({key:t,value:n,role:o,loc:c})};if("input"===l){if("checkbox"===r){const t=e.attrs.find(e=>"value"===e.key),n=t?JSON.stringify(t.value):'"on"';return a(":checked",`Array.isArray(${o}) ? ${o}.includes(${n}) : ${o}`),void a("@change",`\n const _v = ${n};\n if(Array.isArray(${o})) {\n const _i = ${o}.indexOf(_v);\n if(checked && _i === -1) ${o}.push(_v);\n else if(!checked && _i > -1) ${o}.splice(_i,1);\n } else {\n ${o} = checked;\n }`,"model")}if("radio"===r){const t=e.attrs.find(e=>"value"===e.key),n=(null==t?void 0:t.value)??"null";return a(":checked",`${o} == ${JSON.stringify(n)}`),void a("@change",`if (checked) ${o} = ${JSON.stringify(n)}`,"model")}return a(":value",o),void a("@input",`${o} = value`,"model")}if("textarea"===l)return a(":value",o),void a("@input",`${o} = value`,"model");if("select"===l)return void(e.attrs.some(e=>"multiple"===e.key)?(a("updated",`\n const values = Array.isArray(${o}) ? ${o} : ${o} != null ? [${o}] : [];\n for (const opt of el.options) {\n opt.selected = values.includes(opt.value);\n }`),a("@change",`${o} = Array.from(event.target.selectedOptions).map(o => o.value)`,"model")):(a(":value",o),a("@change",`${o} = value`,"model")));const u=s[l],d=(null==u?void 0:u.prop)??"value",f=(null==u?void 0:u.event)??"change";a(`:${d}`,o),a(`@${f}`,`${o} = ${"checked"===d?"checked":"value"===d?"value":`event.target.${d}`}`,"model")}function p(e,t,n,o=null){if(!e.attrs||0===e.attrs.length)return[];const c=[];for(const l of e.attrs){if(o&&o.has(l.key))continue;const{key:i,value:s,role:r}=l,{isDynamic:a,type:f}=u(i);if(a&&f){const o={k:i,f:n.compile(f,s??"",t),d:1,r:r};d(o,s,l.loc??e.loc),c.push(o)}else c.push({k:i,v:s,d:0,r:r})}return c}function h(e){let t=0===e.d;if(e.c&&e.c.length>0)for(const n of e.c)h(n)||(t=!1);if(e.b&&e.b.length>0)for(const n of e.b)if(n.c&&n.c.length>0)for(const e of n.c)h(e)||(t=!1);return!t||e.t!==c.ASTType.Element&&e.t!==c.ASTType.Text||(e.s=1),t}function y(e,t,n){var l,s,r,a,h,y;const m={t:e.type,d:0};let g=!1;var T;switch(e.type===c.ASTType.Text?(T=e.content)&&i.test(T)&&(g=!0):((null==(l=e.attrs)?void 0:l.some(e=>"s-model"===e.key||u(e.key).isDynamic))&&(g=!0),e.type===c.ASTType.For&&(g=!0)),m.d=g?1:0,e.type){case c.ASTType.Text:{const o=e.content??"";g?(m.f=n.compile("template",o,t),d(m,o,e.loc)):m.x=o;break}case c.ASTType.Element:m.g=e.tag,f(e),m.a=p(e,t,n),e.children&&(m.c=v(e.children,t,n));break;case c.ASTType.For:{const o=null==(s=e.attrs)?void 0:s.find(e=>"each"===e.key),c=(null==o?void 0:o.value)??"";m.f=n.compile("expression",c,t),m.i=(null==(a=null==(r=e.attrs)?void 0:r.find(e=>"item"===e.key))?void 0:a.value)??"item",m.n=(null==(y=null==(h=e.attrs)?void 0:h.find(e=>"index"===e.key))?void 0:y.value)??"index",d(m,c,(null==o?void 0:o.loc)??e.loc);const l=new Set(["each","item","index"]);m.a=p(e,t,n,l);const i=[...t,{i:m.i,x:m.n}];e.children&&(m.c=v(e.children,i,n));break}case c.ASTType.If:case c.ASTType.ElseIf:case c.ASTType.Else:o.IS_DEV&&console.warn(`[Solely] Orphaned conditional node found: ${c.ASTType[e.type]}`),m.a=p(e,t,n),e.children&&(m.c=v(e.children,t,n));break;case c.ASTType.Comment:m.x=e.content??""}return m}function v(e,t,n){var o;const l=[];let i=0;for(;i<e.length;){const s=e[i];if(s.type===c.ASTType.If){const r=[];let a=i;for(;a<e.length;){const l=e[a],i=l.type;if(i!==c.ASTType.If&&i!==c.ASTType.ElseIf&&i!==c.ASTType.Else)break;if(i===c.ASTType.If&&r.length>0)break;let s,u=null,d="";if(i!==c.ASTType.Else){const e=null==(o=l.attrs)?void 0:o.find(e=>"test"===e.key||"condition"===e.key);d=(null==e?void 0:e.value)??"false",u=n.compile("expression",d,t),s=(null==e?void 0:e.loc)??l.loc}const f=l.children?v(l.children,t,n):[],h=p(l,t,n,new Set(["test","condition"]));if(r.push({f:u,c:f,a:h.length>0?h:void 0,__m:{expr:d,loc:s}}),a++,i===c.ASTType.Else)break}l.push({t:c.ASTType.Conditional,d:1,b:r,__m:{loc:s.loc}}),i=a}else l.push(y(s,t,n)),i++}return l}exports.buildIR=function(e,t={}){const{filename:n="anonymous",source:c}=t,l=r.get(n);l.clear();const i=performance.now(),s=v(e,[],l);for(const o of s)h(o);const a=performance.now(),u=l.getStats(),d=s.filter(e=>1===e.d).length,f=s.filter(e=>1===e.s).length,p={t:"root",v:"1.2.0",fns:l.getFunctions(),n:s,s:{tf:u.total,cf:u.cached,dn:d,tn:s.length,sn:f},m:{t:(new Date).toISOString(),as:e.length,fn:n,...c&&{src:c}}};return o.IS_DEV&&console.info(`[Solely] Compiled <${n}> in ${(a-i).toFixed(2)}ms | Nodes: ${s.length} | Fns: ${u.total} | StaticSubtrees: ${f}`),p},exports.clearIRCache=function(e){r.clear(e)},exports.transformModel=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,n,o)=>((t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o)(t,"symbol"!=typeof n?n+"":n,o);import{genFunction as n}from"../../shared/gen-function.js";import{IS_DEV as o}from"../../shared/env.js";import{ASTType as c}from"../../types/ast.js";import{isLifecycleKind as l}from"../../types/lifecycle.js";const i=/\{\{[\s\S]*?\}\}/,s={"solely-checkbox":{prop:"checked",event:"change"},"solely-switch":{prop:"checked",event:"change"},"solely-radio":{prop:"checked",event:"change"}},r=new class{constructor(){t(this,"compilers",new Map)}get(e="anonymous"){let t=this.compilers.get(e);return t||(t=new a,this.compilers.set(e,t)),t}clear(e){var t;if(e)null==(t=this.compilers.get(e))||t.clear(),this.compilers.delete(e);else{for(const e of this.compilers.values())e.clear();this.compilers.clear()}}};class a{constructor(){t(this,"cache",new Map),t(this,"functions",[])}makeCacheKey(e,t,n){return 0===n.length?`${e}:${t}`:`${e}:${t}:${n.map(e
|
|
1
|
+
var e=Object.defineProperty,t=(t,n,o)=>((t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o)(t,"symbol"!=typeof n?n+"":n,o);import{genFunction as n}from"../../shared/gen-function.js";import{IS_DEV as o}from"../../shared/env.js";import{ASTType as c}from"../../types/ast.js";import{isLifecycleKind as l}from"../../types/lifecycle.js";const i=/\{\{[\s\S]*?\}\}/,s={"solely-checkbox":{prop:"checked",event:"change"},"solely-switch":{prop:"checked",event:"change"},"solely-radio":{prop:"checked",event:"change"}},r=new class{constructor(){t(this,"compilers",new Map)}get(e="anonymous"){let t=this.compilers.get(e);return t||(t=new a,this.compilers.set(e,t)),t}clear(e){var t;if(e)null==(t=this.compilers.get(e))||t.clear(),this.compilers.delete(e);else{for(const e of this.compilers.values())e.clear();this.compilers.clear()}}};class a{constructor(){t(this,"cache",new Map),t(this,"functions",[])}makeCacheKey(e,t,n){return 0===n.length?`${e}:${t}`:`${e}:${t}:${n.map(e=>`${e.i}:${e.x}`).join(";")}`}compile(e,t,c){const l=null==t?void 0:t.trim();if(!l)return 0;const i=this.makeCacheKey(e,l,c),s=this.cache.get(i);if(void 0!==s)return s;let r;try{r=n(l,e,c)}catch(u){o&&console.error(`[Solely] IR Compile Error - Type: ${e}, Expr: "${l}"`,u),r=()=>""}const a=this.functions.push(r);return this.cache.set(i,a),a}getFunctions(){return this.functions}getStats(){return{total:this.functions.length,cached:this.cache.size}}clear(){this.cache.clear(),this.functions=[]}}function u(e){const t=e[0];return":"===t?{isDynamic:!0,type:"expression"}:"@"===t?{isDynamic:!0,type:"handler"}:l(e)?{isDynamic:!0,type:"lifecycle"}:{isDynamic:!1,type:null}}function f(e,t,n){e.__m={expr:t??"",loc:n??void 0}}function d(e){if(!e.attrs)return;const t=e.attrs.find(e=>"s-model"===e.key);if(!t)return;const n=t.value.trim(),o=n.startsWith("$data.")?n:`$data.${n.replace(/^this\./,"")}`,c=t.loc,l=(e.tag||"").toLowerCase(),i=e.attrs.find(e=>"type"===e.key),r=(null==i?void 0:i.value)??"text";e.attrs=e.attrs.filter(e=>e!==t);const a=(t,n,o)=>{var l;null==(l=e.attrs)||l.push({key:t,value:n,role:o,loc:c})};if("input"===l){if("checkbox"===r){const t=e.attrs.find(e=>"value"===e.key),n=t?JSON.stringify(t.value):'"on"';return a(":checked",`Array.isArray(${o}) ? ${o}.includes(${n}) : ${o}`),void a("@change",`\n const _v = ${n};\n if(Array.isArray(${o})) {\n const _i = ${o}.indexOf(_v);\n if(checked && _i === -1) ${o}.push(_v);\n else if(!checked && _i > -1) ${o}.splice(_i,1);\n } else {\n ${o} = checked;\n }`,"model")}if("radio"===r){const t=e.attrs.find(e=>"value"===e.key),n=(null==t?void 0:t.value)??"null";return a(":checked",`${o} == ${JSON.stringify(n)}`),void a("@change",`if (checked) ${o} = ${JSON.stringify(n)}`,"model")}return a(":value",o),void a("@input",`${o} = value`,"model")}if("textarea"===l)return a(":value",o),void a("@input",`${o} = value`,"model");if("select"===l)return void(e.attrs.some(e=>"multiple"===e.key)?(a("updated",`\n const values = Array.isArray(${o}) ? ${o} : ${o} != null ? [${o}] : [];\n for (const opt of el.options) {\n opt.selected = values.includes(opt.value);\n }`),a("@change",`${o} = Array.from(event.target.selectedOptions).map(o => o.value)`,"model")):(a(":value",o),a("@change",`${o} = value`,"model")));const u=s[l],f=(null==u?void 0:u.prop)??"value",d=(null==u?void 0:u.event)??"change";a(`:${f}`,o),a(`@${d}`,`${o} = ${"checked"===f?"checked":"value"===f?"value":`event.target.${f}`}`,"model")}function h(e,t,n,o=null){if(!e.attrs||0===e.attrs.length)return[];const c=[];for(const l of e.attrs){if(o&&o.has(l.key))continue;const{key:i,value:s,role:r}=l,{isDynamic:a,type:d}=u(i);if(a&&d){const o={k:i,f:n.compile(d,s??"",t),d:1,r:r};f(o,s,l.loc??e.loc),c.push(o)}else c.push({k:i,v:s,d:0,r:r})}return c}function p(e){let t=0===e.d;if(e.c&&e.c.length>0)for(const n of e.c)p(n)||(t=!1);if(e.b&&e.b.length>0)for(const n of e.b)if(n.c&&n.c.length>0)for(const e of n.c)p(e)||(t=!1);return!t||e.t!==c.Element&&e.t!==c.Text||(e.s=1),t}function v(e,t,n){var l,s,r,a,p,v;const y={t:e.type,d:0};let $=!1;var g;switch(e.type===c.Text?(g=e.content)&&i.test(g)&&($=!0):((null==(l=e.attrs)?void 0:l.some(e=>"s-model"===e.key||u(e.key).isDynamic))&&($=!0),e.type===c.For&&($=!0)),y.d=$?1:0,e.type){case c.Text:{const o=e.content??"";$?(y.f=n.compile("template",o,t),f(y,o,e.loc)):y.x=o;break}case c.Element:y.g=e.tag,d(e),y.a=h(e,t,n),e.children&&(y.c=m(e.children,t,n));break;case c.For:{const o=null==(s=e.attrs)?void 0:s.find(e=>"each"===e.key),c=(null==o?void 0:o.value)??"";y.f=n.compile("expression",c,t),y.i=(null==(a=null==(r=e.attrs)?void 0:r.find(e=>"item"===e.key))?void 0:a.value)??"item",y.n=(null==(v=null==(p=e.attrs)?void 0:p.find(e=>"index"===e.key))?void 0:v.value)??"index",f(y,c,(null==o?void 0:o.loc)??e.loc);const l=new Set(["each","item","index"]);y.a=h(e,t,n,l);const i=[...t,{i:y.i,x:y.n}];e.children&&(y.c=m(e.children,i,n));break}case c.If:case c.ElseIf:case c.Else:o&&console.warn(`[Solely] Orphaned conditional node found: ${c[e.type]}`),y.a=h(e,t,n),e.children&&(y.c=m(e.children,t,n));break;case c.Comment:y.x=e.content??""}return y}function m(e,t,n){var o;const l=[];let i=0;for(;i<e.length;){const s=e[i];if(s.type===c.If){const r=[];let a=i;for(;a<e.length;){const l=e[a],i=l.type;if(i!==c.If&&i!==c.ElseIf&&i!==c.Else)break;if(i===c.If&&r.length>0)break;let s,u=null,f="";if(i!==c.Else){const e=null==(o=l.attrs)?void 0:o.find(e=>"test"===e.key||"condition"===e.key);f=(null==e?void 0:e.value)??"false",u=n.compile("expression",f,t),s=(null==e?void 0:e.loc)??l.loc}const d=l.children?m(l.children,t,n):[],p=h(l,t,n,new Set(["test","condition"]));if(r.push({f:u,c:d,a:p.length>0?p:void 0,__m:{expr:f,loc:s}}),a++,i===c.Else)break}l.push({t:c.Conditional,d:1,b:r,__m:{loc:s.loc}}),i=a}else l.push(v(s,t,n)),i++}return l}function y(e,t={}){const{filename:n="anonymous",source:c}=t,l=r.get(n);l.clear();const i=performance.now(),s=m(e,[],l);for(const o of s)p(o);const a=performance.now(),u=l.getStats(),f=s.filter(e=>1===e.d).length,d=s.filter(e=>1===e.s).length,h={t:"root",v:"1.2.0",fns:l.getFunctions(),n:s,s:{tf:u.total,cf:u.cached,dn:f,tn:s.length,sn:d},m:{t:(new Date).toISOString(),as:e.length,fn:n,...c&&{src:c}}};return o&&console.info(`[Solely] Compiled <${n}> in ${(a-i).toFixed(2)}ms | Nodes: ${s.length} | Fns: ${u.total} | StaticSubtrees: ${d}`),h}function $(e){r.clear(e)}export{y as buildIR,$ as clearIRCache,d as transformModel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../shared/event-listeners.cjs"),e=require("../../types/ast.cjs"),n=require("../../types/lifecycle.cjs"),s=/<\/?([A-Za-z][A-Za-z0-9\-\:]*)[>\s\/]/,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../shared/event-listeners.cjs"),e=require("../../types/ast.cjs"),n=require("../../types/lifecycle.cjs"),s=/<\/?([A-Za-z][A-Za-z0-9\-\:]*)[>\s\/]/,r=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),o=/\s*([^\s"'/>=]+)(?:=(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/gs;function i(r,i){var c;const l=(null==(c=(r.match(s)||[])[1])?void 0:c.toLowerCase())??"",a=function(e,s){o.lastIndex=0;const r=[];let i;const c=e.replace(/^\s*[^\s"'/>]+/,""),l=e.length-c.length;for(;null!==(i=o.exec(c));){const o=i[1];if(!o)continue;const c=i[2]??i[3]??i[4]??"";let a=o;t.default.has(o)&&(a=a.replace(/^on/,"@")),"s-model"!==a&&(a=a.replace(/^on-/,"@").replace(/^s-/,":")),a=n.mapAttrKeyToLifecycleKind(a)||a;const h=i[0],f=h.indexOf("=");let u;if(-1===f)u=h.indexOf(o)+o.length;else{let t=f+1;for(;t<h.length&&/\s/.test(h[t]);)t++;if('"'===h[t]||"'"===h[t]){let e=t+1;for(;e<h.length&&/\s/.test(h[e]);)e++;u=e}else{let e=t;for(;e<h.length&&/\s/.test(h[e]);)e++;u=e}}const p=i.index+u+l,g=e.slice(0,p).split("\n"),T=s[0]+g.length-1,y=g.length>1?g[g.length-1].length+1:s[1]+p;r.push({key:a,value:c,loc:[T,y]})}return r}(r,i);return{type:{for:e.ASTType.For,if:e.ASTType.If,elseif:e.ASTType.ElseIf,else:e.ASTType.Else}[l]??e.ASTType.Element,tag:l,loc:i,children:[],attrs:a}}function c(t,e){const n=t.length;if(t.startsWith("!--",e)){const n=t.indexOf("--\x3e",e+3);return-1===n?-1:n+2}if(t.startsWith("![CDATA[",e)){const n=t.indexOf("]]>",e+8);return-1===n?-1:n+2}if("!"===t[e])return t.indexOf(">",e+1);if("?"===t[e]){const n=t.indexOf("?>",e+1);return-1===n?-1:n+1}let s=!1,r=!1,o=e;for(;o<n;){const e=t[o];if("'"!==e||r)if('"'!==e||s){if(">"===e&&!s&&!r)return o}else r=!r;else s=!s;o++}return-1}exports.parseHtml=function(t){var n,o;const l=[];if(!t)return[];const a=[],h=()=>{var t;return 0===a.length?l:(t=a[a.length-1]).children||(t.children=[])};let f=0;const u=t.length,p=[0];let g=0;for(;-1!==(g=t.indexOf("\n",g));)p.push(++g);function T(t){let e=0,n=p.length-1;for(;e<=n;){const s=e+n>>>1;p[s]<=t?e=s+1:n=s-1}return[n+1,t-p[n]+1]}for(;f<u;){const l=t.indexOf("<",f);if(-1===l||l>f){const n=t.substring(f,-1===l?void 0:l),s=a.length>0?a[a.length-1]:null;let r,o;if(!s||"pre"!==s.tag&&"code"!==s.tag&&"textarea"!==s.tag&&"script"!==s.tag&&"style"!==s.tag){if(r=n.trim(),""===r){if(f=l,-1===l)break;continue}o=f+(n.length-n.trimStart().length)}else r=n,o=f;const i=h(),c=i[i.length-1];if(c&&c.type===e.ASTType.Text)c.content+=r;else{const t=T(o);i.push({type:e.ASTType.Text,tag:"text",content:r,loc:t,children:[]})}if(-1===l)break;f=l}const p=c(t,f+1);if(-1===p){const n=t.substring(f);n.trim()&&h().push({type:e.ASTType.Text,tag:"text",content:n.trim(),children:[],loc:T(f)});break}const g=t.substring(f,p+1),y=h(),d=T(f);if(g.startsWith("\x3c!--")){y.push({type:e.ASTType.Comment,tag:"comment",content:g.slice(4,-3),loc:d,children:[]}),f=p+1;continue}if(g.startsWith("<![CDATA[")){y.push({type:e.ASTType.Text,tag:"text",content:g.slice(9,-3),loc:d,children:[]}),f=p+1;continue}if(g.startsWith("<!")&&!g.startsWith("\x3c!--")){y.push({type:e.ASTType.Comment,tag:"comment",content:g.slice(2,-1),loc:d,children:[]}),f=p+1;continue}if(g.startsWith("<?")){y.push({type:e.ASTType.Comment,tag:"comment",content:g.slice(2,-2),loc:d,children:[]}),f=p+1;continue}if(g.startsWith("</")){const t=null==(n=(g.match(s)||[])[1])?void 0:n.toLowerCase();if(t){let e=-1;for(let n=a.length-1;n>=0;n--)if((null==(o=a[n].tag)?void 0:o.toLowerCase())===t){e=n;break}-1!==e&&(a.length=e)}f=p+1;continue}const x=i(g,d);y.push(x);const m=x.tag||"",A=m.toLowerCase().startsWith("script"),S=m.toLowerCase().startsWith("style"),b=g.endsWith("/>")||r.has(m.toLowerCase());if((A||S)&&!b){const n=`</${m}>`,s=t.toLowerCase().indexOf(n,p+1);if(-1!==s){const r=t.substring(p+1,s);r.length&&x.children.push({type:e.ASTType.Text,tag:"text",content:r,loc:T(p+1),children:[]}),f=s+n.length;continue}{const n=t.substring(p+1);n.length&&x.children.push({type:e.ASTType.Text,tag:"text",content:n,loc:T(p+1),children:[]}),f=u;continue}}b||x.type===e.ASTType.Text||x.type===e.ASTType.Comment||a.push(x),f=p+1}return l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"../../shared/event-listeners.js";import{ASTType as e}from"../../types/ast.js";import{mapAttrKeyToLifecycleKind as n}from"../../types/lifecycle.js";const s=/<\/?([A-Za-z][A-Za-z0-9\-\:]*)[>\s\/]/,o=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),r=/\s*([^\s"'/>=]+)(?:=(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/gs;function i(o,i){var
|
|
1
|
+
import t from"../../shared/event-listeners.js";import{ASTType as e}from"../../types/ast.js";import{mapAttrKeyToLifecycleKind as n}from"../../types/lifecycle.js";const s=/<\/?([A-Za-z][A-Za-z0-9\-\:]*)[>\s\/]/,o=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),r=/\s*([^\s"'/>=]+)(?:=(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/gs;function i(o,i){var l;const c=(null==(l=(o.match(s)||[])[1])?void 0:l.toLowerCase())??"",h=function(e,s){r.lastIndex=0;const o=[];let i;const l=e.replace(/^\s*[^\s"'/>]+/,""),c=e.length-l.length;for(;null!==(i=r.exec(l));){const r=i[1];if(!r)continue;const l=i[2]??i[3]??i[4]??"";let h=r;t.has(r)&&(h=h.replace(/^on/,"@")),"s-model"!==h&&(h=h.replace(/^on-/,"@").replace(/^s-/,":")),h=n(h)||h;const a=i[0],f=a.indexOf("=");let u;if(-1===f)u=a.indexOf(r)+r.length;else{let t=f+1;for(;t<a.length&&/\s/.test(a[t]);)t++;if('"'===a[t]||"'"===a[t]){let e=t+1;for(;e<a.length&&/\s/.test(a[e]);)e++;u=e}else{let e=t;for(;e<a.length&&/\s/.test(a[e]);)e++;u=e}}const g=i.index+u+c,p=e.slice(0,g).split("\n"),d=s[0]+p.length-1,m=p.length>1?p[p.length-1].length+1:s[1]+g;o.push({key:h,value:l,loc:[d,m]})}return o}(o,i);return{type:{for:e.For,if:e.If,elseif:e.ElseIf,else:e.Else}[c]??e.Element,tag:c,loc:i,children:[],attrs:h}}function l(t,e){const n=t.length;if(t.startsWith("!--",e)){const n=t.indexOf("--\x3e",e+3);return-1===n?-1:n+2}if(t.startsWith("![CDATA[",e)){const n=t.indexOf("]]>",e+8);return-1===n?-1:n+2}if("!"===t[e])return t.indexOf(">",e+1);if("?"===t[e]){const n=t.indexOf("?>",e+1);return-1===n?-1:n+1}let s=!1,o=!1,r=e;for(;r<n;){const e=t[r];if("'"!==e||o)if('"'!==e||s){if(">"===e&&!s&&!o)return r}else o=!o;else s=!s;r++}return-1}function c(t){var n,r;const c=[];if(!t)return[];const h=[],a=()=>{var t;return 0===h.length?c:(t=h[h.length-1]).children||(t.children=[])};let f=0;const u=t.length,g=[0];let p=0;for(;-1!==(p=t.indexOf("\n",p));)g.push(++p);function d(t){let e=0,n=g.length-1;for(;e<=n;){const s=e+n>>>1;g[s]<=t?e=s+1:n=s-1}return[n+1,t-g[n]+1]}for(;f<u;){const c=t.indexOf("<",f);if(-1===c||c>f){const n=t.substring(f,-1===c?void 0:c),s=h.length>0?h[h.length-1]:null;let o,r;if(!s||"pre"!==s.tag&&"code"!==s.tag&&"textarea"!==s.tag&&"script"!==s.tag&&"style"!==s.tag){if(o=n.trim(),""===o){if(f=c,-1===c)break;continue}r=f+(n.length-n.trimStart().length)}else o=n,r=f;const i=a(),l=i[i.length-1];if(l&&l.type===e.Text)l.content+=o;else{const t=d(r);i.push({type:e.Text,tag:"text",content:o,loc:t,children:[]})}if(-1===c)break;f=c}const g=l(t,f+1);if(-1===g){const n=t.substring(f);n.trim()&&a().push({type:e.Text,tag:"text",content:n.trim(),children:[],loc:d(f)});break}const p=t.substring(f,g+1),m=a(),x=d(f);if(p.startsWith("\x3c!--")){m.push({type:e.Comment,tag:"comment",content:p.slice(4,-3),loc:x,children:[]}),f=g+1;continue}if(p.startsWith("<![CDATA[")){m.push({type:e.Text,tag:"text",content:p.slice(9,-3),loc:x,children:[]}),f=g+1;continue}if(p.startsWith("<!")&&!p.startsWith("\x3c!--")){m.push({type:e.Comment,tag:"comment",content:p.slice(2,-1),loc:x,children:[]}),f=g+1;continue}if(p.startsWith("<?")){m.push({type:e.Comment,tag:"comment",content:p.slice(2,-2),loc:x,children:[]}),f=g+1;continue}if(p.startsWith("</")){const t=null==(n=(p.match(s)||[])[1])?void 0:n.toLowerCase();if(t){let e=-1;for(let n=h.length-1;n>=0;n--)if((null==(r=h[n].tag)?void 0:r.toLowerCase())===t){e=n;break}-1!==e&&(h.length=e)}f=g+1;continue}const y=i(p,x);m.push(y);const b=y.tag||"",C=b.toLowerCase().startsWith("script"),W=b.toLowerCase().startsWith("style"),v=p.endsWith("/>")||o.has(b.toLowerCase());if((C||W)&&!v){const n=`</${b}>`,s=t.toLowerCase().indexOf(n,g+1);if(-1!==s){const o=t.substring(g+1,s);o.length&&y.children.push({type:e.Text,tag:"text",content:o,loc:d(g+1),children:[]}),f=s+n.length;continue}{const n=t.substring(g+1);n.length&&y.children.push({type:e.Text,tag:"text",content:n,loc:d(g+1),children:[]}),f=u;continue}}v||y.type===e.Text||y.type===e.Comment||h.push(y),f=g+1}return c}export{c as parseHtml};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:a}=this;return this.getStepsClasses()},function(t){const{$data:a}=this;return!a.useSlot},function(t){const{$data:a}=this;return this.getParsedItems()},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return this.getStepClasses(s,i)},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return"process"===this.getStepStatus(i)?"step":void 0},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return s.disabled?"true":"false"},function(t,a){const{$data:s}=this,{value:i,checked:d}=(null==t?void 0:t.target)||{};var[n]=a.map(t=>t.itmVal),[e]=a.map(t=>t.idxVal);this.handleStepClick(n,e)},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return this.getIconClasses(s)},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return s.icon?this.getIconStyle(s):""},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return!a.progressDot},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return s.icon||"finish"===this.getStepStatus(i)||"error"===this.getStepStatus(i)},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return`${this.getStepIcon(s,i)}`},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return`${i+1}`},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return`${s.title}`},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return s.description},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return`${s.description}`},function(t){const{$data:a}=this;return a.useSlot},function(t){const{$data:a}=this;return a.slotItems},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return this.getSlotStepClasses(s,i)},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return"process"===this.getSlotStepStatus(i)?"step":void 0},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return s.disabled?"true":"false"},function(t,a){const{$data:s}=this,{value:i,checked:d}=(null==t?void 0:t.target)||{};var[n]=a.map(t=>t.itmVal),[e]=a.map(t=>t.idxVal);this.handleSlotStepClick(n,e)},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return s.iconHtml},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return`${s.title}`},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return s.description},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return`${s.description}`}],n:[{t:0,d:1,g:"div",a:[{k:"part",v:"base",d:0},{k:"class",v:"steps",d:0},{k:":class",f:1,d:1},{k:"role",v:"list",d:0},{k:"aria-label",v:"步骤条",d:0}],c:[{t:2,d:0,x:" 使用 items 属性时的渲染 "},{t:7,d:1,b:[{f:2,c:[{t:6,d:1,f:3,i:"item",n:"index",a:[],c:[{t:0,d:1,g:"div",a:[{k:"part",v:"step",d:0},{k:"class",v:"step",d:0},{k:":class",f:4,d:1},{k:"role",v:"listitem",d:0},{k:":aria-current",f:5,d:1},{k:":aria-disabled",f:6,d:1},{k:"@click",f:7,d:1}],c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"tail",d:0},{k:"class",v:"step__tail",d:0}],c:[]},{t:0,d:0,g:"div",a:[{k:"part",v:"wrapper",d:0},{k:"class",v:"step__wrapper",d:0}],c:[{t:0,d:1,g:"div",a:[{k:"part",v:"icon-wrapper",d:0},{k:"class",v:"step__icon-wrapper",d:0},{k:":class",f:8,d:1},{k:":style",f:9,d:1}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"icon",d:0},{k:"class",v:"step__icon",d:0}],c:[{t:7,d:1,b:[{f:10,c:[{t:7,d:1,b:[{f:11,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"icon-substitution",d:0},{k:"class",v:"step__icon-substitution",d:0}],c:[{t:1,d:1,f:12}]}]},{f:null,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"icon-text",d:0},{k:"class",v:"step__icon-text",d:0}],c:[{t:1,d:1,f:13}]}]}]}]}]}]}]},{t:0,d:0,g:"div",a:[{k:"part",v:"content",d:0},{k:"class",v:"step__content",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"title",d:0},{k:"class",v:"step__title",d:0}],c:[{t:1,d:1,f:14}]},{t:7,d:1,b:[{f:15,c:[{t:0,d:0,g:"div",a:[{k:"part",v:"description",d:0},{k:"class",v:"step__description",d:0}],c:[{t:1,d:1,f:16}]}]}]}]}]}]}]}]}]},{t:2,d:0,x:" 使用插槽时的渲染 "},{t:7,d:1,b:[{f:17,c:[{t:6,d:1,f:18,i:"slotItem",n:"index",a:[],c:[{t:0,d:1,g:"div",a:[{k:"part",v:"step",d:0},{k:"class",v:"step",d:0},{k:":class",f:19,d:1},{k:"role",v:"listitem",d:0},{k:":aria-current",f:20,d:1},{k:":aria-disabled",f:21,d:1},{k:"@click",f:22,d:1}],c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"tail",d:0},{k:"class",v:"step__tail",d:0}],c:[]},{t:0,d:0,g:"div",a:[{k:"part",v:"wrapper",d:0},{k:"class",v:"step__wrapper",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"icon-wrapper",d:0},{k:"class",v:"step__icon-wrapper",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"icon",d:0},{k:"class",v:"step__icon",d:0}],c:[{t:7,d:1,b:[{f:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:a}=this;return this.getStepsClasses()},function(t){const{$data:a}=this;return!a.useSlot},function(t){const{$data:a}=this;return this.getParsedItems()},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return this.getStepClasses(s,i)},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return"process"===this.getStepStatus(i)?"step":void 0},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return s.disabled?"true":"false"},function(t,a){const{$data:s}=this,{value:i,checked:d}=(null==t?void 0:t.target)||{};var[n]=a.map(t=>t.itmVal),[e]=a.map(t=>t.idxVal);this.handleStepClick(n,e)},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return this.getIconClasses(s)},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return s.icon?this.getIconStyle(s):""},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return!a.progressDot},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return s.icon||"finish"===this.getStepStatus(i)||"error"===this.getStepStatus(i)},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return`${this.getStepIcon(s,i)}`},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return`${i+1}`},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return`${s.title}`},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return s.description},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return`${s.description}`},function(t){const{$data:a}=this;return a.useSlot},function(t){const{$data:a}=this;return a.slotItems},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return this.getSlotStepClasses(s,i)},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return"process"===this.getSlotStepStatus(i)?"step":void 0},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return s.disabled?"true":"false"},function(t,a){const{$data:s}=this,{value:i,checked:d}=(null==t?void 0:t.target)||{};var[n]=a.map(t=>t.itmVal),[e]=a.map(t=>t.idxVal);this.handleSlotStepClick(n,e)},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return!a.progressDot},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return s.iconHtml},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return`${s.title}`},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return s.description},function(t){const{$data:a}=this;var[s]=t.map(t=>t.itmVal),[i]=t.map(t=>t.idxVal);return`${s.description}`}],n:[{t:0,d:1,g:"div",a:[{k:"part",v:"base",d:0},{k:"class",v:"steps",d:0},{k:":class",f:1,d:1},{k:"role",v:"list",d:0},{k:"aria-label",v:"步骤条",d:0}],c:[{t:2,d:0,x:" 使用 items 属性时的渲染 "},{t:7,d:1,b:[{f:2,c:[{t:6,d:1,f:3,i:"item",n:"index",a:[],c:[{t:0,d:1,g:"div",a:[{k:"part",v:"step",d:0},{k:"class",v:"step",d:0},{k:":class",f:4,d:1},{k:"role",v:"listitem",d:0},{k:":aria-current",f:5,d:1},{k:":aria-disabled",f:6,d:1},{k:"@click",f:7,d:1}],c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"tail",d:0},{k:"class",v:"step__tail",d:0}],c:[]},{t:0,d:0,g:"div",a:[{k:"part",v:"wrapper",d:0},{k:"class",v:"step__wrapper",d:0}],c:[{t:0,d:1,g:"div",a:[{k:"part",v:"icon-wrapper",d:0},{k:"class",v:"step__icon-wrapper",d:0},{k:":class",f:8,d:1},{k:":style",f:9,d:1}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"icon",d:0},{k:"class",v:"step__icon",d:0}],c:[{t:7,d:1,b:[{f:10,c:[{t:7,d:1,b:[{f:11,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"icon-substitution",d:0},{k:"class",v:"step__icon-substitution",d:0}],c:[{t:1,d:1,f:12}]}]},{f:null,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"icon-text",d:0},{k:"class",v:"step__icon-text",d:0}],c:[{t:1,d:1,f:13}]}]}]}]}]}]}]},{t:0,d:0,g:"div",a:[{k:"part",v:"content",d:0},{k:"class",v:"step__content",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"title",d:0},{k:"class",v:"step__title",d:0}],c:[{t:1,d:1,f:14}]},{t:7,d:1,b:[{f:15,c:[{t:0,d:0,g:"div",a:[{k:"part",v:"description",d:0},{k:"class",v:"step__description",d:0}],c:[{t:1,d:1,f:16}]}]}]}]}]}]}]}]}]},{t:2,d:0,x:" 使用插槽时的渲染 "},{t:7,d:1,b:[{f:17,c:[{t:6,d:1,f:18,i:"slotItem",n:"index",a:[],c:[{t:0,d:1,g:"div",a:[{k:"part",v:"step",d:0},{k:"class",v:"step",d:0},{k:":class",f:19,d:1},{k:"role",v:"listitem",d:0},{k:":aria-current",f:20,d:1},{k:":aria-disabled",f:21,d:1},{k:"@click",f:22,d:1}],c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"tail",d:0},{k:"class",v:"step__tail",d:0}],c:[]},{t:0,d:0,g:"div",a:[{k:"part",v:"wrapper",d:0},{k:"class",v:"step__wrapper",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"icon-wrapper",d:0},{k:"class",v:"step__icon-wrapper",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"icon",d:0},{k:"class",v:"step__icon",d:0}],c:[{t:7,d:1,b:[{f:23,c:[{t:2,d:0,x:" 使用插槽元素的 innerHTML 作为图标内容 "},{t:0,d:1,g:"span",a:[{k:"part",v:"icon-substitution",d:0},{k:"class",v:"step__icon-substitution",d:0},{k:":innerHTML",f:24,d:1}],c:[]}]}]}]}]},{t:0,d:0,g:"div",a:[{k:"part",v:"content",d:0},{k:"class",v:"step__content",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"title",d:0},{k:"class",v:"step__title",d:0}],c:[{t:1,d:1,f:25}]},{t:7,d:1,b:[{f:26,c:[{t:0,d:0,g:"div",a:[{k:"part",v:"description",d:0},{k:"class",v:"step__description",d:0}],c:[{t:1,d:1,f:27}]}]}]}]}]}]}]}]}]}]}],s:{tf:27,cf:27,dn:1,tn:1,sn:0}};exports.__SOLELY_IR__=t,exports.default=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:a}=this;return this.getStepsClasses()},function(t){const{$data:a}=this;return!a.useSlot},function(t){const{$data:a}=this;return this.getParsedItems()},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return this.getStepClasses(i,s)},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return"process"===this.getStepStatus(s)?"step":void 0},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return i.disabled?"true":"false"},function(t,a){const{$data:i}=this,{value:s,checked:d}=(null==t?void 0:t.target)||{};var[n]=a.map(t=>t.itmVal),[c]=a.map(t=>t.idxVal);this.handleStepClick(n,c)},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return this.getIconClasses(i)},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return i.icon?this.getIconStyle(i):""},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return!a.progressDot},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return i.icon||"finish"===this.getStepStatus(s)||"error"===this.getStepStatus(s)},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return`${this.getStepIcon(i,s)}`},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return`${s+1}`},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return`${i.title}`},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return i.description},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return`${i.description}`},function(t){const{$data:a}=this;return a.useSlot},function(t){const{$data:a}=this;return a.slotItems},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return this.getSlotStepClasses(i,s)},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return"process"===this.getSlotStepStatus(s)?"step":void 0},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return i.disabled?"true":"false"},function(t,a){const{$data:i}=this,{value:s,checked:d}=(null==t?void 0:t.target)||{};var[n]=a.map(t=>t.itmVal),[c]=a.map(t=>t.idxVal);this.handleSlotStepClick(n,c)},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return i.iconHtml},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return`${i.title}`},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return i.description},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return`${i.description}`}],n:[{t:0,d:1,g:"div",a:[{k:"part",v:"base",d:0},{k:"class",v:"steps",d:0},{k:":class",f:1,d:1},{k:"role",v:"list",d:0},{k:"aria-label",v:"步骤条",d:0}],c:[{t:2,d:0,x:" 使用 items 属性时的渲染 "},{t:7,d:1,b:[{f:2,c:[{t:6,d:1,f:3,i:"item",n:"index",a:[],c:[{t:0,d:1,g:"div",a:[{k:"part",v:"step",d:0},{k:"class",v:"step",d:0},{k:":class",f:4,d:1},{k:"role",v:"listitem",d:0},{k:":aria-current",f:5,d:1},{k:":aria-disabled",f:6,d:1},{k:"@click",f:7,d:1}],c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"tail",d:0},{k:"class",v:"step__tail",d:0}],c:[]},{t:0,d:0,g:"div",a:[{k:"part",v:"wrapper",d:0},{k:"class",v:"step__wrapper",d:0}],c:[{t:0,d:1,g:"div",a:[{k:"part",v:"icon-wrapper",d:0},{k:"class",v:"step__icon-wrapper",d:0},{k:":class",f:8,d:1},{k:":style",f:9,d:1}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"icon",d:0},{k:"class",v:"step__icon",d:0}],c:[{t:7,d:1,b:[{f:10,c:[{t:7,d:1,b:[{f:11,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"icon-substitution",d:0},{k:"class",v:"step__icon-substitution",d:0}],c:[{t:1,d:1,f:12}]}]},{f:null,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"icon-text",d:0},{k:"class",v:"step__icon-text",d:0}],c:[{t:1,d:1,f:13}]}]}]}]}]}]}]},{t:0,d:0,g:"div",a:[{k:"part",v:"content",d:0},{k:"class",v:"step__content",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"title",d:0},{k:"class",v:"step__title",d:0}],c:[{t:1,d:1,f:14}]},{t:7,d:1,b:[{f:15,c:[{t:0,d:0,g:"div",a:[{k:"part",v:"description",d:0},{k:"class",v:"step__description",d:0}],c:[{t:1,d:1,f:16}]}]}]}]}]}]}]}]}]},{t:2,d:0,x:" 使用插槽时的渲染 "},{t:7,d:1,b:[{f:17,c:[{t:6,d:1,f:18,i:"slotItem",n:"index",a:[],c:[{t:0,d:1,g:"div",a:[{k:"part",v:"step",d:0},{k:"class",v:"step",d:0},{k:":class",f:19,d:1},{k:"role",v:"listitem",d:0},{k:":aria-current",f:20,d:1},{k:":aria-disabled",f:21,d:1},{k:"@click",f:22,d:1}],c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"tail",d:0},{k:"class",v:"step__tail",d:0}],c:[]},{t:0,d:0,g:"div",a:[{k:"part",v:"wrapper",d:0},{k:"class",v:"step__wrapper",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"icon-wrapper",d:0},{k:"class",v:"step__icon-wrapper",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"icon",d:0},{k:"class",v:"step__icon",d:0}],c:[{t:7,d:1,b:[{f:
|
|
1
|
+
const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:a}=this;return this.getStepsClasses()},function(t){const{$data:a}=this;return!a.useSlot},function(t){const{$data:a}=this;return this.getParsedItems()},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return this.getStepClasses(i,s)},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return"process"===this.getStepStatus(s)?"step":void 0},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return i.disabled?"true":"false"},function(t,a){const{$data:i}=this,{value:s,checked:d}=(null==t?void 0:t.target)||{};var[n]=a.map(t=>t.itmVal),[c]=a.map(t=>t.idxVal);this.handleStepClick(n,c)},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return this.getIconClasses(i)},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return i.icon?this.getIconStyle(i):""},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return!a.progressDot},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return i.icon||"finish"===this.getStepStatus(s)||"error"===this.getStepStatus(s)},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return`${this.getStepIcon(i,s)}`},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return`${s+1}`},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return`${i.title}`},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return i.description},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return`${i.description}`},function(t){const{$data:a}=this;return a.useSlot},function(t){const{$data:a}=this;return a.slotItems},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return this.getSlotStepClasses(i,s)},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return"process"===this.getSlotStepStatus(s)?"step":void 0},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return i.disabled?"true":"false"},function(t,a){const{$data:i}=this,{value:s,checked:d}=(null==t?void 0:t.target)||{};var[n]=a.map(t=>t.itmVal),[c]=a.map(t=>t.idxVal);this.handleSlotStepClick(n,c)},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return!a.progressDot},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return i.iconHtml},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return`${i.title}`},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return i.description},function(t){const{$data:a}=this;var[i]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return`${i.description}`}],n:[{t:0,d:1,g:"div",a:[{k:"part",v:"base",d:0},{k:"class",v:"steps",d:0},{k:":class",f:1,d:1},{k:"role",v:"list",d:0},{k:"aria-label",v:"步骤条",d:0}],c:[{t:2,d:0,x:" 使用 items 属性时的渲染 "},{t:7,d:1,b:[{f:2,c:[{t:6,d:1,f:3,i:"item",n:"index",a:[],c:[{t:0,d:1,g:"div",a:[{k:"part",v:"step",d:0},{k:"class",v:"step",d:0},{k:":class",f:4,d:1},{k:"role",v:"listitem",d:0},{k:":aria-current",f:5,d:1},{k:":aria-disabled",f:6,d:1},{k:"@click",f:7,d:1}],c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"tail",d:0},{k:"class",v:"step__tail",d:0}],c:[]},{t:0,d:0,g:"div",a:[{k:"part",v:"wrapper",d:0},{k:"class",v:"step__wrapper",d:0}],c:[{t:0,d:1,g:"div",a:[{k:"part",v:"icon-wrapper",d:0},{k:"class",v:"step__icon-wrapper",d:0},{k:":class",f:8,d:1},{k:":style",f:9,d:1}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"icon",d:0},{k:"class",v:"step__icon",d:0}],c:[{t:7,d:1,b:[{f:10,c:[{t:7,d:1,b:[{f:11,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"icon-substitution",d:0},{k:"class",v:"step__icon-substitution",d:0}],c:[{t:1,d:1,f:12}]}]},{f:null,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"icon-text",d:0},{k:"class",v:"step__icon-text",d:0}],c:[{t:1,d:1,f:13}]}]}]}]}]}]}]},{t:0,d:0,g:"div",a:[{k:"part",v:"content",d:0},{k:"class",v:"step__content",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"title",d:0},{k:"class",v:"step__title",d:0}],c:[{t:1,d:1,f:14}]},{t:7,d:1,b:[{f:15,c:[{t:0,d:0,g:"div",a:[{k:"part",v:"description",d:0},{k:"class",v:"step__description",d:0}],c:[{t:1,d:1,f:16}]}]}]}]}]}]}]}]}]},{t:2,d:0,x:" 使用插槽时的渲染 "},{t:7,d:1,b:[{f:17,c:[{t:6,d:1,f:18,i:"slotItem",n:"index",a:[],c:[{t:0,d:1,g:"div",a:[{k:"part",v:"step",d:0},{k:"class",v:"step",d:0},{k:":class",f:19,d:1},{k:"role",v:"listitem",d:0},{k:":aria-current",f:20,d:1},{k:":aria-disabled",f:21,d:1},{k:"@click",f:22,d:1}],c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"tail",d:0},{k:"class",v:"step__tail",d:0}],c:[]},{t:0,d:0,g:"div",a:[{k:"part",v:"wrapper",d:0},{k:"class",v:"step__wrapper",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"icon-wrapper",d:0},{k:"class",v:"step__icon-wrapper",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"icon",d:0},{k:"class",v:"step__icon",d:0}],c:[{t:7,d:1,b:[{f:23,c:[{t:2,d:0,x:" 使用插槽元素的 innerHTML 作为图标内容 "},{t:0,d:1,g:"span",a:[{k:"part",v:"icon-substitution",d:0},{k:"class",v:"step__icon-substitution",d:0},{k:":innerHTML",f:24,d:1}],c:[]}]}]}]}]},{t:0,d:0,g:"div",a:[{k:"part",v:"content",d:0},{k:"class",v:"step__content",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"title",d:0},{k:"class",v:"step__title",d:0}],c:[{t:1,d:1,f:25}]},{t:7,d:1,b:[{f:26,c:[{t:0,d:0,g:"div",a:[{k:"part",v:"description",d:0},{k:"class",v:"step__description",d:0}],c:[{t:1,d:1,f:27}]}]}]}]}]}]}]}]}]}]}],s:{tf:27,cf:27,dn:1,tn:1,sn:0}};export{t as __SOLELY_IR__,t as default};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./router/index.cjs"),r=require("./shared/templateError.cjs"),t=require("./shared/gen-function.cjs"),s=require("./shared/functions.cjs"),o=require("./shared/event-listeners.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./router/index.cjs"),r=require("./shared/templateError.cjs"),t=require("./shared/gen-function.cjs"),s=require("./shared/functions.cjs"),o=require("./shared/event-listeners.cjs"),c=require("./shared/is-object.cjs"),i=require("./shared/url.cjs"),u=require("./shared/env.cjs"),a=require("./shared/case-convert.cjs"),n=require("./types/ast.cjs"),p=require("./types/lifecycle.cjs"),l=require("./runtime/component/base-element.cjs"),d=require("./router/router-link.cjs"),x=require("./router/router-view.cjs"),m=require("./runtime/renderer/html-decode.cjs"),R=require("./runtime/component/decorators.cjs"),j=require("./runtime/renderer/renderIR.cjs"),q=require("./router/core.cjs"),b=require("./compiler/ir/buildIR.cjs"),y=require("./runtime/reactivity/observe.cjs"),f=require("./compiler/parser/parser.cjs");exports.createRouter=e.createRouter,exports.showTemplateError=r.showTemplateError,exports.genFunction=t.genFunction,exports.createFunction=s.createFunction,exports.isCSPBlocked=s.isCSPBlocked,exports.listeners=o.default,exports.isObject=c.isObject,exports.parseHashUrl=i.parseHashUrl,exports.IS_DEV=u.IS_DEV,exports.IS_PROD=u.IS_PROD,exports.camelToKebab=a.camelToKebab,exports.ASTType=n.ASTType,exports.LIFECYCLE_ATTRS_MAP=p.LIFECYCLE_ATTRS_MAP,exports.isLifecycleKind=p.isLifecycleKind,exports.mapAttrKeyToLifecycleKind=p.mapAttrKeyToLifecycleKind,exports.BaseElement=l.default,Object.defineProperty(exports,"RouterLink",{enumerable:!0,get:()=>d.default}),Object.defineProperty(exports,"RouterView",{enumerable:!0,get:()=>x.default}),exports.htmlDecode=m.default,exports.CustomElement=R.CustomElement,exports.IRRenderer=j.IRRenderer,exports.createRender=j.createRender,exports.Router=q.Router,exports.getRouter=q.getRouter,exports.routerReady=q.routerReady,exports.buildIR=b.buildIR,exports.clearIRCache=b.clearIRCache,exports.transformModel=b.transformModel,exports.isProxy=y.isProxy,exports.observe=y.observe,exports.toRaw=y.toRaw,exports.parseHtml=f.parseHtml;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRouter as r}from"./router/index.js";import{showTemplateError as e}from"./shared/templateError.js";import{genFunction as o}from"./shared/gen-function.js";import{createFunction as t,isCSPBlocked as m}from"./shared/functions.js";import{default as s}from"./shared/event-listeners.js";import{isObject as i}from"./shared/is-object.js";import{parseHashUrl as a}from"./shared/url.js";import{IS_DEV as p,IS_PROD as f}from"./shared/env.js";import{
|
|
1
|
+
import{createRouter as r}from"./router/index.js";import{showTemplateError as e}from"./shared/templateError.js";import{genFunction as o}from"./shared/gen-function.js";import{createFunction as t,isCSPBlocked as m}from"./shared/functions.js";import{default as s}from"./shared/event-listeners.js";import{isObject as i}from"./shared/is-object.js";import{parseHashUrl as a}from"./shared/url.js";import{IS_DEV as p,IS_PROD as f}from"./shared/env.js";import{camelToKebab as n}from"./shared/case-convert.js";import{ASTType as d}from"./types/ast.js";import{LIFECYCLE_ATTRS_MAP as j,isLifecycleKind as u,mapAttrKeyToLifecycleKind as l}from"./types/lifecycle.js";import{default as c}from"./runtime/component/base-element.js";import{default as h}from"./router/router-link.js";import{default as v}from"./router/router-view.js";import{default as b}from"./runtime/renderer/html-decode.js";import{CustomElement as y}from"./runtime/component/decorators.js";import{IRRenderer as R,createRender as k}from"./runtime/renderer/renderIR.js";import{Router as w,getRouter as x,routerReady as E}from"./router/core.js";import{buildIR as I,clearIRCache as g,transformModel as B}from"./compiler/ir/buildIR.js";import{isProxy as D,observe as L,toRaw as V}from"./runtime/reactivity/observe.js";import{parseHtml as q}from"./compiler/parser/parser.js";export{d as ASTType,c as BaseElement,y as CustomElement,R as IRRenderer,p as IS_DEV,f as IS_PROD,j as LIFECYCLE_ATTRS_MAP,w as Router,h as RouterLink,v as RouterView,I as buildIR,n as camelToKebab,g as clearIRCache,t as createFunction,k as createRender,r as createRouter,o as genFunction,x as getRouter,b as htmlDecode,m as isCSPBlocked,u as isLifecycleKind,i as isObject,D as isProxy,s as listeners,l as mapAttrKeyToLifecycleKind,L as observe,a as parseHashUrl,q as parseHtml,E as routerReady,e as showTemplateError,V as toRaw,B as transformModel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t,e,s,i,a,n,o,r,h,l,
|
|
1
|
+
"use strict";var t,e,s,i,a,n,o,r,h,c,l,u,d,p,f,b,m,y,v,w,g,M,S,O,k,$,j=Object.defineProperty,C=t=>{throw TypeError(t)},W=(t,e,s)=>e.has(t)||C("Cannot "+s),A=(t,e,s)=>(W(t,e,"read from private field"),s?s.call(t):e.get(t)),E=(t,e,s)=>e.has(t)?C("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),N=(t,e,s,i)=>(W(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),D=(t,e,s)=>(W(t,e,"access private method"),s);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("../../shared/is-object.cjs"),q=require("../../shared/env.cjs"),U=require("../../shared/case-convert.cjs"),I=require("../reactivity/observe.cjs"),_=require("../renderer/renderIR.cjs"),x=Symbol.for("solely.manifest"),L=class y extends HTMLElement{constructor(p={}){var b,y;super(),E(this,f),((t,e,s)=>{e in t?j(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(this,"symbol"!=typeof(y="$refs")?y+"":y,{}),E(this,t),E(this,e),E(this,s),E(this,i),E(this,a),E(this,n),E(this,o,!1),E(this,r,!1),E(this,h,!1),E(this,c,!1),E(this,l,!1),E(this,u,!1),E(this,d,!1);const w=this.constructor;N(this,t,w[x]||{tagName:"base-element"});const g=A(this,t);N(this,a,(null==(b=g.shadowDOM)?void 0:b.use)?this.attachShadow({mode:g.shadowDOM.mode||"open"}):this),D(this,f,m).call(this,p),D(this,f,v).call(this,g),queueMicrotask(()=>D(this,f,$).call(this))}static get observedAttributes(){const t=this[x];return(null==t?void 0:t.attributeMap)?Array.from(t.attributeMap.keys()):[]}get $data(){return A(this,i)}set $data(t){var e;P.isObject(t)||(t={}),t!==A(this,i)&&(null==(e=A(this,n))||e.call(this),D(this,f,m).call(this,t),D(this,f,g).call(this),D(this,f,S).call(this))}refresh(){D(this,f,S).call(this)}connectedCallback(){var i;N(this,l,!0);const n=A(this,t);if(D(this,f,$).call(this),(n.className||n.tagName||"").split(" ").forEach(t=>t&&this.classList.add(t)),D(this,f,k).call(this),n.attributeMap&&P.isObject(this.$data)){D(this,f,g).call(this);for(const[t,e]of n.attributeMap){const s=e.name;if(this.hasAttribute(t)){const i=this.getAttribute(t),a=D(this,f,M).call(this,i,e.default,e.type);this.$data[s]=a}else"default"in e&&void 0===this.$data[s]&&(this.$data[s]=e.default,"boolean"===e.type&&!0===e.default&&this.setAttribute(t,""))}}D(this,f,b).call(this),A(this,s)&&!A(this,e)&&N(this,e,_.createRender(A(this,s),A(this,a),this)),A(this,u)&&(N(this,u,!1),D(this,f,S).call(this)),this.mounted(),null==(i=this.onInit)||i.call(this)}disconnectedCallback(){var e,s;N(this,l,!1);const i=A(this,t);if(!(null==(e=i.shadowDOM)?void 0:e.use)&&i.styles){const t=`solely-style-${i.tagName}`,e=A(y,p).get(t)||0;e<=1?(null==(s=document.head.querySelector(`#${t}`))||s.remove(),A(y,p).delete(t)):A(y,p).set(t,e-1)}this.unmounted()}attributeChangedCallback(e,s,i){var a;if(s===i||!P.isObject(this.$data))return;const n=null==(a=A(this,t).attributeMap)?void 0:a.get(e);if(!n)return;const o=n.name,r=this.$data[o],c=D(this,f,M).call(this,i,n.default??r,n.type);this.$data[o]=c,N(this,h,!0),this.attributeChanged(e,r,c)}emit(t,e,s){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e,...s}))}emitNative(t,e){this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0,...e}))}warn(t,e){if(q.IS_DEV&&t){const t=this.tagName.toLowerCase();console.warn(`[${t}] ${e}`)}}error(t,e){if(q.IS_DEV&&t){const t=this.tagName.toLowerCase();console.error(`[${t}] ${e}`)}}onInit(){}created(){}mounted(){}beforeUpdate(){}updated(){}unmounted(){}attributeChanged(t,e,s){}beforeAttributesUpdate(){}afterAttributesUpdate(){}};t=new WeakMap,e=new WeakMap,s=new WeakMap,i=new WeakMap,a=new WeakMap,n=new WeakMap,o=new WeakMap,r=new WeakMap,h=new WeakMap,c=new WeakMap,l=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap,f=new WeakSet,b=function(){const t=Object.getOwnPropertyNames(this),e=["#","_"],s=new Set(["$data","$refs","constructor","onInit","created","mounted","beforeUpdate","updated","unmounted","attributeChanged","beforeAttributesUpdate","afterAttributesUpdate","emit","refresh"]),i=new Map;let a=Object.getPrototypeOf(this);for(;a&&a!==HTMLElement.prototype;){const t=Object.getOwnPropertyDescriptors(a);for(const[e,s]of Object.entries(t))s.set&&!i.has(e)&&i.set(e,s);a=Object.getPrototypeOf(a)}for(const n of t){if(s.has(n))continue;if(e.some(t=>n.startsWith(t)))continue;const t=Object.getOwnPropertyDescriptor(this,n);if(!t||!("value"in t))continue;const a=t.value,o=i.get(n);(null==o?void 0:o.set)&&(delete this[n],this[n]=a)}},m=function(e){const{proxy:s,dispose:a}=I.observe(e,e=>{var s;if("set"===e.type){const{key:i,newValue:a}=e,n=A(this,t),o=String(i),r=null==(s=n.propMap)?void 0:s.get(o);(null==r?void 0:r.reflect)&&D(this,f,y).call(this,r,a)}this.emit("dataChange",{...e}),D(this,f,S).call(this)});N(this,i,s),N(this,n,a)},y=function(t,e){const s=U.camelToKebab(t.name);if("boolean"===t.type)e?this.setAttribute(s,""):this.removeAttribute(s);else{const t="object"==typeof e?JSON.stringify(e):String(e);this.setAttribute(s,t)}},v=function(t){t.ir&&N(this,s,t.ir)},w=function(){const e=A(this,t);if(e.attributeMap)for(const[,t]of e.attributeMap){if(!1===t.reactive)continue;const e=Object.getOwnPropertyDescriptor(this.constructor.prototype,t.name);if(!(null==e?void 0:e.get)&&!(null==e?void 0:e.set)){const e=Object.getOwnPropertyDescriptor(this,t.name);e&&"value"in e&&(this.$data[t.name]=e.value,delete this[t.name]),Object.defineProperty(this,t.name,{get:()=>this.$data[t.name],set:e=>{this.$data[t.name]=e},configurable:!0,enumerable:!0})}}},g=function(){A(this,d)||(N(this,d,!0),D(this,f,w).call(this))},M=function(t,e,s){if(null===t)return"boolean"!==s&&e;switch(s){case"boolean":return!0;case"number":{const s=Number(t);return isNaN(s)?e:s}case"object":try{return JSON.parse(t)}catch(i){return console.error(`[Solely] Failed to parse object value: "${t}", using default value.`,i),e}case"array":try{const s=t.replace(/'/g,'"'),i=JSON.parse(s);return Array.isArray(i)?i:e}catch(i){return console.error(`[Solely] Failed to parse array value: "${t}", using default value.`,i),e}default:return t}},S=function(){A(this,l)?!A(this,r)&&A(this,e)&&(N(this,r,!0),queueMicrotask(()=>{N(this,r,!1),D(this,f,O).call(this)})):N(this,u,!0)},O=function(){if(!A(this,o)&&A(this,l)){N(this,o,!0);try{A(this,h)&&this.beforeAttributesUpdate(),this.beforeUpdate(),A(this,e).update(),this.updated(),A(this,h)&&(this.afterAttributesUpdate(),N(this,h,!1))}finally{N(this,o,!1)}}},k=function(){var e;const s=A(this,t);if(!s.styles)return;const i=A(this,a);if(s.sheet&&i instanceof ShadowRoot&&"adoptedStyleSheets"in i){if(!i.adoptedStyleSheets.includes(s.sheet)){const t=Array.from(i.adoptedStyleSheets);t.push(s.sheet),i.adoptedStyleSheets=t}return}const n=i instanceof ShadowRoot?i:document.head,o=`solely-style-${s.tagName}`,r=!(null==(e=s.shadowDOM)?void 0:e.use);if(!n.querySelector(`#${o}`)){const t=document.createElement("style");t.id=o,t.textContent=s.styles,n.appendChild(t)}if(r){const t=A(L,p).get(o)||0;A(L,p).set(o,t+1)}},$=function(){A(this,c)||(N(this,c,!0),this.created())},E(L,p,new Map),(()=>{if(q.IS_DEV&&"undefined"!=typeof customElements){const t=customElements.define,e=new WeakSet;customElements.define=function(s,i,a){if(L.isPrototypeOf(i)&&!e.has(i)){e.add(i);const t=i.prototype,a=["connectedCallback","disconnectedCallback","attributeChangedCallback"];for(const e of a)t[e]!==L.prototype[e]&&console.error(`[${s}] 禁止重写 ${e}(),请使用框架钩子`)}return t.call(this,s,i,a)}}})();let T=L;exports.default=T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var t,e,s,i,a,o,n,r,h,l,c,u,d,p,
|
|
1
|
+
var t,e,s,i,a,o,n,r,h,l,c,u,d,f,p,b,m,y,v,w,g,M,k,$,O,S,j=Object.defineProperty,C=t=>{throw TypeError(t)},W=(t,e,s)=>e.has(t)||C("Cannot "+s),A=(t,e,s)=>(W(t,e,"read from private field"),s?s.call(t):e.get(t)),N=(t,e,s)=>e.has(t)?C("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),E=(t,e,s,i)=>(W(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),P=(t,e,s)=>(W(t,e,"access private method"),s);import{isObject as U}from"../../shared/is-object.js";import{IS_DEV as D}from"../../shared/env.js";import{camelToKebab as L}from"../../shared/case-convert.js";import{observe as q}from"../reactivity/observe.js";import{createRender as x}from"../renderer/renderIR.js";const I=Symbol.for("solely.manifest"),J=class y extends HTMLElement{constructor(f={}){var b,y;super(),N(this,p),((t,e,s)=>{e in t?j(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(this,"symbol"!=typeof(y="$refs")?y+"":y,{}),N(this,t),N(this,e),N(this,s),N(this,i),N(this,a),N(this,o),N(this,n,!1),N(this,r,!1),N(this,h,!1),N(this,l,!1),N(this,c,!1),N(this,u,!1),N(this,d,!1);const w=this.constructor;E(this,t,w[I]||{tagName:"base-element"});const g=A(this,t);E(this,a,(null==(b=g.shadowDOM)?void 0:b.use)?this.attachShadow({mode:g.shadowDOM.mode||"open"}):this),P(this,p,m).call(this,f),P(this,p,v).call(this,g),queueMicrotask(()=>P(this,p,S).call(this))}static get observedAttributes(){const t=this[I];return(null==t?void 0:t.attributeMap)?Array.from(t.attributeMap.keys()):[]}get $data(){return A(this,i)}set $data(t){var e;U(t)||(t={}),t!==A(this,i)&&(null==(e=A(this,o))||e.call(this),P(this,p,m).call(this,t),P(this,p,g).call(this),P(this,p,k).call(this))}refresh(){P(this,p,k).call(this)}connectedCallback(){var i;E(this,c,!0);const o=A(this,t);if(P(this,p,S).call(this),(o.className||o.tagName||"").split(" ").forEach(t=>t&&this.classList.add(t)),P(this,p,O).call(this),o.attributeMap&&U(this.$data)){P(this,p,g).call(this);for(const[t,e]of o.attributeMap){const s=e.name;if(this.hasAttribute(t)){const i=this.getAttribute(t),a=P(this,p,M).call(this,i,e.default,e.type);this.$data[s]=a}else"default"in e&&void 0===this.$data[s]&&(this.$data[s]=e.default,"boolean"===e.type&&!0===e.default&&this.setAttribute(t,""))}}P(this,p,b).call(this),A(this,s)&&!A(this,e)&&E(this,e,x(A(this,s),A(this,a),this)),A(this,u)&&(E(this,u,!1),P(this,p,k).call(this)),this.mounted(),null==(i=this.onInit)||i.call(this)}disconnectedCallback(){var e,s;E(this,c,!1);const i=A(this,t);if(!(null==(e=i.shadowDOM)?void 0:e.use)&&i.styles){const t=`solely-style-${i.tagName}`,e=A(y,f).get(t)||0;e<=1?(null==(s=document.head.querySelector(`#${t}`))||s.remove(),A(y,f).delete(t)):A(y,f).set(t,e-1)}this.unmounted()}attributeChangedCallback(e,s,i){var a;if(s===i||!U(this.$data))return;const o=null==(a=A(this,t).attributeMap)?void 0:a.get(e);if(!o)return;const n=o.name,r=this.$data[n],l=P(this,p,M).call(this,i,o.default??r,o.type);this.$data[n]=l,E(this,h,!0),this.attributeChanged(e,r,l)}emit(t,e,s){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e,...s}))}emitNative(t,e){this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0,...e}))}warn(t,e){if(D&&t){const t=this.tagName.toLowerCase();console.warn(`[${t}] ${e}`)}}error(t,e){if(D&&t){const t=this.tagName.toLowerCase();console.error(`[${t}] ${e}`)}}onInit(){}created(){}mounted(){}beforeUpdate(){}updated(){}unmounted(){}attributeChanged(t,e,s){}beforeAttributesUpdate(){}afterAttributesUpdate(){}};t=new WeakMap,e=new WeakMap,s=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,r=new WeakMap,h=new WeakMap,l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakSet,b=function(){const t=Object.getOwnPropertyNames(this),e=["#","_"],s=new Set(["$data","$refs","constructor","onInit","created","mounted","beforeUpdate","updated","unmounted","attributeChanged","beforeAttributesUpdate","afterAttributesUpdate","emit","refresh"]),i=new Map;let a=Object.getPrototypeOf(this);for(;a&&a!==HTMLElement.prototype;){const t=Object.getOwnPropertyDescriptors(a);for(const[e,s]of Object.entries(t))s.set&&!i.has(e)&&i.set(e,s);a=Object.getPrototypeOf(a)}for(const o of t){if(s.has(o))continue;if(e.some(t=>o.startsWith(t)))continue;const t=Object.getOwnPropertyDescriptor(this,o);if(!t||!("value"in t))continue;const a=t.value,n=i.get(o);(null==n?void 0:n.set)&&(delete this[o],this[o]=a)}},m=function(e){const{proxy:s,dispose:a}=q(e,e=>{var s;if("set"===e.type){const{key:i,newValue:a}=e,o=A(this,t),n=String(i),r=null==(s=o.propMap)?void 0:s.get(n);(null==r?void 0:r.reflect)&&P(this,p,y).call(this,r,a)}this.emit("dataChange",{...e}),P(this,p,k).call(this)});E(this,i,s),E(this,o,a)},y=function(t,e){const s=L(t.name);if("boolean"===t.type)e?this.setAttribute(s,""):this.removeAttribute(s);else{const t="object"==typeof e?JSON.stringify(e):String(e);this.setAttribute(s,t)}},v=function(t){t.ir&&E(this,s,t.ir)},w=function(){const e=A(this,t);if(e.attributeMap)for(const[,t]of e.attributeMap){if(!1===t.reactive)continue;const e=Object.getOwnPropertyDescriptor(this.constructor.prototype,t.name);if(!(null==e?void 0:e.get)&&!(null==e?void 0:e.set)){const e=Object.getOwnPropertyDescriptor(this,t.name);e&&"value"in e&&(this.$data[t.name]=e.value,delete this[t.name]),Object.defineProperty(this,t.name,{get:()=>this.$data[t.name],set:e=>{this.$data[t.name]=e},configurable:!0,enumerable:!0})}}},g=function(){A(this,d)||(E(this,d,!0),P(this,p,w).call(this))},M=function(t,e,s){if(null===t)return"boolean"!==s&&e;switch(s){case"boolean":return!0;case"number":{const s=Number(t);return isNaN(s)?e:s}case"object":try{return JSON.parse(t)}catch(i){return console.error(`[Solely] Failed to parse object value: "${t}", using default value.`,i),e}case"array":try{const s=t.replace(/'/g,'"'),i=JSON.parse(s);return Array.isArray(i)?i:e}catch(i){return console.error(`[Solely] Failed to parse array value: "${t}", using default value.`,i),e}default:return t}},k=function(){A(this,c)?!A(this,r)&&A(this,e)&&(E(this,r,!0),queueMicrotask(()=>{E(this,r,!1),P(this,p,$).call(this)})):E(this,u,!0)},$=function(){if(!A(this,n)&&A(this,c)){E(this,n,!0);try{A(this,h)&&this.beforeAttributesUpdate(),this.beforeUpdate(),A(this,e).update(),this.updated(),A(this,h)&&(this.afterAttributesUpdate(),E(this,h,!1))}finally{E(this,n,!1)}}},O=function(){var e;const s=A(this,t);if(!s.styles)return;const i=A(this,a);if(s.sheet&&i instanceof ShadowRoot&&"adoptedStyleSheets"in i){if(!i.adoptedStyleSheets.includes(s.sheet)){const t=Array.from(i.adoptedStyleSheets);t.push(s.sheet),i.adoptedStyleSheets=t}return}const o=i instanceof ShadowRoot?i:document.head,n=`solely-style-${s.tagName}`,r=!(null==(e=s.shadowDOM)?void 0:e.use);if(!o.querySelector(`#${n}`)){const t=document.createElement("style");t.id=n,t.textContent=s.styles,o.appendChild(t)}if(r){const t=A(J,f).get(n)||0;A(J,f).set(n,t+1)}},S=function(){A(this,l)||(E(this,l,!0),this.created())},N(J,f,new Map),(()=>{if(D&&"undefined"!=typeof customElements){const t=customElements.define,e=new WeakSet;customElements.define=function(s,i,a){if(J.isPrototypeOf(i)&&!e.has(i)){e.add(i);const t=i.prototype,a=["connectedCallback","disconnectedCallback","attributeChangedCallback"];for(const e of a)t[e]!==J.prototype[e]&&console.error(`[${s}] 禁止重写 ${e}(),请使用框架钩子`)}return t.call(this,s,i,a)}}})();let R=J;export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../shared/env.cjs"),t=require("../../compiler/parser/parser.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../shared/env.cjs"),t=require("../../shared/case-convert.cjs"),r=require("../../compiler/parser/parser.cjs"),n=require("../../compiler/ir/buildIR.cjs"),o=Symbol.for("solely.manifest");exports.CustomElement=s=>{const l=s,a="undefined"!=typeof window&&"undefined"!=typeof customElements;return s=>{const{tagName:i}=l;if(a&&!(s.prototype instanceof HTMLElement)&&s!==HTMLElement)throw new TypeError(`[Solely] CustomElement decorator can only be applied to classes extending HTMLElement.\nReceived: ${s.name||"anonymous class"}`);if(a&&customElements.get(i))return e.IS_DEV&&console.warn(`[Solely] 标签名称 "${i}" 已经被注册,跳过重复定义。`),s[o]=l,s;if("string"!=typeof l.template||l.ir){if(l.template&&!l.ir)if("object"==typeof l.template&&null!==l.template){const t=l.template;"root"===t.t&&Array.isArray(t.fns)&&Array.isArray(t.n)?(l.ir=t,e.IS_DEV&&console.info(`[Solely] Using precompiled IR for <${i}> | Nodes: ${t.n.length} | Fns: ${t.fns.length}`)):console.error(`[Manifest Error] <${i}>: 提供的 template 不是有效的 IRRoot 对象。\n期望: { t: "root", fns: [], n: [] }\n实际: ${JSON.stringify(Object.keys(t))}`)}else console.error(`[Manifest Error] <${i}>: template 类型无效。\n期望: string 或 IRRoot 对象\n实际: ${typeof l.template}`)}else if(l.template.trim())try{const e=r.parseHtml(l.template);l.ir=n.buildIR(e,{source:l.template,filename:i})}catch(p){const t=p instanceof Error?p:new Error(String(p));console.error(`[Compiler Error] <${i}>: 模板编译失败\n错误: ${t.message}\n模板长度: ${l.template.length} 字符`,e.IS_DEV?t.stack:"")}else e.IS_DEV&&console.warn(`[Solely] <${i}>: 模板为空字符串`);if(a&&l.styles&&!l.sheet&&"CSSStyleSheet"in window)try{const e=new CSSStyleSheet;"function"==typeof e.replaceSync&&(e.replaceSync(l.styles),l.sheet=e)}catch{e.IS_DEV&&console.warn(`[Solely] <${i}>: CSSStyleSheet 不可用,将使用 style 标签回退方案`)}if(l.props&&!l.attributeMap){const e=new Map,r=new Map;l.props.forEach(n=>{const o="string"==typeof n?{name:n}:n,s=t.camelToKebab(o.name),l=o.name,a={...o,name:l};e.set(s,a),r.set(l,a)}),l.attributeMap=e,l.propMap=r}class c extends s{}return c[o]=l,a&&customElements.define(i,c),c}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IS_DEV as e}from"../../shared/env.js";import{
|
|
1
|
+
import{IS_DEV as e}from"../../shared/env.js";import{camelToKebab as t}from"../../shared/case-convert.js";import{parseHtml as o}from"../../compiler/parser/parser.js";import{buildIR as r}from"../../compiler/ir/buildIR.js";const n=Symbol.for("solely.manifest"),s=s=>{const l=s,a="undefined"!=typeof window&&"undefined"!=typeof customElements;return s=>{const{tagName:i}=l;if(a&&!(s.prototype instanceof HTMLElement)&&s!==HTMLElement)throw new TypeError(`[Solely] CustomElement decorator can only be applied to classes extending HTMLElement.\nReceived: ${s.name||"anonymous class"}`);if(a&&customElements.get(i))return e&&console.warn(`[Solely] 标签名称 "${i}" 已经被注册,跳过重复定义。`),s[n]=l,s;if("string"!=typeof l.template||l.ir){if(l.template&&!l.ir)if("object"==typeof l.template&&null!==l.template){const t=l.template;"root"===t.t&&Array.isArray(t.fns)&&Array.isArray(t.n)?(l.ir=t,e&&console.info(`[Solely] Using precompiled IR for <${i}> | Nodes: ${t.n.length} | Fns: ${t.fns.length}`)):console.error(`[Manifest Error] <${i}>: 提供的 template 不是有效的 IRRoot 对象。\n期望: { t: "root", fns: [], n: [] }\n实际: ${JSON.stringify(Object.keys(t))}`)}else console.error(`[Manifest Error] <${i}>: template 类型无效。\n期望: string 或 IRRoot 对象\n实际: ${typeof l.template}`)}else if(l.template.trim())try{const e=o(l.template);l.ir=r(e,{source:l.template,filename:i})}catch(m){const t=m instanceof Error?m:new Error(String(m));console.error(`[Compiler Error] <${i}>: 模板编译失败\n错误: ${t.message}\n模板长度: ${l.template.length} 字符`,e?t.stack:"")}else e&&console.warn(`[Solely] <${i}>: 模板为空字符串`);if(a&&l.styles&&!l.sheet&&"CSSStyleSheet"in window)try{const e=new CSSStyleSheet;"function"==typeof e.replaceSync&&(e.replaceSync(l.styles),l.sheet=e)}catch{e&&console.warn(`[Solely] <${i}>: CSSStyleSheet 不可用,将使用 style 标签回退方案`)}if(l.props&&!l.attributeMap){const e=new Map,o=new Map;l.props.forEach(r=>{const n="string"==typeof r?{name:r}:r,s=t(n.name),l=n.name,a={...n,name:l};e.set(s,a),o.set(l,a)}),l.attributeMap=e,l.propMap=o}class p extends s{}return p[n]=l,a&&customElements.define(i,p),p}};export{s as CustomElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../shared/is-object.cjs"),t=Symbol("solely.raw"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../shared/is-object.cjs"),t=require("../../shared/env.cjs"),r=Symbol("solely.raw"),n=new WeakMap,i=new WeakMap,o=new WeakMap,s=new WeakMap,a=new WeakMap;function l(e){if(e&&"object"==typeof e){const t=e[r];if(t)return t}return e}const c=e=>!(!e||"object"!=typeof e)&&(e instanceof File||e instanceof Blob||e instanceof FormData||e instanceof ArrayBuffer||e instanceof Response||e instanceof Request);function u(e){return!(!e||!e[r])}const f=(e,t,r=new WeakMap,n=0)=>{if(n>10)return e===t;if(e===t)return!0;if(null==e||null==t)return e===t;if("object"!=typeof e||"object"!=typeof t)return e===t;if(Array.isArray(e)!==Array.isArray(t))return!1;if(r.has(e))return r.get(e)===t;if(r.set(e,t),Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!f(e[i],t[i],r,n+1))return!1;return!0}const i=Reflect.ownKeys(e);if(i.length!==Reflect.ownKeys(t).length)return!1;for(const o of i){if(!Reflect.has(t,o))return!1;const i=e[o],s=t[o];if(!f(i,s,r,n+1))return!1}return!0},p=(e,t)=>{if(0===t.length)return!0;const r=e.map(String).join(".");return t.some(e=>e.test(r))},y=(e,t)=>{const r=(e=>{const t=[];let r=e;for(;r;){const e=o.get(r);if(!e||null==e.key)break;t.unshift(e.key),r=e.parent}return t})(e);let i=e,s=0;for(;i;){const e=n.get(i);if(e){const n=r.slice(r.length-s);e.forEach(e=>{if(!e.active)return;if(!p(n,e.filterRegexes))return;const r={...t,path:n};e.throttle>0?(e.pending.push(r),e.timer||(e.timer=setTimeout(()=>{if(!e.active)return;const t=[...e.pending];e.pending=[],e.timer=null,t.length>0&&(e.onBatch?e.onBatch(t):e.callback(t[t.length-1]))},e.throttle))):e.onBatch?e.onBatch([r]):e.callback(r)})}const a=o.get(i);i=(null==a?void 0:a.parent)||null,s++}};exports.isProxy=u,exports.observe=function(p,d,h={}){const{throttle:g=0,onBatch:b,immediate:m=!1,deepCompare:w=!1}=h,v={callback:d,onBatch:b,throttle:g,filterRegexes:(Array.isArray(h.filter)?h.filter:h.filter?[h.filter]:[]).map(e=>{if(""===e)return/^.*$/;const t=e.replace(/\./g,"\\.").replace(/\*\*/g,"(.+)").replace(/\*/g,"[^.]+").replace(/\[\d+\]/g,"\\[\\d+\\]");return new RegExp(`^${t}$`)}),pending:[],timer:null,active:!0},A=(n,p,d)=>{if(!Object.isExtensible(n))return n;if(c(n))return n;if(n[r])return n;const h=i.get(n);if(h)return h;const g=new Proxy(n,{get(t,n,i){if(n===r)return t;if(Array.isArray(t)){const e=s.get(g);if(e&&Object.prototype.hasOwnProperty.call(e,n))return Reflect.get(e,n,i)}const o=Reflect.get(t,n,i);return"symbol"==typeof n?o:e.isObject(o)&&!c(o)?A(o,g,n):o},set(e,r,n,i){if(!v.active)return t.IS_DEV&&console.warn("[Solely] Cannot set property on a disposed reactive object"),!0;const o=e[r];if(w?f(o,n):o===n)return!0;const s=Reflect.set(e,r,n,i);return 0===(a.get(g)||0)&&(Array.isArray(o)&&Array.isArray(n)?y(g,{type:"array-replace",oldValue:o,newValue:n}):y(g,{type:"set",key:r,newValue:n,oldValue:o})),s},deleteProperty(e,r){if(!v.active)return t.IS_DEV&&console.warn("[Solely] Cannot delete property on a disposed reactive object"),!0;if(!Reflect.has(e,r))return!1;const n=e[r],i=Reflect.deleteProperty(e,r),o=a.get(g)||0;return i&&0===o&&y(g,{type:"delete",key:r,oldValue:n}),i}});return i.set(n,g),o.set(g,{parent:p,key:d}),Array.isArray(n)&&s.set(g,((e,t,r)=>{const n={};return["push","pop","shift","unshift","splice"].forEach(i=>{n[i]=function(...n){if(!t)return;const o=a.get(t)||0;a.set(t,o+1);const s=e[i].apply(e,n);if(a.set(t,o),"push"===i)r(t,{type:"array-push",index:e.length-n.length,values:n});else if("unshift"===i)r(t,{type:"array-push",index:0,values:n});else if("pop"===i)r(t,{type:"array-splice",index:e.length,deleteCount:1,insert:[]});else if("shift"===i)r(t,{type:"array-splice",index:0,deleteCount:1,insert:[]});else if("splice"===i){const[e,i,...o]=n;r(t,{type:"array-splice",index:e,deleteCount:i,insert:o})}return s}}),["sort","reverse","fill","copyWithin"].forEach(i=>{n[i]=function(...n){if(!t)return;const o=a.get(t)||0;a.set(t,o+1);const s=e[i].apply(e,n);return a.set(t,o),r(t,{type:"array-reset",method:i}),s}}),["indexOf","lastIndexOf","includes"].forEach(t=>{n[t]=function(r,...n){let i=e[t].apply(e,[r,...n]);return-1!==i&&!1!==i||!u(r)||(i=e[t].apply(e,[l(r),...n])),i}}),n})(n,g,y)),g},k=A(p,null,null);let x=n.get(k);if(x||(x=new Set,n.set(k,x)),x.add(v),m){const t=(r,n,i=new WeakSet)=>{e.isObject(r)&&!i.has(r)&&(i.add(r),Reflect.ownKeys(r).forEach(o=>{const s=r[o];e.isObject(s)&&i.has(s)||(y(n,{type:"set",key:o,newValue:s,oldValue:void 0}),e.isObject(s)&&t(s,A(s,n,o),i))}))};t(p,k)}return{proxy:k,unobserve:()=>{v.active=!1,v.pending=[],v.timer&&(clearTimeout(v.timer),v.timer=null);const e=n.get(k);e&&e.delete(v)},resume:()=>{if(v.active)return;v.active=!0;let e=n.get(k);e||(e=new Set,n.set(k,e)),e.has(v)||e.add(v)},dispose:()=>{v.active=!1,v.pending=[],v.timer&&(clearTimeout(v.timer),v.timer=null);const e=n.get(k);e&&e.delete(v),v.callback=()=>{},v.onBatch=void 0}}},exports.toRaw=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isObject as e}from"../../shared/is-object.js";const
|
|
1
|
+
import{isObject as e}from"../../shared/is-object.js";import{IS_DEV as t}from"../../shared/env.js";const r=Symbol("solely.raw"),n=new WeakMap,i=new WeakMap,o=new WeakMap,a=new WeakMap,s=new WeakMap;function l(e){if(e&&"object"==typeof e){const t=e[r];if(t)return t}return e}const c=e=>!(!e||"object"!=typeof e)&&(e instanceof File||e instanceof Blob||e instanceof FormData||e instanceof ArrayBuffer||e instanceof Response||e instanceof Request);function f(e){return!(!e||!e[r])}const u=(e,t,r=new WeakMap,n=0)=>{if(n>10)return e===t;if(e===t)return!0;if(null==e||null==t)return e===t;if("object"!=typeof e||"object"!=typeof t)return e===t;if(Array.isArray(e)!==Array.isArray(t))return!1;if(r.has(e))return r.get(e)===t;if(r.set(e,t),Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!u(e[i],t[i],r,n+1))return!1;return!0}const i=Reflect.ownKeys(e);if(i.length!==Reflect.ownKeys(t).length)return!1;for(const o of i){if(!Reflect.has(t,o))return!1;const i=e[o],a=t[o];if(!u(i,a,r,n+1))return!1}return!0},p=(e,t)=>{if(0===t.length)return!0;const r=e.map(String).join(".");return t.some(e=>e.test(r))},y=(e,t)=>{const r=(e=>{const t=[];let r=e;for(;r;){const e=o.get(r);if(!e||null==e.key)break;t.unshift(e.key),r=e.parent}return t})(e);let i=e,a=0;for(;i;){const e=n.get(i);if(e){const n=r.slice(r.length-a);e.forEach(e=>{if(!e.active)return;if(!p(n,e.filterRegexes))return;const r={...t,path:n};e.throttle>0?(e.pending.push(r),e.timer||(e.timer=setTimeout(()=>{if(!e.active)return;const t=[...e.pending];e.pending=[],e.timer=null,t.length>0&&(e.onBatch?e.onBatch(t):e.callback(t[t.length-1]))},e.throttle))):e.onBatch?e.onBatch([r]):e.callback(r)})}const s=o.get(i);i=(null==s?void 0:s.parent)||null,a++}};function h(p,h,d={}){const{throttle:g=0,onBatch:m,immediate:w=!1,deepCompare:b=!1}=d,v={callback:h,onBatch:m,throttle:g,filterRegexes:(Array.isArray(d.filter)?d.filter:d.filter?[d.filter]:[]).map(e=>{if(""===e)return/^.*$/;const t=e.replace(/\./g,"\\.").replace(/\*\*/g,"(.+)").replace(/\*/g,"[^.]+").replace(/\[\d+\]/g,"\\[\\d+\\]");return new RegExp(`^${t}$`)}),pending:[],timer:null,active:!0},A=(n,p,h)=>{if(!Object.isExtensible(n))return n;if(c(n))return n;if(n[r])return n;const d=i.get(n);if(d)return d;const g=new Proxy(n,{get(t,n,i){if(n===r)return t;if(Array.isArray(t)){const e=a.get(g);if(e&&Object.prototype.hasOwnProperty.call(e,n))return Reflect.get(e,n,i)}const o=Reflect.get(t,n,i);return"symbol"==typeof n?o:e(o)&&!c(o)?A(o,g,n):o},set(e,r,n,i){if(!v.active)return t&&console.warn("[Solely] Cannot set property on a disposed reactive object"),!0;const o=e[r];if(b?u(o,n):o===n)return!0;const a=Reflect.set(e,r,n,i);return 0===(s.get(g)||0)&&(Array.isArray(o)&&Array.isArray(n)?y(g,{type:"array-replace",oldValue:o,newValue:n}):y(g,{type:"set",key:r,newValue:n,oldValue:o})),a},deleteProperty(e,r){if(!v.active)return t&&console.warn("[Solely] Cannot delete property on a disposed reactive object"),!0;if(!Reflect.has(e,r))return!1;const n=e[r],i=Reflect.deleteProperty(e,r),o=s.get(g)||0;return i&&0===o&&y(g,{type:"delete",key:r,oldValue:n}),i}});return i.set(n,g),o.set(g,{parent:p,key:h}),Array.isArray(n)&&a.set(g,((e,t,r)=>{const n={};return["push","pop","shift","unshift","splice"].forEach(i=>{n[i]=function(...n){if(!t)return;const o=s.get(t)||0;s.set(t,o+1);const a=e[i].apply(e,n);if(s.set(t,o),"push"===i)r(t,{type:"array-push",index:e.length-n.length,values:n});else if("unshift"===i)r(t,{type:"array-push",index:0,values:n});else if("pop"===i)r(t,{type:"array-splice",index:e.length,deleteCount:1,insert:[]});else if("shift"===i)r(t,{type:"array-splice",index:0,deleteCount:1,insert:[]});else if("splice"===i){const[e,i,...o]=n;r(t,{type:"array-splice",index:e,deleteCount:i,insert:o})}return a}}),["sort","reverse","fill","copyWithin"].forEach(i=>{n[i]=function(...n){if(!t)return;const o=s.get(t)||0;s.set(t,o+1);const a=e[i].apply(e,n);return s.set(t,o),r(t,{type:"array-reset",method:i}),a}}),["indexOf","lastIndexOf","includes"].forEach(t=>{n[t]=function(r,...n){let i=e[t].apply(e,[r,...n]);return-1!==i&&!1!==i||!f(r)||(i=e[t].apply(e,[l(r),...n])),i}}),n})(n,g,y)),g},k=A(p,null,null);let x=n.get(k);if(x||(x=new Set,n.set(k,x)),x.add(v),w){const t=(r,n,i=new WeakSet)=>{e(r)&&!i.has(r)&&(i.add(r),Reflect.ownKeys(r).forEach(o=>{const a=r[o];e(a)&&i.has(a)||(y(n,{type:"set",key:o,newValue:a,oldValue:void 0}),e(a)&&t(a,A(a,n,o),i))}))};t(p,k)}return{proxy:k,unobserve:()=>{v.active=!1,v.pending=[],v.timer&&(clearTimeout(v.timer),v.timer=null);const e=n.get(k);e&&e.delete(v)},resume:()=>{if(v.active)return;v.active=!0;let e=n.get(k);e||(e=new Set,n.set(k,e)),e.has(v)||e.add(v)},dispose:()=>{v.active=!1,v.pending=[],v.timer&&(clearTimeout(v.timer),v.timer=null);const e=n.get(k);e&&e.delete(v),v.callback=()=>{},v.onBatch=void 0}}}export{f as isProxy,h as observe,l as toRaw};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",copy:"©",reg:"®",trade:"™",hellip:"…",middot:"·",euro:"€"},t={128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},r=/&(?:#([xX][0-9a-fA-F]+|\d+)|([a-zA-Z0-9]+));/g;exports.default=function(o){return o&&"string"==typeof o&&o.includes("&")?o.replace(r,(r,o,n)=>{if(n)return e[n.toLowerCase()]||r;if(o){const e="x"===o[0]||"X"===o[0];let n=parseInt(e?o.slice(1):o,e?16:10);return isNaN(n)?r:(n>=128&&n<=159&&(n=t[n]||n),0===n||n>=55296&&n<=57343||n>1114111?"�":String.fromCodePoint(n))}return r}):o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=
|
|
1
|
+
const t={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",copy:"©",reg:"®",trade:"™",hellip:"…",middot:"·",euro:"€"},e={128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},r=/&(?:#([xX][0-9a-fA-F]+|\d+)|([a-zA-Z0-9]+));/g;function o(o){return o&&"string"==typeof o&&o.includes("&")?o.replace(r,(r,o,n)=>{if(n)return t[n.toLowerCase()]||r;if(o){const t="x"===o[0]||"X"===o[0];let n=parseInt(t?o.slice(1):o,t?16:10);return isNaN(n)?r:(n>=128&&n<=159&&(n=e[n]||n),0===n||n>=55296&&n<=57343||n>1114111?"�":String.fromCodePoint(n))}return r}):o}export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=Object.defineProperty,t=(t,r,o)=>((t,r,o)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o)(t,"symbol"!=typeof r?r+"":r,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../types/ast.cjs"),o=require("../../shared/templateError.cjs"),
|
|
1
|
+
"use strict";var e=Object.defineProperty,t=(t,r,o)=>((t,r,o)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o)(t,"symbol"!=typeof r?r+"":r,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../types/ast.cjs"),o=require("../../shared/templateError.cjs"),n=require("../../shared/env.cjs"),s=require("./html-decode.cjs"),i=Symbol("solely.irCtx"),a=Symbol("solely.irEvents"),c=Symbol("solely.prevClassObj"),l=Symbol("solely.prevStyleObj"),d={xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},h={readonly:"readOnly",for:"htmlFor",tabindex:"tabIndex",contenteditable:"contentEditable",maxlength:"maxLength"},m=new Set(["data-","aria-","role","form"]),u=new Set(["value","selectedIndex"]);function f(e,t){var r;const o=null==(r=t.a)?void 0:r.find(e=>"class"===e.k&&!e.d);(null==o?void 0:o.v)&&e.setAttribute("class",o.v)}function p(e,t){var r;if(!e.style)return;const o=null==(r=t.a)?void 0:r.find(e=>"style"===e.k&&!e.d),n=o?v(o.v):{};for(const s in n){const t=n[s];s.startsWith("--")?e.style.setProperty(s,t):e.style[s]=t}}const y=e=>!(!e||0===e.length||/\s/.test(e)&&(n.IS_DEV&&console.warn(`[Solely] Invalid class name "${e}" contains whitespace, will be ignored`),1));function v(e){const t={},r=[[e]];for(;r.length;){const[e,o]=r.pop()||[];if(e){if("string"==typeof e){const r=/([^:;]+)\s*:\s*([^;]*\(.*?\)[^;]*|[^;]+)/g;let o;for(;null!==(o=r.exec(e));){const e=o[1].trim(),r=o[2].trim();e&&r&&(t[e]=r)}continue}if(Array.isArray(e))for(let t=e.length-1;t>=0;t--)r.push([e[t]]);else if("object"==typeof e)for(const n in e){const s=e[n];if(null==s)continue;const i=o?`${o}-${n}`:n;"object"!=typeof s||Array.isArray(s)?t[i]=String(s):r.push([s,i])}}}return t}function S(e,t,r){const o=null==r?"":String(r),n=t.indexOf(":");if(n>0){const r=t.slice(0,n),s=d[r];if(s)return void(e.getAttributeNS(s,t)!==o&&e.setAttributeNS(s,t,o))}e.getAttribute(t)!==o&&e.setAttribute(t,o)}function b(e,t,r,o){const n=h[t]||t;if(t.startsWith("data-")||t.startsWith("aria-")||m.has(t))return void S(e,t,r);const s=e,i=s.tagName;if(null!=r){if("src"===n||"href"===n){const t=String(r);if(s[n]===t||e.getAttribute(n)===t)return}if("value"!==n||"INPUT"!==i&&"TEXTAREA"!==i||s.value!==r)if("boolean"!=typeof r)(o??(e instanceof SVGElement||void 0!==s.ownerSVGElement))&&!h[t]?S(e,t,r):s[n]!==r&&(s[n]=r);else{if(s[n]===r)return;s[n]=r}}else if("boolean"==typeof s[n])!1!==s[n]&&(s[n]=!1);else{const r=s[n];""!==r&&void 0!==r&&(s[n]=""),e.hasAttribute(t)&&e.removeAttribute(t)}}class g{constructor(e,r,o={}){t(this,"nodeMap",new Map),t(this,"marker",!1),t(this,"staticSubtreeCache",new Map),this.ir=e,this.container=r,this.scope=o}evalIR(e,t,r){var s;const i=this.ir.fns[e-1];if(n.IS_DEV)try{return i?i.apply(this.scope,t):""}catch(a){return o.showTemplateError(a.message||a.toString(),(null==(s=this.ir.m)?void 0:s.src)||"",r,this.scope.tagName),""}return i?i.apply(this.scope,t):""}createElement(e,t){const r=e.g??"";return t instanceof SVGElement||"svg"===r?document.createElementNS("http://www.w3.org/2000/svg",r):document.createElement(r)}createText(e,t){const r=e.d?this.evalIR(e.f??-1,[t],e.__m):s.default(e.x||"");return document.createTextNode(r)}createComment(e,t){const r=e.d?this.evalIR(e.f??-1,[t],e.__m):e.x||"";return document.createComment(r)}applyAttrs(e,t,r,o=!1){const n=[],s=e,d=e instanceof SVGElement||void 0!==s.ownerSVGElement;let h;s[i]||(s[i]={loops:null}),s[i].loops=r,s[a]||(s[a]=Object.create(null));let m,f=!1,p=!1;for(const c of t){const{k:t,f:l,d:y,v:v}=c;if(":class"===t){h=this.evalIR(l??-1,[r],c.__m),f=!0;continue}if(":style"===t){m=this.evalIR(l??-1,[r],c.__m),p=!0;continue}if("class"===t||"style"===t)continue;const g=t[0];if("@"===g){const r=t.slice(1),n=c.r??"user";let d=s[a][r];if(d||(d=s[a][r]={model:[],user:[]},e.addEventListener(r,e=>{for(const t of d.model)t(e);for(const t of d.user)t(e)})),!o){const e=e=>this.evalIR(l??-1,[e,s[i].loops],c.__m);d[n].push(e)}continue}if("mounted"===t){o||requestAnimationFrame(()=>this.evalIR(l??-1,[e,r],c.__m));continue}if("updated"===t){o&&requestAnimationFrame(()=>this.evalIR(l??-1,[e,r],c.__m));continue}if("ref"===t&&v){this.scope.$refs=this.scope.$refs||{},this.scope.$refs[v]=e;continue}const k=y?this.evalIR(l??-1,[r],c.__m):v??"";if(":"===g){const r=t.slice(1);"SELECT"===e.tagName&&u.has(r)?n.push(()=>b(e,r,k,d)):b(e,r,k,d)}else o||S(e,t,String(k))}return f&&((e,t)=>{const r=e,o=r[c],n=function(e){const t={},r=[e];for(;r.length;){const e=r.pop();if(e)if("string"==typeof e){const r=e.split(" ");for(let e=0;e<r.length;e++){const o=r[e].trim();o&&(t[o]=!0)}}else if(Array.isArray(e))for(let t=e.length-1;t>=0;t--)r.push(e[t]);else if("object"==typeof e)for(const r in e)e[r]&&(t[r]=!0)}return t}(t),s={};for(const a in n)y(a)&&(s[a]=n[a]);if(!o){for(const t in s)e.classList.add(t);return void(r[c]=s)}let i=!1;for(const a in o)s[a]||(e.classList.remove(a),i=!0);for(const a in s)o[a]||(e.classList.add(a),i=!0);i&&(r[c]=s)})(e,h),p&&((e,t)=>{const r=e,o=v(t),n=r[l];if(!n){for(const t in o){const r=o[t];t.startsWith("--")?e.style.setProperty(t,r):e.style[t]=r}return void(r[l]=o)}let s=!1;for(const i in n)i in o||(i.startsWith("--")?e.style.removeProperty(i):e.style[i]="",s=!0);for(const i in o){const t=o[i];t!==n[i]&&(i.startsWith("--")?e.style.setProperty(i,t):e.style[i]=t,s=!0)}s&&(r[l]=o)})(e,m),n}updateNode(e,t,r){const o=t.d?this.evalIR(t.f??-1,[r],t.__m):t.x||"";t.d&&e.textContent!==o&&(e.textContent=o)}createStaticSubtree(e,t,o){var n;switch(e.t){case r.ASTType.Element:{const r=this.createElement(e,t);f(r,e),p(r,e);const s=this.applyAttrs(r,e.a??[],o);return null==(n=e.c)||n.forEach(e=>{const t=this.createStaticSubtree(e,r,o);r.appendChild(t)}),s.forEach(e=>e()),r}case r.ASTType.Text:return this.createText(e,o);case r.ASTType.Comment:return this.createComment(e,o);default:return document.createComment("unknown")}}handleStaticSubtree(e,t,r,o){const n=this.staticSubtreeCache.get(t);if(n){const e=n.cloneNode(!0);return r.appendChild(e),e}const s=this.createStaticSubtree(e,r,o);return r.appendChild(s),this.staticSubtreeCache.set(t,s.cloneNode(!0)),s}irToNode(e,t,o,n,s){var i,a,c,l,d,h,m;const u=o+"-"+t,y=this.nodeMap.get(u);let v;if(1!==e.s)if(y){v=y.node,y.marker=this.marker;let t=[];e.d&&(e.t===r.ASTType.Element?t=this.applyAttrs(v,e.a??[],s,!0):this.updateNode(v,e,s)),null==(i=e.c)||i.forEach((e,t)=>{this.irToNode(e,t,u,v,s)}),t.forEach(e=>e())}else switch(e.t){case r.ASTType.Element:v=this.createElement(e,n),f(v,e),p(v,e);const t=this.applyAttrs(v,e.a??[],s);n.appendChild(v),this.nodeMap.set(u,{irNode:e,node:v,loops:s,marker:this.marker}),null==(a=e.c)||a.forEach((e,t)=>{this.irToNode(e,t,u,v,s)}),t.forEach(e=>e());break;case r.ASTType.Text:v=this.createText(e,s),n.appendChild(v),this.nodeMap.set(u,{irNode:e,node:v,loops:s,marker:this.marker});break;case r.ASTType.Comment:v=this.createComment(e,s),n.appendChild(v),this.nodeMap.set(u,{irNode:e,node:v,loops:s,marker:this.marker});break;case r.ASTType.For:{const t=`${u}-end`;let o=null==(c=this.nodeMap.get(t))?void 0:c.node;o?this.nodeMap.get(t).marker=this.marker:(o=document.createComment(`for:${u}`),n.appendChild(o),this.nodeMap.set(t,{irNode:{t:r.ASTType.Comment},node:o,loops:s,marker:this.marker}));const i=this.evalIR(e.f??-1,[s],e.__m)||[],a=document.createDocumentFragment();i.forEach((t,r)=>{var o;const n=[...s,{itmVal:t,idxVal:r}];null==(o=e.c)||o.forEach((e,t)=>{this.irToNode(e,t,`${u}-for-${r}`,a,n)})}),null==(l=o.parentNode)||l.insertBefore(a,o);break}case r.ASTType.Conditional:{const t=`${u}-end`;let r=null==(d=this.nodeMap.get(t))?void 0:d.node;r?this.nodeMap.get(t).marker=this.marker:(r=document.createComment(`if:${u}`),n.appendChild(r),this.nodeMap.set(t,{irNode:{},node:r,loops:s,marker:this.marker}));for(let o=0;o<(e.b||[]).length;o++){const t=null==(h=e.b)?void 0:h[o];if(null===t.f||this.evalIR(t.f,[s],t.__m)){const e=document.createDocumentFragment();t.c.forEach((t,r)=>{this.irToNode(t,r,`${u}-if-${o}`,e,s)}),null==(m=r.parentNode)||m.insertBefore(e,r);break}}break}}else y?(y.marker=this.marker,v=y.node):(v=this.handleStaticSubtree(e,u,n,s),this.nodeMap.set(u,{irNode:e,node:v,loops:s,marker:this.marker}))}cleanupOldNodes(){for(const[e,t]of this.nodeMap.entries())if(t.marker!==this.marker){const{irNode:r,node:o,loops:n}=t;if(r.a){const e=r.a.find(e=>"unmounted"===e.k);e&&requestAnimationFrame(()=>{this.evalIR(e.f??-1,[o,n],e.__m)});const t=r.a.find(e=>"ref"===e.k);t&&t.v&&delete this.scope.$refs[t.v]}null==o||o.remove(),this.nodeMap.delete(e)}}mount(){this.marker=!this.marker,this.ir.n.forEach((e,t)=>{this.irToNode(e,t,"root",this.container,[])}),this.cleanupOldNodes()}update(){this.marker=!this.marker,this.ir.n.forEach((e,t)=>{this.irToNode(e,t,"root",this.container,[])}),this.cleanupOldNodes()}destroy(){this.container.innerHTML="",this.nodeMap.clear(),this.staticSubtreeCache.clear()}}exports.IRRenderer=g,exports.createRender=(e,t,r={})=>{const o=new g(e,t,r);return o.mount(),{update:()=>o.update(),destroy:()=>o.destroy()}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,o,n)=>((t,o,n)=>o in t?e(t,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[o]=n)(t,"symbol"!=typeof o?o+"":o,n);import{ASTType as o}from"../../types/ast.js";import{showTemplateError as n}from"../../shared/templateError.js";import{IS_DEV as s}from"../../shared/env.js";import r from"./html-decode.js";const i=Symbol("solely.irCtx"),a=Symbol("solely.irEvents"),c=Symbol("solely.prevClassObj"),l=Symbol("solely.prevStyleObj"),d={xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},h={readonly:"readOnly",for:"htmlFor",tabindex:"tabIndex",contenteditable:"contentEditable",maxlength:"maxLength"},m=new Set(["data-","aria-","role","form"]),f=new Set(["value","selectedIndex"]);function u(e,t){var o;const n=null==(o=t.a)?void 0:o.find(e=>"class"===e.k&&!e.d);(null==n?void 0:n.v)&&e.setAttribute("class",n.v)}function p(e,t){var o;if(!e.style)return;const n=null==(o=t.a)?void 0:o.find(e=>"style"===e.k&&!e.d),s=n?y(n.v):{};for(const r in s){const t=s[r];r.startsWith("--")?e.style.setProperty(r,t):e.style[r]=t}}const v=e=>!(!e||0===e.length||/\s/.test(e)&&(s&&console.warn(`[Solely] Invalid class name "${e}" contains whitespace, will be ignored`),1));function y(e){const t={},o=[[e]];for(;o.length;){const[e,n]=o.pop()||[];if(e){if("string"==typeof e){const o=/([^:;]+)\s*:\s*([^;]*\(.*?\)[^;]*|[^;]+)/g;let n;for(;null!==(n=o.exec(e));){const e=n[1].trim(),o=n[2].trim();e&&o&&(t[e]=o)}continue}if(Array.isArray(e))for(let t=e.length-1;t>=0;t--)o.push([e[t]]);else if("object"==typeof e)for(const s in e){const r=e[s];if(null==r)continue;const i=n?`${n}-${s}`:s;"object"!=typeof r||Array.isArray(r)?t[i]=String(r):o.push([r,i])}}}return t}function b(e,t,o){const n=null==o?"":String(o),s=t.indexOf(":");if(s>0){const o=t.slice(0,s),r=d[o];if(r)return void(e.getAttributeNS(r,t)!==n&&e.setAttributeNS(r,t,n))}e.getAttribute(t)!==n&&e.setAttribute(t,n)}function g(e,t,o){const
|
|
1
|
+
var e=Object.defineProperty,t=(t,o,n)=>((t,o,n)=>o in t?e(t,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[o]=n)(t,"symbol"!=typeof o?o+"":o,n);import{ASTType as o}from"../../types/ast.js";import{showTemplateError as n}from"../../shared/templateError.js";import{IS_DEV as s}from"../../shared/env.js";import r from"./html-decode.js";const i=Symbol("solely.irCtx"),a=Symbol("solely.irEvents"),c=Symbol("solely.prevClassObj"),l=Symbol("solely.prevStyleObj"),d={xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},h={readonly:"readOnly",for:"htmlFor",tabindex:"tabIndex",contenteditable:"contentEditable",maxlength:"maxLength"},m=new Set(["data-","aria-","role","form"]),f=new Set(["value","selectedIndex"]);function u(e,t){var o;const n=null==(o=t.a)?void 0:o.find(e=>"class"===e.k&&!e.d);(null==n?void 0:n.v)&&e.setAttribute("class",n.v)}function p(e,t){var o;if(!e.style)return;const n=null==(o=t.a)?void 0:o.find(e=>"style"===e.k&&!e.d),s=n?y(n.v):{};for(const r in s){const t=s[r];r.startsWith("--")?e.style.setProperty(r,t):e.style[r]=t}}const v=e=>!(!e||0===e.length||/\s/.test(e)&&(s&&console.warn(`[Solely] Invalid class name "${e}" contains whitespace, will be ignored`),1));function y(e){const t={},o=[[e]];for(;o.length;){const[e,n]=o.pop()||[];if(e){if("string"==typeof e){const o=/([^:;]+)\s*:\s*([^;]*\(.*?\)[^;]*|[^;]+)/g;let n;for(;null!==(n=o.exec(e));){const e=n[1].trim(),o=n[2].trim();e&&o&&(t[e]=o)}continue}if(Array.isArray(e))for(let t=e.length-1;t>=0;t--)o.push([e[t]]);else if("object"==typeof e)for(const s in e){const r=e[s];if(null==r)continue;const i=n?`${n}-${s}`:s;"object"!=typeof r||Array.isArray(r)?t[i]=String(r):o.push([r,i])}}}return t}function b(e,t,o){const n=null==o?"":String(o),s=t.indexOf(":");if(s>0){const o=t.slice(0,s),r=d[o];if(r)return void(e.getAttributeNS(r,t)!==n&&e.setAttributeNS(r,t,n))}e.getAttribute(t)!==n&&e.setAttribute(t,n)}function g(e,t,o,n){const s=h[t]||t;if(t.startsWith("data-")||t.startsWith("aria-")||m.has(t))return void b(e,t,o);const r=e,i=r.tagName;if(null!=o){if("src"===s||"href"===s){const t=String(o);if(r[s]===t||e.getAttribute(s)===t)return}if("value"!==s||"INPUT"!==i&&"TEXTAREA"!==i||r.value!==o)if("boolean"!=typeof o)(n??(e instanceof SVGElement||void 0!==r.ownerSVGElement))&&!h[t]?b(e,t,o):r[s]!==o&&(r[s]=o);else{if(r[s]===o)return;r[s]=o}}else if("boolean"==typeof r[s])!1!==r[s]&&(r[s]=!1);else{const o=r[s];""!==o&&void 0!==o&&(r[s]=""),e.hasAttribute(t)&&e.removeAttribute(t)}}class k{constructor(e,o,n={}){t(this,"nodeMap",new Map),t(this,"marker",!1),t(this,"staticSubtreeCache",new Map),this.ir=e,this.container=o,this.scope=n}evalIR(e,t,o){var r;const i=this.ir.fns[e-1];if(s)try{return i?i.apply(this.scope,t):""}catch(a){return n(a.message||a.toString(),(null==(r=this.ir.m)?void 0:r.src)||"",o,this.scope.tagName),""}return i?i.apply(this.scope,t):""}createElement(e,t){const o=e.g??"";return t instanceof SVGElement||"svg"===o?document.createElementNS("http://www.w3.org/2000/svg",o):document.createElement(o)}createText(e,t){const o=e.d?this.evalIR(e.f??-1,[t],e.__m):r(e.x||"");return document.createTextNode(o)}createComment(e,t){const o=e.d?this.evalIR(e.f??-1,[t],e.__m):e.x||"";return document.createComment(o)}applyAttrs(e,t,o,n=!1){const s=[],r=e,d=e instanceof SVGElement||void 0!==r.ownerSVGElement;let h;r[i]||(r[i]={loops:null}),r[i].loops=o,r[a]||(r[a]=Object.create(null));let m,u=!1,p=!1;for(const c of t){const{k:t,f:l,d:v,v:y}=c;if(":class"===t){h=this.evalIR(l??-1,[o],c.__m),u=!0;continue}if(":style"===t){m=this.evalIR(l??-1,[o],c.__m),p=!0;continue}if("class"===t||"style"===t)continue;const k=t[0];if("@"===k){const o=t.slice(1),s=c.r??"user";let d=r[a][o];if(d||(d=r[a][o]={model:[],user:[]},e.addEventListener(o,e=>{for(const t of d.model)t(e);for(const t of d.user)t(e)})),!n){const e=e=>this.evalIR(l??-1,[e,r[i].loops],c.__m);d[s].push(e)}continue}if("mounted"===t){n||requestAnimationFrame(()=>this.evalIR(l??-1,[e,o],c.__m));continue}if("updated"===t){n&&requestAnimationFrame(()=>this.evalIR(l??-1,[e,o],c.__m));continue}if("ref"===t&&y){this.scope.$refs=this.scope.$refs||{},this.scope.$refs[y]=e;continue}const S=v?this.evalIR(l??-1,[o],c.__m):y??"";if(":"===k){const o=t.slice(1);"SELECT"===e.tagName&&f.has(o)?s.push(()=>g(e,o,S,d)):g(e,o,S,d)}else n||b(e,t,String(S))}return u&&((e,t)=>{const o=e,n=o[c],s=function(e){const t={},o=[e];for(;o.length;){const e=o.pop();if(e)if("string"==typeof e){const o=e.split(" ");for(let e=0;e<o.length;e++){const n=o[e].trim();n&&(t[n]=!0)}}else if(Array.isArray(e))for(let t=e.length-1;t>=0;t--)o.push(e[t]);else if("object"==typeof e)for(const o in e)e[o]&&(t[o]=!0)}return t}(t),r={};for(const a in s)v(a)&&(r[a]=s[a]);if(!n){for(const t in r)e.classList.add(t);return void(o[c]=r)}let i=!1;for(const a in n)r[a]||(e.classList.remove(a),i=!0);for(const a in r)n[a]||(e.classList.add(a),i=!0);i&&(o[c]=r)})(e,h),p&&((e,t)=>{const o=e,n=y(t),s=o[l];if(!s){for(const t in n){const o=n[t];t.startsWith("--")?e.style.setProperty(t,o):e.style[t]=o}return void(o[l]=n)}let r=!1;for(const i in s)i in n||(i.startsWith("--")?e.style.removeProperty(i):e.style[i]="",r=!0);for(const i in n){const t=n[i];t!==s[i]&&(i.startsWith("--")?e.style.setProperty(i,t):e.style[i]=t,r=!0)}r&&(o[l]=n)})(e,m),s}updateNode(e,t,o){const n=t.d?this.evalIR(t.f??-1,[o],t.__m):t.x||"";t.d&&e.textContent!==n&&(e.textContent=n)}createStaticSubtree(e,t,n){var s;switch(e.t){case o.Element:{const o=this.createElement(e,t);u(o,e),p(o,e);const r=this.applyAttrs(o,e.a??[],n);return null==(s=e.c)||s.forEach(e=>{const t=this.createStaticSubtree(e,o,n);o.appendChild(t)}),r.forEach(e=>e()),o}case o.Text:return this.createText(e,n);case o.Comment:return this.createComment(e,n);default:return document.createComment("unknown")}}handleStaticSubtree(e,t,o,n){const s=this.staticSubtreeCache.get(t);if(s){const e=s.cloneNode(!0);return o.appendChild(e),e}const r=this.createStaticSubtree(e,o,n);return o.appendChild(r),this.staticSubtreeCache.set(t,r.cloneNode(!0)),r}irToNode(e,t,n,s,r){var i,a,c,l,d,h,m;const f=n+"-"+t,v=this.nodeMap.get(f);let y;if(1!==e.s)if(v){y=v.node,v.marker=this.marker;let t=[];e.d&&(e.t===o.Element?t=this.applyAttrs(y,e.a??[],r,!0):this.updateNode(y,e,r)),null==(i=e.c)||i.forEach((e,t)=>{this.irToNode(e,t,f,y,r)}),t.forEach(e=>e())}else switch(e.t){case o.Element:y=this.createElement(e,s),u(y,e),p(y,e);const t=this.applyAttrs(y,e.a??[],r);s.appendChild(y),this.nodeMap.set(f,{irNode:e,node:y,loops:r,marker:this.marker}),null==(a=e.c)||a.forEach((e,t)=>{this.irToNode(e,t,f,y,r)}),t.forEach(e=>e());break;case o.Text:y=this.createText(e,r),s.appendChild(y),this.nodeMap.set(f,{irNode:e,node:y,loops:r,marker:this.marker});break;case o.Comment:y=this.createComment(e,r),s.appendChild(y),this.nodeMap.set(f,{irNode:e,node:y,loops:r,marker:this.marker});break;case o.For:{const t=`${f}-end`;let n=null==(c=this.nodeMap.get(t))?void 0:c.node;n?this.nodeMap.get(t).marker=this.marker:(n=document.createComment(`for:${f}`),s.appendChild(n),this.nodeMap.set(t,{irNode:{t:o.Comment},node:n,loops:r,marker:this.marker}));const i=this.evalIR(e.f??-1,[r],e.__m)||[],a=document.createDocumentFragment();i.forEach((t,o)=>{var n;const s=[...r,{itmVal:t,idxVal:o}];null==(n=e.c)||n.forEach((e,t)=>{this.irToNode(e,t,`${f}-for-${o}`,a,s)})}),null==(l=n.parentNode)||l.insertBefore(a,n);break}case o.Conditional:{const t=`${f}-end`;let o=null==(d=this.nodeMap.get(t))?void 0:d.node;o?this.nodeMap.get(t).marker=this.marker:(o=document.createComment(`if:${f}`),s.appendChild(o),this.nodeMap.set(t,{irNode:{},node:o,loops:r,marker:this.marker}));for(let n=0;n<(e.b||[]).length;n++){const t=null==(h=e.b)?void 0:h[n];if(null===t.f||this.evalIR(t.f,[r],t.__m)){const e=document.createDocumentFragment();t.c.forEach((t,o)=>{this.irToNode(t,o,`${f}-if-${n}`,e,r)}),null==(m=o.parentNode)||m.insertBefore(e,o);break}}break}}else v?(v.marker=this.marker,y=v.node):(y=this.handleStaticSubtree(e,f,s,r),this.nodeMap.set(f,{irNode:e,node:y,loops:r,marker:this.marker}))}cleanupOldNodes(){for(const[e,t]of this.nodeMap.entries())if(t.marker!==this.marker){const{irNode:o,node:n,loops:s}=t;if(o.a){const e=o.a.find(e=>"unmounted"===e.k);e&&requestAnimationFrame(()=>{this.evalIR(e.f??-1,[n,s],e.__m)});const t=o.a.find(e=>"ref"===e.k);t&&t.v&&delete this.scope.$refs[t.v]}null==n||n.remove(),this.nodeMap.delete(e)}}mount(){this.marker=!this.marker,this.ir.n.forEach((e,t)=>{this.irToNode(e,t,"root",this.container,[])}),this.cleanupOldNodes()}update(){this.marker=!this.marker,this.ir.n.forEach((e,t)=>{this.irToNode(e,t,"root",this.container,[])}),this.cleanupOldNodes()}destroy(){this.container.innerHTML="",this.nodeMap.clear(),this.staticSubtreeCache.clear()}}const S=(e,t,o={})=>{const n=new k(e,t,o);return n.mount(),{update:()=>n.update(),destroy:()=>n.destroy()}};export{k as IRRenderer,S as createRender};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports.camelToKebab=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const camelToKebab: (str: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase();export{e as camelToKebab};
|
package/dist/shared/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./templateError.cjs"),r=require("./gen-function.cjs"),s=require("./functions.cjs"),t=require("./event-listeners.cjs"),o=require("./is-object.cjs"),c=require("./url.cjs"),i=require("./env.cjs");exports.showTemplateError=e.showTemplateError,exports.genFunction=r.genFunction,exports.createFunction=s.createFunction,exports.isCSPBlocked=s.isCSPBlocked,exports.listeners=t.default,exports.isObject=o.isObject,exports.parseHashUrl=c.parseHashUrl,exports.IS_DEV=i.IS_DEV,exports.IS_PROD=i.IS_PROD;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./templateError.cjs"),r=require("./gen-function.cjs"),s=require("./functions.cjs"),t=require("./event-listeners.cjs"),o=require("./is-object.cjs"),c=require("./url.cjs"),i=require("./env.cjs"),n=require("./case-convert.cjs");exports.showTemplateError=e.showTemplateError,exports.genFunction=r.genFunction,exports.createFunction=s.createFunction,exports.isCSPBlocked=s.isCSPBlocked,exports.listeners=t.default,exports.isObject=o.isObject,exports.parseHashUrl=c.parseHashUrl,exports.IS_DEV=i.IS_DEV,exports.IS_PROD=i.IS_PROD,exports.camelToKebab=n.camelToKebab;
|
package/dist/shared/index.d.ts
CHANGED
package/dist/shared/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{showTemplateError as r}from"./templateError.js";import{genFunction as o}from"./gen-function.js";import{createFunction as t,isCSPBlocked as m}from"./functions.js";import{default as s}from"./event-listeners.js";import{isObject as e}from"./is-object.js";import{parseHashUrl as i}from"./url.js";import{IS_DEV as f,IS_PROD as n}from"./env.js";export{f as IS_DEV,n as IS_PROD,t as createFunction,o as genFunction,m as isCSPBlocked,e as isObject,s as listeners,i as parseHashUrl,r as showTemplateError};
|
|
1
|
+
import{showTemplateError as r}from"./templateError.js";import{genFunction as o}from"./gen-function.js";import{createFunction as t,isCSPBlocked as m}from"./functions.js";import{default as s}from"./event-listeners.js";import{isObject as e}from"./is-object.js";import{parseHashUrl as i}from"./url.js";import{IS_DEV as f,IS_PROD as n}from"./env.js";import{camelToKebab as p}from"./case-convert.js";export{f as IS_DEV,n as IS_PROD,p as camelToKebab,t as createFunction,o as genFunction,m as isCSPBlocked,e as isObject,s as listeners,i as parseHashUrl,r as showTemplateError};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=new Set(["[object Function]","[object Date]","[object RegExp]","[object Map]","[object Set]","[object WeakMap]","[object WeakSet]"]);exports.isObject=t=>null!==t&&"object"==typeof t&&!e.has(Object.prototype.toString.call(t));
|
package/dist/shared/is-object.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=
|
|
1
|
+
const t=new Set(["[object Function]","[object Date]","[object RegExp]","[object Map]","[object Set]","[object WeakMap]","[object WeakSet]"]),e=e=>null!==e&&"object"==typeof e&&!t.has(Object.prototype.toString.call(e));export{e as isObject};
|
package/package.json
CHANGED