rip-lang 3.13.89 → 3.13.90
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 +6 -2
- package/docs/dist/rip.min.js +2 -2
- package/docs/dist/rip.min.js.br +0 -0
- package/package.json +1 -1
- package/src/browser.js +3 -0
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.90-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
|
@@ -8785,8 +8785,8 @@ globalThis.zip ??= (...a) => a[0].map((_, i) => a.map(b => b[i]));
|
|
|
8785
8785
|
return new CodeGenerator({}).getComponentRuntime();
|
|
8786
8786
|
}
|
|
8787
8787
|
// src/browser.js
|
|
8788
|
-
var VERSION = "3.13.
|
|
8789
|
-
var BUILD_DATE = "2026-03-04@
|
|
8788
|
+
var VERSION = "3.13.90";
|
|
8789
|
+
var BUILD_DATE = "2026-03-04@06:22:39GMT";
|
|
8790
8790
|
if (typeof globalThis !== "undefined") {
|
|
8791
8791
|
if (!globalThis.__rip)
|
|
8792
8792
|
new Function(getReactiveRuntime())();
|
|
@@ -8973,13 +8973,17 @@ ${c.js}
|
|
|
8973
8973
|
es.addEventListener("reload", (e) => {
|
|
8974
8974
|
if (e.data === "styles") {
|
|
8975
8975
|
const t = Date.now();
|
|
8976
|
+
let refreshed = 0;
|
|
8976
8977
|
document.querySelectorAll('link[rel="stylesheet"]').forEach((l) => {
|
|
8977
8978
|
if (new URL(l.href).origin !== location.origin)
|
|
8978
8979
|
return;
|
|
8979
8980
|
const url = new URL(l.href);
|
|
8980
8981
|
url.searchParams.set("_r", t);
|
|
8981
8982
|
l.href = url.toString();
|
|
8983
|
+
refreshed++;
|
|
8982
8984
|
});
|
|
8985
|
+
if (!refreshed)
|
|
8986
|
+
location.reload();
|
|
8983
8987
|
} else {
|
|
8984
8988
|
location.reload();
|
|
8985
8989
|
}
|
package/docs/dist/rip.min.js
CHANGED
|
@@ -719,7 +719,7 @@ globalThis.sleep ??= (ms) => new Promise(r => setTimeout(r, ms));
|
|
|
719
719
|
globalThis.todo ??= (msg) => { throw new Error(msg || "Not implemented"); };
|
|
720
720
|
globalThis.warn ??= console.warn;
|
|
721
721
|
globalThis.zip ??= (...a) => a[0].map((_, i) => a.map(b => b[i]));
|
|
722
|
-
`}function z1(){return new l({}).getReactiveRuntime()}function K1(){return new l({}).getComponentRuntime()}var q2="3.13.
|
|
722
|
+
`}function z1(){return new l({}).getReactiveRuntime()}function K1(){return new l({}).getComponentRuntime()}var q2="3.13.90",O2="2026-03-04@06:22:39GMT";if(typeof globalThis<"u"){if(!globalThis.__rip)Function(z1())();if(!globalThis.__ripComponent)Function(K1())()}var i3=($)=>{let U=$.match(/^[ \t]*(?=\S)/gm),W=Math.min(...(U||[]).map((F)=>F.length));return $.replace(RegExp(`^[ ]{${W}}`,"gm"),"").trim()};async function G2(){let $=[],U=document.querySelector('script[src$="rip.min.js"], script[src$="rip.js"]'),W=U?.getAttribute("data-src");if(W){for(let F of W.trim().split(/\s+/))if(F)$.push({url:F})}for(let F of document.querySelectorAll('script[type="text/rip"]'))if(F.src)$.push({url:F.src});else{let u=i3(F.textContent);if(u)$.push({code:u})}if($.length>0){let F=await Promise.allSettled($.map(async(A)=>{if(!A.url)return;let Z=await fetch(A.url);if(!Z.ok)throw Error(`${A.url} (${Z.status})`);if(A.url.endsWith(".rip"))A.code=await Z.text();else{let R=await Z.json();A.bundle=R}}));for(let A of F)if(A.status==="rejected")console.warn("Rip: fetch failed:",A.reason.message);let u=[],f=[];for(let A of $)if(A.bundle)u.push(A.bundle);else if(A.code)f.push(A);let _=U?.getAttribute("data-router");if(_!=null&&u.length>0){let A={skipRuntimes:!0,skipExports:!0};if(f.length>0){let R="";for(let X of f)try{R+=o(X.code,A)+`
|
|
723
723
|
`}catch(J){console.error(`Rip compile error in ${X.url||"inline"}:`,J.message)}if(R)try{await(0,eval)(`(async()=>{
|
|
724
724
|
${R}
|
|
725
725
|
})()`)}catch(X){console.error("Rip runtime error:",X)}}let Z=$1.modules?.["ui.rip"];if(Z?.launch){let R=u[u.length-1],X=U.getAttribute("data-persist"),J={bundle:R,hash:_==="hash"};if(X!=null)J.persist=X==="local"?"local":!0;await Z.launch("",J)}}else{let A=[];for(let X of u){for(let[J,Q]of Object.entries(X.components||{}))A.push({code:Q,url:J});if(X.data){let J=U?.getAttribute("data-state"),Q={};if(J)try{Q=JSON.parse(J)}catch{}Object.assign(Q,X.data),U?.setAttribute("data-state",JSON.stringify(Q))}}A.push(...f);let Z={skipRuntimes:!0,skipExports:!0},R=[];for(let X of A){if(!X.code)continue;try{let J=o(X.code,Z);R.push({js:J,url:X.url||"inline"})}catch(J){console.error(`Rip compile error in ${X.url||"inline"}:`,J.message)}}if(!globalThis.__ripApp&&U){let X=globalThis.stash;if(X){let J={},Q=U.getAttribute("data-state");if(Q)try{J=JSON.parse(Q)}catch(z){console.error("Rip: invalid data-state JSON:",z.message)}let K=X({data:J});if(globalThis.__ripApp=K,typeof window<"u")window.app=K;let D=U.getAttribute("data-persist");if(D!=null&&globalThis.persistStash)globalThis.persistStash(K,{local:D==="local"})}}if(R.length>0){let X=R.map((Q)=>Q.js).join(`
|
|
@@ -728,7 +728,7 @@ ${J}.mount(${JSON.stringify(Q)});`}try{await(0,eval)(`(async()=>{
|
|
|
728
728
|
${X}
|
|
729
729
|
})()`),document.body.classList.add("ready")}catch(Q){if(Q instanceof SyntaxError){console.error(`Rip syntax error in combined output: ${Q.message}`);for(let K of R)try{Function(`(async()=>{
|
|
730
730
|
${K.js}
|
|
731
|
-
})()`)}catch(D){console.error(` → source: ${K.url}`,D.message)}}else console.error("Rip runtime error:",Q)}}}}if(U?.hasAttribute("data-reload")&&!globalThis.__ripLaunched){let F=!1,u=new EventSource("/watch");u.addEventListener("connected",()=>{if(F)location.reload();F=!0}),u.addEventListener("reload",(f)=>{if(f.data==="styles"){let _=Date.now();document.querySelectorAll('link[rel="stylesheet"]').forEach((
|
|
731
|
+
})()`)}catch(D){console.error(` → source: ${K.url}`,D.message)}}else console.error("Rip runtime error:",Q)}}}}if(U?.hasAttribute("data-reload")&&!globalThis.__ripLaunched){let F=!1,u=new EventSource("/watch");u.addEventListener("connected",()=>{if(F)location.reload();F=!0}),u.addEventListener("reload",(f)=>{if(f.data==="styles"){let _=Date.now(),Y=0;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((A)=>{if(new URL(A.href).origin!==location.origin)return;let Z=new URL(A.href);Z.searchParams.set("_r",_),A.href=Z.toString(),Y++}),!Y)location.reload()}else location.reload()})}}async function $1($){for(let[_,Y]of Object.entries($1.modules))if($.includes(_))return Y;let U=await fetch($).then((_)=>{if(!_.ok)throw Error(`importRip: ${$} (${_.status})`);return _.text()}),W=o(U),F=`// ${$}
|
|
732
732
|
`,u=new Blob([F+W],{type:"application/javascript"});return await import(URL.createObjectURL(u))}$1.modules={};function P2($){try{let U=$.replace(/^/gm," "),F=o(`do ->
|
|
733
733
|
${U}`).replace(/^let\s+[^;]+;\s*\n\s*/m,"");F=F.replace(/^const\s+(\w+)\s*=/gm,"globalThis.$1 =");let u=(0,eval)(F);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=P2,globalThis.importRip=$1,globalThis.compileToJS=o,globalThis.__ripExports={compile:I1,compileToJS:o,formatSExpr:d,getStdlibCode:J1,VERSION:q2,BUILD_DATE:O2,getReactiveRuntime:z1,getComponentRuntime:K1};if(typeof document<"u")globalThis.__ripScriptsReady=new Promise(($)=>{let U=()=>G2().then($);if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",()=>queueMicrotask(U));else queueMicrotask(U)});var T1={};u2(T1,{throttle:()=>r3,stash:()=>l2,setContext:()=>b2,raw:()=>n1,persistStash:()=>x2,launch:()=>a3,isStash:()=>n3,hold:()=>o3,hasContext:()=>j2,getContext:()=>h2,delay:()=>k2,debounce:()=>d3,createRouter:()=>i2,createResource:()=>p3,createRenderer:()=>n2,createComponents:()=>m2});var I2,x1,p1,A1,e,N1,E2,U1,g,k1,M1,H1,d1,B2,N2,E1,B1,T2,L2,S2,m1,i1,h2,V2,r1,j2,D1,o1,C2,y2,b2,c2,g2,a1,v2;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,W)=>$.map((F)=>F[W]));({__state:g,__effect:U1,__batch:E2}=globalThis.__rip);({setContext:b2,getContext:h2,hasContext:j2}=globalThis.__ripComponent||{});N1=Symbol("stash");e=Symbol("signals");A1=Symbol("raw");x1=Symbol("persisted");p1=new WeakMap;k1=0;d1=g(0);r1=function($,U){let W;if(!$[e])Object.defineProperty($,e,{value:new Map,enumerable:!1});if(W=$[e].get(U),!W)W=g($[U]),$[e].set(U,W);return W};D1=function($){return r1($,Symbol.for("keys"))};v2=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=p1.get($),U)return U;return o1($)};o1=function($){let U,W;return W=null,U={get:function(F,u){let f,_;if(u===N1)return!0;if(u===A1)return F;if(typeof u==="symbol")return Reflect.get(F,u);if(u==="length"&&Array.isArray(F))return D1(F).value,F.length;if(u==="get")return function(Y){return c2(W,Y)};if(u==="set")return function(Y,A){return g2(W,Y,A)};if(f=r1(F,u),_=f.value,_!=null&&typeof _==="object")return v2(_);return _},set:function(F,u,f){let _,Y;if(_=F[u],Y=f?.[A1]?f[A1]:f,Y===_)return!0;if(F[u]=Y,F[e]?.has(u))F[e].get(u).value=Y;if(_===void 0&&Y!==void 0)D1(F).value=++k1;return d1.value++,!0},deleteProperty:function(F,u){let f;if(delete F[u],f=F[e]?.get(u),f!=null)f.value=void 0;return D1(F).value=++k1,!0},ownKeys:function(F){return D1(F).value,Reflect.ownKeys(F)}},W=new Proxy($,U),p1.set($,W),W};I2=/([./][^./\[\s]+|\[[-+]?\d+\]|\[(?:"[^"]+"|'[^']+')\])/;a1=function($){let U,W,F,u,f;F=("."+$).split(I2),F.shift(),f=[],W=0;while(W<F.length){if(u=F[W],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));W+=2}return f};c2=function($,U){let W,F;F=a1(U),W=$;for(let u of F){if(W==null)return;W=W[u]}return W};g2=function($,U,W){let F,u;u=a1(U),F=$;for(let f=0;f<u.length;f++){let _=u[f];if(f===u.length-1)F[_]=W;else{if(F[_]==null)F[_]={};F=F[_]}}return W};var l2=function($={}){return o1($)},n1=function($){return $?.[A1]?$[A1]:$},n3=function($){return $?.[N1]===!0},x2=function($,U={}){let W,F,u,f,_,Y;if(Y=n1($)||$,Y[x1])return;Y[x1]=!0,f=U.local?localStorage:sessionStorage,_=U.key||"__rip_app";try{if(F=f.getItem(_),F){u=JSON.parse(F);for(let A in u){let Z=u[A];$.data[A]=Z}}}catch{}return W=function(){return(()=>{try{return f.setItem(_,JSON.stringify(n1($.data)))}catch{return null}})()},U1(function(){let A;return d1.value,A=setTimeout(W,2000),function(){return clearTimeout(A)}}),window.addEventListener("beforeunload",W)},p3=function($,U={}){let W,F,u,f,_;if(W=g(U.initial||null),u=g(!1),F=g(null),f=async function(){let Y;return u.value=!0,F.value=null,(async()=>{try{return Y=await $(),W.value=Y}catch(A){return F.value=A}finally{u.value=!1}})()},_={data:void 0,loading:void 0,error:void 0,refetch:f},Object.defineProperty(_,"data",{get:function(){return W.value}}),Object.defineProperty(_,"loading",{get:function(){return u.value}}),Object.defineProperty(_,"error",{get:function(){return F.value}}),!U.lazy)f();return _};H1=function($){return typeof $==="function"?$:function(){return $.value}};M1=function($,U){let W;return W={read:function(){return $.read()}},Object.defineProperty(W,"value",{get:function(){return $.value},set:function(F){return U.value=F}}),W};var k2=function($,U){let W,F;return W=H1(U),F=g(!!W()),U1(function(){let u;if(W())return u=setTimeout(function(){return F.value=!0},$),function(){return clearTimeout(u)};else return F.value=!1}),typeof U!=="function"?M1(F,U):F},d3=function($,U){let W,F;return W=H1(U),F=g(W()),U1(function(){let u,f;return f=W(),u=setTimeout(function(){return F.value=f},$),function(){return clearTimeout(u)}}),typeof U!=="function"?M1(F,U):F},r3=function($,U){let W,F,u;return W=H1(U),u=g(W()),F=0,U1(function(){let f,_,Y,A;if(A=W(),f=Date.now(),_=$-(f-F),_<=0)return u.value=A,F=f;else return Y=setTimeout(function(){return u.value=W(),F=Date.now()},_),function(){return clearTimeout(Y)}}),typeof U!=="function"?M1(u,U):u},o3=function($,U){let W,F;return W=H1(U),F=g(!!W()),U1(function(){let u;if(W())return F.value=!0;else return u=setTimeout(function(){return F.value=!1},$),function(){return clearTimeout(u)}}),typeof U!=="function"?M1(F,U):F},m2=function(){let $,U,W,F;return U=new Map,F=[],$=new Map,W=function(u,f){for(let _ of F)_(u,f)},{read:function(u){return U.get(u)},write:function(u,f){let _;return _=!U.has(u),U.set(u,f),$.delete(u),W(_?"create":"change",u)},del:function(u){return U.delete(u),$.delete(u),W("delete",u)},exists:function(u){return U.has(u)},size:function(){return U.size},list:function(u=""){let f,_,Y;Y=[],f=u?u+"/":"";for(let[A]of U)if(A.startsWith(f)){if(_=A.slice(f.length),_.includes("/"))continue;Y.push(A)}return Y},listAll:function(u=""){let f,_;_=[],f=u?u+"/":"";for(let[Y]of U)if(Y.startsWith(f))_.push(Y);return _},load:function(u){for(let f in u){let _=u[f];U.set(f,_)}},watch:function(u){return F.push(u),function(){return F.splice(F.indexOf(u),1)}},getCompiled:function(u){return $.get(u)},setCompiled:function(u,f){return $.set(u,f)}}};S2=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};y2=function($){let U,W;return U=[],W=$.replace(/\*(\w+)/g,function(F,u){return U.push(u),"(.+)"}).replace(/:(\w+)/g,function(F,u){return U.push(u),"([^/]+)"}),{regex:new RegExp("^"+W+"$"),names:U}};C2=function($,U){let W,F;for(let u of U)if(W=$.match(u.regex.regex),W){F={};for(let f=0;f<u.regex.names.length;f++){let _=u.regex.names[f];F[_]=decodeURIComponent(W[f+1])}return{route:u,params:F}}return null};E1=function($,U="components"){let W,F,u,f,_,Y,A,Z,R;A=[],u=new Map,W=$.listAll(U);for(let X of W){if(Y=X.slice(U.length+1),!Y.endsWith(".rip"))continue;if(f=Y.split("/").pop(),f==="_layout.rip"){F=Y==="_layout.rip"?"":Y.slice(0,-12),u.set(F,X);continue}if(f.startsWith("_"))continue;if(Z=Y.split("/"),Z.length>1&&Z.some(function(J,Q){return Q<Z.length-1&&J.startsWith("_")}))continue;R=S2(Y),_=y2(R),A.push({pattern:R,regex:_,file:X,rel:Y})}return A.sort(function(X,J){let Q,K,D,z;if(K=(X.pattern.match(/:/g)||[]).length,z=(J.pattern.match(/:/g)||[]).length,Q=X.pattern.includes("*")?1:0,D=J.pattern.includes("*")?1:0,Q!==D)return Q-D;if(K!==z)return K-z;return X.pattern.localeCompare(J.pattern)}),{routes:A,layouts:u}};V2=function($,U,W){let F,u,f,_;if(F=[],f=$.slice(U.length+1),_=f.split("/"),u="",W.has(""))F.push(W.get(""));for(let Y=0;Y<_.length;Y++){let A=_[Y];if(Y===_.length-1)break;if(u=u?u+"/"+A:A,W.has(u))F.push(W.get(u))}return F};var i2=function($,U={}){let W,F,u,f,_,Y,A,Z,R,X,J,Q,K,D,z,w,H,M,O,P,G;if(H=U.root||"components",R=U.base||"",X=U.hash||!1,K=U.onError||null,O=function(q){return R&&q.startsWith(R)?q.slice(R.length)||"/":q},Z=function(q){return R?R+q:q},z=function(){let q;if(X){if(q=location.hash.slice(1),!q)return"/";return q[0]==="/"?q:"/"+q}else return location.pathname+location.search+location.hash},G=function(q){return X?q==="/"?location.pathname:"#"+q.slice(1):Z(q)},_=g(O(X?z():location.pathname)),f=g({}),A=g(null),F=g([]),Y=g({}),W=g(""),u=k2(100,g(!1)),P=E1($,H),J=new Set,$.watch(function(q,I){if(!I.startsWith(H+"/"))return;return P=E1($,H)}),w=function(q){let I,E,N,L,B;if(L=q.split("?")[0].split("#")[0],E=O(L),E=E[0]==="/"?E:"/"+E,N=q.split("?")[1]?.split("#")[0]||"",I=q.includes("#")?q.split("#")[1]:"",B=C2(E,P.routes),B){E2(function(){return _.value=E,f.value=B.params,A.value=B.route,F.value=V2(B.route.file,H,P.layouts),Y.value=Object.fromEntries(new URLSearchParams(N)),W.value=I});for(let C of J)C(M.current);return!0}if(K)K({status:404,path:E});return!1},D=function(){return w(z())},typeof window<"u")window.addEventListener("popstate",D);if(Q=function(q){let I,E,N;if(q.button!==0||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey)return;E=q.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 q.preventDefault(),I=X&&N.hash?N.hash.slice(1)||"/":N.pathname+N.search+N.hash,M.push(I)},typeof document<"u")document.addEventListener("click",Q);return M={push:function(q){return w(q)?history.pushState(null,"",G(_.read())):void 0},replace:function(q){return w(q)?history.replaceState(null,"",G(_.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(q){return J.add(q),function(){return J.delete(q)}},rebuild:function(){return P=E1($,H)},routes:void 0,init:function(){return w(z()),M},destroy:function(){if(typeof window<"u")window.removeEventListener("popstate",D);if(typeof document<"u")document.removeEventListener("click",Q);return J.clear()}},Object.defineProperty(M,"current",{get:function(){return{path:_.value,params:f.value,route:A.value,layouts:F.value,query:Y.value,hash:W.value}}}),Object.defineProperty(M,"path",{get:function(){return _.value}}),Object.defineProperty(M,"params",{get:function(){return f.value}}),Object.defineProperty(M,"route",{get:function(){return A.value}}),Object.defineProperty(M,"layouts",{get:function(){return F.value}}),Object.defineProperty(M,"query",{get:function(){return Y.value}}),Object.defineProperty(M,"hash",{get:function(){return W.value}}),Object.defineProperty(M,"navigating",{get:function(){return u.value},set:function(q){return u.value=q}}),Object.defineProperty(M,"routes",{get:function(){return P.routes}}),M};B2=function($,U){if($.length!==U.length)return!1;for(let W=0;W<$.length;W++)if($[W]!==U[W])return!1;return!0};i1=function($){for(let U in $){let W=$[U];if(typeof W==="function"&&(W.prototype?.mount||W.prototype?._create))return W}return typeof $.default==="function"?$.default:void 0};m1=function($){let U;U={};for(let W in $){let F=$[W];if(typeof F==="function"&&(F.prototype?.mount||F.prototype?._create))U[W]=F}return U};L2=function($){let U;return U=$.split("/").pop().replace(/\.rip$/,""),U.replace(/(^|[-_])([a-z])/g,function(W,F,u){return u.toUpperCase()})};N2=function($,U="components"){let W,F,u;F={};for(let f of $.listAll(U)){if(!f.endsWith(".rip"))continue;if(W=f.split("/").pop(),W.startsWith("_"))continue;if(u=L2(f),F[u])console.warn(`[Rip] Component name collision: ${u} (${F[u]} vs ${f})`);F[u]=f}return F};B1=async function($,U,W=null,F=null,u=null){let f,_,Y,A,Z,R,X,J,Q,K,D,z;if(W&&F){if(_=W.getCompiled(F),_)return _}if(X=U($),u){K={};for(let w in u.map){let H=u.map[w];if(H!==F&&X.includes(`new ${w}(`)){if(!u.classes[w]){if(A=W.read(H),A){Y=await B1(A,U,W,H,u),Z=m1(Y);for(let M in Z){let O=Z[M];u.classes[M]=O}}}if(u.classes[w])K[w]=!0}}if(Q=Object.keys(K),Q.length>0)D=`const {${Q.join(", ")}} = globalThis['${u.key}'];
|
|
734
734
|
`,X=D+X}if(R=F?`// ${F}
|
package/docs/dist/rip.min.js.br
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/browser.js
CHANGED
|
@@ -197,12 +197,15 @@ async function processRipScripts() {
|
|
|
197
197
|
es.addEventListener('reload', (e) => {
|
|
198
198
|
if (e.data === 'styles') {
|
|
199
199
|
const t = Date.now();
|
|
200
|
+
let refreshed = 0;
|
|
200
201
|
document.querySelectorAll('link[rel="stylesheet"]').forEach(l => {
|
|
201
202
|
if (new URL(l.href).origin !== location.origin) return;
|
|
202
203
|
const url = new URL(l.href);
|
|
203
204
|
url.searchParams.set('_r', t);
|
|
204
205
|
l.href = url.toString();
|
|
206
|
+
refreshed++;
|
|
205
207
|
});
|
|
208
|
+
if (!refreshed) location.reload();
|
|
206
209
|
} else {
|
|
207
210
|
location.reload();
|
|
208
211
|
}
|