@buerli.io/react-cad 0.13.1-beta.10 → 0.13.1-beta.11
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/build/index.cjs.js +34 -30
- package/build/index.js +34 -30
- package/package.json +3 -3
package/build/index.cjs.js
CHANGED
|
@@ -1183,7 +1183,7 @@ const Mentions = ({
|
|
|
1183
1183
|
};
|
|
1184
1184
|
|
|
1185
1185
|
function isDegValue(expr) {
|
|
1186
|
-
return expr.length > 1 && expr
|
|
1186
|
+
return expr.length > 1 && expr.slice(expr.length - 3) === 'deg' && !isNaN(Number(expr.slice(0, expr.length - 3)));
|
|
1187
1187
|
}
|
|
1188
1188
|
function getDefNumValue(numOrExpr) {
|
|
1189
1189
|
return typeof numOrExpr === 'number' ? numOrExpr : isDegValue(numOrExpr) ? numOrExpr : 0;
|
|
@@ -1267,7 +1267,7 @@ const NumOrExpr = ({
|
|
|
1267
1267
|
}, /*#__PURE__*/React.createElement(Prefix, null, prefix)));
|
|
1268
1268
|
};
|
|
1269
1269
|
const baseReg$3 = /^-?(\d*(\.\d*)?)?$/;
|
|
1270
|
-
const angleReg$3 = /^-?(\d*(\.\d*)?)?g?$/;
|
|
1270
|
+
const angleReg$3 = /^-?(\d*(\.\d*)?)?d?e?g?$/;
|
|
1271
1271
|
const NumInput$1 = ({
|
|
1272
1272
|
state,
|
|
1273
1273
|
setState,
|
|
@@ -1566,7 +1566,7 @@ function acceptableRange(min, max) {
|
|
|
1566
1566
|
if (!isNaN(Number(numParam))) {
|
|
1567
1567
|
value = Number(numParam);
|
|
1568
1568
|
} else if (typeof numParam === 'string' && isDegValue(numParam)) {
|
|
1569
|
-
value = Number(numParam.slice(0, numParam.length -
|
|
1569
|
+
value = Number(numParam.slice(0, numParam.length - 3));
|
|
1570
1570
|
} else {
|
|
1571
1571
|
return [];
|
|
1572
1572
|
}
|
|
@@ -1663,7 +1663,7 @@ function createRealParam(member) {
|
|
|
1663
1663
|
// In the old models if member doesn't contain experssion, the value is stored in the member.expression as string
|
|
1664
1664
|
// For example 'limit2' member for an extrusion looks like this: {expression: "50", type: "real", value: 50, visible: 1}
|
|
1665
1665
|
// These expressions should be ignored.
|
|
1666
|
-
const expr = member.expression.replace(/ExpressionSet./g, '@expr.');
|
|
1666
|
+
const expr = member.expression.replace(/ExpressionSet./g, '@expr.').replace(/(?<=\b\d[\d.]*)g\b/g, 'deg');
|
|
1667
1667
|
const isExpr = expr.length > 0 && isNaN(Number(expr));
|
|
1668
1668
|
const value = isExpr ? expr : member.value;
|
|
1669
1669
|
return value;
|
|
@@ -1971,10 +1971,10 @@ const DimValue = ({
|
|
|
1971
1971
|
|
|
1972
1972
|
// const paramName = dimension.members.paramName.value
|
|
1973
1973
|
const expr = ((_master$members3 = master.members) == null ? void 0 : (_master$members3$memb = _master$members3[memberName]) == null ? void 0 : _master$members3$memb.expression.replace(/ /g, '').replace(/ExpressionSet./g, '@expr.')) || '';
|
|
1974
|
-
const degValue = expr.length > 0 && expr
|
|
1974
|
+
const degValue = expr.length > 0 && expr.slice(expr.length - 3) === 'deg' ? Number(expr.slice(0, expr.length - 3)) : NaN;
|
|
1975
1975
|
const isDeg = !isNaN(degValue);
|
|
1976
1976
|
const value = isDeg ? degValue : (_master$members4 = master.members) == null ? void 0 : (_master$members4$memb = _master$members4[memberName]) == null ? void 0 : _master$members4$memb.value;
|
|
1977
|
-
const valueStr = isDeg ? value.toFixed(2) + '
|
|
1977
|
+
const valueStr = isDeg ? value.toFixed(2) + 'deg' : value.toFixed(2);
|
|
1978
1978
|
return expr && !isDeg ? expr + ' (' + valueStr + ')' : valueStr;
|
|
1979
1979
|
}, [dimension, master, memberName, angle]);
|
|
1980
1980
|
const [editMode, setEditMode] = React.useState(false);
|
|
@@ -5900,7 +5900,7 @@ function parsePoint(param) {
|
|
|
5900
5900
|
return comps;
|
|
5901
5901
|
}
|
|
5902
5902
|
function getDisplayValue(valOrExpr) {
|
|
5903
|
-
return typeof valOrExpr === 'string' ? valOrExpr.replace(/ /g, '')
|
|
5903
|
+
return typeof valOrExpr === 'string' ? valOrExpr.replace(/ /g, '') : valOrExpr.toString();
|
|
5904
5904
|
}
|
|
5905
5905
|
const DisplayBase = styled.div`
|
|
5906
5906
|
display: flex;
|
|
@@ -6235,7 +6235,7 @@ const PointEditor = ({
|
|
|
6235
6235
|
};
|
|
6236
6236
|
|
|
6237
6237
|
function createPointParam(member) {
|
|
6238
|
-
const expr = member.expression.replace(/ExpressionSet./g, '@expr.');
|
|
6238
|
+
const expr = member.expression.replace(/ExpressionSet./g, '@expr.').replace(/(?<=\b\d[\d.]*)g\b/g, 'deg');
|
|
6239
6239
|
const isExpr = expr.length > 0;
|
|
6240
6240
|
const value = isExpr ? expr : member.value;
|
|
6241
6241
|
return value;
|
|
@@ -9536,7 +9536,7 @@ function CreateAngle(drawingId, pluginId) {
|
|
|
9536
9536
|
} = tmpObjects[tmpDimensionId];
|
|
9537
9537
|
const sector = getArcSector(dimPos, dir0, dir1, center);
|
|
9538
9538
|
const previewValue = getArcPreviewValue(dir0, dir1, sector, reflex);
|
|
9539
|
-
const degValue = radiansToDegrees(previewValue) + '
|
|
9539
|
+
const degValue = radiansToDegrees(previewValue) + 'deg';
|
|
9540
9540
|
classcad.createApi(drawingId).v1.sketch.dimension({
|
|
9541
9541
|
id: sketchId,
|
|
9542
9542
|
name: 'Ang',
|
|
@@ -10754,7 +10754,8 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
10754
10754
|
id: sketchId,
|
|
10755
10755
|
startPos,
|
|
10756
10756
|
midPos: midInfo.mid,
|
|
10757
|
-
endPos
|
|
10757
|
+
endPos,
|
|
10758
|
+
genTangency: arcType === HandlersList.DRAWARCTANGENT
|
|
10758
10759
|
});
|
|
10759
10760
|
promise.then(() => {
|
|
10760
10761
|
// Remove the old temporary arc and its points once a permanent one is created in its place
|
|
@@ -14075,7 +14076,7 @@ const TmpAngularDim = props => {
|
|
|
14075
14076
|
previewValue: previewValue_
|
|
14076
14077
|
};
|
|
14077
14078
|
}, [dir0, dir1, center, dimPos, reflex]);
|
|
14078
|
-
const text = radiansToDegrees(previewValue).toFixed(2) + '
|
|
14079
|
+
const text = radiansToDegrees(previewValue).toFixed(2) + 'deg';
|
|
14079
14080
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Line$2, {
|
|
14080
14081
|
start: cornerP,
|
|
14081
14082
|
end: startFoot
|
|
@@ -15131,12 +15132,12 @@ function useShowRigidSet(drawingId, pluginId, selectorId) {
|
|
|
15131
15132
|
}
|
|
15132
15133
|
const convertDegToRadValue = angle => {
|
|
15133
15134
|
if (isDegValue(angle)) {
|
|
15134
|
-
return degreesToRadians(Number(angle.slice(0, angle.length -
|
|
15135
|
+
return degreesToRadians(Number(angle.slice(0, angle.length - 3)));
|
|
15135
15136
|
}
|
|
15136
15137
|
return angle === '' ? NaN : Number(angle);
|
|
15137
15138
|
};
|
|
15138
15139
|
const baseReg$2 = /^-?(\d*(\.\d*)?)?$/;
|
|
15139
|
-
const angleReg$2 = /^-?(\d*(\.\d*)?)?g?$/;
|
|
15140
|
+
const angleReg$2 = /^-?(\d*(\.\d*)?)?d?e?g?$/;
|
|
15140
15141
|
const Input$2 = _ref => {
|
|
15141
15142
|
let {
|
|
15142
15143
|
angle = false,
|
|
@@ -15284,7 +15285,7 @@ const CircPattern = () => {
|
|
|
15284
15285
|
const [rgSetSelId, setRgSetSelId] = React.useState('');
|
|
15285
15286
|
const [centerSelId, setCenterSelId] = React.useState('');
|
|
15286
15287
|
const [countD, setCountD] = React.useState('3');
|
|
15287
|
-
const [angleD, setAngleD] = React.useState('
|
|
15288
|
+
const [angleD, setAngleD] = React.useState('45deg');
|
|
15288
15289
|
useShowRigidSet(drawingId, pluginId, rgSetSelId);
|
|
15289
15290
|
const createPattern = React.useCallback(() => {
|
|
15290
15291
|
var _getDrawing$selection2, _getDrawing$selection3;
|
|
@@ -15326,7 +15327,7 @@ const CircPattern = () => {
|
|
|
15326
15327
|
contentWidth: 50
|
|
15327
15328
|
}, /*#__PURE__*/React.createElement(Input$2, {
|
|
15328
15329
|
value: angleD,
|
|
15329
|
-
defaultValue: '
|
|
15330
|
+
defaultValue: '45deg',
|
|
15330
15331
|
setValue: setAngleD,
|
|
15331
15332
|
angle: true
|
|
15332
15333
|
})), /*#__PURE__*/React.createElement(Wrapper, {
|
|
@@ -22973,8 +22974,12 @@ const ModelTreeHeader = ({
|
|
|
22973
22974
|
const mode = useEditMode(drawingId);
|
|
22974
22975
|
const currProd = useCurrentProduct(drawingId);
|
|
22975
22976
|
const currInstance = useCurrentInstance(drawingId);
|
|
22976
|
-
const
|
|
22977
|
-
|
|
22977
|
+
const {
|
|
22978
|
+
isRoot,
|
|
22979
|
+
isAssembly,
|
|
22980
|
+
isAssemblyNode
|
|
22981
|
+
} = useObjectDetails(drawingId, (currInstance == null ? void 0 : currInstance.id) || NOCCID);
|
|
22982
|
+
const showBackBtn = React.useMemo(() => pStackNotEmpty || !isRoot && (isAssemblyNode || isAssembly), [isAssembly, isAssemblyNode, isRoot, pStackNotEmpty]);
|
|
22978
22983
|
const isFeatureActive = react.useDrawing(drawingId, d => d.plugin.active.feature !== null) || false;
|
|
22979
22984
|
const name = currProd ? currProd.name : currInstance ? currInstance.name : '';
|
|
22980
22985
|
const [rename, setRename] = React.useState(false);
|
|
@@ -23060,7 +23065,7 @@ const ModelTreeHeader = ({
|
|
|
23060
23065
|
display: 'flex',
|
|
23061
23066
|
alignItems: 'center'
|
|
23062
23067
|
}
|
|
23063
|
-
}, exportComponent, mode === exports.EditMode.Assembly &&
|
|
23068
|
+
}, exportComponent, mode === exports.EditMode.Assembly && isRoot && /*#__PURE__*/React.createElement(antd.Tooltip, {
|
|
23064
23069
|
title: "Convert to subassembly"
|
|
23065
23070
|
}, /*#__PURE__*/React.createElement(antd.Button, {
|
|
23066
23071
|
style: {
|
|
@@ -23069,7 +23074,7 @@ const ModelTreeHeader = ({
|
|
|
23069
23074
|
onClick: () => setShowNameChoice(true),
|
|
23070
23075
|
icon: /*#__PURE__*/React.createElement(icons.AppstoreAddOutlined, null),
|
|
23071
23076
|
size: "small"
|
|
23072
|
-
})), /*#__PURE__*/React.createElement(antd.Tooltip, {
|
|
23077
|
+
})), mode === exports.EditMode.Assembly && /*#__PURE__*/React.createElement(antd.Tooltip, {
|
|
23073
23078
|
title: "Product management"
|
|
23074
23079
|
}, /*#__PURE__*/React.createElement(antd.Button, {
|
|
23075
23080
|
style: {
|
|
@@ -23078,7 +23083,7 @@ const ModelTreeHeader = ({
|
|
|
23078
23083
|
onClick: () => enableProductManagement(true),
|
|
23079
23084
|
icon: /*#__PURE__*/React.createElement(icons.AppstoreOutlined, null),
|
|
23080
23085
|
size: "small"
|
|
23081
|
-
})))
|
|
23086
|
+
}))), showNameChoice && /*#__PURE__*/React.createElement(NameChoice, {
|
|
23082
23087
|
drawingId: drawingId,
|
|
23083
23088
|
hideWindow: () => setShowNameChoice(false)
|
|
23084
23089
|
}));
|
|
@@ -25923,13 +25928,13 @@ const formatValue$1 = (value, angle) => {
|
|
|
25923
25928
|
if (typeof value === 'number') {
|
|
25924
25929
|
return formatNumber$1(value);
|
|
25925
25930
|
} else if (angle && typeof value === 'string' && isDegValue(value)) {
|
|
25926
|
-
const float = Number(value.slice(0, value.length -
|
|
25927
|
-
return formatNumber$1(float) + '
|
|
25931
|
+
const float = Number(value.slice(0, value.length - 3));
|
|
25932
|
+
return formatNumber$1(float) + 'deg';
|
|
25928
25933
|
}
|
|
25929
25934
|
return '';
|
|
25930
25935
|
};
|
|
25931
25936
|
const baseReg$1 = /^-?(\d*(\.\d*)?)?$/;
|
|
25932
|
-
const angleReg$1 = /^-?(\d*(\.\d*)?)?g?$/;
|
|
25937
|
+
const angleReg$1 = /^-?(\d*(\.\d*)?)?d?e?g?$/;
|
|
25933
25938
|
const LimitInput = ({
|
|
25934
25939
|
value,
|
|
25935
25940
|
setValue,
|
|
@@ -26052,10 +26057,10 @@ const formatNumber = value => value.toFixed(3).replace(/\.?0+$/, '');
|
|
|
26052
26057
|
const formatValue = (value, angle) => {
|
|
26053
26058
|
if (typeof value === 'number') {
|
|
26054
26059
|
const formatted = formatNumber(value);
|
|
26055
|
-
return angle ? formatted + '
|
|
26060
|
+
return angle ? formatted + 'deg' : formatted;
|
|
26056
26061
|
} else if (isDegValue(value)) {
|
|
26057
|
-
const float = Number(value.slice(0, value.length -
|
|
26058
|
-
return formatNumber(float) + '
|
|
26062
|
+
const float = Number(value.slice(0, value.length - 3));
|
|
26063
|
+
return formatNumber(float) + 'deg';
|
|
26059
26064
|
}
|
|
26060
26065
|
return '';
|
|
26061
26066
|
};
|
|
@@ -26075,7 +26080,7 @@ function getNumericValue(value) {
|
|
|
26075
26080
|
if (typeof value === 'number') {
|
|
26076
26081
|
return value;
|
|
26077
26082
|
} else if (isDegValue(value)) {
|
|
26078
|
-
return Number(value.slice(0, value.length -
|
|
26083
|
+
return Number(value.slice(0, value.length - 3));
|
|
26079
26084
|
}
|
|
26080
26085
|
return 0;
|
|
26081
26086
|
}
|
|
@@ -26083,7 +26088,7 @@ function convertIfAngle(value, angle) {
|
|
|
26083
26088
|
return value !== undefined && angle ? radiansToDegrees(value) : value;
|
|
26084
26089
|
}
|
|
26085
26090
|
const baseReg = /^-?(\d*(\.\d*)?)?$/;
|
|
26086
|
-
const angleReg = /^-?(\d*(\.\d*)?)?g?$/;
|
|
26091
|
+
const angleReg = /^-?(\d*(\.\d*)?)?d?e?g?$/;
|
|
26087
26092
|
const LimitedValue = ({
|
|
26088
26093
|
drawingId,
|
|
26089
26094
|
objId,
|
|
@@ -27633,7 +27638,7 @@ function RootImpl$3({
|
|
|
27633
27638
|
});
|
|
27634
27639
|
}, [drawingId, objectId, entities, ratio, offset]);
|
|
27635
27640
|
const validate = React.useCallback(() => {
|
|
27636
|
-
if (ratio.userValue === 0 || ratio.userValue === '
|
|
27641
|
+
if (ratio.userValue === 0 || ratio.userValue === '0deg') {
|
|
27637
27642
|
return ["Ratio shouldn't equal 0!"];
|
|
27638
27643
|
}
|
|
27639
27644
|
return [];
|
|
@@ -28686,7 +28691,6 @@ const load = (file, singleDrawingApp) => {
|
|
|
28686
28691
|
await classcad.createApi(drawingId).v1.common.load({
|
|
28687
28692
|
data,
|
|
28688
28693
|
format: format,
|
|
28689
|
-
ident: file.name,
|
|
28690
28694
|
encoding: 'base64',
|
|
28691
28695
|
compression: 'deflate'
|
|
28692
28696
|
}).catch(console.warn);
|
package/build/index.js
CHANGED
|
@@ -1160,7 +1160,7 @@ const Mentions = ({
|
|
|
1160
1160
|
};
|
|
1161
1161
|
|
|
1162
1162
|
function isDegValue(expr) {
|
|
1163
|
-
return expr.length > 1 && expr
|
|
1163
|
+
return expr.length > 1 && expr.slice(expr.length - 3) === 'deg' && !isNaN(Number(expr.slice(0, expr.length - 3)));
|
|
1164
1164
|
}
|
|
1165
1165
|
function getDefNumValue(numOrExpr) {
|
|
1166
1166
|
return typeof numOrExpr === 'number' ? numOrExpr : isDegValue(numOrExpr) ? numOrExpr : 0;
|
|
@@ -1244,7 +1244,7 @@ const NumOrExpr = ({
|
|
|
1244
1244
|
}, /*#__PURE__*/React__default.createElement(Prefix, null, prefix)));
|
|
1245
1245
|
};
|
|
1246
1246
|
const baseReg$3 = /^-?(\d*(\.\d*)?)?$/;
|
|
1247
|
-
const angleReg$3 = /^-?(\d*(\.\d*)?)?g?$/;
|
|
1247
|
+
const angleReg$3 = /^-?(\d*(\.\d*)?)?d?e?g?$/;
|
|
1248
1248
|
const NumInput$1 = ({
|
|
1249
1249
|
state,
|
|
1250
1250
|
setState,
|
|
@@ -1543,7 +1543,7 @@ function acceptableRange(min, max) {
|
|
|
1543
1543
|
if (!isNaN(Number(numParam))) {
|
|
1544
1544
|
value = Number(numParam);
|
|
1545
1545
|
} else if (typeof numParam === 'string' && isDegValue(numParam)) {
|
|
1546
|
-
value = Number(numParam.slice(0, numParam.length -
|
|
1546
|
+
value = Number(numParam.slice(0, numParam.length - 3));
|
|
1547
1547
|
} else {
|
|
1548
1548
|
return [];
|
|
1549
1549
|
}
|
|
@@ -1640,7 +1640,7 @@ function createRealParam(member) {
|
|
|
1640
1640
|
// In the old models if member doesn't contain experssion, the value is stored in the member.expression as string
|
|
1641
1641
|
// For example 'limit2' member for an extrusion looks like this: {expression: "50", type: "real", value: 50, visible: 1}
|
|
1642
1642
|
// These expressions should be ignored.
|
|
1643
|
-
const expr = member.expression.replace(/ExpressionSet./g, '@expr.');
|
|
1643
|
+
const expr = member.expression.replace(/ExpressionSet./g, '@expr.').replace(/(?<=\b\d[\d.]*)g\b/g, 'deg');
|
|
1644
1644
|
const isExpr = expr.length > 0 && isNaN(Number(expr));
|
|
1645
1645
|
const value = isExpr ? expr : member.value;
|
|
1646
1646
|
return value;
|
|
@@ -1948,10 +1948,10 @@ const DimValue = ({
|
|
|
1948
1948
|
|
|
1949
1949
|
// const paramName = dimension.members.paramName.value
|
|
1950
1950
|
const expr = ((_master$members3 = master.members) == null ? void 0 : (_master$members3$memb = _master$members3[memberName]) == null ? void 0 : _master$members3$memb.expression.replace(/ /g, '').replace(/ExpressionSet./g, '@expr.')) || '';
|
|
1951
|
-
const degValue = expr.length > 0 && expr
|
|
1951
|
+
const degValue = expr.length > 0 && expr.slice(expr.length - 3) === 'deg' ? Number(expr.slice(0, expr.length - 3)) : NaN;
|
|
1952
1952
|
const isDeg = !isNaN(degValue);
|
|
1953
1953
|
const value = isDeg ? degValue : (_master$members4 = master.members) == null ? void 0 : (_master$members4$memb = _master$members4[memberName]) == null ? void 0 : _master$members4$memb.value;
|
|
1954
|
-
const valueStr = isDeg ? value.toFixed(2) + '
|
|
1954
|
+
const valueStr = isDeg ? value.toFixed(2) + 'deg' : value.toFixed(2);
|
|
1955
1955
|
return expr && !isDeg ? expr + ' (' + valueStr + ')' : valueStr;
|
|
1956
1956
|
}, [dimension, master, memberName, angle]);
|
|
1957
1957
|
const [editMode, setEditMode] = React__default.useState(false);
|
|
@@ -5877,7 +5877,7 @@ function parsePoint(param) {
|
|
|
5877
5877
|
return comps;
|
|
5878
5878
|
}
|
|
5879
5879
|
function getDisplayValue(valOrExpr) {
|
|
5880
|
-
return typeof valOrExpr === 'string' ? valOrExpr.replace(/ /g, '')
|
|
5880
|
+
return typeof valOrExpr === 'string' ? valOrExpr.replace(/ /g, '') : valOrExpr.toString();
|
|
5881
5881
|
}
|
|
5882
5882
|
const DisplayBase = styled.div`
|
|
5883
5883
|
display: flex;
|
|
@@ -6212,7 +6212,7 @@ const PointEditor = ({
|
|
|
6212
6212
|
};
|
|
6213
6213
|
|
|
6214
6214
|
function createPointParam(member) {
|
|
6215
|
-
const expr = member.expression.replace(/ExpressionSet./g, '@expr.');
|
|
6215
|
+
const expr = member.expression.replace(/ExpressionSet./g, '@expr.').replace(/(?<=\b\d[\d.]*)g\b/g, 'deg');
|
|
6216
6216
|
const isExpr = expr.length > 0;
|
|
6217
6217
|
const value = isExpr ? expr : member.value;
|
|
6218
6218
|
return value;
|
|
@@ -9513,7 +9513,7 @@ function CreateAngle(drawingId, pluginId) {
|
|
|
9513
9513
|
} = tmpObjects[tmpDimensionId];
|
|
9514
9514
|
const sector = getArcSector(dimPos, dir0, dir1, center);
|
|
9515
9515
|
const previewValue = getArcPreviewValue(dir0, dir1, sector, reflex);
|
|
9516
|
-
const degValue = radiansToDegrees(previewValue) + '
|
|
9516
|
+
const degValue = radiansToDegrees(previewValue) + 'deg';
|
|
9517
9517
|
createApi$1(drawingId).v1.sketch.dimension({
|
|
9518
9518
|
id: sketchId,
|
|
9519
9519
|
name: 'Ang',
|
|
@@ -10731,7 +10731,8 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
10731
10731
|
id: sketchId,
|
|
10732
10732
|
startPos,
|
|
10733
10733
|
midPos: midInfo.mid,
|
|
10734
|
-
endPos
|
|
10734
|
+
endPos,
|
|
10735
|
+
genTangency: arcType === HandlersList.DRAWARCTANGENT
|
|
10735
10736
|
});
|
|
10736
10737
|
promise.then(() => {
|
|
10737
10738
|
// Remove the old temporary arc and its points once a permanent one is created in its place
|
|
@@ -14052,7 +14053,7 @@ const TmpAngularDim = props => {
|
|
|
14052
14053
|
previewValue: previewValue_
|
|
14053
14054
|
};
|
|
14054
14055
|
}, [dir0, dir1, center, dimPos, reflex]);
|
|
14055
|
-
const text = radiansToDegrees(previewValue).toFixed(2) + '
|
|
14056
|
+
const text = radiansToDegrees(previewValue).toFixed(2) + 'deg';
|
|
14056
14057
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Line$2, {
|
|
14057
14058
|
start: cornerP,
|
|
14058
14059
|
end: startFoot
|
|
@@ -15108,12 +15109,12 @@ function useShowRigidSet(drawingId, pluginId, selectorId) {
|
|
|
15108
15109
|
}
|
|
15109
15110
|
const convertDegToRadValue = angle => {
|
|
15110
15111
|
if (isDegValue(angle)) {
|
|
15111
|
-
return degreesToRadians(Number(angle.slice(0, angle.length -
|
|
15112
|
+
return degreesToRadians(Number(angle.slice(0, angle.length - 3)));
|
|
15112
15113
|
}
|
|
15113
15114
|
return angle === '' ? NaN : Number(angle);
|
|
15114
15115
|
};
|
|
15115
15116
|
const baseReg$2 = /^-?(\d*(\.\d*)?)?$/;
|
|
15116
|
-
const angleReg$2 = /^-?(\d*(\.\d*)?)?g?$/;
|
|
15117
|
+
const angleReg$2 = /^-?(\d*(\.\d*)?)?d?e?g?$/;
|
|
15117
15118
|
const Input$2 = _ref => {
|
|
15118
15119
|
let {
|
|
15119
15120
|
angle = false,
|
|
@@ -15261,7 +15262,7 @@ const CircPattern = () => {
|
|
|
15261
15262
|
const [rgSetSelId, setRgSetSelId] = React__default.useState('');
|
|
15262
15263
|
const [centerSelId, setCenterSelId] = React__default.useState('');
|
|
15263
15264
|
const [countD, setCountD] = React__default.useState('3');
|
|
15264
|
-
const [angleD, setAngleD] = React__default.useState('
|
|
15265
|
+
const [angleD, setAngleD] = React__default.useState('45deg');
|
|
15265
15266
|
useShowRigidSet(drawingId, pluginId, rgSetSelId);
|
|
15266
15267
|
const createPattern = React__default.useCallback(() => {
|
|
15267
15268
|
var _getDrawing$selection2, _getDrawing$selection3;
|
|
@@ -15303,7 +15304,7 @@ const CircPattern = () => {
|
|
|
15303
15304
|
contentWidth: 50
|
|
15304
15305
|
}, /*#__PURE__*/React__default.createElement(Input$2, {
|
|
15305
15306
|
value: angleD,
|
|
15306
|
-
defaultValue: '
|
|
15307
|
+
defaultValue: '45deg',
|
|
15307
15308
|
setValue: setAngleD,
|
|
15308
15309
|
angle: true
|
|
15309
15310
|
})), /*#__PURE__*/React__default.createElement(Wrapper, {
|
|
@@ -22950,8 +22951,12 @@ const ModelTreeHeader = ({
|
|
|
22950
22951
|
const mode = useEditMode(drawingId);
|
|
22951
22952
|
const currProd = useCurrentProduct(drawingId);
|
|
22952
22953
|
const currInstance = useCurrentInstance(drawingId);
|
|
22953
|
-
const
|
|
22954
|
-
|
|
22954
|
+
const {
|
|
22955
|
+
isRoot,
|
|
22956
|
+
isAssembly,
|
|
22957
|
+
isAssemblyNode
|
|
22958
|
+
} = useObjectDetails(drawingId, (currInstance == null ? void 0 : currInstance.id) || NOCCID);
|
|
22959
|
+
const showBackBtn = React__default.useMemo(() => pStackNotEmpty || !isRoot && (isAssemblyNode || isAssembly), [isAssembly, isAssemblyNode, isRoot, pStackNotEmpty]);
|
|
22955
22960
|
const isFeatureActive = useDrawing(drawingId, d => d.plugin.active.feature !== null) || false;
|
|
22956
22961
|
const name = currProd ? currProd.name : currInstance ? currInstance.name : '';
|
|
22957
22962
|
const [rename, setRename] = React__default.useState(false);
|
|
@@ -23037,7 +23042,7 @@ const ModelTreeHeader = ({
|
|
|
23037
23042
|
display: 'flex',
|
|
23038
23043
|
alignItems: 'center'
|
|
23039
23044
|
}
|
|
23040
|
-
}, exportComponent, mode === EditMode.Assembly &&
|
|
23045
|
+
}, exportComponent, mode === EditMode.Assembly && isRoot && /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
23041
23046
|
title: "Convert to subassembly"
|
|
23042
23047
|
}, /*#__PURE__*/React__default.createElement(Button$1, {
|
|
23043
23048
|
style: {
|
|
@@ -23046,7 +23051,7 @@ const ModelTreeHeader = ({
|
|
|
23046
23051
|
onClick: () => setShowNameChoice(true),
|
|
23047
23052
|
icon: /*#__PURE__*/React__default.createElement(AppstoreAddOutlined, null),
|
|
23048
23053
|
size: "small"
|
|
23049
|
-
})), /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
23054
|
+
})), mode === EditMode.Assembly && /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
23050
23055
|
title: "Product management"
|
|
23051
23056
|
}, /*#__PURE__*/React__default.createElement(Button$1, {
|
|
23052
23057
|
style: {
|
|
@@ -23055,7 +23060,7 @@ const ModelTreeHeader = ({
|
|
|
23055
23060
|
onClick: () => enableProductManagement(true),
|
|
23056
23061
|
icon: /*#__PURE__*/React__default.createElement(AppstoreOutlined, null),
|
|
23057
23062
|
size: "small"
|
|
23058
|
-
})))
|
|
23063
|
+
}))), showNameChoice && /*#__PURE__*/React__default.createElement(NameChoice, {
|
|
23059
23064
|
drawingId: drawingId,
|
|
23060
23065
|
hideWindow: () => setShowNameChoice(false)
|
|
23061
23066
|
}));
|
|
@@ -25900,13 +25905,13 @@ const formatValue$1 = (value, angle) => {
|
|
|
25900
25905
|
if (typeof value === 'number') {
|
|
25901
25906
|
return formatNumber$1(value);
|
|
25902
25907
|
} else if (angle && typeof value === 'string' && isDegValue(value)) {
|
|
25903
|
-
const float = Number(value.slice(0, value.length -
|
|
25904
|
-
return formatNumber$1(float) + '
|
|
25908
|
+
const float = Number(value.slice(0, value.length - 3));
|
|
25909
|
+
return formatNumber$1(float) + 'deg';
|
|
25905
25910
|
}
|
|
25906
25911
|
return '';
|
|
25907
25912
|
};
|
|
25908
25913
|
const baseReg$1 = /^-?(\d*(\.\d*)?)?$/;
|
|
25909
|
-
const angleReg$1 = /^-?(\d*(\.\d*)?)?g?$/;
|
|
25914
|
+
const angleReg$1 = /^-?(\d*(\.\d*)?)?d?e?g?$/;
|
|
25910
25915
|
const LimitInput = ({
|
|
25911
25916
|
value,
|
|
25912
25917
|
setValue,
|
|
@@ -26029,10 +26034,10 @@ const formatNumber = value => value.toFixed(3).replace(/\.?0+$/, '');
|
|
|
26029
26034
|
const formatValue = (value, angle) => {
|
|
26030
26035
|
if (typeof value === 'number') {
|
|
26031
26036
|
const formatted = formatNumber(value);
|
|
26032
|
-
return angle ? formatted + '
|
|
26037
|
+
return angle ? formatted + 'deg' : formatted;
|
|
26033
26038
|
} else if (isDegValue(value)) {
|
|
26034
|
-
const float = Number(value.slice(0, value.length -
|
|
26035
|
-
return formatNumber(float) + '
|
|
26039
|
+
const float = Number(value.slice(0, value.length - 3));
|
|
26040
|
+
return formatNumber(float) + 'deg';
|
|
26036
26041
|
}
|
|
26037
26042
|
return '';
|
|
26038
26043
|
};
|
|
@@ -26052,7 +26057,7 @@ function getNumericValue(value) {
|
|
|
26052
26057
|
if (typeof value === 'number') {
|
|
26053
26058
|
return value;
|
|
26054
26059
|
} else if (isDegValue(value)) {
|
|
26055
|
-
return Number(value.slice(0, value.length -
|
|
26060
|
+
return Number(value.slice(0, value.length - 3));
|
|
26056
26061
|
}
|
|
26057
26062
|
return 0;
|
|
26058
26063
|
}
|
|
@@ -26060,7 +26065,7 @@ function convertIfAngle(value, angle) {
|
|
|
26060
26065
|
return value !== undefined && angle ? radiansToDegrees(value) : value;
|
|
26061
26066
|
}
|
|
26062
26067
|
const baseReg = /^-?(\d*(\.\d*)?)?$/;
|
|
26063
|
-
const angleReg = /^-?(\d*(\.\d*)?)?g?$/;
|
|
26068
|
+
const angleReg = /^-?(\d*(\.\d*)?)?d?e?g?$/;
|
|
26064
26069
|
const LimitedValue = ({
|
|
26065
26070
|
drawingId,
|
|
26066
26071
|
objId,
|
|
@@ -27610,7 +27615,7 @@ function RootImpl$3({
|
|
|
27610
27615
|
});
|
|
27611
27616
|
}, [drawingId, objectId, entities, ratio, offset]);
|
|
27612
27617
|
const validate = React__default.useCallback(() => {
|
|
27613
|
-
if (ratio.userValue === 0 || ratio.userValue === '
|
|
27618
|
+
if (ratio.userValue === 0 || ratio.userValue === '0deg') {
|
|
27614
27619
|
return ["Ratio shouldn't equal 0!"];
|
|
27615
27620
|
}
|
|
27616
27621
|
return [];
|
|
@@ -28663,7 +28668,6 @@ const load = (file, singleDrawingApp) => {
|
|
|
28663
28668
|
await createApi$1(drawingId).v1.common.load({
|
|
28664
28669
|
data,
|
|
28665
28670
|
format: format,
|
|
28666
|
-
ident: file.name,
|
|
28667
28671
|
encoding: 'base64',
|
|
28668
28672
|
compression: 'deflate'
|
|
28669
28673
|
}).catch(console.warn);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buerli.io/react-cad",
|
|
3
|
-
"version": "0.13.1-beta.
|
|
3
|
+
"version": "0.13.1-beta.11",
|
|
4
4
|
"description": "buerli CAD components",
|
|
5
5
|
"author": "AWV Informatik AG <info@awv-informatik.ch>",
|
|
6
6
|
"repository": {},
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"three": ">=0.153"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@buerli.io/classcad": "0.13.1-beta.
|
|
91
|
-
"@buerli.io/react": "0.13.1-beta.
|
|
90
|
+
"@buerli.io/classcad": "0.13.1-beta.11",
|
|
91
|
+
"@buerli.io/react": "0.13.1-beta.11",
|
|
92
92
|
"@dnd-kit/core": "^6.0.8",
|
|
93
93
|
"@dnd-kit/modifiers": "^6.0.1",
|
|
94
94
|
"@dnd-kit/sortable": "^7.0.2",
|