@molecule/app-ide-react 1.20.3 → 1.20.4
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/components/BackgroundTasksStrip.d.ts.map +1 -1
- package/dist/components/BackgroundTasksStrip.js +5 -1
- package/dist/components/BackgroundTasksStrip.js.map +1 -1
- package/dist/components/ChatPanel.d.ts.map +1 -1
- package/dist/components/ChatPanel.js +10 -1
- package/dist/components/ChatPanel.js.map +1 -1
- package/dist/components/DockStrip.d.ts +24 -2
- package/dist/components/DockStrip.d.ts.map +1 -1
- package/dist/components/DockStrip.js +52 -3
- package/dist/components/DockStrip.js.map +1 -1
- package/dist/components/PlanCard.d.ts +5 -1
- package/dist/components/PlanCard.d.ts.map +1 -1
- package/dist/components/PlanCard.js +14 -4
- package/dist/components/PlanCard.js.map +1 -1
- package/dist/components/WorkCard.d.ts +8 -6
- package/dist/components/WorkCard.d.ts.map +1 -1
- package/dist/components/WorkCard.js +39 -15
- package/dist/components/WorkCard.js.map +1 -1
- package/package.json +2 -2
|
@@ -8,8 +8,26 @@
|
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
10
|
import type { JSX, ReactNode } from 'react';
|
|
11
|
+
/**
|
|
12
|
+
* The slots of the one-row work tray (see WorkCard). When a {@link DockStrip}
|
|
13
|
+
* sits inside it, the strip draws a compact chip into `headerEl` and, while it
|
|
14
|
+
* is the open one, its detail into `detailEl` — so every section shares a
|
|
15
|
+
* single row instead of stacking one bar each.
|
|
16
|
+
*/
|
|
17
|
+
export interface WorkTrayValue {
|
|
18
|
+
/** Where the chips go. Null until the tray has mounted. */
|
|
19
|
+
headerEl: HTMLElement | null;
|
|
20
|
+
/** Where the open section's detail goes. */
|
|
21
|
+
detailEl: HTMLElement | null;
|
|
22
|
+
/** The open section's `molId`, if any. */
|
|
23
|
+
openId: string | null;
|
|
24
|
+
/** Open this section (or close it, when it is already the open one). */
|
|
25
|
+
toggle: (id: string) => void;
|
|
26
|
+
}
|
|
27
|
+
/** Provided by the work tray; absent when a strip stands alone. */
|
|
28
|
+
export declare const WorkTrayContext: import("react").Context<WorkTrayValue | null>;
|
|
11
29
|
/** The states a strip row can be in. */
|
|
12
|
-
export type StatusMarkState = 'done' | 'active' | 'todo' | 'failed';
|
|
30
|
+
export type StatusMarkState = 'done' | 'active' | 'todo' | 'failed' | 'waiting' | 'stopped';
|
|
13
31
|
/**
|
|
14
32
|
* One status icon for every strip row: the landing page's green check circle
|
|
15
33
|
* when done, the platform's molecule spinner while active, a red crossed circle
|
|
@@ -37,6 +55,10 @@ export interface DockStripProps {
|
|
|
37
55
|
icon?: ReactNode;
|
|
38
56
|
/** The strip's one-line summary. */
|
|
39
57
|
label: ReactNode;
|
|
58
|
+
/** A shorter label for the tray chip (defaults to `label`). */
|
|
59
|
+
chipLabel?: ReactNode;
|
|
60
|
+
/** Hover text for the tray chip. */
|
|
61
|
+
chipTitle?: string;
|
|
40
62
|
/** Quieter text after the label (the thing in flight). */
|
|
41
63
|
hint?: ReactNode;
|
|
42
64
|
/** Right-hand readout and action buttons; clicks must stop propagation. */
|
|
@@ -51,5 +73,5 @@ export interface DockStripProps {
|
|
|
51
73
|
* @param props - See {@link DockStripProps}.
|
|
52
74
|
* @returns The strip.
|
|
53
75
|
*/
|
|
54
|
-
export declare function DockStrip({ molId, toggleMolId, expanded, onToggle, icon, label, hint, actions, rootProps, children, }: DockStripProps): JSX.Element;
|
|
76
|
+
export declare function DockStrip({ molId, toggleMolId, expanded, onToggle, icon, label, chipLabel, chipTitle, hint, actions, rootProps, children, }: DockStripProps): JSX.Element | null;
|
|
55
77
|
//# sourceMappingURL=DockStrip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DockStrip.d.ts","sourceRoot":"","sources":["../../src/components/DockStrip.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CA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SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,sCAAsC;IACtC,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,SAAS,EACT,SAAS,EACT,IAAI,EACJ,OAAO,EACP,SAAS,EACT,QAAQ,GACT,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAmJrC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useId } from 'react';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useId } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
3
4
|
import { useThemeMode } from '@molecule/app-react';
|
|
4
5
|
import { getClassMap } from '@molecule/app-ui';
|
|
5
6
|
import { moleculeSpinnerMarkSvg } from '@molecule/app-ui';
|
|
6
7
|
const MARK_SIZE = 16;
|
|
8
|
+
/** Provided by the work tray; absent when a strip stands alone. */
|
|
9
|
+
export const WorkTrayContext = createContext(null);
|
|
7
10
|
/**
|
|
8
11
|
* One status icon for every strip row: the landing page's green check circle
|
|
9
12
|
* when done, the platform's molecule spinner while active, a red crossed circle
|
|
@@ -30,6 +33,26 @@ export function StatusMark({ state, size = MARK_SIZE, }) {
|
|
|
30
33
|
border: `1.5px solid ${isLight ? '#afb8c1' : '#6e7681'}`,
|
|
31
34
|
} }));
|
|
32
35
|
}
|
|
36
|
+
if (state === 'waiting' || state === 'stopped') {
|
|
37
|
+
// Not running: a still ring that says why — a question mark when the person
|
|
38
|
+
// has to answer, a dash when the work simply stopped.
|
|
39
|
+
const ink = state === 'waiting' ? (isLight ? '#9a6700' : '#e3b341') : isLight ? '#6e7781' : '#8b949e';
|
|
40
|
+
return (_jsx("span", { "aria-hidden": true, style: {
|
|
41
|
+
display: 'inline-flex',
|
|
42
|
+
flexShrink: 0,
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
boxSizing: 'border-box',
|
|
46
|
+
width: size,
|
|
47
|
+
height: size,
|
|
48
|
+
borderRadius: '50%',
|
|
49
|
+
border: `1px solid ${ink}`,
|
|
50
|
+
color: ink,
|
|
51
|
+
fontSize: size * 0.7,
|
|
52
|
+
fontWeight: 700,
|
|
53
|
+
lineHeight: 1,
|
|
54
|
+
}, children: state === 'waiting' ? '?' : '–' }));
|
|
55
|
+
}
|
|
33
56
|
const failed = state === 'failed';
|
|
34
57
|
const ink = failed ? (isLight ? '#cf222e' : '#f47067') : isLight ? '#1e7a00' : '#5bb98c';
|
|
35
58
|
const tint = failed
|
|
@@ -58,8 +81,34 @@ export function StatusMark({ state, size = MARK_SIZE, }) {
|
|
|
58
81
|
* @param props - See {@link DockStripProps}.
|
|
59
82
|
* @returns The strip.
|
|
60
83
|
*/
|
|
61
|
-
export function DockStrip({ molId, toggleMolId, expanded, onToggle, icon, label, hint, actions, rootProps, children, }) {
|
|
84
|
+
export function DockStrip({ molId, toggleMolId, expanded, onToggle, icon, label, chipLabel, chipTitle, hint, actions, rootProps, children, }) {
|
|
62
85
|
const cm = getClassMap();
|
|
86
|
+
const tray = useContext(WorkTrayContext);
|
|
87
|
+
if (tray) {
|
|
88
|
+
if (!tray.headerEl)
|
|
89
|
+
return null;
|
|
90
|
+
const open = tray.openId === molId;
|
|
91
|
+
return (_jsxs(_Fragment, { children: [createPortal(_jsxs("div", { "data-mol-id": molId, ...rootProps, style: { display: 'inline-flex', alignItems: 'center', gap: 6, maxWidth: '100%' }, children: [_jsxs("div", { role: "button", tabIndex: 0, "data-mol-id": toggleMolId, "aria-expanded": open, title: chipTitle, onClick: () => tray.toggle(molId), onKeyDown: (e) => {
|
|
92
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
tray.toggle(molId);
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
/* mol-bespoke-button: a work-tray CHIP — status icon and short label that
|
|
98
|
+
opens its section's detail; a disclosure toggle, not a CTA. */
|
|
99
|
+
style: {
|
|
100
|
+
display: 'inline-flex',
|
|
101
|
+
alignItems: 'center',
|
|
102
|
+
gap: 6,
|
|
103
|
+
minWidth: 0,
|
|
104
|
+
padding: '2px 8px',
|
|
105
|
+
borderRadius: 6,
|
|
106
|
+
cursor: 'pointer',
|
|
107
|
+
background: open ? 'rgba(128,128,128,0.18)' : 'rgba(128,128,128,0.08)',
|
|
108
|
+
}, children: [icon, _jsx("span", { className: cm.cn(cm.textMuted, cm.textSize('xs')), style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }, children: chipLabel ?? label })] }), actions] }), tray.headerEl), open && children && tray.detailEl
|
|
109
|
+
? createPortal(_jsx("div", { "data-mol-id": `${molId}-detail`, style: { padding: '2px 10px 8px' }, children: children }), tray.detailEl)
|
|
110
|
+
: null] }));
|
|
111
|
+
}
|
|
63
112
|
return (_jsxs("div", { "data-mol-id": molId, ...rootProps, style: { borderTop: '1px solid rgba(128,128,128,0.15)', padding: '8px 8px 8px 10px' }, children: [_jsxs("div", { role: "button", tabIndex: 0, "data-mol-id": toggleMolId, "aria-expanded": expanded, onClick: onToggle, onKeyDown: (e) => {
|
|
64
113
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
65
114
|
e.preventDefault();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DockStrip.js","sourceRoot":"","sources":["../../src/components/DockStrip.tsx"],"names":[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.todos - The latest task list.
|
|
9
9
|
* @returns The plan strip, or nothing when the list is empty.
|
|
10
10
|
*/
|
|
11
|
-
export declare function PlanCard({ todos }: {
|
|
11
|
+
export declare function PlanCard({ todos, live, awaitingUser, }: {
|
|
12
12
|
todos: ReadonlyArray<TaskListRow>;
|
|
13
|
+
/** Whether a turn is running. A step still "in progress" with no turn running is not progressing. */
|
|
14
|
+
live?: boolean;
|
|
15
|
+
/** Whether the turn is paused on a question to the person. */
|
|
16
|
+
awaitingUser?: boolean;
|
|
13
17
|
}): JSX.Element | null;
|
|
14
18
|
/**
|
|
15
19
|
* The latest plan in a transcript: the most recent `update_task_list` call's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanCard.d.ts","sourceRoot":"","sources":["../../src/components/PlanCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAOhC,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"PlanCard.d.ts","sourceRoot":"","sources":["../../src/components/PlanCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAOhC,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAanF;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,IAAW,EACX,YAAoB,GACrB,EAAE;IACD,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,CAAA;IACjC,qGAAqG;IACrG,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,8DAA8D;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAqErB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;CAC9D,CAAC,GACD,WAAW,EAAE,CAUf"}
|
|
@@ -9,6 +9,10 @@ const MARK = {
|
|
|
9
9
|
in_progress: 'active',
|
|
10
10
|
pending: 'todo',
|
|
11
11
|
};
|
|
12
|
+
/** The mark for a step still in progress: a spinner only while a turn is actually running. */
|
|
13
|
+
function inProgressMark(live, awaitingUser) {
|
|
14
|
+
return live ? 'active' : awaitingUser ? 'waiting' : 'stopped';
|
|
15
|
+
}
|
|
12
16
|
/**
|
|
13
17
|
* The working plan, one of the strips above the composer. It is not part of the
|
|
14
18
|
* transcript: every `update_task_list` call re-draws this one strip instead of
|
|
@@ -17,24 +21,30 @@ const MARK = {
|
|
|
17
21
|
* @param props.todos - The latest task list.
|
|
18
22
|
* @returns The plan strip, or nothing when the list is empty.
|
|
19
23
|
*/
|
|
20
|
-
export function PlanCard({ todos }) {
|
|
24
|
+
export function PlanCard({ todos, live = true, awaitingUser = false, }) {
|
|
21
25
|
const cm = getClassMap();
|
|
22
26
|
const [expanded, setExpanded] = useState(true);
|
|
23
27
|
if (todos.length === 0)
|
|
24
28
|
return null;
|
|
25
29
|
const completed = todos.filter((todo) => todo.status === 'completed').length;
|
|
26
30
|
const current = todos.find((todo) => todo.status === 'in_progress');
|
|
27
|
-
|
|
31
|
+
const stuckMark = inProgressMark(live, awaitingUser);
|
|
32
|
+
const stuckNote = live
|
|
33
|
+
? undefined
|
|
34
|
+
: awaitingUser
|
|
35
|
+
? t('ide.work.waiting', undefined, { defaultValue: 'Waiting for your answer' })
|
|
36
|
+
: t('ide.work.stopped', undefined, { defaultValue: 'Stopped before finishing' });
|
|
37
|
+
return (_jsx(DockStrip, { molId: "task-list-card", toggleMolId: "task-list-toggle", expanded: expanded, onToggle: () => setExpanded((open) => !open), label: t('ide.chat.taskListTitle', undefined, { defaultValue: 'Working plan' }), hint: !expanded && current ? `· ${current.content}` : undefined, chipLabel: t('ide.work.plan', { done: completed, total: todos.length }, { defaultValue: 'Plan {{done}}/{{total}}' }), chipTitle: current ? [current.content, stuckNote].filter(Boolean).join(' — ') : undefined, icon: _jsx(StatusMark, { state: current ? stuckMark : completed === todos.length ? 'done' : 'todo', size: 14 }), children: _jsx("div", { style: { maxHeight: '168px', overflowY: 'auto' }, children: todos.map((todo, i) => (_jsxs("div", { "data-mol-id": "task-list-row", className: cm.textSize('xs'), style: {
|
|
28
38
|
display: 'flex',
|
|
29
39
|
alignItems: 'flex-start',
|
|
30
40
|
gap: 8,
|
|
31
41
|
padding: '3px 0',
|
|
32
42
|
...(todo.status === 'completed' ? { opacity: 0.55 } : {}),
|
|
33
|
-
}, children: [_jsx("span", { style: { flexShrink: 0, display: 'inline-flex', paddingTop: 1 }, children: _jsx(StatusMark, { state: MARK[todo.status] }) }),
|
|
43
|
+
}, children: [_jsx("span", { style: { flexShrink: 0, display: 'inline-flex', paddingTop: 1 }, children: _jsx(StatusMark, { state: todo.status === 'in_progress' ? stuckMark : MARK[todo.status] }) }), _jsxs("span", { style: {
|
|
34
44
|
flex: 1,
|
|
35
45
|
minWidth: 0,
|
|
36
46
|
...(todo.status === 'completed' ? { textDecoration: 'line-through' } : {}),
|
|
37
|
-
}, children: todo.content })] }, i))) }) }));
|
|
47
|
+
}, children: [todo.content, todo.status === 'in_progress' && stuckNote ? (_jsx("span", { className: cm.textMuted, children: ` — ${stuckNote}` })) : null] })] }, i))) }) }));
|
|
38
48
|
}
|
|
39
49
|
/**
|
|
40
50
|
* The latest plan in a transcript: the most recent `update_task_list` call's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanCard.js","sourceRoot":"","sources":["../../src/components/PlanCard.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAA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AAC,CAAC,EAAE,CAAC;yBAC3E,aAEA,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,MAAM,KAAK,aAAa,IAAI,SAAS,CAAC,CAAC,CAAC,CAC5C,eAAM,SAAS,EAAE,EAAE,CAAC,SAAS,YAAG,MAAM,SAAS,EAAE,GAAQ,CAC1D,CAAC,CAAC,CAAC,IAAI,IACH,KAzBF,CAAC,CA0BF,CACP,CAAC,GACE,GACI,CACb,CAAA;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACxB,QAEE;IAEF,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAA;QACzC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,kBAAkB;gBAAE,SAAQ;YAClD,MAAM,IAAI,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;YACnD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAA;QAClC,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { JSX, ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* The
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* The work tray: one full-width row of chips — plan, background tasks, tests,
|
|
4
|
+
* uncommitted files — that sits UNDER the composer's rounded top edge like a
|
|
5
|
+
* layer behind it. Each section is a `DockStrip` that draws its chip into the
|
|
6
|
+
* row and, when its chip is open, its detail below it; one section is open at a
|
|
7
|
+
* time. The tray has a top, left and right border and no bottom edge: the
|
|
8
|
+
* composer is drawn over its lower 8px.
|
|
7
9
|
* @param props - Component props.
|
|
8
|
-
* @param props.children - The sections (strips)
|
|
9
|
-
* @returns The
|
|
10
|
+
* @param props.children - The sections (strips).
|
|
11
|
+
* @returns The tray.
|
|
10
12
|
*/
|
|
11
13
|
export declare function WorkCard({ children }: {
|
|
12
14
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkCard.d.ts","sourceRoot":"","sources":["../../src/components/WorkCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"WorkCard.d.ts","sourceRoot":"","sources":["../../src/components/WorkCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAO3C;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CA+C3E"}
|
|
@@ -1,23 +1,47 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
2
3
|
import { useThemeMode } from '@molecule/app-react';
|
|
4
|
+
import { WorkTrayContext } from './DockStrip.js';
|
|
3
5
|
/**
|
|
4
|
-
* The
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* The work tray: one full-width row of chips — plan, background tasks, tests,
|
|
7
|
+
* uncommitted files — that sits UNDER the composer's rounded top edge like a
|
|
8
|
+
* layer behind it. Each section is a `DockStrip` that draws its chip into the
|
|
9
|
+
* row and, when its chip is open, its detail below it; one section is open at a
|
|
10
|
+
* time. The tray has a top, left and right border and no bottom edge: the
|
|
11
|
+
* composer is drawn over its lower 8px.
|
|
8
12
|
* @param props - Component props.
|
|
9
|
-
* @param props.children - The sections (strips)
|
|
10
|
-
* @returns The
|
|
13
|
+
* @param props.children - The sections (strips).
|
|
14
|
+
* @returns The tray.
|
|
11
15
|
*/
|
|
12
16
|
export function WorkCard({ children }) {
|
|
13
17
|
const isLight = useThemeMode() === 'light';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
const [headerEl, setHeaderEl] = useState(null);
|
|
19
|
+
const [detailEl, setDetailEl] = useState(null);
|
|
20
|
+
const [openId, setOpenId] = useState(null);
|
|
21
|
+
const value = useMemo(() => ({
|
|
22
|
+
headerEl,
|
|
23
|
+
detailEl,
|
|
24
|
+
openId,
|
|
25
|
+
toggle: (id) => setOpenId((current) => (current === id ? null : id)),
|
|
26
|
+
}), [headerEl, detailEl, openId]);
|
|
27
|
+
const border = isLight ? '#d0d7de' : '#3d444d';
|
|
28
|
+
return (_jsx(WorkTrayContext.Provider, { value: value, children: _jsxs("div", { "data-mol-id": "work-card", style: {
|
|
29
|
+
flexShrink: 0,
|
|
30
|
+
position: 'relative',
|
|
31
|
+
boxSizing: 'border-box',
|
|
32
|
+
// Tucked 8px under the composer, which is drawn on top of it.
|
|
33
|
+
marginBottom: -8,
|
|
34
|
+
paddingBottom: 8,
|
|
35
|
+
borderRadius: '8px 8px 0 0',
|
|
36
|
+
border: `1px solid ${border}`,
|
|
37
|
+
borderBottom: 'none',
|
|
38
|
+
background: isLight ? '#f6f8fa' : 'rgba(255,255,255,0.04)',
|
|
39
|
+
}, children: [_jsx("div", { ref: setHeaderEl, style: {
|
|
40
|
+
display: 'flex',
|
|
41
|
+
flexWrap: 'wrap',
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
gap: 6,
|
|
44
|
+
padding: '6px 10px',
|
|
45
|
+
} }), _jsx("div", { ref: setDetailEl, style: { maxHeight: 220, overflowY: 'auto' } }), children] }) }));
|
|
22
46
|
}
|
|
23
47
|
//# sourceMappingURL=WorkCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkCard.js","sourceRoot":"","sources":["../../src/components/WorkCard.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"WorkCard.js","sourceRoot":"","sources":["../../src/components/WorkCard.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,QAAQ,EAA2B;IAC5D,MAAM,OAAO,GAAG,YAAY,EAAE,KAAK,OAAO,CAAA;IAC1C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAqB,IAAI,CAAC,CAAA;IAClE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAqB,IAAI,CAAC,CAAA;IAClE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAA;IACzD,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC;QACL,QAAQ;QACR,QAAQ;QACR,MAAM;QACN,MAAM,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;KAC7E,CAAC,EACF,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAC7B,CAAA;IACD,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;IAC9C,OAAO,CACL,KAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACpC,8BACc,WAAW,EACvB,KAAK,EAAE;gBACL,UAAU,EAAE,CAAC;gBACb,QAAQ,EAAE,UAAU;gBACpB,SAAS,EAAE,YAAY;gBACvB,8DAA8D;gBAC9D,YAAY,EAAE,CAAC,CAAC;gBAChB,aAAa,EAAE,CAAC;gBAChB,YAAY,EAAE,aAAa;gBAC3B,MAAM,EAAE,aAAa,MAAM,EAAE;gBAC7B,YAAY,EAAE,MAAM;gBACpB,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,wBAAwB;aAC3D,aAED,cACE,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE;wBACL,OAAO,EAAE,MAAM;wBACf,QAAQ,EAAE,MAAM;wBAChB,UAAU,EAAE,QAAQ;wBACpB,GAAG,EAAE,CAAC;wBACN,OAAO,EAAE,UAAU;qBACpB,GACD,EACF,cAAK,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,GAAI,EACtE,QAAQ,IACL,GACmB,CAC5B,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-ide-react",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.4",
|
|
4
4
|
"description": "React IDE components for molecule.dev workspace",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@molecule/app-i18n": "1.0.3",
|
|
63
63
|
"@molecule/app-icons": "1.0.2",
|
|
64
64
|
"@molecule/app-live-preview": "1.0.2",
|
|
65
|
-
"@molecule/app-locales-ide": "1.10.
|
|
65
|
+
"@molecule/app-locales-ide": "1.10.8",
|
|
66
66
|
"@molecule/app-logger": "1.0.2",
|
|
67
67
|
"@molecule/app-react": "1.6.2",
|
|
68
68
|
"@molecule/app-storage": "1.0.2",
|