@duckafire/html.js 0.0.2-1 → 0.0.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 -6
- package/html.min.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ This is a web component library, thought to be:
|
|
|
17
17
|
Just copy and paste this code chunk in your HTML file:
|
|
18
18
|
|
|
19
19
|
``` html
|
|
20
|
-
<script src="https://cdn.jsdelivr.net/npm/@duckafire/html.js@0.0.2/html.min.js"></script>
|
|
20
|
+
<script src="https://cdn.jsdelivr.net/npm/@duckafire/html.js@0.0.2-3/html.min.js"></script>
|
|
21
21
|
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -28,12 +28,12 @@ After this, run the JavaScript code below:
|
|
|
28
28
|
|
|
29
29
|
``` html
|
|
30
30
|
<script>
|
|
31
|
-
|
|
31
|
+
declare_htmljs();
|
|
32
32
|
</script>
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
> [!NOTE]
|
|
36
|
-
> See more about `
|
|
36
|
+
> See more about `declare_htmljs` [here](#start-library).
|
|
37
37
|
|
|
38
38
|
## How to use
|
|
39
39
|
|
|
@@ -42,7 +42,7 @@ After this, run the JavaScript code below:
|
|
|
42
42
|
As mentioned earlier on, it is necessary call the functions bellow to
|
|
43
43
|
start the library:
|
|
44
44
|
|
|
45
|
-
* `{}
|
|
45
|
+
* `{} declare_htmljs( [prefix: string = ""], [createObject: boolean = false] )`
|
|
46
46
|
* `prefix`: prefixs the name of the functions/methods that are
|
|
47
47
|
used to create the elements.
|
|
48
48
|
* `createObject`: specifics that the methods have to be declared
|
|
@@ -89,8 +89,8 @@ will explain their structure.
|
|
|
89
89
|
string, a *text node* will added to the element.
|
|
90
90
|
* `closeTag`: an optional thing, to explicit the end of the element creation. I
|
|
91
91
|
recommend that it to be equal the itself function (like the previous
|
|
92
|
-
example). See [this](#closing-the-element-creation) to learn how to
|
|
93
|
-
this optional parameter.
|
|
92
|
+
example). See [this](#closing-the-element-creation) to learn how to
|
|
93
|
+
disable this optional parameter.
|
|
94
94
|
|
|
95
95
|
> [!IMPORTANT]
|
|
96
96
|
> Deprecated tags are not available.
|
package/html.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";let __htmljs_ignore_last__=1;const __HTMLJS_FIRST_CONTAINER_TAG_ID__=12,__htmljs_is_not_object__=t=>"object"!=typeof t||Array.isArray(t),__htmljs_element_tags__=["area","base","br","col","hr","img","input","link","meta","source","track","wbr","a","abbr","address","article","audio","b","bdi","bdo","blockquote","body","button","canvas","caption","cite","code","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","html","i","iframe","ins","kbd","label","legend","li","main","map","mark","meter","nav","noscript","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","samp","script","section","select","small","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","ul","var","video"],__htmljs_core__=(t,e,..._)=>{const o=document.createElement(t);if(void 0!==e){let t="";const r=_.length-__htmljs_ignore_last__;if(null!==e){if(__htmljs_is_not_object__(e))throw new TypeError(`Excepting Object to \`htmlProperties\`, instead "${typeof e}".`);for(const t in e)o[t]=e[t]}for(let e=0;e<r;e++)if("string"!=typeof _[e]){if(__htmljs_is_not_object__(_[e]))throw new TypeError(`Excepting Object or String to \`children[${e}]\`, instead "${typeof _[e]}".`);""!=t&&(o.appendChild(document.createTextNode(t)),t="");try{o.appendChild(_[e])}catch(t){console.error(t);break}}else t+=(""==t?"":" ")+_[e];null!==t&&o.appendChild(document.createTextNode(t))}return o},htmljs_set_ignore_last=t=>{__htmljs_ignore_last__=t?1:0},declare_htmljs=(t,e)=>{const _=e?{}:window,o=t||"";return __htmljs_element_tags__.forEach((t,e)=>{_[o+t]=e<12?e=>__htmljs_core__(t,e):(e,..._)=>__htmljs_core__(t,e,..._)}),_};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duckafire/html.js",
|
|
3
3
|
"author": "duckafire",
|
|
4
|
-
"version": "0.0.2-
|
|
4
|
+
"version": "0.0.2-3",
|
|
5
5
|
"license": "Zlib",
|
|
6
6
|
"description": "Just a very simple components library.",
|
|
7
7
|
"keywords": ["front-end", "client", "html", "dom", "light", "components", "web", "simple", "minimalist", "easy"],
|