@kumix/ui 0.3.8 → 0.3.10

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.
Files changed (102) hide show
  1. package/README.md +16 -15
  2. package/dist/components/agents/ai-sidebar.js +3 -5
  3. package/dist/components/agents/ai-sidebar.js.map +1 -1
  4. package/dist/components/motion/animated-sidebar.d.ts.map +1 -1
  5. package/dist/components/motion/animated-sidebar.js.map +1 -1
  6. package/dist/components/motion/availability-scheduler/copy-menu.js +1 -1
  7. package/dist/components/motion/availability-scheduler/day-row.d.ts.map +1 -1
  8. package/dist/components/motion/availability-scheduler/day-row.js +15 -7
  9. package/dist/components/motion/availability-scheduler/day-row.js.map +1 -1
  10. package/dist/components/motion/availability-scheduler/index.js +1 -1
  11. package/dist/components/motion/button/index.d.ts +2 -1
  12. package/dist/components/motion/button/index.js +2 -1
  13. package/dist/components/motion/button/metallic.d.ts +10 -0
  14. package/dist/components/motion/button/metallic.d.ts.map +1 -0
  15. package/dist/components/motion/button/metallic.js +71 -0
  16. package/dist/components/motion/button/metallic.js.map +1 -0
  17. package/dist/components/motion/combobox/content.js +1 -1
  18. package/dist/components/motion/combobox/context.d.ts +6 -0
  19. package/dist/components/motion/combobox/context.d.ts.map +1 -1
  20. package/dist/components/motion/combobox/context.js +1 -233
  21. package/dist/components/motion/combobox/list.js +1 -1
  22. package/dist/components/motion/combobox/trigger.js +7 -8
  23. package/dist/components/motion/combobox/trigger.js.map +1 -1
  24. package/dist/components/motion/combobox.js +1 -1
  25. package/dist/components/motion/command-palette.d.ts.map +1 -1
  26. package/dist/components/motion/command-palette.js +21 -26
  27. package/dist/components/motion/command-palette.js.map +1 -1
  28. package/dist/components/motion/expandable-control.d.ts +28 -0
  29. package/dist/components/motion/expandable-control.d.ts.map +1 -0
  30. package/dist/components/motion/expandable-control.js +149 -0
  31. package/dist/components/motion/expandable-control.js.map +1 -0
  32. package/dist/components/motion/expanding-arrow-button.d.ts +12 -0
  33. package/dist/components/motion/expanding-arrow-button.d.ts.map +1 -0
  34. package/dist/components/motion/expanding-arrow-button.js +142 -0
  35. package/dist/components/motion/expanding-arrow-button.js.map +1 -0
  36. package/dist/components/motion/file-tree.d.ts +42 -0
  37. package/dist/components/motion/file-tree.d.ts.map +1 -0
  38. package/dist/components/motion/file-tree.js +272 -0
  39. package/dist/components/motion/file-tree.js.map +1 -0
  40. package/dist/components/motion/morphing-search.d.ts.map +1 -1
  41. package/dist/components/motion/morphing-search.js +27 -23
  42. package/dist/components/motion/morphing-search.js.map +1 -1
  43. package/dist/components/reui/alert.d.ts +1 -1
  44. package/dist/components/reui/badge.d.ts +1 -1
  45. package/dist/components/reui/code-block/code-block-highlight.d.ts +216 -0
  46. package/dist/components/reui/code-block/code-block-highlight.d.ts.map +1 -0
  47. package/dist/components/reui/code-block/code-block-highlight.js +792 -0
  48. package/dist/components/reui/code-block/code-block-highlight.js.map +1 -0
  49. package/dist/components/reui/code-block/code-block.d.ts +197 -0
  50. package/dist/components/reui/code-block/code-block.d.ts.map +1 -0
  51. package/dist/components/reui/code-block/code-block.js +1150 -0
  52. package/dist/components/reui/code-block/code-block.js.map +1 -0
  53. package/dist/components/reui/filters/filters-builder.js +1 -1
  54. package/dist/components/reui/filters/filters-chip.js.map +1 -1
  55. package/dist/components/reui/filters/filters-editors.js +2 -2
  56. package/dist/components/reui/filters/filters-editors.js.map +1 -1
  57. package/dist/components/reui/gantt/gantt-bar.js +42 -12
  58. package/dist/components/reui/gantt/gantt-bar.js.map +1 -1
  59. package/dist/components/reui/gantt/gantt-dnd.d.ts.map +1 -1
  60. package/dist/components/reui/gantt/gantt-dnd.js +22 -7
  61. package/dist/components/reui/gantt/gantt-dnd.js.map +1 -1
  62. package/dist/components/reui/gantt/gantt-i18n.d.ts +8 -0
  63. package/dist/components/reui/gantt/gantt-i18n.d.ts.map +1 -1
  64. package/dist/components/reui/gantt/gantt-i18n.js +6 -1
  65. package/dist/components/reui/gantt/gantt-i18n.js.map +1 -1
  66. package/dist/components/reui/gantt/gantt-lib.d.ts +59 -2
  67. package/dist/components/reui/gantt/gantt-lib.d.ts.map +1 -1
  68. package/dist/components/reui/gantt/gantt-lib.js +67 -2
  69. package/dist/components/reui/gantt/gantt-lib.js.map +1 -1
  70. package/dist/components/reui/gantt/gantt-recurrence.js +3 -3
  71. package/dist/components/reui/gantt/gantt-recurrence.js.map +1 -1
  72. package/dist/components/reui/gantt/gantt-types.d.ts +32 -1
  73. package/dist/components/reui/gantt/gantt-types.d.ts.map +1 -1
  74. package/dist/components/reui/gantt/gantt-view.d.ts.map +1 -1
  75. package/dist/components/reui/gantt/gantt-view.js +324 -35
  76. package/dist/components/reui/gantt/gantt-view.js.map +1 -1
  77. package/dist/components/reui/gantt/gantt.d.ts +71 -2
  78. package/dist/components/reui/gantt/gantt.d.ts.map +1 -1
  79. package/dist/components/reui/gantt/gantt.js +8 -0
  80. package/dist/components/reui/gantt/gantt.js.map +1 -1
  81. package/dist/components/ui/badge.d.ts +1 -1
  82. package/dist/components/ui/bubble.d.ts +1 -1
  83. package/dist/components/ui/button.d.ts +1 -1
  84. package/dist/components/ui/item.d.ts +1 -1
  85. package/dist/components/ui/marker.d.ts +1 -1
  86. package/dist/components/ui/tabs.d.ts +1 -1
  87. package/dist/context-BizvUNZv.js +298 -0
  88. package/dist/context-BizvUNZv.js.map +1 -0
  89. package/dist/{copy-menu-1FKoMc9o.js → copy-menu-C5GaT4Z-.js} +67 -2
  90. package/dist/copy-menu-C5GaT4Z-.js.map +1 -0
  91. package/dist/hooks/use-on-open.d.ts +18 -0
  92. package/dist/hooks/use-on-open.d.ts.map +1 -0
  93. package/dist/hooks/use-on-open.js +27 -0
  94. package/dist/hooks/use-on-open.js.map +1 -0
  95. package/dist/hooks/use-row-cursor.d.ts +39 -0
  96. package/dist/hooks/use-row-cursor.d.ts.map +1 -0
  97. package/dist/hooks/use-row-cursor.js +77 -0
  98. package/dist/hooks/use-row-cursor.js.map +1 -0
  99. package/dist/types-smkWN_7x.d.ts.map +1 -1
  100. package/package.json +7 -13
  101. package/dist/components/motion/combobox/context.js.map +0 -1
  102. package/dist/copy-menu-1FKoMc9o.js.map +0 -1
@@ -0,0 +1,216 @@
1
+ import { ReactNode } from "react";
2
+ import { ShikiTransformer } from "shiki";
3
+ //#region src/components/reui/code-block/code-block-highlight.d.ts
4
+ /**
5
+ * One themed slice of a line. `color`/`colorDark` emit as `--cb-c`/`--cb-cd`
6
+ * custom properties, so one rule pair on the `<pre>` theme-switches the whole
7
+ * block. An uncoloured token keeps both undefined and renders as a bare text
8
+ * node with no wrapper.
9
+ */
10
+ type CodeBlockToken = {
11
+ content: string;
12
+ color?: string;
13
+ colorDark?: string;
14
+ fontStyle?: CodeBlockFontStyle;
15
+ word?: boolean;
16
+ };
17
+ type CodeBlockFontStyle = "italic" | "bold" | "underline";
18
+ type CodeBlockDiffKind = "add" | "remove";
19
+ type CodeBlockLevel = "error" | "warning" | "info";
20
+ /**
21
+ * Per-line presentation state, resolved once at highlight time.
22
+ *
23
+ * Two sources merge here: the props on the root, and the classes a shiki
24
+ * transformer put on the line, so `@shikijs/transformers` notation such as
25
+ * `[!code ++]` reaches the same place without the renderer knowing shiki
26
+ * exists. Props win on conflict, because notation lives in the source string,
27
+ * which a consumer often does not control.
28
+ */
29
+ type CodeBlockLineState = {
30
+ highlighted?: boolean;
31
+ diff?: CodeBlockDiffKind;
32
+ focused?: boolean;
33
+ level?: CodeBlockLevel;
34
+ };
35
+ /**
36
+ * A rendered line. `number` is the DISPLAYED number (offset by `startLine`);
37
+ * line specs address source lines, so changing `startLine` never invalidates
38
+ * them. Instances are reused across passes when unchanged, which is what lets
39
+ * the row be a plain `React.memo` and a streamed chunk cost one re-render.
40
+ */
41
+ type CodeBlockLine = {
42
+ tokens: CodeBlockToken[];
43
+ number: number;
44
+ text: string;
45
+ state?: CodeBlockLineState;
46
+ /**
47
+ * Replaces the counter-driven gutter number for this row - a unified patch
48
+ * shows "old new" pairs, a hunk header shows dots. Rendered verbatim.
49
+ */
50
+ gutter?: string;
51
+ };
52
+ /** Source lines, as `[2, 3, 4]` or as a range string such as `"2-4,7"`. */
53
+ type CodeBlockLineSpec = number[] | string;
54
+ type CodeBlockDiffSpec = {
55
+ added?: CodeBlockLineSpec;
56
+ removed?: CodeBlockLineSpec;
57
+ };
58
+ type CodeBlockLevelSpec = Partial<Record<CodeBlockLevel, CodeBlockLineSpec>>;
59
+ /** A word to mark, optionally restricted to some source lines. */
60
+ type CodeBlockWordSpec = string | {
61
+ word: string;
62
+ lines?: CodeBlockLineSpec;
63
+ };
64
+ type CodeBlockThemes = {
65
+ light: string;
66
+ dark: string;
67
+ };
68
+ /**
69
+ * shiki's own transformer type, imported type-only so it erases at compile
70
+ * time and costs the bundle nothing. The previous structural stand-in
71
+ * (`Record<string, unknown>`) rejected every real `ShikiTransformer`: an
72
+ * interface without an index signature is not assignable to it.
73
+ */
74
+ type CodeBlockTransformer = ShikiTransformer;
75
+ type CodeBlockHighlightOptions = {
76
+ language?: string;
77
+ themes?: CodeBlockThemes;
78
+ transformers?: CodeBlockTransformer[];
79
+ startLine?: number;
80
+ /**
81
+ * Distinguishes same-signature blocks in the line-reuse cache. Without it,
82
+ * two identically-configured streams evict each other's previous document.
83
+ * The root passes its own instance id.
84
+ */
85
+ instanceKey?: string;
86
+ highlightedLines?: CodeBlockLineSpec;
87
+ highlightedWords?: CodeBlockWordSpec[];
88
+ focusedLines?: CodeBlockLineSpec;
89
+ diff?: CodeBlockDiffSpec;
90
+ lineLevels?: CodeBlockLevelSpec;
91
+ };
92
+ /** What a `CodeBlockLineActions` render prop receives. */
93
+ type CodeBlockLineActionContext = {
94
+ line: number;
95
+ text: string;
96
+ state?: CodeBlockLineState;
97
+ };
98
+ type CodeBlockLineActionsRender = (context: CodeBlockLineActionContext) => ReactNode;
99
+ /**
100
+ * A STATIC map, never ``import(`shiki/langs/${lang}.mjs`)``: a template import
101
+ * makes bundlers bundle all ~200 grammars. Written out, each entry is its own
102
+ * lazy chunk. To add a language, add a line: that is the intended extension
103
+ * point of this file.
104
+ */
105
+ declare const codeBlockLanguages: Record<string, () => Promise<unknown>>;
106
+ declare const codeBlockThemes: Record<string, () => Promise<unknown>>;
107
+ declare const DEFAULT_CODE_BLOCK_THEMES: CodeBlockThemes;
108
+ /** Resolves an alias and reports whether the grammar is actually available. */
109
+ declare function resolveCodeBlockLanguage(language?: string): string | undefined;
110
+ /**
111
+ * Turns `[2, 3]` or `"2-4,7"` into a set of source line numbers.
112
+ *
113
+ * Deliberately total: a reversed range, a negative bound or outright garbage
114
+ * yields an empty set rather than throwing. These values often come from user
115
+ * content or from a model, and a code viewer that crashes on a bad range is
116
+ * worse than one that shows no highlight.
117
+ */
118
+ declare function parseLineSpec(spec?: CodeBlockLineSpec): Set<number>;
119
+ /** Normalises line endings so every downstream offset is LF-based. */
120
+ declare function normalizeCode(code: string): string;
121
+ /**
122
+ * Character ranges for `highlightedWords`, as shiki `decorations`.
123
+ *
124
+ * shiki rejects overlapping decorations, so a later match that would overlap an
125
+ * earlier one is dropped rather than passed through to throw.
126
+ */
127
+ declare function buildWordDecorations(code: string, words?: CodeBlockWordSpec[]): {
128
+ start: number;
129
+ end: number;
130
+ properties: {
131
+ class: string;
132
+ };
133
+ }[];
134
+ /**
135
+ * Strips `[!code ...]` notation from a copy payload: the transformer already
136
+ * drops it from RENDERED output, but the raw `code` string would paste the
137
+ * comment into someone's editor.
138
+ */
139
+ declare function stripNotationComments(code: string): string;
140
+ /**
141
+ * Plain, unhighlighted lines. One token per line, no colour.
142
+ *
143
+ * This is both the `highlight={false}` renderer and the first paint of a
144
+ * streaming block, so the tail of a stream is readable before its grammar pass
145
+ * lands and no frame is ever blank.
146
+ */
147
+ declare function toPlainLines(code: string, startLine?: number): CodeBlockLine[];
148
+ /**
149
+ * Pulls `code` and `language` out of the props react-markdown gives a `pre`:
150
+ * the glue every AI chat app writes by hand, shipped here instead. Tolerant by
151
+ * construction, because a still-streaming fence has no closing delimiter and
152
+ * often no language yet, and must render as plain text rather than throw.
153
+ */
154
+ declare function markdownCodeProps(props: {
155
+ children?: ReactNode;
156
+ className?: string;
157
+ }): {
158
+ code: string;
159
+ language?: string;
160
+ };
161
+ /** One segment of a markdown string: prose, or a fenced code block. */
162
+ type CodeBlockMarkdownPart = {
163
+ type: "text" | "code";
164
+ content: string;
165
+ language?: string;
166
+ /** True for a fence whose closing delimiter has not arrived yet. */
167
+ open: boolean;
168
+ };
169
+ /**
170
+ * Splits markdown into prose and fenced code, for transcripts that render a
171
+ * raw assistant message without a markdown dependency. The unterminated
172
+ * trailing fence is the point: mid-stream it comes back as a code part flagged
173
+ * `open`, instead of being dropped or read as prose.
174
+ */
175
+ declare function markdownFences(markdown: string): CodeBlockMarkdownPart[];
176
+ /**
177
+ * Highlights `code` into the renderer's line shape. Built on `codeToHast` so
178
+ * consumer transformers run and their line classes land in `line.state`,
179
+ * making prop state and `[!code ++]` notation one feature, not two code
180
+ * paths. Safe in a server component: the result is plain JSON.
181
+ */
182
+ declare function highlightCode(code: string, options?: CodeBlockHighlightOptions): Promise<CodeBlockLine[]>;
183
+ /** Test seam: drops the singleton and every cached document. */
184
+ declare function resetCodeBlockHighlighter(): void;
185
+ /**
186
+ * Terminal output with SGR colour codes, as renderable lines: feed the result
187
+ * to the `lines` prop. Covers what agent stdout actually uses - 30-37 / 90-97
188
+ * foregrounds, 38;5;n and 38;2;r;g;b, bold, italic, underline and resets.
189
+ * Backgrounds and cursor movements are STRIPPED rather than rendered: a code
190
+ * surface has its own background, and a partial screen-drawing stream is
191
+ * better read as text than half-drawn.
192
+ */
193
+ declare function ansiToLines(text: string, startLine?: number): CodeBlockLine[];
194
+ type CodeBlockPatchFile = {
195
+ /** New-side path, or the old one for a deletion. */
196
+ file: string;
197
+ /** Unified view: context, removed and added lines with dual gutter labels. */
198
+ lines: CodeBlockLine[];
199
+ added: number;
200
+ removed: number;
201
+ hunks: {
202
+ header: string;
203
+ at: number;
204
+ }[];
205
+ };
206
+ /**
207
+ * A `git diff` / unified patch, as renderable per-file line sets: feed each
208
+ * file's `lines` to the `lines` prop and the diff tints, `+`/`-` glyphs and
209
+ * dual old/new gutter numbers all come from the parse - no `diff` prop
210
+ * arithmetic against a hand-concatenated string. Tokens are plain; patches
211
+ * read by tint, not grammar.
212
+ */
213
+ declare function parseUnifiedDiff(patch: string): CodeBlockPatchFile[];
214
+ //#endregion
215
+ export { CodeBlockDiffKind, CodeBlockDiffSpec, CodeBlockFontStyle, CodeBlockHighlightOptions, CodeBlockLevel, CodeBlockLevelSpec, CodeBlockLine, CodeBlockLineActionContext, CodeBlockLineActionsRender, CodeBlockLineSpec, CodeBlockLineState, CodeBlockMarkdownPart, CodeBlockPatchFile, CodeBlockThemes, CodeBlockToken, CodeBlockTransformer, CodeBlockWordSpec, DEFAULT_CODE_BLOCK_THEMES, ansiToLines, buildWordDecorations, codeBlockLanguages, codeBlockThemes, highlightCode, markdownCodeProps, markdownFences, normalizeCode, parseLineSpec, parseUnifiedDiff, resetCodeBlockHighlighter, resolveCodeBlockLanguage, stripNotationComments, toPlainLines };
216
+ //# sourceMappingURL=code-block-highlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-block-highlight.d.ts","names":[],"sources":["../../../../src/components/reui/code-block/code-block-highlight.tsx"],"mappings":";;;;;;;;;KAWY;EACV;EACA;EACA;EACA,YAAY;EACZ;;KAGU;KAEA;KAEA;;;;;;;;;;KAWA;EACV;EACA,OAAO;EACP;EACA,QAAQ;;;;;;;;KASE;EACV,QAAQ;EACR;EACA;EACA,QAAQ;;;;;EAKR;;;KAIU;KAEA;EACV,QAAQ;EACR,UAAU;;KAGA,qBAAqB,QAAQ,OAAO,gBAAgB;;KAGpD;EAA+B;EAAc,QAAQ;;KAErD;EAAoB;EAAe;;;;;;;;KAQnC,uBAAuB;KAEvB;EACV;EACA,SAAS;EACT,eAAe;EACf;;;;;;EAMA;EACA,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;EACf,OAAO;EACP,aAAa;;;KAIH;EACV;EACA;EACA,QAAQ;;KAGE,8BAA8B,SAAS,+BAA+B;;;;;;;cAYrE,oBAAoB,qBAAqB;cAqDzC,iBAAiB,qBAAqB;cAqBtC,2BAA2B;;iBAMxB,yBAAyB;;;;;;;;;iBAmBzB,cAAc,OAAO,oBAAoB;;iBAmCzC,cAAc;;;;;;;iBAUd,qBACd,cACA,QAAQ;EACL;EAAe;EAAa;IAAc;;;;;;;;iBAiD/B,sBAAsB;;;;;;;;iBAgBtB,aAAa,cAAc,qBAAgB;;;;;;;iBAgB3C,kBAAkB;EAAS,WAAW;EAAW;;EAC/D;EACA;;;KAwCU;EACV;EACA;EACA;;EAEA;;;;;;;;iBASc,eAAe,mBAAmB;;;;;;;iBAiW5B,cACpB,cACA,UAAS,4BACR,QAAQ;;iBAmEK;;;;;;;;;iBAkHA,YAAY,cAAc,qBAAgB;KAkF9C;;EAEV;;EAEA,OAAO;EACP;EACA;EACA;IAAS;IAAgB;;;;;;;;;;iBAUX,iBAAiB,gBAAgB"}