@solid-labs/fab-one-widget 0.1.0 → 0.1.2
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/GirthManagerWidget-DizbUvPi.js +2280 -0
- package/dist/GirthManagerWidget-DizbUvPi.js.map +1 -0
- package/dist/girth-manager-ui/src/GirthManagerCore.d.ts +37 -0
- package/dist/girth-manager-ui/src/components/AlignedOrbitControls.d.ts +5 -0
- package/dist/girth-manager-ui/src/components/CameraFit.d.ts +11 -0
- package/dist/girth-manager-ui/src/components/CircumferenceMeasurements.d.ts +16 -0
- package/dist/girth-manager-ui/src/components/CircumferenceSlice.d.ts +16 -0
- package/dist/girth-manager-ui/src/components/ClickableMesh.d.ts +8 -0
- package/dist/girth-manager-ui/src/components/DebugOverlays.d.ts +31 -0
- package/dist/girth-manager-ui/src/components/DebugPanel.d.ts +6 -0
- package/dist/girth-manager-ui/src/components/DraggableLineHandle.d.ts +16 -0
- package/dist/girth-manager-ui/src/components/ErrorDisplay.d.ts +4 -0
- package/dist/girth-manager-ui/src/components/LandmarkMarkers.d.ts +5 -0
- package/dist/girth-manager-ui/src/components/LoadingSpinner.d.ts +3 -0
- package/dist/girth-manager-ui/src/components/ScaleNotice.d.ts +5 -0
- package/dist/girth-manager-ui/src/components/ShellNotice.d.ts +5 -0
- package/dist/girth-manager-ui/src/components/Stepper.d.ts +10 -0
- package/dist/girth-manager-ui/src/components/TransverseView.d.ts +10 -0
- package/dist/girth-manager-ui/src/components/VerticalDimension.d.ts +8 -0
- package/dist/girth-manager-ui/src/config.d.ts +29 -0
- package/dist/girth-manager-ui/src/hooks/useCachedBVH.d.ts +3 -0
- package/dist/girth-manager-ui/src/index.d.ts +38 -0
- package/dist/girth-manager-ui/src/processing/alignment.d.ts +4 -0
- package/dist/girth-manager-ui/src/processing/constants.d.ts +7 -0
- package/dist/girth-manager-ui/src/processing/cut-plane.d.ts +13 -0
- package/dist/girth-manager-ui/src/processing/mesh-ops.d.ts +33 -0
- package/dist/girth-manager-ui/src/processing/pipeline.d.ts +46 -0
- package/dist/girth-manager-ui/src/processing/slice.d.ts +14 -0
- package/dist/girth-manager-ui/src/processing/stl-convert.d.ts +2 -0
- package/dist/girth-manager-ui/src/processing/types.d.ts +43 -0
- package/dist/girth-manager-ui/src/processing/validation.d.ts +6 -0
- package/dist/girth-manager-ui/src/processing/vertex-colors.d.ts +8 -0
- package/dist/girth-manager-ui/src/processing/wasm-loader.d.ts +23 -0
- package/dist/{store.d.ts → girth-manager-ui/src/store.d.ts} +1 -14
- package/dist/girth-manager-web-widget/src/GirthManagerWidget.d.ts +13 -0
- package/dist/girth-manager-web-widget/src/dev-harness.d.ts +1 -0
- package/dist/girth-manager-web-widget/src/index.d.ts +4 -0
- package/dist/girth-manager-web-widget/src/types.d.ts +76 -0
- package/dist/girth-manager-web-widget/src/web-component.d.ts +34 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/web-component.js +78 -0
- package/dist/web-component.js.map +1 -0
- package/package.json +36 -26
- package/dist/FabOneWidget.d.ts +0 -19
- package/dist/fab-one-widget.js +0 -4732
- package/dist/index.d.ts +0 -2
- package/dist/protosthetics_geo-BcQYS-wX.js +0 -1
- package/dist/register.d.ts +0 -2
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { WidgetRequest, WidgetResponse } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Custom Element wrapper for Angular integration.
|
|
4
|
+
*
|
|
5
|
+
* Usage in Angular:
|
|
6
|
+
* // In the component class:
|
|
7
|
+
* async ngAfterViewInit() {
|
|
8
|
+
* const wasm = await import('galileo-core-geo');
|
|
9
|
+
* await wasm.default();
|
|
10
|
+
* this.widgetEl.nativeElement.wasmModule = wasm;
|
|
11
|
+
* this.widgetEl.nativeElement.request = { spacing_type: 'BK', scan_url: '...' };
|
|
12
|
+
* }
|
|
13
|
+
*
|
|
14
|
+
* // In the template:
|
|
15
|
+
* <girth-manager-widget #widgetEl (widgetComplete)="onComplete($event)"></girth-manager-widget>
|
|
16
|
+
*/
|
|
17
|
+
declare class GirthManagerWidgetElement extends HTMLElement {
|
|
18
|
+
private _root;
|
|
19
|
+
private _request;
|
|
20
|
+
private _wasmModule;
|
|
21
|
+
static get observedAttributes(): string[];
|
|
22
|
+
get request(): WidgetRequest | null;
|
|
23
|
+
set request(value: WidgetRequest | string | null);
|
|
24
|
+
/** Set the pre-loaded WASM module (galileo-core-geo). Must be set before or alongside request. */
|
|
25
|
+
get wasmModule(): unknown;
|
|
26
|
+
set wasmModule(value: unknown);
|
|
27
|
+
connectedCallback(): void;
|
|
28
|
+
disconnectedCallback(): void;
|
|
29
|
+
attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
|
|
30
|
+
private _handleComplete;
|
|
31
|
+
private _render;
|
|
32
|
+
}
|
|
33
|
+
export { GirthManagerWidgetElement };
|
|
34
|
+
export type { WidgetRequest, WidgetResponse };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createElement as s } from "react";
|
|
2
|
+
import { createRoot as i } from "react-dom/client";
|
|
3
|
+
import { G as o } from "./GirthManagerWidget-DizbUvPi.js";
|
|
4
|
+
class n extends HTMLElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments), this._root = null, this._request = null, this._wasmModule = void 0, this._handleComplete = (e) => {
|
|
7
|
+
this.dispatchEvent(
|
|
8
|
+
new CustomEvent("widgetComplete", {
|
|
9
|
+
detail: e,
|
|
10
|
+
bubbles: true,
|
|
11
|
+
composed: true
|
|
12
|
+
})
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
static get observedAttributes() {
|
|
17
|
+
return ["request"];
|
|
18
|
+
}
|
|
19
|
+
get request() {
|
|
20
|
+
return this._request;
|
|
21
|
+
}
|
|
22
|
+
set request(e) {
|
|
23
|
+
if (typeof e == "string")
|
|
24
|
+
try {
|
|
25
|
+
this._request = JSON.parse(e);
|
|
26
|
+
} catch {
|
|
27
|
+
console.error("[GirthManagerWidget] Invalid JSON for request attribute:", e);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
else
|
|
31
|
+
this._request = e;
|
|
32
|
+
this._render();
|
|
33
|
+
}
|
|
34
|
+
/** Set the pre-loaded WASM module (galileo-core-geo). Must be set before or alongside request. */
|
|
35
|
+
get wasmModule() {
|
|
36
|
+
return this._wasmModule;
|
|
37
|
+
}
|
|
38
|
+
set wasmModule(e) {
|
|
39
|
+
this._wasmModule = e, this._render();
|
|
40
|
+
}
|
|
41
|
+
connectedCallback() {
|
|
42
|
+
const e = this.attachShadow({ mode: "open" }), t = document.createElement("div");
|
|
43
|
+
t.style.width = "100%", t.style.height = "100%", e.appendChild(t), this._root = i(t);
|
|
44
|
+
const r = this.getAttribute("request");
|
|
45
|
+
if (r && !this._request)
|
|
46
|
+
try {
|
|
47
|
+
this._request = JSON.parse(r);
|
|
48
|
+
} catch {
|
|
49
|
+
console.error("[GirthManagerWidget] Invalid JSON in request attribute");
|
|
50
|
+
}
|
|
51
|
+
this._render();
|
|
52
|
+
}
|
|
53
|
+
disconnectedCallback() {
|
|
54
|
+
var _a;
|
|
55
|
+
(_a = this._root) == null ? void 0 : _a.unmount(), this._root = null;
|
|
56
|
+
}
|
|
57
|
+
attributeChangedCallback(e, t, r) {
|
|
58
|
+
if (e === "request" && r)
|
|
59
|
+
try {
|
|
60
|
+
this._request = JSON.parse(r), this._render();
|
|
61
|
+
} catch {
|
|
62
|
+
console.error("[GirthManagerWidget] Invalid JSON in request attribute");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
_render() {
|
|
66
|
+
!this._root || !this._request || this._root.render(
|
|
67
|
+
s(o, {
|
|
68
|
+
request: this._request,
|
|
69
|
+
onComplete: this._handleComplete,
|
|
70
|
+
wasmModule: this._wasmModule
|
|
71
|
+
})
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
customElements.get("girth-manager-widget") || customElements.define("girth-manager-widget", n);
|
|
76
|
+
export {
|
|
77
|
+
n as GirthManagerWidgetElement
|
|
78
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-component.js","sources":["../src/web-component.ts"],"sourcesContent":["import { createElement } from \"react\"\nimport { createRoot, type Root } from \"react-dom/client\"\nimport { GirthManagerWidget } from \"./GirthManagerWidget\"\nimport type { WidgetRequest, WidgetResponse } from \"./types\"\n\n/**\n * Custom Element wrapper for Angular integration.\n *\n * Usage in Angular:\n * // In the component class:\n * async ngAfterViewInit() {\n * const wasm = await import('galileo-core-geo');\n * await wasm.default();\n * this.widgetEl.nativeElement.wasmModule = wasm;\n * this.widgetEl.nativeElement.request = { spacing_type: 'BK', scan_url: '...' };\n * }\n *\n * // In the template:\n * <girth-manager-widget #widgetEl (widgetComplete)=\"onComplete($event)\"></girth-manager-widget>\n */\nclass GirthManagerWidgetElement extends HTMLElement {\n private _root: Root | null = null\n private _request: WidgetRequest | null = null\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _wasmModule: any = undefined\n\n static get observedAttributes() {\n return [\"request\"]\n }\n\n get request(): WidgetRequest | null {\n return this._request\n }\n\n set request(value: WidgetRequest | string | null) {\n if (typeof value === \"string\") {\n try {\n this._request = JSON.parse(value)\n } catch {\n console.error(\"[GirthManagerWidget] Invalid JSON for request attribute:\", value)\n return\n }\n } else {\n this._request = value\n }\n this._render()\n }\n\n /** Set the pre-loaded WASM module (galileo-core-geo). Must be set before or alongside request. */\n get wasmModule() {\n return this._wasmModule\n }\n\n set wasmModule(value: unknown) {\n this._wasmModule = value\n this._render()\n }\n\n connectedCallback() {\n const shadow = this.attachShadow({ mode: \"open\" })\n const container = document.createElement(\"div\")\n container.style.width = \"100%\"\n container.style.height = \"100%\"\n shadow.appendChild(container)\n this._root = createRoot(container)\n\n // Parse request from attribute if set before connection\n const attrValue = this.getAttribute(\"request\")\n if (attrValue && !this._request) {\n try {\n this._request = JSON.parse(attrValue)\n } catch {\n console.error(\"[GirthManagerWidget] Invalid JSON in request attribute\")\n }\n }\n\n this._render()\n }\n\n disconnectedCallback() {\n this._root?.unmount()\n this._root = null\n }\n\n attributeChangedCallback(name: string, _oldValue: string, newValue: string) {\n if (name === \"request\" && newValue) {\n try {\n this._request = JSON.parse(newValue)\n this._render()\n } catch {\n console.error(\"[GirthManagerWidget] Invalid JSON in request attribute\")\n }\n }\n }\n\n private _handleComplete = (response: WidgetResponse) => {\n this.dispatchEvent(\n new CustomEvent(\"widgetComplete\", {\n detail: response,\n bubbles: true,\n composed: true,\n })\n )\n }\n\n private _render() {\n if (!this._root || !this._request) return\n\n this._root.render(\n createElement(GirthManagerWidget, {\n request: this._request,\n onComplete: this._handleComplete,\n wasmModule: this._wasmModule,\n })\n )\n }\n}\n\n// Register the custom element\nif (!customElements.get(\"girth-manager-widget\")) {\n customElements.define(\"girth-manager-widget\", GirthManagerWidgetElement)\n}\n\nexport { GirthManagerWidgetElement }\nexport type { WidgetRequest, WidgetResponse }\n"],"names":["GirthManagerWidgetElement","response","value","shadow","container","createRoot","attrValue","name","_oldValue","newValue","createElement","GirthManagerWidget"],"mappings":";;;AAoBA,MAAMA,UAAkC,YAAY;AAAA,EAApD,cAAA;AAAA,UAAA,GAAA,SAAA,GACI,KAAQ,QAAqB,MAC7B,KAAQ,WAAiC,MAEzC,KAAQ,cAAmB,QAuE3B,KAAQ,kBAAkB,CAACC,MAA6B;AACpD,WAAK;AAAA,QACD,IAAI,YAAY,kBAAkB;AAAA,UAC9B,QAAQA;AAAA,UACR,SAAS;AAAA,UACT,UAAU;AAAA,QAAA,CACb;AAAA,MAAA;AAAA,IAET;AAAA,EAAA;AAAA,EA7EA,WAAW,qBAAqB;AAC5B,WAAO,CAAC,SAAS;AAAA,EACrB;AAAA,EAEA,IAAI,UAAgC;AAChC,WAAO,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SAAS,KAAK;AAAA,QACd,YAAY,KAAK;AAAA,QACjB,YAAY,KAAK;AAAA,MAAA,CACpB;AAAA,IAAA;AAAA,EAET;AACJ;AAGK,eAAe,IAAI,sBAAsB,KAC1C,eAAe,OAAO,wBAAwBX,CAAyB;"}
|
package/package.json
CHANGED
|
@@ -1,40 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solid-labs/fab-one-widget",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/girth-manager-web-widget/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"types": "./dist/girth-manager-web-widget/src/index.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"./web-component": {
|
|
13
|
+
"import": "./dist/web-component.js",
|
|
14
|
+
"types": "./dist/girth-manager-web-widget/src/web-component.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
9
17
|
"files": [
|
|
10
18
|
"dist"
|
|
11
19
|
],
|
|
12
20
|
"scripts": {
|
|
13
|
-
"
|
|
14
|
-
"
|
|
21
|
+
"dev": "vite",
|
|
22
|
+
"build": "vite build && tsc --emitDeclarationOnly",
|
|
23
|
+
"preview": "vite preview",
|
|
24
|
+
"typecheck": "tsc --noEmit"
|
|
15
25
|
},
|
|
16
26
|
"dependencies": {
|
|
17
|
-
"@
|
|
18
|
-
"@react-three/drei": "^10.7.6",
|
|
19
|
-
"@react-three/fiber": "^9.3.0",
|
|
20
|
-
"protosthetics-geo": "file:../wasm/protosthetics-geo/pkg",
|
|
21
|
-
"react": "^19.2.0",
|
|
22
|
-
"react-dom": "^19.2.0",
|
|
23
|
-
"three": "^0.180.0",
|
|
24
|
-
"three-mesh-bvh": "^0.9.1",
|
|
25
|
-
"zustand": "^5.0.8"
|
|
27
|
+
"@galileo/girth-manager-ui": "file:../girth-manager-ui"
|
|
26
28
|
},
|
|
27
29
|
"devDependencies": {
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@types/
|
|
31
|
-
"@
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
30
|
+
"@react-three/drei": "^10.0.3",
|
|
31
|
+
"@react-three/fiber": "^9.1.2",
|
|
32
|
+
"@types/react": "^19.0.10",
|
|
33
|
+
"@types/react-dom": "^19.0.4",
|
|
34
|
+
"@types/three": "^0.172.0",
|
|
35
|
+
"@vitejs/plugin-react": "^5.1.4",
|
|
36
|
+
"react": "^19.0.0",
|
|
37
|
+
"react-dom": "^19.0.0",
|
|
38
|
+
"three": "^0.172.0",
|
|
39
|
+
"three-mesh-bvh": "^0.8.3",
|
|
40
|
+
"zustand": "^5.0.3",
|
|
41
|
+
"typescript": "~5.7.0",
|
|
42
|
+
"vite": "^6.1.0",
|
|
43
|
+
"vite-plugin-wasm": "^3.4.1",
|
|
44
|
+
"vite-plugin-top-level-await": "^1.5.0"
|
|
36
45
|
},
|
|
37
|
-
"
|
|
38
|
-
"
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": ">=18",
|
|
48
|
+
"react-dom": ">=18"
|
|
39
49
|
}
|
|
40
50
|
}
|
package/dist/FabOneWidget.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FabOneWidget — Self-contained 3D prosthetic measurement widget.
|
|
3
|
-
*
|
|
4
|
-
* Synced with FabOneViewer2. Accepts `objUrl` and `amputationType` props.
|
|
5
|
-
* Fetches OBJ, processes with WASM, renders 3D canvas with landmark selection
|
|
6
|
-
* and circumference measurement. Dispatches `measurements` CustomEvent when
|
|
7
|
-
* data changes.
|
|
8
|
-
*/
|
|
9
|
-
export interface MeasurementData {
|
|
10
|
-
yPosition: number;
|
|
11
|
-
originalValue: number;
|
|
12
|
-
modifiedValue: number | null;
|
|
13
|
-
}
|
|
14
|
-
export interface FabOneWidgetProps {
|
|
15
|
-
objUrl?: string;
|
|
16
|
-
spacingType?: "AK" | "BK";
|
|
17
|
-
}
|
|
18
|
-
declare const FabOneWidget: ({ objUrl, spacingType }: FabOneWidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export default FabOneWidget;
|