@molecule/app-ide-react 1.0.4 → 1.1.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/README.md +11 -1
- package/dist/components/ChatPanel.d.ts.map +1 -1
- package/dist/components/ChatPanel.js +30 -26
- package/dist/components/ChatPanel.js.map +1 -1
- package/dist/customEventCards.d.ts +10 -0
- package/dist/customEventCards.d.ts.map +1 -1
- package/dist/customEventCards.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-08-
|
|
6
|
+
Generated: 2026-08-12T21:41:36.283Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-ide-react
|
|
@@ -178,6 +178,16 @@ interface ChatEventCardAction {
|
|
|
178
178
|
* `/report` or a skill name — so it stands out from prose while staying clickable.
|
|
179
179
|
*/
|
|
180
180
|
code?: boolean
|
|
181
|
+
/**
|
|
182
|
+
* Semantic design-system button color. When set, the card renders this action
|
|
183
|
+
* as a real `cm.button` (the ClassMap's standard tinted button, same as every
|
|
184
|
+
* other button in the app) in this color, so a CTA looks identical wherever it
|
|
185
|
+
* appears — e.g. an app can keep "Sign up" `primary` and "Log in" `success`
|
|
186
|
+
* across its auth page, banners, and chat cards. When omitted, the card's
|
|
187
|
+
* legacy accent-outline treatment applies. The app owns the semantics; the
|
|
188
|
+
* shared package just passes the color through to the ClassMap.
|
|
189
|
+
*/
|
|
190
|
+
color?: 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info'
|
|
181
191
|
}
|
|
182
192
|
```
|
|
183
193
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatPanel.d.ts","sourceRoot":"","sources":["../../src/components/ChatPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAa,MAAM,OAAO,CAAA;AAY3C,OAAO,KAAK,EAAa,WAAW,EAAmB,MAAM,uBAAuB,CAAA;AAsCpF,OAAO,KAAK,EAAE,cAAc,EAAoB,eAAe,EAAE,MAAM,aAAa,CAAA;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AA0BvD,OAAO,KAAK,EAAsB,SAAS,EAAE,MAAM,gCAAgC,CAAA;AA6KnF,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAgND,UAAU,WAAW;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;
|
|
1
|
+
{"version":3,"file":"ChatPanel.d.ts","sourceRoot":"","sources":["../../src/components/ChatPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAa,MAAM,OAAO,CAAA;AAY3C,OAAO,KAAK,EAAa,WAAW,EAAmB,MAAM,uBAAuB,CAAA;AAsCpF,OAAO,KAAK,EAAE,cAAc,EAAoB,eAAe,EAAE,MAAM,aAAa,CAAA;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AA0BvD,OAAO,KAAK,EAAsB,SAAS,EAAE,MAAM,gCAAgC,CAAA;AA6KnF,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,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AM,CAAA;IAClB,uFAAuF;IACvF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAg5OD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,eAAe,EACf,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,wBAA+B,EAC/B,cAAc,EAAE,wBAAwB,EACxC,OAAO,EAAE,iBAAiB,EAC1B,gBAAgB,EAAE,0BAA0B,EAC5C,eAAe,EAAE,qBAAqB,EACtC,gBAAgB,EAAE,sBAAsB,EACxC,kBAAkB,EAAE,wBAAwB,EAC5C,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,0BAA0B,EAC1B,2BAA2B,EAC3B,cAAc,EACd,iBAAiB,EACjB,KAAK,EACL,eAAe,EACf,uBAAuB,EACvB,UAAU,EACV,SAAS,EACT,WAAW,EACX,OAAO,EACP,WAAW,EACX,SAAS,GACV,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CA2b9B;yBA7ee,SAAS"}
|
|
@@ -739,6 +739,19 @@ function NoticeCard({ tone, text, content, action, icon: iconOverride, }) {
|
|
|
739
739
|
...chatCardStyle(accent),
|
|
740
740
|
lineHeight: 1.5,
|
|
741
741
|
}, children: [_jsx(Icon, { name: icon, size: CHAT_CARD_ICON_SIZE, "aria-hidden": "true", style: { flexShrink: 0, marginTop: 1, color: accent } }), _jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [content ? (content.map((seg, i) => renderCardSegment(seg, i))) : (_jsx("span", { style: multiLine ? { whiteSpace: 'pre-wrap' } : undefined, children: text })), !content && actions.length > 0 && (_jsx("div", { style: { display: 'flex', flexWrap: 'wrap', gap: 8, marginTop: 8 }, children: actions.map((act, i) => {
|
|
742
|
+
// An action with a semantic `color` renders as a REAL design-system
|
|
743
|
+
// button (`cm.button`, sm) so the same CTA looks identical wherever
|
|
744
|
+
// the app shows it (auth page, banners, chat cards). No inline
|
|
745
|
+
// colors — the ClassMap owns the look, including hover states.
|
|
746
|
+
// Colorless actions keep the legacy accent-outline treatment.
|
|
747
|
+
if (act.color) {
|
|
748
|
+
const className = cm.cn(cm.button({ color: act.color, size: 'sm' }), cm.touchTarget);
|
|
749
|
+
const coloredStyle = {
|
|
750
|
+
textDecoration: 'none',
|
|
751
|
+
fontFamily: act.code ? 'var(--mol-font-mono, monospace)' : 'inherit',
|
|
752
|
+
};
|
|
753
|
+
return act.href ? (_jsx("a", { href: act.href, target: act.href.startsWith('http') ? '_blank' : undefined, rel: act.href.startsWith('http') ? 'noopener noreferrer' : undefined, className: className, style: coloredStyle, children: act.label }, i)) : (_jsx("button", { type: "button", onClick: act.onClick, className: className, style: coloredStyle, children: act.label }, i));
|
|
754
|
+
}
|
|
742
755
|
const style = {
|
|
743
756
|
display: 'inline-flex',
|
|
744
757
|
alignItems: 'center',
|
|
@@ -2661,38 +2674,29 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
2661
2674
|
const messagesContainerRef = useRef(null);
|
|
2662
2675
|
const userScrolledUpRef = useRef(false);
|
|
2663
2676
|
const sentInitialRef = useRef(null);
|
|
2664
|
-
//
|
|
2665
|
-
//
|
|
2666
|
-
//
|
|
2677
|
+
// "Should we stick to the bottom?" — derived ONLY from the actual scroll
|
|
2678
|
+
// position after a scroll event, never from touch direction or content size.
|
|
2679
|
+
//
|
|
2680
|
+
// Why the `scroll` event and not wheel/touch: a streaming burst GROWS the
|
|
2681
|
+
// content (scrollHeight rises) WITHOUT firing `scroll`, so growth alone can
|
|
2682
|
+
// never be mistaken for "the user scrolled up" — only a real move of the
|
|
2683
|
+
// viewport does. The autoscroll pins straight to the bottom (no smooth
|
|
2684
|
+
// animation), so its own programmatic `scroll` lands at distance 0 and keeps
|
|
2685
|
+
// the flag false. A user drag up past the threshold flips it true; dragging
|
|
2686
|
+
// back to the bottom flips it false and auto-scroll resumes. This replaces the
|
|
2687
|
+
// old wheel/touch detector whose touchmove LATCHED true on any downward drag
|
|
2688
|
+
// and only cleared on an up-swipe — a single tap after boot permanently killed
|
|
2689
|
+
// every auto-scroll, which is why the live response stayed out of view on
|
|
2690
|
+
// mobile.
|
|
2667
2691
|
useEffect(() => {
|
|
2668
2692
|
const el = messagesContainerRef.current;
|
|
2669
2693
|
if (!el)
|
|
2670
2694
|
return;
|
|
2671
|
-
const
|
|
2695
|
+
const onScroll = () => {
|
|
2672
2696
|
userScrolledUpRef.current = el.scrollHeight - el.scrollTop - el.clientHeight > 80;
|
|
2673
2697
|
};
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
};
|
|
2677
|
-
let touchY = 0;
|
|
2678
|
-
const onTouchStart = (e) => {
|
|
2679
|
-
touchY = e.touches[0].clientY;
|
|
2680
|
-
};
|
|
2681
|
-
const onTouchMove = (e) => {
|
|
2682
|
-
// Swipe down (finger moves down) = scroll up
|
|
2683
|
-
if (e.touches[0].clientY > touchY)
|
|
2684
|
-
userScrolledUpRef.current = true;
|
|
2685
|
-
else
|
|
2686
|
-
requestAnimationFrame(check);
|
|
2687
|
-
};
|
|
2688
|
-
el.addEventListener('wheel', onWheel, { passive: true });
|
|
2689
|
-
el.addEventListener('touchstart', onTouchStart, { passive: true });
|
|
2690
|
-
el.addEventListener('touchmove', onTouchMove, { passive: true });
|
|
2691
|
-
return () => {
|
|
2692
|
-
el.removeEventListener('wheel', onWheel);
|
|
2693
|
-
el.removeEventListener('touchstart', onTouchStart);
|
|
2694
|
-
el.removeEventListener('touchmove', onTouchMove);
|
|
2695
|
-
};
|
|
2698
|
+
el.addEventListener('scroll', onScroll, { passive: true });
|
|
2699
|
+
return () => el.removeEventListener('scroll', onScroll);
|
|
2696
2700
|
}, []);
|
|
2697
2701
|
// ── Git status ─────────────────────────────────────────────────────────────
|
|
2698
2702
|
const [gitStatusTick, setGitStatusTick] = useState(0);
|