Skip to content

Commit

Permalink
0.0.873
Browse files Browse the repository at this point in the history
  • Loading branch information
bahrus committed Dec 22, 2024
1 parent 0fc078c commit d87f94f
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 43 deletions.
22 changes: 1 addition & 21 deletions dss/findR.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
async function getHostish(el) {
let { localName, ish } = el;
if (localName.includes('-')) {
await customElements.whenDefined(localName);
return el;
}
if (ish instanceof HTMLElement)
return ish;
const itemScopeAttr = el.getAttribute('itemscope');
if (itemScopeAttr) {
//let ish = (<any>el).ish as HTMLElement | undefined;
//if(host) return getHostish(host, prop);
const { Newish, waitForEvent } = await import('./Newish.js');
const ah = new Newish(el, itemScopeAttr);
if (!ah.isResolved) {
await waitForEvent(ah, 'resolved');
}
ish = el.ish;
return ish;
}
}
import { getHostish } from './getHostish.js';
export async function findR(element, specifier, scopeE) {
const { scopeS, elS, isModulo } = specifier;
if (scopeS !== undefined) {
Expand Down
23 changes: 1 addition & 22 deletions dss/findR.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
import { Specifier } from "../ts-refs/trans-render/dss/types";
import {ZeroOrMore} from '../ts-refs/trans-render/types';
import {getHostish} from './getHostish.js';

async function getHostish(el: Element){
let {localName, ish} = el as any;
if(localName.includes('-')){
await customElements.whenDefined(localName);
return el;
}
if(ish instanceof HTMLElement) return ish;
const itemScopeAttr = el.getAttribute('itemscope');
if(itemScopeAttr){
//let ish = (<any>el).ish as HTMLElement | undefined;
//if(host) return getHostish(host, prop);
const {Newish, waitForEvent} = await import('./Newish.js');
const ah = new Newish(el, itemScopeAttr);
if(!ah.isResolved){
await waitForEvent(ah, 'resolved');
}
ish = (<any>el).ish as HTMLElement | undefined;
return ish;

}
}
export async function findR(element: Element, specifier: Specifier, scopeE?: Element | undefined){
const {scopeS, elS, isModulo} = specifier;

Expand Down
21 changes: 21 additions & 0 deletions dss/getHostish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export async function getHostish(el) {
let { localName, ish } = el;
if (localName.includes('-')) {
await customElements.whenDefined(localName);
return el;
}
if (ish instanceof HTMLElement)
return ish;
const itemScopeAttr = el.getAttribute('itemscope');
if (itemScopeAttr) {
//let ish = (<any>el).ish as HTMLElement | undefined;
//if(host) return getHostish(host, prop);
const { Newish, waitForEvent } = await import('./Newish.js');
const ah = new Newish(el, itemScopeAttr);
if (!ah.isResolved) {
await waitForEvent(ah, 'resolved');
}
ish = el.ish;
return ish;
}
}
21 changes: 21 additions & 0 deletions dss/getHostish.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export async function getHostish(el: Element){
let {localName, ish} = el as any;
if(localName.includes('-')){
await customElements.whenDefined(localName);
return el;
}
if(ish instanceof HTMLElement) return ish;
const itemScopeAttr = el.getAttribute('itemscope');
if(itemScopeAttr){
//let ish = (<any>el).ish as HTMLElement | undefined;
//if(host) return getHostish(host, prop);
const {Newish, waitForEvent} = await import('./Newish.js');
const ah = new Newish(el, itemScopeAttr);
if(!ah.isResolved){
await waitForEvent(ah, 'resolved');
}
ish = (<any>el).ish as HTMLElement | undefined;
return ish;

}
}
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
"default": "./lib/findR.js",
"types": "./lib/findR.ts"
},
"./dss/getHostish.js": {
"default": "./dss/getHostish.js",
"types": "./dss/getHostish.ts"
},
"./dss/tref/getChildren.js": {
"default": "./dss/tref/getChildren.js",
"types": "./dss/tref/getChildren.ts"
Expand Down

0 comments on commit d87f94f

Please sign in to comment.