@adcops/autocore-react 3.5.15 → 3.6.3
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/components/tis-editor/DeleteMethodDialog.d.ts +43 -0
- package/dist/components/tis-editor/DeleteMethodDialog.d.ts.map +1 -0
- package/dist/components/tis-editor/DeleteMethodDialog.js +1 -0
- package/dist/components/tis-editor/MethodTransfer.d.ts +69 -0
- package/dist/components/tis-editor/MethodTransfer.d.ts.map +1 -0
- package/dist/components/tis-editor/MethodTransfer.js +1 -0
- package/dist/components/tis-editor/TisConfigEditor.css +31 -0
- package/dist/components/tis-editor/TisConfigEditor.d.ts +9 -1
- package/dist/components/tis-editor/TisConfigEditor.d.ts.map +1 -1
- package/dist/components/tis-editor/TisConfigEditor.js +1 -1
- package/dist/components/tis-editor/editor/IdentitySection.d.ts.map +1 -1
- package/dist/components/tis-editor/editor/IdentitySection.js +1 -1
- package/dist/components/tis-editor/types.d.ts +11 -0
- package/dist/components/tis-editor/types.d.ts.map +1 -1
- package/dist/components/varpick/VariablePicker.d.ts.map +1 -1
- package/dist/components/varpick/VariablePicker.js +1 -1
- package/dist/components/varpick/varpick.css +84 -30
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useMethodSequence.d.ts +60 -0
- package/dist/hooks/useMethodSequence.d.ts.map +1 -0
- package/dist/hooks/useMethodSequence.js +1 -0
- package/package.json +1 -1
- package/src/components/tis-editor/DeleteMethodDialog.tsx +162 -0
- package/src/components/tis-editor/MethodTransfer.ts +138 -0
- package/src/components/tis-editor/TisConfigEditor.css +31 -0
- package/src/components/tis-editor/TisConfigEditor.tsx +305 -7
- package/src/components/tis-editor/editor/IdentitySection.tsx +33 -1
- package/src/components/tis-editor/types.ts +11 -0
- package/src/components/varpick/VariablePicker.tsx +4 -0
- package/src/components/varpick/varpick.css +84 -30
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useMethodSequence.ts +128 -0
- package/tools/tests/dist/{TestFieldDialog-BvHAr2GQ.js → TestFieldDialog-Dph2oPfe.js} +1 -0
- package/tools/tests/dist/autocore-react.css +84 -30
- package/tools/tests/dist/tis-editor.entry.js +1 -1
- package/tools/tests/dist/varpick.entry.js +1 -1
- package/tools/tests/varpick.test.mjs +5 -0
|
@@ -1,12 +1,66 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Variable picker.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* ## The token bridge
|
|
5
|
+
*
|
|
6
|
+
* Every colour resolves `--ac-*` first, then the PrimeReact theme variable,
|
|
7
|
+
* then a literal. That ordering is the whole point:
|
|
8
|
+
*
|
|
9
|
+
* - **`--ac-*`** is autocore's own design-token layer, which 4.0 supplies.
|
|
10
|
+
* When it exists, this file needs no edit to follow it.
|
|
11
|
+
* - **PrimeReact's `--surface-*` / `--text-color`** is what 3.5 actually
|
|
12
|
+
* defines today, so the picker matches whatever theme the machine runs,
|
|
13
|
+
* light or dark.
|
|
14
|
+
* - **The literal** keeps an un-themed host legible — the playground, the
|
|
15
|
+
* jsdom test harness — rather than rendering black on black.
|
|
16
|
+
*
|
|
17
|
+
* The token NAMES and their fallbacks are copied deliberately from
|
|
18
|
+
* `@adcops/autocore-seq-react`'s `styles.css`. The sequence editor's picker and
|
|
19
|
+
* this one sit one tab apart doing the identical thing; if they read different
|
|
20
|
+
* token names, 4.0 would have to satisfy two sets and the two panels could
|
|
21
|
+
* drift to different colours while both looked "correct".
|
|
22
|
+
*
|
|
23
|
+
* ## Why the tokens are declared twice
|
|
24
|
+
*
|
|
25
|
+
* The field lives inside the TIS editor's form, but PrimeReact renders the
|
|
26
|
+
* Dialog through a PORTAL to `<body>` — so the two halves are not in one
|
|
27
|
+
* subtree and a single scoping root cannot cover both. Hence the declaration on
|
|
28
|
+
* `.ac-varpick` (the dialog, which passes that className) and on
|
|
29
|
+
* `.ac-varpick__input` (the field). Declaring them on `:root` instead would
|
|
30
|
+
* push a dozen names into every consuming application's global scope for the
|
|
31
|
+
* benefit of one component.
|
|
8
32
|
*/
|
|
9
33
|
|
|
34
|
+
.ac-varpick,
|
|
35
|
+
.ac-varpick__input {
|
|
36
|
+
/* -- surfaces ---------------------------------------------------- */
|
|
37
|
+
--vp-sunk: var(--ac-surface-sunk, var(--surface-50, #f8f9fa));
|
|
38
|
+
--vp-overlay: var(--ac-surface-overlay, var(--surface-overlay,#ffffff));
|
|
39
|
+
--vp-hover: var(--ac-hover, var(--surface-hover, rgba(127, 127, 127, 0.08)));
|
|
40
|
+
|
|
41
|
+
/* -- ink --------------------------------------------------------- */
|
|
42
|
+
--vp-ink: var(--ac-on-surface, var(--text-color, #111827));
|
|
43
|
+
--vp-ink-muted: var(--ac-on-surface-muted, var(--text-color-secondary, #6b7280));
|
|
44
|
+
--vp-ink-subtle: var(--ac-on-surface-subtle, var(--text-color-secondary, #8b95a1));
|
|
45
|
+
|
|
46
|
+
/* -- lines ------------------------------------------------------- */
|
|
47
|
+
--vp-border: var(--ac-border, var(--surface-border, rgba(127, 127, 127, 0.25)));
|
|
48
|
+
--vp-divider: var(--ac-divider, var(--surface-border, rgba(127, 127, 127, 0.18)));
|
|
49
|
+
|
|
50
|
+
/* -- accents ----------------------------------------------------- */
|
|
51
|
+
--vp-primary: var(--ac-primary, var(--primary-color, #2563eb));
|
|
52
|
+
--vp-primary-subtle: var(--ac-primary-subtle, var(--highlight-bg, rgba(37, 99, 235, 0.14)));
|
|
53
|
+
--vp-success: var(--ac-success, var(--green-500, #15803d));
|
|
54
|
+
--vp-warning: var(--ac-warning, var(--orange-500, #b45309));
|
|
55
|
+
--vp-info: var(--ac-info, var(--blue-500, #0369a1));
|
|
56
|
+
--vp-focus-ring: var(--ac-focus-ring, rgba(37, 99, 235, 0.45));
|
|
57
|
+
|
|
58
|
+
/* -- type -------------------------------------------------------- */
|
|
59
|
+
--vp-mono: var(--ac-font-mono, ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace);
|
|
60
|
+
--vp-font-sm: var(--ac-text-sm, 0.8125rem);
|
|
61
|
+
--vp-font-xs: var(--ac-text-xs, 0.75rem);
|
|
62
|
+
}
|
|
63
|
+
|
|
10
64
|
.ac-varpick__input {
|
|
11
65
|
display: flex;
|
|
12
66
|
align-items: stretch;
|
|
@@ -31,8 +85,8 @@
|
|
|
31
85
|
}
|
|
32
86
|
|
|
33
87
|
.ac-varpick__hint {
|
|
34
|
-
font-size:
|
|
35
|
-
color: var(--
|
|
88
|
+
font-size: var(--vp-font-sm);
|
|
89
|
+
color: var(--vp-ink-muted);
|
|
36
90
|
margin-bottom: 0.75rem;
|
|
37
91
|
line-height: 1.4;
|
|
38
92
|
}
|
|
@@ -41,7 +95,7 @@
|
|
|
41
95
|
|
|
42
96
|
.ac-varpick__empty {
|
|
43
97
|
padding: 1.5rem 0.25rem;
|
|
44
|
-
color: var(--
|
|
98
|
+
color: var(--vp-ink-muted);
|
|
45
99
|
font-size: 0.875rem;
|
|
46
100
|
}
|
|
47
101
|
|
|
@@ -64,24 +118,24 @@
|
|
|
64
118
|
gap: 0.5rem;
|
|
65
119
|
padding-bottom: 0.25rem;
|
|
66
120
|
margin-bottom: 0.25rem;
|
|
67
|
-
border-bottom: 1px solid var(--
|
|
121
|
+
border-bottom: 1px solid var(--vp-divider);
|
|
68
122
|
position: sticky;
|
|
69
123
|
top: 0;
|
|
70
|
-
background: var(--
|
|
124
|
+
background: var(--vp-overlay);
|
|
71
125
|
z-index: 1;
|
|
72
126
|
}
|
|
73
127
|
|
|
74
128
|
.ac-varpick__grouptitle {
|
|
75
|
-
font-size:
|
|
129
|
+
font-size: var(--vp-font-xs);
|
|
76
130
|
font-weight: 700;
|
|
77
131
|
letter-spacing: 0.04em;
|
|
78
132
|
text-transform: uppercase;
|
|
79
|
-
color: var(--
|
|
133
|
+
color: var(--vp-ink-muted);
|
|
80
134
|
}
|
|
81
135
|
|
|
82
136
|
.ac-varpick__grouphint {
|
|
83
|
-
font-size:
|
|
84
|
-
color: var(--
|
|
137
|
+
font-size: var(--vp-font-xs);
|
|
138
|
+
color: var(--vp-ink-subtle);
|
|
85
139
|
}
|
|
86
140
|
|
|
87
141
|
/*
|
|
@@ -102,21 +156,21 @@
|
|
|
102
156
|
border: 1px solid transparent;
|
|
103
157
|
border-radius: 3px;
|
|
104
158
|
background: transparent;
|
|
105
|
-
color: var(--
|
|
159
|
+
color: var(--vp-ink);
|
|
106
160
|
font: inherit;
|
|
107
161
|
cursor: pointer;
|
|
108
162
|
}
|
|
109
163
|
|
|
110
|
-
.ac-varpick__row:hover { background: var(--
|
|
164
|
+
.ac-varpick__row:hover { background: var(--vp-hover); }
|
|
111
165
|
|
|
112
166
|
.ac-varpick__row:focus-visible {
|
|
113
|
-
outline: 2px solid var(--
|
|
167
|
+
outline: 2px solid var(--vp-focus-ring);
|
|
114
168
|
outline-offset: -2px;
|
|
115
169
|
}
|
|
116
170
|
|
|
117
171
|
.ac-varpick__row--on {
|
|
118
|
-
background: var(--
|
|
119
|
-
border-color: var(--primary
|
|
172
|
+
background: var(--vp-primary-subtle);
|
|
173
|
+
border-color: var(--vp-primary);
|
|
120
174
|
}
|
|
121
175
|
|
|
122
176
|
.ac-varpick__row--off { opacity: 0.55; cursor: default; }
|
|
@@ -130,19 +184,19 @@
|
|
|
130
184
|
}
|
|
131
185
|
|
|
132
186
|
.ac-varpick__name {
|
|
133
|
-
font-family: var(--
|
|
187
|
+
font-family: var(--vp-mono);
|
|
134
188
|
font-weight: 600;
|
|
135
189
|
}
|
|
136
190
|
|
|
137
191
|
.ac-varpick__label { font-size: 0.875rem; }
|
|
138
192
|
|
|
139
193
|
.ac-varpick__chip {
|
|
140
|
-
font-size:
|
|
194
|
+
font-size: var(--vp-font-xs);
|
|
141
195
|
padding: 0 6px;
|
|
142
196
|
border-radius: 999px;
|
|
143
|
-
background: var(--
|
|
144
|
-
border: 1px solid var(--
|
|
145
|
-
color: var(--
|
|
197
|
+
background: var(--vp-sunk);
|
|
198
|
+
border: 1px solid var(--vp-border);
|
|
199
|
+
color: var(--vp-ink-muted);
|
|
146
200
|
/* A unit symbol's case is meaningful: "mm/s", "N", "MPa". */
|
|
147
201
|
text-transform: none;
|
|
148
202
|
}
|
|
@@ -150,18 +204,18 @@
|
|
|
150
204
|
/* The current reading. Nothing turns an unfamiliar name into an obvious one
|
|
151
205
|
* faster than seeing what it says right now. */
|
|
152
206
|
.ac-varpick__live {
|
|
153
|
-
font-family: var(--
|
|
154
|
-
font-size:
|
|
155
|
-
color: var(--
|
|
207
|
+
font-family: var(--vp-mono);
|
|
208
|
+
font-size: var(--vp-font-xs);
|
|
209
|
+
color: var(--vp-success);
|
|
156
210
|
}
|
|
157
211
|
|
|
158
212
|
.ac-varpick__desc {
|
|
159
|
-
font-size:
|
|
160
|
-
color: var(--
|
|
213
|
+
font-size: var(--vp-font-sm);
|
|
214
|
+
color: var(--vp-ink-muted);
|
|
161
215
|
line-height: 1.35;
|
|
162
216
|
}
|
|
163
217
|
|
|
164
|
-
.ac-varpick__why { font-size:
|
|
165
|
-
.ac-varpick__note { font-size:
|
|
218
|
+
.ac-varpick__why { font-size: var(--vp-font-sm); color: var(--vp-warning); }
|
|
219
|
+
.ac-varpick__note { font-size: var(--vp-font-sm); color: var(--vp-info); }
|
|
166
220
|
|
|
167
221
|
.ac-varpick__foot { display: flex; justify-content: flex-end; gap: 0.5rem; }
|
package/src/hooks/index.ts
CHANGED
|
@@ -22,3 +22,7 @@ export type { UseGmVariablesResult, UseGmVariablesOptions, GmIpcInvoker } from '
|
|
|
22
22
|
// a TIS cycle column, and the one nothing used to check.
|
|
23
23
|
export { useSequenceProducers, collectStoredNames } from './useSequenceProducers';
|
|
24
24
|
export type { UseSequenceProducersResult, UseSequenceProducersOptions } from './useSequenceProducers';
|
|
25
|
+
export {
|
|
26
|
+
useMethodSequence, sequenceTopic, emptySequence, isSequenceShaped,
|
|
27
|
+
} from './useMethodSequence';
|
|
28
|
+
export type { MethodSequenceIo, UseMethodSequenceOptions } from './useMethodSequence';
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useMethodSequence — read, write and delete the `.seq.json` half of a test
|
|
3
|
+
* method.
|
|
4
|
+
*
|
|
5
|
+
* ## One method, two files
|
|
6
|
+
*
|
|
7
|
+
* A sequence-backed test method is its `test_methods.json` schema entry PLUS
|
|
8
|
+
* `methods/<method_id>.seq.json`, the procedure the sequence engine runs. The
|
|
9
|
+
* filename is DERIVED from the method id and never stored, so the two halves
|
|
10
|
+
* cannot point at different things — see `autocore_tis::config::sequence_file`
|
|
11
|
+
* and `method_path()` in gen4_ac's `process_main.rs`, which spell the same
|
|
12
|
+
* derivation.
|
|
13
|
+
*
|
|
14
|
+
* Every method-lifecycle action therefore has to move both halves together:
|
|
15
|
+
*
|
|
16
|
+
* New — scaffold a blank procedure, or the method is unrunnable and
|
|
17
|
+
* Start refuses with "has no sequence on this machine".
|
|
18
|
+
* Duplicate — copy the procedure under the new id, or the copy silently runs
|
|
19
|
+
* nothing.
|
|
20
|
+
* Delete — remove the procedure, or an orphan file is left behind that a
|
|
21
|
+
* later method of the same name would inherit.
|
|
22
|
+
* Im/Export — carry the procedure, because a schema whose cycle columns
|
|
23
|
+
* nothing produces records blank rows forever.
|
|
24
|
+
*
|
|
25
|
+
* That last one is why import/export is a METHOD operation and not a sequence
|
|
26
|
+
* operation: half a method is not portable.
|
|
27
|
+
*
|
|
28
|
+
* The control program has no filesystem access, so all of this rides the
|
|
29
|
+
* datastore servelet over IPC, exactly as {@link useSequenceProducers} reads it.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
import { useCallback, useContext, useMemo } from 'react';
|
|
33
|
+
import { EventEmitterContext } from '../core/EventEmitterContext';
|
|
34
|
+
import { MessageType } from '../hub/CommandMessage';
|
|
35
|
+
|
|
36
|
+
/** Where the sequence library lives in the datastore. Keep in step with
|
|
37
|
+
* `useSequenceProducers`, `autocore_tis::config::sequence_file`, and
|
|
38
|
+
* gen4_ac's `method_path()`. */
|
|
39
|
+
const METHOD_DIR = 'methods';
|
|
40
|
+
const METHOD_EXT = '.seq.json';
|
|
41
|
+
|
|
42
|
+
/** The datastore topic for a method's procedure. */
|
|
43
|
+
export function sequenceTopic(methodId: string): string {
|
|
44
|
+
return `datastore.${METHOD_DIR}/${methodId}${METHOD_EXT}`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** A blank procedure, shaped so `validateMethod` and the editor accept it. */
|
|
48
|
+
export function emptySequence(methodId: string): Record<string, unknown> {
|
|
49
|
+
return { name: methodId, format_version: 1, steps: [] };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Is this datastore payload plausibly a `.seq.json` method? */
|
|
53
|
+
export function isSequenceShaped(v: any): boolean {
|
|
54
|
+
return !!v && Array.isArray(v.steps);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface UseMethodSequenceOptions {
|
|
58
|
+
/** Override the IPC layer (tests, playground). */
|
|
59
|
+
invoker?: (topic: string, messageType: number, payload: object) => Promise<any>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface MethodSequenceIo {
|
|
63
|
+
/** The procedure for `methodId`, or null when there is none. */
|
|
64
|
+
read: (methodId: string) => Promise<any | null>;
|
|
65
|
+
/**
|
|
66
|
+
* Write `sequence` as the procedure for `methodId`.
|
|
67
|
+
*
|
|
68
|
+
* `name` is rewritten to `methodId` on the way out, unconditionally. The
|
|
69
|
+
* method id owns the identity; the `name` inside the file is a leftover
|
|
70
|
+
* from when the sequence library named itself, and a copy that keeps its
|
|
71
|
+
* source's name is a file claiming to be a method it is not.
|
|
72
|
+
*/
|
|
73
|
+
write: (methodId: string, sequence: any) => Promise<void>;
|
|
74
|
+
/** Remove the procedure for `methodId`. Resolves even if there was none. */
|
|
75
|
+
remove: (methodId: string) => Promise<void>;
|
|
76
|
+
/** Copy `from`'s procedure to `to`. No-op when `from` has none. */
|
|
77
|
+
copy: (from: string, to: string) => Promise<void>;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function useMethodSequence(options?: UseMethodSequenceOptions): MethodSequenceIo {
|
|
81
|
+
const ctx = useContext(EventEmitterContext);
|
|
82
|
+
const invoke = options?.invoker
|
|
83
|
+
?? ((topic: string, messageType: number, payload: object) =>
|
|
84
|
+
ctx.invoke(topic as any, messageType as any, payload as any));
|
|
85
|
+
|
|
86
|
+
const read = useCallback(async (methodId: string) => {
|
|
87
|
+
if (!methodId) return null;
|
|
88
|
+
try {
|
|
89
|
+
const resp: any = await invoke(sequenceTopic(methodId), MessageType.Read, {});
|
|
90
|
+
if (resp?.success === false) return null;
|
|
91
|
+
const seq = resp?.data ?? resp;
|
|
92
|
+
return isSequenceShaped(seq) ? seq : null;
|
|
93
|
+
} catch {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
97
|
+
}, [ctx]);
|
|
98
|
+
|
|
99
|
+
const write = useCallback(async (methodId: string, sequence: any) => {
|
|
100
|
+
const value = { ...(sequence ?? {}), name: methodId };
|
|
101
|
+
await invoke(sequenceTopic(methodId), MessageType.Write, {
|
|
102
|
+
value,
|
|
103
|
+
options: { create_dirs: true },
|
|
104
|
+
});
|
|
105
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
106
|
+
}, [ctx]);
|
|
107
|
+
|
|
108
|
+
const remove = useCallback(async (methodId: string) => {
|
|
109
|
+
try {
|
|
110
|
+
await invoke(sequenceTopic(methodId), MessageType.Control, { action: 'delete' });
|
|
111
|
+
} catch {
|
|
112
|
+
// A method with no procedure is a legitimate state (a control-backed
|
|
113
|
+
// method, or one that was never authored). Failing the delete of the
|
|
114
|
+
// schema because the file it never had could not be removed would
|
|
115
|
+
// leave the operator unable to finish.
|
|
116
|
+
}
|
|
117
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
118
|
+
}, [ctx]);
|
|
119
|
+
|
|
120
|
+
const copy = useCallback(async (from: string, to: string) => {
|
|
121
|
+
const seq = await read(from);
|
|
122
|
+
if (seq) await write(to, seq);
|
|
123
|
+
}, [read, write]);
|
|
124
|
+
|
|
125
|
+
return useMemo(() => ({ read, write, remove, copy }), [read, write, remove, copy]);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export default useMethodSequence;
|
|
@@ -31489,6 +31489,7 @@ var VariablePicker = ({ visible, catalog, title, hint, initialQuery, onCancel, o
|
|
|
31489
31489
|
visible,
|
|
31490
31490
|
onHide: onCancel,
|
|
31491
31491
|
footer,
|
|
31492
|
+
className: "ac-varpick",
|
|
31492
31493
|
style: {
|
|
31493
31494
|
width: "44rem",
|
|
31494
31495
|
maxWidth: "95vw"
|
|
@@ -90,12 +90,66 @@
|
|
|
90
90
|
/*
|
|
91
91
|
* Variable picker.
|
|
92
92
|
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
93
|
+
* ## The token bridge
|
|
94
|
+
*
|
|
95
|
+
* Every colour resolves `--ac-*` first, then the PrimeReact theme variable,
|
|
96
|
+
* then a literal. That ordering is the whole point:
|
|
97
|
+
*
|
|
98
|
+
* - **`--ac-*`** is autocore's own design-token layer, which 4.0 supplies.
|
|
99
|
+
* When it exists, this file needs no edit to follow it.
|
|
100
|
+
* - **PrimeReact's `--surface-*` / `--text-color`** is what 3.5 actually
|
|
101
|
+
* defines today, so the picker matches whatever theme the machine runs,
|
|
102
|
+
* light or dark.
|
|
103
|
+
* - **The literal** keeps an un-themed host legible — the playground, the
|
|
104
|
+
* jsdom test harness — rather than rendering black on black.
|
|
105
|
+
*
|
|
106
|
+
* The token NAMES and their fallbacks are copied deliberately from
|
|
107
|
+
* `@adcops/autocore-seq-react`'s `styles.css`. The sequence editor's picker and
|
|
108
|
+
* this one sit one tab apart doing the identical thing; if they read different
|
|
109
|
+
* token names, 4.0 would have to satisfy two sets and the two panels could
|
|
110
|
+
* drift to different colours while both looked "correct".
|
|
111
|
+
*
|
|
112
|
+
* ## Why the tokens are declared twice
|
|
113
|
+
*
|
|
114
|
+
* The field lives inside the TIS editor's form, but PrimeReact renders the
|
|
115
|
+
* Dialog through a PORTAL to `<body>` — so the two halves are not in one
|
|
116
|
+
* subtree and a single scoping root cannot cover both. Hence the declaration on
|
|
117
|
+
* `.ac-varpick` (the dialog, which passes that className) and on
|
|
118
|
+
* `.ac-varpick__input` (the field). Declaring them on `:root` instead would
|
|
119
|
+
* push a dozen names into every consuming application's global scope for the
|
|
120
|
+
* benefit of one component.
|
|
97
121
|
*/
|
|
98
122
|
|
|
123
|
+
.ac-varpick,
|
|
124
|
+
.ac-varpick__input {
|
|
125
|
+
/* -- surfaces ---------------------------------------------------- */
|
|
126
|
+
--vp-sunk: var(--ac-surface-sunk, var(--surface-50, #f8f9fa));
|
|
127
|
+
--vp-overlay: var(--ac-surface-overlay, var(--surface-overlay,#ffffff));
|
|
128
|
+
--vp-hover: var(--ac-hover, var(--surface-hover, rgba(127, 127, 127, 0.08)));
|
|
129
|
+
|
|
130
|
+
/* -- ink --------------------------------------------------------- */
|
|
131
|
+
--vp-ink: var(--ac-on-surface, var(--text-color, #111827));
|
|
132
|
+
--vp-ink-muted: var(--ac-on-surface-muted, var(--text-color-secondary, #6b7280));
|
|
133
|
+
--vp-ink-subtle: var(--ac-on-surface-subtle, var(--text-color-secondary, #8b95a1));
|
|
134
|
+
|
|
135
|
+
/* -- lines ------------------------------------------------------- */
|
|
136
|
+
--vp-border: var(--ac-border, var(--surface-border, rgba(127, 127, 127, 0.25)));
|
|
137
|
+
--vp-divider: var(--ac-divider, var(--surface-border, rgba(127, 127, 127, 0.18)));
|
|
138
|
+
|
|
139
|
+
/* -- accents ----------------------------------------------------- */
|
|
140
|
+
--vp-primary: var(--ac-primary, var(--primary-color, #2563eb));
|
|
141
|
+
--vp-primary-subtle: var(--ac-primary-subtle, var(--highlight-bg, rgba(37, 99, 235, 0.14)));
|
|
142
|
+
--vp-success: var(--ac-success, var(--green-500, #15803d));
|
|
143
|
+
--vp-warning: var(--ac-warning, var(--orange-500, #b45309));
|
|
144
|
+
--vp-info: var(--ac-info, var(--blue-500, #0369a1));
|
|
145
|
+
--vp-focus-ring: var(--ac-focus-ring, rgba(37, 99, 235, 0.45));
|
|
146
|
+
|
|
147
|
+
/* -- type -------------------------------------------------------- */
|
|
148
|
+
--vp-mono: var(--ac-font-mono, ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace);
|
|
149
|
+
--vp-font-sm: var(--ac-text-sm, 0.8125rem);
|
|
150
|
+
--vp-font-xs: var(--ac-text-xs, 0.75rem);
|
|
151
|
+
}
|
|
152
|
+
|
|
99
153
|
.ac-varpick__input {
|
|
100
154
|
display: flex;
|
|
101
155
|
align-items: stretch;
|
|
@@ -120,8 +174,8 @@
|
|
|
120
174
|
}
|
|
121
175
|
|
|
122
176
|
.ac-varpick__hint {
|
|
123
|
-
font-size:
|
|
124
|
-
color: var(--
|
|
177
|
+
font-size: var(--vp-font-sm);
|
|
178
|
+
color: var(--vp-ink-muted);
|
|
125
179
|
margin-bottom: 0.75rem;
|
|
126
180
|
line-height: 1.4;
|
|
127
181
|
}
|
|
@@ -130,7 +184,7 @@
|
|
|
130
184
|
|
|
131
185
|
.ac-varpick__empty {
|
|
132
186
|
padding: 1.5rem 0.25rem;
|
|
133
|
-
color: var(--
|
|
187
|
+
color: var(--vp-ink-muted);
|
|
134
188
|
font-size: 0.875rem;
|
|
135
189
|
}
|
|
136
190
|
|
|
@@ -153,24 +207,24 @@
|
|
|
153
207
|
gap: 0.5rem;
|
|
154
208
|
padding-bottom: 0.25rem;
|
|
155
209
|
margin-bottom: 0.25rem;
|
|
156
|
-
border-bottom: 1px solid var(--
|
|
210
|
+
border-bottom: 1px solid var(--vp-divider);
|
|
157
211
|
position: sticky;
|
|
158
212
|
top: 0;
|
|
159
|
-
background: var(--
|
|
213
|
+
background: var(--vp-overlay);
|
|
160
214
|
z-index: 1;
|
|
161
215
|
}
|
|
162
216
|
|
|
163
217
|
.ac-varpick__grouptitle {
|
|
164
|
-
font-size:
|
|
218
|
+
font-size: var(--vp-font-xs);
|
|
165
219
|
font-weight: 700;
|
|
166
220
|
letter-spacing: 0.04em;
|
|
167
221
|
text-transform: uppercase;
|
|
168
|
-
color: var(--
|
|
222
|
+
color: var(--vp-ink-muted);
|
|
169
223
|
}
|
|
170
224
|
|
|
171
225
|
.ac-varpick__grouphint {
|
|
172
|
-
font-size:
|
|
173
|
-
color: var(--
|
|
226
|
+
font-size: var(--vp-font-xs);
|
|
227
|
+
color: var(--vp-ink-subtle);
|
|
174
228
|
}
|
|
175
229
|
|
|
176
230
|
/*
|
|
@@ -191,21 +245,21 @@
|
|
|
191
245
|
border: 1px solid transparent;
|
|
192
246
|
border-radius: 3px;
|
|
193
247
|
background: transparent;
|
|
194
|
-
color: var(--
|
|
248
|
+
color: var(--vp-ink);
|
|
195
249
|
font: inherit;
|
|
196
250
|
cursor: pointer;
|
|
197
251
|
}
|
|
198
252
|
|
|
199
|
-
.ac-varpick__row:hover { background: var(--
|
|
253
|
+
.ac-varpick__row:hover { background: var(--vp-hover); }
|
|
200
254
|
|
|
201
255
|
.ac-varpick__row:focus-visible {
|
|
202
|
-
outline: 2px solid var(--
|
|
256
|
+
outline: 2px solid var(--vp-focus-ring);
|
|
203
257
|
outline-offset: -2px;
|
|
204
258
|
}
|
|
205
259
|
|
|
206
260
|
.ac-varpick__row--on {
|
|
207
|
-
background: var(--
|
|
208
|
-
border-color: var(--primary
|
|
261
|
+
background: var(--vp-primary-subtle);
|
|
262
|
+
border-color: var(--vp-primary);
|
|
209
263
|
}
|
|
210
264
|
|
|
211
265
|
.ac-varpick__row--off { opacity: 0.55; cursor: default; }
|
|
@@ -219,19 +273,19 @@
|
|
|
219
273
|
}
|
|
220
274
|
|
|
221
275
|
.ac-varpick__name {
|
|
222
|
-
font-family: var(--
|
|
276
|
+
font-family: var(--vp-mono);
|
|
223
277
|
font-weight: 600;
|
|
224
278
|
}
|
|
225
279
|
|
|
226
280
|
.ac-varpick__label { font-size: 0.875rem; }
|
|
227
281
|
|
|
228
282
|
.ac-varpick__chip {
|
|
229
|
-
font-size:
|
|
283
|
+
font-size: var(--vp-font-xs);
|
|
230
284
|
padding: 0 6px;
|
|
231
285
|
border-radius: 999px;
|
|
232
|
-
background: var(--
|
|
233
|
-
border: 1px solid var(--
|
|
234
|
-
color: var(--
|
|
286
|
+
background: var(--vp-sunk);
|
|
287
|
+
border: 1px solid var(--vp-border);
|
|
288
|
+
color: var(--vp-ink-muted);
|
|
235
289
|
/* A unit symbol's case is meaningful: "mm/s", "N", "MPa". */
|
|
236
290
|
text-transform: none;
|
|
237
291
|
}
|
|
@@ -239,19 +293,19 @@
|
|
|
239
293
|
/* The current reading. Nothing turns an unfamiliar name into an obvious one
|
|
240
294
|
* faster than seeing what it says right now. */
|
|
241
295
|
.ac-varpick__live {
|
|
242
|
-
font-family: var(--
|
|
243
|
-
font-size:
|
|
244
|
-
color: var(--
|
|
296
|
+
font-family: var(--vp-mono);
|
|
297
|
+
font-size: var(--vp-font-xs);
|
|
298
|
+
color: var(--vp-success);
|
|
245
299
|
}
|
|
246
300
|
|
|
247
301
|
.ac-varpick__desc {
|
|
248
|
-
font-size:
|
|
249
|
-
color: var(--
|
|
302
|
+
font-size: var(--vp-font-sm);
|
|
303
|
+
color: var(--vp-ink-muted);
|
|
250
304
|
line-height: 1.35;
|
|
251
305
|
}
|
|
252
306
|
|
|
253
|
-
.ac-varpick__why { font-size:
|
|
254
|
-
.ac-varpick__note { font-size:
|
|
307
|
+
.ac-varpick__why { font-size: var(--vp-font-sm); color: var(--vp-warning); }
|
|
308
|
+
.ac-varpick__note { font-size: var(--vp-font-sm); color: var(--vp-info); }
|
|
255
309
|
|
|
256
310
|
.ac-varpick__foot { display: flex; justify-content: flex-end; gap: 0.5rem; }
|
|
257
311
|
/*$vite$:1*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as useMergeProps, B as PrimeReact$2, C as Portal, D as ComponentBase, E as IconBase, F as useUnmountEffect, G as IconUtils, H as ariaLabel$2, I as useUpdateEffect, J as ZIndexUtils, K as ObjectUtils, L as FilterMatchMode$2, M as useOverlayListener, N as usePrevious, O as useHandleStyle, P as useStyle, Q as __toESM, R as FilterOperator, S as Tooltip, T as SpinnerIcon, U as localeOption, V as PrimeReactContext, W as DomHandler, X as require_client, Y as classNames, Z as require_react, _ as OverlayService, b as InputNumber, c as useEditDraft, d as require_jsx_runtime, f as Button, g as CSSTransition, h as VirtualScroller, i as chartFieldCatalog, j as useMountEffect, k as useEventListener, l as FormRow, m as CheckIcon, p as Dropdown, q as UniqueComponentId, s as VariableInput, t as TestFieldDialog, u as Dialog, v as TimesIcon, w as Ripple, x as InputText, y as ChevronDownIcon, z as FilterService } from "./TestFieldDialog-
|
|
1
|
+
import { A as useMergeProps, B as PrimeReact$2, C as Portal, D as ComponentBase, E as IconBase, F as useUnmountEffect, G as IconUtils, H as ariaLabel$2, I as useUpdateEffect, J as ZIndexUtils, K as ObjectUtils, L as FilterMatchMode$2, M as useOverlayListener, N as usePrevious, O as useHandleStyle, P as useStyle, Q as __toESM, R as FilterOperator, S as Tooltip, T as SpinnerIcon, U as localeOption, V as PrimeReactContext, W as DomHandler, X as require_client, Y as classNames, Z as require_react, _ as OverlayService, b as InputNumber, c as useEditDraft, d as require_jsx_runtime, f as Button, g as CSSTransition, h as VirtualScroller, i as chartFieldCatalog, j as useMountEffect, k as useEventListener, l as FormRow, m as CheckIcon, p as Dropdown, q as UniqueComponentId, s as VariableInput, t as TestFieldDialog, u as Dialog, v as TimesIcon, w as Ripple, x as InputText, y as ChevronDownIcon, z as FilterService } from "./TestFieldDialog-Dph2oPfe.js";
|
|
2
2
|
//#region node_modules/primereact/icons/arrowdown/index.esm.js
|
|
3
3
|
var import_client = require_client();
|
|
4
4
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Q as __toESM, X as require_client, Z as require_react, a as configSourceCatalog, d as require_jsx_runtime, i as chartFieldCatalog, n as AuthoringContext, o as cycleSourceCatalog, r as boundCatalog, t as TestFieldDialog } from "./TestFieldDialog-
|
|
1
|
+
import { Q as __toESM, X as require_client, Z as require_react, a as configSourceCatalog, d as require_jsx_runtime, i as chartFieldCatalog, n as AuthoringContext, o as cycleSourceCatalog, r as boundCatalog, t as TestFieldDialog } from "./TestFieldDialog-Dph2oPfe.js";
|
|
2
2
|
//#region src/hooks/useSequenceProducers.ts
|
|
3
3
|
var import_client = require_client();
|
|
4
4
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
@@ -173,6 +173,11 @@ check('typing still works', inputIn('Source').value, 'gm.stale_binding');
|
|
|
173
173
|
|
|
174
174
|
await click(pickerButtonIn('Source'));
|
|
175
175
|
ok('the picker opened', dialogs().length > 1, `dialogs=${dialogs().length}`);
|
|
176
|
+
// The dialog is PORTALED to <body>, so it inherits nothing from the field's
|
|
177
|
+
// subtree — the token bridge in varpick.css is declared on this class, and
|
|
178
|
+
// without it every colour would fall through to its literal.
|
|
179
|
+
ok('the dialog carries the token-bridge class',
|
|
180
|
+
picker().classList.contains('ac-varpick'), picker().className);
|
|
176
181
|
ok('the sequence group is present',
|
|
177
182
|
picker().textContent.includes('Recorded by the sequence'));
|
|
178
183
|
|