rip-lang 3.13.66 → 3.13.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/docs/dist/rip.js +10 -10
- package/docs/dist/rip.min.js +4 -4
- package/docs/dist/rip.min.js.br +0 -0
- package/package.json +1 -1
- package/src/browser.js +4 -4
- package/src/lexer.js +1 -1
- package/src/{app.rip → ui.rip} +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
<a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-3.13.
|
|
12
|
+
<a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-3.13.68-blue.svg" alt="Version"></a>
|
|
13
13
|
<a href="#zero-dependencies"><img src="https://img.shields.io/badge/dependencies-ZERO-brightgreen.svg" alt="Dependencies"></a>
|
|
14
14
|
<a href="#"><img src="https://img.shields.io/badge/tests-1%2C436%2F1%2C436-brightgreen.svg" alt="Tests"></a>
|
|
15
15
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
|
package/docs/dist/rip.js
CHANGED
|
@@ -1532,7 +1532,7 @@
|
|
|
1532
1532
|
return 0;
|
|
1533
1533
|
let m = /^#([a-zA-Z_][\w-]*)/.exec(this.chunk);
|
|
1534
1534
|
if (m) {
|
|
1535
|
-
this.emit("IDENTIFIER",
|
|
1535
|
+
this.emit("IDENTIFIER", "div#" + m[1]);
|
|
1536
1536
|
return m[0].length;
|
|
1537
1537
|
}
|
|
1538
1538
|
}
|
|
@@ -8739,8 +8739,8 @@ globalThis.zip ??= (...a) => a[0].map((_, i) => a.map(b => b[i]));
|
|
|
8739
8739
|
return new CodeGenerator({}).getComponentRuntime();
|
|
8740
8740
|
}
|
|
8741
8741
|
// src/browser.js
|
|
8742
|
-
var VERSION = "3.13.
|
|
8743
|
-
var BUILD_DATE = "2026-03-
|
|
8742
|
+
var VERSION = "3.13.68";
|
|
8743
|
+
var BUILD_DATE = "2026-03-02@03:09:09GMT";
|
|
8744
8744
|
if (typeof globalThis !== "undefined") {
|
|
8745
8745
|
if (!globalThis.__rip)
|
|
8746
8746
|
new Function(getReactiveRuntime())();
|
|
@@ -8831,7 +8831,7 @@ ${c.js}
|
|
|
8831
8831
|
}
|
|
8832
8832
|
const cfg = document.querySelector("script[data-launch]");
|
|
8833
8833
|
if (cfg && !globalThis.__ripLaunched) {
|
|
8834
|
-
const ui = importRip.modules?.["
|
|
8834
|
+
const ui = importRip.modules?.["ui.rip"];
|
|
8835
8835
|
if (ui?.launch) {
|
|
8836
8836
|
const url = cfg.getAttribute("data-launch") || "";
|
|
8837
8837
|
const hash = cfg.getAttribute("data-hash");
|
|
@@ -8902,9 +8902,9 @@ ${indented}`);
|
|
|
8902
8902
|
}
|
|
8903
8903
|
});
|
|
8904
8904
|
}
|
|
8905
|
-
// docs/dist/
|
|
8906
|
-
var
|
|
8907
|
-
__export(
|
|
8905
|
+
// docs/dist/_ui.js
|
|
8906
|
+
var exports__ui = {};
|
|
8907
|
+
__export(exports__ui, {
|
|
8908
8908
|
throttle: () => throttle,
|
|
8909
8909
|
stash: () => stash,
|
|
8910
8910
|
setContext: () => setContext,
|
|
@@ -9799,7 +9799,7 @@ ${indented}`);
|
|
|
9799
9799
|
mp.appendChild(wrapper);
|
|
9800
9800
|
inst.mount(wrapper);
|
|
9801
9801
|
layoutInstances.push(inst);
|
|
9802
|
-
slot = wrapper.querySelector("
|
|
9802
|
+
slot = wrapper.querySelector("#content") || wrapper;
|
|
9803
9803
|
mp = slot;
|
|
9804
9804
|
}
|
|
9805
9805
|
currentLayouts = [...layoutFiles];
|
|
@@ -10028,8 +10028,8 @@ ${indented}`);
|
|
|
10028
10028
|
};
|
|
10029
10029
|
|
|
10030
10030
|
// docs/dist/_entry.js
|
|
10031
|
-
importRip.modules["
|
|
10032
|
-
for (const [k, v] of Object.entries(
|
|
10031
|
+
importRip.modules["ui.rip"] = exports__ui;
|
|
10032
|
+
for (const [k, v] of Object.entries(exports__ui))
|
|
10033
10033
|
if (typeof v === "function")
|
|
10034
10034
|
globalThis[k] = v;
|
|
10035
10035
|
})();
|
package/docs/dist/rip.min.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
`}function i($){if(!$)return $;return $=$.replace(/::/g,":"),$=$.replace(/(\w+(?:<[^>]+>)?)\?\?/g,"$1 | null | undefined"),$=$.replace(/(\w+(?:<[^>]+>)?)\?(?![.:])/g,"$1 | undefined"),$=$.replace(/(\w+(?:<[^>]+>)?)\!/g,"NonNullable<$1>"),$}function C1($,U,F,W,u){if(!Array.isArray($))return;let f=$[0]?.valueOf?.()??$[0],Y=!1,A=null,_=null;if(f==="export"&&Array.isArray($[1])){Y=!0;let Z=$[1];if((Z[0]?.valueOf?.()??Z[0])==="="&&Array.isArray(Z[2])&&(Z[2][0]?.valueOf?.()??Z[2][0])==="component")A=Z[1]?.valueOf?.()??Z[1],_=Z[2]}else if(f==="="&&Array.isArray($[2])&&($[2][0]?.valueOf?.()??$[2][0])==="component")A=$[1]?.valueOf?.()??$[1],_=$[2];if(A&&_){let Z=Y?"export ":"",R=_[2],Q=Array.isArray(R)&&(R[0]?.valueOf?.()??R[0])==="block"?R.slice(1):R?[R]:[],z=[],J=!1;for(let K of Q){if(!Array.isArray(K))continue;let M=K[0]?.valueOf?.()??K[0],X,w,D,q,O;if(M==="state"||M==="readonly"||M==="computed"){if(X=K[1],D=Array.isArray(X)&&(X[0]?.valueOf?.()??X[0])==="."&&(X[1]?.valueOf?.()??X[1])==="this",w=D?X[2]?.valueOf?.()??X[2]:X?.valueOf?.()??X,q=D?X[2]?.type:X?.type,O=!0,!D)u.add(w)}else if(M==="."){if(D=(K[1]?.valueOf?.()??K[1])==="this",w=D?K[2]?.valueOf?.()??K[2]:null,q=D?K[2]?.type:null,O=!1,!D&&w)u.add(w)}else continue;if(!D||!w)continue;let P=q?i(q):"any",G=O?"?":"";if(!O)J=!0;z.push(` ${w}${G}: ${P};`)}if(U.push(`${Z}declare class ${A} {`),z.length>0){let K=J?"":"?";U.push(` constructor(props${K}: {`);for(let M of z)U.push(M);U.push(" });")}U.push("}")}if(f==="program"||f==="block"){for(let Z=1;Z<$.length;Z++)if(Array.isArray($[Z]))C1($[Z],U,F,W,u)}if(f==="export"&&Array.isArray($[1])&&!_)C1($[1],U,F,W,u)}function $2($,U,F){let[W,u]=U,f=W?.valueOf?.()??W,Y=[];if(Array.isArray(u)){let Z=u[0]==="block"?u.slice(1):[u];for(let R of Z)if(Array.isArray(R)){if(R[0]?.valueOf?.()==="="){let Q=R[1]?.valueOf?.()??R[1],z=R[2]?.valueOf?.()??R[2];Y.push([Q,z])}}}if(Y.length===0)return`const ${f} = {}`;let A=Y.map(([Z,R])=>`${Z}: ${R}`).join(", "),_=Y.map(([Z,R])=>`${R}: "${Z}"`).join(", ");return`const ${f} = {${A}, ${_}}`}var U2=new Set(["true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","yield","await","if","else","switch","for","while","do","try","catch","finally","class","extends","super","import","export","default"]),F2=new Set(["undefined","Infinity","NaN","then","unless","until","loop","of","by","when","def","component","render","enum","interface"]),c1={and:"&&",or:"||",is:"==",isnt:"!=",not:"!",yes:"true",no:"false",on:"true",off:"false"},W2=new Set(Object.keys(c1)),e2=new Set(["case","function","var","void","with","const","let","native","implements","package","private","protected","public","static"]),u3=new Set(["break","continue","debugger"]),f3=new Set(["NEW","TYPEOF","DELETE"]),$3=new Set(["IN","OF","INSTANCEOF"]),O1=new Set(["IDENTIFIER","PROPERTY",")","]","@","THIS","SUPER","DYNAMIC_IMPORT","?."]),X2=new Set([...O1,"NUMBER","INFINITY","NAN","STRING","STRING_END","REGEX","REGEX_END","BOOL","NULL","UNDEFINED","}"]),q1=new Set(["IDENTIFIER","PROPERTY","NUMBER","INFINITY","NAN","STRING","STRING_START","REGEX","REGEX_START","JS","NEW","PARAM_START","CLASS","IF","TRY","SWITCH","THIS","DYNAMIC_IMPORT","IMPORT_META","NEW_TARGET","UNDEFINED","NULL","BOOL","UNARY","DO","DO_IIFE","YIELD","AWAIT","UNARY_MATH","SUPER","THROW","@","->","=>","[","(","{","--","++"]),U3=new Set(["+","-"]),F3=new Set(["POST_IF","POST_UNLESS","FOR","WHILE","UNTIL","WHEN","BY","LOOP","TERMINATOR","||","&&","PIPE"]),W3=new Set(["STRING","STRING_END","REGEX","REGEX_END","NUMBER","BOOL","NULL","UNDEFINED","INFINITY","NAN","]","}"]),u1=new Set(["(","[","{","INDENT","CALL_START","PARAM_START","INDEX_START","STRING_START","INTERPOLATION_START","REGEX_START"]),a=new Set([")","]","}","OUTDENT","CALL_END","PARAM_END","INDEX_END","STRING_END","INTERPOLATION_END","REGEX_END"]),A3={"(":")",")":"(","[":"]","]":"[","{":"}","}":"{",INDENT:"OUTDENT",OUTDENT:"INDENT",CALL_START:"CALL_END",CALL_END:"CALL_START",PARAM_START:"PARAM_END",PARAM_END:"PARAM_START",INDEX_START:"INDEX_END",INDEX_END:"INDEX_START",STRING_START:"STRING_END",STRING_END:"STRING_START",INTERPOLATION_START:"INTERPOLATION_END",INTERPOLATION_END:"INTERPOLATION_START",REGEX_START:"REGEX_END",REGEX_END:"REGEX_START"},A2=new Set(["CATCH","THEN","ELSE","FINALLY",...a]),b1=new Set(["IDENTIFIER","PROPERTY","SUPER",")","CALL_END","]","INDEX_END","@","THIS"]),Y3=new Set(["IF","TRY","FINALLY","CATCH","CLASS","SWITCH","COMPONENT"]),Y2=new Set(["ELSE","->","=>","TRY","FINALLY","THEN"]),_3=new Set(["TERMINATOR","CATCH","FINALLY","ELSE","OUTDENT","LEADING_WHEN"]),Z1=new Set(["INDENT","OUTDENT","TERMINATOR"]),_2=new Set([".","?."]),R2=new Set(["\\",".","?.","UNARY","DO","DO_IIFE","MATH","UNARY_MATH","+","-","**","SHIFT","RELATION","COMPARE","&","^","|","&&","||","TERNARY","EXTENDS"]),R3=new Set([...X2,"++","--"]),Z2=new Set(["-=","+=","/=","*=","%=","||=","&&=","?=","??=","<<=",">>=",">>>=","&=","^=","|=","**=","//=","%%="]),Z3=new Set(["*","/","%","//","%%"]),w3=new Set(["==","!=","===","!==","<",">","<=",">=","=~"]),J3=new Set(["<<",">>",">>>"]),Q3=new Set(["!","~"]),X3=/^(?!\d)((?:(?!\s)[$\w\x7f-\uffff])+(?:!(?!\?)|[?](?![.?![(]))?)([^\n\S]*:(?![=:]))?/,z3=/^0b[01](?:_?[01])*n?|^0o[0-7](?:_?[0-7])*n?|^0x[\da-f](?:_?[\da-f])*n?|^\d+(?:_\d+)*n|^(?:\d+(?:_\d+)*)?\.?\d+(?:_\d+)*(?:e[+-]?\d+(?:_\d+)*)?/i,K3=/^(?:<=>|::=|::|[-=]>|~>|~=|:=|=!|===|!==|!\?|\?\!|\?\?|=~|\|>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>*\/%])\2=?|\?\.?|\.{2,3})/,D3=/^[^\n\S]+/,M3=/^(?:\n[^\n\S]*)+/,H3=/^(\s*)###([^#][\s\S]*?)(?:###([^\n\S]*)|###$)|^((?:\s*#(?!##[^#]).*)+)/,q3=/^[-=]>/,O3=/^(?:~[=>]|=!)/,G3=/^(?:'''\\|"""\\|'''|"""|'|")/,P3=/^(?:[^\\']|\\[\s\S])*/,I3=/^(?:[^\\"#$]|\\[\s\S]|\#(?!\{)|\$(?!\{))*/,E3=/^(?:[^\\']|\\[\s\S]|'(?!''))*/,B3=/^(?:[^\\"#$]|\\[\s\S]|"(?!"")|\#(?!\{)|\$(?!\{))*/,w2=/\n+([^\n\S]*)(?=\S)/g,N3=/^\/(?!\/)((?:[^[\/\n\\]|\\[^\n]|\[(?:\\[^\n]|[^\]\n\\])*\])*)(\/)?/,J2=/^\w*/,T3=/^(?!.*(.).*\1)[gimsuy]*$/,L3=/^(?:[^\\\/#\s]|\\[\s\S]|\/(?!\/\/)|\#(?!\{)|\s+(?:#(?!\{).*)?)*/,S3=/^`(?!``)((?:[^`\\]|\\[\s\S])*)`/,h3=/^```((?:[^`\\]|\\[\s\S]|`(?!``))*)```/,V3=/\s+$/,Q2=/^\s*(?:,|\??\.(?![.\d]))/,j3=65279;function G1($,U,{pre:F=0,row:W=0,col:u=0,len:f=0,data:Y=null}={}){let A=[$,U];return A.pre=F,A.data=Y,A.loc={r:W,c:u,n:f},A.spaced=F>0,A.newLine=!1,A}function r($,U,F){let W=G1($,U);if(W.generated=!0,F)W.origin=F;return W}function p($,{row:U=0,col:F=0,len:W=1}={}){let u=SyntaxError($);throw u.location={first_line:U,first_column:F,last_column:F+W-1},u}function C3($){if($==null)return NaN;switch($.charAt(1)){case"b":return parseInt($.slice(2).replace(/_/g,""),2);case"o":return parseInt($.slice(2).replace(/_/g,""),8);case"x":return parseInt($.slice(2).replace(/_/g,""),16);default:return parseFloat($.replace(/_/g,""))}}class s{tokenize($,U={}){this.code=$,this.tokens=[],this.ends=[],this.chunk="",this.pos=0,this.row=U.row||0,this.col=U.col||0,this.indent=0,this.indents=[],this.seenFor=!1,this.seenImport=!1,this.seenExport=!1,this.importSpecifierList=!1,this.exportSpecifierList=!1,this.inRenderBlock=!1,this.renderIndent=0,$=this.clean($),this.code=$;while(this.pos<$.length){this.chunk=$.slice(this.pos);let F=this.identifierToken()||this.commentToken()||this.whitespaceToken()||this.lineToken()||this.stringToken()||this.numberToken()||this.regexToken()||this.jsToken()||this.literalToken();if(F===0)p(`unexpected character: ${this.chunk.charAt(0)}`,{row:this.row,col:this.col});if(this.advance(F),U.untilBalanced&&this.ends.length===0)return{tokens:this.tokens,index:this.pos}}if(this.closeIndentation(),this.ends.length>0){let F=this.ends[this.ends.length-1];p(`missing ${F.tag}`,{row:this.row,col:this.col})}if(U.rewrite===!1)return this.tokens;return this.rewrite(this.tokens)}clean($){if($.charCodeAt(0)===j3)$=$.slice(1);if($=$.replace(/\r\n?/g,`
|
|
4
4
|
`),$=$.replace(V3,""),/^[^\n\S]/.test($))$=`
|
|
5
5
|
`+$;return $}advance($){let U=this.code.slice(this.pos,this.pos+$);for(let F=0;F<U.length;F++)if(U[F]===`
|
|
6
|
-
`)this.row++,this.col=0;else this.col++;this.pos+=$}emit($,U,{len:F,data:W,pre:u}={}){let f=G1($,U,{pre:u??0,row:this.row,col:this.col,len:F??(typeof U==="string"?U.length:0),data:W});return this.tokens.push(f),f}prev(){return this.tokens[this.tokens.length-1]}prevTag(){let $=this.prev();return $?$[0]:void 0}prevVal(){let $=this.prev();return $?$[1]:void 0}identifierToken(){if(O3.test(this.chunk))return 0;let $=X3.exec(this.chunk);if(!$)return 0;let[,U,F]=$,W=U.length,u={},f;if(U==="own"&&this.prevTag()==="FOR")return this.emit("OWN",U,{len:W}),W;if(U==="from"&&this.prevTag()==="YIELD")return this.emit("FROM",U,{len:W}),W;if(U==="as"&&!this.seenFor&&(this.seenImport||this.seenExport)){if(this.seenImport){if(this.prevVal()==="*")this.prev()[0]="IMPORT_ALL"}let R=this.prevTag();if(R==="DEFAULT"||R==="IMPORT_ALL"||R==="IDENTIFIER")return this.emit("AS",U,{len:W}),W}if((U==="as"||U==="as!")&&this.seenFor)return this.seenFor=!1,this.emit(U==="as!"?"FORASAWAIT":"FORAS","as",{len:W}),W;if(U==="default"&&this.seenExport&&(this.prevTag()==="EXPORT"||this.prevTag()==="AS"))return this.emit("DEFAULT",U,{len:W}),W;let Y;if(U==="do"&&(Y=/^(\s*super)(?!\(\))/.exec(this.chunk.slice(3))))return this.emit("SUPER","super"),this.emit("CALL_START","("),this.emit("CALL_END",")"),Y[1].length+3;let A=this.prev();if(F&&A&&A[0]==="TERNARY")F=null;if(F||A&&(A[0]==="."||A[0]==="?."||!A.spaced&&A[0]==="@")){if(f="PROPERTY",this.inRenderBlock&&A&&A[0]==="."&&!F){let R=this.chunk.slice(W);while(R[0]==="-"&&/^-[a-zA-Z]/.test(R)){let Q=/^-([a-zA-Z][\w]*)/.exec(R);if(!Q)break;U+="-"+Q[1],W+=1+Q[1].length,R=this.chunk.slice(W)}}}else f="IDENTIFIER";let _=U.endsWith("!")||U.endsWith("?")?U.slice(0,-1):U;if(f==="IDENTIFIER"&&!U.endsWith("!")&&!U.endsWith("?")&&(U2.has(U)||F2.has(U)||W2.has(U))&&!(this.exportSpecifierList&&W2.has(U))){if(c1[U]!==void 0)u.original=U,U=c1[U];f=this.classifyKeyword(U,f,u)}if(f==="IDENTIFIER"&&e2.has(_))p(`reserved word '${_}'`,{row:this.row,col:this.col,len:W});if(f==="PROPERTY"&&A){if(A[0]==="."&&this.tokens.length>1){let R=this.tokens[this.tokens.length-2];if(R[0]==="UNARY"&&R[1]==="new")R[0]="NEW_TARGET";if(R[0]==="IMPORT"&&R[1]==="import")this.seenImport=!1,R[0]="IMPORT_META"}}if(U.length>1&&U.endsWith("!"))u.await=!0,U=U.slice(0,-1);if(U.length>1&&U.endsWith("?"))u.predicate=!0,U=U.slice(0,-1);let Z=this.emit(f,U,{len:W,data:Object.keys(u).length?u:null});if(f==="RENDER")this.inRenderBlock=!0,this.renderIndent=this.indent;if(F)return this.emit(":",":",{len:1}),W+F.length;return W}classifyKeyword($,U,F){switch($){case"!":return"UNARY";case"==":case"!=":return"COMPARE";case"true":case"false":return"BOOL";case"&&":case"||":return $}if(u3.has($))return"STATEMENT";let W=$.toUpperCase();if(W==="WHEN"&&Z1.has(this.prevTag()))return"LEADING_WHEN";if(W==="FOR")return this.seenFor={endsLength:this.ends.length},"FOR";if(W==="UNLESS")return"UNLESS";if(W==="IMPORT")return this.seenImport=!0,"IMPORT";if(W==="EXPORT")return this.seenExport=!0,"EXPORT";if(f3.has(W))return"UNARY";if($3.has(W)){if(W!=="INSTANCEOF"&&this.seenFor)return this.seenFor=!1,"FOR"+W;if(this.prevVal()==="!"){let u=this.tokens.pop();F.invert=u.data?.original||u[1]}return"RELATION"}if(U2.has($)||F2.has($))return W;return U}commentToken(){if(this.inRenderBlock){if(/^#[a-zA-Z_]/.test(this.chunk)){let U=this.prev();if(U&&(U[0]==="IDENTIFIER"||U[0]==="PROPERTY"))return 0;let F=/^#([a-zA-Z_][\w-]*)/.exec(this.chunk);if(F)return this.emit("IDENTIFIER",
|
|
6
|
+
`)this.row++,this.col=0;else this.col++;this.pos+=$}emit($,U,{len:F,data:W,pre:u}={}){let f=G1($,U,{pre:u??0,row:this.row,col:this.col,len:F??(typeof U==="string"?U.length:0),data:W});return this.tokens.push(f),f}prev(){return this.tokens[this.tokens.length-1]}prevTag(){let $=this.prev();return $?$[0]:void 0}prevVal(){let $=this.prev();return $?$[1]:void 0}identifierToken(){if(O3.test(this.chunk))return 0;let $=X3.exec(this.chunk);if(!$)return 0;let[,U,F]=$,W=U.length,u={},f;if(U==="own"&&this.prevTag()==="FOR")return this.emit("OWN",U,{len:W}),W;if(U==="from"&&this.prevTag()==="YIELD")return this.emit("FROM",U,{len:W}),W;if(U==="as"&&!this.seenFor&&(this.seenImport||this.seenExport)){if(this.seenImport){if(this.prevVal()==="*")this.prev()[0]="IMPORT_ALL"}let R=this.prevTag();if(R==="DEFAULT"||R==="IMPORT_ALL"||R==="IDENTIFIER")return this.emit("AS",U,{len:W}),W}if((U==="as"||U==="as!")&&this.seenFor)return this.seenFor=!1,this.emit(U==="as!"?"FORASAWAIT":"FORAS","as",{len:W}),W;if(U==="default"&&this.seenExport&&(this.prevTag()==="EXPORT"||this.prevTag()==="AS"))return this.emit("DEFAULT",U,{len:W}),W;let Y;if(U==="do"&&(Y=/^(\s*super)(?!\(\))/.exec(this.chunk.slice(3))))return this.emit("SUPER","super"),this.emit("CALL_START","("),this.emit("CALL_END",")"),Y[1].length+3;let A=this.prev();if(F&&A&&A[0]==="TERNARY")F=null;if(F||A&&(A[0]==="."||A[0]==="?."||!A.spaced&&A[0]==="@")){if(f="PROPERTY",this.inRenderBlock&&A&&A[0]==="."&&!F){let R=this.chunk.slice(W);while(R[0]==="-"&&/^-[a-zA-Z]/.test(R)){let Q=/^-([a-zA-Z][\w]*)/.exec(R);if(!Q)break;U+="-"+Q[1],W+=1+Q[1].length,R=this.chunk.slice(W)}}}else f="IDENTIFIER";let _=U.endsWith("!")||U.endsWith("?")?U.slice(0,-1):U;if(f==="IDENTIFIER"&&!U.endsWith("!")&&!U.endsWith("?")&&(U2.has(U)||F2.has(U)||W2.has(U))&&!(this.exportSpecifierList&&W2.has(U))){if(c1[U]!==void 0)u.original=U,U=c1[U];f=this.classifyKeyword(U,f,u)}if(f==="IDENTIFIER"&&e2.has(_))p(`reserved word '${_}'`,{row:this.row,col:this.col,len:W});if(f==="PROPERTY"&&A){if(A[0]==="."&&this.tokens.length>1){let R=this.tokens[this.tokens.length-2];if(R[0]==="UNARY"&&R[1]==="new")R[0]="NEW_TARGET";if(R[0]==="IMPORT"&&R[1]==="import")this.seenImport=!1,R[0]="IMPORT_META"}}if(U.length>1&&U.endsWith("!"))u.await=!0,U=U.slice(0,-1);if(U.length>1&&U.endsWith("?"))u.predicate=!0,U=U.slice(0,-1);let Z=this.emit(f,U,{len:W,data:Object.keys(u).length?u:null});if(f==="RENDER")this.inRenderBlock=!0,this.renderIndent=this.indent;if(F)return this.emit(":",":",{len:1}),W+F.length;return W}classifyKeyword($,U,F){switch($){case"!":return"UNARY";case"==":case"!=":return"COMPARE";case"true":case"false":return"BOOL";case"&&":case"||":return $}if(u3.has($))return"STATEMENT";let W=$.toUpperCase();if(W==="WHEN"&&Z1.has(this.prevTag()))return"LEADING_WHEN";if(W==="FOR")return this.seenFor={endsLength:this.ends.length},"FOR";if(W==="UNLESS")return"UNLESS";if(W==="IMPORT")return this.seenImport=!0,"IMPORT";if(W==="EXPORT")return this.seenExport=!0,"EXPORT";if(f3.has(W))return"UNARY";if($3.has(W)){if(W!=="INSTANCEOF"&&this.seenFor)return this.seenFor=!1,"FOR"+W;if(this.prevVal()==="!"){let u=this.tokens.pop();F.invert=u.data?.original||u[1]}return"RELATION"}if(U2.has($)||F2.has($))return W;return U}commentToken(){if(this.inRenderBlock){if(/^#[a-zA-Z_]/.test(this.chunk)){let U=this.prev();if(U&&(U[0]==="IDENTIFIER"||U[0]==="PROPERTY"))return 0;let F=/^#([a-zA-Z_][\w-]*)/.exec(this.chunk);if(F)return this.emit("IDENTIFIER","div#"+F[1]),F[0].length}if(/^\s+#[a-zA-Z_]/.test(this.chunk))return 0}let $=H3.exec(this.chunk);if(!$)return 0;return $[0].length}whitespaceToken(){let $=D3.exec(this.chunk);if(!$&&this.chunk[0]!==`
|
|
7
7
|
`)return 0;let U=this.prev();if(U)if($)U.spaced=!0,U.pre=$[0].length;else U.newLine=!0;return $?$[0].length:0}lineToken(){let $=M3.exec(this.chunk);if(!$)return 0;let U=$[0],F=U.length-1-U.lastIndexOf(`
|
|
8
8
|
`);if(this.isUnfinished()){if(F<this.indent&&/^\s*,/.test(this.chunk)&&!R2.has(this.prevTag())){if(this.outdentTo(F,U.length),this.prevTag()==="TERMINATOR")this.tokens.pop();return U.length}return U.length}if(this.seenFor&&!(this.seenFor.endsLength<this.ends.length))this.seenFor=!1;if(!this.importSpecifierList)this.seenImport=!1;if(!this.exportSpecifierList)this.seenExport=!1;if(F===this.indent)return this.emitNewline(),U.length;if(F>this.indent){if(!this.tokens.length)return this.indent=F,U.length;let W=F-this.indent;return this.emit("INDENT",W,{len:F}),this.indents.push(W),this.ends.push({tag:"OUTDENT"}),this.indent=F,U.length}return this.outdentTo(F,U.length),U.length}outdentTo($,U=0){if(this.inRenderBlock&&$<=this.renderIndent)this.inRenderBlock=!1;let F=this.indent-$;while(F>0){let W=this.indents[this.indents.length-1];if(!W)F=0;else this.indents.pop(),this.pair("OUTDENT"),this.emit("OUTDENT",F,{len:U}),F-=W}this.emitNewline(),this.indent=$}closeIndentation(){this.outdentTo(0)}emitNewline(){if(this.prevTag()!=="TERMINATOR")this.emit("TERMINATOR",`
|
|
9
9
|
`,{len:0})}isUnfinished(){if(this.inRenderBlock&&Q2.test(this.chunk)&&/^\s*\./.test(this.chunk))return!1;if(this.inRenderBlock&&this.prevTag()==="."){let U=this.tokens.length;if(U>=2){let F=this.tokens[U-2][0];if(F==="INDENT"||F==="TERMINATOR"||F==="OUTDENT")return!1}}let $=this.tokens[this.tokens.length-1];if($?.[0]==="COMPARE"&&$[1]===">"){let U=0;for(let F=this.tokens.length-1;F>=0;F--){let W=this.tokens[F];if(W[0]==="COMPARE"&&W[1]===">")U++;else if(W[0]==="COMPARE"&&W[1]==="<")U--;if(U===0&&W[0]==="TYPE_ANNOTATION")return!1;if(W[0]==="TERMINATOR"||W[0]==="INDENT"||W[0]==="OUTDENT")break}}return Q2.test(this.chunk)||R2.has(this.prevTag())}pair($){let U=this.ends[this.ends.length-1];if(!U||$!==U.tag){if(U?.tag==="OUTDENT"){let F=this.indents[this.indents.length-1];if(F)this.outdentTo(this.indent-F);return this.pair($)}p(`unmatched ${$}`,{row:this.row,col:this.col})}return this.ends.pop()}stringToken(){let $=G3.exec(this.chunk);if(!$)return 0;let U=$[0],F=U.length>1&&U.endsWith("\\"),W=F?U.slice(0,-1):U,u=this.prev();if(u&&this.prevVal()==="from"&&(this.seenImport||this.seenExport))u[0]="FROM";let f;switch(W){case"'":f=P3;break;case'"':f=I3;break;case"'''":f=E3;break;case'"""':f=B3;break}let{tokens:Y,index:A}=this.matchWithInterpolations(f,U,W),_=W.length===3,Z=null;if(_)Z=this.processHeredocIndent(A,W,Y);return this.mergeInterpolationTokens(Y,{quote:W,indent:Z,endOffset:A,raw:F}),A}processHeredocIndent($,U,F){let W=$-U.length,u=W-1;while(u>=0&&this.chunk[u]!==`
|
|
@@ -718,14 +718,14 @@ globalThis.sleep ??= (ms) => new Promise(r => setTimeout(r, ms));
|
|
|
718
718
|
globalThis.todo ??= (msg) => { throw new Error(msg || "Not implemented"); };
|
|
719
719
|
globalThis.warn ??= console.warn;
|
|
720
720
|
globalThis.zip ??= (...a) => a[0].map((_, i) => a.map(b => b[i]));
|
|
721
|
-
`}function z1(){return new l({}).getReactiveRuntime()}function K1(){return new l({}).getComponentRuntime()}var D2="3.13.
|
|
721
|
+
`}function z1(){return new l({}).getReactiveRuntime()}function K1(){return new l({}).getComponentRuntime()}var D2="3.13.68",M2="2026-03-02@03:09:09GMT";if(typeof globalThis<"u"){if(!globalThis.__rip)Function(z1())();if(!globalThis.__ripComponent)Function(K1())()}var x3=($)=>{let U=$.match(/^[ \t]*(?=\S)/gm),F=Math.min(...(U||[]).map((W)=>W.length));return $.replace(RegExp(`^[ ]{${F}}`,"gm"),"").trim()};async function H2(){let $=[],U=document.querySelector('script[src$="rip.min.js"], script[src$="rip.js"]'),F=U?.getAttribute("data-src");if(F){for(let u of F.trim().split(/\s+/))if(u)$.push({url:u})}for(let u of document.querySelectorAll('script[type="text/rip"]'))if(u.src)$.push({url:u.src});else{let f=x3(u.textContent);if(f)$.push({code:f})}if($.length>0){await Promise.all($.map(async(Y)=>{if(!Y.url)return;try{let A=await fetch(Y.url);if(!A.ok){console.error(`Rip: failed to fetch ${Y.url} (${A.status})`);return}Y.code=await A.text()}catch(A){console.error(`Rip: failed to fetch ${Y.url}:`,A.message)}}));let u={skipRuntimes:!0,skipExports:!0},f=[];for(let Y of $){if(!Y.code)continue;try{let A=t(Y.code,u);f.push({js:A,url:Y.url||"inline"})}catch(A){console.error(`Rip compile error in ${Y.url||"inline"}:`,A.message)}}if(f.length>0){let Y=f.map((_)=>_.js).join(`
|
|
722
722
|
`),A=U?.getAttribute("data-mount");if(A){let _=U.getAttribute("data-target")||"body";Y+=`
|
|
723
723
|
${A}.mount(${JSON.stringify(_)});`}try{await(0,eval)(`(async()=>{
|
|
724
724
|
${Y}
|
|
725
725
|
})()`)}catch(_){if(_ instanceof SyntaxError){console.error(`Rip syntax error in combined output: ${_.message}`);for(let Z of f)try{Function(`(async()=>{
|
|
726
726
|
${Z.js}
|
|
727
|
-
})()`)}catch(R){console.error(` → source: ${Z.url}`,R.message)}}else console.error("Rip runtime error:",_)}}}let W=document.querySelector("script[data-launch]");if(W&&!globalThis.__ripLaunched){let u=$1.modules?.["
|
|
727
|
+
})()`)}catch(R){console.error(` → source: ${Z.url}`,R.message)}}else console.error("Rip runtime error:",_)}}}let W=document.querySelector("script[data-launch]");if(W&&!globalThis.__ripLaunched){let u=$1.modules?.["ui.rip"];if(u?.launch){let f=W.getAttribute("data-launch")||"",Y=W.getAttribute("data-hash"),A=W.getAttribute("data-persist"),_={hash:Y!=="false"};if(f)_.bundleUrl=f;if(A!=null)_.persist=A==="local"?"local":!0;await u.launch("",_)}}}async function $1($){for(let[Y,A]of Object.entries($1.modules))if($.includes(Y))return A;let U=await fetch($).then((Y)=>{if(!Y.ok)throw Error(`importRip: ${$} (${Y.status})`);return Y.text()}),F=t(U),W=`// ${$}
|
|
728
728
|
`,u=new Blob([W+F],{type:"application/javascript"});return await import(URL.createObjectURL(u))}$1.modules={};function q2($){try{let U=$.replace(/^/gm," "),W=t(`do ->
|
|
729
729
|
${U}`).replace(/^let\s+[^;]+;\s*\n\s*/m,"");W=W.replace(/^const\s+(\w+)\s*=/gm,"globalThis.$1 =");let u=(0,eval)(W);if(u&&typeof u.then==="function")return u.then((f)=>{if(f!==void 0)globalThis._=f;return f});if(u!==void 0)globalThis._=u;return u}catch(U){console.error("Rip compilation error:",U.message);return}}if(typeof globalThis<"u")globalThis.rip=q2,globalThis.importRip=$1,globalThis.compileToJS=t,globalThis.__ripExports={compile:I1,compileToJS:t,formatSExpr:d,getStdlibCode:X1,VERSION:D2,BUILD_DATE:M2,getReactiveRuntime:z1,getComponentRuntime:K1};if(typeof document<"u")globalThis.__ripScriptsReady=new Promise(($)=>{let U=()=>H2().then($);if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",()=>queueMicrotask(U));else queueMicrotask(U)});var T1={};t1(T1,{throttle:()=>n3,stash:()=>c2,setContext:()=>j2,raw:()=>g2,launch:()=>d3,isStash:()=>k3,hold:()=>p3,hasContext:()=>S2,getContext:()=>T2,delay:()=>v2,debounce:()=>i3,createRouter:()=>x2,createResource:()=>m3,createRenderer:()=>k2,createComponents:()=>l2});var O2,i1,_1,e,N1,G2,U1,g,x1,M1,H1,n1,P2,I2,E1,B1,E2,B2,N2,k1,m1,T2,L2,p1,S2,D1,d1,h2,V2,j2,C2,y2,r1,b2;globalThis.abort??=($)=>{if($)console.error($);process.exit(1)};globalThis.assert??=($,U)=>{if(!$)throw Error(U||"Assertion failed")};globalThis.exit??=($)=>process.exit($||0);globalThis.kind??=($)=>$!=null?($.constructor?.name||Object.prototype.toString.call($).slice(8,-1)).toLowerCase():String($);globalThis.noop??=()=>{};globalThis.p??=console.log;globalThis.pp??=($)=>{return console.log(JSON.stringify($,null,2)),$};globalThis.raise??=($,U)=>{throw U!==void 0?new $(U):Error($)};globalThis.rand??=($,U)=>U!==void 0?($>U&&([$,U]=[U,$]),Math.floor(Math.random()*(U-$+1)+$)):$?Math.floor(Math.random()*$):Math.random();globalThis.sleep??=($)=>new Promise((U)=>setTimeout(U,$));globalThis.todo??=($)=>{throw Error($||"Not implemented")};globalThis.warn??=console.warn;globalThis.zip??=(...$)=>$[0].map((U,F)=>$.map((W)=>W[F]));({__state:g,__effect:U1,__batch:G2}=globalThis.__rip);({setContext:j2,getContext:T2,hasContext:S2}=globalThis.__ripComponent||{});N1=Symbol("stash");e=Symbol("signals");_1=Symbol("raw");i1=new WeakMap;x1=0;n1=g(0);p1=function($,U){let F;if(!$[e])Object.defineProperty($,e,{value:new Map,enumerable:!1});if(F=$[e].get(U),!F)F=g($[U]),$[e].set(U,F);return F};D1=function($){return p1($,Symbol.for("keys"))};b2=function($){let U;if(!($!=null&&typeof $==="object"))return $;if($[N1])return $;if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Promise)return $;if(U=i1.get($),U)return U;return d1($)};d1=function($){let U,F;return F=null,U={get:function(W,u){let f,Y;if(u===N1)return!0;if(u===_1)return W;if(typeof u==="symbol")return Reflect.get(W,u);if(u==="length"&&Array.isArray(W))return D1(W).value,W.length;if(u==="get")return function(A){return C2(F,A)};if(u==="set")return function(A,_){return y2(F,A,_)};if(f=p1(W,u),Y=f.value,Y!=null&&typeof Y==="object")return b2(Y);return Y},set:function(W,u,f){let Y,A;if(Y=W[u],A=f?.[_1]?f[_1]:f,A===Y)return!0;if(W[u]=A,W[e]?.has(u))W[e].get(u).value=A;if(Y===void 0&&A!==void 0)D1(W).value=++x1;return n1.value++,!0},deleteProperty:function(W,u){let f;if(delete W[u],f=W[e]?.get(u),f!=null)f.value=void 0;return D1(W).value=++x1,!0},ownKeys:function(W){return D1(W).value,Reflect.ownKeys(W)}},F=new Proxy($,U),i1.set($,F),F};O2=/([./][^./\[\s]+|\[[-+]?\d+\]|\[(?:"[^"]+"|'[^']+')\])/;r1=function($){let U,F,W,u,f;W=("."+$).split(O2),W.shift(),f=[],F=0;while(F<W.length){if(u=W[F],U=u[0],U==="."||U==="/")f.push(u.slice(1));else if(U==="[")if(u[1]==='"'||u[1]==="'")f.push(u.slice(2,-2));else f.push(+u.slice(1,-1));F+=2}return f};C2=function($,U){let F,W;W=r1(U),F=$;for(let u of W){if(F==null)return;F=F[u]}return F};y2=function($,U,F){let W,u;u=r1(U),W=$;for(let f=0;f<u.length;f++){let Y=u[f];if(f===u.length-1)W[Y]=F;else{if(W[Y]==null)W[Y]={};W=W[Y]}}return F};var c2=function($={}){return d1($)},g2=function($){return $?.[_1]?$[_1]:$},k3=function($){return $?.[N1]===!0},m3=function($,U={}){let F,W,u,f,Y;if(F=g(U.initial||null),u=g(!1),W=g(null),f=async function(){let A;return u.value=!0,W.value=null,(async()=>{try{return A=await $(),F.value=A}catch(_){return W.value=_}finally{u.value=!1}})()},Y={data:void 0,loading:void 0,error:void 0,refetch:f},Object.defineProperty(Y,"data",{get:function(){return F.value}}),Object.defineProperty(Y,"loading",{get:function(){return u.value}}),Object.defineProperty(Y,"error",{get:function(){return W.value}}),!U.lazy)f();return Y};H1=function($){return typeof $==="function"?$:function(){return $.value}};M1=function($,U){let F;return F={read:function(){return $.read()}},Object.defineProperty(F,"value",{get:function(){return $.value},set:function(W){return U.value=W}}),F};var v2=function($,U){let F,W;return F=H1(U),W=g(!!F()),U1(function(){let u;if(F())return u=setTimeout(function(){return W.value=!0},$),function(){return clearTimeout(u)};else return W.value=!1}),typeof U!=="function"?M1(W,U):W},i3=function($,U){let F,W;return F=H1(U),W=g(F()),U1(function(){let u,f;return f=F(),u=setTimeout(function(){return W.value=f},$),function(){return clearTimeout(u)}}),typeof U!=="function"?M1(W,U):W},n3=function($,U){let F,W,u;return F=H1(U),u=g(F()),W=0,U1(function(){let f,Y,A,_;if(_=F(),f=Date.now(),Y=$-(f-W),Y<=0)return u.value=_,W=f;else return A=setTimeout(function(){return u.value=F(),W=Date.now()},Y),function(){return clearTimeout(A)}}),typeof U!=="function"?M1(u,U):u},p3=function($,U){let F,W;return F=H1(U),W=g(!!F()),U1(function(){let u;if(F())return W.value=!0;else return u=setTimeout(function(){return W.value=!1},$),function(){return clearTimeout(u)}}),typeof U!=="function"?M1(W,U):W},l2=function(){let $,U,F,W;return U=new Map,W=[],$=new Map,F=function(u,f){for(let Y of W)Y(u,f)},{read:function(u){return U.get(u)},write:function(u,f){let Y;return Y=!U.has(u),U.set(u,f),$.delete(u),F(Y?"create":"change",u)},del:function(u){return U.delete(u),$.delete(u),F("delete",u)},exists:function(u){return U.has(u)},size:function(){return U.size},list:function(u=""){let f,Y,A;A=[],f=u?u+"/":"";for(let[_]of U)if(_.startsWith(f)){if(Y=_.slice(f.length),Y.includes("/"))continue;A.push(_)}return A},listAll:function(u=""){let f,Y;Y=[],f=u?u+"/":"";for(let[A]of U)if(A.startsWith(f))Y.push(A);return Y},load:function(u){for(let f in u){let Y=u[f];U.set(f,Y)}},watch:function(u){return W.push(u),function(){return W.splice(W.indexOf(u),1)}},getCompiled:function(u){return $.get(u)},setCompiled:function(u,f){return $.set(u,f)}}};N2=function($){let U;if(U=$.replace(/\.rip$/,""),U=U.replace(/\[\.\.\.(\w+)\]/g,"*$1"),U=U.replace(/\[(\w+)\]/g,":$1"),U==="index")return"/";return U=U.replace(/\/index$/,""),"/"+U};V2=function($){let U,F;return U=[],F=$.replace(/\*(\w+)/g,function(W,u){return U.push(u),"(.+)"}).replace(/:(\w+)/g,function(W,u){return U.push(u),"([^/]+)"}),{regex:new RegExp("^"+F+"$"),names:U}};h2=function($,U){let F,W;for(let u of U)if(F=$.match(u.regex.regex),F){W={};for(let f=0;f<u.regex.names.length;f++){let Y=u.regex.names[f];W[Y]=decodeURIComponent(F[f+1])}return{route:u,params:W}}return null};E1=function($,U="components"){let F,W,u,f,Y,A,_,Z,R;_=[],u=new Map,F=$.listAll(U);for(let Q of F){if(A=Q.slice(U.length+1),!A.endsWith(".rip"))continue;if(f=A.split("/").pop(),f==="_layout.rip"){W=A==="_layout.rip"?"":A.slice(0,-12),u.set(W,Q);continue}if(f.startsWith("_"))continue;if(Z=A.split("/"),Z.length>1&&Z.some(function(z,J){return J<Z.length-1&&z.startsWith("_")}))continue;R=N2(A),Y=V2(R),_.push({pattern:R,regex:Y,file:Q,rel:A})}return _.sort(function(Q,z){let J,K,M,X;if(K=(Q.pattern.match(/:/g)||[]).length,X=(z.pattern.match(/:/g)||[]).length,J=Q.pattern.includes("*")?1:0,M=z.pattern.includes("*")?1:0,J!==M)return J-M;if(K!==X)return K-X;return Q.pattern.localeCompare(z.pattern)}),{routes:_,layouts:u}};L2=function($,U,F){let W,u,f,Y;if(W=[],f=$.slice(U.length+1),Y=f.split("/"),u="",F.has(""))W.push(F.get(""));for(let A=0;A<Y.length;A++){let _=Y[A];if(A===Y.length-1)break;if(u=u?u+"/"+_:_,F.has(u))W.push(F.get(u))}return W};var x2=function($,U={}){let F,W,u,f,Y,A,_,Z,R,Q,z,J,K,M,X,w,D,q,O,P,G;if(D=U.root||"components",R=U.base||"",Q=U.hash||!1,K=U.onError||null,O=function(H){return R&&H.startsWith(R)?H.slice(R.length)||"/":H},Z=function(H){return R?R+H:H},X=function(){let H;if(Q){if(H=location.hash.slice(1),!H)return"/";return H[0]==="/"?H:"/"+H}else return location.pathname+location.search+location.hash},G=function(H){return Q?H==="/"?location.pathname:"#"+H.slice(1):Z(H)},Y=g(O(Q?X():location.pathname)),f=g({}),_=g(null),W=g([]),A=g({}),F=g(""),u=v2(100,g(!1)),P=E1($,D),z=new Set,$.watch(function(H,I){if(!I.startsWith(D+"/"))return;return P=E1($,D)}),w=function(H){let I,E,N,B,T;if(B=H.split("?")[0].split("#")[0],E=O(B),E=E[0]==="/"?E:"/"+E,N=H.split("?")[1]?.split("#")[0]||"",I=H.includes("#")?H.split("#")[1]:"",T=h2(E,P.routes),T){G2(function(){return Y.value=E,f.value=T.params,_.value=T.route,W.value=L2(T.route.file,D,P.layouts),A.value=Object.fromEntries(new URLSearchParams(N)),F.value=I});for(let C of z)C(q.current);return!0}if(K)K({status:404,path:E});return!1},M=function(){return w(X())},typeof window<"u")window.addEventListener("popstate",M);if(J=function(H){let I,E,N;if(H.button!==0||H.metaKey||H.ctrlKey||H.shiftKey||H.altKey)return;E=H.target;while(E&&E.tagName!=="A")E=E.parentElement;if(!E?.href)return;if(N=new URL(E.href,location.origin),N.origin!==location.origin)return;if(E.target==="_blank"||E.hasAttribute("data-external"))return;return H.preventDefault(),I=Q&&N.hash?N.hash.slice(1)||"/":N.pathname+N.search+N.hash,q.push(I)},typeof document<"u")document.addEventListener("click",J);return q={push:function(H){return w(H)?history.pushState(null,"",G(Y.read())):void 0},replace:function(H){return w(H)?history.replaceState(null,"",G(Y.read())):void 0},back:function(){return history.back()},forward:function(){return history.forward()},current:void 0,path:void 0,params:void 0,route:void 0,layouts:void 0,query:void 0,hash:void 0,navigating:void 0,onNavigate:function(H){return z.add(H),function(){return z.delete(H)}},rebuild:function(){return P=E1($,D)},routes:void 0,init:function(){return w(X()),q},destroy:function(){if(typeof window<"u")window.removeEventListener("popstate",M);if(typeof document<"u")document.removeEventListener("click",J);return z.clear()}},Object.defineProperty(q,"current",{get:function(){return{path:Y.value,params:f.value,route:_.value,layouts:W.value,query:A.value,hash:F.value}}}),Object.defineProperty(q,"path",{get:function(){return Y.value}}),Object.defineProperty(q,"params",{get:function(){return f.value}}),Object.defineProperty(q,"route",{get:function(){return _.value}}),Object.defineProperty(q,"layouts",{get:function(){return W.value}}),Object.defineProperty(q,"query",{get:function(){return A.value}}),Object.defineProperty(q,"hash",{get:function(){return F.value}}),Object.defineProperty(q,"navigating",{get:function(){return u.value},set:function(H){return u.value=H}}),Object.defineProperty(q,"routes",{get:function(){return P.routes}}),q};P2=function($,U){if($.length!==U.length)return!1;for(let F=0;F<$.length;F++)if($[F]!==U[F])return!1;return!0};m1=function($){for(let U in $){let F=$[U];if(typeof F==="function"&&(F.prototype?.mount||F.prototype?._create))return F}return typeof $.default==="function"?$.default:void 0};k1=function($){let U;U={};for(let F in $){let W=$[F];if(typeof W==="function"&&(W.prototype?.mount||W.prototype?._create))U[F]=W}return U};B2=function($){let U;return U=$.split("/").pop().replace(/\.rip$/,""),U.replace(/(^|[-_])([a-z])/g,function(F,W,u){return u.toUpperCase()})};I2=function($,U="components"){let F,W,u;W={};for(let f of $.listAll(U)){if(!f.endsWith(".rip"))continue;if(F=f.split("/").pop(),F.startsWith("_"))continue;if(u=B2(f),W[u])console.warn(`[Rip] Component name collision: ${u} (${W[u]} vs ${f})`);W[u]=f}return W};B1=async function($,U,F=null,W=null,u=null){let f,Y,A,_,Z,R,Q,z,J,K,M,X;if(F&&W){if(Y=F.getCompiled(W),Y)return Y}if(Q=U($),u){K={};for(let w in u.map){let D=u.map[w];if(D!==W&&Q.includes(`new ${w}(`)){if(!u.classes[w]){if(_=F.read(D),_){A=await B1(_,U,F,D,u),Z=k1(A);for(let q in Z){let O=Z[q];u.classes[q]=O}}}if(u.classes[w])K[w]=!0}}if(J=Object.keys(K),J.length>0)M=`const {${J.join(", ")}} = globalThis['${u.key}'];
|
|
730
730
|
`,Q=M+Q}if(R=W?`// ${W}
|
|
731
|
-
`:"",f=new Blob([R+Q],{type:"application/javascript"}),X=URL.createObjectURL(f),z=await import(X),u){Z=k1(z);for(let w in Z){let D=Z[w];u.classes[w]=D}}if(F&&W)F.setCompiled(W,z);return z};var k2=function($={}){let U,F,W,u,f,Y,A,_,Z,R,Q,z,J,K,M,X,w,D,q,O,P,G;if({router:O,app:U,components:f,resolver:q,compile:W,target:P,onError:w}=$,Y=typeof P==="string"?document.querySelector(P):P||document.getElementById("app"),!Y)Y=document.createElement("div"),Y.id="app",document.body.appendChild(Y);return Y.style.opacity="0",A=null,R=null,Z=null,_=[],J=[],M=Y,z=0,Q=null,u=new Map,K=$.cacheSize||10,F=function(){let H,I;if(A&&R){if(A.beforeUnmount)A.beforeUnmount();if(u.set(R,A),u.size>K){if(I=u.keys().next().value,H=u.get(I),H.unmounted)H.unmounted();u.delete(I)}return A=null,R=null}},G=function(){F();for(let H=J.length-1;H>=0;H--){let I=J[H];if(I.beforeUnmount)I.beforeUnmount();if(I.unmounted)I.unmounted();I._target?.remove()}return J=[],M=Y},f.watch(function(H,I){let E;if(u.has(I)){if(E=u.get(I),E.unmounted)E.unmounted();return u.delete(I)}}),X=async function(H){let I,E,N,B,T,C,L,h,S,j,b,m,c,v,k,o,F1,L1,x,o1,S1,W1;if({route:x,params:o,layouts:h,query:L1}=H,!x)return;if(x.file===R&&JSON.stringify(o)===JSON.stringify(Z))return;return Z=o,B=++z,O.navigating=!0,(async()=>{try{if(S1=f.read(x.file),!S1){if(w)w({status:404,message:`File not found: ${x.file}`});O.navigating=!1;return}if(m=await B1(S1,W,f,x.file,q),B!==z){O.navigating=!1;return}if(I=m1(m),!I){if(w)w({status:500,message:`No component found in ${x.file}`});O.navigating=!1;return}if(b=!P2(h,_),v=A?._target,b)G();else F();if(c=b?Y:M,b&&h.length>0){Y.innerHTML="",c=Y;for(let n of h){if(j=f.read(n),!j)continue;if(S=await B1(j,W,f,n,q),B!==z){O.navigating=!1;return}if(E=m1(S),!E)continue;if(C=new E({app:U,params:o,router:O}),C.beforeMount)C.beforeMount();W1=document.createElement("div"),W1.setAttribute("data-layout",n),c.appendChild(W1),C.mount(W1),J.push(C),o1=W1.querySelector("
|
|
731
|
+
`:"",f=new Blob([R+Q],{type:"application/javascript"}),X=URL.createObjectURL(f),z=await import(X),u){Z=k1(z);for(let w in Z){let D=Z[w];u.classes[w]=D}}if(F&&W)F.setCompiled(W,z);return z};var k2=function($={}){let U,F,W,u,f,Y,A,_,Z,R,Q,z,J,K,M,X,w,D,q,O,P,G;if({router:O,app:U,components:f,resolver:q,compile:W,target:P,onError:w}=$,Y=typeof P==="string"?document.querySelector(P):P||document.getElementById("app"),!Y)Y=document.createElement("div"),Y.id="app",document.body.appendChild(Y);return Y.style.opacity="0",A=null,R=null,Z=null,_=[],J=[],M=Y,z=0,Q=null,u=new Map,K=$.cacheSize||10,F=function(){let H,I;if(A&&R){if(A.beforeUnmount)A.beforeUnmount();if(u.set(R,A),u.size>K){if(I=u.keys().next().value,H=u.get(I),H.unmounted)H.unmounted();u.delete(I)}return A=null,R=null}},G=function(){F();for(let H=J.length-1;H>=0;H--){let I=J[H];if(I.beforeUnmount)I.beforeUnmount();if(I.unmounted)I.unmounted();I._target?.remove()}return J=[],M=Y},f.watch(function(H,I){let E;if(u.has(I)){if(E=u.get(I),E.unmounted)E.unmounted();return u.delete(I)}}),X=async function(H){let I,E,N,B,T,C,L,h,S,j,b,m,c,v,k,o,F1,L1,x,o1,S1,W1;if({route:x,params:o,layouts:h,query:L1}=H,!x)return;if(x.file===R&&JSON.stringify(o)===JSON.stringify(Z))return;return Z=o,B=++z,O.navigating=!0,(async()=>{try{if(S1=f.read(x.file),!S1){if(w)w({status:404,message:`File not found: ${x.file}`});O.navigating=!1;return}if(m=await B1(S1,W,f,x.file,q),B!==z){O.navigating=!1;return}if(I=m1(m),!I){if(w)w({status:500,message:`No component found in ${x.file}`});O.navigating=!1;return}if(b=!P2(h,_),v=A?._target,b)G();else F();if(c=b?Y:M,b&&h.length>0){Y.innerHTML="",c=Y;for(let n of h){if(j=f.read(n),!j)continue;if(S=await B1(j,W,f,n,q),B!==z){O.navigating=!1;return}if(E=m1(S),!E)continue;if(C=new E({app:U,params:o,router:O}),C.beforeMount)C.beforeMount();W1=document.createElement("div"),W1.setAttribute("data-layout",n),c.appendChild(W1),C.mount(W1),J.push(C),o1=W1.querySelector("#content")||W1,c=o1}_=[...h],M=c}else if(b)Y.innerHTML="",_=[],M=Y;if(N=u.get(x.file),N)u.delete(x.file),c.appendChild(N._target),A=N,R=x.file;else{if(k=document.createElement("div"),k.setAttribute("data-component",x.file),c.appendChild(k),L=new I({app:U,params:o,query:L1,router:O}),L.beforeMount)L.beforeMount();if(L.mount(k),A=L,R=x.file,L.load)await L.load(o,L1)}return v?.remove(),O.navigating=!1,Y.style.opacity==="0"?document.fonts.ready.then(function(){return requestAnimationFrame(function(){return Y.style.transition="opacity 150ms ease-in",Y.style.opacity="1"})}):void 0}catch(n){if(O.navigating=!1,Y.style.opacity="1",console.error(`Renderer: error mounting ${x.file}:`,n),w)w({status:500,message:n.message,error:n});T=!1;for(let h1=J.length-1;h1>=0;h1--){let a1=J[h1];if(a1.onError)try{a1.onError(n),T=!0;break}catch(m2){console.error("Renderer: error boundary failed:",m2)}}return(()=>{if(!T)return F1=document.createElement("pre"),F1.style.cssText="color:red;padding:1em",F1.textContent=n.stack||n.message,Y.innerHTML="",Y.appendChild(F1)})()}})()},D={start:function(){return Q=U1(function(){let H;return H=O.current,H.route?X(H):void 0}),O.init(),D},stop:function(){if(G(),Q)Q(),Q=null;return Y.innerHTML=""},remount:function(){let H;return H=O.current,H.route?X(H):void 0},cache:u},D};E2=function($){let U,F,W;return W=1000,F=30000,U=function(){let u;return u=new EventSource($),u.addEventListener("connected",function(){return W=1000,console.log("[Rip] Hot reload connected")}),u.addEventListener("reload",function(){return console.log("[Rip] Reloading..."),location.reload()}),u.addEventListener("css",function(){for(let f of document.querySelectorAll('link[rel="stylesheet"]'))$=new URL(f.href),$.searchParams.set("_t",Date.now()),f.href=$.toString()}),u.onerror=function(){return u.close(),setTimeout(U,W),W=Math.min(W*2,F)}},U()};var d3=async function($="",U={}){let F,W,u,f,Y,A,_,Z,R,Q,z,J,K,M,X,w,D,q,O,P,G,H;if(globalThis.__ripLaunched=!0,typeof $==="object")U=$,$="";if($=$.replace(/\/+$/,""),H=U.target||"#app",R=U.compile||null,X=U.persist||!1,K=U.hash||!1,!R)R=globalThis?.compileToJS||null;if(typeof document<"u"&&!document.querySelector(H))Q=document.createElement("div"),Q.id=H.replace(/^#/,""),document.body.prepend(Q);if(U.bundle)A=U.bundle;else if(U.bundleUrl){if(M={},J=`__rip_etag_${U.bundleUrl}`,_=sessionStorage.getItem(J),_)M["If-None-Match"]=_;if(D=await fetch(U.bundleUrl,{headers:M}),D.status===304)A=JSON.parse(sessionStorage.getItem(`${J}_data`));else if(D.ok){if(A=await D.json(),z=D.headers.get("etag"),z)sessionStorage.setItem(J,z),sessionStorage.setItem(`${J}_data`,JSON.stringify(A))}else throw Error(`launch: ${U.bundleUrl} (${D.status})`)}else throw Error("launch: no bundle or bundleUrl provided");if(f=c2({components:{},routes:{},data:{}}),A.data)f.data=A.data;if(A.routes)f.routes=A.routes;if(X&&typeof sessionStorage<"u"){u=`__rip_${$}`,W=X==="local"?localStorage:sessionStorage;try{if(P=W.getItem(u),P){G=JSON.parse(P);for(let I in G){let E=G[I];f.data[I]=E}}}catch{}F=function(){return(()=>{try{return W.setItem(u,JSON.stringify(g2(f.data)))}catch{return null}})()},U1(function(){let I;return n1.value,I=setTimeout(F,2000),function(){return clearTimeout(I)}}),window.addEventListener("beforeunload",F)}if(Y=l2(),A.components)Y.load(A.components);if(Z=`__rip_${$.replace(/\//g,"_")||"app"}`,q={map:I2(Y),classes:{},key:Z},typeof globalThis<"u")globalThis[Z]=q.classes;if(f.data.title&&typeof document<"u")document.title=f.data.title;if(O=x2(Y,{root:"components",base:$,hash:K,onError:function(I){return console.error(`[Rip] Error ${I.status}: ${I.message||I.path}`)}}),w=k2({router:O,app:f,components:Y,resolver:q,compile:R,target:H,onError:function(I){return console.error(`[Rip] ${I.message}`,I.error)}}),w.start(),A.data?.watch)E2(`${$}/watch`);if(typeof window<"u")window.app=f,window.__RIP__={app:f,components:Y,router:O,renderer:w,cache:w.cache,version:"0.3.0"};return{app:f,components:Y,router:O,renderer:w}};$1.modules["ui.rip"]=T1;for(let[$,U]of Object.entries(T1))if(typeof U==="function")globalThis[$]=U;})();
|
package/docs/dist/rip.min.js.br
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/browser.js
CHANGED
|
@@ -14,7 +14,7 @@ export const BUILD_DATE = "0000-00-00@00:00:00GMT";
|
|
|
14
14
|
import { compile, compileToJS, formatSExpr, getReactiveRuntime, getComponentRuntime } from './compiler.js';
|
|
15
15
|
|
|
16
16
|
// Eagerly register Rip's reactive and component runtimes on globalThis so that
|
|
17
|
-
// framework code (
|
|
17
|
+
// framework code (ui.rip) and browser-compiled scripts can use them directly
|
|
18
18
|
if (typeof globalThis !== 'undefined') {
|
|
19
19
|
if (!globalThis.__rip) new Function(getReactiveRuntime())();
|
|
20
20
|
if (!globalThis.__ripComponent) new Function(getComponentRuntime())();
|
|
@@ -108,7 +108,7 @@ async function processRipScripts() {
|
|
|
108
108
|
// Step 5: data-launch triggers launch() for server mode
|
|
109
109
|
const cfg = document.querySelector('script[data-launch]');
|
|
110
110
|
if (cfg && !globalThis.__ripLaunched) {
|
|
111
|
-
const ui = importRip.modules?.['
|
|
111
|
+
const ui = importRip.modules?.['ui.rip'];
|
|
112
112
|
if (ui?.launch) {
|
|
113
113
|
const url = cfg.getAttribute('data-launch') || '';
|
|
114
114
|
const hash = cfg.getAttribute('data-hash');
|
|
@@ -126,10 +126,10 @@ export { processRipScripts };
|
|
|
126
126
|
/**
|
|
127
127
|
* Import a .rip file as an ES module
|
|
128
128
|
* Fetches the URL, compiles Rip→JS, dynamically imports via Blob URL
|
|
129
|
-
* Usage: const { launch } = await importRip('/
|
|
129
|
+
* Usage: const { launch } = await importRip('/ui.rip')
|
|
130
130
|
*
|
|
131
131
|
* Pre-compiled modules can be registered on importRip.modules to skip fetching.
|
|
132
|
-
* The browser bundle uses this to embed
|
|
132
|
+
* The browser bundle uses this to embed ui.rip without a server round-trip.
|
|
133
133
|
*/
|
|
134
134
|
export async function importRip(url) {
|
|
135
135
|
for (const [key, mod] of Object.entries(importRip.modules)) {
|
package/src/lexer.js
CHANGED
|
@@ -635,7 +635,7 @@ export class Lexer {
|
|
|
635
635
|
return 0; // after a tag (div#main) → let # become a token for rewriter
|
|
636
636
|
let m = /^#([a-zA-Z_][\w-]*)/.exec(this.chunk);
|
|
637
637
|
if (m) {
|
|
638
|
-
this.emit('IDENTIFIER',
|
|
638
|
+
this.emit('IDENTIFIER', 'div#' + m[1]);
|
|
639
639
|
return m[0].length;
|
|
640
640
|
}
|
|
641
641
|
}
|
package/src/{app.rip → ui.rip}
RENAMED
|
@@ -757,7 +757,7 @@ export createRenderer = (opts = {}) ->
|
|
|
757
757
|
inst.mount wrapper
|
|
758
758
|
layoutInstances.push inst
|
|
759
759
|
|
|
760
|
-
slot = wrapper.querySelector('
|
|
760
|
+
slot = wrapper.querySelector('#content') or wrapper
|
|
761
761
|
mp = slot
|
|
762
762
|
|
|
763
763
|
currentLayouts = [...layoutFiles]
|