native-document 1.0.125 → 1.0.127
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/dist/native-document.components.min.js +132 -130
- package/dist/native-document.dev.js +55 -58
- package/dist/native-document.dev.js.map +1 -1
- package/dist/native-document.min.js +1 -1
- package/package.json +1 -1
- package/src/components/$traits/HasItems.js +39 -2
- package/src/components/BaseComponent.js +4 -0
- package/src/components/button/Button.js +15 -9
- package/src/components/menu/Menu.js +18 -7
- package/src/components/menu/MenuItem.js +13 -13
- package/src/components/menu/MenuLink.js +24 -0
- package/src/core/elements/anchor/anchor.js +3 -10
- package/src/core/utils/property-accumulator.js +1 -1
- package/src/router/Router.js +11 -0
- package/src/router/RouterComponent.js +3 -1
- package/src/ui/components/button/button.css +362 -0
- package/src/ui/components/button/button.render.js +63 -0
- package/src/ui/theme.js +2 -1
- package/src/ui/tokens/animation.scss +36 -0
- package/src/ui/tokens/colors-dark.scss +57 -0
- package/src/ui/tokens/colors.scss +54 -0
- package/src/ui/tokens/components.scss +32 -0
- package/src/ui/tokens/fonts.scss +57 -0
- package/src/ui/tokens/glass.scss +10 -0
- package/src/ui/tokens/index.scss +38 -0
- package/src/ui/tokens/layouts.scss +228 -0
- package/src/ui/tokens/opacity.scss +21 -0
- package/src/ui/tokens/others.scss +11 -0
- package/src/ui/tokens/radius.scss +6 -0
- package/src/ui/tokens/reset.scss +48 -0
- package/src/ui/tokens/shadows.scss +29 -0
- package/src/ui/tokens/spacings.scss +13 -0
- package/src/ui/tokens/vars.scss +35 -0
- package/src/ui/tokens/viewports.scss +30 -0
- package/utils.js +3 -1
- package/src/ui/components/button/Button.js +0 -8
- package/src/ui/tokens/vars.css +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var NativeDocument = (function (exports) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
let DebugManager$
|
|
4
|
+
let DebugManager$1 = {};
|
|
5
5
|
|
|
6
6
|
{
|
|
7
|
-
DebugManager$
|
|
7
|
+
DebugManager$1 = {
|
|
8
8
|
enabled: false,
|
|
9
9
|
|
|
10
10
|
enable() {
|
|
@@ -35,7 +35,7 @@ var NativeDocument = (function (exports) {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
}
|
|
38
|
-
var DebugManager$
|
|
38
|
+
var DebugManager$2 = DebugManager$1;
|
|
39
39
|
|
|
40
40
|
class NativeDocumentError extends Error {
|
|
41
41
|
constructor(message, context = {}) {
|
|
@@ -321,10 +321,10 @@ var NativeDocument = (function (exports) {
|
|
|
321
321
|
}
|
|
322
322
|
};
|
|
323
323
|
|
|
324
|
-
let PluginsManager
|
|
324
|
+
let PluginsManager = null;
|
|
325
325
|
|
|
326
326
|
{
|
|
327
|
-
PluginsManager
|
|
327
|
+
PluginsManager = (function() {
|
|
328
328
|
|
|
329
329
|
const $plugins = new Map();
|
|
330
330
|
const $pluginByEvents = new Map();
|
|
@@ -390,7 +390,7 @@ var NativeDocument = (function (exports) {
|
|
|
390
390
|
try{
|
|
391
391
|
callback.call(plugin, ...data);
|
|
392
392
|
} catch (error) {
|
|
393
|
-
DebugManager$
|
|
393
|
+
DebugManager$2.error('Plugin Manager', `Error in plugin ${plugin.$name} for event ${eventName}`, error);
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
}
|
|
@@ -399,12 +399,12 @@ var NativeDocument = (function (exports) {
|
|
|
399
399
|
}());
|
|
400
400
|
}
|
|
401
401
|
|
|
402
|
-
var PluginsManager = PluginsManager
|
|
402
|
+
var PluginsManager$1 = PluginsManager;
|
|
403
403
|
|
|
404
404
|
function NDElement(element) {
|
|
405
405
|
this.$element = element;
|
|
406
406
|
{
|
|
407
|
-
PluginsManager.emit('NDElementCreated', element, this);
|
|
407
|
+
PluginsManager$1.emit('NDElementCreated', element, this);
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
|
|
@@ -569,7 +569,7 @@ var NativeDocument = (function (exports) {
|
|
|
569
569
|
}
|
|
570
570
|
{
|
|
571
571
|
if (this[name] && !this.$localExtensions.has(name)) {
|
|
572
|
-
DebugManager$
|
|
572
|
+
DebugManager$2.warn('NDElement.extend', `Method "${name}" already exists and will be overwritten`);
|
|
573
573
|
}
|
|
574
574
|
this.$localExtensions.set(name, method);
|
|
575
575
|
}
|
|
@@ -620,23 +620,23 @@ var NativeDocument = (function (exports) {
|
|
|
620
620
|
const method = methods[name];
|
|
621
621
|
|
|
622
622
|
if (typeof method !== 'function') {
|
|
623
|
-
DebugManager$
|
|
623
|
+
DebugManager$2.warn('NDElement.extend', `"${name}" is not a function, skipping`);
|
|
624
624
|
continue;
|
|
625
625
|
}
|
|
626
626
|
|
|
627
627
|
if (protectedMethods.has(name)) {
|
|
628
|
-
DebugManager$
|
|
628
|
+
DebugManager$2.error('NDElement.extend', `Cannot override protected method "${name}"`);
|
|
629
629
|
throw new NativeDocumentError(`Cannot override protected method "${name}"`);
|
|
630
630
|
}
|
|
631
631
|
|
|
632
632
|
if (NDElement.prototype[name]) {
|
|
633
|
-
DebugManager$
|
|
633
|
+
DebugManager$2.warn('NDElement.extend', `Overwriting existing prototype method "${name}"`);
|
|
634
634
|
}
|
|
635
635
|
|
|
636
636
|
NDElement.prototype[name] = method;
|
|
637
637
|
}
|
|
638
638
|
{
|
|
639
|
-
PluginsManager.emit('NDElementExtended', methods);
|
|
639
|
+
PluginsManager$1.emit('NDElementExtended', methods);
|
|
640
640
|
}
|
|
641
641
|
|
|
642
642
|
return NDElement;
|
|
@@ -787,7 +787,7 @@ var NativeDocument = (function (exports) {
|
|
|
787
787
|
const foundReserved = Object.keys(attributes).filter(key => reserved.includes(key));
|
|
788
788
|
|
|
789
789
|
if (foundReserved.length > 0) {
|
|
790
|
-
DebugManager$
|
|
790
|
+
DebugManager$2.warn('Validator', `Reserved attributes found: ${foundReserved.join(', ')}`);
|
|
791
791
|
}
|
|
792
792
|
|
|
793
793
|
return attributes;
|
|
@@ -874,7 +874,7 @@ var NativeDocument = (function (exports) {
|
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
876
|
if (cleanedCount > 0) {
|
|
877
|
-
DebugManager$
|
|
877
|
+
DebugManager$2.log('Memory Auto Clean', `🧹 Cleaned ${cleanedCount} orphaned observables`);
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
880
|
};
|
|
@@ -1185,7 +1185,7 @@ var NativeDocument = (function (exports) {
|
|
|
1185
1185
|
}
|
|
1186
1186
|
}
|
|
1187
1187
|
{
|
|
1188
|
-
PluginsManager.emit('CreateObservable', this);
|
|
1188
|
+
PluginsManager$1.emit('CreateObservable', this);
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
1191
1191
|
|
|
@@ -1292,12 +1292,12 @@ var NativeDocument = (function (exports) {
|
|
|
1292
1292
|
this.$previousValue = this.$currentValue;
|
|
1293
1293
|
this.$currentValue = newValue;
|
|
1294
1294
|
{
|
|
1295
|
-
PluginsManager.emit('ObservableBeforeChange', this);
|
|
1295
|
+
PluginsManager$1.emit('ObservableBeforeChange', this);
|
|
1296
1296
|
}
|
|
1297
1297
|
this.trigger($setOperation);
|
|
1298
1298
|
this.$previousValue = null;
|
|
1299
1299
|
{
|
|
1300
|
-
PluginsManager.emit('ObservableAfterChange', this);
|
|
1300
|
+
PluginsManager$1.emit('ObservableAfterChange', this);
|
|
1301
1301
|
}
|
|
1302
1302
|
};
|
|
1303
1303
|
|
|
@@ -1375,7 +1375,7 @@ var NativeDocument = (function (exports) {
|
|
|
1375
1375
|
ObservableItem.prototype.subscribe = function(callback) {
|
|
1376
1376
|
{
|
|
1377
1377
|
if (this.$isCleanedUp) {
|
|
1378
|
-
DebugManager$
|
|
1378
|
+
DebugManager$2.warn('Observable subscription', '⚠️ Attempted to subscribe to a cleaned up observable.');
|
|
1379
1379
|
return;
|
|
1380
1380
|
}
|
|
1381
1381
|
if (typeof callback !== 'function') {
|
|
@@ -1387,7 +1387,7 @@ var NativeDocument = (function (exports) {
|
|
|
1387
1387
|
this.$listeners.push(callback);
|
|
1388
1388
|
this.assocTrigger();
|
|
1389
1389
|
{
|
|
1390
|
-
PluginsManager.emit('ObservableSubscribe', this);
|
|
1390
|
+
PluginsManager$1.emit('ObservableSubscribe', this);
|
|
1391
1391
|
}
|
|
1392
1392
|
};
|
|
1393
1393
|
|
|
@@ -1498,7 +1498,7 @@ var NativeDocument = (function (exports) {
|
|
|
1498
1498
|
}
|
|
1499
1499
|
this.assocTrigger();
|
|
1500
1500
|
{
|
|
1501
|
-
PluginsManager.emit('ObservableUnsubscribe', this);
|
|
1501
|
+
PluginsManager$1.emit('ObservableUnsubscribe', this);
|
|
1502
1502
|
}
|
|
1503
1503
|
};
|
|
1504
1504
|
|
|
@@ -1972,7 +1972,7 @@ var NativeDocument = (function (exports) {
|
|
|
1972
1972
|
Function.prototype.toNdElement = function () {
|
|
1973
1973
|
const child = this;
|
|
1974
1974
|
{
|
|
1975
|
-
PluginsManager.emit('BeforeProcessComponent', child);
|
|
1975
|
+
PluginsManager$1.emit('BeforeProcessComponent', child);
|
|
1976
1976
|
}
|
|
1977
1977
|
return ElementCreator.getChild(child());
|
|
1978
1978
|
};
|
|
@@ -2155,14 +2155,14 @@ var NativeDocument = (function (exports) {
|
|
|
2155
2155
|
processChildren: (children, parent) => {
|
|
2156
2156
|
if(children === null) return;
|
|
2157
2157
|
{
|
|
2158
|
-
PluginsManager.emit('BeforeProcessChildren', parent);
|
|
2158
|
+
PluginsManager$1.emit('BeforeProcessChildren', parent);
|
|
2159
2159
|
}
|
|
2160
2160
|
let child = ElementCreator.getChild(children);
|
|
2161
2161
|
if(child) {
|
|
2162
2162
|
parent.appendChild(child);
|
|
2163
2163
|
}
|
|
2164
2164
|
{
|
|
2165
|
-
PluginsManager.emit('AfterProcessChildren', parent);
|
|
2165
|
+
PluginsManager$1.emit('AfterProcessChildren', parent);
|
|
2166
2166
|
}
|
|
2167
2167
|
},
|
|
2168
2168
|
async safeRemove(element) {
|
|
@@ -2313,13 +2313,6 @@ var NativeDocument = (function (exports) {
|
|
|
2313
2313
|
function Anchor(name, isUniqueChild = false) {
|
|
2314
2314
|
const anchorFragment = new AnchorWithSentinel(name);
|
|
2315
2315
|
|
|
2316
|
-
/**
|
|
2317
|
-
* State :
|
|
2318
|
-
* 1. Not injected in the DOM
|
|
2319
|
-
* 2. Injected in the DOM and should be the only child of parent
|
|
2320
|
-
* 3. Injected in the DOM and the parent may have other children
|
|
2321
|
-
*/
|
|
2322
|
-
|
|
2323
2316
|
anchorFragment.onConnectedOnce((parent) => {
|
|
2324
2317
|
if(isUniqueChild) {
|
|
2325
2318
|
oneChildAnchorOverwriting(anchorFragment, parent);
|
|
@@ -2426,7 +2419,7 @@ var NativeDocument = (function (exports) {
|
|
|
2426
2419
|
return;
|
|
2427
2420
|
}
|
|
2428
2421
|
if(isParentUniqueChild(parent)) {
|
|
2429
|
-
anchorFragment.
|
|
2422
|
+
anchorFragment.nativeAppend.apply(anchorFragment, parent.childNodes);
|
|
2430
2423
|
parent.replaceChildren(anchorStart, anchorEnd);
|
|
2431
2424
|
return;
|
|
2432
2425
|
}
|
|
@@ -2455,11 +2448,11 @@ var NativeDocument = (function (exports) {
|
|
|
2455
2448
|
return;
|
|
2456
2449
|
}
|
|
2457
2450
|
if(isParentUniqueChild(parent)) {
|
|
2458
|
-
parent.replaceChildren(anchorStart,
|
|
2451
|
+
parent.replaceChildren(anchorStart, child, anchorEnd);
|
|
2459
2452
|
return;
|
|
2460
2453
|
}
|
|
2461
2454
|
anchorFragment.removeChildren();
|
|
2462
|
-
parent.insertBefore(
|
|
2455
|
+
parent.insertBefore(child, anchorEnd);
|
|
2463
2456
|
};
|
|
2464
2457
|
|
|
2465
2458
|
anchorFragment.setContent = anchorFragment.replaceContent;
|
|
@@ -3388,7 +3381,7 @@ var NativeDocument = (function (exports) {
|
|
|
3388
3381
|
return {
|
|
3389
3382
|
add(key, value) {
|
|
3390
3383
|
if(isArray) {
|
|
3391
|
-
data.push(key+'
|
|
3384
|
+
data.push(key+': '+value);
|
|
3392
3385
|
return;
|
|
3393
3386
|
}
|
|
3394
3387
|
data[key] = value;
|
|
@@ -3852,7 +3845,7 @@ var NativeDocument = (function (exports) {
|
|
|
3852
3845
|
|
|
3853
3846
|
ObservableItem.call(this, target, configs);
|
|
3854
3847
|
{
|
|
3855
|
-
PluginsManager.emit('CreateObservableArray', this);
|
|
3848
|
+
PluginsManager$1.emit('CreateObservableArray', this);
|
|
3856
3849
|
}
|
|
3857
3850
|
};
|
|
3858
3851
|
|
|
@@ -4486,7 +4479,7 @@ var NativeDocument = (function (exports) {
|
|
|
4486
4479
|
const observable = new ObservableItem(initialValue);
|
|
4487
4480
|
const updatedValue = nextTick(() => observable.set(callback()));
|
|
4488
4481
|
{
|
|
4489
|
-
PluginsManager.emit('CreateObservableComputed', observable, dependencies);
|
|
4482
|
+
PluginsManager$1.emit('CreateObservableComputed', observable, dependencies);
|
|
4490
4483
|
}
|
|
4491
4484
|
|
|
4492
4485
|
if(Validator.isFunction(dependencies)) {
|
|
@@ -4521,7 +4514,7 @@ var NativeDocument = (function (exports) {
|
|
|
4521
4514
|
const $getStoreOrThrow = (method, name) => {
|
|
4522
4515
|
const item = $stores.get(name);
|
|
4523
4516
|
if (!item) {
|
|
4524
|
-
DebugManager$
|
|
4517
|
+
DebugManager$2.error('Store', `Store.${method}('${name}') : store not found. Did you call Store.create('${name}') first?`);
|
|
4525
4518
|
throw new NativeDocumentError(
|
|
4526
4519
|
`Store.${method}('${name}') : store not found.`
|
|
4527
4520
|
);
|
|
@@ -4534,7 +4527,7 @@ var NativeDocument = (function (exports) {
|
|
|
4534
4527
|
*/
|
|
4535
4528
|
const $applyReadOnly = (observer, name, context) => {
|
|
4536
4529
|
const readOnlyError = (method) => () => {
|
|
4537
|
-
DebugManager$
|
|
4530
|
+
DebugManager$2.error('Store', `Store.${context}('${name}') is read-only. '${method}()' is not allowed.`);
|
|
4538
4531
|
throw new NativeDocumentError(
|
|
4539
4532
|
`Store.${context}('${name}') is read-only.`
|
|
4540
4533
|
);
|
|
@@ -4565,7 +4558,7 @@ var NativeDocument = (function (exports) {
|
|
|
4565
4558
|
*/
|
|
4566
4559
|
create(name, value) {
|
|
4567
4560
|
if ($stores.has(name)) {
|
|
4568
|
-
DebugManager$
|
|
4561
|
+
DebugManager$2.warn('Store', `Store.create('${name}') : a store with this name already exists. Use Store.get('${name}') to retrieve it.`);
|
|
4569
4562
|
throw new NativeDocumentError(
|
|
4570
4563
|
`Store.create('${name}') : a store with this name already exists.`
|
|
4571
4564
|
);
|
|
@@ -4586,7 +4579,7 @@ var NativeDocument = (function (exports) {
|
|
|
4586
4579
|
*/
|
|
4587
4580
|
createResettable(name, value) {
|
|
4588
4581
|
if ($stores.has(name)) {
|
|
4589
|
-
DebugManager$
|
|
4582
|
+
DebugManager$2.warn('Store', `Store.createResettable('${name}') : a store with this name already exists.`);
|
|
4590
4583
|
throw new NativeDocumentError(
|
|
4591
4584
|
`Store.createResettable('${name}') : a store with this name already exists.`
|
|
4592
4585
|
);
|
|
@@ -4622,7 +4615,7 @@ var NativeDocument = (function (exports) {
|
|
|
4622
4615
|
*/
|
|
4623
4616
|
createComposed(name, computation, dependencies) {
|
|
4624
4617
|
if ($stores.has(name)) {
|
|
4625
|
-
DebugManager$
|
|
4618
|
+
DebugManager$2.warn('Store', `Store.createComposed('${name}') : a store with this name already exists.`);
|
|
4626
4619
|
throw new NativeDocumentError(
|
|
4627
4620
|
`Store.createComposed('${name}') : a store with this name already exists.`
|
|
4628
4621
|
);
|
|
@@ -4645,7 +4638,7 @@ var NativeDocument = (function (exports) {
|
|
|
4645
4638
|
}
|
|
4646
4639
|
const depItem = $stores.get(depName);
|
|
4647
4640
|
if (!depItem) {
|
|
4648
|
-
DebugManager$
|
|
4641
|
+
DebugManager$2.error('Store', `Store.createComposed('${name}') : dependency '${depName}' not found. Create it first.`);
|
|
4649
4642
|
throw new NativeDocumentError(
|
|
4650
4643
|
`Store.createComposed('${name}') : dependency store '${depName}' not found.`
|
|
4651
4644
|
);
|
|
@@ -4679,13 +4672,13 @@ var NativeDocument = (function (exports) {
|
|
|
4679
4672
|
reset(name) {
|
|
4680
4673
|
const item = $getStoreOrThrow('reset', name);
|
|
4681
4674
|
if (item.composed) {
|
|
4682
|
-
DebugManager$
|
|
4675
|
+
DebugManager$2.error('Store', `Store.reset('${name}') : composed stores cannot be reset. Their value is derived from dependencies.`);
|
|
4683
4676
|
throw new NativeDocumentError(
|
|
4684
4677
|
`Store.reset('${name}') : composed stores cannot be reset.`
|
|
4685
4678
|
);
|
|
4686
4679
|
}
|
|
4687
4680
|
if (!item.resettable) {
|
|
4688
|
-
DebugManager$
|
|
4681
|
+
DebugManager$2.error('Store', `Store.reset('${name}') : this store is not resettable. Use Store.createResettable('${name}', value) instead of Store.create().`);
|
|
4689
4682
|
throw new NativeDocumentError(
|
|
4690
4683
|
`Store.reset('${name}') : this store is not resettable. Use Store.createResettable('${name}', value) instead of Store.create().`
|
|
4691
4684
|
);
|
|
@@ -4706,7 +4699,7 @@ var NativeDocument = (function (exports) {
|
|
|
4706
4699
|
const item = $getStoreOrThrow('use', name);
|
|
4707
4700
|
|
|
4708
4701
|
if (item.composed) {
|
|
4709
|
-
DebugManager$
|
|
4702
|
+
DebugManager$2.error('Store', `Store.use('${name}') : composed stores are read-only. Use Store.follow('${name}') instead.`);
|
|
4710
4703
|
throw new NativeDocumentError(
|
|
4711
4704
|
`Store.use('${name}') : composed stores are read-only. Use Store.follow('${name}') instead.`
|
|
4712
4705
|
);
|
|
@@ -4773,7 +4766,7 @@ var NativeDocument = (function (exports) {
|
|
|
4773
4766
|
get(name) {
|
|
4774
4767
|
const item = $stores.get(name);
|
|
4775
4768
|
if (!item) {
|
|
4776
|
-
DebugManager$
|
|
4769
|
+
DebugManager$2.warn('Store', `Store.get('${name}') : store not found.`);
|
|
4777
4770
|
return null;
|
|
4778
4771
|
}
|
|
4779
4772
|
return item.observer;
|
|
@@ -4795,7 +4788,7 @@ var NativeDocument = (function (exports) {
|
|
|
4795
4788
|
delete(name) {
|
|
4796
4789
|
const item = $stores.get(name);
|
|
4797
4790
|
if (!item) {
|
|
4798
|
-
DebugManager$
|
|
4791
|
+
DebugManager$2.warn('Store', `Store.delete('${name}') : store not found, nothing to delete.`);
|
|
4799
4792
|
return;
|
|
4800
4793
|
}
|
|
4801
4794
|
item.subscribers.forEach(follower => follower.destroy());
|
|
@@ -4897,7 +4890,7 @@ var NativeDocument = (function (exports) {
|
|
|
4897
4890
|
return undefined;
|
|
4898
4891
|
},
|
|
4899
4892
|
set(target, prop, value) {
|
|
4900
|
-
DebugManager$
|
|
4893
|
+
DebugManager$2.error('Store', `Forbidden: You cannot overwrite the store key '${String(prop)}'. Use .use('${String(prop)}').set(value) instead.`);
|
|
4901
4894
|
throw new NativeDocumentError(`Store structure is immutable. Use .set() on the observable.`);
|
|
4902
4895
|
},
|
|
4903
4896
|
deleteProperty(target, prop) {
|
|
@@ -4985,7 +4978,7 @@ var NativeDocument = (function (exports) {
|
|
|
4985
4978
|
}
|
|
4986
4979
|
cache.set(keyId, { keyId, isNew: true, child: new WeakRef(child), indexObserver});
|
|
4987
4980
|
} catch (e) {
|
|
4988
|
-
DebugManager$
|
|
4981
|
+
DebugManager$2.error('ForEach', `Error creating element for key ${keyId}` , e);
|
|
4989
4982
|
throw e;
|
|
4990
4983
|
}
|
|
4991
4984
|
return keyId;
|
|
@@ -5355,7 +5348,7 @@ var NativeDocument = (function (exports) {
|
|
|
5355
5348
|
*/
|
|
5356
5349
|
const ShowIf = function(condition, child, { comment = null, shouldKeepInCache = true} = {}) {
|
|
5357
5350
|
if(!(Validator.isObservable(condition)) && !Validator.isObservableWhenResult(condition)) {
|
|
5358
|
-
return DebugManager$
|
|
5351
|
+
return DebugManager$2.warn('ShowIf', "ShowIf : condition must be an Observable / "+comment, condition);
|
|
5359
5352
|
}
|
|
5360
5353
|
const element = Anchor('Show if : '+(comment || ''));
|
|
5361
5354
|
|
|
@@ -6774,7 +6767,7 @@ var NativeDocument = (function (exports) {
|
|
|
6774
6767
|
window.history.pushState({ name: route.name(), params, path}, route.name() || path , path);
|
|
6775
6768
|
this.handleRouteChange(route, params, query, path);
|
|
6776
6769
|
} catch (e) {
|
|
6777
|
-
DebugManager$
|
|
6770
|
+
DebugManager$2.error('HistoryRouter', 'Error in pushState', e);
|
|
6778
6771
|
}
|
|
6779
6772
|
};
|
|
6780
6773
|
/**
|
|
@@ -6787,7 +6780,7 @@ var NativeDocument = (function (exports) {
|
|
|
6787
6780
|
window.history.replaceState({ name: route.name(), params, path}, route.name() || path , path);
|
|
6788
6781
|
this.handleRouteChange(route, params, {}, path);
|
|
6789
6782
|
} catch(e) {
|
|
6790
|
-
DebugManager$
|
|
6783
|
+
DebugManager$2.error('HistoryRouter', 'Error in replaceState', e);
|
|
6791
6784
|
}
|
|
6792
6785
|
};
|
|
6793
6786
|
this.forward = function() {
|
|
@@ -6814,7 +6807,7 @@ var NativeDocument = (function (exports) {
|
|
|
6814
6807
|
}
|
|
6815
6808
|
this.handleRouteChange(route, params, query, path);
|
|
6816
6809
|
} catch(e) {
|
|
6817
|
-
DebugManager$
|
|
6810
|
+
DebugManager$2.error('HistoryRouter', 'Error in popstate event', e);
|
|
6818
6811
|
}
|
|
6819
6812
|
});
|
|
6820
6813
|
const { route, params, query, path } = this.resolve(defaultPath || (window.location.pathname+window.location.search));
|
|
@@ -6919,7 +6912,6 @@ var NativeDocument = (function (exports) {
|
|
|
6919
6912
|
anchor = Anchor(path);
|
|
6920
6913
|
anchor.appendChild(node);
|
|
6921
6914
|
}
|
|
6922
|
-
console.log(anchor);
|
|
6923
6915
|
$routeInstanceAnchors.set(node, anchor);
|
|
6924
6916
|
return anchor;
|
|
6925
6917
|
};
|
|
@@ -6955,10 +6947,12 @@ var NativeDocument = (function (exports) {
|
|
|
6955
6947
|
if(cachedLayout === $currentLayout) {
|
|
6956
6948
|
const layoutAnchor = getNodeAnchorForLayout(nodeToInsert, path);
|
|
6957
6949
|
removeLastNodeInserted();
|
|
6950
|
+
$lastNodeInserted = nodeToInsert;
|
|
6958
6951
|
layoutAnchor.replaceContent(nodeToInsert);
|
|
6959
6952
|
return;
|
|
6960
6953
|
}
|
|
6961
6954
|
cleanContainer();
|
|
6955
|
+
$lastNodeInserted = nodeToInsert;
|
|
6962
6956
|
$currentLayout = cachedLayout;
|
|
6963
6957
|
const layoutAnchor = getNodeAnchorForLayout(nodeToInsert, path);
|
|
6964
6958
|
layoutAnchor.replaceContent(nodeToInsert);
|
|
@@ -6966,6 +6960,7 @@ var NativeDocument = (function (exports) {
|
|
|
6966
6960
|
return;
|
|
6967
6961
|
}
|
|
6968
6962
|
cleanContainer();
|
|
6963
|
+
$lastNodeInserted = nodeToInsert;
|
|
6969
6964
|
const anchor = getNodeAnchorForLayout(nodeToInsert, path);
|
|
6970
6965
|
|
|
6971
6966
|
$currentLayout = ElementCreator.getChild(layout(anchor));
|
|
@@ -7041,7 +7036,7 @@ var NativeDocument = (function (exports) {
|
|
|
7041
7036
|
listener(request);
|
|
7042
7037
|
next && next(request);
|
|
7043
7038
|
} catch (e) {
|
|
7044
|
-
DebugManager$
|
|
7039
|
+
DebugManager$2.warn('Route Listener', 'Error in listener:', e);
|
|
7045
7040
|
}
|
|
7046
7041
|
}
|
|
7047
7042
|
};
|
|
@@ -7219,7 +7214,7 @@ var NativeDocument = (function (exports) {
|
|
|
7219
7214
|
*/
|
|
7220
7215
|
Router.create = function(options, callback) {
|
|
7221
7216
|
if(!Validator.isFunction(callback)) {
|
|
7222
|
-
DebugManager$
|
|
7217
|
+
DebugManager$2.error('Router', 'Callback must be a function');
|
|
7223
7218
|
throw new RouterError('Callback must be a function');
|
|
7224
7219
|
}
|
|
7225
7220
|
const router = new Router(options);
|
|
@@ -7415,6 +7410,8 @@ var NativeDocument = (function (exports) {
|
|
|
7415
7410
|
__proto__: null,
|
|
7416
7411
|
Cache: cache,
|
|
7417
7412
|
NativeFetch: NativeFetch,
|
|
7413
|
+
classPropertyAccumulator: classPropertyAccumulator,
|
|
7414
|
+
cssPropertyAccumulator: cssPropertyAccumulator,
|
|
7418
7415
|
filters: index
|
|
7419
7416
|
});
|
|
7420
7417
|
|
|
@@ -7423,7 +7420,7 @@ var NativeDocument = (function (exports) {
|
|
|
7423
7420
|
exports.HtmlElementWrapper = HtmlElementWrapper;
|
|
7424
7421
|
exports.NDElement = NDElement;
|
|
7425
7422
|
exports.Observable = Observable;
|
|
7426
|
-
exports.PluginsManager = PluginsManager;
|
|
7423
|
+
exports.PluginsManager = PluginsManager$1;
|
|
7427
7424
|
exports.SingletonView = SingletonView;
|
|
7428
7425
|
exports.Store = Store;
|
|
7429
7426
|
exports.StoreFactory = StoreFactory;
|