@uniformdev/canvas 19.170.1 → 19.173.1-alpha.17
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 +1457 -19
- package/dist/index.d.ts +1457 -19
- package/dist/index.esm.js +127 -4
- package/dist/index.js +130 -5
- package/dist/index.mjs +127 -4
- package/package.json +5 -5
package/dist/index.esm.js
CHANGED
@@ -1631,6 +1631,59 @@ function evaluateCriterion(clause, rootOptions) {
|
|
1631
1631
|
return null;
|
1632
1632
|
}
|
1633
1633
|
|
1634
|
+
// src/enhancement/visibility/evaluatePropertyCriteria.ts
|
1635
|
+
function evaluatePropertyCriteria({
|
1636
|
+
baseValue,
|
1637
|
+
conditionalValues,
|
1638
|
+
keepIndeterminate,
|
1639
|
+
...evaluateGroupOptions
|
1640
|
+
}) {
|
1641
|
+
let authoritative = true;
|
1642
|
+
const result = {
|
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
|
+
}
|
1680
|
+
}
|
1681
|
+
if (authoritative) {
|
1682
|
+
result.remainingConditionalValues = void 0;
|
1683
|
+
}
|
1684
|
+
return result;
|
1685
|
+
}
|
1686
|
+
|
1634
1687
|
// src/enhancement/visibility/types.ts
|
1635
1688
|
var CANVAS_VIZ_CONTROL_PARAM = "$viz";
|
1636
1689
|
|
@@ -1658,8 +1711,8 @@ function evaluateNodeVisibility({
|
|
1658
1711
|
return result;
|
1659
1712
|
}
|
1660
1713
|
|
1661
|
-
// src/enhancement/visibility/
|
1662
|
-
function
|
1714
|
+
// src/enhancement/visibility/evaluateWalkTreeNodeVisibility.ts
|
1715
|
+
function evaluateWalkTreeNodeVisibility({
|
1663
1716
|
rules,
|
1664
1717
|
showIndeterminate,
|
1665
1718
|
context
|
@@ -1676,6 +1729,69 @@ function evaluateWalkTreeVisibility({
|
|
1676
1729
|
return true;
|
1677
1730
|
}
|
1678
1731
|
|
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
|
+
|
1679
1795
|
// src/enhancement/visibility/rules/evaluateStringMatch.ts
|
1680
1796
|
var isEvaluator = (criteria, matchValue) => {
|
1681
1797
|
if (Array.isArray(criteria)) {
|
@@ -1820,7 +1936,7 @@ function localize(options) {
|
|
1820
1936
|
return;
|
1821
1937
|
}
|
1822
1938
|
if (isUsingModernOptions) {
|
1823
|
-
const result =
|
1939
|
+
const result = evaluateWalkTreeNodeVisibility({
|
1824
1940
|
context,
|
1825
1941
|
rules: vizControlLocaleRule,
|
1826
1942
|
showIndeterminate: true
|
@@ -1828,6 +1944,11 @@ function localize(options) {
|
|
1828
1944
|
if (!result) {
|
1829
1945
|
return;
|
1830
1946
|
}
|
1947
|
+
evaluateWalkTreePropertyCriteria({
|
1948
|
+
node: context.node,
|
1949
|
+
rules: vizControlLocaleRule,
|
1950
|
+
keepIndeterminate: true
|
1951
|
+
});
|
1831
1952
|
}
|
1832
1953
|
if (node.type === CANVAS_LOCALIZATION_TYPE) {
|
1833
1954
|
const locales = extractLocales({ component: node });
|
@@ -3082,8 +3203,10 @@ export {
|
|
3082
3203
|
createUniformApiEnhancer,
|
3083
3204
|
createVariableReference,
|
3084
3205
|
enhance,
|
3206
|
+
evaluatePropertyCriteria,
|
3085
3207
|
evaluateVisibilityCriteriaGroup,
|
3086
|
-
|
3208
|
+
evaluateWalkTreeNodeVisibility,
|
3209
|
+
evaluateWalkTreePropertyCriteria,
|
3087
3210
|
extractLocales,
|
3088
3211
|
findParameterInNodeTree,
|
3089
3212
|
flattenValues,
|
package/dist/index.js
CHANGED
@@ -352,8 +352,10 @@ __export(src_exports, {
|
|
352
352
|
createUniformApiEnhancer: () => createUniformApiEnhancer,
|
353
353
|
createVariableReference: () => createVariableReference,
|
354
354
|
enhance: () => enhance,
|
355
|
+
evaluatePropertyCriteria: () => evaluatePropertyCriteria,
|
355
356
|
evaluateVisibilityCriteriaGroup: () => evaluateVisibilityCriteriaGroup,
|
356
|
-
|
357
|
+
evaluateWalkTreeNodeVisibility: () => evaluateWalkTreeNodeVisibility,
|
358
|
+
evaluateWalkTreePropertyCriteria: () => evaluateWalkTreePropertyCriteria,
|
357
359
|
extractLocales: () => extractLocales,
|
358
360
|
findParameterInNodeTree: () => findParameterInNodeTree,
|
359
361
|
flattenValues: () => flattenValues,
|
@@ -1779,6 +1781,59 @@ function evaluateCriterion(clause, rootOptions) {
|
|
1779
1781
|
return null;
|
1780
1782
|
}
|
1781
1783
|
|
1784
|
+
// src/enhancement/visibility/evaluatePropertyCriteria.ts
|
1785
|
+
function evaluatePropertyCriteria({
|
1786
|
+
baseValue,
|
1787
|
+
conditionalValues,
|
1788
|
+
keepIndeterminate,
|
1789
|
+
...evaluateGroupOptions
|
1790
|
+
}) {
|
1791
|
+
let authoritative = true;
|
1792
|
+
const result = {
|
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
|
+
}
|
1830
|
+
}
|
1831
|
+
if (authoritative) {
|
1832
|
+
result.remainingConditionalValues = void 0;
|
1833
|
+
}
|
1834
|
+
return result;
|
1835
|
+
}
|
1836
|
+
|
1782
1837
|
// src/enhancement/visibility/types.ts
|
1783
1838
|
var CANVAS_VIZ_CONTROL_PARAM = "$viz";
|
1784
1839
|
|
@@ -1806,8 +1861,8 @@ function evaluateNodeVisibility({
|
|
1806
1861
|
return result;
|
1807
1862
|
}
|
1808
1863
|
|
1809
|
-
// src/enhancement/visibility/
|
1810
|
-
function
|
1864
|
+
// src/enhancement/visibility/evaluateWalkTreeNodeVisibility.ts
|
1865
|
+
function evaluateWalkTreeNodeVisibility({
|
1811
1866
|
rules,
|
1812
1867
|
showIndeterminate,
|
1813
1868
|
context
|
@@ -1824,6 +1879,69 @@ function evaluateWalkTreeVisibility({
|
|
1824
1879
|
return true;
|
1825
1880
|
}
|
1826
1881
|
|
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
|
+
|
1827
1945
|
// src/enhancement/visibility/rules/evaluateStringMatch.ts
|
1828
1946
|
var isEvaluator = (criteria, matchValue) => {
|
1829
1947
|
if (Array.isArray(criteria)) {
|
@@ -1968,7 +2086,7 @@ function localize(options) {
|
|
1968
2086
|
return;
|
1969
2087
|
}
|
1970
2088
|
if (isUsingModernOptions) {
|
1971
|
-
const result =
|
2089
|
+
const result = evaluateWalkTreeNodeVisibility({
|
1972
2090
|
context,
|
1973
2091
|
rules: vizControlLocaleRule,
|
1974
2092
|
showIndeterminate: true
|
@@ -1976,6 +2094,11 @@ function localize(options) {
|
|
1976
2094
|
if (!result) {
|
1977
2095
|
return;
|
1978
2096
|
}
|
2097
|
+
evaluateWalkTreePropertyCriteria({
|
2098
|
+
node: context.node,
|
2099
|
+
rules: vizControlLocaleRule,
|
2100
|
+
keepIndeterminate: true
|
2101
|
+
});
|
1979
2102
|
}
|
1980
2103
|
if (node.type === CANVAS_LOCALIZATION_TYPE) {
|
1981
2104
|
const locales = extractLocales({ component: node });
|
@@ -3231,8 +3354,10 @@ var CanvasClientError = import_api15.ApiClientError;
|
|
3231
3354
|
createUniformApiEnhancer,
|
3232
3355
|
createVariableReference,
|
3233
3356
|
enhance,
|
3357
|
+
evaluatePropertyCriteria,
|
3234
3358
|
evaluateVisibilityCriteriaGroup,
|
3235
|
-
|
3359
|
+
evaluateWalkTreeNodeVisibility,
|
3360
|
+
evaluateWalkTreePropertyCriteria,
|
3236
3361
|
extractLocales,
|
3237
3362
|
findParameterInNodeTree,
|
3238
3363
|
flattenValues,
|
package/dist/index.mjs
CHANGED
@@ -1631,6 +1631,59 @@ function evaluateCriterion(clause, rootOptions) {
|
|
1631
1631
|
return null;
|
1632
1632
|
}
|
1633
1633
|
|
1634
|
+
// src/enhancement/visibility/evaluatePropertyCriteria.ts
|
1635
|
+
function evaluatePropertyCriteria({
|
1636
|
+
baseValue,
|
1637
|
+
conditionalValues,
|
1638
|
+
keepIndeterminate,
|
1639
|
+
...evaluateGroupOptions
|
1640
|
+
}) {
|
1641
|
+
let authoritative = true;
|
1642
|
+
const result = {
|
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
|
+
}
|
1680
|
+
}
|
1681
|
+
if (authoritative) {
|
1682
|
+
result.remainingConditionalValues = void 0;
|
1683
|
+
}
|
1684
|
+
return result;
|
1685
|
+
}
|
1686
|
+
|
1634
1687
|
// src/enhancement/visibility/types.ts
|
1635
1688
|
var CANVAS_VIZ_CONTROL_PARAM = "$viz";
|
1636
1689
|
|
@@ -1658,8 +1711,8 @@ function evaluateNodeVisibility({
|
|
1658
1711
|
return result;
|
1659
1712
|
}
|
1660
1713
|
|
1661
|
-
// src/enhancement/visibility/
|
1662
|
-
function
|
1714
|
+
// src/enhancement/visibility/evaluateWalkTreeNodeVisibility.ts
|
1715
|
+
function evaluateWalkTreeNodeVisibility({
|
1663
1716
|
rules,
|
1664
1717
|
showIndeterminate,
|
1665
1718
|
context
|
@@ -1676,6 +1729,69 @@ function evaluateWalkTreeVisibility({
|
|
1676
1729
|
return true;
|
1677
1730
|
}
|
1678
1731
|
|
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
|
+
|
1679
1795
|
// src/enhancement/visibility/rules/evaluateStringMatch.ts
|
1680
1796
|
var isEvaluator = (criteria, matchValue) => {
|
1681
1797
|
if (Array.isArray(criteria)) {
|
@@ -1820,7 +1936,7 @@ function localize(options) {
|
|
1820
1936
|
return;
|
1821
1937
|
}
|
1822
1938
|
if (isUsingModernOptions) {
|
1823
|
-
const result =
|
1939
|
+
const result = evaluateWalkTreeNodeVisibility({
|
1824
1940
|
context,
|
1825
1941
|
rules: vizControlLocaleRule,
|
1826
1942
|
showIndeterminate: true
|
@@ -1828,6 +1944,11 @@ function localize(options) {
|
|
1828
1944
|
if (!result) {
|
1829
1945
|
return;
|
1830
1946
|
}
|
1947
|
+
evaluateWalkTreePropertyCriteria({
|
1948
|
+
node: context.node,
|
1949
|
+
rules: vizControlLocaleRule,
|
1950
|
+
keepIndeterminate: true
|
1951
|
+
});
|
1831
1952
|
}
|
1832
1953
|
if (node.type === CANVAS_LOCALIZATION_TYPE) {
|
1833
1954
|
const locales = extractLocales({ component: node });
|
@@ -3082,8 +3203,10 @@ export {
|
|
3082
3203
|
createUniformApiEnhancer,
|
3083
3204
|
createVariableReference,
|
3084
3205
|
enhance,
|
3206
|
+
evaluatePropertyCriteria,
|
3085
3207
|
evaluateVisibilityCriteriaGroup,
|
3086
|
-
|
3208
|
+
evaluateWalkTreeNodeVisibility,
|
3209
|
+
evaluateWalkTreePropertyCriteria,
|
3087
3210
|
extractLocales,
|
3088
3211
|
findParameterInNodeTree,
|
3089
3212
|
flattenValues,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/canvas",
|
3
|
-
"version": "19.
|
3
|
+
"version": "19.173.1-alpha.17+25c1176cea",
|
4
4
|
"description": "Common functionality and types for Uniform Canvas",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
6
6
|
"main": "./dist/index.js",
|
@@ -32,14 +32,14 @@
|
|
32
32
|
},
|
33
33
|
"devDependencies": {
|
34
34
|
"@types/retry": "0.12.5",
|
35
|
-
"lexical": "
|
35
|
+
"lexical": "0.16.1",
|
36
36
|
"p-retry": "5.1.2",
|
37
37
|
"p-throttle": "5.0.0",
|
38
38
|
"pusher-js": "8.2.0"
|
39
39
|
},
|
40
40
|
"dependencies": {
|
41
|
-
"@uniformdev/assets": "19.
|
42
|
-
"@uniformdev/context": "19.
|
41
|
+
"@uniformdev/assets": "19.173.1-alpha.17+25c1176cea",
|
42
|
+
"@uniformdev/context": "19.173.1-alpha.17+25c1176cea",
|
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": "25c1176cea8d5114b92fc75cdd8bba4aa6463a50"
|
52
52
|
}
|