vsn 0.1.101 → 0.1.104
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/examples/component-slots.html +3 -0
- package/demo/vsn.js +2 -2
- package/dist/AST.js +8 -8
- package/dist/AST.js.map +1 -1
- package/dist/Component.js +1 -1
- package/dist/Component.js.map +1 -1
- package/dist/DOM.js +42 -40
- package/dist/DOM.js.map +1 -1
- package/dist/Tag.js +1 -0
- package/dist/Tag.js.map +1 -1
- package/dist/attributes/List.js +6 -1
- 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 +3 -0
- package/dist/vsn.min.js.LICENSE.txt +9 -0
- package/package.json +1 -1
- package/src/AST.ts +8 -8
- package/src/Component.ts +1 -1
- package/src/DOM.ts +4 -3
- package/src/Tag.ts +1 -0
- package/src/attributes/List.ts +5 -1
- package/src/version.ts +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
4
|
+
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
5
|
+
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
6
|
+
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
7
|
+
* Code distributed by Google as part of the polymer project is also
|
|
8
|
+
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
9
|
+
*/
|
package/package.json
CHANGED
package/src/AST.ts
CHANGED
|
@@ -282,14 +282,6 @@ const TOKEN_PATTERNS: TokenPattern[] = [
|
|
|
282
282
|
type: TokenType.NOT_EQUALS,
|
|
283
283
|
pattern: /^!=/
|
|
284
284
|
},
|
|
285
|
-
{
|
|
286
|
-
type: TokenType.GREATER_THAN,
|
|
287
|
-
pattern: /^>/
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
type: TokenType.LESS_THAN,
|
|
291
|
-
pattern: /^</
|
|
292
|
-
},
|
|
293
285
|
{
|
|
294
286
|
type: TokenType.GREATER_THAN_EQUAL,
|
|
295
287
|
pattern: /^>=/
|
|
@@ -298,6 +290,14 @@ const TOKEN_PATTERNS: TokenPattern[] = [
|
|
|
298
290
|
type: TokenType.LESS_THAN_EQUAL,
|
|
299
291
|
pattern: /^<=/
|
|
300
292
|
},
|
|
293
|
+
{
|
|
294
|
+
type: TokenType.GREATER_THAN,
|
|
295
|
+
pattern: /^>/
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
type: TokenType.LESS_THAN,
|
|
299
|
+
pattern: /^</
|
|
300
|
+
},
|
|
301
301
|
{
|
|
302
302
|
type: TokenType.COLON,
|
|
303
303
|
pattern: /^:/
|
package/src/Component.ts
CHANGED
|
@@ -33,7 +33,7 @@ export class Component extends HTMLElement {
|
|
|
33
33
|
const t = await DOM.instance.buildTag<SlottedTag>(child as HTMLElement, false, SlottedTag);
|
|
34
34
|
await t?.slotted(slotTag);
|
|
35
35
|
}
|
|
36
|
-
await
|
|
36
|
+
await DOM.instance.setupTags([slotTag]);
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
39
|
});
|
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
|
|
|
@@ -370,7 +371,7 @@ export class DOM extends EventDispatcher {
|
|
|
370
371
|
await this.resetBranch(t);
|
|
371
372
|
}
|
|
372
373
|
|
|
373
|
-
if (tag && tag.
|
|
374
|
+
if (tag && tag.parentTag && tag.uniqueScope) {
|
|
374
375
|
tag.scope.parentScope = tag.parentTag.scope;
|
|
375
376
|
}
|
|
376
377
|
}
|
package/src/Tag.ts
CHANGED
|
@@ -561,6 +561,7 @@ export class Tag extends DOMObject {
|
|
|
561
561
|
public async finalize() {
|
|
562
562
|
this._state = TagState.Built;
|
|
563
563
|
this.callOnWrapped('$built', this, this.scope, this.element);
|
|
564
|
+
this.dispatch('$built', this);
|
|
564
565
|
VisionHelper.nice(this.setupDeferredAttributes.bind(this));
|
|
565
566
|
}
|
|
566
567
|
|
package/src/attributes/List.ts
CHANGED
|
@@ -99,7 +99,7 @@ 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
|
-
this.items.push(tag.scope.wrapped || tag.scope);
|
|
102
|
+
this.items.push(tag.scope.get(this.listItemName) || tag.scope.wrapped || tag.scope);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -189,6 +189,10 @@ export class List extends Attribute {
|
|
|
189
189
|
if (cls) {
|
|
190
190
|
if (!obj || !(obj instanceof cls)) {
|
|
191
191
|
obj = new cls(obj);
|
|
192
|
+
this.tag.once('$built', () => {
|
|
193
|
+
if (obj['$built'])
|
|
194
|
+
obj['$built'](this.tag, this.tag.scope, this.tag.element);
|
|
195
|
+
});
|
|
192
196
|
}
|
|
193
197
|
}
|
|
194
198
|
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.104';
|
|
2
2
|
|