@cueloop/client 0.1.0-alpha.31 → 0.1.0-alpha.33
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 +5 -5
- package/src/App.autoclose.test.tsx +4 -3
- package/src/App.diff.test.tsx +5 -2
- package/src/App.export.test.tsx +5 -7
- package/src/App.plan-review.test.tsx +14 -17
- package/src/App.readonly.test.tsx +9 -7
- package/src/App.rendering.test.tsx +6 -2
- package/src/App.review-panel.test.tsx +19 -14
- package/src/App.submit-confirm.test.tsx +6 -7
- package/src/App.test.tsx +8 -5
- package/src/App.toast.test.tsx +68 -0
- package/src/App.tsx +154 -50
- package/src/App.walk.test.tsx +7 -4
- package/src/components/AnnotationCard.stories.tsx +1 -1
- package/src/components/AnnotationCard.tsx +18 -13
- package/src/components/CompletionOverlay.tsx +1 -1
- package/src/components/ConfirmCard.tsx +1 -0
- package/src/components/ConfirmDialog.stories.tsx +1 -1
- package/src/components/ConfirmDialog.tsx +1 -1
- package/src/components/DiffSheet.stories.tsx +21 -3
- package/src/components/DiffSheet.tsx +45 -19
- package/src/components/InboxList.stories.tsx +1 -1
- package/src/components/InboxList.tsx +3 -3
- package/src/components/KeybindsDialog.stories.tsx +31 -0
- package/src/components/KeybindsDialog.tsx +42 -0
- package/src/components/MenuBar.stories.tsx +33 -0
- package/src/components/MenuBar.tsx +58 -0
- package/src/components/PlanSheet.stories.tsx +2 -2
- package/src/components/PlanSheet.tsx +26 -75
- package/src/components/PromptDialog.stories.tsx +2 -2
- package/src/components/PromptDialog.tsx +1 -1
- package/src/components/ReviewPanel.stories.tsx +5 -17
- package/src/components/ReviewPanel.tsx +10 -29
- package/src/components/ReviewRail.stories.tsx +39 -0
- package/src/components/ReviewRail.tsx +62 -57
- package/src/components/SettingsDialog.stories.tsx +1 -1
- package/src/components/SettingsDialog.tsx +4 -3
- package/src/components/SettingsRows.stories.tsx +1 -1
- package/src/components/SettingsRows.tsx +1 -1
- package/src/components/Toast.stories.tsx +12 -0
- package/src/components/Toast.tsx +29 -0
- package/src/components/WalkWizard.stories.tsx +1 -1
- package/src/components/WalkWizard.tsx +1 -1
- package/src/components/__snapshots__/stories.test.tsx.snap +598 -566
- package/src/components/primitives/Button.stories.tsx +2 -2
- package/src/components/primitives/Dialog.stories.tsx +1 -1
- package/src/components/primitives/Dialog.tsx +7 -5
- package/src/components/primitives/Tabs.tsx +19 -38
- package/src/components/stories-app.tsx +1 -1
- package/src/components/stories.test.tsx +2 -0
- package/src/key-bindings.test.ts +4 -4
- package/src/key-bindings.ts +41 -2
- package/src/serve.test.ts +2 -2
- package/src/session-controller.share.test.ts +13 -0
- package/src/session-controller.ts +19 -1
- package/src/test-support.test.ts +55 -0
- package/src/test-support.ts +113 -23
- package/src/theme.ts +16 -16
- package/src/version.ts +5 -0
- package/src/components/ComposeBar.stories.tsx +0 -18
- package/src/components/ComposeBar.tsx +0 -54
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { DARK } from "../theme";
|
|
3
|
-
import type { Story, StoryMeta } from "./story";
|
|
4
|
-
import { ComposeBar } from "./ComposeBar";
|
|
5
|
-
|
|
6
|
-
export const meta: StoryMeta = { title: "ComposeBar" };
|
|
7
|
-
|
|
8
|
-
export const CommentOnLine: Story = {
|
|
9
|
-
render: () => (
|
|
10
|
-
<ComposeBar kind="comment" quote=" private items = new Map();" text="Map needs an eviction story." onInput={() => {}} />
|
|
11
|
-
),
|
|
12
|
-
expectedColors: [DARK.accent, DARK.elevated],
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const SuggestionOnLine: Story = {
|
|
16
|
-
render: () => <ComposeBar kind="suggestion" quote="export class Store {" text="" onInput={() => {}} />,
|
|
17
|
-
expectedColors: [DARK.green],
|
|
18
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bottom compose bar - the diff view composes annotation bodies here. The
|
|
3
|
-
* editor is the same multiline textarea contract as the inline composer:
|
|
4
|
-
* ⏎ saves through the grammar, shift+⏎ adds a line.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { useRef } from "react";
|
|
8
|
-
import type { KeyBinding, TextareaRenderable } from "@opentui/core";
|
|
9
|
-
import type { Theme } from "../theme";
|
|
10
|
-
import { useComponentTheme } from "./theme-context";
|
|
11
|
-
import { truncateToSingleLine } from "./truncate-text";
|
|
12
|
-
|
|
13
|
-
export interface ComposeBarProps {
|
|
14
|
-
kind: "comment" | "suggestion";
|
|
15
|
-
quote: string;
|
|
16
|
-
text: string;
|
|
17
|
-
onInput: (text: string) => void;
|
|
18
|
-
theme?: Theme;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const COMPOSE_KEY_BINDINGS: KeyBinding[] = [
|
|
22
|
-
{ name: "return", action: "submit" },
|
|
23
|
-
{ name: "return", shift: true, action: "newline" },
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
export function ComposeBar({ kind, quote, text, onInput, theme }: ComposeBarProps): React.ReactNode {
|
|
27
|
-
const tokens = useComponentTheme(theme);
|
|
28
|
-
const editorRef = useRef<TextareaRenderable | null>(null);
|
|
29
|
-
const editorRows = Math.min(4, Math.max(1, text.split("\n").length));
|
|
30
|
-
return (
|
|
31
|
-
<box style={{ height: 1 + editorRows, backgroundColor: tokens.elevated, flexDirection: "column", paddingLeft: 1 }}>
|
|
32
|
-
<text fg={kind === "suggestion" ? tokens.green : tokens.accent}>
|
|
33
|
-
{kind === "suggestion" ? "SUGGEST REPLACEMENT FOR" : "COMMENT ON"} “{truncateToSingleLine(quote, 60)}” · ⏎ save · esc cancel
|
|
34
|
-
</text>
|
|
35
|
-
<textarea
|
|
36
|
-
ref={editorRef}
|
|
37
|
-
focused
|
|
38
|
-
initialValue=""
|
|
39
|
-
keyBindings={COMPOSE_KEY_BINDINGS}
|
|
40
|
-
onContentChange={() => {
|
|
41
|
-
const editor = editorRef.current;
|
|
42
|
-
if (editor) onInput(editor.plainText);
|
|
43
|
-
}}
|
|
44
|
-
style={{
|
|
45
|
-
height: editorRows,
|
|
46
|
-
backgroundColor: tokens.elevated,
|
|
47
|
-
focusedBackgroundColor: tokens.elevated,
|
|
48
|
-
textColor: tokens.text,
|
|
49
|
-
focusedTextColor: tokens.text,
|
|
50
|
-
}}
|
|
51
|
-
/>
|
|
52
|
-
</box>
|
|
53
|
-
);
|
|
54
|
-
}
|