mount-observer 0.0.109 → 0.0.111

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/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "mount-observer",
3
- "version": "0.0.109",
3
+ "version": "0.0.111",
4
4
  "description": "Observe and act on css matches.",
5
5
  "main": "MountObserver.js",
6
6
  "module": "MountObserver.js",
7
7
  "devDependencies": {
8
- "@playwright/test": "1.56.1",
8
+ "@playwright/test": "1.57.0",
9
9
  "spa-ssi": "0.0.25"
10
10
  },
11
11
  "exports": {
@@ -41,6 +41,10 @@
41
41
  "default": "./doCleanup.js",
42
42
  "types": "./doCleanup.ts"
43
43
  },
44
+ "./upShadowSearch.js": {
45
+ "default": "./upShadowSearch.js",
46
+ "types": "./upShadowSearch.ts"
47
+ },
44
48
  "./waitForEvent.js": {
45
49
  "default": "./waitForEvent.js",
46
50
  "types": "./waitForEvent.ts"
package/refid/ism.js CHANGED
@@ -9,10 +9,10 @@ Object.defineProperty(HTMLElement.prototype, 'ism', {
9
9
  }
10
10
  });
11
11
  const parsedItempropMaps = new WeakMap();
12
- export function parse(el, obj = {}, scopedLists = {}) {
12
+ export function parse(el, scope = {}, scopedLists = {}) {
13
13
  const itemprop = el.getAttribute('itemprop');
14
14
  if (itemprop) {
15
- obj[itemprop] = stdVal(el); //TODO full logic
15
+ scope[itemprop] = stdVal(el); //TODO full logic
16
16
  }
17
17
  const itempropmap = el.getAttribute('itempropmap');
18
18
  if (itempropmap) {
@@ -31,34 +31,32 @@ export function parse(el, obj = {}, scopedLists = {}) {
31
31
  const rhs = parsed[key];
32
32
  switch (typeof rhs) {
33
33
  case 'string':
34
- obj[rhs] = attr;
34
+ scope[rhs] = attr;
35
35
  break;
36
36
  case 'object':
37
37
  const { instanceOf, mapsTo } = rhs;
38
38
  switch (instanceOf) {
39
39
  case 'Number':
40
40
  case Number:
41
- obj[mapsTo] = Number(attr);
41
+ scope[mapsTo] = Number(attr);
42
42
  break;
43
43
  case 'Object':
44
44
  case Object:
45
45
  case 'Boolean':
46
46
  case Boolean:
47
- obj[mapsTo] = JSON.parse(attr);
47
+ scope[mapsTo] = JSON.parse(attr);
48
48
  break;
49
49
  }
50
50
  }
51
51
  }
52
52
  }
53
- //el.ish = obj;
54
53
  const children = Array.from(el.children);
55
- //const isItemScoped = el.hasAttribute('itemscope');
56
54
  let itemscopeMapToPass = scopedLists;
57
55
  for (const child of children) {
58
56
  if (!(child instanceof HTMLElement))
59
57
  continue;
60
58
  const childHasItemScopeAttr = child.hasAttribute('itemscope');
61
- const objToPass = childHasItemScopeAttr ? {} : obj;
59
+ const objToPass = childHasItemScopeAttr ? {} : scope;
62
60
  if (childHasItemScopeAttr) {
63
61
  itemscopeMapToPass = {};
64
62
  }
@@ -73,11 +71,8 @@ export function parse(el, obj = {}, scopedLists = {}) {
73
71
  }
74
72
  }
75
73
  }
76
- // if(itemscopeMap){
77
- // el.ism = itemscopeMap;
78
- // }
79
74
  return {
80
- obj,
75
+ scope,
81
76
  scopedLists
82
77
  };
83
78
  }
package/refid/ism.ts CHANGED
@@ -13,10 +13,10 @@ type ScopedLists = {[key: string] : any[]}
13
13
 
14
14
  const parsedItempropMaps = new WeakMap<HTMLScriptElement, any>();
15
15
 
16
- export function parse(el: HTMLElement, obj: any = {}, scopedLists: ScopedLists = {}){
16
+ export function parse(el: HTMLElement, scope: any = {}, scopedLists: ScopedLists = {}){
17
17
  const itemprop = el.getAttribute('itemprop');
18
18
  if(itemprop){
19
- obj[itemprop] = stdVal(el); //TODO full logic
19
+ scope[itemprop] = stdVal(el); //TODO full logic
20
20
  }
21
21
  const itempropmap = el.getAttribute('itempropmap');
22
22
  if(itempropmap){
@@ -33,20 +33,20 @@ export function parse(el: HTMLElement, obj: any = {}, scopedLists: ScopedLists =
33
33
  const rhs = parsed[key];
34
34
  switch(typeof rhs){
35
35
  case 'string':
36
- obj[rhs] = attr;
36
+ scope[rhs] = attr;
37
37
  break;
38
38
  case 'object':
39
39
  const {instanceOf, mapsTo} = rhs;
40
40
  switch(instanceOf){
41
41
  case 'Number':
42
42
  case Number:
43
- obj[mapsTo] = Number(attr);
43
+ scope[mapsTo] = Number(attr);
44
44
  break;
45
45
  case 'Object':
46
46
  case Object:
47
47
  case 'Boolean':
48
48
  case Boolean:
49
- obj[mapsTo] = JSON.parse(attr);
49
+ scope[mapsTo] = JSON.parse(attr);
50
50
  break;
51
51
 
52
52
 
@@ -55,14 +55,12 @@ export function parse(el: HTMLElement, obj: any = {}, scopedLists: ScopedLists =
55
55
  }
56
56
 
57
57
  }
58
- //el.ish = obj;
59
58
  const children = Array.from(el.children);
60
- //const isItemScoped = el.hasAttribute('itemscope');
61
59
  let itemscopeMapToPass = scopedLists;
62
60
  for(const child of children){
63
61
  if(!(child instanceof HTMLElement)) continue;
64
62
  const childHasItemScopeAttr = child.hasAttribute('itemscope')
65
- const objToPass = childHasItemScopeAttr ? {} : obj;
63
+ const objToPass = childHasItemScopeAttr ? {} : scope;
66
64
  if(childHasItemScopeAttr) {
67
65
  itemscopeMapToPass = {};
68
66
  }
@@ -76,11 +74,8 @@ export function parse(el: HTMLElement, obj: any = {}, scopedLists: ScopedLists =
76
74
  }
77
75
  }
78
76
  }
79
- // if(itemscopeMap){
80
- // el.ism = itemscopeMap;
81
- // }
82
77
  return {
83
- obj,
78
+ scope,
84
79
  scopedLists
85
80
  };
86
81
  }
@@ -0,0 +1,18 @@
1
+ import {IEnhancement, BEAllProps, EMC} from '../trans-render/be/types';
2
+
3
+ export interface EndUserProps extends IEnhancement{
4
+ }
5
+
6
+ export interface AllProps extends EndUserProps{
7
+ }
8
+
9
+ export type AP = AllProps;
10
+
11
+ export type PAP = Partial<AP>;
12
+
13
+ export type ProPAP = Promise<PAP>;
14
+
15
+ export type BAP = AP & BEAllProps;
16
+
17
+ export interface Actions{
18
+ }