@adaas/are-html 0.0.13 → 0.0.15
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/dist/browser/index.mjs +24 -2
- package/dist/browser/index.mjs.map +1 -1
- package/dist/node/lib/AreRoot/AreRoot.component.js +24 -2
- package/dist/node/lib/AreRoot/AreRoot.component.js.map +1 -1
- package/dist/node/lib/AreRoot/AreRoot.component.mjs +24 -2
- package/dist/node/lib/AreRoot/AreRoot.component.mjs.map +1 -1
- package/package.json +3 -3
- package/src/lib/AreRoot/AreRoot.component.ts +36 -5
package/dist/browser/index.mjs
CHANGED
|
@@ -2209,7 +2209,13 @@ var AreRoot = class extends Are {
|
|
|
2209
2209
|
let renderTarget = signalsContext?.findComponentByVector(rootId, initialVector);
|
|
2210
2210
|
if (!renderTarget) {
|
|
2211
2211
|
const signalsMeta = A_Context.meta(AreSignals);
|
|
2212
|
-
|
|
2212
|
+
const metaTarget = signalsMeta?.findComponentByVector(initialVector);
|
|
2213
|
+
if (metaTarget) {
|
|
2214
|
+
const pool = signalsContext?.getComponentById(rootId);
|
|
2215
|
+
if (!pool?.length || pool.includes(metaTarget)) {
|
|
2216
|
+
renderTarget = metaTarget;
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2213
2219
|
}
|
|
2214
2220
|
if (renderTarget?.name) {
|
|
2215
2221
|
componentName = A_FormatterHelper.toKebabCase(renderTarget.name);
|
|
@@ -2220,6 +2226,12 @@ var AreRoot = class extends Are {
|
|
|
2220
2226
|
return;
|
|
2221
2227
|
}
|
|
2222
2228
|
}
|
|
2229
|
+
if (!componentName) {
|
|
2230
|
+
const defaultComp = signalsContext?.getDefault(rootId);
|
|
2231
|
+
if (defaultComp?.name) {
|
|
2232
|
+
componentName = A_FormatterHelper.toKebabCase(defaultComp.name);
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2223
2235
|
if (!componentName) {
|
|
2224
2236
|
const defaultMatch = root.markup?.match(/\bdefault=["']([^"']*)["']/);
|
|
2225
2237
|
componentName = defaultMatch?.[1];
|
|
@@ -2238,12 +2250,22 @@ var AreRoot = class extends Are {
|
|
|
2238
2250
|
let renderTarget = signalsContext?.findComponentByVector(rootId, vector);
|
|
2239
2251
|
if (!renderTarget) {
|
|
2240
2252
|
const signalsMeta = A_Context.meta(AreSignals);
|
|
2241
|
-
|
|
2253
|
+
const metaTarget = signalsMeta?.findComponentByVector(vector);
|
|
2254
|
+
if (metaTarget) {
|
|
2255
|
+
const pool = signalsContext?.getComponentById(rootId);
|
|
2256
|
+
if (!pool?.length || pool.includes(metaTarget)) {
|
|
2257
|
+
renderTarget = metaTarget;
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2242
2260
|
}
|
|
2243
2261
|
const componentName = renderTarget?.name ? A_FormatterHelper.toKebabCase(renderTarget.name) : store.get("default");
|
|
2244
2262
|
if (!componentName) {
|
|
2245
2263
|
return;
|
|
2246
2264
|
}
|
|
2265
|
+
const currentChild = root.children[0];
|
|
2266
|
+
if (currentChild?.type === componentName) {
|
|
2267
|
+
return;
|
|
2268
|
+
}
|
|
2247
2269
|
root.setContent(`<${componentName}></${componentName}>`);
|
|
2248
2270
|
for (let i = 0; i < root.children.length; i++) {
|
|
2249
2271
|
const child = root.children[i];
|