rip-lang 3.13.32 → 3.13.33
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 +35 -12
- package/docs/dist/rip.min.js +193 -193
- package/docs/dist/rip.min.js.br +0 -0
- package/package.json +1 -1
- package/src/components.js +33 -11
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.33-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%2C300%2F1%2C300-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
|
@@ -3801,23 +3801,36 @@ Expecting ${expected.join(", ")}, got '${this.tokenNames[symbol] || symbol}'`;
|
|
|
3801
3801
|
tag = "div";
|
|
3802
3802
|
return { tag, classes, id };
|
|
3803
3803
|
};
|
|
3804
|
+
const _str = (s) => typeof s === "string" ? s : s instanceof String ? s.valueOf() : null;
|
|
3805
|
+
const _transferMeta = (from, to) => {
|
|
3806
|
+
if (!(from instanceof String))
|
|
3807
|
+
return to;
|
|
3808
|
+
const s = new String(to);
|
|
3809
|
+
if (from.predicate)
|
|
3810
|
+
s.predicate = true;
|
|
3811
|
+
if (from.await)
|
|
3812
|
+
s.await = true;
|
|
3813
|
+
return s.predicate || s.await ? s : to;
|
|
3814
|
+
};
|
|
3804
3815
|
proto.transformComponentMembers = function(sexpr) {
|
|
3805
3816
|
const self = this._self;
|
|
3806
3817
|
if (!Array.isArray(sexpr)) {
|
|
3807
|
-
|
|
3808
|
-
|
|
3818
|
+
const sv = _str(sexpr);
|
|
3819
|
+
if (sv && this.reactiveMembers && this.reactiveMembers.has(sv)) {
|
|
3820
|
+
return [".", [".", self, sv], _transferMeta(sexpr, "value")];
|
|
3809
3821
|
}
|
|
3810
|
-
if (
|
|
3811
|
-
return [".", self, sexpr];
|
|
3822
|
+
if (sv && this.componentMembers && this.componentMembers.has(sv)) {
|
|
3823
|
+
return [".", self, _transferMeta(sexpr, sv)];
|
|
3812
3824
|
}
|
|
3813
3825
|
return sexpr;
|
|
3814
3826
|
}
|
|
3815
|
-
if (sexpr[0] === "." && sexpr[1] === "this" &&
|
|
3816
|
-
const
|
|
3827
|
+
if (sexpr[0] === "." && sexpr[1] === "this" && _str(sexpr[2]) != null) {
|
|
3828
|
+
const prop = sexpr[2];
|
|
3829
|
+
const memberName = _str(prop);
|
|
3817
3830
|
if (this.reactiveMembers && this.reactiveMembers.has(memberName)) {
|
|
3818
|
-
return [".", [".", self, memberName], "value"];
|
|
3831
|
+
return [".", [".", self, memberName], _transferMeta(prop, "value")];
|
|
3819
3832
|
}
|
|
3820
|
-
return this._factoryMode ? [".", self,
|
|
3833
|
+
return this._factoryMode ? [".", self, prop] : sexpr;
|
|
3821
3834
|
}
|
|
3822
3835
|
if (sexpr[0] === "." || sexpr[0] === "?.") {
|
|
3823
3836
|
return [sexpr[0], this.transformComponentMembers(sexpr[1]), sexpr[2]];
|
|
@@ -3937,7 +3950,7 @@ Expecting ${expected.join(", ")}, got '${this.tokenNames[symbol] || symbol}'`;
|
|
|
3937
3950
|
lines.push(isPublic ? ` this.${name} = __state(props.__bind_${name}__ ?? props.${name} ?? ${val});` : ` this.${name} = __state(${val});`);
|
|
3938
3951
|
}
|
|
3939
3952
|
for (const { name, expr } of derivedVars) {
|
|
3940
|
-
if (this.is(expr, "block")
|
|
3953
|
+
if (this.is(expr, "block")) {
|
|
3941
3954
|
const transformed = this.transformComponentMembers(expr);
|
|
3942
3955
|
const body2 = this.generateFunctionBody(transformed);
|
|
3943
3956
|
lines.push(` this.${name} = __computed(() => ${body2});`);
|
|
@@ -3949,7 +3962,7 @@ Expecting ${expected.join(", ")}, got '${this.tokenNames[symbol] || symbol}'`;
|
|
|
3949
3962
|
for (const effect of effects) {
|
|
3950
3963
|
const effectBody = effect[2];
|
|
3951
3964
|
const isAsync = this.containsAwait(effectBody) ? "async " : "";
|
|
3952
|
-
if (this.is(effectBody, "block")
|
|
3965
|
+
if (this.is(effectBody, "block")) {
|
|
3953
3966
|
const transformed = this.transformComponentMembers(effectBody);
|
|
3954
3967
|
const body2 = this.generateFunctionBody(transformed, [], true);
|
|
3955
3968
|
lines.push(` __effect(${isAsync}() => ${body2});`);
|
|
@@ -4113,6 +4126,12 @@ ${blockFactoriesCode}return ${lines.join(`
|
|
|
4113
4126
|
this._pushEffect(`${textVar2}.data = ${this._self}.${str}.value;`);
|
|
4114
4127
|
return textVar2;
|
|
4115
4128
|
}
|
|
4129
|
+
if (str === "slot" && this.componentMembers) {
|
|
4130
|
+
const s = this._self;
|
|
4131
|
+
const slotVar = this.newElementVar("slot");
|
|
4132
|
+
this._createLines.push(`${slotVar} = ${s}.children instanceof Node ? ${s}.children : (${s}.children != null ? document.createTextNode(String(${s}.children)) : document.createComment(''));`);
|
|
4133
|
+
return slotVar;
|
|
4134
|
+
}
|
|
4116
4135
|
const [tagStr, idStr] = str.split("#");
|
|
4117
4136
|
const elVar = this.newElementVar();
|
|
4118
4137
|
const actualTag = tagStr || "div";
|
|
@@ -4439,7 +4458,11 @@ ${blockFactoriesCode}return ${lines.join(`
|
|
|
4439
4458
|
this._createLines.push(`if (${valueCode}) ${elVar}.setAttribute('${key}', '');`);
|
|
4440
4459
|
}
|
|
4441
4460
|
} else if (this.hasReactiveDeps(value)) {
|
|
4442
|
-
|
|
4461
|
+
if (Array.isArray(value) && value[0] === "presence") {
|
|
4462
|
+
this._pushEffect(`{ const __v = ${valueCode}; __v == null ? ${elVar}.removeAttribute('${key}') : ${elVar}.setAttribute('${key}', __v); }`);
|
|
4463
|
+
} else {
|
|
4464
|
+
this._pushEffect(`${elVar}.setAttribute('${key}', ${valueCode});`);
|
|
4465
|
+
}
|
|
4443
4466
|
} else {
|
|
4444
4467
|
this._createLines.push(`${elVar}.setAttribute('${key}', ${valueCode});`);
|
|
4445
4468
|
}
|
|
@@ -8594,7 +8617,7 @@ globalThis.zip ??= (...a) => a[0].map((_, i) => a.map(b => b[i]));
|
|
|
8594
8617
|
}
|
|
8595
8618
|
// src/browser.js
|
|
8596
8619
|
var VERSION = "3.13.32";
|
|
8597
|
-
var BUILD_DATE = "2026-02-26@
|
|
8620
|
+
var BUILD_DATE = "2026-02-26@17:50:29GMT";
|
|
8598
8621
|
if (typeof globalThis !== "undefined") {
|
|
8599
8622
|
if (!globalThis.__rip)
|
|
8600
8623
|
new Function(getReactiveRuntime())();
|