mount-observer 0.0.79 → 0.0.81

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/getContent.js ADDED
@@ -0,0 +1,10 @@
1
+ import { waitForEvent } from './waitForEvent.js';
2
+ export async function getContent(templ) {
3
+ const templWithRemoteContent = templ;
4
+ if (templWithRemoteContent.remoteContent)
5
+ return templWithRemoteContent.remoteContent;
6
+ await waitForEvent(templ, 'load');
7
+ if (templWithRemoteContent.remoteContent)
8
+ return templWithRemoteContent.remoteContent;
9
+ throw 500; //remote content not loaded
10
+ }
package/getContent.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import {waitForEvent} from './waitForEvent.js';
2
2
  import {TemplateWithRemoteContent} from './ts-refs/mount-observer/types.js';
3
3
 
4
- export async function getContent(templ: HTMLTemplateElement, target?: DocumentFragment | ShadowRoot | Document | Element) {
4
+ export async function getContent(templ: HTMLTemplateElement) {
5
5
  const templWithRemoteContent = templ as TemplateWithRemoteContent;
6
6
  if(templWithRemoteContent.remoteContent) return templWithRemoteContent.remoteContent;
7
7
  await waitForEvent(templ, 'load');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mount-observer",
3
- "version": "0.0.79",
3
+ "version": "0.0.81",
4
4
  "description": "Observe and act on css matches.",
5
5
  "main": "MountObserver.js",
6
6
  "module": "MountObserver.js",
package/preloadContent.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  import {TemplateWithRemoteContent} from './ts-refs/mount-observer/types.js';
2
2
  const remoteTemplElSym = Symbol.for('du3y+tfsAUGFHMG/iHZiMQ');
3
3
 
4
- export async function preloadContent(templ: HTMLTemplateElement, target?: DocumentFragment | ShadowRoot | Document | Element) {
4
+ export async function preloadContent(
5
+ templ: HTMLTemplateElement,
6
+ target?: DocumentFragment | ShadowRoot | Document | Element
7
+ ) {
5
8
  const templWithRemoteContent = templ as TemplateWithRemoteContent & {
6
9
  [remoteTemplElSym]?: WeakRef<HTMLTemplateElement>
7
10
  };
@@ -192,6 +192,7 @@ export interface IshConfig<TProps = any, TActions = TProps, ETProps = TProps>{
192
192
  inScopeXForms?: {[key: CSSQuery]: XForm<TProps, TActions>};
193
193
  ishListCountProp?: keyof TProps & string;
194
194
  defaultIshList?: any[];
195
+ mapParentScopeRefTo?: keyof TProps & string;
195
196
  }
196
197
  export interface OConfig<TProps = any, TActions = TProps, ETProps = TProps> extends IshConfig<TProps, TActions, ETProps>{
197
198
  mainTemplate?: string | HTMLTemplateElement;
@@ -26,4 +26,5 @@ export interface ResolvingParameters{
26
26
  remoteSpecifier: Specifier;
27
27
  localSpecifierString: string;
28
28
  localSpecifier: Specifier;
29
+ remotePropertyPath: string;
29
30
  }
package/upShadowSearch.js CHANGED
@@ -13,6 +13,6 @@ export function upShadowSearch(ref, id) {
13
13
  else if (rn === document) {
14
14
  return null;
15
15
  }
16
- throw 'NI';
16
+ return null;
17
17
  }
18
18
  }
package/upShadowSearch.ts CHANGED
@@ -10,7 +10,7 @@ export function upShadowSearch(ref: Element, id: string){
10
10
  }else if(rn === document){
11
11
  return null;
12
12
  }
13
- throw 'NI';
13
+ return null;
14
14
  }
15
15
  }
16
16