@agimon-ai/doompi-web-components 0.0.1-alpha.0 → 0.0.1-alpha.3
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 +25 -6
- package/dist/components/Breadcrumb.d.cts +37 -0
- package/dist/components/Breadcrumb.d.cts.map +1 -0
- package/dist/components/CodeEditor.d.cts +6 -0
- package/dist/components/CodeEditor.d.cts.map +1 -0
- package/dist/components/Dialog.d.cts.map +1 -1
- package/dist/components/MediaPreview.d.cts +25 -0
- package/dist/components/MediaPreview.d.cts.map +1 -0
- package/dist/icons/icons.d.cts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +8 -2
- package/dist/index.d.mts +8 -2
- package/dist/index.mjs +1 -1
- package/dist/lib/editorLanguage.d.cts +22 -0
- package/dist/lib/editorLanguage.d.cts.map +1 -0
- package/dist/lib/media.d.cts +12 -0
- package/dist/lib/media.d.cts.map +1 -0
- package/dist/src/components/Breadcrumb.cjs +2 -0
- package/dist/src/components/Breadcrumb.cjs.map +1 -0
- package/dist/src/components/Breadcrumb.d.mts +37 -0
- package/dist/src/components/Breadcrumb.d.mts.map +1 -0
- package/dist/src/components/Breadcrumb.mjs +2 -0
- package/dist/src/components/Breadcrumb.mjs.map +1 -0
- package/dist/src/components/CodeEditor.cjs +2 -0
- package/dist/src/components/CodeEditor.cjs.map +1 -0
- package/dist/src/components/CodeEditor.d.mts +6 -0
- package/dist/src/components/CodeEditor.d.mts.map +1 -0
- package/dist/src/components/CodeEditor.mjs +2 -0
- package/dist/src/components/CodeEditor.mjs.map +1 -0
- package/dist/src/components/CodeEditorView.cjs +2 -0
- package/dist/src/components/CodeEditorView.cjs.map +1 -0
- package/dist/src/components/CodeEditorView.mjs +2 -0
- package/dist/src/components/CodeEditorView.mjs.map +1 -0
- package/dist/src/components/Dialog.cjs +1 -1
- package/dist/src/components/Dialog.cjs.map +1 -1
- package/dist/src/components/Dialog.d.mts.map +1 -1
- package/dist/src/components/Dialog.mjs +1 -1
- package/dist/src/components/Dialog.mjs.map +1 -1
- package/dist/src/components/EmptyState.cjs +1 -1
- package/dist/src/components/EmptyState.cjs.map +1 -1
- package/dist/src/components/EmptyState.mjs +1 -1
- package/dist/src/components/EmptyState.mjs.map +1 -1
- package/dist/src/components/MediaPreview.cjs +2 -0
- package/dist/src/components/MediaPreview.cjs.map +1 -0
- package/dist/src/components/MediaPreview.d.mts +25 -0
- package/dist/src/components/MediaPreview.d.mts.map +1 -0
- package/dist/src/components/MediaPreview.mjs +2 -0
- package/dist/src/components/MediaPreview.mjs.map +1 -0
- package/dist/src/components/Popover.cjs +1 -1
- package/dist/src/components/Popover.cjs.map +1 -1
- package/dist/src/components/Popover.mjs +1 -1
- package/dist/src/components/Popover.mjs.map +1 -1
- package/dist/src/icons/icons.cjs +1 -1
- package/dist/src/icons/icons.d.mts +2 -2
- package/dist/src/icons/icons.mjs +1 -1
- package/dist/src/lib/editorLanguage.cjs +2 -0
- package/dist/src/lib/editorLanguage.cjs.map +1 -0
- package/dist/src/lib/editorLanguage.d.mts +22 -0
- package/dist/src/lib/editorLanguage.d.mts.map +1 -0
- package/dist/src/lib/editorLanguage.mjs +2 -0
- package/dist/src/lib/editorLanguage.mjs.map +1 -0
- package/dist/src/lib/editorTheme.cjs +2 -0
- package/dist/src/lib/editorTheme.cjs.map +1 -0
- package/dist/src/lib/editorTheme.mjs +2 -0
- package/dist/src/lib/editorTheme.mjs.map +1 -0
- package/dist/src/lib/media.cjs +2 -0
- package/dist/src/lib/media.cjs.map +1 -0
- package/dist/src/lib/media.d.mts +12 -0
- package/dist/src/lib/media.d.mts.map +1 -0
- package/dist/src/lib/media.mjs +2 -0
- package/dist/src/lib/media.mjs.map +1 -0
- package/dist/src/types/editor.cjs +2 -0
- package/dist/src/types/editor.cjs.map +1 -0
- package/dist/src/types/editor.d.mts +44 -0
- package/dist/src/types/editor.d.mts.map +1 -0
- package/dist/src/types/editor.mjs +2 -0
- package/dist/src/types/editor.mjs.map +1 -0
- package/dist/types/editor.d.cts +44 -0
- package/dist/types/editor.d.cts.map +1 -0
- package/package.json +16 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MediaKind } from "../types/editor.mjs";
|
|
2
|
+
//#region src/lib/media.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* How to show the file at this path. Anything unrecognised is a download,
|
|
5
|
+
* which is the honest answer for a `.docx` or a `.zip`: a browser cannot
|
|
6
|
+
* render it, and pretending otherwise costs a converter that loses the
|
|
7
|
+
* formatting it converted.
|
|
8
|
+
*/
|
|
9
|
+
declare function mediaKindOf(filePath: string): MediaKind;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { mediaKindOf };
|
|
12
|
+
//# sourceMappingURL=media.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.d.mts","names":[],"sources":["../../../src/lib/media.ts"],"mappings":";;;;;;;;iBAyCgB,YAAY,mBAAmB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e={avif:`image`,bmp:`image`,gif:`image`,ico:`image`,jpeg:`image`,jpg:`image`,png:`image`,svg:`image`,webp:`image`,m4v:`video`,mov:`video`,mp4:`video`,webm:`video`,pdf:`pdf`};function t(e){let t=e.split(`/`).at(-1)??``,n=t.lastIndexOf(`.`);return n<1?``:t.slice(n+1).toLowerCase()}function n(n){return e[t(n)]??`download`}export{n as mediaKindOf};
|
|
2
|
+
//# sourceMappingURL=media.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.mjs","names":[],"sources":["../../../src/lib/media.ts"],"sourcesContent":["import type { MediaKind } from '../types/editor.ts';\n\n/**\n * Which files a browser can show without help.\n *\n * Keyed by lower-case extension without the dot, and deliberately short: an\n * entry here is a promise that the element named by its kind will render the\n * bytes, so a format the browser only sometimes handles belongs in the\n * download fallback instead of on this list.\n */\nconst MEDIA_KIND_BY_EXTENSION: Readonly<Record<string, MediaKind>> = {\n avif: 'image',\n bmp: 'image',\n gif: 'image',\n ico: 'image',\n jpeg: 'image',\n jpg: 'image',\n png: 'image',\n svg: 'image',\n webp: 'image',\n m4v: 'video',\n mov: 'video',\n mp4: 'video',\n webm: 'video',\n pdf: 'pdf',\n};\n\n/** The extension of a path, lower-cased and without the dot; empty when it has none. */\nfunction extensionOf(filePath: string): string {\n const name = filePath.split('/').at(-1) ?? '';\n const dot = name.lastIndexOf('.');\n // A leading dot is the whole name of a dotfile, not the start of a suffix.\n return dot < 1 ? '' : name.slice(dot + 1).toLowerCase();\n}\n\n/**\n * How to show the file at this path. Anything unrecognised is a download,\n * which is the honest answer for a `.docx` or a `.zip`: a browser cannot\n * render it, and pretending otherwise costs a converter that loses the\n * formatting it converted.\n */\nexport function mediaKindOf(filePath: string): MediaKind {\n return MEDIA_KIND_BY_EXTENSION[extensionOf(filePath)] ?? 'download';\n}\n"],"mappings":"AAUA,MAAM,EAA+D,CACnE,KAAM,QACN,IAAK,QACL,IAAK,QACL,IAAK,QACL,KAAM,QACN,IAAK,QACL,IAAK,QACL,IAAK,QACL,KAAM,QACN,IAAK,QACL,IAAK,QACL,IAAK,QACL,KAAM,QACN,IAAK,KACP,EAGA,SAAS,EAAY,EAA0B,CAC7C,IAAM,EAAO,EAAS,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,GAAK,GACrC,EAAM,EAAK,YAAY,GAAG,EAEhC,OAAO,EAAM,EAAI,GAAK,EAAK,MAAM,EAAM,CAAC,CAAC,CAAC,YAAY,CACxD,CAQA,SAAgB,EAAY,EAA6B,CACvD,OAAO,EAAwB,EAAY,CAAQ,IAAM,UAC3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.cjs","names":[],"sources":["../../../src/types/editor.ts"],"sourcesContent":["/**\n * The vocabulary a file surface shares: how a file is shown, and what an\n * editor hands back when a reader selects part of one.\n *\n * It lives here rather than beside the components so a caller can classify a\n * path, or hold a selection in its own state, without pulling the editor\n * chunk in behind it.\n */\n\n/** How a file is shown when its bytes are not text: inline by kind, or offered as a download. */\nexport const MEDIA_KINDS = ['image', 'video', 'pdf', 'download'] as const;\nexport type MediaKind = (typeof MEDIA_KINDS)[number];\n\n/**\n * What a reader picked out, in the terms a review comment needs: the text\n * itself, and where it sits. Lines are one-based, matching what an editor\n * gutter shows, and a caret with nothing selected reports the same line twice\n * with empty text.\n */\nexport interface EditorSelectionRange {\n text: string;\n startLine: number;\n endLine: number;\n}\n\nexport interface CodeEditorProps {\n value: string;\n /**\n * The file this content came from. It picks the syntax grammar and nothing\n * else; leave it off and the editor stays plain text.\n */\n path?: string;\n readOnly?: boolean;\n /**\n * Wraps long lines rather than scrolling sideways. On by default, because\n * the cockpit is read on phones and unwrapped code there is unreadable.\n */\n lineWrapping?: boolean;\n className?: string;\n 'data-testid'?: string;\n onChange?: (value: string) => void;\n onSelect?: (range: EditorSelectionRange) => void;\n}\n"],"mappings":"AAUA,MAAa,EAAc,CAAC,QAAS,QAAS,MAAO,UAAU"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//#region src/types/editor.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The vocabulary a file surface shares: how a file is shown, and what an
|
|
4
|
+
* editor hands back when a reader selects part of one.
|
|
5
|
+
*
|
|
6
|
+
* It lives here rather than beside the components so a caller can classify a
|
|
7
|
+
* path, or hold a selection in its own state, without pulling the editor
|
|
8
|
+
* chunk in behind it.
|
|
9
|
+
*/
|
|
10
|
+
/** How a file is shown when its bytes are not text: inline by kind, or offered as a download. */
|
|
11
|
+
declare const MEDIA_KINDS: readonly ['image', 'video', 'pdf', 'download'];
|
|
12
|
+
type MediaKind = (typeof MEDIA_KINDS)[number];
|
|
13
|
+
/**
|
|
14
|
+
* What a reader picked out, in the terms a review comment needs: the text
|
|
15
|
+
* itself, and where it sits. Lines are one-based, matching what an editor
|
|
16
|
+
* gutter shows, and a caret with nothing selected reports the same line twice
|
|
17
|
+
* with empty text.
|
|
18
|
+
*/
|
|
19
|
+
interface EditorSelectionRange {
|
|
20
|
+
text: string;
|
|
21
|
+
startLine: number;
|
|
22
|
+
endLine: number;
|
|
23
|
+
}
|
|
24
|
+
interface CodeEditorProps {
|
|
25
|
+
value: string;
|
|
26
|
+
/**
|
|
27
|
+
* The file this content came from. It picks the syntax grammar and nothing
|
|
28
|
+
* else; leave it off and the editor stays plain text.
|
|
29
|
+
*/
|
|
30
|
+
path?: string;
|
|
31
|
+
readOnly?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Wraps long lines rather than scrolling sideways. On by default, because
|
|
34
|
+
* the cockpit is read on phones and unwrapped code there is unreadable.
|
|
35
|
+
*/
|
|
36
|
+
lineWrapping?: boolean;
|
|
37
|
+
className?: string;
|
|
38
|
+
'data-testid'?: string;
|
|
39
|
+
onChange?: (value: string) => void;
|
|
40
|
+
onSelect?: (range: EditorSelectionRange) => void;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { CodeEditorProps, EditorSelectionRange, MEDIA_KINDS, MediaKind };
|
|
44
|
+
//# sourceMappingURL=editor.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.d.mts","names":[],"sources":["../../../src/types/editor.ts"],"mappings":";;;;;;;;;;cAUa;KACD,oBAAoB;;;;;;;UAQf;EACf;EACA;EACA;;UAGe;EACf;;;;;EAKA;EACA;;;;;EAKA;EACA;EACA;EACA,YAAY;EACZ,YAAY,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.mjs","names":[],"sources":["../../../src/types/editor.ts"],"sourcesContent":["/**\n * The vocabulary a file surface shares: how a file is shown, and what an\n * editor hands back when a reader selects part of one.\n *\n * It lives here rather than beside the components so a caller can classify a\n * path, or hold a selection in its own state, without pulling the editor\n * chunk in behind it.\n */\n\n/** How a file is shown when its bytes are not text: inline by kind, or offered as a download. */\nexport const MEDIA_KINDS = ['image', 'video', 'pdf', 'download'] as const;\nexport type MediaKind = (typeof MEDIA_KINDS)[number];\n\n/**\n * What a reader picked out, in the terms a review comment needs: the text\n * itself, and where it sits. Lines are one-based, matching what an editor\n * gutter shows, and a caret with nothing selected reports the same line twice\n * with empty text.\n */\nexport interface EditorSelectionRange {\n text: string;\n startLine: number;\n endLine: number;\n}\n\nexport interface CodeEditorProps {\n value: string;\n /**\n * The file this content came from. It picks the syntax grammar and nothing\n * else; leave it off and the editor stays plain text.\n */\n path?: string;\n readOnly?: boolean;\n /**\n * Wraps long lines rather than scrolling sideways. On by default, because\n * the cockpit is read on phones and unwrapped code there is unreadable.\n */\n lineWrapping?: boolean;\n className?: string;\n 'data-testid'?: string;\n onChange?: (value: string) => void;\n onSelect?: (range: EditorSelectionRange) => void;\n}\n"],"mappings":"AAUA,MAAa,EAAc,CAAC,QAAS,QAAS,MAAO,UAAU"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//#region src/types/editor.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The vocabulary a file surface shares: how a file is shown, and what an
|
|
4
|
+
* editor hands back when a reader selects part of one.
|
|
5
|
+
*
|
|
6
|
+
* It lives here rather than beside the components so a caller can classify a
|
|
7
|
+
* path, or hold a selection in its own state, without pulling the editor
|
|
8
|
+
* chunk in behind it.
|
|
9
|
+
*/
|
|
10
|
+
/** How a file is shown when its bytes are not text: inline by kind, or offered as a download. */
|
|
11
|
+
declare const MEDIA_KINDS: readonly ['image', 'video', 'pdf', 'download'];
|
|
12
|
+
type MediaKind = (typeof MEDIA_KINDS)[number];
|
|
13
|
+
/**
|
|
14
|
+
* What a reader picked out, in the terms a review comment needs: the text
|
|
15
|
+
* itself, and where it sits. Lines are one-based, matching what an editor
|
|
16
|
+
* gutter shows, and a caret with nothing selected reports the same line twice
|
|
17
|
+
* with empty text.
|
|
18
|
+
*/
|
|
19
|
+
interface EditorSelectionRange {
|
|
20
|
+
text: string;
|
|
21
|
+
startLine: number;
|
|
22
|
+
endLine: number;
|
|
23
|
+
}
|
|
24
|
+
interface CodeEditorProps {
|
|
25
|
+
value: string;
|
|
26
|
+
/**
|
|
27
|
+
* The file this content came from. It picks the syntax grammar and nothing
|
|
28
|
+
* else; leave it off and the editor stays plain text.
|
|
29
|
+
*/
|
|
30
|
+
path?: string;
|
|
31
|
+
readOnly?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Wraps long lines rather than scrolling sideways. On by default, because
|
|
34
|
+
* the cockpit is read on phones and unwrapped code there is unreadable.
|
|
35
|
+
*/
|
|
36
|
+
lineWrapping?: boolean;
|
|
37
|
+
className?: string;
|
|
38
|
+
'data-testid'?: string;
|
|
39
|
+
onChange?: (value: string) => void;
|
|
40
|
+
onSelect?: (range: EditorSelectionRange) => void;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { CodeEditorProps, EditorSelectionRange, MEDIA_KINDS, MediaKind };
|
|
44
|
+
//# sourceMappingURL=editor.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.d.cts","names":[],"sources":["../../src/types/editor.ts"],"mappings":";;;;;;;;;;cAUa;KACD,oBAAoB;;;;;;;UAQf;EACf;EACA;EACA;;UAGe;EACf;;;;;EAKA;EACA;;;;;EAKA;EACA;EACA;EACA,YAAY;EACZ,YAAY,OAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/doompi-web-components",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.3",
|
|
4
4
|
"description": "Shared web components and theme tokens for the DoomPi cockpit and its web plugins: shadcn-style primitives on Radix, tuned to the Doom palette, with runtime theme configs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -58,6 +58,20 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
+
"@codemirror/commands": "6.11.0",
|
|
62
|
+
"@codemirror/lang-css": "6.3.1",
|
|
63
|
+
"@codemirror/lang-html": "6.4.12",
|
|
64
|
+
"@codemirror/lang-javascript": "6.2.5",
|
|
65
|
+
"@codemirror/lang-json": "6.0.2",
|
|
66
|
+
"@codemirror/lang-markdown": "6.5.2",
|
|
67
|
+
"@codemirror/lang-python": "6.2.1",
|
|
68
|
+
"@codemirror/lang-yaml": "6.1.3",
|
|
69
|
+
"@codemirror/language": "6.12.4",
|
|
70
|
+
"@codemirror/legacy-modes": "6.5.3",
|
|
71
|
+
"@codemirror/search": "6.7.1",
|
|
72
|
+
"@codemirror/state": "6.7.1",
|
|
73
|
+
"@codemirror/view": "6.43.9",
|
|
74
|
+
"@lezer/highlight": "1.2.3",
|
|
61
75
|
"class-variance-authority": "0.7.1",
|
|
62
76
|
"clsx": "2.1.1",
|
|
63
77
|
"lucide-react": "1.31.0",
|
|
@@ -76,7 +90,7 @@
|
|
|
76
90
|
"tsdown": "0.22.14",
|
|
77
91
|
"typescript": "7.0.2",
|
|
78
92
|
"vitest": "4.1.11",
|
|
79
|
-
"@agimon-ai/vibe-lint-plugin-doom-web": "0.0.1-alpha.
|
|
93
|
+
"@agimon-ai/vibe-lint-plugin-doom-web": "0.0.1-alpha.39"
|
|
80
94
|
},
|
|
81
95
|
"peerDependencies": {
|
|
82
96
|
"react": "^19.0.0",
|