@justanarthur/modo-ui-ai 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/LICENSE.fluid-functionalism +21 -0
- package/README.md +105 -2
- package/blocks/conversation/agent-prompt/examples.mdx +44 -0
- package/blocks/conversation/agent-prompt/index.tsx +114 -0
- package/blocks/conversation/composer/draft.css +25 -0
- package/blocks/conversation/composer/draft.tsx +589 -0
- package/blocks/conversation/composer/examples.mdx +114 -0
- package/blocks/conversation/composer/file-preview-tile.tsx +59 -0
- package/blocks/conversation/composer/file-thumbnail.tsx +146 -0
- package/blocks/conversation/composer/index.tsx +517 -0
- package/blocks/conversation/composer/queued-row.tsx +102 -0
- package/blocks/conversation/composer/shared.ts +38 -0
- package/blocks/conversation/composer/suggestion-row.tsx +64 -0
- package/blocks/conversation/composer/use-composer-files.ts +142 -0
- package/blocks/conversation/composer/use-history-nav.ts +60 -0
- package/blocks/conversation/composer/use-message-queue.ts +108 -0
- package/blocks/conversation/composer/use-region-height.ts +34 -0
- package/blocks/conversation/failure-states/examples.mdx +58 -0
- package/blocks/conversation/failure-states/index.tsx +274 -0
- package/blocks/conversation/transcript/examples.mdx +43 -0
- package/blocks/conversation/transcript/index.tsx +204 -0
- package/blocks/conversation/transcript-search/examples.mdx +50 -0
- package/blocks/conversation/transcript-search/index.tsx +469 -0
- package/blocks/dialogs/command-palette/examples.mdx +33 -0
- package/blocks/dialogs/command-palette/index.tsx +232 -0
- package/blocks/dialogs/hook-dialog/examples.mdx +44 -0
- package/blocks/dialogs/hook-dialog/index.tsx +286 -0
- package/blocks/dialogs/mcp-server-dialog/examples.mdx +57 -0
- package/blocks/dialogs/mcp-server-dialog/index.tsx +415 -0
- package/blocks/dialogs/shortcuts-sheet/examples.mdx +36 -0
- package/blocks/dialogs/shortcuts-sheet/index.tsx +186 -0
- package/blocks/panes/artifacts-pane/examples.mdx +23 -0
- package/blocks/panes/artifacts-pane/index.tsx +82 -0
- package/blocks/panes/changes-pane/examples.mdx +23 -0
- package/blocks/panes/changes-pane/index.tsx +248 -0
- package/blocks/panes/file-pane/examples.mdx +13 -0
- package/blocks/panes/file-pane/index.tsx +102 -0
- package/blocks/panes/pr-pane/examples.mdx +13 -0
- package/blocks/panes/pr-pane/index.tsx +191 -0
- package/blocks/panes/side-pane/examples.mdx +58 -0
- package/blocks/panes/side-pane/index.tsx +187 -0
- package/blocks/panes/tasks-pane/examples.mdx +23 -0
- package/blocks/panes/tasks-pane/index.tsx +127 -0
- package/blocks/panes/terminal-pane/examples.mdx +13 -0
- package/blocks/panes/terminal-pane/index.tsx +99 -0
- package/blocks/panes/usage-pane/examples.mdx +13 -0
- package/blocks/panes/usage-pane/index.tsx +75 -0
- package/blocks/profiles/profile-onboarding/examples.mdx +80 -0
- package/blocks/profiles/profile-onboarding/index.tsx +580 -0
- package/blocks/profiles/profile-switcher/examples.mdx +18 -0
- package/blocks/profiles/profile-switcher/index.tsx +197 -0
- package/blocks/profiles/profile-usage/examples.mdx +21 -0
- package/blocks/profiles/profile-usage/index.tsx +127 -0
- package/blocks/sessions/inbox/examples.mdx +35 -0
- package/blocks/sessions/inbox/index.tsx +372 -0
- package/blocks/sessions/session-board/examples.mdx +34 -0
- package/blocks/sessions/session-board/index.tsx +570 -0
- package/blocks/sessions/session-sidebar/examples.mdx +43 -0
- package/blocks/sessions/session-sidebar/index.tsx +442 -0
- package/blocks/settings/extensions/examples.mdx +10 -0
- package/blocks/settings/extensions/index.tsx +72 -0
- package/blocks/settings/hooks/examples.mdx +16 -0
- package/blocks/settings/hooks/index.tsx +127 -0
- package/blocks/settings/mcp-servers/examples.mdx +26 -0
- package/blocks/settings/mcp-servers/index.tsx +204 -0
- package/blocks/settings/memory/examples.mdx +22 -0
- package/blocks/settings/memory/index.tsx +113 -0
- package/blocks/settings/notifications/examples.mdx +8 -0
- package/blocks/settings/notifications/index.tsx +63 -0
- package/blocks/settings/permission-rules/examples.mdx +37 -0
- package/blocks/settings/permission-rules/index.tsx +317 -0
- package/blocks/settings/plugin-catalog/examples.mdx +52 -0
- package/blocks/settings/plugin-catalog/index.tsx +407 -0
- package/blocks/settings/plugins/examples.mdx +10 -0
- package/blocks/settings/plugins/index.tsx +72 -0
- package/blocks/settings/settings-window/examples.mdx +40 -0
- package/blocks/settings/settings-window/index.tsx +188 -0
- package/blocks/settings/worktrees/examples.mdx +17 -0
- package/blocks/settings/worktrees/index.tsx +145 -0
- package/components/conversation/agent-run/examples.mdx +30 -0
- package/components/conversation/agent-run/index.tsx +82 -0
- package/components/conversation/chapter-nav/examples.mdx +30 -0
- package/components/conversation/chapter-nav/index.tsx +123 -0
- package/components/conversation/message/examples.mdx +53 -0
- package/components/conversation/message/index.tsx +128 -0
- package/components/conversation/message/working.tsx +102 -0
- package/components/conversation/reasoning/examples.mdx +22 -0
- package/components/conversation/reasoning/index.tsx +54 -0
- package/components/conversation/recap/examples.mdx +21 -0
- package/components/conversation/recap/index.tsx +67 -0
- package/components/conversation/todo-list/examples.mdx +32 -0
- package/components/conversation/todo-list/index.tsx +106 -0
- package/components/conversation/tool-call/examples.mdx +48 -0
- package/components/conversation/tool-call/index.tsx +142 -0
- package/components/conversation/work-summary/examples.mdx +50 -0
- package/components/conversation/work-summary/index.tsx +87 -0
- package/components/prompts/permission-request/examples.mdx +32 -0
- package/components/prompts/permission-request/index.tsx +74 -0
- package/components/prompts/plan-approval/examples.mdx +37 -0
- package/components/prompts/plan-approval/index.tsx +76 -0
- package/components/prompts/prompt-card/examples.mdx +31 -0
- package/components/prompts/prompt-card/index.tsx +82 -0
- package/components/prompts/question-prompt/examples.mdx +46 -0
- package/components/prompts/question-prompt/index.tsx +118 -0
- package/dist/blocks/conversation/agent-prompt/index.d.ts +7 -0
- package/dist/blocks/conversation/agent-prompt/index.js +13 -0
- package/dist/blocks/conversation/composer/index.d.ts +4 -0
- package/dist/blocks/conversation/composer/index.js +15 -0
- package/dist/blocks/conversation/failure-states/index.d.ts +4 -0
- package/dist/blocks/conversation/failure-states/index.js +8 -0
- package/dist/blocks/conversation/transcript/index.d.ts +50 -0
- package/dist/blocks/conversation/transcript/index.js +17 -0
- package/dist/blocks/conversation/transcript-search/index.d.ts +4 -0
- package/dist/blocks/conversation/transcript-search/index.js +11 -0
- package/dist/blocks/dialogs/command-palette/index.d.ts +5 -0
- package/dist/blocks/dialogs/command-palette/index.js +20 -0
- package/dist/blocks/dialogs/hook-dialog/index.d.ts +3 -0
- package/dist/blocks/dialogs/hook-dialog/index.js +12 -0
- package/dist/blocks/dialogs/mcp-server-dialog/index.d.ts +5 -0
- package/dist/blocks/dialogs/mcp-server-dialog/index.js +12 -0
- package/dist/blocks/dialogs/shortcuts-sheet/index.d.ts +2 -0
- package/dist/blocks/dialogs/shortcuts-sheet/index.js +11 -0
- package/dist/blocks/panes/artifacts-pane/index.d.ts +3 -0
- package/dist/blocks/panes/artifacts-pane/index.js +9 -0
- package/dist/blocks/panes/changes-pane/index.d.ts +3 -0
- package/dist/blocks/panes/changes-pane/index.js +9 -0
- package/dist/blocks/panes/file-pane/index.d.ts +3 -0
- package/dist/blocks/panes/file-pane/index.js +9 -0
- package/dist/blocks/panes/pr-pane/index.d.ts +3 -0
- package/dist/blocks/panes/pr-pane/index.js +10 -0
- package/dist/blocks/panes/side-pane/index.d.ts +5 -0
- package/dist/blocks/panes/side-pane/index.js +21 -0
- package/dist/blocks/panes/tasks-pane/index.d.ts +3 -0
- package/dist/blocks/panes/tasks-pane/index.js +10 -0
- package/dist/blocks/panes/terminal-pane/index.d.ts +3 -0
- package/dist/blocks/panes/terminal-pane/index.js +9 -0
- package/dist/blocks/panes/usage-pane/index.d.ts +4 -0
- package/dist/blocks/panes/usage-pane/index.js +11 -0
- package/dist/blocks/profiles/profile-onboarding/index.d.ts +4 -0
- package/dist/blocks/profiles/profile-onboarding/index.js +11 -0
- package/dist/blocks/profiles/profile-switcher/index.d.ts +4 -0
- package/dist/blocks/profiles/profile-switcher/index.js +11 -0
- package/dist/blocks/profiles/profile-usage/index.d.ts +4 -0
- package/dist/blocks/profiles/profile-usage/index.js +10 -0
- package/dist/blocks/sessions/inbox/index.d.ts +2 -0
- package/dist/blocks/sessions/inbox/index.js +11 -0
- package/dist/blocks/sessions/session-board/index.d.ts +4 -0
- package/dist/blocks/sessions/session-board/index.js +26 -0
- package/dist/blocks/sessions/session-sidebar/index.d.ts +5 -0
- package/dist/blocks/sessions/session-sidebar/index.js +15 -0
- package/dist/blocks/settings/extensions/index.d.ts +2 -0
- package/dist/blocks/settings/extensions/index.js +9 -0
- package/dist/blocks/settings/hooks/index.d.ts +4 -0
- package/dist/blocks/settings/hooks/index.js +9 -0
- package/dist/blocks/settings/mcp-servers/index.d.ts +4 -0
- package/dist/blocks/settings/mcp-servers/index.js +9 -0
- package/dist/blocks/settings/memory/index.d.ts +4 -0
- package/dist/blocks/settings/memory/index.js +8 -0
- package/dist/blocks/settings/notifications/index.d.ts +2 -0
- package/dist/blocks/settings/notifications/index.js +8 -0
- package/dist/blocks/settings/permission-rules/index.d.ts +3 -0
- package/dist/blocks/settings/permission-rules/index.js +10 -0
- package/dist/blocks/settings/plugin-catalog/index.d.ts +2 -0
- package/dist/blocks/settings/plugin-catalog/index.js +11 -0
- package/dist/blocks/settings/plugins/index.d.ts +4 -0
- package/dist/blocks/settings/plugins/index.js +9 -0
- package/dist/blocks/settings/settings-window/index.d.ts +4 -0
- package/dist/blocks/settings/settings-window/index.js +8 -0
- package/dist/blocks/settings/worktrees/index.d.ts +4 -0
- package/dist/blocks/settings/worktrees/index.js +9 -0
- package/dist/components/conversation/agent-run/index.d.ts +3 -0
- package/dist/components/conversation/agent-run/index.js +10 -0
- package/dist/components/conversation/chapter-nav/index.d.ts +2 -0
- package/dist/components/conversation/chapter-nav/index.js +11 -0
- package/dist/components/conversation/message/index.d.ts +2 -0
- package/dist/components/conversation/message/index.js +15 -0
- package/dist/components/conversation/reasoning/index.d.ts +2 -0
- package/dist/components/conversation/reasoning/index.js +8 -0
- package/dist/components/conversation/recap/index.d.ts +2 -0
- package/dist/components/conversation/recap/index.js +9 -0
- package/dist/components/conversation/todo-list/index.d.ts +2 -0
- package/dist/components/conversation/todo-list/index.js +9 -0
- package/dist/components/conversation/tool-call/index.d.ts +3 -0
- package/dist/components/conversation/tool-call/index.js +13 -0
- package/dist/components/conversation/work-summary/index.d.ts +2 -0
- package/dist/components/conversation/work-summary/index.js +10 -0
- package/dist/components/prompts/permission-request/index.d.ts +2 -0
- package/dist/components/prompts/permission-request/index.js +9 -0
- package/dist/components/prompts/plan-approval/index.d.ts +2 -0
- package/dist/components/prompts/plan-approval/index.js +9 -0
- package/dist/components/prompts/prompt-card/index.d.ts +3 -0
- package/dist/components/prompts/prompt-card/index.js +8 -0
- package/dist/components/prompts/question-prompt/index.d.ts +2 -0
- package/dist/components/prompts/question-prompt/index.js +9 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +231 -0
- package/dist/lib/config-parts.d.ts +2 -0
- package/dist/lib/config-parts.js +16 -0
- package/dist/lib/icons.d.ts +2 -0
- package/dist/lib/icons.js +10 -0
- package/dist/lib/pace-bar.d.ts +11 -0
- package/dist/lib/pace-bar.js +6 -0
- package/dist/lib/pace.d.ts +4 -0
- package/dist/lib/pace.js +12 -0
- package/dist/lib/pane-parts.d.ts +25 -0
- package/dist/lib/pane-parts.js +11 -0
- package/dist/lib/row-trigger.d.ts +5 -0
- package/dist/lib/row-trigger.js +7 -0
- package/dist/lib/settings-parts.d.ts +70 -0
- package/dist/lib/settings-parts.js +24 -0
- package/dist/lib/side-pane-types.d.ts +2 -0
- package/dist/lib/side-pane-types.js +1 -0
- package/dist/lib/status-glyph.d.ts +8 -0
- package/dist/lib/status-glyph.js +12 -0
- package/dist/lib/types.d.ts +3 -0
- package/dist/lib/types.js +1 -0
- package/dist/shared/chunk-04a497rr.js +21 -0
- package/dist/shared/chunk-13yf0mza.d.ts +70 -0
- package/dist/shared/chunk-1aq2xzv5.js +558 -0
- package/dist/shared/chunk-1f96cz69.js +45 -0
- package/dist/shared/chunk-1yt061np.d.ts +64 -0
- package/dist/shared/chunk-218qabm5.js +250 -0
- package/dist/shared/chunk-2fk5aq60.js +313 -0
- package/dist/shared/chunk-4248zvmh.js +177 -0
- package/dist/shared/chunk-45rqgey6.d.ts +25 -0
- package/dist/shared/chunk-4n0v64qx.js +179 -0
- package/dist/shared/chunk-4zvhpf2x.js +55 -0
- package/dist/shared/chunk-57hzzmjd.d.ts +67 -0
- package/dist/shared/chunk-58qvny6a.d.ts +29 -0
- package/dist/shared/chunk-5fhkkn39.js +130 -0
- package/dist/shared/chunk-5hw0525a.d.ts +33 -0
- package/dist/shared/chunk-5k6xwqfj.d.ts +68 -0
- package/dist/shared/chunk-5meda998.js +238 -0
- package/dist/shared/chunk-5pqksw7z.js +91 -0
- package/dist/shared/chunk-6220dy5n.js +70 -0
- package/dist/shared/chunk-64bnh22t.d.ts +59 -0
- package/dist/shared/chunk-66sh633m.d.ts +60 -0
- package/dist/shared/chunk-6cmf27g3.d.ts +81 -0
- package/dist/shared/chunk-6g4970a6.d.ts +20 -0
- package/dist/shared/chunk-75zwypyr.d.ts +43 -0
- package/dist/shared/chunk-7rzjmcnh.d.ts +30 -0
- package/dist/shared/chunk-7zvb39cf.d.ts +26 -0
- package/dist/shared/chunk-8mecznyr.js +357 -0
- package/dist/shared/chunk-8pag6vmd.js +255 -0
- package/dist/shared/chunk-8xg5gwwy.js +38 -0
- package/dist/shared/chunk-9kw6m047.d.ts +32 -0
- package/dist/shared/chunk-a4s440b6.js +79 -0
- package/dist/shared/chunk-at0jje23.d.ts +110 -0
- package/dist/shared/chunk-awd573h9.js +34 -0
- package/dist/shared/chunk-b171wjge.d.ts +25 -0
- package/dist/shared/chunk-bh2b5d1z.js +98 -0
- package/dist/shared/chunk-bzs6amnv.js +187 -0
- package/dist/shared/chunk-c36qvrwq.d.ts +30 -0
- package/dist/shared/chunk-c8wp058j.js +153 -0
- package/dist/shared/chunk-cd4f87as.d.ts +28 -0
- package/dist/shared/chunk-cmwby8f9.js +467 -0
- package/dist/shared/chunk-d2t72h4x.d.ts +35 -0
- package/dist/shared/chunk-dh3qy5fj.js +49 -0
- package/dist/shared/chunk-e46apgve.d.ts +40 -0
- package/dist/shared/chunk-ejtknc0w.js +21 -0
- package/dist/shared/chunk-eqajdxn8.js +82 -0
- package/dist/shared/chunk-fbn0h7cr.js +123 -0
- package/dist/shared/chunk-fqhcz6ss.d.ts +29 -0
- package/dist/shared/chunk-g28hweee.d.ts +35 -0
- package/dist/shared/chunk-g88hweqh.d.ts +70 -0
- package/dist/shared/chunk-gewnsgza.js +61 -0
- package/dist/shared/chunk-gkyk663q.d.ts +53 -0
- package/dist/shared/chunk-hd4gtj5z.d.ts +23 -0
- package/dist/shared/chunk-hxjgey30.d.ts +36 -0
- package/dist/shared/chunk-jkkdq1mh.d.ts +213 -0
- package/dist/shared/chunk-jpq101w3.js +91 -0
- package/dist/shared/chunk-k3bv9k1v.d.ts +56 -0
- package/dist/shared/chunk-k5zegxje.d.ts +81 -0
- package/dist/shared/chunk-kreypnzp.d.ts +34 -0
- package/dist/shared/chunk-kw9npka5.js +224 -0
- package/dist/shared/chunk-mrb3fp2f.d.ts +30 -0
- package/dist/shared/chunk-n1qq2wp9.js +6 -0
- package/dist/shared/chunk-n4742y54.js +39 -0
- package/dist/shared/chunk-ndjvdkv7.d.ts +29 -0
- package/dist/shared/chunk-nk4578dr.js +73 -0
- package/dist/shared/chunk-paezqfg1.js +106 -0
- package/dist/shared/chunk-qemm9e3r.d.ts +21 -0
- package/dist/shared/chunk-qhxz1etk.js +96 -0
- package/dist/shared/chunk-qj5ev9ak.js +531 -0
- package/dist/shared/chunk-qnwggvjy.js +150 -0
- package/dist/shared/chunk-r5hz78pb.js +129 -0
- package/dist/shared/chunk-r6nb21kz.d.ts +102 -0
- package/dist/shared/chunk-rjfwje37.d.ts +234 -0
- package/dist/shared/chunk-rqrpvvz4.d.ts +107 -0
- package/dist/shared/chunk-rzajcn44.d.ts +49 -0
- package/dist/shared/chunk-s3r759ec.js +80 -0
- package/dist/shared/chunk-sdtjrw9w.d.ts +98 -0
- package/dist/shared/chunk-sfqvyzcs.d.ts +68 -0
- package/dist/shared/chunk-skg3m9m0.js +56 -0
- package/dist/shared/chunk-szkvrqg1.d.ts +54 -0
- package/dist/shared/chunk-t21t9x7e.js +188 -0
- package/dist/shared/chunk-tc75ng2c.js +235 -0
- package/dist/shared/chunk-tkx1krwc.js +88 -0
- package/dist/shared/chunk-tprdqtb1.d.ts +30 -0
- package/dist/shared/chunk-tv9a1sek.js +137 -0
- package/dist/shared/chunk-tvbd27hg.d.ts +43 -0
- package/dist/shared/chunk-v6yevw62.d.ts +28 -0
- package/dist/shared/chunk-v9q38p0x.js +258 -0
- package/dist/shared/chunk-vd59gzzd.js +86 -0
- package/dist/shared/chunk-vgh4f3sv.js +118 -0
- package/dist/shared/chunk-vjht1zn1.js +391 -0
- package/dist/shared/chunk-vsrkb0sp.d.ts +21 -0
- package/dist/shared/chunk-w5z8qnf8.js +175 -0
- package/dist/shared/chunk-wgvzavx1.js +1488 -0
- package/dist/shared/chunk-whsx7yp9.d.ts +37 -0
- package/dist/shared/chunk-x7az5x1y.d.ts +57 -0
- package/dist/shared/chunk-x9jf26yb.js +318 -0
- package/dist/shared/chunk-xbrrt07s.d.ts +23 -0
- package/dist/shared/chunk-xkchhs2z.js +129 -0
- package/dist/shared/chunk-xzfrskd7.js +202 -0
- package/dist/shared/chunk-y4cj4y54.js +423 -0
- package/dist/shared/chunk-y934at6m.js +7 -0
- package/dist/shared/chunk-zbpwhpjy.d.ts +75 -0
- package/dist/shared/chunk-zfhmbb7n.js +63 -0
- package/dist/shared/chunk-zk0t4vq5.js +71 -0
- package/dist/shared/chunk-znp9gna7.d.ts +23 -0
- package/dist/styles.css +467 -0
- package/index.ts +49 -0
- package/lib/config-parts.tsx +97 -0
- package/lib/icons.tsx +149 -0
- package/lib/pace-bar.tsx +24 -0
- package/lib/pace.ts +74 -0
- package/lib/pane-parts.tsx +76 -0
- package/lib/row-trigger.tsx +44 -0
- package/lib/settings-parts.tsx +232 -0
- package/lib/side-pane-types.ts +75 -0
- package/lib/status-glyph.tsx +25 -0
- package/lib/types.ts +204 -0
- package/mock/demo-reply.tsx +33 -0
- package/mock/demo-session.tsx +150 -0
- package/mock/mock-config.ts +173 -0
- package/mock/mock-extras.ts +288 -0
- package/mock/mock-panes.ts +190 -0
- package/mock/mock-settings.ts +92 -0
- package/mock/mock.ts +548 -0
- package/mock/screen-frame.tsx +49 -0
- package/package.json +114 -4
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import Composer from './index'
|
|
2
|
+
import Button from '@justanarthur/modo-ui/components/actions/button'
|
|
3
|
+
import { Plus } from 'lucide-react'
|
|
4
|
+
import { COMPOSER, ZCODE_MODELS } from '../../../mock/mock'
|
|
5
|
+
|
|
6
|
+
# Composer
|
|
7
|
+
|
|
8
|
+
In the draft, the + palette and the run trigger (permission mode, model, effort, context ring) that opens the run settings. On the shell, where the session runs: the project and the profile with its usage lines.
|
|
9
|
+
|
|
10
|
+
<div className="flex h-[440px] w-full max-w-2xl items-end">
|
|
11
|
+
<Composer {...COMPOSER} />
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
# New session
|
|
15
|
+
|
|
16
|
+
`target`: the project (its popover holds the worktree, setup script and base branch) and the profile can still be picked.
|
|
17
|
+
|
|
18
|
+
<div className="flex h-[200px] w-full max-w-2xl items-end">
|
|
19
|
+
<Composer {...COMPOSER} target context={0} placeholder="Describe the task, or type / for commands" />
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
# Near compaction
|
|
23
|
+
|
|
24
|
+
Past 80% the context ring in the run trigger turns amber; at 95% it compacts.
|
|
25
|
+
|
|
26
|
+
<div className="flex h-[200px] w-full max-w-2xl items-end">
|
|
27
|
+
<Composer {...COMPOSER} context={0.91} defaultPermissionMode="Plan mode" defaultEffort="Max" />
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
# Compacting
|
|
31
|
+
|
|
32
|
+
While the conversation is summarized, the run settings' context meter says so.
|
|
33
|
+
|
|
34
|
+
<div className="flex h-[200px] w-full max-w-2xl items-end">
|
|
35
|
+
<Composer {...COMPOSER} compacting />
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
# Streaming
|
|
39
|
+
|
|
40
|
+
A reply is in flight: Enter queues, and with the draft empty the button stops it. Fast mode is on: the run trigger shows its bolt.
|
|
41
|
+
|
|
42
|
+
<div className="flex h-[200px] w-full max-w-2xl items-end">
|
|
43
|
+
<Composer {...COMPOSER} defaultStatus="streaming" defaultFast />
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
# Queued messages
|
|
47
|
+
|
|
48
|
+
Typed while a reply streams, messages wait above the draft. Drag a row (or Alt+↑/↓) to reorder, double-click to pull it back into the draft, × to drop it. Stop the reply and the top one sends.
|
|
49
|
+
|
|
50
|
+
<div className="flex h-[280px] w-full max-w-2xl items-end">
|
|
51
|
+
<Composer
|
|
52
|
+
{...COMPOSER}
|
|
53
|
+
defaultStatus="streaming"
|
|
54
|
+
defaultQueue={[
|
|
55
|
+
{ id: 'q1', text: 'Also add a dark-mode screenshot', files: [] },
|
|
56
|
+
{ id: 'q2', text: 'And link the changelog entry', files: [] },
|
|
57
|
+
]}
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
# History
|
|
62
|
+
|
|
63
|
+
With the caret on the first line, ↑ recalls the previous message; ↓ on the last line walks forward and, past the newest, brings back the draft.
|
|
64
|
+
|
|
65
|
+
<div className="flex h-[200px] w-full max-w-2xl items-end">
|
|
66
|
+
<Composer {...COMPOSER} history={['Summarize the release notes', 'Now as a bulleted list']} />
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
# Suggestions
|
|
70
|
+
|
|
71
|
+
An empty draft offers prompts: Tab fills the ghost one, ↓ / ↑ walk the list under the draft (the text keeps focus), Enter or a click fills the highlighted one. Typing folds the list away.
|
|
72
|
+
|
|
73
|
+
<div className="flex h-[360px] w-full max-w-2xl items-end">
|
|
74
|
+
<Composer
|
|
75
|
+
{...COMPOSER}
|
|
76
|
+
placeholderSuggestion="Why does the sidebar flicker on resize?"
|
|
77
|
+
suggestions={['Review the open pull request', 'Write tests for the date mask', 'Explain the morph layer']}
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
# Another provider
|
|
82
|
+
|
|
83
|
+
A compatible profile offers its own models.
|
|
84
|
+
|
|
85
|
+
<div className="flex h-[200px] w-full max-w-2xl items-end">
|
|
86
|
+
<Composer {...COMPOSER} models={ZCODE_MODELS} defaultPermissionMode="Auto" context={0.18} />
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
# Draft alone
|
|
90
|
+
|
|
91
|
+
`Composer.Draft` without the shell and its menus, for a reply box on a board or a card. Its slots take any controls; a render function gets `openFilePicker`. `defaultFiles` turns attachments on: drop a PNG, JPEG or PDF on it, hover a tile for its ×.
|
|
92
|
+
|
|
93
|
+
<div className="w-full max-w-xl">
|
|
94
|
+
<Composer.Draft
|
|
95
|
+
defaultFiles={[
|
|
96
|
+
new File(['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><rect width="80" height="80" /></svg>'], 'swatch.svg', { type: 'image/svg+xml' }),
|
|
97
|
+
new File(['Quarterly notes'], 'notes.txt', { type: 'text/plain' }),
|
|
98
|
+
]}
|
|
99
|
+
leftSlot={({ openFilePicker }) => (
|
|
100
|
+
<Button variant="ghost" size="icon-compact" aria-label="Attach" onClick={() => openFilePicker()}>
|
|
101
|
+
<Plus />
|
|
102
|
+
</Button>
|
|
103
|
+
)}
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
# Compact and disabled
|
|
108
|
+
|
|
109
|
+
The compact step for dense surfaces; `disabled` dims the draft and takes no input or drops.
|
|
110
|
+
|
|
111
|
+
<div className="flex w-full max-w-xl flex-col gap-3">
|
|
112
|
+
<Composer.Draft size="compact" placeholder="Reply to the session" />
|
|
113
|
+
<Composer.Draft defaultValue="This draft is disabled" disabled />
|
|
114
|
+
</div>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Ported from Fluid Functionalism — github.com/mickadesign/fluid-functionalism
|
|
3
|
+
* `registry/default/input-message.tsx` @ b3587bdbd83fc66c2a6aae3817ffb856cb09260b
|
|
4
|
+
* MIT License © 2026 Micka Touillaud (notice: LICENSE.fluid-functionalism). Local changes: see ui/PORTING.md.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use client'
|
|
8
|
+
|
|
9
|
+
import { Tooltip } from '@justanarthur/modo-ui/components/overlays/tooltip'
|
|
10
|
+
import { useIcon } from '@justanarthur/modo-ui/lib/icon-context'
|
|
11
|
+
import { spring } from '@justanarthur/modo-ui/lib/springs'
|
|
12
|
+
import { motion } from 'motion/react'
|
|
13
|
+
import { forwardRef } from 'react'
|
|
14
|
+
import { FileThumbnail } from './file-thumbnail'
|
|
15
|
+
|
|
16
|
+
interface FilePreviewTileProps {
|
|
17
|
+
file: File
|
|
18
|
+
onRemove: () => void
|
|
19
|
+
size: number
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// A forwardRef: `<AnimatePresence mode="popLayout">` measures the exiting tile
|
|
23
|
+
// through a ref, which React 18 drops on a plain function component.
|
|
24
|
+
const FilePreviewTile = forwardRef<HTMLDivElement, FilePreviewTileProps>(function FilePreviewTile(
|
|
25
|
+
{ file, onRemove, size },
|
|
26
|
+
ref,
|
|
27
|
+
) {
|
|
28
|
+
const XIcon = useIcon('x')
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<motion.div
|
|
32
|
+
ref={ref}
|
|
33
|
+
layout
|
|
34
|
+
initial={{ opacity: 0, scale: 0.9 }}
|
|
35
|
+
animate={{ opacity: 1, scale: 1 }}
|
|
36
|
+
exit={{ opacity: 0, scale: 0.9, transition: spring.fast.exit }}
|
|
37
|
+
transition={spring.fast}
|
|
38
|
+
className="relative shrink-0 cursor-default group/tile"
|
|
39
|
+
>
|
|
40
|
+
<FileThumbnail file={file} size={size} />
|
|
41
|
+
<Tooltip content="Remove" side="top">
|
|
42
|
+
<button
|
|
43
|
+
type="button"
|
|
44
|
+
onClick={e => {
|
|
45
|
+
e.stopPropagation()
|
|
46
|
+
onRemove()
|
|
47
|
+
}}
|
|
48
|
+
aria-label={`Remove ${file.name}`}
|
|
49
|
+
// Pinned to the light scheme so the badge keeps one contrast over any image.
|
|
50
|
+
className="light absolute top-1 right-1 w-5 h-5 rounded-full bg-foreground text-background opacity-0 group-hover/tile:opacity-100 transition-opacity duration-fast flex items-center justify-center cursor-pointer outline-none focus-visible:opacity-100 focus-visible:ring-1 focus-visible:ring-focus-ring"
|
|
51
|
+
>
|
|
52
|
+
<XIcon size={12} strokeWidth={2.5} />
|
|
53
|
+
</button>
|
|
54
|
+
</Tooltip>
|
|
55
|
+
</motion.div>
|
|
56
|
+
)
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
export { FilePreviewTile }
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Ported from Fluid Functionalism — github.com/mickadesign/fluid-functionalism
|
|
3
|
+
* `registry/default/file-thumbnail.tsx` @ b3587bdbd83fc66c2a6aae3817ffb856cb09260b
|
|
4
|
+
* MIT License © 2026 Micka Touillaud (notice: LICENSE.fluid-functionalism). Local changes: see ui/PORTING.md.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use client'
|
|
8
|
+
|
|
9
|
+
import { useShape } from '@justanarthur/modo-ui/lib/shape-context'
|
|
10
|
+
import { cn } from '@justanarthur/modo-ui/lib/utils'
|
|
11
|
+
import { useEffect, useState } from 'react'
|
|
12
|
+
|
|
13
|
+
// pdfjs-dist is an optional peer, loaded on the first PDF with its worker from the CDN.
|
|
14
|
+
// The `.catch` right on `import()` also lets esbuild bundle a host that didn't install it.
|
|
15
|
+
type PdfjsModule = typeof import('pdfjs-dist')
|
|
16
|
+
let pdfjsPromise: Promise<PdfjsModule> | null = null
|
|
17
|
+
|
|
18
|
+
const PDFJS_MISSING =
|
|
19
|
+
'@justanarthur/modo-ui: PDF thumbnails need the optional peer dependency `pdfjs-dist` (npm install pdfjs-dist); showing the file icon instead.'
|
|
20
|
+
|
|
21
|
+
async function loadPdfjs(): Promise<PdfjsModule> {
|
|
22
|
+
if (!pdfjsPromise) {
|
|
23
|
+
pdfjsPromise = import('pdfjs-dist')
|
|
24
|
+
.catch(error => {
|
|
25
|
+
console.warn(PDFJS_MISSING)
|
|
26
|
+
throw error
|
|
27
|
+
})
|
|
28
|
+
.then(mod => {
|
|
29
|
+
if (!mod.GlobalWorkerOptions.workerSrc) {
|
|
30
|
+
mod.GlobalWorkerOptions.workerSrc = `https://cdn.jsdelivr.net/npm/pdfjs-dist@${mod.version}/build/pdf.worker.min.mjs`
|
|
31
|
+
}
|
|
32
|
+
return mod
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
return pdfjsPromise
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function renderPdfFirstPage(file: File, targetWidth: number): Promise<string> {
|
|
39
|
+
const pdfjs = await loadPdfjs()
|
|
40
|
+
const buffer = await file.arrayBuffer()
|
|
41
|
+
const pdf = await pdfjs.getDocument({ data: buffer }).promise
|
|
42
|
+
const page = await pdf.getPage(1)
|
|
43
|
+
const baseViewport = page.getViewport({ scale: 1 })
|
|
44
|
+
const scale = (targetWidth * 2) / baseViewport.width
|
|
45
|
+
const viewport = page.getViewport({ scale })
|
|
46
|
+
const canvas = document.createElement('canvas')
|
|
47
|
+
canvas.width = viewport.width
|
|
48
|
+
canvas.height = viewport.height
|
|
49
|
+
await page.render({ canvas, viewport }).promise
|
|
50
|
+
return canvas.toDataURL('image/png')
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface FileThumbnailProps {
|
|
54
|
+
file: File
|
|
55
|
+
/** Side length of the square thumbnail in pixels. */
|
|
56
|
+
size: number
|
|
57
|
+
className?: string
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** A square preview of a File: images cover it, PDFs show their first page, anything else a document glyph. */
|
|
61
|
+
function FileThumbnail({ file, size, className }: FileThumbnailProps) {
|
|
62
|
+
const shape = useShape()
|
|
63
|
+
const isImage = file.type.startsWith('image/')
|
|
64
|
+
const isPdf = file.type === 'application/pdf'
|
|
65
|
+
|
|
66
|
+
// Created and revoked in one effect: under StrictMode a memoized URL is
|
|
67
|
+
// revoked by the simulated cleanup and never recreated.
|
|
68
|
+
const [imageUrl, setImageUrl] = useState<string | null>(null)
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (!isImage) {
|
|
71
|
+
setImageUrl(null)
|
|
72
|
+
return
|
|
73
|
+
}
|
|
74
|
+
const url = URL.createObjectURL(file)
|
|
75
|
+
setImageUrl(url)
|
|
76
|
+
return () => URL.revokeObjectURL(url)
|
|
77
|
+
}, [isImage, file])
|
|
78
|
+
|
|
79
|
+
// Any failure (corrupt file, blocked worker, pdfjs-dist missing) shows the glyph.
|
|
80
|
+
const [pdfUrl, setPdfUrl] = useState<string | null>(null)
|
|
81
|
+
const [pdfError, setPdfError] = useState(false)
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
setPdfError(false)
|
|
84
|
+
if (!isPdf) {
|
|
85
|
+
setPdfUrl(null)
|
|
86
|
+
return
|
|
87
|
+
}
|
|
88
|
+
let cancelled = false
|
|
89
|
+
renderPdfFirstPage(file, size)
|
|
90
|
+
.then(url => {
|
|
91
|
+
if (!cancelled) setPdfUrl(url)
|
|
92
|
+
})
|
|
93
|
+
.catch(() => {
|
|
94
|
+
if (!cancelled) setPdfError(true)
|
|
95
|
+
})
|
|
96
|
+
return () => {
|
|
97
|
+
cancelled = true
|
|
98
|
+
}
|
|
99
|
+
}, [file, isPdf, size])
|
|
100
|
+
|
|
101
|
+
const previewUrl = imageUrl ?? pdfUrl
|
|
102
|
+
const isPending = (isImage && !imageUrl) || (isPdf && !pdfUrl && !pdfError)
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<div
|
|
106
|
+
className={cn('relative shrink-0 overflow-hidden bg-accent border border-border', shape.bg, className)}
|
|
107
|
+
style={{ width: size, height: size }}
|
|
108
|
+
>
|
|
109
|
+
{previewUrl ? (
|
|
110
|
+
<img src={previewUrl} alt={file.name} className="absolute inset-0 w-full h-full object-cover" />
|
|
111
|
+
) : isPending ? (
|
|
112
|
+
<div className="absolute inset-0 flex items-center justify-center">
|
|
113
|
+
<div
|
|
114
|
+
className="w-6 h-6 rounded-full border-2 border-border border-t-muted-foreground animate-spin"
|
|
115
|
+
aria-label="Loading preview"
|
|
116
|
+
role="status"
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
119
|
+
) : (
|
|
120
|
+
<div
|
|
121
|
+
className="absolute inset-0 flex items-center justify-center text-muted-foreground"
|
|
122
|
+
role="img"
|
|
123
|
+
aria-label={file.name}
|
|
124
|
+
>
|
|
125
|
+
<svg
|
|
126
|
+
width={Math.max(16, size * 0.35)}
|
|
127
|
+
height={Math.max(16, size * 0.35)}
|
|
128
|
+
viewBox="0 0 24 24"
|
|
129
|
+
fill="none"
|
|
130
|
+
stroke="currentColor"
|
|
131
|
+
strokeWidth="1.5"
|
|
132
|
+
strokeLinecap="round"
|
|
133
|
+
strokeLinejoin="round"
|
|
134
|
+
aria-hidden="true"
|
|
135
|
+
>
|
|
136
|
+
<path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" />
|
|
137
|
+
<path d="M14 3v5h5" />
|
|
138
|
+
</svg>
|
|
139
|
+
</div>
|
|
140
|
+
)}
|
|
141
|
+
</div>
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export type { FileThumbnailProps }
|
|
146
|
+
export { FileThumbnail }
|