Skip to content

CAD Editor entries and transactions ​

Public entryWorkspace / release mapConsumer role
Rootsrc/index.ts / dist/index.jsPure native sessions and public types.
/reactsrc/react/index.tsx / dist/react/index.jsMounted viewport, inspector and reusable task components.
/styles.csssrc/styles.css / dist/cad-editor.cssExplicit host stylesheet import.

Root factories and errors ​

createCadEditorSession(initialDocument:CadDocumentV1,options?:CadEditorSessionOptions):CadEditorSession validates and copies complete native data. Options select displayBodyIds and view independently of the document.

createCadEditorFeatureSession(document:BooleanExtrusionFeatureGraphV0,options:CadEditorFeatureSessionOptions):CadEditorFeatureSession creates the separate feature-graph session. Options specify native graph admission, selected feature/output slot and bounded mesh profile.

CadEditorError carries code, bounded message, copied context and actual cause.

Canonical session reference ​

MethodsArguments and resultLifetime / refusal
getSnapshot(), subscribe(listener)Copied CPU snapshot; unsubscribe function.No renderer exposure.
selectSurfacePole, selectCurvePole, requestSelection, resolveSelectionTransitionQualified body/coefficient target; transition token and explicit choice.Stale/unsupported target refuses.
stageSurfacePoleField, stageCurvePoleField, stageBodyTranslationFieldField and raw string; retains separate draft.Native admission occurs at preparation.
setEditTarget, setRotationAxis, stageBodyRotation, setScaleAxis, stageBodyScaleSupported edit mode/axis and raw scalar.Profile capability governs actual edit.
prepareApply(): CadEditorCandidate | nullWhole native candidate or no effective change.Does not commit authored history.
prepareOpen(text,options?), prepareUndo(), prepareRedo()Session-bound candidate.Pending/stale/budget/profile guards apply.
prepareDisplayBodies, prepareCurveFocus, prepareDocumentViewDisplay candidate, retaining native authority.Only display generation advances after acceptance.
prepareRenameBody(bodyId,name)Candidate or no-op.Canonical body label is separate from native IDs.
acceptCandidate(token), cancelCandidate(token)Exact session-local token; acceptance returns snapshot.Foreign/stale/reused tokens refuse.
serializeAccepted(): CadEditorDownload, markDownloaded(token)Token, text, suggested filename; started-download status.Pending excluded; stale capture refuses.
inspectExport, exportAccepted, inspectCurveLength, inspectCurveD2, inspectSurfaceD2, inspectCurveCurvature, inspectSurfaceCurvatureAccepted revision-qualified reference and query/options.Original native result; errors preserve authority.
discardPending(), dispose()Clear raw fields; release CPU session.Dispose idempotent, later mutations refuse.

Feature and React entries ​

Feature sessions expose the shared candidate/history/download lifecycle plus selectFeature, stageLengthParameter, stageBooleanOperation, getFaceCorners, prepareFaceCornerEdit, prepareDisplayOutputs, prepareExtrusionTransaction, prepareParameterTransaction, prepareReferencedFeatureTransaction and inspectExtrusionProperties.

React exports CadEditor, CadEditorViewport, CadEditorInspector, useCadEditorSnapshot, CadEditorFeature, useCadEditorFeatureSnapshot, CadEditorExportReview, CadEditorGeometryAnalysis and CadEditorBodyRename, with their public props/receipt types. Hooks subscribe to caller-owned sessions. Receipts distinguish actual native inventory, view and fresh pixels; they are not native document authority.

packages/barocss-cad-editor/package.json (Manifest and version; local source) · packages/barocss-cad-editor/README.md (Package task notes; local source)

Local manual snapshot. Availability is stated on each package page.