vsn 0.1.103 → 0.1.106
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/demo/demo.html +4 -4
- package/demo/vsn.js +2 -2
- package/dist/DOM.js +45 -46
- package/dist/DOM.js.map +1 -1
- package/dist/attributes/List.js +3 -2
- package/dist/attributes/List.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/vsn.min.js +2 -2
- package/package.json +1 -1
- package/src/DOM.ts +7 -8
- package/src/attributes/List.ts +2 -1
- package/src/version.ts +1 -1
package/package.json
CHANGED
package/src/DOM.ts
CHANGED
|
@@ -269,6 +269,9 @@ export class DOM extends EventDispatcher {
|
|
|
269
269
|
if (isRoot) {
|
|
270
270
|
document.body.setAttribute('vsn-root', '');
|
|
271
271
|
document.ondragover = (e) => e.cancelable && e.preventDefault(); // Allow dragging over document
|
|
272
|
+
this._root = await this.buildTag(document.body, true);
|
|
273
|
+
this._root.createScope(true);
|
|
274
|
+
await this.setupTags([this._root]);
|
|
272
275
|
}
|
|
273
276
|
|
|
274
277
|
// Setup components first
|
|
@@ -294,8 +297,6 @@ export class DOM extends EventDispatcher {
|
|
|
294
297
|
if (tag)
|
|
295
298
|
newTags.push(tag);
|
|
296
299
|
}
|
|
297
|
-
if (isRoot)
|
|
298
|
-
this._root = await this.getTagForElement(document.body);
|
|
299
300
|
|
|
300
301
|
await this.setupTags(newTags);
|
|
301
302
|
|
|
@@ -361,18 +362,16 @@ export class DOM extends EventDispatcher {
|
|
|
361
362
|
public async resetBranch(e: Tag | HTMLElement) {
|
|
362
363
|
if (e instanceof Tag)
|
|
363
364
|
e = e.element;
|
|
365
|
+
|
|
364
366
|
const tag = e[Tag.TaggedVariable];
|
|
365
|
-
if (tag)
|
|
366
|
-
tag.
|
|
367
|
+
if (tag) {
|
|
368
|
+
tag.findParentTag();
|
|
369
|
+
}
|
|
367
370
|
|
|
368
371
|
const children = Array.from(e.children) as HTMLElement[]
|
|
369
372
|
for (const t of children) {
|
|
370
373
|
await this.resetBranch(t);
|
|
371
374
|
}
|
|
372
|
-
|
|
373
|
-
if (tag && tag.uniqueScope && tag.parentTag) {
|
|
374
|
-
tag.scope.parentScope = tag.parentTag.scope;
|
|
375
|
-
}
|
|
376
375
|
}
|
|
377
376
|
|
|
378
377
|
public static get instance(): DOM {
|
package/src/attributes/List.ts
CHANGED
|
@@ -99,7 +99,8 @@ export class List extends Attribute {
|
|
|
99
99
|
const tag: Tag = await this.tag.dom.getTagForElement(element);
|
|
100
100
|
if (tag) {
|
|
101
101
|
this.tags.push(tag);
|
|
102
|
-
|
|
102
|
+
let listModel = tag.scope.get(this.listItemName);
|
|
103
|
+
this.items.push(listModel?.wrapped || listModel || tag.scope.wrapped || tag.scope);
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
106
|
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.106';
|
|
2
2
|
|