@imfusion/web-ui 0.5.1-dev.56.gcf89961f → 0.5.1-dev.6.ge1cebe1f
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 +31 -68
- package/bin/install-skill.js +180 -0
- package/dist/code-qBbqAHK-.js +190 -0
- package/dist/components/callout/callout.d.ts +1 -1
- package/dist/components/chip-link/chip-link.d.ts +1 -1
- package/dist/components/code/code.d.ts +18 -10
- package/dist/components/input/input.d.ts +1 -3
- package/dist/components/typo/typo.d.ts +2 -2
- package/dist/hooks/index.d.ts +0 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.js +12206 -1789
- package/dist/integrations/code-highlight/code-highlight.d.ts +6 -8
- package/dist/integrations/code-highlight/highlighter.d.ts +3 -32
- package/dist/integrations/code-highlight.js +59 -198
- package/dist/integrations/image-display-options.js +69 -70
- package/dist/meta-B8C51eyL.js +74 -0
- package/dist/provider/web-ui-provider.d.ts +1 -4
- package/dist/style.css +1 -1
- package/dist/tabs-DqBFSqq6.js +3789 -0
- package/package.json +26 -48
- package/src/docgen/doc.gen.json +38 -381
- package/src/llms/llms.gen.txt +0 -17
- package/src/llms/skills/imf-web-ui/SKILL.md +12 -13
- package/src/llms/skills/imf-web-ui-components/SKILL.md +3 -56
- package/src/llms/skills/imf-web-ui-frontend-patterns/SKILL.md +93 -0
- package/src/llms/skills/imf-web-ui-frontend-patterns/references/code-conventions.md +133 -0
- package/src/llms/skills/imf-web-ui-frontend-patterns/references/react-patterns.md +94 -0
- package/src/llms/skills/imf-web-ui-imfusion-frontend-setup/SKILL.md +201 -0
- package/src/llms/skills/imf-web-ui-setup/SKILL.md +37 -67
- package/src/llms/skills/imf-web-ui-ux/SKILL.md +4 -4
- package/src/llms/skills/imf-web-ui-ux/references/forms.md +2 -2
- package/bin/install.js +0 -428
- package/bin/install.test.ts +0 -329
- package/dist/build/vite-css-module-names/index.d.ts +0 -20
- package/dist/build/vite-css-module-names.js +0 -17
- package/dist/chunk-DmhlhrBa.js +0 -11
- package/dist/code-Blo48PGr.js +0 -136
- package/dist/codegen/gen-icons.d.ts +0 -24
- package/dist/components/field/field.d.ts +0 -104
- package/dist/components/field/field.meta.d.ts +0 -2
- package/dist/components/field/index.d.ts +0 -2
- package/dist/components/fieldset/fieldset.d.ts +0 -29
- package/dist/components/fieldset/fieldset.meta.d.ts +0 -2
- package/dist/components/fieldset/index.d.ts +0 -2
- package/dist/components/icon/icon.d.ts +0 -16
- package/dist/components/icon/icon.meta.d.ts +0 -2
- package/dist/components/icon/index.d.ts +0 -4
- package/dist/components/icon/types.d.ts +0 -2
- package/dist/docgen/component-sources.d.ts +0 -7
- package/dist/hooks/use-resize-observer.d.ts +0 -2
- package/dist/icons/catalog.gen.d.ts +0 -8357
- package/dist/icons/icon-config-provider.d.ts +0 -8
- package/dist/icons/icon-context.d.ts +0 -4
- package/dist/icons/icons.gen.d.ts +0 -1672
- package/dist/icons/index.d.ts +0 -3
- package/dist/icons-wBmF0U2x.js +0 -78
- package/dist/icons.js +0 -2
- package/dist/integrations/code-highlight/language-patterns.d.ts +0 -7
- package/dist/integrations/code-highlight/languages/cmake.d.ts +0 -1
- package/dist/integrations/code-highlight/languages/cpp.d.ts +0 -1
- package/dist/integrations/code-highlight/languages/python.d.ts +0 -1
- package/dist/llms/gen-tokens.d.ts +0 -7
- package/dist/meta-CySnRuVp.js +0 -21
- package/dist/tabs-CMKvMF4E.js +0 -369
- package/src/llms/icon-catalog.gen.json +0 -11203
- package/src/llms/install-templates/AGENTS.md +0 -34
- package/src/llms/install-templates/codex-hooks.json +0 -44
- package/src/llms/install-templates/hooks/baseline-staleness.sh +0 -17
- package/src/llms/install-templates/hooks/session-start.sh +0 -5
- package/src/llms/install-templates/hooks/stop.sh +0 -18
- package/src/llms/install-templates/hooks/subagent-start.sh +0 -5
- package/src/llms/install-templates/hooks/user-prompt-submit.sh +0 -5
- package/src/llms/install-templates/settings.json +0 -45
- package/src/llms/skills/imf-web-ui-audit/SKILL.md +0 -119
- package/src/llms/skills/imf-web-ui-conventions/SKILL.md +0 -57
- package/src/llms/skills/imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md +0 -141
- package/src/llms/skills/imf-web-ui-conventions/templates/REPORT.md +0 -45
- package/src/llms/skills/imf-web-ui-conventions/topics/agent-tooling.md +0 -82
- package/src/llms/skills/imf-web-ui-conventions/topics/assets.md +0 -27
- package/src/llms/skills/imf-web-ui-conventions/topics/authentication.md +0 -65
- package/src/llms/skills/imf-web-ui-conventions/topics/class-names.md +0 -50
- package/src/llms/skills/imf-web-ui-conventions/topics/components.md +0 -101
- package/src/llms/skills/imf-web-ui-conventions/topics/data.md +0 -221
- package/src/llms/skills/imf-web-ui-conventions/topics/docs-structure.md +0 -40
- package/src/llms/skills/imf-web-ui-conventions/topics/git.md +0 -34
- package/src/llms/skills/imf-web-ui-conventions/topics/library-boundary.md +0 -35
- package/src/llms/skills/imf-web-ui-conventions/topics/library-setup.md +0 -26
- package/src/llms/skills/imf-web-ui-conventions/topics/npm-project.md +0 -53
- package/src/llms/skills/imf-web-ui-conventions/topics/project-structure.md +0 -44
- package/src/llms/skills/imf-web-ui-conventions/topics/react.md +0 -109
- package/src/llms/skills/imf-web-ui-conventions/topics/styling.md +0 -88
- package/src/llms/skills/imf-web-ui-conventions/topics/testing.md +0 -25
- package/src/llms/skills/imf-web-ui-conventions/topics/tokens.md +0 -7
- package/src/llms/skills/imf-web-ui-conventions/topics/tooling.md +0 -116
- package/src/llms/skills/imf-web-ui-conventions/topics/typescript.md +0 -73
- package/src/llms/skills/imf-web-ui-conventions/topics/validation.md +0 -62
- package/src/llms/skills/imf-web-ui-update/SKILL.md +0 -157
- package/src/llms/tokens.gen.json +0 -887
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { Code } from '../../components/code';
|
|
2
2
|
import { SupportedLanguage } from './highlighter';
|
|
3
|
-
type BlockProps = Omit<React.ComponentProps<typeof Code.Block>, "
|
|
3
|
+
type BlockProps = Omit<React.ComponentProps<typeof Code.Block>, "highlighted" | "language"> & {
|
|
4
4
|
/** Language of `children`: grammar for tokenization and label for the corner notch. Omit to hide the notch and skip highlighting. */
|
|
5
|
-
children: string;
|
|
6
5
|
language?: SupportedLanguage;
|
|
7
6
|
};
|
|
8
|
-
/** Code.Block — the core `Code.Block` with TanStack Highlight tokens
|
|
9
|
-
export declare function Block({ language, children, ...props }: BlockProps): import(
|
|
7
|
+
/** Code.Block — the core `Code.Block` with TanStack Highlight tokens filling its `highlighted` slot. */
|
|
8
|
+
export declare function Block({ language, children, ...props }: BlockProps): import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export declare namespace Block {
|
|
11
10
|
var displayName: string;
|
|
12
11
|
}
|
|
13
|
-
type InlineProps = Omit<React.ComponentProps<typeof Code.Inline>, "
|
|
12
|
+
type InlineProps = Omit<React.ComponentProps<typeof Code.Inline>, "highlighted"> & {
|
|
14
13
|
/** Grammar used to tokenize the fragment. Purely visual — the chip shows no language label. Omit for plain text. */
|
|
15
|
-
children: string;
|
|
16
14
|
language?: SupportedLanguage;
|
|
17
15
|
};
|
|
18
|
-
/** Code.Inline — the core `Code.Inline` with TanStack Highlight tokens
|
|
19
|
-
export declare function Inline({ language, children, ...props }: InlineProps): import(
|
|
16
|
+
/** Code.Inline — the core `Code.Inline` with TanStack Highlight tokens filling its `highlighted` slot. */
|
|
17
|
+
export declare function Inline({ language, children, ...props }: InlineProps): import("react/jsx-runtime").JSX.Element;
|
|
20
18
|
export declare namespace Inline {
|
|
21
19
|
var displayName: string;
|
|
22
20
|
}
|
|
@@ -1,35 +1,6 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
readonly ts: {
|
|
6
|
-
readonly aliases: readonly ["typescript"];
|
|
7
|
-
};
|
|
8
|
-
readonly css: {
|
|
9
|
-
readonly aliases: readonly ["scss"];
|
|
10
|
-
};
|
|
11
|
-
readonly shell: {
|
|
12
|
-
readonly aliases: readonly ["bash", "sh", "zsh", "shellscript"];
|
|
13
|
-
};
|
|
14
|
-
readonly json: {
|
|
15
|
-
readonly aliases: readonly [];
|
|
16
|
-
};
|
|
17
|
-
readonly cpp: {
|
|
18
|
-
readonly aliases: readonly ["c++", "cc", "cxx", "hpp"];
|
|
19
|
-
};
|
|
20
|
-
readonly python: {
|
|
21
|
-
readonly aliases: readonly ["py"];
|
|
22
|
-
};
|
|
23
|
-
readonly cmake: {
|
|
24
|
-
readonly aliases: readonly [];
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export declare const SUPPORTED_LANGUAGES: string[];
|
|
28
|
-
type CanonicalLanguage = keyof typeof LANGUAGE_DEFINITIONS;
|
|
29
|
-
type LanguageAlias = {
|
|
30
|
-
[Language in CanonicalLanguage]: (typeof LANGUAGE_DEFINITIONS)[Language]["aliases"][number];
|
|
31
|
-
}[CanonicalLanguage];
|
|
32
|
-
export type SupportedLanguage = CanonicalLanguage | LanguageAlias;
|
|
1
|
+
export declare const SUPPORTED_LANGUAGES: readonly ["tsx", "ts", "css", "shell", "json"];
|
|
2
|
+
declare const LANGUAGE_ALIASES: readonly ["typescript", "bash", "sh", "zsh", "shellscript", "scss"];
|
|
3
|
+
export type SupportedLanguage = (typeof SUPPORTED_LANGUAGES)[number] | (typeof LANGUAGE_ALIASES)[number];
|
|
33
4
|
export declare function isSupportedLanguage(value: string): value is SupportedLanguage;
|
|
34
5
|
export declare function highlightToHtml(code: string, language: SupportedLanguage): string;
|
|
35
6
|
export {};
|
|
@@ -1,223 +1,84 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { jsx as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
for (let t = s; t < c; t += 1) if (i[t]) {
|
|
30
|
-
e = !0;
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
e || (r.push({
|
|
34
|
-
start: s,
|
|
35
|
-
end: c,
|
|
36
|
-
className: n.className
|
|
37
|
-
}), i.fill(1, s, c));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return r;
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region src/integrations/code-highlight/languages/cmake.ts
|
|
45
|
-
var b = [
|
|
46
|
-
{
|
|
47
|
-
className: "string",
|
|
48
|
-
regex: /"(?:\\.|[^"\\\n])*"|\[(=*)\[[\s\S]*?\]\1\]/g
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
className: "comment",
|
|
52
|
-
regex: /#[^\n]*/g
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
className: "variable",
|
|
56
|
-
regex: /\$(?:ENV|CACHE)?\{[^}\n]+\}/g
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
className: "keyword",
|
|
60
|
-
regex: /\b(?:break|continue|else|elseif|endforeach|endfunction|endif|endmacro|endwhile|if|include|macro|return|while)\b/gi
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
className: "literal",
|
|
64
|
-
regex: /\b(?:FALSE|IGNORE|NOTFOUND|NO|OFF|ON|TRUE|YES)\b/gi
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
className: "function",
|
|
68
|
-
regex: /\b[A-Za-z_][\w-]*(?=\s*\()/g
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
className: "number",
|
|
72
|
-
regex: /\b\d+(?:\.\d+)?\b/g
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
className: "operator",
|
|
76
|
-
regex: /(?:LESS_EQUAL|GREATER_EQUAL|STREQUAL|IN_LIST|MATCHES|EQUAL|LESS|GREATER|AND|OR|NOT|[=<>+*/!-])/gi
|
|
77
|
-
}
|
|
78
|
-
], x = l({
|
|
79
|
-
name: "cmake",
|
|
80
|
-
tokenize(e) {
|
|
81
|
-
return y(e, b);
|
|
82
|
-
}
|
|
83
|
-
}), S = [
|
|
84
|
-
{
|
|
85
|
-
className: "comment",
|
|
86
|
-
regex: /\/\/[^\n]*|\/\*[\s\S]*?\*\//g
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
className: "string",
|
|
90
|
-
regex: /"(?:\\.|[^"\\\n])*"|'(?:\\.|[^'\\\n])*'/g
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
className: "meta",
|
|
94
|
-
regex: /^[ \t]*#[ \t]*(?:include|define|if|ifdef|ifndef|elif|else|endif|pragma|undef|error|warning)\b/gm
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
className: "keyword",
|
|
98
|
-
regex: /\b(?:alignas|alignof|and|asm|atomic_cancel|atomic_commit|atomic_noexcept|auto|bitand|bitor|break|case|catch|co_await|co_return|co_yield|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|default|delete|do|dynamic_cast|else|enum|explicit|export|extern|for|friend|goto|if|inline|mutable|namespace|new|noexcept|not|operator|or|private|protected|public|reflexpr|register|reinterpret_cast|requires|return|sizeof|static|static_assert|static_cast|struct|switch|synchronized|template|this|thread_local|throw|try|typedef|typeid|typename|union|using|virtual|volatile|while|xor)\b/g
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
className: "type",
|
|
102
|
-
regex: /\b(?:bool|char|char8_t|char16_t|char32_t|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
className: "literal",
|
|
106
|
-
regex: /\b(?:NULL|nullptr|true|false)\b/g
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
className: "function",
|
|
110
|
-
regex: /\b[A-Za-z_]\w*(?=\s*\()/g
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
className: "number",
|
|
114
|
-
regex: /\b(?:0[xX][\da-fA-F']+|0[bB][01']+|\d[\d']*(?:\.\d[\d']*)?(?:[eE][+-]?\d[\d']*)?[uUlLfF]*)\b/g
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
className: "operator",
|
|
118
|
-
regex: /(?:<<=?|>>=?|->\*|->|\+\+|--|&&|\|\||==|!=|<=|>=|::|\+=|-=|\*=|\/=|%=|&=|\|=|\^=|[-+*/%=&|^!<>?:~])/g
|
|
119
|
-
}
|
|
120
|
-
], C = l({
|
|
121
|
-
name: "cpp",
|
|
122
|
-
aliases: [
|
|
123
|
-
"c++",
|
|
124
|
-
"cc",
|
|
125
|
-
"cxx",
|
|
126
|
-
"hpp"
|
|
127
|
-
],
|
|
128
|
-
tokenize(e) {
|
|
129
|
-
return y(e, S);
|
|
130
|
-
}
|
|
131
|
-
}), w = [{
|
|
132
|
-
className: "function",
|
|
133
|
-
regex: /\b[A-Za-z_]\w*(?=\s*\()/g
|
|
134
|
-
}], T = l({
|
|
135
|
-
name: "python",
|
|
136
|
-
aliases: ["py"],
|
|
137
|
-
tokenize(e, t) {
|
|
138
|
-
let n = v.tokenize(e, t), r = y(e, w, n);
|
|
139
|
-
return [...n, ...r];
|
|
140
|
-
}
|
|
141
|
-
}), E = {
|
|
142
|
-
tsx: { aliases: ["typescriptreact"] },
|
|
143
|
-
ts: { aliases: ["typescript"] },
|
|
144
|
-
css: { aliases: ["scss"] },
|
|
145
|
-
shell: { aliases: [
|
|
146
|
-
"bash",
|
|
147
|
-
"sh",
|
|
148
|
-
"zsh",
|
|
149
|
-
"shellscript"
|
|
150
|
-
] },
|
|
151
|
-
json: { aliases: [] },
|
|
152
|
-
cpp: { aliases: [
|
|
153
|
-
"c++",
|
|
154
|
-
"cc",
|
|
155
|
-
"cxx",
|
|
156
|
-
"hpp"
|
|
157
|
-
] },
|
|
158
|
-
python: { aliases: ["py"] },
|
|
159
|
-
cmake: { aliases: [] }
|
|
160
|
-
}, D = Object.keys(E), O = [...D, ...Object.values(E).flatMap(({ aliases: e }) => e)];
|
|
161
|
-
function k(e) {
|
|
162
|
-
return O.includes(e);
|
|
163
|
-
}
|
|
164
|
-
function A(e, t) {
|
|
165
|
-
return e.aliases.includes(t);
|
|
166
|
-
}
|
|
167
|
-
function j(e) {
|
|
168
|
-
for (let [t, n] of Object.entries(E)) if (A(n, e)) return t;
|
|
169
|
-
return e;
|
|
1
|
+
import { a as e, t } from "../meta-B8C51eyL.js";
|
|
2
|
+
import { i as n, n as r, r as i } from "../code-qBbqAHK-.js";
|
|
3
|
+
import { useMemo as a } from "react";
|
|
4
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
5
|
+
import { createHighlighter as s, renderNodesToHtml as c, renderTokens as l } from "@tanstack/highlight/core";
|
|
6
|
+
import { css as u } from "@tanstack/highlight/languages/css";
|
|
7
|
+
import { json as d } from "@tanstack/highlight/languages/json";
|
|
8
|
+
import { plaintext as f } from "@tanstack/highlight/languages/plaintext";
|
|
9
|
+
import { shell as p } from "@tanstack/highlight/languages/shell";
|
|
10
|
+
import { ts as m } from "@tanstack/highlight/languages/ts";
|
|
11
|
+
import { tsx as h } from "@tanstack/highlight/languages/tsx";
|
|
12
|
+
//#region src/integrations/code-highlight/highlighter.ts
|
|
13
|
+
var g = [
|
|
14
|
+
"tsx",
|
|
15
|
+
"ts",
|
|
16
|
+
"css",
|
|
17
|
+
"shell",
|
|
18
|
+
"json"
|
|
19
|
+
], _ = [
|
|
20
|
+
"typescript",
|
|
21
|
+
"bash",
|
|
22
|
+
"sh",
|
|
23
|
+
"zsh",
|
|
24
|
+
"shellscript",
|
|
25
|
+
"scss"
|
|
26
|
+
], v = [...g, ..._];
|
|
27
|
+
function y(e) {
|
|
28
|
+
return v.includes(e);
|
|
170
29
|
}
|
|
171
|
-
var
|
|
30
|
+
var b = {
|
|
31
|
+
shellscript: "shell",
|
|
32
|
+
scss: "css"
|
|
33
|
+
}, x = s({
|
|
172
34
|
languages: [
|
|
173
|
-
_,
|
|
174
|
-
g,
|
|
175
|
-
f,
|
|
176
35
|
h,
|
|
36
|
+
m,
|
|
37
|
+
u,
|
|
177
38
|
p,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
x,
|
|
181
|
-
m
|
|
39
|
+
d,
|
|
40
|
+
f
|
|
182
41
|
],
|
|
183
42
|
fallbackLanguage: "plaintext"
|
|
184
43
|
});
|
|
185
|
-
function
|
|
186
|
-
let n =
|
|
187
|
-
return
|
|
44
|
+
function S(e, t) {
|
|
45
|
+
let n = b[t] ?? t, { tokens: r } = x.tokenize(e, { lang: n });
|
|
46
|
+
return c(l(r));
|
|
188
47
|
}
|
|
189
48
|
//#endregion
|
|
190
49
|
//#region src/integrations/code-highlight/code-highlight.tsx
|
|
191
|
-
var
|
|
192
|
-
Block: () =>
|
|
193
|
-
Inline: () =>
|
|
50
|
+
var C = /* @__PURE__ */ e({
|
|
51
|
+
Block: () => T,
|
|
52
|
+
Inline: () => E,
|
|
194
53
|
InlineLink: () => n
|
|
195
54
|
});
|
|
196
|
-
function
|
|
197
|
-
return
|
|
198
|
-
if (!(t == null || e === "")) return /* @__PURE__ */
|
|
55
|
+
function w(e, t) {
|
|
56
|
+
return a(() => {
|
|
57
|
+
if (!(t == null || e === "")) return /* @__PURE__ */ o("span", { dangerouslySetInnerHTML: { __html: S(e, t) } });
|
|
199
58
|
}, [e, t]);
|
|
200
59
|
}
|
|
201
|
-
function
|
|
202
|
-
let i =
|
|
203
|
-
return
|
|
60
|
+
function T({ language: e, children: t, ...n }) {
|
|
61
|
+
let i = w(t, e);
|
|
62
|
+
return /* @__PURE__ */ o(r, {
|
|
204
63
|
...n,
|
|
205
64
|
language: e,
|
|
65
|
+
highlighted: i,
|
|
206
66
|
children: t
|
|
207
|
-
})
|
|
67
|
+
});
|
|
208
68
|
}
|
|
209
|
-
|
|
210
|
-
function
|
|
211
|
-
let r =
|
|
212
|
-
return
|
|
69
|
+
T.displayName = "Code.Block";
|
|
70
|
+
function E({ language: e, children: t, ...n }) {
|
|
71
|
+
let r = w(t, e);
|
|
72
|
+
return /* @__PURE__ */ o(i, {
|
|
213
73
|
...n,
|
|
74
|
+
highlighted: r,
|
|
214
75
|
children: t
|
|
215
|
-
})
|
|
76
|
+
});
|
|
216
77
|
}
|
|
217
|
-
|
|
78
|
+
E.displayName = "Code.Inline";
|
|
218
79
|
//#endregion
|
|
219
80
|
//#region src/integrations/code-highlight/code-highlight.meta.ts
|
|
220
|
-
var
|
|
81
|
+
var D = {
|
|
221
82
|
name: "CodeHighlight",
|
|
222
83
|
category: t.display,
|
|
223
84
|
status: "experimental",
|
|
@@ -233,4 +94,4 @@ var R = {
|
|
|
233
94
|
}
|
|
234
95
|
};
|
|
235
96
|
//#endregion
|
|
236
|
-
export {
|
|
97
|
+
export { C as Code, g as SUPPORTED_LANGUAGES, D as codeHighlightMeta, y as isSupportedLanguage };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { useId as w, useMemo as T, useState as E } from "react";
|
|
1
|
+
import { n as e, t } from "../meta-B8C51eyL.js";
|
|
2
|
+
import { C as n, S as r, a as i, b as a, c as o, d as s, g as c, h as l, i as u, l as d, n as f, o as p, p as m, r as h, t as g, v as _, w as v, x as y, y as b } from "../tabs-DqBFSqq6.js";
|
|
3
|
+
import { useId as x, useMemo as S, useState as C } from "react";
|
|
4
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
6
5
|
import { useDisplayOptions2d as D, useDisplayOptions3d as O } from "@imfusion/sdk-react";
|
|
7
6
|
var k = {
|
|
8
7
|
compactStrip: "imf-ui-image-display-options-module-compactStrip",
|
|
@@ -72,50 +71,50 @@ function F(e, t) {
|
|
|
72
71
|
}
|
|
73
72
|
//#endregion
|
|
74
73
|
//#region src/integrations/image-display-options/image-display-options-view.tsx
|
|
75
|
-
var I =
|
|
76
|
-
function L({ spec: e, value:
|
|
77
|
-
let
|
|
78
|
-
value:
|
|
74
|
+
var I = e(k.root);
|
|
75
|
+
function L({ spec: e, value: t, row: i, onChange: o }) {
|
|
76
|
+
let s = /* @__PURE__ */ E(y, {
|
|
77
|
+
value: t,
|
|
79
78
|
min: e.min,
|
|
80
79
|
max: e.max,
|
|
81
80
|
step: e.step,
|
|
82
81
|
format: e.format,
|
|
83
82
|
onValueChange: (e) => {
|
|
84
|
-
|
|
83
|
+
o(typeof e == "number" ? e : e[0]);
|
|
85
84
|
},
|
|
86
|
-
children: [/* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ E(d, {
|
|
87
86
|
justify: "between",
|
|
88
|
-
children: [/* @__PURE__ */
|
|
89
|
-
}), /* @__PURE__ */
|
|
87
|
+
children: [/* @__PURE__ */ T(a, { children: e.label }), /* @__PURE__ */ T(v, {})]
|
|
88
|
+
}), /* @__PURE__ */ T(_, { children: /* @__PURE__ */ E(n, { children: [/* @__PURE__ */ T(b, {}), /* @__PURE__ */ T(r, { "aria-label": e.label })] }) })]
|
|
90
89
|
});
|
|
91
|
-
return i ? /* @__PURE__ */
|
|
90
|
+
return i ? /* @__PURE__ */ T("div", {
|
|
92
91
|
className: k.rowField,
|
|
93
|
-
children:
|
|
94
|
-
}) :
|
|
92
|
+
children: s
|
|
93
|
+
}) : s;
|
|
95
94
|
}
|
|
96
95
|
function R({ checked: e, row: t, onChange: n }) {
|
|
97
|
-
let r =
|
|
98
|
-
return /* @__PURE__ */
|
|
96
|
+
let r = x();
|
|
97
|
+
return /* @__PURE__ */ E(d, {
|
|
99
98
|
align: "center",
|
|
100
99
|
justify: t ? "start" : "between",
|
|
101
100
|
gap: "2",
|
|
102
101
|
className: k.invertRow,
|
|
103
|
-
children: [/* @__PURE__ */
|
|
102
|
+
children: [/* @__PURE__ */ T("span", {
|
|
104
103
|
id: r,
|
|
105
104
|
className: k.invertLabel,
|
|
106
105
|
children: "Invert"
|
|
107
|
-
}), /* @__PURE__ */
|
|
106
|
+
}), /* @__PURE__ */ T(l, {
|
|
108
107
|
"aria-labelledby": r,
|
|
109
108
|
checked: e,
|
|
110
109
|
onCheckedChange: (e) => {
|
|
111
110
|
n(e);
|
|
112
111
|
},
|
|
113
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ T(c, {})
|
|
114
113
|
})]
|
|
115
114
|
});
|
|
116
115
|
}
|
|
117
116
|
function z({ active: e, onChange: t }) {
|
|
118
|
-
return /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ E(s, {
|
|
119
118
|
className: k.segment,
|
|
120
119
|
"aria-label": "Display dimension",
|
|
121
120
|
value: [e],
|
|
@@ -123,10 +122,10 @@ function z({ active: e, onChange: t }) {
|
|
|
123
122
|
let n = e[0];
|
|
124
123
|
(n === "2d" || n === "3d") && t(n);
|
|
125
124
|
},
|
|
126
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ T(m, {
|
|
127
126
|
value: "2d",
|
|
128
127
|
children: "2D"
|
|
129
|
-
}), /* @__PURE__ */
|
|
128
|
+
}), /* @__PURE__ */ T(m, {
|
|
130
129
|
value: "3d",
|
|
131
130
|
children: "3D"
|
|
132
131
|
})]
|
|
@@ -134,14 +133,14 @@ function z({ active: e, onChange: t }) {
|
|
|
134
133
|
}
|
|
135
134
|
function B({ dimension: e, fields: t, options: n, row: r, onChange: i }) {
|
|
136
135
|
let a = n[e];
|
|
137
|
-
return /* @__PURE__ */
|
|
136
|
+
return /* @__PURE__ */ E(w, { children: [t.map((t) => /* @__PURE__ */ T(L, {
|
|
138
137
|
spec: t,
|
|
139
138
|
value: F(a, t.key),
|
|
140
139
|
row: r,
|
|
141
140
|
onChange: (n) => {
|
|
142
141
|
i(e, P(t.key, n));
|
|
143
142
|
}
|
|
144
|
-
}, t.key)), /* @__PURE__ */
|
|
143
|
+
}, t.key)), /* @__PURE__ */ T(R, {
|
|
145
144
|
checked: a.invert,
|
|
146
145
|
row: r,
|
|
147
146
|
onChange: (t) => {
|
|
@@ -149,115 +148,115 @@ function B({ dimension: e, fields: t, options: n, row: r, onChange: i }) {
|
|
|
149
148
|
}
|
|
150
149
|
})] });
|
|
151
150
|
}
|
|
152
|
-
function V({ variant: e = "default", options: t, intensityRange:
|
|
153
|
-
let [
|
|
154
|
-
|
|
151
|
+
function V({ variant: e = "default", options: t, intensityRange: n, ranges: r, onOptionsChange: a, className: s, ...c }) {
|
|
152
|
+
let [l, m] = C("2d"), _ = N(n, r), v = (e) => {
|
|
153
|
+
m(e === "3d" ? "3d" : "2d");
|
|
155
154
|
};
|
|
156
|
-
return /* @__PURE__ */
|
|
155
|
+
return /* @__PURE__ */ T("div", {
|
|
157
156
|
...c,
|
|
158
157
|
"data-imf-ui-component": "ImageDisplayOptions",
|
|
159
158
|
className: I({ className: s }),
|
|
160
|
-
children: e === "default" ? /* @__PURE__ */
|
|
161
|
-
value:
|
|
159
|
+
children: e === "default" ? /* @__PURE__ */ E(i, {
|
|
160
|
+
value: l,
|
|
162
161
|
onValueChange: v,
|
|
163
|
-
children: [/* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ E(f, { children: [
|
|
163
|
+
/* @__PURE__ */ T(p, {
|
|
165
164
|
value: "2d",
|
|
166
165
|
children: "2D Slices"
|
|
167
166
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ T(p, {
|
|
169
168
|
value: "3d",
|
|
170
169
|
children: "3D Volume"
|
|
171
170
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
] }), /* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ T(g, {})
|
|
172
|
+
] }), /* @__PURE__ */ E(u, { children: [/* @__PURE__ */ T(h, {
|
|
174
173
|
value: "2d",
|
|
175
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ T(o, {
|
|
176
175
|
gap: "3",
|
|
177
|
-
children: /* @__PURE__ */
|
|
176
|
+
children: /* @__PURE__ */ T(B, {
|
|
178
177
|
dimension: "2d",
|
|
179
178
|
fields: _["2d"],
|
|
180
179
|
options: t,
|
|
181
180
|
row: !1,
|
|
182
|
-
onChange:
|
|
181
|
+
onChange: a
|
|
183
182
|
})
|
|
184
183
|
})
|
|
185
|
-
}), /* @__PURE__ */
|
|
184
|
+
}), /* @__PURE__ */ T(h, {
|
|
186
185
|
value: "3d",
|
|
187
|
-
children: /* @__PURE__ */
|
|
186
|
+
children: /* @__PURE__ */ T(o, {
|
|
188
187
|
gap: "3",
|
|
189
|
-
children: /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */ T(B, {
|
|
190
189
|
dimension: "3d",
|
|
191
190
|
fields: _["3d"],
|
|
192
191
|
options: t,
|
|
193
192
|
row: !1,
|
|
194
|
-
onChange:
|
|
193
|
+
onChange: a
|
|
195
194
|
})
|
|
196
195
|
})
|
|
197
196
|
})] })]
|
|
198
|
-
}) : e === "horizontal" ? /* @__PURE__ */
|
|
197
|
+
}) : e === "horizontal" ? /* @__PURE__ */ E(i, {
|
|
199
198
|
className: k.horizontalTabs,
|
|
200
199
|
orientation: "vertical",
|
|
201
|
-
value:
|
|
200
|
+
value: l,
|
|
202
201
|
onValueChange: v,
|
|
203
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ E(f, {
|
|
204
203
|
fill: !0,
|
|
205
204
|
children: [
|
|
206
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ T(p, {
|
|
207
206
|
value: "2d",
|
|
208
207
|
children: "2D"
|
|
209
208
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ T(p, {
|
|
211
210
|
value: "3d",
|
|
212
211
|
children: "3D"
|
|
213
212
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ T(g, {})
|
|
215
214
|
]
|
|
216
|
-
}), /* @__PURE__ */
|
|
215
|
+
}), /* @__PURE__ */ E(u, {
|
|
217
216
|
className: k.horizontalPanel,
|
|
218
|
-
children: [/* @__PURE__ */
|
|
217
|
+
children: [/* @__PURE__ */ T(h, {
|
|
219
218
|
value: "2d",
|
|
220
|
-
children: /* @__PURE__ */
|
|
219
|
+
children: /* @__PURE__ */ T(d, {
|
|
221
220
|
align: "center",
|
|
222
221
|
gap: "3",
|
|
223
222
|
className: k.strip,
|
|
224
|
-
children: /* @__PURE__ */
|
|
223
|
+
children: /* @__PURE__ */ T(B, {
|
|
225
224
|
dimension: "2d",
|
|
226
225
|
fields: _["2d"],
|
|
227
226
|
options: t,
|
|
228
227
|
row: !0,
|
|
229
|
-
onChange:
|
|
228
|
+
onChange: a
|
|
230
229
|
})
|
|
231
230
|
})
|
|
232
|
-
}), /* @__PURE__ */
|
|
231
|
+
}), /* @__PURE__ */ T(h, {
|
|
233
232
|
value: "3d",
|
|
234
|
-
children: /* @__PURE__ */
|
|
233
|
+
children: /* @__PURE__ */ T(d, {
|
|
235
234
|
align: "center",
|
|
236
235
|
gap: "3",
|
|
237
236
|
className: k.strip,
|
|
238
|
-
children: /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ T(B, {
|
|
239
238
|
dimension: "3d",
|
|
240
239
|
fields: _["3d"],
|
|
241
240
|
options: t,
|
|
242
241
|
row: !0,
|
|
243
|
-
onChange:
|
|
242
|
+
onChange: a
|
|
244
243
|
})
|
|
245
244
|
})
|
|
246
245
|
})]
|
|
247
246
|
})]
|
|
248
|
-
}) : /* @__PURE__ */
|
|
247
|
+
}) : /* @__PURE__ */ E(d, {
|
|
249
248
|
align: "center",
|
|
250
249
|
gap: "3",
|
|
251
250
|
className: k.compactStrip,
|
|
252
|
-
children: [/* @__PURE__ */
|
|
253
|
-
active:
|
|
254
|
-
onChange:
|
|
255
|
-
}), /* @__PURE__ */
|
|
256
|
-
dimension:
|
|
257
|
-
fields: _[
|
|
251
|
+
children: [/* @__PURE__ */ T(z, {
|
|
252
|
+
active: l,
|
|
253
|
+
onChange: m
|
|
254
|
+
}), /* @__PURE__ */ T(B, {
|
|
255
|
+
dimension: l,
|
|
256
|
+
fields: _[l],
|
|
258
257
|
options: t,
|
|
259
258
|
row: !0,
|
|
260
|
-
onChange:
|
|
259
|
+
onChange: a
|
|
261
260
|
})]
|
|
262
261
|
})
|
|
263
262
|
});
|
|
@@ -278,8 +277,8 @@ function H({ data: e, variant: t = "default", ranges: n, ...r }) {
|
|
|
278
277
|
level: a.level,
|
|
279
278
|
invert: a.invert
|
|
280
279
|
}
|
|
281
|
-
}, s =
|
|
282
|
-
return /* @__PURE__ */
|
|
280
|
+
}, s = S(() => e.minmaxIntensityOriginal(), [e]);
|
|
281
|
+
return /* @__PURE__ */ T(V, {
|
|
283
282
|
...r,
|
|
284
283
|
variant: t,
|
|
285
284
|
options: o,
|
|
@@ -295,7 +294,7 @@ H.displayName = "ImageDisplayOptions";
|
|
|
295
294
|
//#region src/integrations/image-display-options/image-display-options.meta.ts
|
|
296
295
|
var U = {
|
|
297
296
|
name: "ImageDisplayOptions",
|
|
298
|
-
category:
|
|
297
|
+
category: t.inputs,
|
|
299
298
|
status: "experimental",
|
|
300
299
|
description: "A panel or toolbar of controls bound to an image dataset's display options.",
|
|
301
300
|
origin: "adapted",
|