native-document 1.0.0 → 1.0.1
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 +1 -1
- package/src/data/Observable.js +0 -1
- package/src/router/Router.js +1 -2
- package/src/router/RouterComponent.js +1 -3
- package/src/utils/debug-manager.js +4 -7
- package/src/wrappers/AttributesWrapper.js +0 -1
- package/dist/native-document.dev.js +0 -2346
- package/dist/native-document.min.js +0 -1
package/package.json
CHANGED
package/src/data/Observable.js
CHANGED
package/src/router/Router.js
CHANGED
|
@@ -174,7 +174,6 @@ export default function Router($options = {}) {
|
|
|
174
174
|
$currentState.query = query;
|
|
175
175
|
$currentState.path = path;
|
|
176
176
|
|
|
177
|
-
console.log($currentState.query)
|
|
178
177
|
const middlewares = [...route.middlewares(), trigger];
|
|
179
178
|
let currentIndex = 0;
|
|
180
179
|
const request = { ...$currentState };
|
|
@@ -195,7 +194,7 @@ Router.routers = {};
|
|
|
195
194
|
|
|
196
195
|
/**
|
|
197
196
|
*
|
|
198
|
-
* @param {{mode: 'memory'|'history'|'hash', name
|
|
197
|
+
* @param {{mode: 'memory'|'history'|'hash', name?:string, entry?: string}} options
|
|
199
198
|
* @param {Function} callback
|
|
200
199
|
* @param {Element} container
|
|
201
200
|
*/
|
|
@@ -19,12 +19,10 @@ export function RouterComponent(router, container) {
|
|
|
19
19
|
const { route, params, query, path } = state;
|
|
20
20
|
if($cache.has(path)) {
|
|
21
21
|
const cacheNode = $cache.get(path);
|
|
22
|
-
console.log(cacheNode);
|
|
23
22
|
updateContainer(cacheNode);
|
|
24
23
|
return;
|
|
25
24
|
}
|
|
26
|
-
const Component = route.component()
|
|
27
|
-
console.log({ params, query })
|
|
25
|
+
const Component = route.component();
|
|
28
26
|
const node = Component({ params, query });
|
|
29
27
|
$cache.set(path, node);
|
|
30
28
|
updateContainer(node);
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
// Build configuration
|
|
2
|
-
const isProd = process.env.NODE_ENV === 'production';
|
|
3
|
-
|
|
4
1
|
const DebugManager = {
|
|
5
|
-
enabled:
|
|
2
|
+
enabled: false,
|
|
6
3
|
|
|
7
4
|
enable() {
|
|
8
5
|
this.enabled = true;
|
|
@@ -13,7 +10,7 @@ const DebugManager = {
|
|
|
13
10
|
this.enabled = false;
|
|
14
11
|
},
|
|
15
12
|
|
|
16
|
-
log
|
|
13
|
+
log(category, message, data) {
|
|
17
14
|
if (!this.enabled) return;
|
|
18
15
|
console.group(`🔍 [${category}] ${message}`);
|
|
19
16
|
if (data) console.log(data);
|
|
@@ -21,12 +18,12 @@ const DebugManager = {
|
|
|
21
18
|
console.groupEnd();
|
|
22
19
|
},
|
|
23
20
|
|
|
24
|
-
warn
|
|
21
|
+
warn(category, message, data) {
|
|
25
22
|
if (!this.enabled) return;
|
|
26
23
|
console.warn(`⚠️ [${category}] ${message}`, data);
|
|
27
24
|
},
|
|
28
25
|
|
|
29
|
-
error
|
|
26
|
+
error(category, message, error) {
|
|
30
27
|
console.error(`❌ [${category}] ${message}`, error);
|
|
31
28
|
}
|
|
32
29
|
};
|