@gemboss/ui 0.21.0 → 0.30.2
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/CHANGELOG.md +328 -0
- package/README.md +433 -24
- package/catalog/editor.html +426 -10
- package/catalog/index.html +907 -33
- package/gemboss-ui.css +3 -3
- package/package.json +23 -3
- package/parts/components.css +5 -0
- package/parts/core.css +5 -0
- package/parts/shell.css +5 -0
- package/src/action-card.css +1 -0
- package/src/action-card.tsx +149 -0
- package/src/app-shell.css +1 -1
- package/src/assistant/chat-markdown.ts +279 -0
- package/src/assistant/chat-turns.ts +120 -0
- package/src/assistant/chat.tsx +871 -0
- package/src/assistant/engine-mark-art.ts +45 -0
- package/src/assistant/engine-mark.tsx +39 -0
- package/src/assistant/engine.tsx +697 -0
- package/src/assistant/host.tsx +3 -1
- package/src/assistant/index.ts +6 -0
- package/src/assistant-chat.css +1 -0
- package/src/assistant-engine.css +1 -0
- package/src/auth.css +1 -1
- package/src/auth.tsx +18 -2
- package/src/chat-composer.css +1 -1
- package/src/chat-plain.js +6 -0
- package/src/chat.css +1 -1
- package/src/collections.tsx +1 -0
- package/src/dialog.tsx +3 -135
- package/src/editor/controls.tsx +1 -0
- package/src/editor/frame.tsx +12 -4
- package/src/editor/index.ts +10 -1
- package/src/editor/layers.tsx +136 -0
- package/src/editor/panel.tsx +1 -0
- package/src/editor/panes.tsx +4 -3
- package/src/editor/sortable.tsx +79 -0
- package/src/editor/tree.tsx +61 -0
- package/src/editor-layers-plain.js +1 -0
- package/src/editor.css +1 -1
- package/src/engine-plain.js +1 -0
- package/src/index-table.tsx +1 -0
- package/src/index.ts +8 -3
- package/src/kit-plain.css +1 -1
- package/src/kit-plain.js +1 -1
- package/src/launcher.tsx +1 -0
- package/src/menu-layer.ts +9 -2
- package/src/minichart.css +1 -0
- package/src/minichart.tsx +165 -0
- package/src/portal.tsx +1 -0
- package/src/reactions.tsx +1 -0
- package/src/resource-list-select.tsx +1 -0
- package/src/search-dialog.tsx +146 -0
- package/src/selection.tsx +1 -0
- package/src/setup-guide.css +1 -0
- package/src/setup-guide.tsx +116 -0
- package/src/theme-script.ts +10 -0
- package/src/theme.tsx +5 -5
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Each engine's MARK, the artwork only (0.29.0), moved from the admin (apps/admin/src/lib/engine-mark-art.ts, which now
|
|
3
|
+
* re-exports this file). No JSX and no stylesheet, so a node test and a server module can import it
|
|
4
|
+
* (`@gemboss/ui/assistant/engine-mark-art`); `EngineMark` (engine-mark.tsx) draws it.
|
|
5
|
+
*
|
|
6
|
+
* One shape per engine, never a shared one: a mark that is right for one engine and wrong for the other reads as evidence
|
|
7
|
+
* while naming the wrong thing.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** The Claude asterisk: eight tapered arms from one centre, generated (eight hand-typed arms are eight chances to be off). */
|
|
11
|
+
function claudeAsterisk(): string {
|
|
12
|
+
const c = 12, root = 1.7, tip = 0.5, len = 9.6;
|
|
13
|
+
const f = (n: number) => Math.round(n * 100) / 100;
|
|
14
|
+
const p = (x: number, y: number) => `${f(x)} ${f(y)}`;
|
|
15
|
+
return Array.from({ length: 8 }, (_, i) => {
|
|
16
|
+
const a = (i * Math.PI) / 4;
|
|
17
|
+
const [dx, dy] = [Math.cos(a), Math.sin(a)];
|
|
18
|
+
const [px, py] = [-dy, dx];
|
|
19
|
+
return [
|
|
20
|
+
`M${p(c + px * root, c + py * root)}`,
|
|
21
|
+
`L${p(c + dx * len + px * tip, c + dy * len + py * tip)}`,
|
|
22
|
+
`Q${p(c + dx * (len + 0.6), c + dy * (len + 0.6))} ${p(c + dx * len - px * tip, c + dy * len - py * tip)}`,
|
|
23
|
+
`L${p(c - px * root, c - py * root)}`,
|
|
24
|
+
"Z",
|
|
25
|
+
].join("");
|
|
26
|
+
}).join(" ");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Codex: a hexagonal ring. Not OpenAI's knot (no official asset here; one drawn from memory would be a wrong logo). */
|
|
30
|
+
const CODEX_HEX = "M12 2.6 20.1 7.3V16.7L12 21.4 3.9 16.7V7.3ZM12 6.9 7.6 9.45v5.1L12 17.1l4.4-2.55v-5.1Z";
|
|
31
|
+
|
|
32
|
+
/** NONZERO: the asterisk's eight subpaths all start at the centre, and under evenodd the overlaps cancel (measured in the
|
|
33
|
+
* admin: the centre came back 0/400 inked, a hollow compass rose). */
|
|
34
|
+
export const ENGINE_MARK_FILL_RULE = "nonzero" as const;
|
|
35
|
+
|
|
36
|
+
export type EngineMarkId = "claude" | "codex";
|
|
37
|
+
export interface EngineMarkArt { path: string; label: string }
|
|
38
|
+
export const ENGINE_MARK_ART: Record<EngineMarkId, EngineMarkArt> = {
|
|
39
|
+
claude: { path: claudeAsterisk(), label: "Claude Code" },
|
|
40
|
+
codex: { path: CODEX_HEX, label: "Codex" },
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export function isEngineMarkId(v: unknown): v is EngineMarkId {
|
|
44
|
+
return typeof v === "string" && Object.prototype.hasOwnProperty.call(ENGINE_MARK_ART, v);
|
|
45
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Each engine's MARK (0.29.0), moved from the admin (apps/admin/src/lib/engine-mark-art.ts + components/chat/EngineMark.tsx).
|
|
3
|
+
*
|
|
4
|
+
* Where it shows: on the engine chip when the composer row is too narrow for the name (a name cut to "Clau…" says
|
|
5
|
+
* nothing; a mark still says whose model answers), and in a narration row that stands for the turn itself.
|
|
6
|
+
*
|
|
7
|
+
* One shape per engine, never a shared one: a mark that is right for one engine and wrong for the other reads as evidence
|
|
8
|
+
* while naming the wrong thing. An engine with no artwork draws NOTHING (silence rather than somebody else's logo), and
|
|
9
|
+
* the chip then keeps its name.
|
|
10
|
+
*/
|
|
11
|
+
import "../assistant-engine.css"; // the mark's size (`.gemboss-engine-mark`), with the chip that shows it
|
|
12
|
+
import React from "react";
|
|
13
|
+
|
|
14
|
+
import { ENGINE_MARK_ART, ENGINE_MARK_FILL_RULE, isEngineMarkId } from "./engine-mark-art";
|
|
15
|
+
export { ENGINE_MARK_ART, ENGINE_MARK_FILL_RULE, isEngineMarkId, type EngineMarkArt, type EngineMarkId } from "./engine-mark-art";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/** The mark as an image with a NAME (the hover text and the accessible name), or nothing when the engine has no artwork. */
|
|
19
|
+
export function EngineMark({ engine, title, className = "gemboss-engine-mark", decorative = false }: {
|
|
20
|
+
engine: string;
|
|
21
|
+
title?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
/** Inside a control that already names the engine (the chip): hidden from assistive tech, no hover title. */
|
|
24
|
+
decorative?: boolean;
|
|
25
|
+
}) {
|
|
26
|
+
if (!isEngineMarkId(engine)) return null;
|
|
27
|
+
const art = ENGINE_MARK_ART[engine];
|
|
28
|
+
const name = title || art.label;
|
|
29
|
+
return decorative ? (
|
|
30
|
+
<svg className={className} viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false">
|
|
31
|
+
<path d={art.path} fillRule={ENGINE_MARK_FILL_RULE} />
|
|
32
|
+
</svg>
|
|
33
|
+
) : (
|
|
34
|
+
<svg className={className} viewBox="0 0 24 24" fill="currentColor" role="img" aria-label={name}>
|
|
35
|
+
<title>{name}</title>
|
|
36
|
+
<path d={art.path} fillRule={ENGINE_MARK_FILL_RULE} />
|
|
37
|
+
</svg>
|
|
38
|
+
);
|
|
39
|
+
}
|