tutuca 0.9.66 → 0.9.67
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/tutuca-cli.js +76 -44
- package/dist/tutuca-dev.ext.js +81 -46
- package/dist/tutuca-dev.js +69 -42
- package/dist/tutuca-dev.min.js +2 -2
- package/dist/tutuca-extra.ext.js +48 -42
- package/dist/tutuca-extra.js +46 -42
- package/dist/tutuca-extra.min.js +2 -2
- package/dist/tutuca.ext.js +46 -42
- package/dist/tutuca.js +46 -42
- package/dist/tutuca.min.js +2 -2
- package/package.json +1 -1
- package/skill/tutuca/core.md +10 -2
- package/skill/tutuca/testing.md +3 -2
- package/skill/tutuca-source/SKILL.md +33 -0
- package/skill/tutuca-source/tutuca.ext.js +3828 -0
- package/skill/SKILL.md +0 -46
- package/skill/advanced.md +0 -146
- package/skill/cli.md +0 -117
- package/skill/core.md +0 -793
package/dist/tutuca.ext.js
CHANGED
|
@@ -1172,40 +1172,49 @@ class RequestHandler {
|
|
|
1172
1172
|
}
|
|
1173
1173
|
|
|
1174
1174
|
// src/vdom.js
|
|
1175
|
-
var isHtmlAttribute = (propName) => propName[4] === "-" && (propName[0] === "d" || propName[0] === "a");
|
|
1176
1175
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
1177
1176
|
var isNamespaced = (node) => {
|
|
1178
1177
|
const ns = node.namespaceURI;
|
|
1179
1178
|
return ns !== null && ns !== HTML_NS;
|
|
1180
1179
|
};
|
|
1181
|
-
|
|
1180
|
+
var NEVER_ASSIGN = new Set([
|
|
1181
|
+
"width",
|
|
1182
|
+
"height",
|
|
1183
|
+
"href",
|
|
1184
|
+
"list",
|
|
1185
|
+
"form",
|
|
1186
|
+
"tabIndex",
|
|
1187
|
+
"download",
|
|
1188
|
+
"rowSpan",
|
|
1189
|
+
"colSpan",
|
|
1190
|
+
"role",
|
|
1191
|
+
"popover"
|
|
1192
|
+
]);
|
|
1193
|
+
function applyProperties(node, props, _previous) {
|
|
1182
1194
|
const namespaced = isNamespaced(node);
|
|
1183
|
-
for (const
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
node.setAttribute("class", propValue);
|
|
1191
|
-
else if (namespaced || isHtmlAttribute(propName))
|
|
1192
|
-
node.setAttribute(propName, propValue);
|
|
1195
|
+
for (const name in props)
|
|
1196
|
+
setProp(node, name, props[name], namespaced);
|
|
1197
|
+
}
|
|
1198
|
+
function setProp(node, name, value, namespaced) {
|
|
1199
|
+
if (name === "dangerouslySetInnerHTML") {
|
|
1200
|
+
if (value === undefined)
|
|
1201
|
+
node.replaceChildren();
|
|
1193
1202
|
else
|
|
1194
|
-
node
|
|
1195
|
-
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
if (
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
node.removeAttribute(
|
|
1203
|
+
node.innerHTML = value.__html ?? "";
|
|
1204
|
+
return;
|
|
1205
|
+
}
|
|
1206
|
+
if (typeof value === "function")
|
|
1207
|
+
return;
|
|
1208
|
+
if (!namespaced && !NEVER_ASSIGN.has(name) && name in node) {
|
|
1209
|
+
try {
|
|
1210
|
+
node[name] = value == null ? "" : value;
|
|
1211
|
+
return;
|
|
1212
|
+
} catch {}
|
|
1213
|
+
}
|
|
1214
|
+
if (value == null || value === false && name[4] !== "-")
|
|
1215
|
+
node.removeAttribute(name);
|
|
1207
1216
|
else
|
|
1208
|
-
node
|
|
1217
|
+
node.setAttribute(name, value);
|
|
1209
1218
|
}
|
|
1210
1219
|
|
|
1211
1220
|
class VBase {
|
|
@@ -1477,22 +1486,12 @@ function h(tagName, properties, children, namespace) {
|
|
|
1477
1486
|
if (properties) {
|
|
1478
1487
|
for (const propName in properties) {
|
|
1479
1488
|
const propVal = properties[propName];
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
break;
|
|
1487
|
-
case "class":
|
|
1488
|
-
props.className = propVal;
|
|
1489
|
-
break;
|
|
1490
|
-
case "for":
|
|
1491
|
-
props.htmlFor = propVal;
|
|
1492
|
-
break;
|
|
1493
|
-
default:
|
|
1494
|
-
props[propName] = isHtmlAttribute(propName) ? String(propVal) : propVal;
|
|
1495
|
-
}
|
|
1489
|
+
if (propName === "key")
|
|
1490
|
+
key = propVal;
|
|
1491
|
+
else if (propName === "namespace")
|
|
1492
|
+
namespace = namespace ?? propVal;
|
|
1493
|
+
else
|
|
1494
|
+
props[propName] = propVal;
|
|
1496
1495
|
}
|
|
1497
1496
|
}
|
|
1498
1497
|
const c = tagName.charCodeAt(0);
|
|
@@ -3798,6 +3797,10 @@ function check(_app) {
|
|
|
3798
3797
|
async function test(_opts) {
|
|
3799
3798
|
return null;
|
|
3800
3799
|
}
|
|
3800
|
+
function collectIterBindings() {
|
|
3801
|
+
console.warn("collectIterBindings is a no-op in the core tutuca build; use the tutuca-dev build for a functional implementation");
|
|
3802
|
+
return [];
|
|
3803
|
+
}
|
|
3801
3804
|
function tutuca(nodeOrSelector) {
|
|
3802
3805
|
const rootNode = typeof nodeOrSelector === "string" ? document.querySelector(nodeOrSelector) : nodeOrSelector;
|
|
3803
3806
|
const comps = new Components;
|
|
@@ -3814,6 +3817,7 @@ export {
|
|
|
3814
3817
|
html,
|
|
3815
3818
|
css,
|
|
3816
3819
|
component,
|
|
3820
|
+
collectIterBindings,
|
|
3817
3821
|
check,
|
|
3818
3822
|
SEQ_INFO,
|
|
3819
3823
|
ParseContext,
|
package/dist/tutuca.js
CHANGED
|
@@ -5545,40 +5545,49 @@ class RequestHandler {
|
|
|
5545
5545
|
}
|
|
5546
5546
|
|
|
5547
5547
|
// src/vdom.js
|
|
5548
|
-
var isHtmlAttribute = (propName) => propName[4] === "-" && (propName[0] === "d" || propName[0] === "a");
|
|
5549
5548
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
5550
5549
|
var isNamespaced = (node) => {
|
|
5551
5550
|
const ns = node.namespaceURI;
|
|
5552
5551
|
return ns !== null && ns !== HTML_NS;
|
|
5553
5552
|
};
|
|
5554
|
-
|
|
5553
|
+
var NEVER_ASSIGN = new Set([
|
|
5554
|
+
"width",
|
|
5555
|
+
"height",
|
|
5556
|
+
"href",
|
|
5557
|
+
"list",
|
|
5558
|
+
"form",
|
|
5559
|
+
"tabIndex",
|
|
5560
|
+
"download",
|
|
5561
|
+
"rowSpan",
|
|
5562
|
+
"colSpan",
|
|
5563
|
+
"role",
|
|
5564
|
+
"popover"
|
|
5565
|
+
]);
|
|
5566
|
+
function applyProperties(node, props, _previous) {
|
|
5555
5567
|
const namespaced = isNamespaced(node);
|
|
5556
|
-
for (const
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
node.setAttribute("class", propValue);
|
|
5564
|
-
else if (namespaced || isHtmlAttribute(propName))
|
|
5565
|
-
node.setAttribute(propName, propValue);
|
|
5568
|
+
for (const name in props)
|
|
5569
|
+
setProp2(node, name, props[name], namespaced);
|
|
5570
|
+
}
|
|
5571
|
+
function setProp2(node, name, value, namespaced) {
|
|
5572
|
+
if (name === "dangerouslySetInnerHTML") {
|
|
5573
|
+
if (value === undefined)
|
|
5574
|
+
node.replaceChildren();
|
|
5566
5575
|
else
|
|
5567
|
-
node
|
|
5568
|
-
|
|
5569
|
-
}
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
if (
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
node.removeAttribute(
|
|
5576
|
+
node.innerHTML = value.__html ?? "";
|
|
5577
|
+
return;
|
|
5578
|
+
}
|
|
5579
|
+
if (typeof value === "function")
|
|
5580
|
+
return;
|
|
5581
|
+
if (!namespaced && !NEVER_ASSIGN.has(name) && name in node) {
|
|
5582
|
+
try {
|
|
5583
|
+
node[name] = value == null ? "" : value;
|
|
5584
|
+
return;
|
|
5585
|
+
} catch {}
|
|
5586
|
+
}
|
|
5587
|
+
if (value == null || value === false && name[4] !== "-")
|
|
5588
|
+
node.removeAttribute(name);
|
|
5580
5589
|
else
|
|
5581
|
-
node
|
|
5590
|
+
node.setAttribute(name, value);
|
|
5582
5591
|
}
|
|
5583
5592
|
|
|
5584
5593
|
class VBase {
|
|
@@ -5850,22 +5859,12 @@ function h(tagName, properties, children, namespace) {
|
|
|
5850
5859
|
if (properties) {
|
|
5851
5860
|
for (const propName in properties) {
|
|
5852
5861
|
const propVal = properties[propName];
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
break;
|
|
5860
|
-
case "class":
|
|
5861
|
-
props.className = propVal;
|
|
5862
|
-
break;
|
|
5863
|
-
case "for":
|
|
5864
|
-
props.htmlFor = propVal;
|
|
5865
|
-
break;
|
|
5866
|
-
default:
|
|
5867
|
-
props[propName] = isHtmlAttribute(propName) ? String(propVal) : propVal;
|
|
5868
|
-
}
|
|
5862
|
+
if (propName === "key")
|
|
5863
|
+
key = propVal;
|
|
5864
|
+
else if (propName === "namespace")
|
|
5865
|
+
namespace = namespace ?? propVal;
|
|
5866
|
+
else
|
|
5867
|
+
props[propName] = propVal;
|
|
5869
5868
|
}
|
|
5870
5869
|
}
|
|
5871
5870
|
const c = tagName.charCodeAt(0);
|
|
@@ -8156,6 +8155,10 @@ function check(_app) {
|
|
|
8156
8155
|
async function test(_opts) {
|
|
8157
8156
|
return null;
|
|
8158
8157
|
}
|
|
8158
|
+
function collectIterBindings() {
|
|
8159
|
+
console.warn("collectIterBindings is a no-op in the core tutuca build; use the tutuca-dev build for a functional implementation");
|
|
8160
|
+
return [];
|
|
8161
|
+
}
|
|
8159
8162
|
function tutuca(nodeOrSelector) {
|
|
8160
8163
|
const rootNode = typeof nodeOrSelector === "string" ? document.querySelector(nodeOrSelector) : nodeOrSelector;
|
|
8161
8164
|
const comps = new Components;
|
|
@@ -8206,6 +8209,7 @@ export {
|
|
|
8206
8209
|
fromJS,
|
|
8207
8210
|
css,
|
|
8208
8211
|
component,
|
|
8212
|
+
collectIterBindings,
|
|
8209
8213
|
check,
|
|
8210
8214
|
Stack,
|
|
8211
8215
|
Set2 as Set,
|