@pixerate/editor 0.268.2 → 0.269.0
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/agent/index.cjs +27 -27
- package/dist/agent/index.js +1 -1
- package/dist/animation-editor/index.cjs +61 -61
- package/dist/animation-editor/index.js +5 -5
- package/dist/brushes/import/abr.d.cts +48 -0
- package/dist/brushes/import/abr.d.ts +48 -0
- package/dist/brushes/import/bplist.d.cts +24 -0
- package/dist/brushes/import/bplist.d.ts +24 -0
- package/dist/brushes/import/pack.d.cts +82 -0
- package/dist/brushes/import/pack.d.ts +82 -0
- package/dist/brushes/import/zip.d.cts +31 -0
- package/dist/brushes/import/zip.d.ts +31 -0
- package/dist/brushes/index.cjs +26 -6
- package/dist/brushes/index.d.cts +2 -0
- package/dist/brushes/index.d.ts +2 -0
- package/dist/brushes/index.js +22 -2
- package/dist/{chunk-SIFAIGB3.js → chunk-3AJCEJNH.js} +2 -162
- package/dist/{chunk-YXP6X3SY.cjs → chunk-3KNQ2W6X.cjs} +697 -10
- package/dist/{chunk-QNY7BDFP.js → chunk-4CPOKP27.js} +1 -1
- package/dist/{chunk-J4GXP53R.cjs → chunk-4NMPUJUK.cjs} +86 -86
- package/dist/{chunk-LDOD7VCT.js → chunk-4YSPQGZW.js} +1 -1
- package/dist/{chunk-JBB3GDBB.cjs → chunk-56RHCIJV.cjs} +2 -2
- package/dist/{chunk-4IMD2TLY.cjs → chunk-AI4F33IV.cjs} +3166 -2966
- package/dist/{chunk-YOVXQHA3.cjs → chunk-BENSE3VX.cjs} +23 -23
- package/dist/{chunk-VDGBHYC7.js → chunk-F7OO3DHP.js} +157 -1
- package/dist/{chunk-UVTO3D4E.js → chunk-FUDP5QBB.js} +1 -1
- package/dist/{chunk-3XDSNIGF.js → chunk-ININNHLM.js} +687 -0
- package/dist/{chunk-WIC7TG73.cjs → chunk-M4UQA2T4.cjs} +18 -18
- package/dist/{chunk-ITURMC2M.js → chunk-N3UMQVKX.js} +176 -176
- package/dist/{chunk-UWEQ55MY.cjs → chunk-N4KP3UQR.cjs} +157 -1
- package/dist/{chunk-D5BXSOSU.js → chunk-QGVTOCNB.js} +3118 -2918
- package/dist/{chunk-M6DNZNVY.js → chunk-RWDSSK2I.js} +4 -2
- package/dist/{chunk-CVFAAZXE.cjs → chunk-SPIO2GJU.cjs} +8 -6
- package/dist/{chunk-RHEMMGCN.cjs → chunk-T4JPGBW3.cjs} +173 -173
- package/dist/{chunk-HFY5LG5J.js → chunk-THBJHPUL.js} +1 -1
- package/dist/{chunk-NPWWSCWT.cjs → chunk-VBRHE4AM.cjs} +35 -35
- package/dist/{chunk-AZC2NDAR.js → chunk-WB22XMW3.js} +6 -6
- package/dist/{chunk-NIBFDFYW.cjs → chunk-YBMUHIOM.cjs} +12 -172
- package/dist/extensions/index.cjs +18 -4
- package/dist/extensions/index.d.cts +1 -0
- package/dist/extensions/index.d.ts +1 -0
- package/dist/extensions/index.js +17 -3
- package/dist/extensions/prompt-editor.d.cts +109 -0
- package/dist/extensions/prompt-editor.d.ts +109 -0
- package/dist/generation/index.cjs +15 -15
- package/dist/generation/index.js +3 -3
- package/dist/grammar/index.cjs +4 -4
- package/dist/grammar/index.js +7 -7
- package/dist/image-editor/index.cjs +785 -785
- package/dist/image-editor/index.js +6 -6
- package/dist/index.cjs +27 -13
- package/dist/index.js +23 -9
- package/dist/paint-editor/index.cjs +91 -91
- package/dist/paint-editor/index.js +6 -6
- package/dist/vector/index.cjs +1001 -1001
- package/dist/vector/index.js +6 -6
- package/package.json +1 -1
package/dist/extensions/index.js
CHANGED
|
@@ -22,6 +22,8 @@ import {
|
|
|
22
22
|
Markdown,
|
|
23
23
|
Mention,
|
|
24
24
|
Outline,
|
|
25
|
+
PROMPT_EDITOR_DEFAULT_CLASS_NAME,
|
|
26
|
+
PROMPT_EDITOR_DEFAULT_PLACEHOLDER,
|
|
25
27
|
ParagraphStyles,
|
|
26
28
|
RichClipboard,
|
|
27
29
|
SMILIE_REPLACEMENTS,
|
|
@@ -41,6 +43,7 @@ import {
|
|
|
41
43
|
createMentionExtension,
|
|
42
44
|
createOutlineStore,
|
|
43
45
|
createParagraphStylesStore,
|
|
46
|
+
createPromptEditorOptions,
|
|
44
47
|
createRichTextPreset,
|
|
45
48
|
createTableCommands,
|
|
46
49
|
crossReferencePluginKey,
|
|
@@ -75,20 +78,24 @@ import {
|
|
|
75
78
|
navigateToHeading,
|
|
76
79
|
outlinePluginKey,
|
|
77
80
|
paragraphStylesPluginKey,
|
|
81
|
+
promptEditorConfigKey,
|
|
82
|
+
promptMilestones,
|
|
78
83
|
removeImageNode,
|
|
84
|
+
resolvePromptTemplateColorMap,
|
|
79
85
|
richClipboardPluginKey,
|
|
80
86
|
setMentionRoleAt,
|
|
81
87
|
smartQuoteRules,
|
|
82
88
|
smilieAutocorrectRules,
|
|
83
89
|
symbolRules,
|
|
84
90
|
syncFootnotes,
|
|
91
|
+
syncPromptEditor,
|
|
85
92
|
tableOfContentsMarkdownIt,
|
|
86
93
|
tableOfContentsPluginKey,
|
|
87
94
|
twoInitialCapitalsRules,
|
|
88
95
|
updateImageSrc,
|
|
89
96
|
validateFindPattern,
|
|
90
97
|
writeRichClipboard
|
|
91
|
-
} from "../chunk-
|
|
98
|
+
} from "../chunk-QGVTOCNB.js";
|
|
92
99
|
import {
|
|
93
100
|
DEFAULT_STYLES,
|
|
94
101
|
NORMAL_STYLE_ID,
|
|
@@ -172,7 +179,7 @@ import {
|
|
|
172
179
|
tableNestingPluginKey,
|
|
173
180
|
typeAgentText,
|
|
174
181
|
unnestTables
|
|
175
|
-
} from "../chunk-
|
|
182
|
+
} from "../chunk-N3UMQVKX.js";
|
|
176
183
|
import "../chunk-MQ6MGIQM.js";
|
|
177
184
|
import "../chunk-KGRZMHZB.js";
|
|
178
185
|
import "../chunk-C2WEIEUB.js";
|
|
@@ -214,7 +221,7 @@ import {
|
|
|
214
221
|
import "../chunk-II2WIF5Z.js";
|
|
215
222
|
import "../chunk-WJSD3MAZ.js";
|
|
216
223
|
import "../chunk-CIQIM2IP.js";
|
|
217
|
-
import "../chunk-
|
|
224
|
+
import "../chunk-F7OO3DHP.js";
|
|
218
225
|
import "../chunk-HF5QZS7Z.js";
|
|
219
226
|
import "../chunk-NS62CQ2B.js";
|
|
220
227
|
import "../chunk-2EUW2XZX.js";
|
|
@@ -273,6 +280,8 @@ export {
|
|
|
273
280
|
Mention,
|
|
274
281
|
NORMAL_STYLE_ID,
|
|
275
282
|
Outline,
|
|
283
|
+
PROMPT_EDITOR_DEFAULT_CLASS_NAME,
|
|
284
|
+
PROMPT_EDITOR_DEFAULT_PLACEHOLDER,
|
|
276
285
|
ParagraphStyles,
|
|
277
286
|
RichClipboard,
|
|
278
287
|
SMILIE_REPLACEMENTS,
|
|
@@ -315,6 +324,7 @@ export {
|
|
|
315
324
|
createMentionExtension,
|
|
316
325
|
createOutlineStore,
|
|
317
326
|
createParagraphStylesStore,
|
|
327
|
+
createPromptEditorOptions,
|
|
318
328
|
createReviewId,
|
|
319
329
|
createRichTextPreset,
|
|
320
330
|
createSearchBudget,
|
|
@@ -390,8 +400,11 @@ export {
|
|
|
390
400
|
outlinePluginKey,
|
|
391
401
|
paragraphStylesPluginKey,
|
|
392
402
|
parseReplacement,
|
|
403
|
+
promptEditorConfigKey,
|
|
404
|
+
promptMilestones,
|
|
393
405
|
removeImageNode,
|
|
394
406
|
replaceWithTextTransaction,
|
|
407
|
+
resolvePromptTemplateColorMap,
|
|
395
408
|
resolveTrackedChanges,
|
|
396
409
|
richClipboardPluginKey,
|
|
397
410
|
runTableAction,
|
|
@@ -408,6 +421,7 @@ export {
|
|
|
408
421
|
staticChartSvg,
|
|
409
422
|
symbolRules,
|
|
410
423
|
syncFootnotes,
|
|
424
|
+
syncPromptEditor,
|
|
411
425
|
tableNestingPluginKey,
|
|
412
426
|
tableOfContentsMarkdownIt,
|
|
413
427
|
tableOfContentsPluginKey,
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { Editor, EditorOptions } from "@tiptap/core";
|
|
2
|
+
import type { ColorGradient, Template } from "../grammar/tokens.cjs";
|
|
3
|
+
import { type LoadingNodeViewMount } from "./loading-node.cjs";
|
|
4
|
+
import { type FileImportOptions } from "./file-import.cjs";
|
|
5
|
+
/**
|
|
6
|
+
* The framework-independent options of a prompt editor: the plain-text editor behind React's
|
|
7
|
+
* and Svelte's `usePromptEditor`. The framework bindings add their own `loadingIndicator`
|
|
8
|
+
* component on top and pass its node view to `createPromptEditorOptions`.
|
|
9
|
+
*/
|
|
10
|
+
export interface PromptEditorConfig {
|
|
11
|
+
/**
|
|
12
|
+
* The editor content as plain text. Changes from the parent (e.g. clearing
|
|
13
|
+
* after submit) are applied to the editor; echoes of the editor's own
|
|
14
|
+
* updates via `onContentChange` are ignored.
|
|
15
|
+
*/
|
|
16
|
+
content: string;
|
|
17
|
+
/** Callback fired when the editor content changes (returns plain text) */
|
|
18
|
+
onContentChange: (text: string) => void;
|
|
19
|
+
/** List of available templates to be suggested and highlighted */
|
|
20
|
+
templates?: Template[];
|
|
21
|
+
/** Custom gradient color map for templates */
|
|
22
|
+
templateColorMap?: Map<string, ColorGradient>;
|
|
23
|
+
/** Whether the editor is editable (default `true`) */
|
|
24
|
+
isEditing?: boolean;
|
|
25
|
+
/** Placeholder text for the editor */
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
/** Additional CSS classes for the editor container */
|
|
28
|
+
className?: string;
|
|
29
|
+
/** Callback fired when the Escape key is pressed */
|
|
30
|
+
onEscape?: () => void;
|
|
31
|
+
/** Custom keydown handler. Return true to prevent default behavior */
|
|
32
|
+
onKeyDown?: (event: KeyboardEvent) => boolean;
|
|
33
|
+
/** Callback fired when text selection changes */
|
|
34
|
+
onSelectionChange?: (selection: {
|
|
35
|
+
from: number;
|
|
36
|
+
to: number;
|
|
37
|
+
} | null) => void;
|
|
38
|
+
/** Callback fired when a slash command (e.g., /template) matches */
|
|
39
|
+
onSlashCommandMatch?: (match: RegExpMatchArray, from: number, to: number, coords: {
|
|
40
|
+
top: number;
|
|
41
|
+
left: number;
|
|
42
|
+
}) => void;
|
|
43
|
+
/** Callback to dismiss/clear the active slash command */
|
|
44
|
+
clearSlashCommand?: () => void;
|
|
45
|
+
/** Whether a slash command menu is currently active */
|
|
46
|
+
slashCommandActive?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Callback fired the first time each milestone is reached while the editor
|
|
49
|
+
* is mounted: `used_variable` ({variable}) and `used_magic` (__instruction__).
|
|
50
|
+
*/
|
|
51
|
+
onMilestone?: (milestone: string) => void;
|
|
52
|
+
/** DOM element ID of the container, used for positioning popovers (default `"editor-container"`) */
|
|
53
|
+
containerId?: string;
|
|
54
|
+
/** Variable names originating from structured JSON output steps */
|
|
55
|
+
jsonVariables?: string[];
|
|
56
|
+
/** Animation speed for gradient decorations (default `2`) */
|
|
57
|
+
speed?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Import text from .md, .html, .txt and .rtf files dropped onto the editor
|
|
60
|
+
* (opt-in). Content is always inserted as plain text. Pasting keeps the
|
|
61
|
+
* plain-text paste handler, so pasted files are not imported.
|
|
62
|
+
*/
|
|
63
|
+
fileImport?: Omit<FileImportOptions, "asPlainText"> | boolean;
|
|
64
|
+
/** Accessible label of loading placeholders, announced by screen readers (default `"Loading…"`). */
|
|
65
|
+
loadingLabel?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface PromptEditorOptionsExtras {
|
|
68
|
+
/** Node view drawing a framework loading indicator inside `loadingNode` placeholders. */
|
|
69
|
+
loadingNodeView?: LoadingNodeViewMount | null;
|
|
70
|
+
/**
|
|
71
|
+
* Milestones already reported. Pass the same set for the binding's lifetime so a recreated
|
|
72
|
+
* editor does not report them again (default: a new set per call).
|
|
73
|
+
*/
|
|
74
|
+
reachedMilestones?: Set<string>;
|
|
75
|
+
}
|
|
76
|
+
export declare const PROMPT_EDITOR_DEFAULT_PLACEHOLDER = "Write a prompt, use {{template}}, {variable}, or /command...";
|
|
77
|
+
export declare const PROMPT_EDITOR_DEFAULT_CLASS_NAME = "w-full border border-input rounded-md p-3 font-mono text-sm leading-relaxed focus:outline-none focus:ring-2 focus:ring-primary whitespace-pre-wrap break-words";
|
|
78
|
+
/** The gradient map a prompt editor uses: the caller's, else one default gradient per template. */
|
|
79
|
+
export declare function resolvePromptTemplateColorMap(templates?: Template[], userColorMap?: Map<string, ColorGradient>): Map<string, ColorGradient>;
|
|
80
|
+
/**
|
|
81
|
+
* A key of the options that are baked into the prompt editor's extensions. Bindings recreate
|
|
82
|
+
* the editor only when it changes; content, editability, placeholder and class names are applied
|
|
83
|
+
* to the live editor by `syncPromptEditor`. The color map and templates are keyed by value, so an
|
|
84
|
+
* inline `new Map(...)` does not recreate the editor on every render.
|
|
85
|
+
*/
|
|
86
|
+
export declare function promptEditorConfigKey(config: PromptEditorConfig, extras?: {
|
|
87
|
+
hasLoadingNodeView?: boolean;
|
|
88
|
+
}): string;
|
|
89
|
+
/** The milestones reached by `text`: `used_variable` for `{variable}`, `used_magic` for `__instruction__`. */
|
|
90
|
+
export declare function promptMilestones(text: string): string[];
|
|
91
|
+
/**
|
|
92
|
+
* TipTap `Editor` options for a plain-text prompt editor: gradient tokens, `{{template}}`
|
|
93
|
+
* autocomplete, `loadingNode` placeholders, optional file import, `/command` matching with
|
|
94
|
+
* keyboard capture while a menu is open, milestone tracking and plain-text clipboard handling.
|
|
95
|
+
*
|
|
96
|
+
* Callbacks are read through `getConfig()` when they fire, so the latest handlers are used
|
|
97
|
+
* without recreating the editor. Everything else is read once here.
|
|
98
|
+
*/
|
|
99
|
+
export declare function createPromptEditorOptions(getConfig: () => PromptEditorConfig, extras?: PromptEditorOptionsExtras): Partial<EditorOptions>;
|
|
100
|
+
/**
|
|
101
|
+
* Applies the live options of a prompt editor without recreating it: editability, content,
|
|
102
|
+
* class names and placeholder.
|
|
103
|
+
*
|
|
104
|
+
* Content is applied only when `config.content` changed since `previous` (pass the config of the
|
|
105
|
+
* last sync, or `undefined` for the first one) and differs from the editor's text, so an echo of
|
|
106
|
+
* the editor's own `onContentChange` does not reset the document or the cursor, and an
|
|
107
|
+
* unrelated prop change does not overwrite text the parent has not taken up yet.
|
|
108
|
+
*/
|
|
109
|
+
export declare function syncPromptEditor(editor: Editor, config: PromptEditorConfig, previous?: PromptEditorConfig): void;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { Editor, EditorOptions } from "@tiptap/core";
|
|
2
|
+
import type { ColorGradient, Template } from "../grammar/tokens.js";
|
|
3
|
+
import { type LoadingNodeViewMount } from "./loading-node.js";
|
|
4
|
+
import { type FileImportOptions } from "./file-import.js";
|
|
5
|
+
/**
|
|
6
|
+
* The framework-independent options of a prompt editor: the plain-text editor behind React's
|
|
7
|
+
* and Svelte's `usePromptEditor`. The framework bindings add their own `loadingIndicator`
|
|
8
|
+
* component on top and pass its node view to `createPromptEditorOptions`.
|
|
9
|
+
*/
|
|
10
|
+
export interface PromptEditorConfig {
|
|
11
|
+
/**
|
|
12
|
+
* The editor content as plain text. Changes from the parent (e.g. clearing
|
|
13
|
+
* after submit) are applied to the editor; echoes of the editor's own
|
|
14
|
+
* updates via `onContentChange` are ignored.
|
|
15
|
+
*/
|
|
16
|
+
content: string;
|
|
17
|
+
/** Callback fired when the editor content changes (returns plain text) */
|
|
18
|
+
onContentChange: (text: string) => void;
|
|
19
|
+
/** List of available templates to be suggested and highlighted */
|
|
20
|
+
templates?: Template[];
|
|
21
|
+
/** Custom gradient color map for templates */
|
|
22
|
+
templateColorMap?: Map<string, ColorGradient>;
|
|
23
|
+
/** Whether the editor is editable (default `true`) */
|
|
24
|
+
isEditing?: boolean;
|
|
25
|
+
/** Placeholder text for the editor */
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
/** Additional CSS classes for the editor container */
|
|
28
|
+
className?: string;
|
|
29
|
+
/** Callback fired when the Escape key is pressed */
|
|
30
|
+
onEscape?: () => void;
|
|
31
|
+
/** Custom keydown handler. Return true to prevent default behavior */
|
|
32
|
+
onKeyDown?: (event: KeyboardEvent) => boolean;
|
|
33
|
+
/** Callback fired when text selection changes */
|
|
34
|
+
onSelectionChange?: (selection: {
|
|
35
|
+
from: number;
|
|
36
|
+
to: number;
|
|
37
|
+
} | null) => void;
|
|
38
|
+
/** Callback fired when a slash command (e.g., /template) matches */
|
|
39
|
+
onSlashCommandMatch?: (match: RegExpMatchArray, from: number, to: number, coords: {
|
|
40
|
+
top: number;
|
|
41
|
+
left: number;
|
|
42
|
+
}) => void;
|
|
43
|
+
/** Callback to dismiss/clear the active slash command */
|
|
44
|
+
clearSlashCommand?: () => void;
|
|
45
|
+
/** Whether a slash command menu is currently active */
|
|
46
|
+
slashCommandActive?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Callback fired the first time each milestone is reached while the editor
|
|
49
|
+
* is mounted: `used_variable` ({variable}) and `used_magic` (__instruction__).
|
|
50
|
+
*/
|
|
51
|
+
onMilestone?: (milestone: string) => void;
|
|
52
|
+
/** DOM element ID of the container, used for positioning popovers (default `"editor-container"`) */
|
|
53
|
+
containerId?: string;
|
|
54
|
+
/** Variable names originating from structured JSON output steps */
|
|
55
|
+
jsonVariables?: string[];
|
|
56
|
+
/** Animation speed for gradient decorations (default `2`) */
|
|
57
|
+
speed?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Import text from .md, .html, .txt and .rtf files dropped onto the editor
|
|
60
|
+
* (opt-in). Content is always inserted as plain text. Pasting keeps the
|
|
61
|
+
* plain-text paste handler, so pasted files are not imported.
|
|
62
|
+
*/
|
|
63
|
+
fileImport?: Omit<FileImportOptions, "asPlainText"> | boolean;
|
|
64
|
+
/** Accessible label of loading placeholders, announced by screen readers (default `"Loading…"`). */
|
|
65
|
+
loadingLabel?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface PromptEditorOptionsExtras {
|
|
68
|
+
/** Node view drawing a framework loading indicator inside `loadingNode` placeholders. */
|
|
69
|
+
loadingNodeView?: LoadingNodeViewMount | null;
|
|
70
|
+
/**
|
|
71
|
+
* Milestones already reported. Pass the same set for the binding's lifetime so a recreated
|
|
72
|
+
* editor does not report them again (default: a new set per call).
|
|
73
|
+
*/
|
|
74
|
+
reachedMilestones?: Set<string>;
|
|
75
|
+
}
|
|
76
|
+
export declare const PROMPT_EDITOR_DEFAULT_PLACEHOLDER = "Write a prompt, use {{template}}, {variable}, or /command...";
|
|
77
|
+
export declare const PROMPT_EDITOR_DEFAULT_CLASS_NAME = "w-full border border-input rounded-md p-3 font-mono text-sm leading-relaxed focus:outline-none focus:ring-2 focus:ring-primary whitespace-pre-wrap break-words";
|
|
78
|
+
/** The gradient map a prompt editor uses: the caller's, else one default gradient per template. */
|
|
79
|
+
export declare function resolvePromptTemplateColorMap(templates?: Template[], userColorMap?: Map<string, ColorGradient>): Map<string, ColorGradient>;
|
|
80
|
+
/**
|
|
81
|
+
* A key of the options that are baked into the prompt editor's extensions. Bindings recreate
|
|
82
|
+
* the editor only when it changes; content, editability, placeholder and class names are applied
|
|
83
|
+
* to the live editor by `syncPromptEditor`. The color map and templates are keyed by value, so an
|
|
84
|
+
* inline `new Map(...)` does not recreate the editor on every render.
|
|
85
|
+
*/
|
|
86
|
+
export declare function promptEditorConfigKey(config: PromptEditorConfig, extras?: {
|
|
87
|
+
hasLoadingNodeView?: boolean;
|
|
88
|
+
}): string;
|
|
89
|
+
/** The milestones reached by `text`: `used_variable` for `{variable}`, `used_magic` for `__instruction__`. */
|
|
90
|
+
export declare function promptMilestones(text: string): string[];
|
|
91
|
+
/**
|
|
92
|
+
* TipTap `Editor` options for a plain-text prompt editor: gradient tokens, `{{template}}`
|
|
93
|
+
* autocomplete, `loadingNode` placeholders, optional file import, `/command` matching with
|
|
94
|
+
* keyboard capture while a menu is open, milestone tracking and plain-text clipboard handling.
|
|
95
|
+
*
|
|
96
|
+
* Callbacks are read through `getConfig()` when they fire, so the latest handlers are used
|
|
97
|
+
* without recreating the editor. Everything else is read once here.
|
|
98
|
+
*/
|
|
99
|
+
export declare function createPromptEditorOptions(getConfig: () => PromptEditorConfig, extras?: PromptEditorOptionsExtras): Partial<EditorOptions>;
|
|
100
|
+
/**
|
|
101
|
+
* Applies the live options of a prompt editor without recreating it: editability, content,
|
|
102
|
+
* class names and placeholder.
|
|
103
|
+
*
|
|
104
|
+
* Content is applied only when `config.content` changed since `previous` (pass the config of the
|
|
105
|
+
* last sync, or `undefined` for the first one) and differs from the editor's text, so an echo of
|
|
106
|
+
* the editor's own `onContentChange` does not reset the document or the cursor, and an
|
|
107
|
+
* unrelated prop change does not overwrite text the parent has not taken up yet.
|
|
108
|
+
*/
|
|
109
|
+
export declare function syncPromptEditor(editor: Editor, config: PromptEditorConfig, previous?: PromptEditorConfig): void;
|
|
@@ -39,7 +39,7 @@ var _chunkJG5VGCKPcjs = require('../chunk-JG5VGCKP.cjs');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _chunkSPIO2GJUcjs = require('../chunk-SPIO2GJU.cjs');
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
var _chunkWOFXZ3XUcjs = require('../chunk-WOFXZ3XU.cjs');
|
|
@@ -47,8 +47,8 @@ var _chunkWOFXZ3XUcjs = require('../chunk-WOFXZ3XU.cjs');
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
var
|
|
51
|
-
require('../chunk-
|
|
50
|
+
var _chunkYBMUHIOMcjs = require('../chunk-YBMUHIOM.cjs');
|
|
51
|
+
require('../chunk-N4KP3UQR.cjs');
|
|
52
52
|
|
|
53
53
|
// src/generation/schema.ts
|
|
54
54
|
function enumSchema(cap, description) {
|
|
@@ -642,7 +642,7 @@ function createGenerationRecord(options) {
|
|
|
642
642
|
const settings = clone(_nullishCoalesce(_nullishCoalesce(settingsInput, () => ( _optionalChain([planInput, 'optionalAccess', _55 => _55.request]))), () => ( {})));
|
|
643
643
|
let plan = planInput;
|
|
644
644
|
if (!plan && caps) {
|
|
645
|
-
const resolved =
|
|
645
|
+
const resolved = _chunkYBMUHIOMcjs.resolvePrompt.call(void 0, options.rawPrompt, _nullishCoalesce(options.templates, () => ( [])), {
|
|
646
646
|
bindings: options.bindings,
|
|
647
647
|
values: options.values,
|
|
648
648
|
maxDepth: options.maxDepth
|
|
@@ -653,7 +653,7 @@ function createGenerationRecord(options) {
|
|
|
653
653
|
...mentions ? { mentions } : {}
|
|
654
654
|
});
|
|
655
655
|
}
|
|
656
|
-
const provenance =
|
|
656
|
+
const provenance = _chunkSPIO2GJUcjs.createProvenance.call(void 0, {
|
|
657
657
|
...provenanceOptions,
|
|
658
658
|
model,
|
|
659
659
|
...plan ? { plan } : { request: settings }
|
|
@@ -697,14 +697,14 @@ function parseGenerationRecord(input) {
|
|
|
697
697
|
try {
|
|
698
698
|
data = JSON.parse(input);
|
|
699
699
|
} catch (e2) {
|
|
700
|
-
throw new (0,
|
|
700
|
+
throw new (0, _chunkSPIO2GJUcjs.ProvenanceParseError)("Generation record is not valid JSON.");
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
703
|
if (!isObject(data) || data.format !== GENERATION_RECORD_FORMAT) {
|
|
704
|
-
throw new (0,
|
|
704
|
+
throw new (0, _chunkSPIO2GJUcjs.ProvenanceParseError)("Not a generation record.");
|
|
705
705
|
}
|
|
706
706
|
if (typeof data.version !== "number" || data.version > GENERATION_RECORD_VERSION) {
|
|
707
|
-
throw new (0,
|
|
707
|
+
throw new (0, _chunkSPIO2GJUcjs.ProvenanceParseError)(`Unsupported generation record version ${JSON.stringify(data.version)}.`);
|
|
708
708
|
}
|
|
709
709
|
const checks = [
|
|
710
710
|
["id", typeof data.id === "string" && data.id !== ""],
|
|
@@ -715,8 +715,8 @@ function parseGenerationRecord(input) {
|
|
|
715
715
|
["createdAt", typeof data.createdAt === "string"]
|
|
716
716
|
];
|
|
717
717
|
const bad = checks.find(([, ok]) => !ok);
|
|
718
|
-
if (bad) throw new (0,
|
|
719
|
-
const provenance =
|
|
718
|
+
if (bad) throw new (0, _chunkSPIO2GJUcjs.ProvenanceParseError)(`Invalid generation record field "${bad[0]}".`);
|
|
719
|
+
const provenance = _chunkSPIO2GJUcjs.parseProvenance.call(void 0, data.provenance);
|
|
720
720
|
return {
|
|
721
721
|
...data,
|
|
722
722
|
kind: data.kind === "recreate" || data.kind === "variation" ? data.kind : "generate",
|
|
@@ -754,10 +754,10 @@ function templateDrift(record, current, mode) {
|
|
|
754
754
|
});
|
|
755
755
|
continue;
|
|
756
756
|
}
|
|
757
|
-
const body =
|
|
757
|
+
const body = _chunkYBMUHIOMcjs.getTemplateBody.call(void 0, template, {});
|
|
758
758
|
const hash = body === void 0 ? void 0 : _chunkKPMUIBK7cjs.hashText.call(void 0, body);
|
|
759
759
|
if (hash === recorded.hash) continue;
|
|
760
|
-
const latest =
|
|
760
|
+
const latest = _chunkYBMUHIOMcjs.getLatestVersion.call(void 0, template);
|
|
761
761
|
const toVersion = _optionalChain([template, 'access', _58 => _58.versions, 'optionalAccess', _59 => _59.length]) ? _nullishCoalesce(_optionalChain([latest, 'optionalAccess', _60 => _60.version]), () => ( _optionalChain([latest, 'optionalAccess', _61 => _61.id]))) : void 0;
|
|
762
762
|
const versions = fromVersion !== void 0 || toVersion !== void 0 ? ` (${_nullishCoalesce(fromVersion, () => ( "unversioned"))} \u2192 ${_nullishCoalesce(toVersion, () => ( "unversioned"))})` : "";
|
|
763
763
|
drift.push({
|
|
@@ -791,7 +791,7 @@ function rebuild(record, options, kind, overrides) {
|
|
|
791
791
|
const drift = templateDrift(record, options.templates, mode);
|
|
792
792
|
const rawPrompt = _nullishCoalesce(_optionalChain([overrides, 'optionalAccess', _62 => _62.rawPrompt]), () => ( provenance.rawPrompt));
|
|
793
793
|
const values = _optionalChain([overrides, 'optionalAccess', _63 => _63.values]) !== void 0 ? { ..._nullishCoalesce(provenance.values, () => ( {})), ...overrides.values } : provenance.values ? clone(provenance.values) : null;
|
|
794
|
-
const pinned =
|
|
794
|
+
const pinned = _chunkSPIO2GJUcjs.pinnedTemplatesToTemplates.call(void 0, provenance.templates);
|
|
795
795
|
let templates;
|
|
796
796
|
let bindings;
|
|
797
797
|
if (mode === "latest" && options.templates) {
|
|
@@ -806,7 +806,7 @@ function rebuild(record, options, kind, overrides) {
|
|
|
806
806
|
templates = pinned;
|
|
807
807
|
bindings = { ...provenance.bindings };
|
|
808
808
|
}
|
|
809
|
-
const resolved =
|
|
809
|
+
const resolved = _chunkYBMUHIOMcjs.resolvePrompt.call(void 0, rawPrompt, templates, { bindings, ...values ? { values } : {} });
|
|
810
810
|
const sourceMap = resolved.map.map((segment) => {
|
|
811
811
|
const { locked: _locked, ...rest } = segment;
|
|
812
812
|
return rest;
|
|
@@ -1665,4 +1665,4 @@ function createGenerationRecordStore(options) {
|
|
|
1665
1665
|
|
|
1666
1666
|
|
|
1667
1667
|
|
|
1668
|
-
exports.DRIFT_TYPE_LABELS = DRIFT_TYPE_LABELS; exports.GENERATION_RECORD_FORMAT = GENERATION_RECORD_FORMAT; exports.GENERATION_RECORD_VERSION = GENERATION_RECORD_VERSION; exports.GENERATION_REQUEST_FIELDS = _chunkKPMUIBK7cjs.GENERATION_REQUEST_FIELDS; exports.MAX_PENDING_PERCENT = MAX_PENDING_PERCENT; exports.PROVENANCE_FORMAT =
|
|
1668
|
+
exports.DRIFT_TYPE_LABELS = DRIFT_TYPE_LABELS; exports.GENERATION_RECORD_FORMAT = GENERATION_RECORD_FORMAT; exports.GENERATION_RECORD_VERSION = GENERATION_RECORD_VERSION; exports.GENERATION_REQUEST_FIELDS = _chunkKPMUIBK7cjs.GENERATION_REQUEST_FIELDS; exports.MAX_PENDING_PERCENT = MAX_PENDING_PERCENT; exports.PROVENANCE_FORMAT = _chunkSPIO2GJUcjs.PROVENANCE_FORMAT; exports.PROVENANCE_VERSION = _chunkSPIO2GJUcjs.PROVENANCE_VERSION; exports.ProvenanceParseError = _chunkSPIO2GJUcjs.ProvenanceParseError; exports.QUALITY_LADDER = _chunkKPMUIBK7cjs.QUALITY_LADDER; exports.REFERENCE_ROLES = _chunkKPMUIBK7cjs.REFERENCE_ROLES; exports.REFERENCE_ROLE_ALIASES = _chunkKPMUIBK7cjs.REFERENCE_ROLE_ALIASES; exports.REFERENCE_ROLE_LABELS = _chunkKPMUIBK7cjs.REFERENCE_ROLE_LABELS; exports.REFERENCE_ROLE_NAME_REGEX = _chunkKPMUIBK7cjs.REFERENCE_ROLE_NAME_REGEX; exports.addReference = addReference; exports.aspectRatioRank = _chunkKPMUIBK7cjs.aspectRatioRank; exports.blockingDrift = blockingDrift; exports.capabilitiesToJsonSchema = capabilitiesToJsonSchema; exports.completeGenerationRecord = completeGenerationRecord; exports.createBatchResolver = createBatchResolver; exports.createGenerationHistoryToolProvider = createGenerationHistoryToolProvider; exports.createGenerationRecord = createGenerationRecord; exports.createGenerationRecordId = createGenerationRecordId; exports.createGenerationRecordStore = createGenerationRecordStore; exports.createGenerationToolProvider = createGenerationToolProvider; exports.createProvenance = _chunkSPIO2GJUcjs.createProvenance; exports.defaultAssetRoleOptions = defaultAssetRoleOptions; exports.describeAssetMentions = describeAssetMentions; exports.estimateJobProgress = estimateJobProgress; exports.expectedDurationFor = expectedDurationFor; exports.findTextMentions = _chunkJG5VGCKPcjs.findTextMentions; exports.formatMentionText = _chunkJG5VGCKPcjs.formatMentionText; exports.formatRemaining = formatRemaining; exports.getAssetRoleOptions = getAssetRoleOptions; exports.getGenerationControls = getGenerationControls; exports.getReferenceSlots = getReferenceSlots; exports.getRequestValue = getRequestValue; exports.hashCapabilities = _chunkKPMUIBK7cjs.hashCapabilities; exports.hashText = _chunkKPMUIBK7cjs.hashText; exports.hashValue = _chunkKPMUIBK7cjs.hashValue; exports.isGenerationRecord = isGenerationRecord; exports.isReferenceRoleName = _chunkKPMUIBK7cjs.isReferenceRoleName; exports.matchesRecordFilter = matchesRecordFilter; exports.mediaTypeMatches = _chunkKPMUIBK7cjs.mediaTypeMatches; exports.mergeCapabilities = _chunkKPMUIBK7cjs.mergeCapabilities; exports.normalizeReferenceRole = _chunkKPMUIBK7cjs.normalizeReferenceRole; exports.parseControlValue = parseControlValue; exports.parseGenerationRecord = parseGenerationRecord; exports.parseProvenance = _chunkSPIO2GJUcjs.parseProvenance; exports.pinnedTemplatesToTemplates = _chunkSPIO2GJUcjs.pinnedTemplatesToTemplates; exports.planGenerationRequest = _chunkKPMUIBK7cjs.planGenerationRequest; exports.qualityRank = _chunkKPMUIBK7cjs.qualityRank; exports.recreateRequest = recreateRequest; exports.referenceRoleLabel = _chunkKPMUIBK7cjs.referenceRoleLabel; exports.removeReference = removeReference; exports.replayProvenancePrompt = _chunkSPIO2GJUcjs.replayProvenancePrompt; exports.resolutionMegapixels = _chunkKPMUIBK7cjs.resolutionMegapixels; exports.resolutionRank = _chunkKPMUIBK7cjs.resolutionRank; exports.resolveAssetMentions = resolveAssetMentions; exports.seedCapability = _chunkKPMUIBK7cjs.seedCapability; exports.serializeGenerationRecord = serializeGenerationRecord; exports.serializeProvenance = _chunkSPIO2GJUcjs.serializeProvenance; exports.setMentionRoleInText = _chunkJG5VGCKPcjs.setMentionRoleInText; exports.setRequestValue = setRequestValue; exports.snapToOption = _chunkKPMUIBK7cjs.snapToOption; exports.stableStringify = _chunkKPMUIBK7cjs.stableStringify; exports.summarizeGenerationRecord = summarizeGenerationRecord; exports.supportedModes = _chunkKPMUIBK7cjs.supportedModes; exports.supportedReferenceRoles = _chunkKPMUIBK7cjs.supportedReferenceRoles; exports.textFieldCapability = _chunkKPMUIBK7cjs.textFieldCapability; exports.toAssetResolver = toAssetResolver; exports.validateAssetMentions = validateAssetMentions; exports.validateJsonSchema = _chunkWOFXZ3XUcjs.validateJsonSchema; exports.variationRequest = variationRequest;
|
package/dist/generation/index.js
CHANGED
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
pinnedTemplatesToTemplates,
|
|
40
40
|
replayProvenancePrompt,
|
|
41
41
|
serializeProvenance
|
|
42
|
-
} from "../chunk-
|
|
42
|
+
} from "../chunk-RWDSSK2I.js";
|
|
43
43
|
import {
|
|
44
44
|
validateJsonSchema
|
|
45
45
|
} from "../chunk-V2ZCJRDM.js";
|
|
@@ -47,8 +47,8 @@ import {
|
|
|
47
47
|
getLatestVersion,
|
|
48
48
|
getTemplateBody,
|
|
49
49
|
resolvePrompt
|
|
50
|
-
} from "../chunk-
|
|
51
|
-
import "../chunk-
|
|
50
|
+
} from "../chunk-3AJCEJNH.js";
|
|
51
|
+
import "../chunk-F7OO3DHP.js";
|
|
52
52
|
|
|
53
53
|
// src/generation/schema.ts
|
|
54
54
|
function enumSchema(cap, description) {
|
package/dist/grammar/index.cjs
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkM4UQA2T4cjs = require('../chunk-M4UQA2T4.cjs');
|
|
27
27
|
require('../chunk-N3KJFGXT.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
@@ -32,10 +32,10 @@ require('../chunk-N3KJFGXT.cjs');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
var _chunkYBMUHIOMcjs = require('../chunk-YBMUHIOM.cjs');
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
|
|
38
|
-
var _chunkNIBFDFYWcjs = require('../chunk-NIBFDFYW.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
@@ -58,7 +58,7 @@ var _chunkNIBFDFYWcjs = require('../chunk-NIBFDFYW.cjs');
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
var
|
|
61
|
+
var _chunkN4KP3UQRcjs = require('../chunk-N4KP3UQR.cjs');
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
|
|
@@ -114,4 +114,4 @@ var _chunkUWEQ55MYcjs = require('../chunk-UWEQ55MY.cjs');
|
|
|
114
114
|
|
|
115
115
|
|
|
116
116
|
|
|
117
|
-
exports.FIELD_ALIASES =
|
|
117
|
+
exports.FIELD_ALIASES = _chunkM4UQA2T4cjs.FIELD_ALIASES; exports.INSTRUCTION_REGEX = _chunkN4KP3UQRcjs.INSTRUCTION_REGEX; exports.MAX_DATA_SOURCE_FIELDS = _chunkM4UQA2T4cjs.MAX_DATA_SOURCE_FIELDS; exports.MAX_DATA_SOURCE_RECORDS = _chunkM4UQA2T4cjs.MAX_DATA_SOURCE_RECORDS; exports.MAX_MERGE_LENGTH = _chunkM4UQA2T4cjs.MAX_MERGE_LENGTH; exports.MAX_MERGE_OUTPUTS = _chunkM4UQA2T4cjs.MAX_MERGE_OUTPUTS; exports.TEMPLATE_DEPTH_ERROR = _chunkYBMUHIOMcjs.TEMPLATE_DEPTH_ERROR; exports.TEMPLATE_LOOP_ERROR = _chunkYBMUHIOMcjs.TEMPLATE_LOOP_ERROR; exports.TEMPLATE_REGEX = _chunkN4KP3UQRcjs.TEMPLATE_REGEX; exports.VARIABLE_REGEX = _chunkN4KP3UQRcjs.VARIABLE_REGEX; exports.compactVariableValues = _chunkM4UQA2T4cjs.compactVariableValues; exports.compareConditionValues = _chunkN4KP3UQRcjs.compareConditionValues; exports.conditionSubject = _chunkN4KP3UQRcjs.conditionSubject; exports.describeConditionalTag = _chunkN4KP3UQRcjs.describeConditionalTag; exports.detectDelimiter = _chunkM4UQA2T4cjs.detectDelimiter; exports.escapeVariableText = _chunkN4KP3UQRcjs.escapeVariableText; exports.evaluateCondition = _chunkN4KP3UQRcjs.evaluateCondition; exports.evaluateConditionExpression = _chunkN4KP3UQRcjs.evaluateConditionExpression; exports.evaluatePromptTokens = _chunkYBMUHIOMcjs.evaluatePromptTokens; exports.extractInstructionNames = _chunkM4UQA2T4cjs.extractInstructionNames; exports.extractTemplateNames = _chunkM4UQA2T4cjs.extractTemplateNames; exports.extractVariableNames = _chunkM4UQA2T4cjs.extractVariableNames; exports.extractVariables = _chunkM4UQA2T4cjs.extractVariables; exports.formatComparisonOperand = _chunkN4KP3UQRcjs.formatComparisonOperand; exports.formatConditionalTag = _chunkN4KP3UQRcjs.formatConditionalTag; exports.getLatestVersion = _chunkYBMUHIOMcjs.getLatestVersion; exports.getPromptDiagnostics = _chunkN4KP3UQRcjs.getPromptDiagnostics; exports.getSuppliedValue = _chunkN4KP3UQRcjs.getSuppliedValue; exports.getTemplateBody = _chunkYBMUHIOMcjs.getTemplateBody; exports.getVariableFormFields = _chunkM4UQA2T4cjs.getVariableFormFields; exports.instructionRegex = _chunkN4KP3UQRcjs.instructionRegex; exports.isPromptValueSet = _chunkN4KP3UQRcjs.isPromptValueSet; exports.mapRawOffsetToResolved = _chunkM4UQA2T4cjs.mapRawOffsetToResolved; exports.mapResolvedOffsetToRaw = _chunkM4UQA2T4cjs.mapResolvedOffsetToRaw; exports.matchConditionalTags = _chunkN4KP3UQRcjs.matchConditionalTags; exports.matchFields = _chunkM4UQA2T4cjs.matchFields; exports.mergeRecords = _chunkM4UQA2T4cjs.mergeRecords; exports.normalizeFieldKey = _chunkM4UQA2T4cjs.normalizeFieldKey; exports.normalizeFieldNames = _chunkM4UQA2T4cjs.normalizeFieldNames; exports.parseComparison = _chunkN4KP3UQRcjs.parseComparison; exports.parseConditionExpression = _chunkN4KP3UQRcjs.parseConditionExpression; exports.parseDataSource = _chunkM4UQA2T4cjs.parseDataSource; exports.parseVariableBody = _chunkN4KP3UQRcjs.parseVariableBody; exports.recordToValues = _chunkM4UQA2T4cjs.recordToValues; exports.resolvePrompt = _chunkYBMUHIOMcjs.resolvePrompt; exports.resolveTemplates = _chunkM4UQA2T4cjs.resolveTemplates; exports.resolveTemplatesWithMapping = _chunkM4UQA2T4cjs.resolveTemplatesWithMapping; exports.resolveVariables = _chunkM4UQA2T4cjs.resolveVariables; exports.serializeMergeOutputs = _chunkM4UQA2T4cjs.serializeMergeOutputs; exports.templateRegex = _chunkN4KP3UQRcjs.templateRegex; exports.tokenizePrompt = _chunkN4KP3UQRcjs.tokenizePrompt; exports.tokenizePromptWithDiagnostics = _chunkN4KP3UQRcjs.tokenizePromptWithDiagnostics; exports.unescapeVariableText = _chunkN4KP3UQRcjs.unescapeVariableText; exports.variableRegex = _chunkN4KP3UQRcjs.variableRegex;
|
package/dist/grammar/index.js
CHANGED
|
@@ -23,19 +23,16 @@ import {
|
|
|
23
23
|
resolveTemplatesWithMapping,
|
|
24
24
|
resolveVariables,
|
|
25
25
|
serializeMergeOutputs
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-WB22XMW3.js";
|
|
27
27
|
import "../chunk-WJSD3MAZ.js";
|
|
28
28
|
import {
|
|
29
29
|
TEMPLATE_DEPTH_ERROR,
|
|
30
30
|
TEMPLATE_LOOP_ERROR,
|
|
31
31
|
evaluatePromptTokens,
|
|
32
32
|
getLatestVersion,
|
|
33
|
-
getPromptDiagnostics,
|
|
34
33
|
getTemplateBody,
|
|
35
|
-
resolvePrompt
|
|
36
|
-
|
|
37
|
-
tokenizePromptWithDiagnostics
|
|
38
|
-
} from "../chunk-SIFAIGB3.js";
|
|
34
|
+
resolvePrompt
|
|
35
|
+
} from "../chunk-3AJCEJNH.js";
|
|
39
36
|
import {
|
|
40
37
|
INSTRUCTION_REGEX,
|
|
41
38
|
TEMPLATE_REGEX,
|
|
@@ -48,6 +45,7 @@ import {
|
|
|
48
45
|
evaluateConditionExpression,
|
|
49
46
|
formatComparisonOperand,
|
|
50
47
|
formatConditionalTag,
|
|
48
|
+
getPromptDiagnostics,
|
|
51
49
|
getSuppliedValue,
|
|
52
50
|
instructionRegex,
|
|
53
51
|
isPromptValueSet,
|
|
@@ -56,9 +54,11 @@ import {
|
|
|
56
54
|
parseConditionExpression,
|
|
57
55
|
parseVariableBody,
|
|
58
56
|
templateRegex,
|
|
57
|
+
tokenizePrompt,
|
|
58
|
+
tokenizePromptWithDiagnostics,
|
|
59
59
|
unescapeVariableText,
|
|
60
60
|
variableRegex
|
|
61
|
-
} from "../chunk-
|
|
61
|
+
} from "../chunk-F7OO3DHP.js";
|
|
62
62
|
export {
|
|
63
63
|
FIELD_ALIASES,
|
|
64
64
|
INSTRUCTION_REGEX,
|