cradova 2.2.1 → 2.2.3
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 +6 -7
- package/dist/index.js +63 -76
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
Cradova is a JavaScript framework for building Single Page Applications and PWAs.
|
|
11
11
|
<br/>
|
|
12
12
|
<br/>
|
|
13
|
-
<a href="https://github.com/fridaycandour/cradova#examples"><strong>Explore the docs »</strong></a>
|
|
13
|
+
<a href="https://github.com/fridaycandour/cradova#examples"><strong>Explore the 🎙️ docs »</strong></a>
|
|
14
14
|
<br/>
|
|
15
15
|
<br/>
|
|
16
16
|
<a href="https://t.me/cradovaframework">Join Community</a>
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
|
|
40
40
|
## What is Cradova?
|
|
41
41
|
|
|
42
|
-
Cradova is a
|
|
42
|
+
Cradova is a web development framework for building Single Page Applications and PWAs.
|
|
43
43
|
|
|
44
|
-
It's a fast and
|
|
44
|
+
It's a fast, simple and modern, it provides state management, routing system and a rest API utility out of the box.
|
|
45
45
|
|
|
46
46
|
Cradova follows the [VJS specification](https://github.com/fridaycandour/cradova/blob/main/spec.md)
|
|
47
47
|
|
|
@@ -53,10 +53,9 @@ Cradova does't rely on visual DOM or diff algorithms to manage the DOM, instead,
|
|
|
53
53
|
|
|
54
54
|
### is this a big benefit?
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
see for yourself.
|
|
56
|
+
Undoubtedly, this provides a significant advantage. You can experience it firsthand and decide for yourself.
|
|
58
57
|
|
|
59
|
-
Cradova has been
|
|
58
|
+
Cradova has already been utilized in multiple production projects, and we will continuously update this page to showcase our advancements as we keep improving.
|
|
60
59
|
|
|
61
60
|
[current version changes](https://github.com/fridaycandour/cradova/blob/main/CHANGELOG.md#v220)
|
|
62
61
|
|
|
@@ -278,7 +277,7 @@ Router.route("/", home);
|
|
|
278
277
|
|
|
279
278
|
## Documentation
|
|
280
279
|
|
|
281
|
-
|
|
280
|
+
At the moment, we're in the process of creating documentation for Cradova, and we have limited resources. If you're interested in lending a hand, we invite you to join our community, gain firsthand experience, and contribute to the advancement of Cradova.
|
|
282
281
|
|
|
283
282
|
## Getting Help
|
|
284
283
|
|
package/dist/index.js
CHANGED
|
@@ -757,7 +757,10 @@ RouterBox.router = async function(e, force = false) {
|
|
|
757
757
|
RouterBox["lastNavigatedRouteController"] = route;
|
|
758
758
|
RouterBox["pageShow"] && RouterBox["pageShow"](url);
|
|
759
759
|
} catch (error) {
|
|
760
|
-
|
|
760
|
+
let errorHandler;
|
|
761
|
+
if (RouterBox.routes[RouterBox.params.params._path]) {
|
|
762
|
+
errorHandler = RouterBox.routes[RouterBox.params.params._path].errorHandler || RouterBox.errorHandler;
|
|
763
|
+
}
|
|
761
764
|
if (errorHandler) {
|
|
762
765
|
errorHandler(error);
|
|
763
766
|
}
|
|
@@ -792,7 +795,7 @@ Router["onPageHide"] = function(callback) {
|
|
|
792
795
|
);
|
|
793
796
|
}
|
|
794
797
|
};
|
|
795
|
-
Router.packageScreen = async function(path, data2) {
|
|
798
|
+
Router.packageScreen = async function(path, data2 = {}) {
|
|
796
799
|
if (!RouterBox.routes[path]) {
|
|
797
800
|
console.error(" \u2718 Cradova err: no screen with path " + path);
|
|
798
801
|
throw new Error(" \u2718 Cradova err: cradova err: Not a defined screen path");
|
|
@@ -1039,7 +1042,6 @@ var menu = cra("menu");
|
|
|
1039
1042
|
var meta = cra("meta");
|
|
1040
1043
|
var meter = cra("meter");
|
|
1041
1044
|
var nav = cra("nav");
|
|
1042
|
-
var noscript = cra("noscript");
|
|
1043
1045
|
var object = cra("object");
|
|
1044
1046
|
var ol = cra("ol");
|
|
1045
1047
|
var optgroup = cra("optgroup");
|
|
@@ -1285,77 +1287,63 @@ var Screen = class {
|
|
|
1285
1287
|
|
|
1286
1288
|
// lib/index.ts
|
|
1287
1289
|
var make = function(txx) {
|
|
1288
|
-
if (!txx) {
|
|
1289
|
-
return
|
|
1290
|
-
|
|
1291
|
-
|
|
1290
|
+
if (!txx.length) {
|
|
1291
|
+
return ["DIV"];
|
|
1292
|
+
}
|
|
1293
|
+
if (Array.isArray(txx)) {
|
|
1294
|
+
txx = txx[0];
|
|
1292
1295
|
}
|
|
1293
|
-
let tag;
|
|
1294
1296
|
let innerValue = "";
|
|
1295
1297
|
if (txx.includes("|")) {
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
}
|
|
1300
|
-
const itemsPurifier = () => {
|
|
1301
|
-
if (!txx.includes("#")) {
|
|
1302
|
-
txx = txx.split(".");
|
|
1303
|
-
tag = txx[0];
|
|
1304
|
-
if (tag) {
|
|
1305
|
-
txx.shift();
|
|
1306
|
-
} else {
|
|
1307
|
-
tag = "div";
|
|
1308
|
-
}
|
|
1309
|
-
return [txx, []];
|
|
1310
|
-
} else {
|
|
1311
|
-
if (!txx.includes(".")) {
|
|
1312
|
-
txx = txx.split("#");
|
|
1313
|
-
tag = txx[0];
|
|
1314
|
-
if (tag) {
|
|
1315
|
-
txx.shift();
|
|
1316
|
-
} else {
|
|
1317
|
-
tag = "div";
|
|
1318
|
-
}
|
|
1319
|
-
if (txx[0].includes(" ")) {
|
|
1320
|
-
txx = [txx[0].split(" ")[1]];
|
|
1321
|
-
}
|
|
1322
|
-
return [[], txx];
|
|
1323
|
-
}
|
|
1298
|
+
[txx, innerValue] = txx.split("|");
|
|
1299
|
+
if (!txx) {
|
|
1300
|
+
return ["P", void 0, void 0, innerValue];
|
|
1324
1301
|
}
|
|
1302
|
+
}
|
|
1303
|
+
let tag;
|
|
1304
|
+
if (!txx.includes("#")) {
|
|
1325
1305
|
txx = txx.split(".");
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1306
|
+
tag = txx.shift();
|
|
1307
|
+
if (!tag) {
|
|
1308
|
+
tag = "DIV";
|
|
1309
|
+
}
|
|
1310
|
+
return [tag, void 0, txx.join(" "), innerValue];
|
|
1311
|
+
} else {
|
|
1312
|
+
if (!txx.includes(".")) {
|
|
1313
|
+
txx = txx.split("#");
|
|
1314
|
+
tag = txx.shift();
|
|
1315
|
+
if (!tag) {
|
|
1316
|
+
tag = "DIV";
|
|
1317
|
+
}
|
|
1318
|
+
if (txx[0].includes(" ")) {
|
|
1319
|
+
txx = [txx[0].split(" ")[1]];
|
|
1320
|
+
}
|
|
1321
|
+
return [tag, txx[0], void 0, innerValue];
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
txx = txx.split(".");
|
|
1325
|
+
const classes = [];
|
|
1326
|
+
const IDs = [];
|
|
1327
|
+
tag = !txx[0].includes("#") && txx.shift();
|
|
1328
|
+
if (!tag) {
|
|
1329
|
+
tag = "DIV";
|
|
1330
|
+
}
|
|
1331
|
+
for (let i2 = 0; i2 < txx.length; i2++) {
|
|
1332
|
+
if (txx[i2].includes("#")) {
|
|
1333
|
+
const item = txx[i2].split("#");
|
|
1334
|
+
IDs.push(item[1]);
|
|
1335
|
+
if (i2 === 0) {
|
|
1336
|
+
tag = item[0];
|
|
1341
1337
|
continue;
|
|
1342
1338
|
}
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
if (!tag) {
|
|
1346
|
-
tag = "div";
|
|
1339
|
+
classes.push(item[0]);
|
|
1340
|
+
continue;
|
|
1347
1341
|
}
|
|
1348
|
-
|
|
1349
|
-
}
|
|
1350
|
-
|
|
1351
|
-
const ID = ids && ids[0];
|
|
1352
|
-
const className = classes && classes.join(" ");
|
|
1353
|
-
return { tag, className, ID, innerValue };
|
|
1342
|
+
classes.push(txx[i2]);
|
|
1343
|
+
}
|
|
1344
|
+
return [tag || "DIV", IDs[0], classes.join(" "), innerValue];
|
|
1354
1345
|
};
|
|
1355
1346
|
var _2 = (...element_initials) => {
|
|
1356
|
-
if (element_initials[0].raw) {
|
|
1357
|
-
element_initials[0] = element_initials["raw"][0];
|
|
1358
|
-
}
|
|
1359
1347
|
if (typeof element_initials[0] !== "string") {
|
|
1360
1348
|
return frag(element_initials);
|
|
1361
1349
|
}
|
|
@@ -1363,29 +1351,29 @@ var _2 = (...element_initials) => {
|
|
|
1363
1351
|
let props = void 0;
|
|
1364
1352
|
let element;
|
|
1365
1353
|
try {
|
|
1366
|
-
element = document.createElement(initials
|
|
1354
|
+
element = document.createElement(initials[0]);
|
|
1367
1355
|
} catch (error) {
|
|
1368
|
-
throw new TypeError(" \u2718 Cradova err: invalid tag given " + initials
|
|
1356
|
+
throw new TypeError(" \u2718 Cradova err: invalid tag given " + initials[0]);
|
|
1369
1357
|
}
|
|
1370
|
-
if (initials
|
|
1358
|
+
if (initials[2]) {
|
|
1371
1359
|
if (props) {
|
|
1372
|
-
props["className"] = initials
|
|
1360
|
+
props["className"] = initials[2];
|
|
1373
1361
|
} else {
|
|
1374
|
-
props = { className: initials
|
|
1362
|
+
props = { className: initials[2] };
|
|
1375
1363
|
}
|
|
1376
1364
|
}
|
|
1377
|
-
if (initials
|
|
1365
|
+
if (initials[1]) {
|
|
1378
1366
|
if (props) {
|
|
1379
|
-
props["id"] = initials
|
|
1367
|
+
props["id"] = initials[1];
|
|
1380
1368
|
} else {
|
|
1381
|
-
props = { id: initials
|
|
1369
|
+
props = { id: initials[1] };
|
|
1382
1370
|
}
|
|
1383
1371
|
}
|
|
1384
|
-
if (initials
|
|
1372
|
+
if (initials[3]) {
|
|
1385
1373
|
if (props) {
|
|
1386
|
-
props["innerText"] = initials
|
|
1374
|
+
props["innerText"] = initials[3];
|
|
1387
1375
|
} else {
|
|
1388
|
-
props = { innerText: initials
|
|
1376
|
+
props = { innerText: initials[3] };
|
|
1389
1377
|
}
|
|
1390
1378
|
}
|
|
1391
1379
|
return makeElement(element, props, ...element_initials);
|
|
@@ -1473,7 +1461,6 @@ export {
|
|
|
1473
1461
|
meta,
|
|
1474
1462
|
meter,
|
|
1475
1463
|
nav,
|
|
1476
|
-
noscript,
|
|
1477
1464
|
object,
|
|
1478
1465
|
ol,
|
|
1479
1466
|
optgroup,
|