@uniformdev/canvas 19.173.1-alpha.17 → 19.176.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/dist/index.d.mts +42 -1456
- package/dist/index.d.ts +42 -1456
- package/dist/index.esm.js +19 -129
- package/dist/index.js +21 -132
- package/dist/index.mjs +19 -129
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
@@ -1631,56 +1631,21 @@ function evaluateCriterion(clause, rootOptions) {
|
|
1631
1631
|
return null;
|
1632
1632
|
}
|
1633
1633
|
|
1634
|
-
// src/enhancement/visibility/
|
1635
|
-
function
|
1636
|
-
|
1637
|
-
conditionalValues,
|
1638
|
-
keepIndeterminate,
|
1634
|
+
// src/enhancement/visibility/evaluateNodeVisibilityParameter.ts
|
1635
|
+
function evaluateNodeVisibilityParameter({
|
1636
|
+
parameter,
|
1639
1637
|
...evaluateGroupOptions
|
1640
1638
|
}) {
|
1641
|
-
|
1642
|
-
|
1643
|
-
currentValue: baseValue,
|
1644
|
-
remainingConditionalValues: evaluateGroupOptions.simplifyCriteria && conditionalValues ? [...conditionalValues] : conditionalValues,
|
1645
|
-
currentConditionIndex: -1
|
1646
|
-
};
|
1647
|
-
if (!conditionalValues) {
|
1648
|
-
return result;
|
1649
|
-
}
|
1650
|
-
const conditionIndexesToRemove = [];
|
1651
|
-
for (let i = 0; i < conditionalValues.length; i++) {
|
1652
|
-
const conditionalVariant = conditionalValues[i];
|
1653
|
-
if (result.matched) {
|
1654
|
-
conditionIndexesToRemove.push(i);
|
1655
|
-
continue;
|
1656
|
-
}
|
1657
|
-
const evaluationResult = evaluateVisibilityCriteriaGroup({
|
1658
|
-
...evaluateGroupOptions,
|
1659
|
-
criteriaGroup: conditionalVariant.when
|
1660
|
-
});
|
1661
|
-
if (evaluationResult === null) {
|
1662
|
-
if (keepIndeterminate) {
|
1663
|
-
authoritative = false;
|
1664
|
-
} else {
|
1665
|
-
conditionIndexesToRemove.push(i);
|
1666
|
-
}
|
1667
|
-
} else if (evaluationResult === true) {
|
1668
|
-
result.matched = conditionalVariant;
|
1669
|
-
result.currentValue = conditionalVariant.value;
|
1670
|
-
result.currentConditionIndex = i;
|
1671
|
-
conditionIndexesToRemove.push(i);
|
1672
|
-
} else {
|
1673
|
-
conditionIndexesToRemove.push(i);
|
1674
|
-
}
|
1675
|
-
}
|
1676
|
-
if (evaluateGroupOptions.simplifyCriteria) {
|
1677
|
-
for (let i = conditionIndexesToRemove.length - 1; i >= 0; i--) {
|
1678
|
-
result.remainingConditionalValues.splice(conditionIndexesToRemove[i], 1);
|
1679
|
-
}
|
1639
|
+
if (parameter == null ? void 0 : parameter.explicitlyHidden) {
|
1640
|
+
return false;
|
1680
1641
|
}
|
1681
|
-
if (
|
1682
|
-
|
1642
|
+
if (!(parameter == null ? void 0 : parameter.criteria)) {
|
1643
|
+
return true;
|
1683
1644
|
}
|
1645
|
+
const result = evaluateVisibilityCriteriaGroup({
|
1646
|
+
...evaluateGroupOptions,
|
1647
|
+
criteriaGroup: parameter.criteria
|
1648
|
+
});
|
1684
1649
|
return result;
|
1685
1650
|
}
|
1686
1651
|
|
@@ -1695,24 +1660,18 @@ function evaluateNodeVisibility({
|
|
1695
1660
|
var _a;
|
1696
1661
|
const properties = getPropertiesValue(node);
|
1697
1662
|
const vizCriteria = (_a = properties == null ? void 0 : properties[CANVAS_VIZ_CONTROL_PARAM]) == null ? void 0 : _a.value;
|
1698
|
-
|
1699
|
-
return false;
|
1700
|
-
}
|
1701
|
-
if (!(vizCriteria == null ? void 0 : vizCriteria.criteria)) {
|
1702
|
-
return true;
|
1703
|
-
}
|
1704
|
-
const result = evaluateVisibilityCriteriaGroup({
|
1663
|
+
const result = evaluateNodeVisibilityParameter({
|
1705
1664
|
...evaluateGroupOptions,
|
1706
|
-
|
1665
|
+
parameter: vizCriteria
|
1707
1666
|
});
|
1708
|
-
if (vizCriteria.criteria.clauses.length === 0 && evaluateGroupOptions.simplifyCriteria) {
|
1667
|
+
if ((vizCriteria == null ? void 0 : vizCriteria.criteria) && vizCriteria.criteria.clauses.length === 0 && evaluateGroupOptions.simplifyCriteria) {
|
1709
1668
|
properties == null ? true : delete properties[CANVAS_VIZ_CONTROL_PARAM];
|
1710
1669
|
}
|
1711
1670
|
return result;
|
1712
1671
|
}
|
1713
1672
|
|
1714
|
-
// src/enhancement/visibility/
|
1715
|
-
function
|
1673
|
+
// src/enhancement/visibility/evaluateWalkTreeVisibility.ts
|
1674
|
+
function evaluateWalkTreeVisibility({
|
1716
1675
|
rules,
|
1717
1676
|
showIndeterminate,
|
1718
1677
|
context
|
@@ -1729,69 +1688,6 @@ function evaluateWalkTreeNodeVisibility({
|
|
1729
1688
|
return true;
|
1730
1689
|
}
|
1731
1690
|
|
1732
|
-
// src/enhancement/visibility/evaluateWalkTreePropertyCriteria.ts
|
1733
|
-
function evaluateWalkTreePropertyCriteria({
|
1734
|
-
rules,
|
1735
|
-
node,
|
1736
|
-
keepIndeterminate
|
1737
|
-
}) {
|
1738
|
-
const properties = getPropertiesValue(node);
|
1739
|
-
if (!properties) {
|
1740
|
-
return;
|
1741
|
-
}
|
1742
|
-
Object.entries(properties).forEach(([propertyName, property]) => {
|
1743
|
-
var _a, _b, _c;
|
1744
|
-
if (property.locales || property.localesConditions) {
|
1745
|
-
const localesDefined = [
|
1746
|
-
...Object.keys((_a = property.locales) != null ? _a : {}),
|
1747
|
-
...Object.keys((_b = property.localesConditions) != null ? _b : {})
|
1748
|
-
];
|
1749
|
-
localesDefined.forEach((locale) => {
|
1750
|
-
var _a2, _b2, _c2, _d, _e, _f, _g;
|
1751
|
-
const { currentValue, remainingConditionalValues } = evaluatePropertyCriteria({
|
1752
|
-
baseValue: (_a2 = property.locales) == null ? void 0 : _a2[locale],
|
1753
|
-
conditionalValues: (_b2 = property.localesConditions) == null ? void 0 : _b2[locale],
|
1754
|
-
rules,
|
1755
|
-
simplifyCriteria: true,
|
1756
|
-
keepIndeterminate
|
1757
|
-
});
|
1758
|
-
if (currentValue === null) {
|
1759
|
-
(_c2 = property.locales) == null ? true : delete _c2[locale];
|
1760
|
-
if (!Object.keys((_d = property.locales) != null ? _d : {}).length) {
|
1761
|
-
delete properties[propertyName];
|
1762
|
-
}
|
1763
|
-
} else {
|
1764
|
-
(_e = property.locales) != null ? _e : property.locales = {};
|
1765
|
-
property.locales[locale] = currentValue;
|
1766
|
-
}
|
1767
|
-
if (!(remainingConditionalValues == null ? void 0 : remainingConditionalValues.length)) {
|
1768
|
-
(_f = property.localesConditions) == null ? true : delete _f[locale];
|
1769
|
-
} else {
|
1770
|
-
(_g = property.localesConditions) != null ? _g : property.localesConditions = {};
|
1771
|
-
property.localesConditions[locale] = remainingConditionalValues;
|
1772
|
-
}
|
1773
|
-
});
|
1774
|
-
if (!Object.keys((_c = property.localesConditions) != null ? _c : {}).length) {
|
1775
|
-
delete property.localesConditions;
|
1776
|
-
}
|
1777
|
-
} else {
|
1778
|
-
const { currentValue, remainingConditionalValues } = evaluatePropertyCriteria({
|
1779
|
-
baseValue: property.value,
|
1780
|
-
conditionalValues: property.conditions,
|
1781
|
-
rules,
|
1782
|
-
simplifyCriteria: true,
|
1783
|
-
keepIndeterminate
|
1784
|
-
});
|
1785
|
-
if (currentValue === null) {
|
1786
|
-
delete properties[propertyName];
|
1787
|
-
} else {
|
1788
|
-
property.value = currentValue;
|
1789
|
-
}
|
1790
|
-
property.conditions = remainingConditionalValues;
|
1791
|
-
}
|
1792
|
-
});
|
1793
|
-
}
|
1794
|
-
|
1795
1691
|
// src/enhancement/visibility/rules/evaluateStringMatch.ts
|
1796
1692
|
var isEvaluator = (criteria, matchValue) => {
|
1797
1693
|
if (Array.isArray(criteria)) {
|
@@ -1936,7 +1832,7 @@ function localize(options) {
|
|
1936
1832
|
return;
|
1937
1833
|
}
|
1938
1834
|
if (isUsingModernOptions) {
|
1939
|
-
const result =
|
1835
|
+
const result = evaluateWalkTreeVisibility({
|
1940
1836
|
context,
|
1941
1837
|
rules: vizControlLocaleRule,
|
1942
1838
|
showIndeterminate: true
|
@@ -1944,11 +1840,6 @@ function localize(options) {
|
|
1944
1840
|
if (!result) {
|
1945
1841
|
return;
|
1946
1842
|
}
|
1947
|
-
evaluateWalkTreePropertyCriteria({
|
1948
|
-
node: context.node,
|
1949
|
-
rules: vizControlLocaleRule,
|
1950
|
-
keepIndeterminate: true
|
1951
|
-
});
|
1952
1843
|
}
|
1953
1844
|
if (node.type === CANVAS_LOCALIZATION_TYPE) {
|
1954
1845
|
const locales = extractLocales({ component: node });
|
@@ -3203,10 +3094,9 @@ export {
|
|
3203
3094
|
createUniformApiEnhancer,
|
3204
3095
|
createVariableReference,
|
3205
3096
|
enhance,
|
3206
|
-
|
3097
|
+
evaluateNodeVisibilityParameter,
|
3207
3098
|
evaluateVisibilityCriteriaGroup,
|
3208
|
-
|
3209
|
-
evaluateWalkTreePropertyCriteria,
|
3099
|
+
evaluateWalkTreeVisibility,
|
3210
3100
|
extractLocales,
|
3211
3101
|
findParameterInNodeTree,
|
3212
3102
|
flattenValues,
|
package/dist/index.js
CHANGED
@@ -352,10 +352,9 @@ __export(src_exports, {
|
|
352
352
|
createUniformApiEnhancer: () => createUniformApiEnhancer,
|
353
353
|
createVariableReference: () => createVariableReference,
|
354
354
|
enhance: () => enhance,
|
355
|
-
|
355
|
+
evaluateNodeVisibilityParameter: () => evaluateNodeVisibilityParameter,
|
356
356
|
evaluateVisibilityCriteriaGroup: () => evaluateVisibilityCriteriaGroup,
|
357
|
-
|
358
|
-
evaluateWalkTreePropertyCriteria: () => evaluateWalkTreePropertyCriteria,
|
357
|
+
evaluateWalkTreeVisibility: () => evaluateWalkTreeVisibility,
|
359
358
|
extractLocales: () => extractLocales,
|
360
359
|
findParameterInNodeTree: () => findParameterInNodeTree,
|
361
360
|
flattenValues: () => flattenValues,
|
@@ -1781,56 +1780,21 @@ function evaluateCriterion(clause, rootOptions) {
|
|
1781
1780
|
return null;
|
1782
1781
|
}
|
1783
1782
|
|
1784
|
-
// src/enhancement/visibility/
|
1785
|
-
function
|
1786
|
-
|
1787
|
-
conditionalValues,
|
1788
|
-
keepIndeterminate,
|
1783
|
+
// src/enhancement/visibility/evaluateNodeVisibilityParameter.ts
|
1784
|
+
function evaluateNodeVisibilityParameter({
|
1785
|
+
parameter,
|
1789
1786
|
...evaluateGroupOptions
|
1790
1787
|
}) {
|
1791
|
-
|
1792
|
-
|
1793
|
-
currentValue: baseValue,
|
1794
|
-
remainingConditionalValues: evaluateGroupOptions.simplifyCriteria && conditionalValues ? [...conditionalValues] : conditionalValues,
|
1795
|
-
currentConditionIndex: -1
|
1796
|
-
};
|
1797
|
-
if (!conditionalValues) {
|
1798
|
-
return result;
|
1799
|
-
}
|
1800
|
-
const conditionIndexesToRemove = [];
|
1801
|
-
for (let i = 0; i < conditionalValues.length; i++) {
|
1802
|
-
const conditionalVariant = conditionalValues[i];
|
1803
|
-
if (result.matched) {
|
1804
|
-
conditionIndexesToRemove.push(i);
|
1805
|
-
continue;
|
1806
|
-
}
|
1807
|
-
const evaluationResult = evaluateVisibilityCriteriaGroup({
|
1808
|
-
...evaluateGroupOptions,
|
1809
|
-
criteriaGroup: conditionalVariant.when
|
1810
|
-
});
|
1811
|
-
if (evaluationResult === null) {
|
1812
|
-
if (keepIndeterminate) {
|
1813
|
-
authoritative = false;
|
1814
|
-
} else {
|
1815
|
-
conditionIndexesToRemove.push(i);
|
1816
|
-
}
|
1817
|
-
} else if (evaluationResult === true) {
|
1818
|
-
result.matched = conditionalVariant;
|
1819
|
-
result.currentValue = conditionalVariant.value;
|
1820
|
-
result.currentConditionIndex = i;
|
1821
|
-
conditionIndexesToRemove.push(i);
|
1822
|
-
} else {
|
1823
|
-
conditionIndexesToRemove.push(i);
|
1824
|
-
}
|
1825
|
-
}
|
1826
|
-
if (evaluateGroupOptions.simplifyCriteria) {
|
1827
|
-
for (let i = conditionIndexesToRemove.length - 1; i >= 0; i--) {
|
1828
|
-
result.remainingConditionalValues.splice(conditionIndexesToRemove[i], 1);
|
1829
|
-
}
|
1788
|
+
if (parameter == null ? void 0 : parameter.explicitlyHidden) {
|
1789
|
+
return false;
|
1830
1790
|
}
|
1831
|
-
if (
|
1832
|
-
|
1791
|
+
if (!(parameter == null ? void 0 : parameter.criteria)) {
|
1792
|
+
return true;
|
1833
1793
|
}
|
1794
|
+
const result = evaluateVisibilityCriteriaGroup({
|
1795
|
+
...evaluateGroupOptions,
|
1796
|
+
criteriaGroup: parameter.criteria
|
1797
|
+
});
|
1834
1798
|
return result;
|
1835
1799
|
}
|
1836
1800
|
|
@@ -1845,24 +1809,18 @@ function evaluateNodeVisibility({
|
|
1845
1809
|
var _a;
|
1846
1810
|
const properties = getPropertiesValue(node);
|
1847
1811
|
const vizCriteria = (_a = properties == null ? void 0 : properties[CANVAS_VIZ_CONTROL_PARAM]) == null ? void 0 : _a.value;
|
1848
|
-
|
1849
|
-
return false;
|
1850
|
-
}
|
1851
|
-
if (!(vizCriteria == null ? void 0 : vizCriteria.criteria)) {
|
1852
|
-
return true;
|
1853
|
-
}
|
1854
|
-
const result = evaluateVisibilityCriteriaGroup({
|
1812
|
+
const result = evaluateNodeVisibilityParameter({
|
1855
1813
|
...evaluateGroupOptions,
|
1856
|
-
|
1814
|
+
parameter: vizCriteria
|
1857
1815
|
});
|
1858
|
-
if (vizCriteria.criteria.clauses.length === 0 && evaluateGroupOptions.simplifyCriteria) {
|
1816
|
+
if ((vizCriteria == null ? void 0 : vizCriteria.criteria) && vizCriteria.criteria.clauses.length === 0 && evaluateGroupOptions.simplifyCriteria) {
|
1859
1817
|
properties == null ? true : delete properties[CANVAS_VIZ_CONTROL_PARAM];
|
1860
1818
|
}
|
1861
1819
|
return result;
|
1862
1820
|
}
|
1863
1821
|
|
1864
|
-
// src/enhancement/visibility/
|
1865
|
-
function
|
1822
|
+
// src/enhancement/visibility/evaluateWalkTreeVisibility.ts
|
1823
|
+
function evaluateWalkTreeVisibility({
|
1866
1824
|
rules,
|
1867
1825
|
showIndeterminate,
|
1868
1826
|
context
|
@@ -1879,69 +1837,6 @@ function evaluateWalkTreeNodeVisibility({
|
|
1879
1837
|
return true;
|
1880
1838
|
}
|
1881
1839
|
|
1882
|
-
// src/enhancement/visibility/evaluateWalkTreePropertyCriteria.ts
|
1883
|
-
function evaluateWalkTreePropertyCriteria({
|
1884
|
-
rules,
|
1885
|
-
node,
|
1886
|
-
keepIndeterminate
|
1887
|
-
}) {
|
1888
|
-
const properties = getPropertiesValue(node);
|
1889
|
-
if (!properties) {
|
1890
|
-
return;
|
1891
|
-
}
|
1892
|
-
Object.entries(properties).forEach(([propertyName, property]) => {
|
1893
|
-
var _a, _b, _c;
|
1894
|
-
if (property.locales || property.localesConditions) {
|
1895
|
-
const localesDefined = [
|
1896
|
-
...Object.keys((_a = property.locales) != null ? _a : {}),
|
1897
|
-
...Object.keys((_b = property.localesConditions) != null ? _b : {})
|
1898
|
-
];
|
1899
|
-
localesDefined.forEach((locale) => {
|
1900
|
-
var _a2, _b2, _c2, _d, _e, _f, _g;
|
1901
|
-
const { currentValue, remainingConditionalValues } = evaluatePropertyCriteria({
|
1902
|
-
baseValue: (_a2 = property.locales) == null ? void 0 : _a2[locale],
|
1903
|
-
conditionalValues: (_b2 = property.localesConditions) == null ? void 0 : _b2[locale],
|
1904
|
-
rules,
|
1905
|
-
simplifyCriteria: true,
|
1906
|
-
keepIndeterminate
|
1907
|
-
});
|
1908
|
-
if (currentValue === null) {
|
1909
|
-
(_c2 = property.locales) == null ? true : delete _c2[locale];
|
1910
|
-
if (!Object.keys((_d = property.locales) != null ? _d : {}).length) {
|
1911
|
-
delete properties[propertyName];
|
1912
|
-
}
|
1913
|
-
} else {
|
1914
|
-
(_e = property.locales) != null ? _e : property.locales = {};
|
1915
|
-
property.locales[locale] = currentValue;
|
1916
|
-
}
|
1917
|
-
if (!(remainingConditionalValues == null ? void 0 : remainingConditionalValues.length)) {
|
1918
|
-
(_f = property.localesConditions) == null ? true : delete _f[locale];
|
1919
|
-
} else {
|
1920
|
-
(_g = property.localesConditions) != null ? _g : property.localesConditions = {};
|
1921
|
-
property.localesConditions[locale] = remainingConditionalValues;
|
1922
|
-
}
|
1923
|
-
});
|
1924
|
-
if (!Object.keys((_c = property.localesConditions) != null ? _c : {}).length) {
|
1925
|
-
delete property.localesConditions;
|
1926
|
-
}
|
1927
|
-
} else {
|
1928
|
-
const { currentValue, remainingConditionalValues } = evaluatePropertyCriteria({
|
1929
|
-
baseValue: property.value,
|
1930
|
-
conditionalValues: property.conditions,
|
1931
|
-
rules,
|
1932
|
-
simplifyCriteria: true,
|
1933
|
-
keepIndeterminate
|
1934
|
-
});
|
1935
|
-
if (currentValue === null) {
|
1936
|
-
delete properties[propertyName];
|
1937
|
-
} else {
|
1938
|
-
property.value = currentValue;
|
1939
|
-
}
|
1940
|
-
property.conditions = remainingConditionalValues;
|
1941
|
-
}
|
1942
|
-
});
|
1943
|
-
}
|
1944
|
-
|
1945
1840
|
// src/enhancement/visibility/rules/evaluateStringMatch.ts
|
1946
1841
|
var isEvaluator = (criteria, matchValue) => {
|
1947
1842
|
if (Array.isArray(criteria)) {
|
@@ -2086,7 +1981,7 @@ function localize(options) {
|
|
2086
1981
|
return;
|
2087
1982
|
}
|
2088
1983
|
if (isUsingModernOptions) {
|
2089
|
-
const result =
|
1984
|
+
const result = evaluateWalkTreeVisibility({
|
2090
1985
|
context,
|
2091
1986
|
rules: vizControlLocaleRule,
|
2092
1987
|
showIndeterminate: true
|
@@ -2094,11 +1989,6 @@ function localize(options) {
|
|
2094
1989
|
if (!result) {
|
2095
1990
|
return;
|
2096
1991
|
}
|
2097
|
-
evaluateWalkTreePropertyCriteria({
|
2098
|
-
node: context.node,
|
2099
|
-
rules: vizControlLocaleRule,
|
2100
|
-
keepIndeterminate: true
|
2101
|
-
});
|
2102
1992
|
}
|
2103
1993
|
if (node.type === CANVAS_LOCALIZATION_TYPE) {
|
2104
1994
|
const locales = extractLocales({ component: node });
|
@@ -3354,10 +3244,9 @@ var CanvasClientError = import_api15.ApiClientError;
|
|
3354
3244
|
createUniformApiEnhancer,
|
3355
3245
|
createVariableReference,
|
3356
3246
|
enhance,
|
3357
|
-
|
3247
|
+
evaluateNodeVisibilityParameter,
|
3358
3248
|
evaluateVisibilityCriteriaGroup,
|
3359
|
-
|
3360
|
-
evaluateWalkTreePropertyCriteria,
|
3249
|
+
evaluateWalkTreeVisibility,
|
3361
3250
|
extractLocales,
|
3362
3251
|
findParameterInNodeTree,
|
3363
3252
|
flattenValues,
|
package/dist/index.mjs
CHANGED
@@ -1631,56 +1631,21 @@ function evaluateCriterion(clause, rootOptions) {
|
|
1631
1631
|
return null;
|
1632
1632
|
}
|
1633
1633
|
|
1634
|
-
// src/enhancement/visibility/
|
1635
|
-
function
|
1636
|
-
|
1637
|
-
conditionalValues,
|
1638
|
-
keepIndeterminate,
|
1634
|
+
// src/enhancement/visibility/evaluateNodeVisibilityParameter.ts
|
1635
|
+
function evaluateNodeVisibilityParameter({
|
1636
|
+
parameter,
|
1639
1637
|
...evaluateGroupOptions
|
1640
1638
|
}) {
|
1641
|
-
|
1642
|
-
|
1643
|
-
currentValue: baseValue,
|
1644
|
-
remainingConditionalValues: evaluateGroupOptions.simplifyCriteria && conditionalValues ? [...conditionalValues] : conditionalValues,
|
1645
|
-
currentConditionIndex: -1
|
1646
|
-
};
|
1647
|
-
if (!conditionalValues) {
|
1648
|
-
return result;
|
1649
|
-
}
|
1650
|
-
const conditionIndexesToRemove = [];
|
1651
|
-
for (let i = 0; i < conditionalValues.length; i++) {
|
1652
|
-
const conditionalVariant = conditionalValues[i];
|
1653
|
-
if (result.matched) {
|
1654
|
-
conditionIndexesToRemove.push(i);
|
1655
|
-
continue;
|
1656
|
-
}
|
1657
|
-
const evaluationResult = evaluateVisibilityCriteriaGroup({
|
1658
|
-
...evaluateGroupOptions,
|
1659
|
-
criteriaGroup: conditionalVariant.when
|
1660
|
-
});
|
1661
|
-
if (evaluationResult === null) {
|
1662
|
-
if (keepIndeterminate) {
|
1663
|
-
authoritative = false;
|
1664
|
-
} else {
|
1665
|
-
conditionIndexesToRemove.push(i);
|
1666
|
-
}
|
1667
|
-
} else if (evaluationResult === true) {
|
1668
|
-
result.matched = conditionalVariant;
|
1669
|
-
result.currentValue = conditionalVariant.value;
|
1670
|
-
result.currentConditionIndex = i;
|
1671
|
-
conditionIndexesToRemove.push(i);
|
1672
|
-
} else {
|
1673
|
-
conditionIndexesToRemove.push(i);
|
1674
|
-
}
|
1675
|
-
}
|
1676
|
-
if (evaluateGroupOptions.simplifyCriteria) {
|
1677
|
-
for (let i = conditionIndexesToRemove.length - 1; i >= 0; i--) {
|
1678
|
-
result.remainingConditionalValues.splice(conditionIndexesToRemove[i], 1);
|
1679
|
-
}
|
1639
|
+
if (parameter == null ? void 0 : parameter.explicitlyHidden) {
|
1640
|
+
return false;
|
1680
1641
|
}
|
1681
|
-
if (
|
1682
|
-
|
1642
|
+
if (!(parameter == null ? void 0 : parameter.criteria)) {
|
1643
|
+
return true;
|
1683
1644
|
}
|
1645
|
+
const result = evaluateVisibilityCriteriaGroup({
|
1646
|
+
...evaluateGroupOptions,
|
1647
|
+
criteriaGroup: parameter.criteria
|
1648
|
+
});
|
1684
1649
|
return result;
|
1685
1650
|
}
|
1686
1651
|
|
@@ -1695,24 +1660,18 @@ function evaluateNodeVisibility({
|
|
1695
1660
|
var _a;
|
1696
1661
|
const properties = getPropertiesValue(node);
|
1697
1662
|
const vizCriteria = (_a = properties == null ? void 0 : properties[CANVAS_VIZ_CONTROL_PARAM]) == null ? void 0 : _a.value;
|
1698
|
-
|
1699
|
-
return false;
|
1700
|
-
}
|
1701
|
-
if (!(vizCriteria == null ? void 0 : vizCriteria.criteria)) {
|
1702
|
-
return true;
|
1703
|
-
}
|
1704
|
-
const result = evaluateVisibilityCriteriaGroup({
|
1663
|
+
const result = evaluateNodeVisibilityParameter({
|
1705
1664
|
...evaluateGroupOptions,
|
1706
|
-
|
1665
|
+
parameter: vizCriteria
|
1707
1666
|
});
|
1708
|
-
if (vizCriteria.criteria.clauses.length === 0 && evaluateGroupOptions.simplifyCriteria) {
|
1667
|
+
if ((vizCriteria == null ? void 0 : vizCriteria.criteria) && vizCriteria.criteria.clauses.length === 0 && evaluateGroupOptions.simplifyCriteria) {
|
1709
1668
|
properties == null ? true : delete properties[CANVAS_VIZ_CONTROL_PARAM];
|
1710
1669
|
}
|
1711
1670
|
return result;
|
1712
1671
|
}
|
1713
1672
|
|
1714
|
-
// src/enhancement/visibility/
|
1715
|
-
function
|
1673
|
+
// src/enhancement/visibility/evaluateWalkTreeVisibility.ts
|
1674
|
+
function evaluateWalkTreeVisibility({
|
1716
1675
|
rules,
|
1717
1676
|
showIndeterminate,
|
1718
1677
|
context
|
@@ -1729,69 +1688,6 @@ function evaluateWalkTreeNodeVisibility({
|
|
1729
1688
|
return true;
|
1730
1689
|
}
|
1731
1690
|
|
1732
|
-
// src/enhancement/visibility/evaluateWalkTreePropertyCriteria.ts
|
1733
|
-
function evaluateWalkTreePropertyCriteria({
|
1734
|
-
rules,
|
1735
|
-
node,
|
1736
|
-
keepIndeterminate
|
1737
|
-
}) {
|
1738
|
-
const properties = getPropertiesValue(node);
|
1739
|
-
if (!properties) {
|
1740
|
-
return;
|
1741
|
-
}
|
1742
|
-
Object.entries(properties).forEach(([propertyName, property]) => {
|
1743
|
-
var _a, _b, _c;
|
1744
|
-
if (property.locales || property.localesConditions) {
|
1745
|
-
const localesDefined = [
|
1746
|
-
...Object.keys((_a = property.locales) != null ? _a : {}),
|
1747
|
-
...Object.keys((_b = property.localesConditions) != null ? _b : {})
|
1748
|
-
];
|
1749
|
-
localesDefined.forEach((locale) => {
|
1750
|
-
var _a2, _b2, _c2, _d, _e, _f, _g;
|
1751
|
-
const { currentValue, remainingConditionalValues } = evaluatePropertyCriteria({
|
1752
|
-
baseValue: (_a2 = property.locales) == null ? void 0 : _a2[locale],
|
1753
|
-
conditionalValues: (_b2 = property.localesConditions) == null ? void 0 : _b2[locale],
|
1754
|
-
rules,
|
1755
|
-
simplifyCriteria: true,
|
1756
|
-
keepIndeterminate
|
1757
|
-
});
|
1758
|
-
if (currentValue === null) {
|
1759
|
-
(_c2 = property.locales) == null ? true : delete _c2[locale];
|
1760
|
-
if (!Object.keys((_d = property.locales) != null ? _d : {}).length) {
|
1761
|
-
delete properties[propertyName];
|
1762
|
-
}
|
1763
|
-
} else {
|
1764
|
-
(_e = property.locales) != null ? _e : property.locales = {};
|
1765
|
-
property.locales[locale] = currentValue;
|
1766
|
-
}
|
1767
|
-
if (!(remainingConditionalValues == null ? void 0 : remainingConditionalValues.length)) {
|
1768
|
-
(_f = property.localesConditions) == null ? true : delete _f[locale];
|
1769
|
-
} else {
|
1770
|
-
(_g = property.localesConditions) != null ? _g : property.localesConditions = {};
|
1771
|
-
property.localesConditions[locale] = remainingConditionalValues;
|
1772
|
-
}
|
1773
|
-
});
|
1774
|
-
if (!Object.keys((_c = property.localesConditions) != null ? _c : {}).length) {
|
1775
|
-
delete property.localesConditions;
|
1776
|
-
}
|
1777
|
-
} else {
|
1778
|
-
const { currentValue, remainingConditionalValues } = evaluatePropertyCriteria({
|
1779
|
-
baseValue: property.value,
|
1780
|
-
conditionalValues: property.conditions,
|
1781
|
-
rules,
|
1782
|
-
simplifyCriteria: true,
|
1783
|
-
keepIndeterminate
|
1784
|
-
});
|
1785
|
-
if (currentValue === null) {
|
1786
|
-
delete properties[propertyName];
|
1787
|
-
} else {
|
1788
|
-
property.value = currentValue;
|
1789
|
-
}
|
1790
|
-
property.conditions = remainingConditionalValues;
|
1791
|
-
}
|
1792
|
-
});
|
1793
|
-
}
|
1794
|
-
|
1795
1691
|
// src/enhancement/visibility/rules/evaluateStringMatch.ts
|
1796
1692
|
var isEvaluator = (criteria, matchValue) => {
|
1797
1693
|
if (Array.isArray(criteria)) {
|
@@ -1936,7 +1832,7 @@ function localize(options) {
|
|
1936
1832
|
return;
|
1937
1833
|
}
|
1938
1834
|
if (isUsingModernOptions) {
|
1939
|
-
const result =
|
1835
|
+
const result = evaluateWalkTreeVisibility({
|
1940
1836
|
context,
|
1941
1837
|
rules: vizControlLocaleRule,
|
1942
1838
|
showIndeterminate: true
|
@@ -1944,11 +1840,6 @@ function localize(options) {
|
|
1944
1840
|
if (!result) {
|
1945
1841
|
return;
|
1946
1842
|
}
|
1947
|
-
evaluateWalkTreePropertyCriteria({
|
1948
|
-
node: context.node,
|
1949
|
-
rules: vizControlLocaleRule,
|
1950
|
-
keepIndeterminate: true
|
1951
|
-
});
|
1952
1843
|
}
|
1953
1844
|
if (node.type === CANVAS_LOCALIZATION_TYPE) {
|
1954
1845
|
const locales = extractLocales({ component: node });
|
@@ -3203,10 +3094,9 @@ export {
|
|
3203
3094
|
createUniformApiEnhancer,
|
3204
3095
|
createVariableReference,
|
3205
3096
|
enhance,
|
3206
|
-
|
3097
|
+
evaluateNodeVisibilityParameter,
|
3207
3098
|
evaluateVisibilityCriteriaGroup,
|
3208
|
-
|
3209
|
-
evaluateWalkTreePropertyCriteria,
|
3099
|
+
evaluateWalkTreeVisibility,
|
3210
3100
|
extractLocales,
|
3211
3101
|
findParameterInNodeTree,
|
3212
3102
|
flattenValues,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/canvas",
|
3
|
-
"version": "19.
|
3
|
+
"version": "19.176.0",
|
4
4
|
"description": "Common functionality and types for Uniform Canvas",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
6
6
|
"main": "./dist/index.js",
|
@@ -38,8 +38,8 @@
|
|
38
38
|
"pusher-js": "8.2.0"
|
39
39
|
},
|
40
40
|
"dependencies": {
|
41
|
-
"@uniformdev/assets": "19.
|
42
|
-
"@uniformdev/context": "19.
|
41
|
+
"@uniformdev/assets": "19.176.0",
|
42
|
+
"@uniformdev/context": "19.176.0",
|
43
43
|
"immer": "10.1.1"
|
44
44
|
},
|
45
45
|
"files": [
|
@@ -48,5 +48,5 @@
|
|
48
48
|
"publishConfig": {
|
49
49
|
"access": "public"
|
50
50
|
},
|
51
|
-
"gitHead": "
|
51
|
+
"gitHead": "87107574c3143e48d68ca702a4c74eaa20be44e7"
|
52
52
|
}
|