@cocreate/utils 1.7.2 → 1.7.5
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/CHANGELOG.md +22 -0
- package/docs/index.html +1 -1
- package/package.json +2 -2
- package/src/index.js +22 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## [1.7.5](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.7.4...v1.7.5) (2022-06-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* check path for character < if exist clean up path to mak it in to a valid selector ([9321063](https://github.com/CoCreate-app/CoCreate-utils/commit/93210634425db2dff507919dd32415f0d7bdfc95))
|
|
7
|
+
|
|
8
|
+
## [1.7.4](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.7.3...v1.7.4) (2022-06-18)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bump dependencies ([779f302](https://github.com/CoCreate-app/CoCreate-utils/commit/779f3026942bded821eb58ed0631c254494ba9ab))
|
|
14
|
+
|
|
15
|
+
## [1.7.3](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.7.2...v1.7.3) (2022-06-12)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* update dependencies ([925855d](https://github.com/CoCreate-app/CoCreate-utils/commit/925855da986c61f700642657e27a4dca8a461d64))
|
|
21
|
+
* update docs css document_id ([cec8894](https://github.com/CoCreate-app/CoCreate-utils/commit/cec8894132d8d47eac5b0857fdcfd793ec97e6a2))
|
|
22
|
+
|
|
1
23
|
## [1.7.2](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.7.1...v1.7.2) (2022-05-23)
|
|
2
24
|
|
|
3
25
|
|
package/docs/index.html
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
<!-- CoCreate CSS -->
|
|
15
15
|
<link rel="stylesheet" href="https://cdn.cocreate.app/latest/CoCreate.min.css" type="text/css"/>
|
|
16
|
-
<link rel="stylesheet" href="/docs/index.css" collection="files" document_id="
|
|
16
|
+
<link rel="stylesheet" href="/docs/index.css" collection="files" document_id="60888216117c640e7596303f" name="src" type="text/css" save="true"/>
|
|
17
17
|
</head>
|
|
18
18
|
|
|
19
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/utils",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.5",
|
|
4
4
|
"description": "A simple utils component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"utils",
|
|
@@ -61,6 +61,6 @@
|
|
|
61
61
|
"webpack-log": "^3.0.1"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@cocreate/docs": "^1.3.
|
|
64
|
+
"@cocreate/docs": "^1.3.3"
|
|
65
65
|
}
|
|
66
66
|
}
|
package/src/index.js
CHANGED
|
@@ -47,15 +47,15 @@ export function cssPath(node, container) {
|
|
|
47
47
|
node = '';
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
|
-
let eid = node.getAttribute('eid');
|
|
51
|
-
if(/{{\s*([\w\W]+)\s*}}/g.test(eid)) {
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
if (eid) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
50
|
+
// let eid = node.getAttribute('eid');
|
|
51
|
+
// if(/{{\s*([\w\W]+)\s*}}/g.test(eid)) {
|
|
52
|
+
// eid = false;
|
|
53
|
+
// }
|
|
54
|
+
// if (eid) {
|
|
55
|
+
// pathSplit += `[eid="${eid}"]`;
|
|
56
|
+
// node = '';
|
|
57
|
+
// }
|
|
58
|
+
// else {
|
|
59
59
|
// if (node.classList.length) {
|
|
60
60
|
// node.classList.forEach((item) => {
|
|
61
61
|
// if (item.indexOf(":") === -1) pathSplit += "." + item;
|
|
@@ -85,10 +85,21 @@ export function cssPath(node, container) {
|
|
|
85
85
|
if (node == null || node.tagName == "HTML" || node.tagName == "DOM-PARSER" || node.nodeName == "#document" || node.hasAttribute('contenteditable'))
|
|
86
86
|
node = '';
|
|
87
87
|
}
|
|
88
|
-
}
|
|
88
|
+
// }
|
|
89
89
|
pathSplits.unshift(pathSplit);
|
|
90
90
|
} while (node);
|
|
91
|
-
|
|
91
|
+
let path = pathSplits.join(" > ")
|
|
92
|
+
if (path && path.includes('<')) {
|
|
93
|
+
let index = path.lastIndexOf(' >')
|
|
94
|
+
if (index != -1)
|
|
95
|
+
path = path.slice(0, index)
|
|
96
|
+
else{
|
|
97
|
+
index = path.lastIndexOf('<')
|
|
98
|
+
path = path.slice(0, index)
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return path;
|
|
92
103
|
}
|
|
93
104
|
|
|
94
105
|
export function domParser(str) {
|