treege 3.0.0-beta.66 → 3.0.0-beta.68

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.
@@ -0,0 +1,13 @@
1
+ interface FieldRef {
2
+ nodeId: string;
3
+ label: string;
4
+ }
5
+ interface JsonTemplateEditorProps {
6
+ /** The raw JSON template string (source of truth). */
7
+ value: string;
8
+ onChange: (next: string) => void;
9
+ /** Fields that can be bound to a key or value. */
10
+ fields: FieldRef[];
11
+ }
12
+ declare const JsonTemplateEditor: ({ value, onChange, fields }: JsonTemplateEditorProps) => import("react/jsx-runtime").JSX.Element;
13
+ export default JsonTemplateEditor;
@@ -0,0 +1,15 @@
1
+ import { EditorState } from '@codemirror/state';
2
+ export interface JsonBindTarget {
3
+ /** Start offset of the key/value node to replace. */
4
+ from: number;
5
+ /** End offset of the key/value node to replace. */
6
+ to: number;
7
+ /** Whether the node is already a `{{token}}` (so the menu can offer "unbind"). */
8
+ isToken: boolean;
9
+ }
10
+ /**
11
+ * Find the JSON key or value node under `pos`, so a click there can bind a
12
+ * field. Returns the range to replace and whether it is already a token, or
13
+ * `null` when `pos` is not on a key/value (e.g. on punctuation/whitespace).
14
+ */
15
+ export declare const findJsonBindTargetAt: (state: EditorState, pos: number) => JsonBindTarget | null;