@cocreate/utils 1.10.21 → 1.10.23
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 +14 -0
- package/package.json +2 -2
- package/src/index.js +6 -6
- package/src/index.old.js +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.10.23](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.10.22...v1.10.23) (2022-11-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* bump depenedencies ([9b4eb69](https://github.com/CoCreate-app/CoCreate-utils/commit/9b4eb69f42919ec31dfcd2dc7aaff651b645c8d6))
|
|
7
|
+
|
|
8
|
+
## [1.10.22](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.10.21...v1.10.22) (2022-11-23)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bumped [@cocreate](https://github.com/cocreate) dependencies ([1df48f4](https://github.com/CoCreate-app/CoCreate-utils/commit/1df48f4dcf4cea3242306d9f1db7b45a4d106adf))
|
|
14
|
+
|
|
1
15
|
## [1.10.21](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.10.20...v1.10.21) (2022-11-22)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/utils",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.23",
|
|
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.4.
|
|
64
|
+
"@cocreate/docs": "^1.4.3"
|
|
65
65
|
}
|
|
66
66
|
}
|
package/src/index.js
CHANGED
|
@@ -81,7 +81,7 @@ export function cssPath(node, container) {
|
|
|
81
81
|
}
|
|
82
82
|
else {
|
|
83
83
|
// let eid = node.getAttribute('eid');
|
|
84
|
-
// if(/{{\s*([\w\W]+)\s*}}/g.test(eid)) {
|
|
84
|
+
// if (/{{\s*([\w\W]+)\s*}}/g.test(eid)) {
|
|
85
85
|
// eid = false;
|
|
86
86
|
// }
|
|
87
87
|
// if (eid) {
|
|
@@ -165,12 +165,12 @@ export function queryDocumentSelectorAll(selector) {
|
|
|
165
165
|
|
|
166
166
|
if (selector) {
|
|
167
167
|
let selectors = [selector];
|
|
168
|
-
if(selector.indexOf(',') !== -1){
|
|
168
|
+
if (selector.indexOf(',') !== -1){
|
|
169
169
|
selectors = selector.split(',');
|
|
170
170
|
}
|
|
171
171
|
for (let selector of selectors){
|
|
172
172
|
let els;
|
|
173
|
-
if(selector.indexOf(';') !== -1) {
|
|
173
|
+
if (selector.indexOf(';') !== -1) {
|
|
174
174
|
let targetDocument;
|
|
175
175
|
let [documentSelector, targetSelector] = selector.split(';');
|
|
176
176
|
if (['parent', 'parentDocument'].includes(documentSelector))
|
|
@@ -202,12 +202,12 @@ export function queryDocumentSelectorAll(selector) {
|
|
|
202
202
|
export function queryDocumentSelector(selector) {
|
|
203
203
|
if (selector) {
|
|
204
204
|
let selectors = [selector];
|
|
205
|
-
if(selector.indexOf(',') !== -1){
|
|
205
|
+
if (selector.indexOf(',') !== -1){
|
|
206
206
|
selectors = selector.split(',');
|
|
207
207
|
}
|
|
208
208
|
for (let selector of selectors){
|
|
209
209
|
let el;
|
|
210
|
-
if(selector.indexOf(';') !== -1) {
|
|
210
|
+
if (selector.indexOf(';') !== -1) {
|
|
211
211
|
let targetDocument;
|
|
212
212
|
let [documentSelector, targetSelector] = selector.split(';');
|
|
213
213
|
if (['parent', 'parentDocument'].includes(documentSelector))
|
|
@@ -247,7 +247,7 @@ export function queryDocumentSelector(selector) {
|
|
|
247
247
|
// let parentElement;
|
|
248
248
|
// do {
|
|
249
249
|
// parentElement = element.parentElement.closest(selectors);
|
|
250
|
-
// if(parentElement) {
|
|
250
|
+
// if (parentElement) {
|
|
251
251
|
// element = parentElement;
|
|
252
252
|
// } else {
|
|
253
253
|
// return element;
|
package/src/index.old.js
CHANGED
|
@@ -322,12 +322,12 @@ export function frameQuerySelectorAll(comSelector) {
|
|
|
322
322
|
async function complexSelector(comSelector, callback) {
|
|
323
323
|
let [canvasSelector, selector] = comSelector.split(';');
|
|
324
324
|
let canvas = document.querySelector(canvasSelector);
|
|
325
|
-
if(!canvas) {
|
|
325
|
+
if (!canvas) {
|
|
326
326
|
console.warn('complex selector canvas now found for', comSelector);
|
|
327
327
|
return;
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
-
if(canvas.contentDocument.readyState === 'loading') {
|
|
330
|
+
if (canvas.contentDocument.readyState === 'loading') {
|
|
331
331
|
try {
|
|
332
332
|
await new Promise((resolve, reject) => {
|
|
333
333
|
canvas.contentWindow.addEventListener('load', (e) => resolve());
|
|
@@ -338,7 +338,7 @@ async function complexSelector(comSelector, callback) {
|
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
-
if(canvas.contentWindow.parent.CoCreate.observer && !observerInit.has(canvas.contentWindow)) {
|
|
341
|
+
if (canvas.contentWindow.parent.CoCreate.observer && !observerInit.has(canvas.contentWindow)) {
|
|
342
342
|
observerElements(canvas.contentWindow);
|
|
343
343
|
}
|
|
344
344
|
|
|
@@ -375,12 +375,12 @@ async function complexSelector(comSelector, callback) {
|
|
|
375
375
|
let selectorArray = [];
|
|
376
376
|
if (selector) {
|
|
377
377
|
let selectors = [selector];
|
|
378
|
-
if(selector.indexOf(',') !== -1){
|
|
378
|
+
if (selector.indexOf(',') !== -1){
|
|
379
379
|
selectors = selector.split(',');
|
|
380
380
|
}
|
|
381
381
|
for (let selector of selectors){
|
|
382
382
|
let els;
|
|
383
|
-
if(selector.indexOf(';') !== -1) {
|
|
383
|
+
if (selector.indexOf(';') !== -1) {
|
|
384
384
|
let [documentSelector, targetSelector] = selector.split(';');
|
|
385
385
|
let frame = document.querySelector(documentSelector);
|
|
386
386
|
if (frame)
|
|
@@ -397,12 +397,12 @@ async function complexSelector(comSelector, callback) {
|
|
|
397
397
|
|
|
398
398
|
if (selector) {
|
|
399
399
|
let selectors = [selector];
|
|
400
|
-
if(selector.indexOf(',') !== -1){
|
|
400
|
+
if (selector.indexOf(',') !== -1){
|
|
401
401
|
selectors = selector.split(',');
|
|
402
402
|
}
|
|
403
403
|
for (let selector of selectors){
|
|
404
404
|
let els;
|
|
405
|
-
if(selector.indexOf(';') !== -1) {
|
|
405
|
+
if (selector.indexOf(';') !== -1) {
|
|
406
406
|
let [documentSelector, targetSelector] = selector.split(';');
|
|
407
407
|
let frame = document.querySelector(documentSelector);
|
|
408
408
|
if (frame) {
|