@jinntec/fore
Advanced tools
+1
-1
| { | ||
| "name": "@jinntec/fore", | ||
| "version": "3.2.0", | ||
| "version": "3.2.1", | ||
| "description": "Fore - declarative user interfaces in plain HTML", | ||
@@ -5,0 +5,0 @@ "module": "./index.js", |
+34
-2
| import { Fore } from '../fore.js'; | ||
| import { FxFore } from '../fx-fore.js'; | ||
@@ -53,3 +54,3 @@ /** | ||
| if (this.immediate) { | ||
| queueMicrotask(() => this.include()); | ||
| this._includeWhenReady(); | ||
| return; | ||
@@ -61,2 +62,19 @@ } | ||
| /** | ||
| * Includes content immediately, but waits until the closest `fx-fore` has | ||
| * finished its initial Rebuild/Recalculate/Revalidate/Refresh cycle (i.e. is | ||
| * "ready"), so the included content can resolve binding context against an | ||
| * already-initialized ancestor chain. | ||
| */ | ||
| _includeWhenReady() { | ||
| const fore = this.closest('fx-fore'); | ||
| if (!fore) { | ||
| queueMicrotask(() => this.include()); | ||
| return; | ||
| } | ||
| FxFore.waitUntilReady(fore).then(() => this.include()); | ||
| } | ||
| disconnectedCallback() { | ||
@@ -187,3 +205,3 @@ this._unbindListener(); | ||
| const template = parsed.querySelector('template'); | ||
| const template = parsed.body.querySelector(':scope > template'); | ||
@@ -194,2 +212,10 @@ if (template) { | ||
| const rootElements = Array.from(parsed.body.children); | ||
| if (rootElements.length === 1) { | ||
| const fragment = document.createDocumentFragment(); | ||
| fragment.appendChild(document.importNode(rootElements[0], true)); | ||
| return fragment; | ||
| } | ||
| const fragment = document.createDocumentFragment(); | ||
@@ -241,2 +267,8 @@ | ||
| this._initForeUiDescendants(startElement); | ||
| const fore = startElement.closest('fx-fore'); | ||
| if (fore?.createNodes && typeof fore.initData === 'function') { | ||
| fore.initData(startElement); | ||
| } | ||
| await Fore.refreshChildren(startElement, true); | ||
@@ -243,0 +275,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
3257546
0.09%98878
0.08%