cradova 2.2.0 → 2.2.2
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 +20 -13
- 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
|
@@ -263,9 +263,9 @@ var Ref = class {
|
|
|
263
263
|
window.removeEventListener("cradova-aftermount", av);
|
|
264
264
|
};
|
|
265
265
|
window.addEventListener("cradova-aftermount", av);
|
|
266
|
+
this.effector();
|
|
266
267
|
this.published = true;
|
|
267
268
|
this.rendered = true;
|
|
268
|
-
this.effector();
|
|
269
269
|
if (!element) {
|
|
270
270
|
element = this.preRendered;
|
|
271
271
|
}
|
|
@@ -757,7 +757,7 @@ RouterBox.router = async function(e, force = false) {
|
|
|
757
757
|
RouterBox["lastNavigatedRouteController"] = route;
|
|
758
758
|
RouterBox["pageShow"] && RouterBox["pageShow"](url);
|
|
759
759
|
} catch (error) {
|
|
760
|
-
const errorHandler = RouterBox.routes[RouterBox.params.params.
|
|
760
|
+
const errorHandler = RouterBox.routes[RouterBox.params.params._path].errorHandler || RouterBox.errorHandler;
|
|
761
761
|
if (errorHandler) {
|
|
762
762
|
errorHandler(error);
|
|
763
763
|
}
|
|
@@ -797,11 +797,11 @@ Router.packageScreen = async function(path, data2) {
|
|
|
797
797
|
console.error(" \u2718 Cradova err: no screen with path " + path);
|
|
798
798
|
throw new Error(" \u2718 Cradova err: cradova err: Not a defined screen path");
|
|
799
799
|
}
|
|
800
|
-
|
|
801
|
-
if (!route._Activate && typeof route
|
|
802
|
-
route
|
|
800
|
+
let [route, params] = checker(path);
|
|
801
|
+
if (!route._Activate && typeof route === "function") {
|
|
802
|
+
route = await route();
|
|
803
803
|
}
|
|
804
|
-
route.
|
|
804
|
+
route._package(Object.assign(data2, params || {}));
|
|
805
805
|
route._packed = true;
|
|
806
806
|
};
|
|
807
807
|
Router.getParams = function() {
|
|
@@ -837,9 +837,14 @@ var makeElement = (element, ...ElementChildrenAndPropertyList) => {
|
|
|
837
837
|
child = child();
|
|
838
838
|
}
|
|
839
839
|
}
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
840
|
+
try {
|
|
841
|
+
if (isNode(child)) {
|
|
842
|
+
element.appendChild(child);
|
|
843
|
+
continue;
|
|
844
|
+
}
|
|
845
|
+
} catch (error) {
|
|
846
|
+
console.log(element, ElementChildrenAndPropertyList);
|
|
847
|
+
console.log(error);
|
|
843
848
|
}
|
|
844
849
|
if (Array.isArray(child)) {
|
|
845
850
|
element.appendChild(Rhoda(child));
|
|
@@ -961,10 +966,12 @@ var makeElement = (element, ...ElementChildrenAndPropertyList) => {
|
|
|
961
966
|
return element;
|
|
962
967
|
};
|
|
963
968
|
var cra = (element_initials) => {
|
|
964
|
-
return
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
969
|
+
return (...bo) => {
|
|
970
|
+
return makeElement(
|
|
971
|
+
document.createElement(element_initials),
|
|
972
|
+
...bo
|
|
973
|
+
);
|
|
974
|
+
};
|
|
968
975
|
};
|
|
969
976
|
var a = cra("a");
|
|
970
977
|
var abbr = cra("abbr");
|