@cocreate/utils 1.7.4 → 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 +7 -0
- package/package.json +1 -1
- package/src/index.js +22 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
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
|
+
|
|
1
8
|
## [1.7.4](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.7.3...v1.7.4) (2022-06-18)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
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) {
|