@classcad/react-cad 3.0.0-beta.20261120102655 → 3.0.0-beta.20261120104339
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 +3 -3
- package/build/index.cjs.js +20 -1
- package/build/index.js +20 -1
- package/package.json +3 -3
- package/tsconfig.build.json +1 -1
- package/vitest.config.mts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @buerli.io/react-cad
|
|
2
2
|
|
|
3
|
-
## 3.0.0-beta.
|
|
3
|
+
## 3.0.0-beta.20261120104339
|
|
4
4
|
|
|
5
5
|
### Major Changes
|
|
6
6
|
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
- On WebGPU a curved body's silhouette follows the view. It stayed where it was first drawn, a black line across the body. Seams, where a curved face meets itself, are now drawn like every other edge, so the edge that can be picked is the edge that is seen.
|
|
27
27
|
- The sidebar's lists follow what is picked on the stage: a feature, an instance, a body, a constraint or a sketch element picked in the view is scrolled into view in its list, however long the list. An instance picked inside a folded sub-assembly is found at the sub-assembly's row. Only the list moves, never the page; rows picked together show the topmost of them.
|
|
28
28
|
- Updated dependencies
|
|
29
|
-
- @classcad/client@3.0.0-beta.
|
|
30
|
-
- @classcad/react@3.0.0-beta.
|
|
29
|
+
- @classcad/client@3.0.0-beta.20261120104339
|
|
30
|
+
- @classcad/react@3.0.0-beta.20261120104339
|
|
31
31
|
|
|
32
32
|
## 2.0.0
|
|
33
33
|
|
package/build/index.cjs.js
CHANGED
|
@@ -22988,6 +22988,23 @@ const constraintNames = {
|
|
|
22988
22988
|
[client.ScgClassType.CC2DAngleOXConstraint]: 'Angle to the X axis',
|
|
22989
22989
|
[client.ScgClassType.CCRigidSet]: 'Rigid set'
|
|
22990
22990
|
};
|
|
22991
|
+
const useIsApplicable = constrClass => {
|
|
22992
|
+
const {
|
|
22993
|
+
drawingId,
|
|
22994
|
+
pluginId
|
|
22995
|
+
} = React.useContext(RootContext);
|
|
22996
|
+
const pendingConstraint = useSketchState(drawingId, pluginId, s => s.pendingConstraint);
|
|
22997
|
+
const selected = useDrawingArr(drawingId, d => d.interaction.selected);
|
|
22998
|
+
if (pendingConstraint) {
|
|
22999
|
+
return constrClass === pendingConstraint;
|
|
23000
|
+
}
|
|
23001
|
+
if (selected.length === 0) {
|
|
23002
|
+
return true;
|
|
23003
|
+
}
|
|
23004
|
+
const entities = selected.map(info => info.objectId);
|
|
23005
|
+
const tree = sdkjs.getDrawing(drawingId).structure.tree;
|
|
23006
|
+
return Boolean(constraintsHelpers[classNameMap[constrClass]].adapt(entities, tree));
|
|
23007
|
+
};
|
|
22991
23008
|
const ConstrBtn = ({
|
|
22992
23009
|
constrClass
|
|
22993
23010
|
}) => {
|
|
@@ -22999,6 +23016,7 @@ const ConstrBtn = ({
|
|
|
22999
23016
|
const {
|
|
23000
23017
|
set
|
|
23001
23018
|
} = sdkjs.getPlugin(drawingId, pluginId);
|
|
23019
|
+
const isApplicable = useIsApplicable(constrClass);
|
|
23002
23020
|
const isPicking = useSketchState(drawingId, pluginId, s => s.activeHandler === HandlersList.CREATECONSTRAINT && s.pendingConstraint === constrClass);
|
|
23003
23021
|
const ref = React.useRef(null);
|
|
23004
23022
|
|
|
@@ -23065,6 +23083,7 @@ const ConstrBtn = ({
|
|
|
23065
23083
|
className: "rcad-tool",
|
|
23066
23084
|
"aria-label": name,
|
|
23067
23085
|
"aria-pressed": isPicking,
|
|
23086
|
+
disabled: !isApplicable,
|
|
23068
23087
|
onClick: onClick
|
|
23069
23088
|
}, /*#__PURE__*/React.createElement(Icon$1, {
|
|
23070
23089
|
url: resources[constrClass],
|
|
@@ -36227,7 +36246,7 @@ function useFeatureCount(drawingId) {
|
|
|
36227
36246
|
};
|
|
36228
36247
|
}
|
|
36229
36248
|
|
|
36230
|
-
// TODO: Move to buerli/packages/react or buerli/packages/
|
|
36249
|
+
// TODO: Move to buerli/packages/react or buerli/packages/core
|
|
36231
36250
|
function readFile(file, type) {
|
|
36232
36251
|
return new Promise((resolve, reject) => {
|
|
36233
36252
|
const reader = new FileReader();
|
package/build/index.js
CHANGED
|
@@ -22965,6 +22965,23 @@ const constraintNames = {
|
|
|
22965
22965
|
[ScgClassType.CC2DAngleOXConstraint]: 'Angle to the X axis',
|
|
22966
22966
|
[ScgClassType.CCRigidSet]: 'Rigid set'
|
|
22967
22967
|
};
|
|
22968
|
+
const useIsApplicable = constrClass => {
|
|
22969
|
+
const {
|
|
22970
|
+
drawingId,
|
|
22971
|
+
pluginId
|
|
22972
|
+
} = React__default.useContext(RootContext);
|
|
22973
|
+
const pendingConstraint = useSketchState(drawingId, pluginId, s => s.pendingConstraint);
|
|
22974
|
+
const selected = useDrawingArr(drawingId, d => d.interaction.selected);
|
|
22975
|
+
if (pendingConstraint) {
|
|
22976
|
+
return constrClass === pendingConstraint;
|
|
22977
|
+
}
|
|
22978
|
+
if (selected.length === 0) {
|
|
22979
|
+
return true;
|
|
22980
|
+
}
|
|
22981
|
+
const entities = selected.map(info => info.objectId);
|
|
22982
|
+
const tree = getDrawing(drawingId).structure.tree;
|
|
22983
|
+
return Boolean(constraintsHelpers[classNameMap[constrClass]].adapt(entities, tree));
|
|
22984
|
+
};
|
|
22968
22985
|
const ConstrBtn = ({
|
|
22969
22986
|
constrClass
|
|
22970
22987
|
}) => {
|
|
@@ -22976,6 +22993,7 @@ const ConstrBtn = ({
|
|
|
22976
22993
|
const {
|
|
22977
22994
|
set
|
|
22978
22995
|
} = getPlugin(drawingId, pluginId);
|
|
22996
|
+
const isApplicable = useIsApplicable(constrClass);
|
|
22979
22997
|
const isPicking = useSketchState(drawingId, pluginId, s => s.activeHandler === HandlersList.CREATECONSTRAINT && s.pendingConstraint === constrClass);
|
|
22980
22998
|
const ref = React__default.useRef(null);
|
|
22981
22999
|
|
|
@@ -23042,6 +23060,7 @@ const ConstrBtn = ({
|
|
|
23042
23060
|
className: "rcad-tool",
|
|
23043
23061
|
"aria-label": name,
|
|
23044
23062
|
"aria-pressed": isPicking,
|
|
23063
|
+
disabled: !isApplicable,
|
|
23045
23064
|
onClick: onClick
|
|
23046
23065
|
}, /*#__PURE__*/React__default.createElement(Icon$1, {
|
|
23047
23066
|
url: resources[constrClass],
|
|
@@ -36204,7 +36223,7 @@ function useFeatureCount(drawingId) {
|
|
|
36204
36223
|
};
|
|
36205
36224
|
}
|
|
36206
36225
|
|
|
36207
|
-
// TODO: Move to buerli/packages/react or buerli/packages/
|
|
36226
|
+
// TODO: Move to buerli/packages/react or buerli/packages/core
|
|
36208
36227
|
function readFile(file, type) {
|
|
36209
36228
|
return new Promise((resolve, reject) => {
|
|
36210
36229
|
const reader = new FileReader();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classcad/react-cad",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.20261120104339",
|
|
4
4
|
"homepage": "https://sdkjs.classcad.ch",
|
|
5
5
|
"description": "The CAD user interface on the ClassCAD SDK: feature dialogs, model tree, sketcher",
|
|
6
6
|
"author": "AWV Informatik AG <info@awv-informatik.ch>",
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
86
|
"@babel/runtime": "^7.29.10",
|
|
87
|
-
"@classcad/client": "3.0.0-beta.
|
|
88
|
-
"@classcad/react": "3.0.0-beta.
|
|
87
|
+
"@classcad/client": "3.0.0-beta.20261120104339",
|
|
88
|
+
"@classcad/react": "3.0.0-beta.20261120104339",
|
|
89
89
|
"@dnd-kit/core": "^6.3.1",
|
|
90
90
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
91
91
|
"@dnd-kit/sortable": "^10.0.0",
|
package/tsconfig.build.json
CHANGED
package/vitest.config.mts
CHANGED