native-document 1.0.123 → 1.0.125

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.
@@ -5,6 +5,16 @@ const DocumentObserver = {
5
5
  unmounted: new WeakMap(),
6
6
  unmountedSupposedSize: 0,
7
7
  observer: null,
8
+ initObserver: () => {
9
+ if(DocumentObserver.observer) {
10
+ return;
11
+ }
12
+ DocumentObserver.observer = new MutationObserver(DocumentObserver.checkMutation);
13
+ DocumentObserver.observer.observe(document.body, {
14
+ childList: true,
15
+ subtree: true,
16
+ });
17
+ },
8
18
 
9
19
  executeMountedCallback(node) {
10
20
  const data = DocumentObserver.mounted.get(node);
@@ -52,6 +62,7 @@ const DocumentObserver = {
52
62
  },
53
63
 
54
64
  checkMutation: function(mutationsList) {
65
+ console.log('mutationsList', mutationsList);
55
66
  for(const mutation of mutationsList) {
56
67
  if(DocumentObserver.mountedSupposedSize > 0) {
57
68
  for(const node of mutation.addedNodes) {
@@ -90,6 +101,8 @@ const DocumentObserver = {
90
101
  let mountedRegistered = false;
91
102
  let unmountedRegistered = false;
92
103
 
104
+ DocumentObserver.initObserver();
105
+
93
106
  let data = {
94
107
  inDom,
95
108
  mounted: null,
@@ -167,10 +180,4 @@ const DocumentObserver = {
167
180
  }
168
181
  };
169
182
 
170
- DocumentObserver.observer = new MutationObserver(DocumentObserver.checkMutation);
171
- DocumentObserver.observer.observe(document.body, {
172
- childList: true,
173
- subtree: true,
174
- });
175
-
176
183
  export default DocumentObserver;
@@ -57,6 +57,10 @@ export default function HtmlElementWrapper(name, customWrapper = null) {
57
57
 
58
58
  return (attr, children) => createElement(attr, children)
59
59
  }
60
- return () => Anchor('');
60
+ return (children, name = '') => {
61
+ const anchor = Anchor(name);
62
+ anchor.append(children);
63
+ return anchor;
64
+ };
61
65
  };
62
66
 
@@ -27,6 +27,7 @@ export function RouterComponent(router, container) {
27
27
  anchor = Anchor(path);
28
28
  anchor.appendChild(node);
29
29
  }
30
+ console.log(anchor);
30
31
  $routeInstanceAnchors.set(node, anchor);
31
32
  return anchor;
32
33
  };
@@ -36,6 +37,7 @@ export function RouterComponent(router, container) {
36
37
  $lastNodeInserted.remove();
37
38
  }
38
39
  };
40
+
39
41
  const cleanContainer = () => {
40
42
  container.nodeValue = '';
41
43
  removeLastNodeInserted();
@@ -0,0 +1,8 @@
1
+ import { Button } from "../../../core/elements";
2
+
3
+ import './button.css';
4
+
5
+ const ButtonRender = function($description) {
6
+
7
+ return Button('Just a button');
8
+ };
File without changes
File without changes
@@ -0,0 +1,5 @@
1
+
2
+
3
+ export const DefaultTheme = {
4
+
5
+ }
File without changes