vsn 0.1.107 → 0.1.110

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vsn",
3
- "version": "0.1.107",
3
+ "version": "0.1.110",
4
4
  "description": "SEO Friendly Javascript/Typescript Framework",
5
5
  "keywords": [
6
6
  "framework",
package/src/Component.ts CHANGED
@@ -42,11 +42,8 @@ export class Component extends HTMLElement {
42
42
  async connectedCallback() {
43
43
  const tag = await DOM.instance.buildTag(this, true);
44
44
  tag.createScope(true);
45
- const componentTags = await DOM.instance.buildFrom(this.shadow);
45
+ await DOM.instance.buildFrom(this.shadow);
46
46
  await DOM.instance.resetBranch(tag);
47
- for (const componentTag of componentTags) {
48
- await DOM.instance.resetBranch(componentTag);
49
- }
50
47
  await DOM.instance.setupTags([tag]);
51
48
  }
52
49
  }
package/src/DOM.ts CHANGED
@@ -193,7 +193,7 @@ export class DOM extends EventDispatcher {
193
193
  async discover(ele: HTMLElement, forComponent: boolean = false): Promise<HTMLElement[]> {
194
194
  const discovered: HTMLElement[] = [];
195
195
  const checkElement = (e: HTMLElement): boolean => {
196
- if (Registry.instance.components.has(e?.tagName?.toLowerCase())) {
196
+ if (Registry.instance.tags.has(e?.tagName?.toLowerCase())) {
197
197
  return false;
198
198
  }
199
199
 
@@ -363,7 +363,7 @@ export class DOM extends EventDispatcher {
363
363
  if (e instanceof Tag)
364
364
  e = e.element;
365
365
 
366
- const tag = e[Tag.TaggedVariable];
366
+ const tag: Tag = e[Tag.TaggedVariable];
367
367
  if (tag) {
368
368
  tag.findParentTag();
369
369
  }
package/src/Registry.ts CHANGED
@@ -62,6 +62,7 @@ export class RegistryStore<T = any> extends EventDispatcher {
62
62
 
63
63
  export class Registry extends EventDispatcher {
64
64
  protected static _instance: Registry;
65
+ public readonly tags: RegistryStore;
65
66
  public readonly components: RegistryStore;
66
67
  public readonly functions: RegistryStore;
67
68
  public readonly controllers: RegistryStore;
@@ -76,6 +77,7 @@ export class Registry extends EventDispatcher {
76
77
 
77
78
  constructor() {
78
79
  super();
80
+ this.tags = new RegistryStore();
79
81
  this.components = new RegistryStore();
80
82
  this.functions = new RegistryStore();
81
83
  this.controllers = new RegistryStore();
@@ -8,7 +8,7 @@ export class ComponentAttribute extends TemplateAttribute {
8
8
 
9
9
  public async extract() {
10
10
  const name = this.getAttributeBinding();
11
- if (!Registry.instance.components.has(name)) {
11
+ if (!Registry.instance.tags.has(name)) {
12
12
  await super.extract();
13
13
  const clsName = this.getAttributeValue();
14
14
  let cls;
@@ -17,7 +17,7 @@ export class ComponentAttribute extends TemplateAttribute {
17
17
  }
18
18
  if (!cls)
19
19
  cls = class extends Component {};
20
- Registry.instance.components.register(name, cls);
20
+ Registry.instance.tags.register(name, cls);
21
21
  }
22
22
  }
23
23
  }
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.1.107';
1
+ export const VERSION = '0.1.110';
2
2
 
package/src/vsn.ts CHANGED
@@ -19,7 +19,7 @@ export class Vision extends EventDispatcher {
19
19
 
20
20
  constructor() {
21
21
  super();
22
- Registry.instance.components.on('register', this.defineComponent, this);
22
+ Registry.instance.tags.on('register', this.defineComponent, this);
23
23
  if (VisionHelper.document) {
24
24
  document.addEventListener(
25
25
  "DOMContentLoaded",
@@ -47,10 +47,10 @@ export class Vision extends EventDispatcher {
47
47
  }
48
48
 
49
49
  protected defineComponent(name, cls) {
50
- if (this.dom.built) {
50
+ if (DOM.instance.built) {
51
51
  customElements.define(name, cls);
52
52
  } else {
53
- this.dom.once('built', () => {
53
+ DOM.instance.once('built', () => {
54
54
  customElements.define(name, cls);
55
55
  });
56
56
  }