@arbidocs/blocks 0.4.8 → 0.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/StreamedArtifactEditor-5BMNWSS4.cjs +106 -0
- package/dist/StreamedArtifactEditor-5BMNWSS4.cjs.map +1 -0
- package/dist/StreamedArtifactEditor-6ETUHNQN.js +104 -0
- package/dist/StreamedArtifactEditor-6ETUHNQN.js.map +1 -0
- package/dist/agents/index.cjs +163 -163
- package/dist/agents/index.js +6 -6
- package/dist/artifacts/ArtifactEditor.d.ts +24 -1
- package/dist/artifacts/ArtifactToolbar.d.ts +3 -1
- package/dist/artifacts/StreamedArtifactFrame.d.ts +36 -0
- package/dist/artifacts/editor/index.cjs +11 -82
- package/dist/artifacts/editor/index.cjs.map +1 -1
- package/dist/artifacts/editor/index.js +2 -83
- package/dist/artifacts/editor/index.js.map +1 -1
- package/dist/artifacts/index.cjs +92 -800
- package/dist/artifacts/index.cjs.map +1 -1
- package/dist/artifacts/index.d.ts +2 -1
- package/dist/artifacts/index.js +3 -784
- package/dist/artifacts/index.js.map +1 -1
- package/dist/chat/AssistantToaster.d.ts +8 -0
- package/dist/chat/index.cjs +68 -62
- package/dist/chat/index.d.ts +1 -0
- package/dist/chat/index.js +3 -1
- package/dist/{chunk-JLOYWXRB.js → chunk-557EU3G4.js} +3 -3
- package/dist/{chunk-JLOYWXRB.js.map → chunk-557EU3G4.js.map} +1 -1
- package/dist/chunk-BV7FEMSI.js +34 -0
- package/dist/chunk-BV7FEMSI.js.map +1 -0
- package/dist/{chunk-YP264PVL.js → chunk-D5BZVKIF.js} +6 -6
- package/dist/{chunk-YP264PVL.js.map → chunk-D5BZVKIF.js.map} +1 -1
- package/dist/{chunk-LRUCMZK6.cjs → chunk-D6XY3C4O.cjs} +4 -15
- package/dist/chunk-D6XY3C4O.cjs.map +1 -0
- package/dist/{chunk-YVIOCITQ.cjs → chunk-DCEI37AX.cjs} +3 -3
- package/dist/{chunk-YVIOCITQ.cjs.map → chunk-DCEI37AX.cjs.map} +1 -1
- package/dist/chunk-DTLOXXPN.js +831 -0
- package/dist/chunk-DTLOXXPN.js.map +1 -0
- package/dist/chunk-FX3K6LNZ.cjs +47 -0
- package/dist/chunk-FX3K6LNZ.cjs.map +1 -0
- package/dist/{chunk-QXEJXIP4.js → chunk-H7OD4CHN.js} +5 -16
- package/dist/chunk-H7OD4CHN.js.map +1 -0
- package/dist/chunk-HSFGOA6V.js +86 -0
- package/dist/chunk-HSFGOA6V.js.map +1 -0
- package/dist/{chunk-7OCFHEE6.js → chunk-ILOYJE63.js} +10 -3
- package/dist/chunk-ILOYJE63.js.map +1 -0
- package/dist/chunk-LOJVUGBJ.js +67 -0
- package/dist/chunk-LOJVUGBJ.js.map +1 -0
- package/dist/{chunk-QMDLPO3M.cjs → chunk-LXC5PTTI.cjs} +2 -2
- package/dist/{chunk-QMDLPO3M.cjs.map → chunk-LXC5PTTI.cjs.map} +1 -1
- package/dist/{chunk-G2E3O3HI.js → chunk-OJSWQM4G.js} +158 -5
- package/dist/chunk-OJSWQM4G.js.map +1 -0
- package/dist/chunk-PVK3GAMH.cjs +852 -0
- package/dist/chunk-PVK3GAMH.cjs.map +1 -0
- package/dist/chunk-QVBZESYQ.cjs +70 -0
- package/dist/chunk-QVBZESYQ.cjs.map +1 -0
- package/dist/{chunk-JG4TFS3Z.cjs → chunk-RGHQFJOL.cjs} +160 -2
- package/dist/chunk-RGHQFJOL.cjs.map +1 -0
- package/dist/{chunk-SY7UURF7.cjs → chunk-RMIACB7N.cjs} +6 -6
- package/dist/{chunk-SY7UURF7.cjs.map → chunk-RMIACB7N.cjs.map} +1 -1
- package/dist/chunk-RUNQFXPH.cjs +89 -0
- package/dist/chunk-RUNQFXPH.cjs.map +1 -0
- package/dist/chunk-SLSBJRWW.js +41 -0
- package/dist/chunk-SLSBJRWW.js.map +1 -0
- package/dist/chunk-XKSFJYOD.cjs +37 -0
- package/dist/chunk-XKSFJYOD.cjs.map +1 -0
- package/dist/{chunk-MGUHR3JI.cjs → chunk-YWSWRTGH.cjs} +10 -2
- package/dist/chunk-YWSWRTGH.cjs.map +1 -0
- package/dist/{chunk-EY2RJW27.js → chunk-ZJ6RIPFS.js} +2 -2
- package/dist/{chunk-EY2RJW27.js.map → chunk-ZJ6RIPFS.js.map} +1 -1
- package/dist/collaboration/contacts/ContactCard.d.ts +43 -0
- package/dist/collaboration/contacts/index.d.ts +2 -0
- package/dist/collaboration/contacts/vcard.d.ts +26 -0
- package/dist/collaboration/index.cjs +56 -36
- package/dist/collaboration/index.js +1 -1
- package/dist/connect/index.cjs +97 -23
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -0
- package/dist/connect/index.js +79 -6
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/StreamedArtifact.d.ts +43 -0
- package/dist/connection/StreamedArtifactEditor.d.ts +31 -0
- package/dist/facts/index.cjs +4 -3
- package/dist/facts/index.cjs.map +1 -1
- package/dist/facts/index.js +2 -1
- package/dist/facts/index.js.map +1 -1
- package/dist/files/index.cjs +10 -9
- package/dist/files/index.cjs.map +1 -1
- package/dist/files/index.js +7 -6
- package/dist/files/index.js.map +1 -1
- package/dist/index.cjs +650 -596
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -16
- package/dist/index.js.map +1 -1
- package/dist/lib/use-media-query.d.ts +32 -0
- package/dist/settings/index.cjs +32 -32
- package/dist/settings/index.js +3 -3
- package/dist/shell/Toaster.d.ts +28 -0
- package/dist/shell/index.cjs +78 -48
- package/dist/shell/index.d.ts +2 -0
- package/dist/shell/index.js +5 -3
- package/dist/site/index.cjs +14 -14
- package/dist/site/index.js +2 -2
- package/dist/studio/index.cjs +3 -3
- package/dist/studio/index.js +3 -3
- package/dist/workspaces/index.cjs +12 -5
- package/dist/workspaces/index.cjs.map +1 -1
- package/dist/workspaces/index.js +13 -6
- package/dist/workspaces/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-7OCFHEE6.js.map +0 -1
- package/dist/chunk-G2E3O3HI.js.map +0 -1
- package/dist/chunk-JG4TFS3Z.cjs.map +0 -1
- package/dist/chunk-LRUCMZK6.cjs.map +0 -1
- package/dist/chunk-MGUHR3JI.cjs.map +0 -1
- package/dist/chunk-QXEJXIP4.js.map +0 -1
package/dist/agents/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { ACTION_LABELS, AgentAvatarField, AgentBar, AgentBarIconButton, AgentBarMenu, AgentBarNotes, AgentBarProbeAnswer, AgentBarQueuedNote, AgentBarStatus, AgentCard, AgentCreateView, AgentCreatedView, AgentCreator, AgentEditView, AgentGallery, AgentMainView, AgentSelect, AgentTypeSelector, CapabilityGrid, CapabilityTile, ConfigField, ConfigForm, ConsentActions, ConsentBulletList, ConsentCard, ConsentFootnote, ConsentHeader, ConsentMessage, ConsentNotice, ConsentPage, ConsentPermissionList, ConsentSection, ConsentStrong, ConsentText, CopyableUrl, DEFAULT_AGENT_AVATAR_FIELD_LABELS, DEFAULT_AGENT_BAR_LABELS, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_CREATOR_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_AGENT_SELECT_LABELS, DEFAULT_AGENT_STEPS_LABELS, DEFAULT_AGENT_TYPE_SELECTOR_LABELS, DEFAULT_AUTHORIZE_AGENT_LABELS, DEFAULT_CONFIG_FIELD_LABELS, DEFAULT_CONFIG_FORM_LABELS, DEFAULT_CONSENT_ACTIONS_LABELS, DEFAULT_COPYABLE_URL_LABELS, DEFAULT_LIVE_RUNS_BANNER_LABELS, DEFAULT_RECURRENCE, DEFAULT_RECURRENCE_BUILDER_LABELS, DEFAULT_SCHEMA_FORM_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_EDIT_FORM_LABELS, DEFAULT_SKILL_GENERATE_FORM_LABELS, DEFAULT_SKILL_GLOBAL_BADGE_LABELS, DEFAULT_SKILL_ROW_LABELS, DEFAULT_SKILL_VIEW_TOGGLE_LABELS, DEFAULT_SUBAGENT_ROSTER_LABELS, DEFAULT_TASKS_CHROME_LABELS, DEFAULT_TASK_COLUMN_LABELS, DEFAULT_TASK_COMPOSER_LABELS, DEFAULT_TASK_PLAN_LABELS, DEFAULT_TASK_ROW_ACTIONS_LABELS, DEFAULT_TASK_RUNS_DIALOG_LABELS, DEFAULT_TUPLE_ARRAY_FIELD_LABELS, DEFAULT_UPLOAD_TASK_ITEM_LABELS, DEFAULT_UPLOAD_TASK_LIST_LABELS, DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, EMPTY_WORKFLOW_SCOPE, GoalCriteria, LiveRunsBanner, NewTaskEmptyAction, RecurrenceBuilder, SKILL_PROMPT_FALLBACK_PLACEHOLDER, SKILL_PROMPT_LABEL, STATUS_LABELS, SchemaForm, SkillActionButton, SkillCard, SkillDetail, SkillDetailSection, SkillEditForm, SkillFilterChips, SkillGenerateForm, SkillGlobalBadge, SkillRow, SkillTile, SkillTypeBadge, SkillViewToggle, StepDetail, StepNarration, StepOutcome, StepParams, StepRow, StepSummary, StepTrace, StepTraceSummary, SubAgentLane, SubStepGroup, SubagentRoster, TRIGGER_LABELS, TaskComposer, TaskPlan, TaskRowActions, TaskRunsDialog, TasksBulkBar, TasksToolbar, TupleArrayField, UploadTaskItem, UploadTaskList, WEEKDAYS, WorkflowConfigDialog, WorkflowLauncher, agentConfigSectionToValues, agentCreatorToConfigSection, authModeFor, buildLaunch, buildRRule, composePersona, composeWorkflowPrompt, createTaskColumns, defaultInputs, defaultTaskComposerValues, deriveAgentName, describeRRule, formatElapsed, goalProgress, humanizeSection, inferType, inputsFromContext, isAgenticWorkflow, isEmptyWorkflowScope, isOutOfBounds, isValidAgentName, isWorkflowScope, isoToLocalInput, localInputToIso, nextCriterionId, parseRRule, prettifyKey, promptFieldName, skillToWorkflow, statusBadgeVariant, stripPersonaPreamble, summarizeAgent, summarizeCapabilities, taskComposerToCreateRequest, taskComposerToUpdateRequest, taskNeedsAccess, taskToComposerValues, validateInputs, workflowAccepts, workflowFromFrontmatter, workflowTaskFields, workflowsAccepting, workflowsForHost } from '../chunk-
|
|
2
|
+
export { ACTION_LABELS, AgentAvatarField, AgentBar, AgentBarIconButton, AgentBarMenu, AgentBarNotes, AgentBarProbeAnswer, AgentBarQueuedNote, AgentBarStatus, AgentCard, AgentCreateView, AgentCreatedView, AgentCreator, AgentEditView, AgentGallery, AgentMainView, AgentSelect, AgentTypeSelector, CapabilityGrid, CapabilityTile, ConfigField, ConfigForm, ConsentActions, ConsentBulletList, ConsentCard, ConsentFootnote, ConsentHeader, ConsentMessage, ConsentNotice, ConsentPage, ConsentPermissionList, ConsentSection, ConsentStrong, ConsentText, CopyableUrl, DEFAULT_AGENT_AVATAR_FIELD_LABELS, DEFAULT_AGENT_BAR_LABELS, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_CREATOR_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_AGENT_SELECT_LABELS, DEFAULT_AGENT_STEPS_LABELS, DEFAULT_AGENT_TYPE_SELECTOR_LABELS, DEFAULT_AUTHORIZE_AGENT_LABELS, DEFAULT_CONFIG_FIELD_LABELS, DEFAULT_CONFIG_FORM_LABELS, DEFAULT_CONSENT_ACTIONS_LABELS, DEFAULT_COPYABLE_URL_LABELS, DEFAULT_LIVE_RUNS_BANNER_LABELS, DEFAULT_RECURRENCE, DEFAULT_RECURRENCE_BUILDER_LABELS, DEFAULT_SCHEMA_FORM_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_EDIT_FORM_LABELS, DEFAULT_SKILL_GENERATE_FORM_LABELS, DEFAULT_SKILL_GLOBAL_BADGE_LABELS, DEFAULT_SKILL_ROW_LABELS, DEFAULT_SKILL_VIEW_TOGGLE_LABELS, DEFAULT_SUBAGENT_ROSTER_LABELS, DEFAULT_TASKS_CHROME_LABELS, DEFAULT_TASK_COLUMN_LABELS, DEFAULT_TASK_COMPOSER_LABELS, DEFAULT_TASK_PLAN_LABELS, DEFAULT_TASK_ROW_ACTIONS_LABELS, DEFAULT_TASK_RUNS_DIALOG_LABELS, DEFAULT_TUPLE_ARRAY_FIELD_LABELS, DEFAULT_UPLOAD_TASK_ITEM_LABELS, DEFAULT_UPLOAD_TASK_LIST_LABELS, DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, EMPTY_WORKFLOW_SCOPE, GoalCriteria, LiveRunsBanner, NewTaskEmptyAction, RecurrenceBuilder, SKILL_PROMPT_FALLBACK_PLACEHOLDER, SKILL_PROMPT_LABEL, STATUS_LABELS, SchemaForm, SkillActionButton, SkillCard, SkillDetail, SkillDetailSection, SkillEditForm, SkillFilterChips, SkillGenerateForm, SkillGlobalBadge, SkillRow, SkillTile, SkillTypeBadge, SkillViewToggle, StepDetail, StepNarration, StepOutcome, StepParams, StepRow, StepSummary, StepTrace, StepTraceSummary, SubAgentLane, SubStepGroup, SubagentRoster, TRIGGER_LABELS, TaskComposer, TaskPlan, TaskRowActions, TaskRunsDialog, TasksBulkBar, TasksToolbar, TupleArrayField, UploadTaskItem, UploadTaskList, WEEKDAYS, WorkflowConfigDialog, WorkflowLauncher, agentConfigSectionToValues, agentCreatorToConfigSection, authModeFor, buildLaunch, buildRRule, composePersona, composeWorkflowPrompt, createTaskColumns, defaultInputs, defaultTaskComposerValues, deriveAgentName, describeRRule, formatElapsed, goalProgress, humanizeSection, inferType, inputsFromContext, isAgenticWorkflow, isEmptyWorkflowScope, isOutOfBounds, isValidAgentName, isWorkflowScope, isoToLocalInput, localInputToIso, nextCriterionId, parseRRule, prettifyKey, promptFieldName, skillToWorkflow, statusBadgeVariant, stripPersonaPreamble, summarizeAgent, summarizeCapabilities, taskComposerToCreateRequest, taskComposerToUpdateRequest, taskNeedsAccess, taskToComposerValues, validateInputs, workflowAccepts, workflowFromFrontmatter, workflowTaskFields, workflowsAccepting, workflowsForHost } from '../chunk-D5BZVKIF.js';
|
|
3
|
+
import '../chunk-P6GHJSLR.js';
|
|
3
4
|
import '../chunk-NJL4LIXX.js';
|
|
4
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-S7PSMMRG.js';
|
|
5
6
|
import '../chunk-CQCC7LE7.js';
|
|
7
|
+
import '../chunk-CPMNAJLF.js';
|
|
8
|
+
import '../chunk-TJMKFY5P.js';
|
|
9
|
+
import '../chunk-NUNKSZKU.js';
|
|
6
10
|
import '../chunk-UBNVIIBT.js';
|
|
7
|
-
import '../chunk-P6GHJSLR.js';
|
|
8
|
-
import '../chunk-S7PSMMRG.js';
|
|
9
11
|
import '../chunk-76JDDMSP.js';
|
|
10
|
-
import '../chunk-CPMNAJLF.js';
|
|
11
12
|
import '../chunk-NPLYHR2E.js';
|
|
12
13
|
import '../chunk-OXF2IFXG.js';
|
|
13
|
-
import '../chunk-TJMKFY5P.js';
|
|
14
14
|
import '../chunk-7F6CBP3Z.js';
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -5,13 +5,28 @@ import type { RenderMarkdown } from './ArtifactRedlineView';
|
|
|
5
5
|
import { type ArtifactToolbarLabels } from './ArtifactToolbar';
|
|
6
6
|
import { type ArtifactVersionBarLabels, type ArtifactVersionBarTestIds } from './ArtifactVersionBar';
|
|
7
7
|
import type { VersionEntry } from './VersionTimeline';
|
|
8
|
+
/** Whether the artifact's text is available (`ArtifactTextStatus` of `@arbidocs/react/artifacts`). */
|
|
9
|
+
export type ArtifactEditorStatus = 'loading' | 'parsing' | 'ready' | 'error';
|
|
10
|
+
export interface ArtifactEditorStatusLabels {
|
|
11
|
+
/** Shown while the backend is still parsing a fresh upload. */
|
|
12
|
+
preparing: string;
|
|
13
|
+
error: string;
|
|
14
|
+
retry: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const DEFAULT_ARTIFACT_EDITOR_STATUS_LABELS: ArtifactEditorStatusLabels;
|
|
8
17
|
export interface ArtifactEditorLabels {
|
|
18
|
+
status: Partial<ArtifactEditorStatusLabels>;
|
|
9
19
|
toolbar: Partial<ArtifactToolbarLabels>;
|
|
10
20
|
versions: Partial<ArtifactVersionBarLabels>;
|
|
11
21
|
compare: Partial<ArtifactCompareBarLabels>;
|
|
12
22
|
}
|
|
13
23
|
export interface ArtifactEditorTestIds {
|
|
14
24
|
root: string;
|
|
25
|
+
/** The "Preparing editor" state. */
|
|
26
|
+
preparing: string;
|
|
27
|
+
/** The error state and its retry button. */
|
|
28
|
+
error: string;
|
|
29
|
+
retry: string;
|
|
15
30
|
compareRow: string;
|
|
16
31
|
body: Partial<ArtifactEditorBodyTestIds>;
|
|
17
32
|
versions: Partial<ArtifactVersionBarTestIds>;
|
|
@@ -31,6 +46,14 @@ export interface ArtifactEditorProps {
|
|
|
31
46
|
/** The version being compared against. */
|
|
32
47
|
compareId?: string | null;
|
|
33
48
|
showTrackChanges: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the text is available. While `loading` or `parsing` the body is a "Preparing editor"
|
|
51
|
+
* state (the toolbar is disabled: an editor on an empty baseline would save a blank version);
|
|
52
|
+
* `error` shows `labels.status.error` with Retry (`onRetry`). Default `ready`.
|
|
53
|
+
*/
|
|
54
|
+
status?: ArtifactEditorStatus;
|
|
55
|
+
/** Ask for the text again after an `error`. */
|
|
56
|
+
onRetry?: () => void;
|
|
34
57
|
/** The lineage, oldest first. The version bar shows only for two or more. */
|
|
35
58
|
versions?: VersionEntry[];
|
|
36
59
|
currentVersionId?: string;
|
|
@@ -61,4 +84,4 @@ export interface ArtifactEditorProps {
|
|
|
61
84
|
* changes). Everything is view-model driven: a host binds state with `useArtifactSession` from
|
|
62
85
|
* `@arbidocs/react/artifacts` and passes the editor and redline as slots.
|
|
63
86
|
*/
|
|
64
|
-
export declare function ArtifactEditor({ content, isEditing, hasChanges, isSaving, isDraft, compact, canCompare, comparing, compareId, showTrackChanges, versions, currentVersionId, onStartEdit, onCancel, onSave, onCompare, onStopCompare, onToggleTrackChanges, onOpenVersion, formatDate, editor, redline, renderMarkdown, actions, className, labels, testIds, }: ArtifactEditorProps): import("react").JSX.Element;
|
|
87
|
+
export declare function ArtifactEditor({ content, isEditing, hasChanges, isSaving, isDraft, compact, canCompare, comparing, compareId, showTrackChanges, status, onRetry, versions, currentVersionId, onStartEdit, onCancel, onSave, onCompare, onStopCompare, onToggleTrackChanges, onOpenVersion, formatDate, editor, redline, renderMarkdown, actions, className, labels, testIds, }: ArtifactEditorProps): import("react").JSX.Element;
|
|
@@ -36,6 +36,8 @@ export interface ArtifactToolbarProps {
|
|
|
36
36
|
/** Offer "Compare against the previous version". */
|
|
37
37
|
canCompare: boolean;
|
|
38
38
|
onStartEdit: () => void;
|
|
39
|
+
/** Edit is not offered yet (the text is still being prepared). */
|
|
40
|
+
editDisabled?: boolean;
|
|
39
41
|
/** Discard the buffer and leave edit mode. */
|
|
40
42
|
onCancel: () => void;
|
|
41
43
|
onCompare: () => void;
|
|
@@ -50,4 +52,4 @@ export interface ArtifactToolbarProps {
|
|
|
50
52
|
* once there is something to save; a dot marks unsaved changes and a polite status announces them.
|
|
51
53
|
* Touch targets are 44px on coarse pointers.
|
|
52
54
|
*/
|
|
53
|
-
export declare function ArtifactToolbar({ isEditing, isDraft, compact, hasChanges, isSaving, canCompare, onStartEdit, onCancel, onCompare, onSave, className, labels, testIds, }: ArtifactToolbarProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
55
|
+
export declare function ArtifactToolbar({ isEditing, isDraft, compact, hasChanges, isSaving, canCompare, editDisabled, onStartEdit, onCancel, onCompare, onSave, className, labels, testIds, }: ArtifactToolbarProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** `StreamedArtifactPhase` of `@arbidocs/react/artifacts`. */
|
|
3
|
+
export type StreamedArtifactFramePhase = 'streaming' | 'persisting' | 'parsing' | 'ready' | 'error';
|
|
4
|
+
export interface StreamedArtifactFrameLabels {
|
|
5
|
+
preparing: string;
|
|
6
|
+
error: string;
|
|
7
|
+
retry: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const DEFAULT_STREAMED_ARTIFACT_FRAME_LABELS: StreamedArtifactFrameLabels;
|
|
10
|
+
export interface StreamedArtifactFrameTestIds {
|
|
11
|
+
/** The "Preparing editor" wrapper (`persisting` and `parsing`). */
|
|
12
|
+
preparing: string;
|
|
13
|
+
error: string;
|
|
14
|
+
retry: string;
|
|
15
|
+
}
|
|
16
|
+
export interface StreamedArtifactFrameProps {
|
|
17
|
+
phase: StreamedArtifactFramePhase;
|
|
18
|
+
/** The live canvas: shown while streaming, and kept in view under the status while preparing. */
|
|
19
|
+
canvas: ReactNode;
|
|
20
|
+
/** The editor, mounted only when `phase` is `ready`. */
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
/** Why it failed (shown under the message). */
|
|
23
|
+
error?: string | null;
|
|
24
|
+
onRetry?: () => void;
|
|
25
|
+
className?: string;
|
|
26
|
+
labels?: Partial<StreamedArtifactFrameLabels>;
|
|
27
|
+
testIds?: Partial<StreamedArtifactFrameTestIds>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The STREAM -> PERSIST -> EDIT switch of an agent-drafted artifact, presentational. The live
|
|
31
|
+
* `canvas` while the agent streams; "Preparing editor..." (a polite status above the canvas, so
|
|
32
|
+
* the draft stays readable) while the draft is stored and parsed; the editor (`children`) when it
|
|
33
|
+
* is ready; an alert with Retry when storing or parsing failed. The connected version is
|
|
34
|
+
* `StreamedArtifact` in `@arbidocs/blocks/connect`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function StreamedArtifactFrame({ phase, canvas, children, error, onRetry, className, labels, testIds, }: StreamedArtifactFrameProps): import("react").JSX.Element;
|
|
@@ -1,89 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
var editor = require('@mdxeditor/editor');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var chunkRUNQFXPH_cjs = require('../../chunk-RUNQFXPH.cjs');
|
|
5
|
+
require('../../chunk-MHVNT4J3.cjs');
|
|
8
6
|
|
|
9
|
-
function DictationSlot({
|
|
10
|
-
render
|
|
11
|
-
}) {
|
|
12
|
-
const insertMarkdown = editor.usePublisher(editor.insertMarkdown$);
|
|
13
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: render(insertMarkdown) });
|
|
14
|
-
}
|
|
15
|
-
var DEFAULT_ARTIFACT_MARKDOWN_EDITOR_LABELS = {
|
|
16
|
-
editor: "Document editor",
|
|
17
|
-
placeholder: "Start typing\u2026"
|
|
18
|
-
};
|
|
19
|
-
function ArtifactMarkdownEditor({
|
|
20
|
-
markdown,
|
|
21
|
-
onChange,
|
|
22
|
-
onNormalized,
|
|
23
|
-
dictation,
|
|
24
|
-
labels,
|
|
25
|
-
testId
|
|
26
|
-
}) {
|
|
27
|
-
const l = { ...DEFAULT_ARTIFACT_MARKDOWN_EDITOR_LABELS, ...labels };
|
|
28
|
-
const ref = react.useRef(null);
|
|
29
|
-
const pendingNormalizationRef = react.useRef(true);
|
|
30
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
31
|
-
"div",
|
|
32
|
-
{
|
|
33
|
-
role: "group",
|
|
34
|
-
"aria-label": l.editor,
|
|
35
|
-
"data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "artifact-markdown-editor" }),
|
|
36
|
-
className: "h-full pointer-coarse:[&_[role=toolbar]_button]:min-h-11 pointer-coarse:[&_[role=toolbar]_button]:min-w-11",
|
|
37
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
-
editor.MDXEditor,
|
|
39
|
-
{
|
|
40
|
-
ref,
|
|
41
|
-
markdown,
|
|
42
|
-
onChange: (next) => {
|
|
43
|
-
if (pendingNormalizationRef.current) {
|
|
44
|
-
pendingNormalizationRef.current = false;
|
|
45
|
-
onNormalized?.(next);
|
|
46
|
-
}
|
|
47
|
-
onChange(next);
|
|
48
|
-
},
|
|
49
|
-
contentEditableClassName: "markdown-content max-w-none px-6 py-4 outline-none min-h-full",
|
|
50
|
-
className: "h-full overflow-auto bg-background",
|
|
51
|
-
placeholder: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: l.placeholder }),
|
|
52
|
-
plugins: [
|
|
53
|
-
editor.headingsPlugin(),
|
|
54
|
-
editor.listsPlugin(),
|
|
55
|
-
editor.quotePlugin(),
|
|
56
|
-
editor.thematicBreakPlugin(),
|
|
57
|
-
editor.linkPlugin(),
|
|
58
|
-
editor.linkDialogPlugin(),
|
|
59
|
-
editor.tablePlugin(),
|
|
60
|
-
editor.markdownShortcutPlugin(),
|
|
61
|
-
editor.toolbarPlugin({
|
|
62
|
-
toolbarContents: () => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
63
|
-
/* @__PURE__ */ jsxRuntime.jsx(editor.UndoRedo, {}),
|
|
64
|
-
/* @__PURE__ */ jsxRuntime.jsx(editor.Separator, {}),
|
|
65
|
-
/* @__PURE__ */ jsxRuntime.jsx(editor.BoldItalicUnderlineToggles, {}),
|
|
66
|
-
/* @__PURE__ */ jsxRuntime.jsx(editor.Separator, {}),
|
|
67
|
-
/* @__PURE__ */ jsxRuntime.jsx(editor.BlockTypeSelect, {}),
|
|
68
|
-
/* @__PURE__ */ jsxRuntime.jsx(editor.ListsToggle, {}),
|
|
69
|
-
/* @__PURE__ */ jsxRuntime.jsx(editor.Separator, {}),
|
|
70
|
-
/* @__PURE__ */ jsxRuntime.jsx(editor.CreateLink, {}),
|
|
71
|
-
/* @__PURE__ */ jsxRuntime.jsx(editor.InsertTable, {}),
|
|
72
|
-
/* @__PURE__ */ jsxRuntime.jsx(editor.InsertThematicBreak, {}),
|
|
73
|
-
dictation && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
74
|
-
/* @__PURE__ */ jsxRuntime.jsx(editor.Separator, {}),
|
|
75
|
-
/* @__PURE__ */ jsxRuntime.jsx(DictationSlot, { render: dictation })
|
|
76
|
-
] })
|
|
77
|
-
] })
|
|
78
|
-
})
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
)
|
|
82
|
-
}
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
7
|
|
|
86
|
-
|
|
87
|
-
exports
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "ArtifactMarkdownEditor", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkRUNQFXPH_cjs.ArtifactMarkdownEditor; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "DEFAULT_ARTIFACT_MARKDOWN_EDITOR_LABELS", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunkRUNQFXPH_cjs.DEFAULT_ARTIFACT_MARKDOWN_EDITOR_LABELS; }
|
|
16
|
+
});
|
|
88
17
|
//# sourceMappingURL=index.cjs.map
|
|
89
18
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
|
@@ -1,86 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import { MDXEditor, headingsPlugin, listsPlugin, quotePlugin, thematicBreakPlugin, linkPlugin, linkDialogPlugin, tablePlugin, markdownShortcutPlugin, toolbarPlugin, UndoRedo, Separator, BoldItalicUnderlineToggles, BlockTypeSelect, ListsToggle, CreateLink, InsertTable, InsertThematicBreak, usePublisher, insertMarkdown$ } from '@mdxeditor/editor';
|
|
5
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
function DictationSlot({
|
|
8
|
-
render
|
|
9
|
-
}) {
|
|
10
|
-
const insertMarkdown = usePublisher(insertMarkdown$);
|
|
11
|
-
return /* @__PURE__ */ jsx(Fragment, { children: render(insertMarkdown) });
|
|
12
|
-
}
|
|
13
|
-
var DEFAULT_ARTIFACT_MARKDOWN_EDITOR_LABELS = {
|
|
14
|
-
editor: "Document editor",
|
|
15
|
-
placeholder: "Start typing\u2026"
|
|
16
|
-
};
|
|
17
|
-
function ArtifactMarkdownEditor({
|
|
18
|
-
markdown,
|
|
19
|
-
onChange,
|
|
20
|
-
onNormalized,
|
|
21
|
-
dictation,
|
|
22
|
-
labels,
|
|
23
|
-
testId
|
|
24
|
-
}) {
|
|
25
|
-
const l = { ...DEFAULT_ARTIFACT_MARKDOWN_EDITOR_LABELS, ...labels };
|
|
26
|
-
const ref = useRef(null);
|
|
27
|
-
const pendingNormalizationRef = useRef(true);
|
|
28
|
-
return /* @__PURE__ */ jsx(
|
|
29
|
-
"div",
|
|
30
|
-
{
|
|
31
|
-
role: "group",
|
|
32
|
-
"aria-label": l.editor,
|
|
33
|
-
"data-testid": testIdOr(testId, { testId: "artifact-markdown-editor" }),
|
|
34
|
-
className: "h-full pointer-coarse:[&_[role=toolbar]_button]:min-h-11 pointer-coarse:[&_[role=toolbar]_button]:min-w-11",
|
|
35
|
-
children: /* @__PURE__ */ jsx(
|
|
36
|
-
MDXEditor,
|
|
37
|
-
{
|
|
38
|
-
ref,
|
|
39
|
-
markdown,
|
|
40
|
-
onChange: (next) => {
|
|
41
|
-
if (pendingNormalizationRef.current) {
|
|
42
|
-
pendingNormalizationRef.current = false;
|
|
43
|
-
onNormalized?.(next);
|
|
44
|
-
}
|
|
45
|
-
onChange(next);
|
|
46
|
-
},
|
|
47
|
-
contentEditableClassName: "markdown-content max-w-none px-6 py-4 outline-none min-h-full",
|
|
48
|
-
className: "h-full overflow-auto bg-background",
|
|
49
|
-
placeholder: /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: l.placeholder }),
|
|
50
|
-
plugins: [
|
|
51
|
-
headingsPlugin(),
|
|
52
|
-
listsPlugin(),
|
|
53
|
-
quotePlugin(),
|
|
54
|
-
thematicBreakPlugin(),
|
|
55
|
-
linkPlugin(),
|
|
56
|
-
linkDialogPlugin(),
|
|
57
|
-
tablePlugin(),
|
|
58
|
-
markdownShortcutPlugin(),
|
|
59
|
-
toolbarPlugin({
|
|
60
|
-
toolbarContents: () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
61
|
-
/* @__PURE__ */ jsx(UndoRedo, {}),
|
|
62
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
63
|
-
/* @__PURE__ */ jsx(BoldItalicUnderlineToggles, {}),
|
|
64
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
65
|
-
/* @__PURE__ */ jsx(BlockTypeSelect, {}),
|
|
66
|
-
/* @__PURE__ */ jsx(ListsToggle, {}),
|
|
67
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
68
|
-
/* @__PURE__ */ jsx(CreateLink, {}),
|
|
69
|
-
/* @__PURE__ */ jsx(InsertTable, {}),
|
|
70
|
-
/* @__PURE__ */ jsx(InsertThematicBreak, {}),
|
|
71
|
-
dictation && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
72
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
73
|
-
/* @__PURE__ */ jsx(DictationSlot, { render: dictation })
|
|
74
|
-
] })
|
|
75
|
-
] })
|
|
76
|
-
})
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export { ArtifactMarkdownEditor, DEFAULT_ARTIFACT_MARKDOWN_EDITOR_LABELS };
|
|
2
|
+
export { ArtifactMarkdownEditor, DEFAULT_ARTIFACT_MARKDOWN_EDITOR_LABELS } from '../../chunk-HSFGOA6V.js';
|
|
3
|
+
import '../../chunk-7F6CBP3Z.js';
|
|
85
4
|
//# sourceMappingURL=index.js.map
|
|
86
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|