@imfusion/web-ui 0.5.1-dev.52.gcaa229a7 → 0.5.1-dev.56.gcf89961f
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/README.md +16 -9
- package/dist/{chunk-DA_OvQe2.js → chunk-DmhlhrBa.js} +2 -2
- package/dist/code-Blo48PGr.js +136 -0
- package/dist/{icons-BhogvWBV.js → icons-wBmF0U2x.js} +4 -3
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1377 -12400
- package/dist/integrations/code-highlight.js +9 -9
- package/dist/integrations/image-display-options.js +68 -67
- package/dist/meta-CySnRuVp.js +21 -0
- package/dist/style.css +1 -1
- package/dist/tabs-CMKvMF4E.js +369 -0
- package/package.json +4 -2
- package/dist/code-BRy_lg-h.js +0 -135
- package/dist/meta-BwCupYyq.js +0 -64
- package/dist/tabs-CYqtw1q9.js +0 -3790
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../meta-
|
|
3
|
-
import { i as n, n as r, r as i } from "../code-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { t as e } from "../chunk-DmhlhrBa.js";
|
|
2
|
+
import { t } from "../meta-CySnRuVp.js";
|
|
3
|
+
import { i as n, n as r, r as i } from "../code-Blo48PGr.js";
|
|
4
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
5
|
+
import { cloneElement as o, useMemo as s } from "react";
|
|
6
6
|
import { createHighlighter as c, defineLanguage as l, renderNodesToHtml as u, renderTokens as d } from "@tanstack/highlight/core";
|
|
7
7
|
import { css as f } from "@tanstack/highlight/languages/css";
|
|
8
8
|
import { json as p } from "@tanstack/highlight/languages/json";
|
|
@@ -194,13 +194,13 @@ var P = /* @__PURE__ */ e({
|
|
|
194
194
|
InlineLink: () => n
|
|
195
195
|
});
|
|
196
196
|
function F(e, t) {
|
|
197
|
-
return
|
|
198
|
-
if (!(t == null || e === "")) return /* @__PURE__ */
|
|
197
|
+
return s(() => {
|
|
198
|
+
if (!(t == null || e === "")) return /* @__PURE__ */ a("span", { dangerouslySetInnerHTML: { __html: N(e, t) } });
|
|
199
199
|
}, [e, t]);
|
|
200
200
|
}
|
|
201
201
|
function I({ language: e, children: t, ...n }) {
|
|
202
202
|
let i = F(t, e);
|
|
203
|
-
return
|
|
203
|
+
return o(/* @__PURE__ */ a(r, {
|
|
204
204
|
...n,
|
|
205
205
|
language: e,
|
|
206
206
|
children: t
|
|
@@ -209,7 +209,7 @@ function I({ language: e, children: t, ...n }) {
|
|
|
209
209
|
I.displayName = "Code.Block";
|
|
210
210
|
function L({ language: e, children: t, ...n }) {
|
|
211
211
|
let r = F(t, e);
|
|
212
|
-
return
|
|
212
|
+
return o(/* @__PURE__ */ a(i, {
|
|
213
213
|
...n,
|
|
214
214
|
children: t
|
|
215
215
|
}), { children: r ?? t });
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import {
|
|
4
|
-
import { Fragment as
|
|
1
|
+
import { t as e } from "../meta-CySnRuVp.js";
|
|
2
|
+
import { _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, n as d, o as f, p, r as m, t as h, u as g, v as _, x as v, y } from "../tabs-CMKvMF4E.js";
|
|
3
|
+
import { cva as b } from "class-variance-authority";
|
|
4
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
5
|
+
import { useId as w, useMemo as T, useState as E } from "react";
|
|
5
6
|
import { useDisplayOptions2d as D, useDisplayOptions3d as O } from "@imfusion/sdk-react";
|
|
6
7
|
var k = {
|
|
7
8
|
compactStrip: "imf-ui-image-display-options-module-compactStrip",
|
|
@@ -71,50 +72,50 @@ function F(e, t) {
|
|
|
71
72
|
}
|
|
72
73
|
//#endregion
|
|
73
74
|
//#region src/integrations/image-display-options/image-display-options-view.tsx
|
|
74
|
-
var I =
|
|
75
|
-
function L({ spec:
|
|
76
|
-
let
|
|
77
|
-
value:
|
|
78
|
-
min:
|
|
79
|
-
max:
|
|
80
|
-
step:
|
|
81
|
-
format:
|
|
75
|
+
var I = b(k.root);
|
|
76
|
+
function L({ spec: e, value: n, row: i, onChange: a }) {
|
|
77
|
+
let o = /* @__PURE__ */ C(_, {
|
|
78
|
+
value: n,
|
|
79
|
+
min: e.min,
|
|
80
|
+
max: e.max,
|
|
81
|
+
step: e.step,
|
|
82
|
+
format: e.format,
|
|
82
83
|
onValueChange: (e) => {
|
|
83
|
-
|
|
84
|
+
a(typeof e == "number" ? e : e[0]);
|
|
84
85
|
},
|
|
85
|
-
children: [/* @__PURE__ */
|
|
86
|
+
children: [/* @__PURE__ */ C(u, {
|
|
86
87
|
justify: "between",
|
|
87
|
-
children: [/* @__PURE__ */
|
|
88
|
-
}), /* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ S(t, { children: e.label }), /* @__PURE__ */ S(v, {})]
|
|
89
|
+
}), /* @__PURE__ */ S(c, { children: /* @__PURE__ */ C(r, { children: [/* @__PURE__ */ S(s, {}), /* @__PURE__ */ S(y, { "aria-label": e.label })] }) })]
|
|
89
90
|
});
|
|
90
|
-
return
|
|
91
|
+
return i ? /* @__PURE__ */ S("div", {
|
|
91
92
|
className: k.rowField,
|
|
92
|
-
children:
|
|
93
|
-
}) :
|
|
93
|
+
children: o
|
|
94
|
+
}) : o;
|
|
94
95
|
}
|
|
95
96
|
function R({ checked: e, row: t, onChange: n }) {
|
|
96
|
-
let r =
|
|
97
|
-
return /* @__PURE__ */
|
|
97
|
+
let r = w();
|
|
98
|
+
return /* @__PURE__ */ C(u, {
|
|
98
99
|
align: "center",
|
|
99
100
|
justify: t ? "start" : "between",
|
|
100
101
|
gap: "2",
|
|
101
102
|
className: k.invertRow,
|
|
102
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ S("span", {
|
|
103
104
|
id: r,
|
|
104
105
|
className: k.invertLabel,
|
|
105
106
|
children: "Invert"
|
|
106
|
-
}), /* @__PURE__ */
|
|
107
|
+
}), /* @__PURE__ */ S(o, {
|
|
107
108
|
"aria-labelledby": r,
|
|
108
109
|
checked: e,
|
|
109
110
|
onCheckedChange: (e) => {
|
|
110
111
|
n(e);
|
|
111
112
|
},
|
|
112
|
-
children: /* @__PURE__ */
|
|
113
|
+
children: /* @__PURE__ */ S(p, {})
|
|
113
114
|
})]
|
|
114
115
|
});
|
|
115
116
|
}
|
|
116
117
|
function z({ active: e, onChange: t }) {
|
|
117
|
-
return /* @__PURE__ */
|
|
118
|
+
return /* @__PURE__ */ C(g, {
|
|
118
119
|
className: k.segment,
|
|
119
120
|
"aria-label": "Display dimension",
|
|
120
121
|
value: [e],
|
|
@@ -122,10 +123,10 @@ function z({ active: e, onChange: t }) {
|
|
|
122
123
|
let n = e[0];
|
|
123
124
|
(n === "2d" || n === "3d") && t(n);
|
|
124
125
|
},
|
|
125
|
-
children: [/* @__PURE__ */
|
|
126
|
+
children: [/* @__PURE__ */ S(a, {
|
|
126
127
|
value: "2d",
|
|
127
128
|
children: "2D"
|
|
128
|
-
}), /* @__PURE__ */
|
|
129
|
+
}), /* @__PURE__ */ S(a, {
|
|
129
130
|
value: "3d",
|
|
130
131
|
children: "3D"
|
|
131
132
|
})]
|
|
@@ -133,14 +134,14 @@ function z({ active: e, onChange: t }) {
|
|
|
133
134
|
}
|
|
134
135
|
function B({ dimension: e, fields: t, options: n, row: r, onChange: i }) {
|
|
135
136
|
let a = n[e];
|
|
136
|
-
return /* @__PURE__ */
|
|
137
|
+
return /* @__PURE__ */ C(x, { children: [t.map((t) => /* @__PURE__ */ S(L, {
|
|
137
138
|
spec: t,
|
|
138
139
|
value: F(a, t.key),
|
|
139
140
|
row: r,
|
|
140
141
|
onChange: (n) => {
|
|
141
142
|
i(e, P(t.key, n));
|
|
142
143
|
}
|
|
143
|
-
}, t.key)), /* @__PURE__ */
|
|
144
|
+
}, t.key)), /* @__PURE__ */ S(R, {
|
|
144
145
|
checked: a.invert,
|
|
145
146
|
row: r,
|
|
146
147
|
onChange: (t) => {
|
|
@@ -148,32 +149,32 @@ function B({ dimension: e, fields: t, options: n, row: r, onChange: i }) {
|
|
|
148
149
|
}
|
|
149
150
|
})] });
|
|
150
151
|
}
|
|
151
|
-
function V({ variant: e = "default", options: t, intensityRange: r, ranges: a, onOptionsChange: o, className: s, ...
|
|
152
|
-
let [
|
|
152
|
+
function V({ variant: e = "default", options: t, intensityRange: r, ranges: a, onOptionsChange: o, className: s, ...c }) {
|
|
153
|
+
let [p, g] = E("2d"), _ = N(r, a), v = (e) => {
|
|
153
154
|
g(e === "3d" ? "3d" : "2d");
|
|
154
155
|
};
|
|
155
|
-
return /* @__PURE__ */
|
|
156
|
-
...
|
|
156
|
+
return /* @__PURE__ */ S("div", {
|
|
157
|
+
...c,
|
|
157
158
|
"data-imf-ui-component": "ImageDisplayOptions",
|
|
158
159
|
className: I({ className: s }),
|
|
159
|
-
children: e === "default" ? /* @__PURE__ */
|
|
160
|
-
value:
|
|
160
|
+
children: e === "default" ? /* @__PURE__ */ C(n, {
|
|
161
|
+
value: p,
|
|
161
162
|
onValueChange: v,
|
|
162
|
-
children: [/* @__PURE__ */
|
|
163
|
-
/* @__PURE__ */
|
|
163
|
+
children: [/* @__PURE__ */ C(d, { children: [
|
|
164
|
+
/* @__PURE__ */ S(f, {
|
|
164
165
|
value: "2d",
|
|
165
166
|
children: "2D Slices"
|
|
166
167
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ S(f, {
|
|
168
169
|
value: "3d",
|
|
169
170
|
children: "3D Volume"
|
|
170
171
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
] }), /* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ S(h, {})
|
|
173
|
+
] }), /* @__PURE__ */ C(l, { children: [/* @__PURE__ */ S(m, {
|
|
173
174
|
value: "2d",
|
|
174
|
-
children: /* @__PURE__ */
|
|
175
|
+
children: /* @__PURE__ */ S(i, {
|
|
175
176
|
gap: "3",
|
|
176
|
-
children: /* @__PURE__ */
|
|
177
|
+
children: /* @__PURE__ */ S(B, {
|
|
177
178
|
dimension: "2d",
|
|
178
179
|
fields: _["2d"],
|
|
179
180
|
options: t,
|
|
@@ -181,11 +182,11 @@ function V({ variant: e = "default", options: t, intensityRange: r, ranges: a, o
|
|
|
181
182
|
onChange: o
|
|
182
183
|
})
|
|
183
184
|
})
|
|
184
|
-
}), /* @__PURE__ */
|
|
185
|
+
}), /* @__PURE__ */ S(m, {
|
|
185
186
|
value: "3d",
|
|
186
|
-
children: /* @__PURE__ */
|
|
187
|
+
children: /* @__PURE__ */ S(i, {
|
|
187
188
|
gap: "3",
|
|
188
|
-
children: /* @__PURE__ */
|
|
189
|
+
children: /* @__PURE__ */ S(B, {
|
|
189
190
|
dimension: "3d",
|
|
190
191
|
fields: _["3d"],
|
|
191
192
|
options: t,
|
|
@@ -194,33 +195,33 @@ function V({ variant: e = "default", options: t, intensityRange: r, ranges: a, o
|
|
|
194
195
|
})
|
|
195
196
|
})
|
|
196
197
|
})] })]
|
|
197
|
-
}) : e === "horizontal" ? /* @__PURE__ */
|
|
198
|
+
}) : e === "horizontal" ? /* @__PURE__ */ C(n, {
|
|
198
199
|
className: k.horizontalTabs,
|
|
199
200
|
orientation: "vertical",
|
|
200
|
-
value:
|
|
201
|
+
value: p,
|
|
201
202
|
onValueChange: v,
|
|
202
|
-
children: [/* @__PURE__ */
|
|
203
|
+
children: [/* @__PURE__ */ C(d, {
|
|
203
204
|
fill: !0,
|
|
204
205
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ S(f, {
|
|
206
207
|
value: "2d",
|
|
207
208
|
children: "2D"
|
|
208
209
|
}),
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ S(f, {
|
|
210
211
|
value: "3d",
|
|
211
212
|
children: "3D"
|
|
212
213
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ S(h, {})
|
|
214
215
|
]
|
|
215
|
-
}), /* @__PURE__ */
|
|
216
|
+
}), /* @__PURE__ */ C(l, {
|
|
216
217
|
className: k.horizontalPanel,
|
|
217
|
-
children: [/* @__PURE__ */
|
|
218
|
+
children: [/* @__PURE__ */ S(m, {
|
|
218
219
|
value: "2d",
|
|
219
|
-
children: /* @__PURE__ */
|
|
220
|
+
children: /* @__PURE__ */ S(u, {
|
|
220
221
|
align: "center",
|
|
221
222
|
gap: "3",
|
|
222
223
|
className: k.strip,
|
|
223
|
-
children: /* @__PURE__ */
|
|
224
|
+
children: /* @__PURE__ */ S(B, {
|
|
224
225
|
dimension: "2d",
|
|
225
226
|
fields: _["2d"],
|
|
226
227
|
options: t,
|
|
@@ -228,13 +229,13 @@ function V({ variant: e = "default", options: t, intensityRange: r, ranges: a, o
|
|
|
228
229
|
onChange: o
|
|
229
230
|
})
|
|
230
231
|
})
|
|
231
|
-
}), /* @__PURE__ */
|
|
232
|
+
}), /* @__PURE__ */ S(m, {
|
|
232
233
|
value: "3d",
|
|
233
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ S(u, {
|
|
234
235
|
align: "center",
|
|
235
236
|
gap: "3",
|
|
236
237
|
className: k.strip,
|
|
237
|
-
children: /* @__PURE__ */
|
|
238
|
+
children: /* @__PURE__ */ S(B, {
|
|
238
239
|
dimension: "3d",
|
|
239
240
|
fields: _["3d"],
|
|
240
241
|
options: t,
|
|
@@ -244,16 +245,16 @@ function V({ variant: e = "default", options: t, intensityRange: r, ranges: a, o
|
|
|
244
245
|
})
|
|
245
246
|
})]
|
|
246
247
|
})]
|
|
247
|
-
}) : /* @__PURE__ */
|
|
248
|
+
}) : /* @__PURE__ */ C(u, {
|
|
248
249
|
align: "center",
|
|
249
250
|
gap: "3",
|
|
250
251
|
className: k.compactStrip,
|
|
251
|
-
children: [/* @__PURE__ */
|
|
252
|
-
active:
|
|
252
|
+
children: [/* @__PURE__ */ S(z, {
|
|
253
|
+
active: p,
|
|
253
254
|
onChange: g
|
|
254
|
-
}), /* @__PURE__ */
|
|
255
|
-
dimension:
|
|
256
|
-
fields: _[
|
|
255
|
+
}), /* @__PURE__ */ S(B, {
|
|
256
|
+
dimension: p,
|
|
257
|
+
fields: _[p],
|
|
257
258
|
options: t,
|
|
258
259
|
row: !0,
|
|
259
260
|
onChange: o
|
|
@@ -277,8 +278,8 @@ function H({ data: e, variant: t = "default", ranges: n, ...r }) {
|
|
|
277
278
|
level: a.level,
|
|
278
279
|
invert: a.invert
|
|
279
280
|
}
|
|
280
|
-
}, s =
|
|
281
|
-
return /* @__PURE__ */
|
|
281
|
+
}, s = T(() => e.minmaxIntensityOriginal(), [e]);
|
|
282
|
+
return /* @__PURE__ */ S(V, {
|
|
282
283
|
...r,
|
|
283
284
|
variant: t,
|
|
284
285
|
options: o,
|
|
@@ -294,7 +295,7 @@ H.displayName = "ImageDisplayOptions";
|
|
|
294
295
|
//#region src/integrations/image-display-options/image-display-options.meta.ts
|
|
295
296
|
var U = {
|
|
296
297
|
name: "ImageDisplayOptions",
|
|
297
|
-
category:
|
|
298
|
+
category: e.inputs,
|
|
298
299
|
status: "experimental",
|
|
299
300
|
description: "A panel or toolbar of controls bound to an image dataset's display options.",
|
|
300
301
|
origin: "adapted",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/types/meta.ts
|
|
2
|
+
var e = {
|
|
3
|
+
buttons: {
|
|
4
|
+
id: "buttons",
|
|
5
|
+
label: "Buttons"
|
|
6
|
+
},
|
|
7
|
+
inputs: {
|
|
8
|
+
id: "inputs",
|
|
9
|
+
label: "Inputs"
|
|
10
|
+
},
|
|
11
|
+
layout: {
|
|
12
|
+
id: "layout",
|
|
13
|
+
label: "Layout"
|
|
14
|
+
},
|
|
15
|
+
display: {
|
|
16
|
+
id: "display",
|
|
17
|
+
label: "Display"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { e as t };
|