@next-core/brick-kit 2.109.0 → 2.110.0
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/CHANGELOG.md +11 -0
- package/dist/index.bundle.js +40 -35
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +40 -35
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/StoryboardFunctionRegistryFactory.d.ts.map +1 -1
- package/dist/types/internal/getGeneralGlobals.d.ts +1 -0
- package/dist/types/internal/getGeneralGlobals.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1511,6 +1511,39 @@ function resetPermissionPreChecks() {
|
|
|
1511
1511
|
permissionMap.clear();
|
|
1512
1512
|
}
|
|
1513
1513
|
|
|
1514
|
+
var THROW = () => {
|
|
1515
|
+
throw new Error("Can't modify read-only proxy object");
|
|
1516
|
+
};
|
|
1517
|
+
|
|
1518
|
+
var readOnlyHandler = {
|
|
1519
|
+
set: THROW,
|
|
1520
|
+
defineProperty: THROW,
|
|
1521
|
+
deleteProperty: THROW,
|
|
1522
|
+
setPrototypeOf: THROW
|
|
1523
|
+
};
|
|
1524
|
+
function getReadOnlyProxy(object) {
|
|
1525
|
+
return new Proxy(object, readOnlyHandler);
|
|
1526
|
+
} // First, we want to make accessing property of globals lazy,
|
|
1527
|
+
// So we use *Proxy* to make a dynamic accessor for each of these globals.
|
|
1528
|
+
// But we also want to keep them working in devtools.
|
|
1529
|
+
|
|
1530
|
+
function getDynamicReadOnlyProxy(_ref) {
|
|
1531
|
+
var {
|
|
1532
|
+
get,
|
|
1533
|
+
ownKeys
|
|
1534
|
+
} = _ref;
|
|
1535
|
+
|
|
1536
|
+
if (getDevHook()) {
|
|
1537
|
+
// In devtools, we extract them at beginning.
|
|
1538
|
+
var target = Object.fromEntries(ownKeys(null).map(key => [key, get(null, key, null)]));
|
|
1539
|
+
return getReadOnlyProxy(target);
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
return new Proxy(Object.freeze({}), {
|
|
1543
|
+
get
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1514
1547
|
// `GeneralGlobals` are globals which are page-state-agnostic,
|
|
1515
1548
|
// thus they can be used both in storyboard expressions and functions.
|
|
1516
1549
|
function getGeneralGlobals(attemptToVisitGlobals, options) {
|
|
@@ -1532,7 +1565,8 @@ function getIndividualGlobal(variableName, _ref) {
|
|
|
1532
1565
|
collectCoverage,
|
|
1533
1566
|
widgetId,
|
|
1534
1567
|
app,
|
|
1535
|
-
storyboardFunctions
|
|
1568
|
+
storyboardFunctions,
|
|
1569
|
+
isStoryboardFunction
|
|
1536
1570
|
} = _ref;
|
|
1537
1571
|
|
|
1538
1572
|
switch (variableName) {
|
|
@@ -1560,6 +1594,9 @@ function getIndividualGlobal(variableName, _ref) {
|
|
|
1560
1594
|
return {
|
|
1561
1595
|
getTheme: collectCoverage ? () => "light" : getTheme
|
|
1562
1596
|
};
|
|
1597
|
+
|
|
1598
|
+
case "console":
|
|
1599
|
+
return isStoryboardFunction ? getReadOnlyProxy(console) : undefined;
|
|
1563
1600
|
}
|
|
1564
1601
|
}
|
|
1565
1602
|
|
|
@@ -1646,7 +1683,8 @@ function StoryboardFunctionRegistryFactory() {
|
|
|
1646
1683
|
collectCoverage,
|
|
1647
1684
|
widgetId,
|
|
1648
1685
|
app: currentApp,
|
|
1649
|
-
storyboardFunctions
|
|
1686
|
+
storyboardFunctions,
|
|
1687
|
+
isStoryboardFunction: true
|
|
1650
1688
|
})),
|
|
1651
1689
|
hooks: collector && {
|
|
1652
1690
|
beforeEvaluate: collector.beforeEvaluate,
|
|
@@ -1700,39 +1738,6 @@ function registerWidgetFunctions(widgetId, functions) {
|
|
|
1700
1738
|
registerStoryboardFunctions(functions);
|
|
1701
1739
|
}
|
|
1702
1740
|
|
|
1703
|
-
var THROW = () => {
|
|
1704
|
-
throw new Error("Can't modify read-only proxy object");
|
|
1705
|
-
};
|
|
1706
|
-
|
|
1707
|
-
var readOnlyHandler = {
|
|
1708
|
-
set: THROW,
|
|
1709
|
-
defineProperty: THROW,
|
|
1710
|
-
deleteProperty: THROW,
|
|
1711
|
-
setPrototypeOf: THROW
|
|
1712
|
-
};
|
|
1713
|
-
function getReadOnlyProxy(object) {
|
|
1714
|
-
return new Proxy(object, readOnlyHandler);
|
|
1715
|
-
} // First, we want to make accessing property of globals lazy,
|
|
1716
|
-
// So we use *Proxy* to make a dynamic accessor for each of these globals.
|
|
1717
|
-
// But we also want to keep them working in devtools.
|
|
1718
|
-
|
|
1719
|
-
function getDynamicReadOnlyProxy(_ref) {
|
|
1720
|
-
var {
|
|
1721
|
-
get,
|
|
1722
|
-
ownKeys
|
|
1723
|
-
} = _ref;
|
|
1724
|
-
|
|
1725
|
-
if (getDevHook()) {
|
|
1726
|
-
// In devtools, we extract them at beginning.
|
|
1727
|
-
var target = Object.fromEntries(ownKeys(null).map(key => [key, get(null, key, null)]));
|
|
1728
|
-
return getReadOnlyProxy(target);
|
|
1729
|
-
}
|
|
1730
|
-
|
|
1731
|
-
return new Proxy(Object.freeze({}), {
|
|
1732
|
-
get
|
|
1733
|
-
});
|
|
1734
|
-
}
|
|
1735
|
-
|
|
1736
1741
|
/*! (c) Andrea Giammarchi - ISC */
|
|
1737
1742
|
var self = {};
|
|
1738
1743
|
|