vsn 0.1.77 → 0.1.80
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/vsn.js +2 -2
- package/dist/AST/ClassNode.js +31 -28
- package/dist/AST/ClassNode.js.map +1 -1
- package/dist/Component.js +0 -1
- package/dist/Component.js.map +1 -1
- package/dist/DOM.js +9 -19
- package/dist/DOM.js.map +1 -1
- package/dist/attributes/ComponentAttribute.js +9 -4
- package/dist/attributes/ComponentAttribute.js.map +1 -1
- package/dist/attributes/On.js +0 -1
- package/dist/attributes/On.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 +2 -2
- package/src/AST/ClassNode.ts +5 -3
- package/src/Component.ts +0 -1
- package/src/DOM.ts +0 -1
- package/src/attributes/ComponentAttribute.ts +3 -4
- package/src/attributes/On.ts +0 -1
- package/src/version.ts +2 -1
- package/test/AST/ClassNode.spec.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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vsn",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.80",
|
|
4
4
|
"description": "SEO Friendly Javascript/Typescript Framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"framework",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"main": "./dist/vsn.js",
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "rm -rf ./dist/ && npm run-script version && tsc",
|
|
17
|
-
"version": "echo
|
|
17
|
+
"version": "echo \"export const VERSION = '${npm_package_version}';\n\" > src/version.ts",
|
|
18
18
|
"build_dev": "rm -rf ./dist/ && webpack --env BUILD=development BENCHMARK=1",
|
|
19
19
|
"demo": "webpack --env BUILD=production BENCHMARK=1 && cp ./dist/vsn.min.js ./demo/vsn.js",
|
|
20
20
|
"test": "karma start --single-run",
|
package/src/AST/ClassNode.ts
CHANGED
|
@@ -147,9 +147,11 @@ export class ClassNode extends Node implements TreeNode {
|
|
|
147
147
|
if (element.id)
|
|
148
148
|
localSelectors.push(`#${element.id}`);
|
|
149
149
|
|
|
150
|
-
for (const selector
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
for (const selector of localSelectors) {
|
|
151
|
+
const parentSelectors = ClassNode.classParents[selector];
|
|
152
|
+
if (parentSelectors) {
|
|
153
|
+
fullSelectors.push(...parentSelectors.filter(s => !fullSelectors.includes(s)));
|
|
154
|
+
}
|
|
153
155
|
}
|
|
154
156
|
|
|
155
157
|
if (!tag) {
|
package/src/Component.ts
CHANGED
package/src/DOM.ts
CHANGED
|
@@ -11,13 +11,12 @@ export class ComponentAttribute extends TemplateAttribute {
|
|
|
11
11
|
if (!Registry.instance.components.has(name)) {
|
|
12
12
|
await super.extract();
|
|
13
13
|
const clsName = this.getAttributeValue();
|
|
14
|
-
let cls
|
|
14
|
+
let cls;
|
|
15
15
|
if (clsName) {
|
|
16
16
|
cls = await Registry.instance.components.get(clsName);
|
|
17
|
-
if (!cls) {
|
|
18
|
-
throw new Error(`Component ${clsName} not found`);
|
|
19
|
-
}
|
|
20
17
|
}
|
|
18
|
+
if (!cls)
|
|
19
|
+
cls = class extends Component {};
|
|
21
20
|
Registry.instance.components.register(name, cls);
|
|
22
21
|
}
|
|
23
22
|
}
|
package/src/attributes/On.ts
CHANGED
|
@@ -20,7 +20,6 @@ export abstract class On extends Attribute {
|
|
|
20
20
|
|
|
21
21
|
public async compile() {
|
|
22
22
|
const code: string = this.getAttributeValue();
|
|
23
|
-
console.log(`Compiling ${this.getAttributeBinding()} with ${code}`);
|
|
24
23
|
this.handler = new Tree(code);
|
|
25
24
|
await this.handler.prepare(this.tag.scope, this.tag.dom, this.tag);
|
|
26
25
|
await super.compile();
|
package/src/version.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.80';
|
|
2
|
+
|