@workbench-kit/shell-react 0.0.2-prototype.0.2.27 → 0.0.2-prototype.0.2.28
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/package.json +9 -9
- package/src/editor/view-providers.tsx +0 -7
- package/src/field-remap/convert-note-editor.tsx +2 -4
- package/src/field-remap/convert-palette.tsx +17 -20
- package/src/field-remap/flow-adapter.ts +21 -41
- package/src/field-remap/index.ts +0 -1
- package/src/field-remap/io-class-browse.tsx +29 -6
- package/src/field-remap/jsonata-transform.ts +9 -39
- package/src/field-remap/shape-io-editor.tsx +1 -1
- package/src/field-remap/transform-options-editor.tsx +1 -2
- package/src/field-remap/view.css +4 -29
- package/src/index.ts +0 -10
- package/src/workbench/command-host.tsx +4 -2
- package/src/workbench/command-palette.ts +0 -43
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workbench-kit/shell-react",
|
|
3
|
-
"version": "0.0.2-prototype.0.2.
|
|
3
|
+
"version": "0.0.2-prototype.0.2.28",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"@radix-ui/react-slot": "^1.3.0",
|
|
32
32
|
"@xyflow/react": "^12.11.2",
|
|
33
33
|
"jsonata": "^2.2.0",
|
|
34
|
-
"@workbench-kit/
|
|
35
|
-
"@workbench-kit/
|
|
36
|
-
"@workbench-kit/
|
|
37
|
-
"@workbench-kit/workbench-config": "0.0.2-prototype.0.2.
|
|
38
|
-
"@workbench-kit/
|
|
39
|
-
"@workbench-kit/
|
|
40
|
-
"@workbench-kit/
|
|
41
|
-
"@workbench-kit/
|
|
34
|
+
"@workbench-kit/react": "0.0.2-prototype.0.2.28",
|
|
35
|
+
"@workbench-kit/tokens": "0.0.2-prototype.0.2.28",
|
|
36
|
+
"@workbench-kit/field-remap": "0.0.2-prototype.0.2.28",
|
|
37
|
+
"@workbench-kit/workbench-config": "0.0.2-prototype.0.2.28",
|
|
38
|
+
"@workbench-kit/workbench-extension-sdk": "0.0.2-prototype.0.2.28",
|
|
39
|
+
"@workbench-kit/platform": "0.0.2-prototype.0.2.28",
|
|
40
|
+
"@workbench-kit/workspace": "0.0.2-prototype.0.2.28",
|
|
41
|
+
"@workbench-kit/workbench-core": "0.0.2-prototype.0.2.28"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"react": "^19.0.0",
|
|
@@ -38,13 +38,6 @@ export interface ResolvedEditorDocumentViews {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export const JSON_FORM_PROVIDER_ID = 'workbench-kit.editor.form.json' as const;
|
|
41
|
-
/** @deprecated Prefer `workbench-kit.samples.jdw.widget-form` from samples.jdw. */
|
|
42
|
-
export const JDW_WIDGET_FORM_PROVIDER_ID = 'workbench-kit.samples.jdw.widget-form' as const;
|
|
43
|
-
/** @deprecated Prefer `workbench-kit.samples.jdw.widget-preview` from samples.jdw. */
|
|
44
|
-
export const JDW_PREVIEW_PROVIDER_ID = 'workbench-kit.samples.jdw.widget-preview' as const;
|
|
45
|
-
/** @deprecated Prefer `workbench-kit.builtin.editor.markdown-preview` from builtin.editor. */
|
|
46
|
-
export const MARKDOWN_PREVIEW_PROVIDER_ID =
|
|
47
|
-
'workbench-kit.builtin.editor.markdown-preview' as const;
|
|
48
41
|
|
|
49
42
|
/**
|
|
50
43
|
* Opt-in shallow top-level JSON object form.
|
|
@@ -57,10 +57,8 @@ export function ConvertNoteEditor({
|
|
|
57
57
|
if (!transformId) {
|
|
58
58
|
return {};
|
|
59
59
|
}
|
|
60
|
-
return (
|
|
61
|
-
|
|
62
|
-
);
|
|
63
|
-
}, [chain, edge.transformOptionSteps, edge.transformOptions, stepIndex, transformId]);
|
|
60
|
+
return resolveOptionSteps(chain, edge.transformOptionSteps)[stepIndex] ?? {};
|
|
61
|
+
}, [chain, edge.transformOptionSteps, stepIndex, transformId]);
|
|
64
62
|
|
|
65
63
|
const replaceCatalog = listCompatibleTransforms({
|
|
66
64
|
registry: transforms,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { JSX } from 'react';
|
|
2
|
+
import { SideBarList, SideBarListItem } from '@workbench-kit/react/layout';
|
|
2
3
|
import { Button } from '@workbench-kit/react/primitives';
|
|
3
4
|
import type { ValueTransformRegistry } from '@workbench-kit/field-remap';
|
|
4
5
|
|
|
@@ -59,7 +60,7 @@ export function FieldRemapConvertPalette({
|
|
|
59
60
|
</Button>
|
|
60
61
|
</div>
|
|
61
62
|
|
|
62
|
-
<
|
|
63
|
+
<SideBarList
|
|
63
64
|
className="workbench-field-remap-convert-palette__list"
|
|
64
65
|
role="listbox"
|
|
65
66
|
aria-label={chromeLabels.convertsListAriaLabel}
|
|
@@ -67,27 +68,23 @@ export function FieldRemapConvertPalette({
|
|
|
67
68
|
{catalog.map((definition) => {
|
|
68
69
|
const selected = definition.id === selectedTransformId;
|
|
69
70
|
return (
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<strong>{definition.label}</strong>
|
|
85
|
-
<code>{definition.id}</code>
|
|
86
|
-
</button>
|
|
87
|
-
</li>
|
|
71
|
+
<SideBarListItem
|
|
72
|
+
key={definition.id}
|
|
73
|
+
aria-selected={selected}
|
|
74
|
+
data-testid={`field-remap-palette-item-${definition.id}`}
|
|
75
|
+
role="option"
|
|
76
|
+
selected={selected}
|
|
77
|
+
variant="stacked"
|
|
78
|
+
wrapperProps={{ role: 'presentation' }}
|
|
79
|
+
onClick={() => onSelectedTransformIdChange(definition.id)}
|
|
80
|
+
onDoubleClick={() => onPlaceDraft(definition.id)}
|
|
81
|
+
>
|
|
82
|
+
<strong>{definition.label}</strong>
|
|
83
|
+
<code title={definition.id}>{definition.id}</code>
|
|
84
|
+
</SideBarListItem>
|
|
88
85
|
);
|
|
89
86
|
})}
|
|
90
|
-
</
|
|
87
|
+
</SideBarList>
|
|
91
88
|
|
|
92
89
|
{onAddCombine || onAddSplit ? (
|
|
93
90
|
<div
|
|
@@ -462,28 +462,21 @@ function resolveConnectionPortIds(connection: {
|
|
|
462
462
|
return {};
|
|
463
463
|
}
|
|
464
464
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
targetSlotId = connection.targetHandle;
|
|
476
|
-
} else if (target.startsWith('tgt:')) {
|
|
477
|
-
targetSlotId = target.slice('tgt:'.length);
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
return { sourceFieldId, targetSlotId };
|
|
465
|
+
return {
|
|
466
|
+
sourceFieldId:
|
|
467
|
+
source === SOURCE_OBJECT_NODE_ID && connection.sourceHandle
|
|
468
|
+
? connection.sourceHandle
|
|
469
|
+
: undefined,
|
|
470
|
+
targetSlotId:
|
|
471
|
+
target === TARGET_OBJECT_NODE_ID && connection.targetHandle
|
|
472
|
+
? connection.targetHandle
|
|
473
|
+
: undefined,
|
|
474
|
+
};
|
|
481
475
|
}
|
|
482
476
|
|
|
483
477
|
/**
|
|
484
478
|
* Supported connect matrix for state-changing canvas drags:
|
|
485
479
|
* - source-object port → target-object port (creates / replaces a `MappingEdge`)
|
|
486
|
-
* - legacy `src:*` → `tgt:*` single-field node ids (tests / older graphs)
|
|
487
480
|
* - source-object port → `draft:*` (bind draft input)
|
|
488
481
|
* - `draft:*` → target-object port (bind draft output; finalize when both ends set)
|
|
489
482
|
* - source-object port → `xf:*` `in` (rebind source; splice off earlier steps)
|
|
@@ -640,13 +633,10 @@ export function isValidFieldRemapFlowConnection(
|
|
|
640
633
|
});
|
|
641
634
|
}
|
|
642
635
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
// Legacy single-field node ids (older graphs / tests).
|
|
648
|
-
topologyOk = true;
|
|
649
|
-
}
|
|
636
|
+
const topologyOk =
|
|
637
|
+
source === SOURCE_OBJECT_NODE_ID &&
|
|
638
|
+
target === TARGET_OBJECT_NODE_ID &&
|
|
639
|
+
Boolean(connection.sourceHandle && connection.targetHandle);
|
|
650
640
|
|
|
651
641
|
if (!topologyOk) {
|
|
652
642
|
return false;
|
|
@@ -680,7 +670,7 @@ export type FieldRemapFlowConnectResult = {
|
|
|
680
670
|
readonly removeEdgeIds?: readonly string[];
|
|
681
671
|
};
|
|
682
672
|
|
|
683
|
-
/** Parse React Flow
|
|
673
|
+
/** Parse a React Flow object-port connection into a kit MappingEdge. */
|
|
684
674
|
export function connectionToMappingEdge(input: {
|
|
685
675
|
readonly sourceNodeId: string;
|
|
686
676
|
readonly targetNodeId: string;
|
|
@@ -688,21 +678,12 @@ export function connectionToMappingEdge(input: {
|
|
|
688
678
|
readonly targetHandle?: string | null;
|
|
689
679
|
readonly existing: readonly MappingEdge[];
|
|
690
680
|
}): MappingEdge | null {
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
}
|
|
697
|
-
// Legacy single-field node ids (older graphs / tests).
|
|
698
|
-
sourceFieldId = input.sourceNodeId.slice('src:'.length);
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
if (input.targetNodeId === TARGET_OBJECT_NODE_ID && input.targetHandle) {
|
|
702
|
-
targetSlotId = input.targetHandle;
|
|
703
|
-
} else if (input.targetNodeId.startsWith('tgt:')) {
|
|
704
|
-
targetSlotId = input.targetNodeId.slice('tgt:'.length);
|
|
705
|
-
}
|
|
681
|
+
const { sourceFieldId, targetSlotId } = resolveConnectionPortIds({
|
|
682
|
+
source: input.sourceNodeId,
|
|
683
|
+
target: input.targetNodeId,
|
|
684
|
+
sourceHandle: input.sourceHandle,
|
|
685
|
+
targetHandle: input.targetHandle,
|
|
686
|
+
});
|
|
706
687
|
|
|
707
688
|
if (!sourceFieldId || !targetSlotId) {
|
|
708
689
|
return null;
|
|
@@ -811,7 +792,6 @@ export function applyFieldRemapFlowConnection(input: {
|
|
|
811
792
|
itemEdges: undefined,
|
|
812
793
|
itemTransformIds: undefined,
|
|
813
794
|
itemTransformOptionSteps: undefined,
|
|
814
|
-
itemTransformOptions: undefined,
|
|
815
795
|
},
|
|
816
796
|
removeEdgeIds: [edgeA.id],
|
|
817
797
|
};
|
package/src/field-remap/index.ts
CHANGED
|
@@ -20,6 +20,10 @@ export interface FieldRemapIoClassBrowseProps {
|
|
|
20
20
|
readonly targetsTitle?: string;
|
|
21
21
|
readonly className?: string;
|
|
22
22
|
readonly emptyLabel?: string;
|
|
23
|
+
readonly labels?: {
|
|
24
|
+
readonly hiddenBadge?: string;
|
|
25
|
+
readonly classRefTitle?: string;
|
|
26
|
+
};
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
export function resolveFieldRemapIoChrome(
|
|
@@ -39,9 +43,11 @@ function formatClassRef(classRef: { readonly id: string; readonly version: numbe
|
|
|
39
43
|
function FieldTree({
|
|
40
44
|
nodes,
|
|
41
45
|
emptyLabel,
|
|
46
|
+
labels,
|
|
42
47
|
}: {
|
|
43
48
|
readonly nodes: readonly (SourceField | TargetSlot)[];
|
|
44
49
|
readonly emptyLabel: string;
|
|
50
|
+
readonly labels: FieldRemapIoClassBrowseProps['labels'];
|
|
45
51
|
}): JSX.Element {
|
|
46
52
|
if (nodes.length === 0) {
|
|
47
53
|
return <p className="workbench-field-remap-io-browse__empty">{emptyLabel}</p>;
|
|
@@ -55,19 +61,22 @@ function FieldTree({
|
|
|
55
61
|
<span className="workbench-field-remap-io-browse__meta">
|
|
56
62
|
{node.dataType ? <span>{node.dataType}</span> : null}
|
|
57
63
|
{node.classRef ? (
|
|
58
|
-
<span
|
|
64
|
+
<span
|
|
65
|
+
className="workbench-field-remap-io-browse__badge"
|
|
66
|
+
title={labels?.classRefTitle ?? 'classRef'}
|
|
67
|
+
>
|
|
59
68
|
{formatClassRef(node.classRef)}
|
|
60
69
|
</span>
|
|
61
70
|
) : null}
|
|
62
71
|
{node.hidden === true ? (
|
|
63
72
|
<span className="workbench-field-remap-io-browse__badge" title="hidden">
|
|
64
|
-
Hidden
|
|
73
|
+
{labels?.hiddenBadge ?? 'Hidden'}
|
|
65
74
|
</span>
|
|
66
75
|
) : null}
|
|
67
76
|
</span>
|
|
68
77
|
</div>
|
|
69
78
|
{node.children?.length ? (
|
|
70
|
-
<FieldTree emptyLabel={emptyLabel} nodes={node.children} />
|
|
79
|
+
<FieldTree emptyLabel={emptyLabel} labels={labels} nodes={node.children} />
|
|
71
80
|
) : null}
|
|
72
81
|
</li>
|
|
73
82
|
))}
|
|
@@ -79,10 +88,12 @@ function PortSection({
|
|
|
79
88
|
title,
|
|
80
89
|
nodes,
|
|
81
90
|
emptyLabel,
|
|
91
|
+
labels,
|
|
82
92
|
}: {
|
|
83
93
|
readonly title: string;
|
|
84
94
|
readonly nodes: readonly (SourceField | TargetSlot)[];
|
|
85
95
|
readonly emptyLabel: string;
|
|
96
|
+
readonly labels: FieldRemapIoClassBrowseProps['labels'];
|
|
86
97
|
}): JSX.Element {
|
|
87
98
|
return (
|
|
88
99
|
<section aria-label={title} className="workbench-field-remap-io-browse__section">
|
|
@@ -96,11 +107,12 @@ function PortSection({
|
|
|
96
107
|
<span className="workbench-field-remap-io-browse__port-id">{node.label}</span>
|
|
97
108
|
<span className="workbench-field-remap-io-browse__port-meta">
|
|
98
109
|
{node.classRef ? formatClassRef(node.classRef) : node.id}
|
|
99
|
-
{node.hidden === true ?
|
|
110
|
+
{node.hidden === true ? ` · ${labels?.hiddenBadge ?? 'Hidden'}` : ''}
|
|
100
111
|
</span>
|
|
101
112
|
</p>
|
|
102
113
|
<FieldTree
|
|
103
114
|
emptyLabel={emptyLabel}
|
|
115
|
+
labels={labels}
|
|
104
116
|
nodes={node.children?.length ? node.children : [node]}
|
|
105
117
|
/>
|
|
106
118
|
</div>
|
|
@@ -123,6 +135,7 @@ export function FieldRemapIoClassBrowse({
|
|
|
123
135
|
targetsTitle = 'Outputs',
|
|
124
136
|
className,
|
|
125
137
|
emptyLabel = 'No fields',
|
|
138
|
+
labels,
|
|
126
139
|
}: FieldRemapIoClassBrowseProps): JSX.Element {
|
|
127
140
|
const projectedSources = useMemo(
|
|
128
141
|
() => projectSourceFields(sources, { includeHidden }),
|
|
@@ -138,8 +151,18 @@ export function FieldRemapIoClassBrowse({
|
|
|
138
151
|
className={['workbench-field-remap-io-browse', className].filter(Boolean).join(' ')}
|
|
139
152
|
data-testid="field-remap-io-browse"
|
|
140
153
|
>
|
|
141
|
-
<PortSection
|
|
142
|
-
|
|
154
|
+
<PortSection
|
|
155
|
+
emptyLabel={emptyLabel}
|
|
156
|
+
labels={labels}
|
|
157
|
+
nodes={projectedSources}
|
|
158
|
+
title={sourcesTitle}
|
|
159
|
+
/>
|
|
160
|
+
<PortSection
|
|
161
|
+
emptyLabel={emptyLabel}
|
|
162
|
+
labels={labels}
|
|
163
|
+
nodes={projectedTargets}
|
|
164
|
+
title={targetsTitle}
|
|
165
|
+
/>
|
|
143
166
|
</div>
|
|
144
167
|
);
|
|
145
168
|
}
|
|
@@ -10,8 +10,6 @@ export const DEFAULT_JSONATA_TIMEOUT_MS = 2_000;
|
|
|
10
10
|
/** Default maximum expression source length (characters). */
|
|
11
11
|
export const DEFAULT_JSONATA_MAX_EXPRESSION_LENGTH = 4_096;
|
|
12
12
|
|
|
13
|
-
export type JsonataTransformErrorPolicy = 'passthrough' | 'throw';
|
|
14
|
-
|
|
15
13
|
export interface CreateJsonataValueTransformOptions {
|
|
16
14
|
/** Wall-clock timeout for `evaluate` (default {@link DEFAULT_JSONATA_TIMEOUT_MS}). */
|
|
17
15
|
readonly timeoutMs?: number;
|
|
@@ -20,11 +18,6 @@ export interface CreateJsonataValueTransformOptions {
|
|
|
20
18
|
* (default {@link DEFAULT_JSONATA_MAX_EXPRESSION_LENGTH}).
|
|
21
19
|
*/
|
|
22
20
|
readonly maxExpressionLength?: number;
|
|
23
|
-
/**
|
|
24
|
-
* - `throw` (default): surface timeout / compile / evaluate failures to the host
|
|
25
|
-
* - `passthrough`: return the original value (legacy silent identity)
|
|
26
|
-
*/
|
|
27
|
-
readonly onError?: JsonataTransformErrorPolicy;
|
|
28
21
|
}
|
|
29
22
|
|
|
30
23
|
export function createJsonataValueTransform(
|
|
@@ -32,7 +25,6 @@ export function createJsonataValueTransform(
|
|
|
32
25
|
): ValueTransformDefinition {
|
|
33
26
|
const timeoutMs = options.timeoutMs ?? DEFAULT_JSONATA_TIMEOUT_MS;
|
|
34
27
|
const maxExpressionLength = options.maxExpressionLength ?? DEFAULT_JSONATA_MAX_EXPRESSION_LENGTH;
|
|
35
|
-
const onError = options.onError ?? 'throw';
|
|
36
28
|
|
|
37
29
|
return {
|
|
38
30
|
id: JSONATA_TRANSFORM_ID,
|
|
@@ -57,30 +49,22 @@ export function createJsonataValueTransform(
|
|
|
57
49
|
}
|
|
58
50
|
|
|
59
51
|
if (expression.length > maxExpressionLength) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
`JSONata expression exceeds max length (${expression.length} > ${maxExpressionLength}).`,
|
|
63
|
-
),
|
|
64
|
-
value,
|
|
65
|
-
onError,
|
|
52
|
+
throw new Error(
|
|
53
|
+
`JSONata expression exceeds max length (${expression.length} > ${maxExpressionLength}).`,
|
|
66
54
|
);
|
|
67
55
|
}
|
|
68
56
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
});
|
|
76
|
-
} catch (error) {
|
|
77
|
-
return handleJsonataError(error, value, onError);
|
|
78
|
-
}
|
|
57
|
+
const compiled = jsonata(expression);
|
|
58
|
+
// jsonata@2.x evaluate returns a Promise (1.x was synchronous).
|
|
59
|
+
return await raceJsonataEvaluation(compiled.evaluate(value), {
|
|
60
|
+
timeoutMs,
|
|
61
|
+
signal: context.signal,
|
|
62
|
+
});
|
|
79
63
|
},
|
|
80
64
|
};
|
|
81
65
|
}
|
|
82
66
|
|
|
83
|
-
/** Default bounded transform (
|
|
67
|
+
/** Default bounded transform (2s timeout, 4k expression cap). */
|
|
84
68
|
export const jsonataValueTransform: ValueTransformDefinition = createJsonataValueTransform();
|
|
85
69
|
|
|
86
70
|
export class JsonataTransformTimeoutError extends Error {
|
|
@@ -150,17 +134,3 @@ export async function raceJsonataEvaluation<T>(
|
|
|
150
134
|
);
|
|
151
135
|
});
|
|
152
136
|
}
|
|
153
|
-
|
|
154
|
-
function handleJsonataError(
|
|
155
|
-
error: unknown,
|
|
156
|
-
value: unknown,
|
|
157
|
-
onError: JsonataTransformErrorPolicy,
|
|
158
|
-
): unknown {
|
|
159
|
-
if (onError === 'passthrough') {
|
|
160
|
-
return value;
|
|
161
|
-
}
|
|
162
|
-
if (error instanceof Error) {
|
|
163
|
-
throw error;
|
|
164
|
-
}
|
|
165
|
-
throw new Error(String(error));
|
|
166
|
-
}
|
|
@@ -34,7 +34,7 @@ function formatJson(value: unknown): string {
|
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Host-owned shape IO surface: paste JSON → ingest fields/slots, edit FieldDataType.
|
|
37
|
-
* Persistence stays host-owned (`FieldRemapDocument`
|
|
37
|
+
* Persistence stays host-owned (`FieldRemapDocument` stores mappings, not shapes).
|
|
38
38
|
*/
|
|
39
39
|
export function FieldRemapShapeIoEditor({
|
|
40
40
|
role,
|
|
@@ -195,8 +195,7 @@ function JsonOptionEditor({
|
|
|
195
195
|
|
|
196
196
|
/**
|
|
197
197
|
* Presentational editor for `TransformOptionField` kinds (string / number / boolean /
|
|
198
|
-
* stringMap / json). Emits
|
|
199
|
-
* `patchOptionStep` / `sanitizeOptionRecord`.
|
|
198
|
+
* stringMap / json). Emits the full options record for one transform step.
|
|
200
199
|
*/
|
|
201
200
|
export function TransformOptionsEditor({
|
|
202
201
|
fields,
|
package/src/field-remap/view.css
CHANGED
|
@@ -365,41 +365,16 @@
|
|
|
365
365
|
}
|
|
366
366
|
|
|
367
367
|
.workbench-field-remap-convert-palette__list {
|
|
368
|
-
list-style: none;
|
|
369
|
-
margin: 0;
|
|
370
|
-
padding: 0;
|
|
371
|
-
display: flex;
|
|
372
368
|
flex: 1 1 auto;
|
|
373
|
-
flex-direction: column;
|
|
374
|
-
gap: 0.35rem;
|
|
375
369
|
min-height: 0;
|
|
376
370
|
overflow: auto;
|
|
377
371
|
}
|
|
378
372
|
|
|
379
|
-
.workbench-field-remap-convert-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
gap: 0.15rem;
|
|
384
|
-
width: 100%;
|
|
385
|
-
margin: 0;
|
|
386
|
-
padding: 0.45rem 0.5rem;
|
|
387
|
-
border: 1px solid var(--vscode-panel-border, var(--color-border));
|
|
388
|
-
border-radius: 0.25rem;
|
|
389
|
-
background: var(--vscode-editor-background, var(--color-bg));
|
|
390
|
-
color: inherit;
|
|
391
|
-
text-align: left;
|
|
392
|
-
cursor: pointer;
|
|
393
|
-
font: inherit;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
.workbench-field-remap-convert-palette__item.is-selected {
|
|
397
|
-
border-color: var(--vscode-focusBorder, var(--color-accent, #3794ff));
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
.workbench-field-remap-convert-palette__item code {
|
|
373
|
+
.workbench-field-remap-convert-palette__list code {
|
|
374
|
+
overflow: hidden;
|
|
375
|
+
text-overflow: ellipsis;
|
|
376
|
+
white-space: nowrap;
|
|
401
377
|
font-size: 0.7rem;
|
|
402
|
-
word-break: break-all;
|
|
403
378
|
}
|
|
404
379
|
|
|
405
380
|
.workbench-field-remap-convert-palette__operators {
|
package/src/index.ts
CHANGED
|
@@ -63,11 +63,8 @@ export { EditorArea, type EditorAreaProps, type EditorViewMode } from './editor/
|
|
|
63
63
|
export {
|
|
64
64
|
DEFAULT_EDITOR_DOCUMENT_VIEW_PROVIDERS,
|
|
65
65
|
EditorDocumentViewProviderRegistry,
|
|
66
|
-
JDW_PREVIEW_PROVIDER_ID,
|
|
67
|
-
JDW_WIDGET_FORM_PROVIDER_ID,
|
|
68
66
|
JSON_FORM_PROVIDER,
|
|
69
67
|
JSON_FORM_PROVIDER_ID,
|
|
70
|
-
MARKDOWN_PREVIEW_PROVIDER_ID,
|
|
71
68
|
createEditorDocumentViewProviderRegistry,
|
|
72
69
|
resolveEditorDocumentViewProvider,
|
|
73
70
|
resolveEditorDocumentViews,
|
|
@@ -182,7 +179,6 @@ export {
|
|
|
182
179
|
createJsonataValueTransform,
|
|
183
180
|
jsonataValueTransform,
|
|
184
181
|
type CreateJsonataValueTransformOptions,
|
|
185
|
-
type JsonataTransformErrorPolicy,
|
|
186
182
|
} from './field-remap/jsonata-transform.js';
|
|
187
183
|
export {
|
|
188
184
|
FIELD_REMAP_SAMPLES,
|
|
@@ -216,13 +212,7 @@ export {
|
|
|
216
212
|
type WorkbenchThemeOption,
|
|
217
213
|
} from './shell/shell.js';
|
|
218
214
|
export {
|
|
219
|
-
getWorkbenchCommandPaletteShortcutLabel,
|
|
220
|
-
getWorkbenchQuickAccessShortcutLabel,
|
|
221
|
-
WORKBENCH_COMMAND_PALETTE_SHORTCUT,
|
|
222
|
-
WORKBENCH_QUICK_ACCESS_SHORTCUT,
|
|
223
215
|
buildWorkbenchPaletteCommands,
|
|
224
|
-
matchesWorkbenchCommandPaletteShortcut,
|
|
225
|
-
matchesWorkbenchQuickAccessShortcut,
|
|
226
216
|
mergeWorkbenchCommandDescriptors,
|
|
227
217
|
resolveShellCommandActivities,
|
|
228
218
|
} from './workbench/command-palette.js';
|
|
@@ -16,6 +16,10 @@ import {
|
|
|
16
16
|
type WorkbenchCommandRunContext,
|
|
17
17
|
type WorkbenchShellCommandContext,
|
|
18
18
|
} from '@workbench-kit/react/workbench';
|
|
19
|
+
import {
|
|
20
|
+
matchesWorkbenchCommandPaletteShortcut,
|
|
21
|
+
matchesWorkbenchQuickAccessShortcut,
|
|
22
|
+
} from '@workbench-kit/react/workbench/command-ui';
|
|
19
23
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
20
24
|
|
|
21
25
|
import { useContextKeyRevision } from '../commands/use-context-key-revision.js';
|
|
@@ -24,8 +28,6 @@ import { registerWorkbenchShellCommandHandlers } from './shell-command-registrat
|
|
|
24
28
|
import {
|
|
25
29
|
buildWorkbenchPaletteCommands,
|
|
26
30
|
collectExtensionCommandFeaturesById,
|
|
27
|
-
matchesWorkbenchCommandPaletteShortcut,
|
|
28
|
-
matchesWorkbenchQuickAccessShortcut,
|
|
29
31
|
resolveShellCommandActivities,
|
|
30
32
|
} from './command-palette.js';
|
|
31
33
|
import { resolveExtensionKeybindingCommand } from './keybinding-bridge.js';
|
|
@@ -10,9 +10,6 @@ import {
|
|
|
10
10
|
type ExtensionRegistry,
|
|
11
11
|
} from '@workbench-kit/workbench-core';
|
|
12
12
|
|
|
13
|
-
export const WORKBENCH_COMMAND_PALETTE_SHORTCUT = 'Ctrl+Shift+P';
|
|
14
|
-
export const WORKBENCH_QUICK_ACCESS_SHORTCUT = 'Ctrl+P';
|
|
15
|
-
|
|
16
13
|
type ExtensionCommand = ReturnType<ExtensionRegistry['commands']['getCommands']>[number];
|
|
17
14
|
|
|
18
15
|
function resolveCommandValue<TContext, TValue>(
|
|
@@ -176,43 +173,3 @@ export function buildWorkbenchPaletteCommands({
|
|
|
176
173
|
...additionalCommands,
|
|
177
174
|
]);
|
|
178
175
|
}
|
|
179
|
-
|
|
180
|
-
export function matchesWorkbenchCommandPaletteShortcut(
|
|
181
|
-
event: Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'key' | 'metaKey' | 'shiftKey'>,
|
|
182
|
-
) {
|
|
183
|
-
const key = event.key.toLowerCase();
|
|
184
|
-
|
|
185
|
-
if (key !== 'p') {
|
|
186
|
-
return false;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (!(event.ctrlKey || event.metaKey) || !event.shiftKey || event.altKey) {
|
|
190
|
-
return false;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
export function matchesWorkbenchQuickAccessShortcut(
|
|
197
|
-
event: Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'key' | 'metaKey' | 'shiftKey'>,
|
|
198
|
-
) {
|
|
199
|
-
const key = event.key.toLowerCase();
|
|
200
|
-
|
|
201
|
-
if (key !== 'p') {
|
|
202
|
-
return false;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
if (!(event.ctrlKey || event.metaKey) || event.shiftKey || event.altKey) {
|
|
206
|
-
return false;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
return true;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
export function getWorkbenchCommandPaletteShortcutLabel() {
|
|
213
|
-
return WORKBENCH_COMMAND_PALETTE_SHORTCUT;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
export function getWorkbenchQuickAccessShortcutLabel() {
|
|
217
|
-
return WORKBENCH_QUICK_ACCESS_SHORTCUT;
|
|
218
|
-
}
|