mount-observer 0.0.91 → 0.0.93
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/MountObserver.js +1 -0
- package/MountObserver.ts +1 -0
- package/package.json +2 -2
- package/refid/hostish.js +17 -0
- package/refid/hostish.ts +18 -0
- package/ts-refs/trans-render/dss/types.d.ts +3 -0
package/MountObserver.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RootMutObs } from './RootMutObs.js';
|
|
2
2
|
import { bindish, bindishIt } from './bindish.js';
|
|
3
|
+
import './refid/hostish.js';
|
|
3
4
|
export const guid = '5Pv6bHOVH0ae07opRZ8N/g';
|
|
4
5
|
export const wasItemReffed = Symbol.for('8aA6xB8+PkScmivaslBk5Q');
|
|
5
6
|
export const mutationObserverLookup = new WeakMap();
|
package/MountObserver.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {MountInit, IMountObserver, AddMutationEventListener,
|
|
|
9
9
|
} from './ts-refs/mount-observer/types';
|
|
10
10
|
import {RootMutObs} from './RootMutObs.js';
|
|
11
11
|
import {bindish, bindishIt} from './bindish.js';
|
|
12
|
+
import './refid/hostish.js';
|
|
12
13
|
export {MOSE} from './ts-refs/mount-observer/types';
|
|
13
14
|
export const guid = '5Pv6bHOVH0ae07opRZ8N/g';
|
|
14
15
|
export const wasItemReffed = Symbol.for('8aA6xB8+PkScmivaslBk5Q');
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mount-observer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.93",
|
|
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.
|
|
8
|
+
"@playwright/test": "1.55.0",
|
|
9
9
|
"ssi-server": "0.0.1"
|
|
10
10
|
},
|
|
11
11
|
"exports": {
|
package/refid/hostish.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Element.prototype.hostish = async function () {
|
|
3
|
+
const closest = this.closest('[itemscope]');
|
|
4
|
+
if (closest === null)
|
|
5
|
+
return this.getRootNode().host;
|
|
6
|
+
const { localName } = closest;
|
|
7
|
+
if (localName.includes('-')) {
|
|
8
|
+
await customElements.whenDefined(localName);
|
|
9
|
+
return closest;
|
|
10
|
+
}
|
|
11
|
+
const itemScopeAttr = closest.getAttribute('itemscope');
|
|
12
|
+
if (itemScopeAttr) {
|
|
13
|
+
const { waitForIsh } = await import('mount-observer/waitForIsh.js');
|
|
14
|
+
return await waitForIsh(closest);
|
|
15
|
+
}
|
|
16
|
+
return this.getRootNode().host;
|
|
17
|
+
};
|
package/refid/hostish.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface Element{
|
|
2
|
+
hostish(): Promise<any>
|
|
3
|
+
}
|
|
4
|
+
Element.prototype.hostish = async function(){
|
|
5
|
+
const closest = this.closest('[itemscope]') as HTMLElement;
|
|
6
|
+
if(closest === null) return (<any>this.getRootNode()).host;
|
|
7
|
+
const {localName} = closest;
|
|
8
|
+
if(localName.includes('-')){
|
|
9
|
+
await customElements.whenDefined(localName);
|
|
10
|
+
return closest;
|
|
11
|
+
}
|
|
12
|
+
const itemScopeAttr = closest.getAttribute('itemscope');
|
|
13
|
+
if(itemScopeAttr){
|
|
14
|
+
const {waitForIsh} = await import('mount-observer/waitForIsh.js');
|
|
15
|
+
return await waitForIsh(closest);
|
|
16
|
+
}
|
|
17
|
+
return (<any>this.getRootNode()).host;
|
|
18
|
+
}
|
|
@@ -155,10 +155,13 @@ export interface Specifier {
|
|
|
155
155
|
|
|
156
156
|
export interface IPE {
|
|
157
157
|
id?: string,
|
|
158
|
+
prop?: string,
|
|
158
159
|
path?: SubPropPath,
|
|
159
160
|
evtName?: string,
|
|
160
161
|
as?: asOptions,
|
|
161
162
|
constVal?: any;
|
|
163
|
+
enhKey?: string;
|
|
164
|
+
ish?: boolean;
|
|
162
165
|
}
|
|
163
166
|
|
|
164
167
|
export type Modulo = 'aria-rowindex' | 'aria-colindex' | 'aria-rowindextext'
|