native-document 1.0.111 → 1.0.112
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 +20 -20
- package/dist/native-document.dev.js +81 -75
- package/dist/native-document.dev.js.map +1 -1
- package/dist/native-document.min.js +1 -1
- package/package.json +1 -1
- package/src/core/wrappers/template-cloner/TemplateCloner.js +13 -16
- package/src/core/wrappers/template-cloner/utils.js +21 -11
|
@@ -363,16 +363,16 @@ var NativeComponents = (function (exports) {
|
|
|
363
363
|
// });
|
|
364
364
|
};
|
|
365
365
|
|
|
366
|
-
let DebugManager = {};
|
|
366
|
+
let DebugManager$1 = {};
|
|
367
367
|
{
|
|
368
|
-
DebugManager = {
|
|
368
|
+
DebugManager$1 = {
|
|
369
369
|
log() {},
|
|
370
370
|
warn() {},
|
|
371
371
|
error() {},
|
|
372
372
|
disable() {}
|
|
373
373
|
};
|
|
374
374
|
}
|
|
375
|
-
var DebugManager
|
|
375
|
+
var DebugManager = DebugManager$1;
|
|
376
376
|
|
|
377
377
|
/**
|
|
378
378
|
*
|
|
@@ -861,17 +861,17 @@ var NativeComponents = (function (exports) {
|
|
|
861
861
|
const method = methods[name];
|
|
862
862
|
|
|
863
863
|
if (typeof method !== 'function') {
|
|
864
|
-
DebugManager
|
|
864
|
+
DebugManager.warn('NDElement.extend', `"${name}" is not a function, skipping`);
|
|
865
865
|
continue;
|
|
866
866
|
}
|
|
867
867
|
|
|
868
868
|
if (protectedMethods.has(name)) {
|
|
869
|
-
DebugManager
|
|
869
|
+
DebugManager.error('NDElement.extend', `Cannot override protected method "${name}"`);
|
|
870
870
|
throw new NativeDocumentError(`Cannot override protected method "${name}"`);
|
|
871
871
|
}
|
|
872
872
|
|
|
873
873
|
if (NDElement.prototype[name]) {
|
|
874
|
-
DebugManager
|
|
874
|
+
DebugManager.warn('NDElement.extend', `Overwriting existing prototype method "${name}"`);
|
|
875
875
|
}
|
|
876
876
|
|
|
877
877
|
NDElement.prototype[name] = method;
|
|
@@ -1060,7 +1060,7 @@ var NativeComponents = (function (exports) {
|
|
|
1060
1060
|
anchorFragment.appendChild = function(child, before = null) {
|
|
1061
1061
|
const parent = anchorEnd.parentNode;
|
|
1062
1062
|
if(!parent) {
|
|
1063
|
-
DebugManager
|
|
1063
|
+
DebugManager.error('Anchor', 'Anchor : parent not found', child);
|
|
1064
1064
|
return;
|
|
1065
1065
|
}
|
|
1066
1066
|
before = before ?? anchorEnd;
|
|
@@ -1240,7 +1240,7 @@ var NativeComponents = (function (exports) {
|
|
|
1240
1240
|
}
|
|
1241
1241
|
}
|
|
1242
1242
|
if (cleanedCount > 0) {
|
|
1243
|
-
DebugManager
|
|
1243
|
+
DebugManager.log('Memory Auto Clean', `🧹 Cleaned ${cleanedCount} orphaned observables`);
|
|
1244
1244
|
}
|
|
1245
1245
|
}
|
|
1246
1246
|
};
|
|
@@ -1447,7 +1447,7 @@ var NativeComponents = (function (exports) {
|
|
|
1447
1447
|
const $getStoreOrThrow = (method, name) => {
|
|
1448
1448
|
const item = $stores.get(name);
|
|
1449
1449
|
if (!item) {
|
|
1450
|
-
DebugManager
|
|
1450
|
+
DebugManager.error('Store', `Store.${method}('${name}') : store not found. Did you call Store.create('${name}') first?`);
|
|
1451
1451
|
throw new NativeDocumentError(
|
|
1452
1452
|
`Store.${method}('${name}') : store not found.`
|
|
1453
1453
|
);
|
|
@@ -1460,7 +1460,7 @@ var NativeComponents = (function (exports) {
|
|
|
1460
1460
|
*/
|
|
1461
1461
|
const $applyReadOnly = (observer, name, context) => {
|
|
1462
1462
|
const readOnlyError = (method) => () => {
|
|
1463
|
-
DebugManager
|
|
1463
|
+
DebugManager.error('Store', `Store.${context}('${name}') is read-only. '${method}()' is not allowed.`);
|
|
1464
1464
|
throw new NativeDocumentError(
|
|
1465
1465
|
`Store.${context}('${name}') is read-only.`
|
|
1466
1466
|
);
|
|
@@ -1491,7 +1491,7 @@ var NativeComponents = (function (exports) {
|
|
|
1491
1491
|
*/
|
|
1492
1492
|
create(name, value) {
|
|
1493
1493
|
if ($stores.has(name)) {
|
|
1494
|
-
DebugManager
|
|
1494
|
+
DebugManager.warn('Store', `Store.create('${name}') : a store with this name already exists. Use Store.get('${name}') to retrieve it.`);
|
|
1495
1495
|
throw new NativeDocumentError(
|
|
1496
1496
|
`Store.create('${name}') : a store with this name already exists.`
|
|
1497
1497
|
);
|
|
@@ -1512,7 +1512,7 @@ var NativeComponents = (function (exports) {
|
|
|
1512
1512
|
*/
|
|
1513
1513
|
createResettable(name, value) {
|
|
1514
1514
|
if ($stores.has(name)) {
|
|
1515
|
-
DebugManager
|
|
1515
|
+
DebugManager.warn('Store', `Store.createResettable('${name}') : a store with this name already exists.`);
|
|
1516
1516
|
throw new NativeDocumentError(
|
|
1517
1517
|
`Store.createResettable('${name}') : a store with this name already exists.`
|
|
1518
1518
|
);
|
|
@@ -1548,7 +1548,7 @@ var NativeComponents = (function (exports) {
|
|
|
1548
1548
|
*/
|
|
1549
1549
|
createComposed(name, computation, dependencies) {
|
|
1550
1550
|
if ($stores.has(name)) {
|
|
1551
|
-
DebugManager
|
|
1551
|
+
DebugManager.warn('Store', `Store.createComposed('${name}') : a store with this name already exists.`);
|
|
1552
1552
|
throw new NativeDocumentError(
|
|
1553
1553
|
`Store.createComposed('${name}') : a store with this name already exists.`
|
|
1554
1554
|
);
|
|
@@ -1571,7 +1571,7 @@ var NativeComponents = (function (exports) {
|
|
|
1571
1571
|
}
|
|
1572
1572
|
const depItem = $stores.get(depName);
|
|
1573
1573
|
if (!depItem) {
|
|
1574
|
-
DebugManager
|
|
1574
|
+
DebugManager.error('Store', `Store.createComposed('${name}') : dependency '${depName}' not found. Create it first.`);
|
|
1575
1575
|
throw new NativeDocumentError(
|
|
1576
1576
|
`Store.createComposed('${name}') : dependency store '${depName}' not found.`
|
|
1577
1577
|
);
|
|
@@ -1605,13 +1605,13 @@ var NativeComponents = (function (exports) {
|
|
|
1605
1605
|
reset(name) {
|
|
1606
1606
|
const item = $getStoreOrThrow('reset', name);
|
|
1607
1607
|
if (item.composed) {
|
|
1608
|
-
DebugManager
|
|
1608
|
+
DebugManager.error('Store', `Store.reset('${name}') : composed stores cannot be reset. Their value is derived from dependencies.`);
|
|
1609
1609
|
throw new NativeDocumentError(
|
|
1610
1610
|
`Store.reset('${name}') : composed stores cannot be reset.`
|
|
1611
1611
|
);
|
|
1612
1612
|
}
|
|
1613
1613
|
if (!item.resettable) {
|
|
1614
|
-
DebugManager
|
|
1614
|
+
DebugManager.error('Store', `Store.reset('${name}') : this store is not resettable. Use Store.createResettable('${name}', value) instead of Store.create().`);
|
|
1615
1615
|
throw new NativeDocumentError(
|
|
1616
1616
|
`Store.reset('${name}') : this store is not resettable. Use Store.createResettable('${name}', value) instead of Store.create().`
|
|
1617
1617
|
);
|
|
@@ -1632,7 +1632,7 @@ var NativeComponents = (function (exports) {
|
|
|
1632
1632
|
const item = $getStoreOrThrow('use', name);
|
|
1633
1633
|
|
|
1634
1634
|
if (item.composed) {
|
|
1635
|
-
DebugManager
|
|
1635
|
+
DebugManager.error('Store', `Store.use('${name}') : composed stores are read-only. Use Store.follow('${name}') instead.`);
|
|
1636
1636
|
throw new NativeDocumentError(
|
|
1637
1637
|
`Store.use('${name}') : composed stores are read-only. Use Store.follow('${name}') instead.`
|
|
1638
1638
|
);
|
|
@@ -1699,7 +1699,7 @@ var NativeComponents = (function (exports) {
|
|
|
1699
1699
|
get(name) {
|
|
1700
1700
|
const item = $stores.get(name);
|
|
1701
1701
|
if (!item) {
|
|
1702
|
-
DebugManager
|
|
1702
|
+
DebugManager.warn('Store', `Store.get('${name}') : store not found.`);
|
|
1703
1703
|
return null;
|
|
1704
1704
|
}
|
|
1705
1705
|
return item.observer;
|
|
@@ -1721,7 +1721,7 @@ var NativeComponents = (function (exports) {
|
|
|
1721
1721
|
delete(name) {
|
|
1722
1722
|
const item = $stores.get(name);
|
|
1723
1723
|
if (!item) {
|
|
1724
|
-
DebugManager
|
|
1724
|
+
DebugManager.warn('Store', `Store.delete('${name}') : store not found, nothing to delete.`);
|
|
1725
1725
|
return;
|
|
1726
1726
|
}
|
|
1727
1727
|
item.subscribers.forEach(follower => follower.destroy());
|
|
@@ -1823,7 +1823,7 @@ var NativeComponents = (function (exports) {
|
|
|
1823
1823
|
return undefined;
|
|
1824
1824
|
},
|
|
1825
1825
|
set(target, prop, value) {
|
|
1826
|
-
DebugManager
|
|
1826
|
+
DebugManager.error('Store', `Forbidden: You cannot overwrite the store key '${String(prop)}'. Use .use('${String(prop)}').set(value) instead.`);
|
|
1827
1827
|
throw new NativeDocumentError(`Store structure is immutable. Use .set() on the observable.`);
|
|
1828
1828
|
},
|
|
1829
1829
|
deleteProperty(target, prop) {
|