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-extra.ext.js
CHANGED
|
@@ -50,6 +50,7 @@ __export(exports_extra, {
|
|
|
50
50
|
component: () => component,
|
|
51
51
|
compileClassesToStyleText: () => compileClassesToStyleText,
|
|
52
52
|
compileClassesToStyle: () => compileClassesToStyle,
|
|
53
|
+
collectIterBindings: () => collectIterBindings,
|
|
53
54
|
check: () => check,
|
|
54
55
|
SEQ_INFO: () => SEQ_INFO,
|
|
55
56
|
ParseContext: () => ParseContext,
|
|
@@ -1282,40 +1283,49 @@ class RequestHandler {
|
|
|
1282
1283
|
}
|
|
1283
1284
|
|
|
1284
1285
|
// src/vdom.js
|
|
1285
|
-
var isHtmlAttribute = (propName) => propName[4] === "-" && (propName[0] === "d" || propName[0] === "a");
|
|
1286
1286
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
1287
1287
|
var isNamespaced = (node) => {
|
|
1288
1288
|
const ns = node.namespaceURI;
|
|
1289
1289
|
return ns !== null && ns !== HTML_NS;
|
|
1290
1290
|
};
|
|
1291
|
-
|
|
1291
|
+
var NEVER_ASSIGN = new Set([
|
|
1292
|
+
"width",
|
|
1293
|
+
"height",
|
|
1294
|
+
"href",
|
|
1295
|
+
"list",
|
|
1296
|
+
"form",
|
|
1297
|
+
"tabIndex",
|
|
1298
|
+
"download",
|
|
1299
|
+
"rowSpan",
|
|
1300
|
+
"colSpan",
|
|
1301
|
+
"role",
|
|
1302
|
+
"popover"
|
|
1303
|
+
]);
|
|
1304
|
+
function applyProperties(node, props, _previous) {
|
|
1292
1305
|
const namespaced = isNamespaced(node);
|
|
1293
|
-
for (const
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
node.setAttribute("class", propValue);
|
|
1301
|
-
else if (namespaced || isHtmlAttribute(propName))
|
|
1302
|
-
node.setAttribute(propName, propValue);
|
|
1306
|
+
for (const name in props)
|
|
1307
|
+
setProp(node, name, props[name], namespaced);
|
|
1308
|
+
}
|
|
1309
|
+
function setProp(node, name, value, namespaced) {
|
|
1310
|
+
if (name === "dangerouslySetInnerHTML") {
|
|
1311
|
+
if (value === undefined)
|
|
1312
|
+
node.replaceChildren();
|
|
1303
1313
|
else
|
|
1304
|
-
node
|
|
1305
|
-
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
if (
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
node.removeAttribute(
|
|
1314
|
+
node.innerHTML = value.__html ?? "";
|
|
1315
|
+
return;
|
|
1316
|
+
}
|
|
1317
|
+
if (typeof value === "function")
|
|
1318
|
+
return;
|
|
1319
|
+
if (!namespaced && !NEVER_ASSIGN.has(name) && name in node) {
|
|
1320
|
+
try {
|
|
1321
|
+
node[name] = value == null ? "" : value;
|
|
1322
|
+
return;
|
|
1323
|
+
} catch {}
|
|
1324
|
+
}
|
|
1325
|
+
if (value == null || value === false && name[4] !== "-")
|
|
1326
|
+
node.removeAttribute(name);
|
|
1317
1327
|
else
|
|
1318
|
-
node
|
|
1328
|
+
node.setAttribute(name, value);
|
|
1319
1329
|
}
|
|
1320
1330
|
|
|
1321
1331
|
class VBase {
|
|
@@ -1587,22 +1597,12 @@ function h(tagName, properties, children, namespace) {
|
|
|
1587
1597
|
if (properties) {
|
|
1588
1598
|
for (const propName in properties) {
|
|
1589
1599
|
const propVal = properties[propName];
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
break;
|
|
1597
|
-
case "class":
|
|
1598
|
-
props.className = propVal;
|
|
1599
|
-
break;
|
|
1600
|
-
case "for":
|
|
1601
|
-
props.htmlFor = propVal;
|
|
1602
|
-
break;
|
|
1603
|
-
default:
|
|
1604
|
-
props[propName] = isHtmlAttribute(propName) ? String(propVal) : propVal;
|
|
1605
|
-
}
|
|
1600
|
+
if (propName === "key")
|
|
1601
|
+
key = propVal;
|
|
1602
|
+
else if (propName === "namespace")
|
|
1603
|
+
namespace = namespace ?? propVal;
|
|
1604
|
+
else
|
|
1605
|
+
props[propName] = propVal;
|
|
1606
1606
|
}
|
|
1607
1607
|
}
|
|
1608
1608
|
const c = tagName.charCodeAt(0);
|
|
@@ -4106,6 +4106,7 @@ __export(exports_tutuca, {
|
|
|
4106
4106
|
html: () => html,
|
|
4107
4107
|
css: () => css,
|
|
4108
4108
|
component: () => component,
|
|
4109
|
+
collectIterBindings: () => collectIterBindings,
|
|
4109
4110
|
check: () => check,
|
|
4110
4111
|
SEQ_INFO: () => SEQ_INFO,
|
|
4111
4112
|
ParseContext: () => ParseContext,
|
|
@@ -4132,6 +4133,10 @@ function check(_app) {
|
|
|
4132
4133
|
async function test(_opts) {
|
|
4133
4134
|
return null;
|
|
4134
4135
|
}
|
|
4136
|
+
function collectIterBindings() {
|
|
4137
|
+
console.warn("collectIterBindings is a no-op in the core tutuca build; use the tutuca-dev build for a functional implementation");
|
|
4138
|
+
return [];
|
|
4139
|
+
}
|
|
4135
4140
|
function tutuca(nodeOrSelector) {
|
|
4136
4141
|
const rootNode = typeof nodeOrSelector === "string" ? document.querySelector(nodeOrSelector) : nodeOrSelector;
|
|
4137
4142
|
const comps = new Components;
|
|
@@ -4173,6 +4178,7 @@ export {
|
|
|
4173
4178
|
component,
|
|
4174
4179
|
compileClassesToStyleText,
|
|
4175
4180
|
compileClassesToStyle,
|
|
4181
|
+
collectIterBindings,
|
|
4176
4182
|
check,
|
|
4177
4183
|
SEQ_INFO,
|
|
4178
4184
|
ParseContext,
|
package/dist/tutuca-extra.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);
|
|
@@ -8309,6 +8308,10 @@ function check(_app) {
|
|
|
8309
8308
|
async function test(_opts) {
|
|
8310
8309
|
return null;
|
|
8311
8310
|
}
|
|
8311
|
+
function collectIterBindings() {
|
|
8312
|
+
console.warn("collectIterBindings is a no-op in the core tutuca build; use the tutuca-dev build for a functional implementation");
|
|
8313
|
+
return [];
|
|
8314
|
+
}
|
|
8312
8315
|
function tutuca(nodeOrSelector) {
|
|
8313
8316
|
const rootNode = typeof nodeOrSelector === "string" ? document.querySelector(nodeOrSelector) : nodeOrSelector;
|
|
8314
8317
|
const comps = new Components;
|
|
@@ -8383,6 +8386,7 @@ export {
|
|
|
8383
8386
|
component,
|
|
8384
8387
|
compileClassesToStyleText,
|
|
8385
8388
|
compileClassesToStyle,
|
|
8389
|
+
collectIterBindings,
|
|
8386
8390
|
check,
|
|
8387
8391
|
Stack,
|
|
8388
8392
|
Set2 as Set,
|