@adea-ai/ui 0.108.0 → 0.109.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.
Files changed (30) hide show
  1. package/dist/NOTICE +13 -0
  2. package/dist/components/ui/annotation-surface/annotation-surface.css +27 -0
  3. package/dist/components/ui/annotation-surface/annotation-surface.d.ts +66 -0
  4. package/dist/components/ui/annotation-surface/annotation-surface.d.ts.map +1 -0
  5. package/dist/components/ui/annotation-surface/annotation-surface.js +244 -0
  6. package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -0
  7. package/dist/components/ui/annotation-surface/geometry.d.ts +10 -0
  8. package/dist/components/ui/annotation-surface/geometry.d.ts.map +1 -0
  9. package/dist/components/ui/annotation-surface/geometry.js +19 -0
  10. package/dist/components/ui/annotation-surface/geometry.js.map +1 -0
  11. package/dist/components/ui/annotation-surface/index.d.ts +4 -0
  12. package/dist/components/ui/annotation-surface/index.d.ts.map +1 -0
  13. package/dist/components/ui/annotation-surface/index.js +2 -0
  14. package/dist/components/ui/sheet/sheet.d.ts +1 -1
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +2 -1
  18. package/dist/r/annotation-surface.json +32 -0
  19. package/dist/r/registry.json +32 -0
  20. package/dist/r/src/components/ui/annotation-surface/annotation-surface.css +27 -0
  21. package/dist/r/src/components/ui/annotation-surface/annotation-surface.tsx +316 -0
  22. package/dist/r/src/components/ui/annotation-surface/geometry.ts +31 -0
  23. package/dist/r/src/components/ui/annotation-surface/index.ts +13 -0
  24. package/package.json +3 -2
  25. package/registry.json +32 -0
  26. package/src/components/ui/annotation-surface/annotation-surface.css +27 -0
  27. package/src/components/ui/annotation-surface/annotation-surface.tsx +316 -0
  28. package/src/components/ui/annotation-surface/geometry.ts +31 -0
  29. package/src/components/ui/annotation-surface/index.ts +13 -0
  30. package/src/index.ts +1 -0
package/dist/NOTICE CHANGED
@@ -427,6 +427,19 @@ The shared component owns reusable geometry and pointer/keyboard controls only.
427
427
  T3 runtime state, streaming, Electron services, native picture-in-picture,
428
428
  notifications and content rendering are not included.
429
429
 
430
+ ## Annotation viewport adapted from Adea Dev View
431
+
432
+ `packages/ui/src/components/ui/annotation-surface/` supplies the shared,
433
+ pixel-free viewport, normalized pointer capture and keyboard start behavior for
434
+ Adea's BrowserPane annotation adapter. That adapter is issue #718 and traces its
435
+ region drag interaction to t3code's annotation implementation, pinned at
436
+ `77bca8b2d76a1f42552e5eee7d277fcb1160347a`; the MIT license and copyright for
437
+ that revision are recorded in the t3code section above. Adea's host captures a
438
+ screenshot only when an annotation is submitted, so this shared component never
439
+ reads or renders live pixels and receives no screenshot or permission authority.
440
+ It owns presentation and pointer capture; the host owns normalized domain
441
+ geometry, keyboard edits, annotation commands and capture timing.
442
+
430
443
  ## Catalog browser translated from KiroCrew (issue #425 selected unit)
431
444
 
432
445
  `packages/ui/src/components/composites/catalog-browser/` translates the
@@ -0,0 +1,27 @@
1
+ .dev-annotation-surface {
2
+ touch-action: none;
3
+ cursor: crosshair;
4
+ background-image: repeating-linear-gradient(
5
+ 45deg,
6
+ color-mix(in oklch, var(--muted) 55%, transparent) 0 calc(var(--spacing) * 2),
7
+ transparent calc(var(--spacing) * 2) calc(var(--spacing) * 4)
8
+ );
9
+ }
10
+
11
+ .dev-annotation-surface[data-tool='point'] {
12
+ cursor: cell;
13
+ }
14
+
15
+ .dev-annotation-surface[data-dragging='true'] {
16
+ cursor: grabbing;
17
+ }
18
+
19
+ .dev-annotation-surface[aria-disabled='true'] {
20
+ touch-action: auto;
21
+ cursor: default;
22
+ }
23
+
24
+ .dev-annotation-surface__region,
25
+ .dev-annotation-surface__hint {
26
+ pointer-events: none;
27
+ }
@@ -0,0 +1,66 @@
1
+ import { type JSX } from 'solid-js';
2
+ import './annotation-surface.css';
3
+ import { type AnnotationSurfacePoint } from './geometry';
4
+ export type AnnotationSurfaceRegion = Readonly<{
5
+ x: number;
6
+ y: number;
7
+ width: number;
8
+ height: number;
9
+ }>;
10
+ export type AnnotationSurfaceDrag = Readonly<{
11
+ start: AnnotationSurfacePoint;
12
+ current: AnnotationSurfacePoint;
13
+ }>;
14
+ export type AnnotationSurfaceTool = 'region' | 'point';
15
+ export type AnnotationSurfaceDragPhase = 'start' | 'move' | 'end' | 'cancel' | 'keyboard';
16
+ export type AnnotationSurfacePointerEvent = PointerEvent & {
17
+ currentTarget: HTMLDivElement;
18
+ };
19
+ export type AnnotationSurfaceKeyboardEvent = KeyboardEvent & {
20
+ currentTarget: HTMLDivElement;
21
+ };
22
+ export type AnnotationSurfaceInputEvent = AnnotationSurfacePointerEvent | AnnotationSurfaceKeyboardEvent;
23
+ type SurfaceElementProps = Pick<JSX.HTMLAttributes<HTMLDivElement>, 'id' | 'aria-describedby'>;
24
+ export type AnnotationSurfaceProps = SurfaceElementProps & {
25
+ /** Accessible instructions for the keyboard-operated surface. */
26
+ label: string;
27
+ /** Region draws a captured drag; point reports a single placement point. */
28
+ tool: AnnotationSurfaceTool;
29
+ /** Normalized 0..1 geometry supplied by the host; absent means no region. */
30
+ region?: AnnotationSurfaceRegion;
31
+ /** Visible idle guidance. It is hidden while a region is present. */
32
+ hint?: JSX.Element;
33
+ /** Disable new drawing while the host is busy. Defaults to true. */
34
+ interactive?: boolean;
35
+ /** Changing this value cancels an in-flight drag owned by the host context. */
36
+ resetKey?: string | number;
37
+ /** Receives one normalized point in point mode. */
38
+ onPoint?: (point: AnnotationSurfacePoint, event: AnnotationSurfaceInputEvent) => void;
39
+ /** Receives drag phases; cancel has no drag and fires at most once per capture. */
40
+ onDragChange?: (drag: AnnotationSurfaceDrag | undefined, phase: AnnotationSurfaceDragPhase, event?: AnnotationSurfaceInputEvent) => void;
41
+ /** Domain keyboard policy stays with the host and receives the native event. */
42
+ onKeyDown?: (event: AnnotationSurfaceKeyboardEvent) => void;
43
+ /** Ref to the actual focusable and pointer-capturing HTMLDivElement. */
44
+ ref?: (element: HTMLDivElement) => void;
45
+ /** Layout only; appearance remains owned by the shared component. */
46
+ class?: string;
47
+ };
48
+ /**
49
+ * AnnotationSurface.
50
+ *
51
+ * A keyboard-focusable, viewport-shaped drawing surface for hosts that own an
52
+ * annotation domain. It renders normalized region geometry and idle guidance,
53
+ * captures region drags, and reports normalized points without reading or
54
+ * rendering screenshot pixels. The host keeps tool policy, domain geometry,
55
+ * persistence and capture commands.
56
+ *
57
+ * This bespoke application widget is necessary because a generic button or
58
+ * slider cannot represent a two-dimensional drawing viewport. Its keyboard
59
+ * behavior is supplied by the host and forwarded as a native key event. Space
60
+ * creates a centered region or places a point at the center; Escape is left to
61
+ * the host first, which can prevent the default gesture cancellation while it
62
+ * applies its own draft and mode rules.
63
+ */
64
+ export declare function AnnotationSurface(props: AnnotationSurfaceProps): JSX.Element;
65
+ export {};
66
+ //# sourceMappingURL=annotation-surface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotation-surface.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/annotation-surface/annotation-surface.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,GAAG,EACT,MAAM,UAAU,CAAA;AAEjB,OAAO,0BAA0B,CAAA;AACjC,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,YAAY,CAAA;AAEnB,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAC,CAAA;AAEF,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,KAAK,EAAE,sBAAsB,CAAA;IAC7B,OAAO,EAAE,sBAAsB,CAAA;CAChC,CAAC,CAAA;AAEF,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,OAAO,CAAA;AACtD,MAAM,MAAM,0BAA0B,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAA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;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eA6N9D"}
@@ -0,0 +1,244 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { clampSurfaceFraction, normalizedSurfacePoint } from "./geometry.js";
3
+ import { className, createComponent, delegateEvents, effect, insert, memo, setAttribute, template, use } from "solid-js/web";
4
+ import { Show, createEffect, createSignal, createUniqueId, onCleanup, splitProps } from "solid-js";
5
+ import "./annotation-surface.css";
6
+ //#region src/components/ui/annotation-surface/annotation-surface.tsx
7
+ var _tmpl$ = /*#__PURE__*/ template(`<span class="dev-annotation-surface__hint pointer-events-none absolute inset-0 grid place-items-center p-4 text-center text-xs text-muted-foreground">`);
8
+ var _tmpl$2 = /*#__PURE__*/ template(`<div role=application aria-roledescription="annotation surface"tabindex=0>`);
9
+ var _tmpl$3 = /*#__PURE__*/ template(`<svg class="dev-annotation-surface__region pointer-events-none absolute inset-0 size-full"viewBox="0 0 10000 10000"preserveAspectRatio=none aria-hidden=true><rect class="fill-primary-subtle stroke-primary"stroke-width=1.5 vector-effect=non-scaling-stroke>`);
10
+ function pointFrom(event, target) {
11
+ const bounds = target.getBoundingClientRect();
12
+ return normalizedSurfacePoint(event.clientX, event.clientY, bounds);
13
+ }
14
+ /**
15
+ * AnnotationSurface.
16
+ *
17
+ * A keyboard-focusable, viewport-shaped drawing surface for hosts that own an
18
+ * annotation domain. It renders normalized region geometry and idle guidance,
19
+ * captures region drags, and reports normalized points without reading or
20
+ * rendering screenshot pixels. The host keeps tool policy, domain geometry,
21
+ * persistence and capture commands.
22
+ *
23
+ * This bespoke application widget is necessary because a generic button or
24
+ * slider cannot represent a two-dimensional drawing viewport. Its keyboard
25
+ * behavior is supplied by the host and forwarded as a native key event. Space
26
+ * creates a centered region or places a point at the center; Escape is left to
27
+ * the host first, which can prevent the default gesture cancellation while it
28
+ * applies its own draft and mode rules.
29
+ */
30
+ function AnnotationSurface(props) {
31
+ const [local] = splitProps(props, [
32
+ "id",
33
+ "aria-describedby",
34
+ "label",
35
+ "tool",
36
+ "region",
37
+ "hint",
38
+ "interactive",
39
+ "resetKey",
40
+ "onPoint",
41
+ "onDragChange",
42
+ "onKeyDown",
43
+ "ref",
44
+ "class"
45
+ ]);
46
+ const [dragging, setDragging] = createSignal(false);
47
+ const hintId = createUniqueId();
48
+ let activeDrag;
49
+ let previousResetKey = local.resetKey;
50
+ let previousTool = local.tool;
51
+ const isInteractive = () => local.interactive ?? true;
52
+ function releaseCapture(drag) {
53
+ try {
54
+ if (drag.target.hasPointerCapture(drag.pointerId)) drag.target.releasePointerCapture(drag.pointerId);
55
+ } catch {}
56
+ }
57
+ function cancelDrag(event, release = true) {
58
+ const drag = activeDrag;
59
+ if (!drag) return;
60
+ activeDrag = void 0;
61
+ setDragging(false);
62
+ if (release) releaseCapture(drag);
63
+ local.onDragChange?.(void 0, "cancel", event);
64
+ }
65
+ createEffect(() => {
66
+ const resetKey = local.resetKey;
67
+ const tool = local.tool;
68
+ const interactive = isInteractive();
69
+ if (activeDrag && (resetKey !== previousResetKey || tool !== previousTool || !interactive)) cancelDrag();
70
+ previousResetKey = resetKey;
71
+ previousTool = tool;
72
+ });
73
+ onCleanup(() => cancelDrag());
74
+ function handlePointerDown(event) {
75
+ if (!isInteractive() || !event.isPrimary || event.button !== 0) return;
76
+ event.preventDefault();
77
+ event.currentTarget.focus({ preventScroll: true });
78
+ const point = pointFrom(event, event.currentTarget);
79
+ if (activeDrag) return;
80
+ if (local.tool === "point") {
81
+ local.onPoint?.(point, event);
82
+ return;
83
+ }
84
+ try {
85
+ event.currentTarget.setPointerCapture(event.pointerId);
86
+ } catch {
87
+ return;
88
+ }
89
+ activeDrag = {
90
+ pointerId: event.pointerId,
91
+ target: event.currentTarget,
92
+ start: point,
93
+ current: point
94
+ };
95
+ setDragging(true);
96
+ local.onDragChange?.({
97
+ start: point,
98
+ current: point
99
+ }, "start", event);
100
+ }
101
+ function handlePointerMove(event) {
102
+ const drag = activeDrag;
103
+ if (!drag || drag.pointerId !== event.pointerId) return;
104
+ const current = pointFrom(event, event.currentTarget);
105
+ activeDrag = {
106
+ ...drag,
107
+ current
108
+ };
109
+ local.onDragChange?.({
110
+ start: drag.start,
111
+ current
112
+ }, "move", event);
113
+ }
114
+ function handlePointerUp(event) {
115
+ const drag = activeDrag;
116
+ if (!drag || drag.pointerId !== event.pointerId) return;
117
+ const current = pointFrom(event, event.currentTarget);
118
+ activeDrag = void 0;
119
+ setDragging(false);
120
+ releaseCapture(drag);
121
+ local.onDragChange?.({
122
+ start: drag.start,
123
+ current
124
+ }, "end", event);
125
+ }
126
+ function handlePointerCancel(event) {
127
+ if (activeDrag?.pointerId === event.pointerId) cancelDrag(event);
128
+ }
129
+ function handleLostPointerCapture(event) {
130
+ if (activeDrag?.pointerId === event.pointerId) cancelDrag(event, false);
131
+ }
132
+ function handleKeyDown(event) {
133
+ local.onKeyDown?.(event);
134
+ if (event.key === "Escape") {
135
+ if (!event.defaultPrevented) cancelDrag();
136
+ return;
137
+ }
138
+ if (event.defaultPrevented || !isInteractive() || event.key !== " " || event.repeat || event.isComposing || event.altKey || event.ctrlKey || event.metaKey || activeDrag) return;
139
+ event.preventDefault();
140
+ if (local.tool === "point") {
141
+ local.onPoint?.({
142
+ x: .5,
143
+ y: .5
144
+ }, event);
145
+ return;
146
+ }
147
+ local.onDragChange?.({
148
+ start: {
149
+ x: .25,
150
+ y: .25
151
+ },
152
+ current: {
153
+ x: .75,
154
+ y: .75
155
+ }
156
+ }, "keyboard", event);
157
+ }
158
+ const visibleRegion = () => {
159
+ const region = local.region;
160
+ if (!region) return void 0;
161
+ const x = clampSurfaceFraction(region.x);
162
+ const y = clampSurfaceFraction(region.y);
163
+ return {
164
+ x,
165
+ y,
166
+ width: Math.min(clampSurfaceFraction(region.width), 1 - x),
167
+ height: Math.min(clampSurfaceFraction(region.height), 1 - y)
168
+ };
169
+ };
170
+ const describedBy = () => [local["aria-describedby"], local.hint && !visibleRegion() ? hintId : void 0].filter(Boolean).join(" ") || void 0;
171
+ return (() => {
172
+ var _el$ = _tmpl$2();
173
+ _el$.$$keydown = handleKeyDown;
174
+ _el$.addEventListener("lostpointercapture", handleLostPointerCapture);
175
+ _el$.addEventListener("pointercancel", handlePointerCancel);
176
+ _el$.$$pointerup = handlePointerUp;
177
+ _el$.$$pointermove = handlePointerMove;
178
+ _el$.$$pointerdown = handlePointerDown;
179
+ use((element) => local.ref?.(element), _el$);
180
+ insert(_el$, createComponent(Show, {
181
+ get when() {
182
+ return visibleRegion();
183
+ },
184
+ children: (region) => (() => {
185
+ var _el$3 = _tmpl$3(), _el$4 = _el$3.firstChild;
186
+ effect((_p$) => {
187
+ var _v$8 = region().x * 1e4, _v$9 = region().y * 1e4, _v$0 = region().width * 1e4, _v$1 = region().height * 1e4;
188
+ _v$8 !== _p$.e && setAttribute(_el$4, "x", _p$.e = _v$8);
189
+ _v$9 !== _p$.t && setAttribute(_el$4, "y", _p$.t = _v$9);
190
+ _v$0 !== _p$.a && setAttribute(_el$4, "width", _p$.a = _v$0);
191
+ _v$1 !== _p$.o && setAttribute(_el$4, "height", _p$.o = _v$1);
192
+ return _p$;
193
+ }, {
194
+ e: void 0,
195
+ t: void 0,
196
+ a: void 0,
197
+ o: void 0
198
+ });
199
+ return _el$3;
200
+ })()
201
+ }), null);
202
+ insert(_el$, createComponent(Show, {
203
+ get when() {
204
+ return memo(() => !!local.hint)() && !visibleRegion();
205
+ },
206
+ get children() {
207
+ var _el$2 = _tmpl$();
208
+ setAttribute(_el$2, "id", hintId);
209
+ insert(_el$2, () => local.hint);
210
+ return _el$2;
211
+ }
212
+ }), null);
213
+ effect((_p$) => {
214
+ var _v$ = local.id, _v$2 = describedBy(), _v$3 = local.label, _v$4 = isInteractive() ? void 0 : "true", _v$5 = local.tool, _v$6 = dragging() ? "true" : "false", _v$7 = cn("dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle", local.class);
215
+ _v$ !== _p$.e && setAttribute(_el$, "id", _p$.e = _v$);
216
+ _v$2 !== _p$.t && setAttribute(_el$, "aria-describedby", _p$.t = _v$2);
217
+ _v$3 !== _p$.a && setAttribute(_el$, "aria-label", _p$.a = _v$3);
218
+ _v$4 !== _p$.o && setAttribute(_el$, "aria-disabled", _p$.o = _v$4);
219
+ _v$5 !== _p$.i && setAttribute(_el$, "data-tool", _p$.i = _v$5);
220
+ _v$6 !== _p$.n && setAttribute(_el$, "data-dragging", _p$.n = _v$6);
221
+ _v$7 !== _p$.s && className(_el$, _p$.s = _v$7);
222
+ return _p$;
223
+ }, {
224
+ e: void 0,
225
+ t: void 0,
226
+ a: void 0,
227
+ o: void 0,
228
+ i: void 0,
229
+ n: void 0,
230
+ s: void 0
231
+ });
232
+ return _el$;
233
+ })();
234
+ }
235
+ delegateEvents([
236
+ "pointerdown",
237
+ "pointermove",
238
+ "pointerup",
239
+ "keydown"
240
+ ]);
241
+ //#endregion
242
+ export { AnnotationSurface };
243
+
244
+ //# sourceMappingURL=annotation-surface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotation-surface.js","names":["createEffect","createSignal","createUniqueId","onCleanup","Show","splitProps","JSX","cn","clampSurfaceFraction","normalizedSurfacePoint","AnnotationSurfacePoint","AnnotationSurfaceRegion","Readonly","x","y","width","height","AnnotationSurfaceDrag","start","current","AnnotationSurfaceTool","AnnotationSurfaceDragPhase","AnnotationSurfacePointerEvent","PointerEvent","currentTarget","HTMLDivElement","AnnotationSurfaceKeyboardEvent","KeyboardEvent","AnnotationSurfaceInputEvent","SurfaceElementProps","Pick","HTMLAttributes","AnnotationSurfaceProps","label","tool","region","hint","Element","interactive","resetKey","onPoint","point","event","onDragChange","drag","phase","onKeyDown","ref","element","class","ActiveDrag","pointerId","target","pointFrom","bounds","getBoundingClientRect","clientX","clientY","AnnotationSurface","props","local","dragging","setDragging","hintId","activeDrag","previousResetKey","previousTool","isInteractive","releaseCapture","hasPointerCapture","releasePointerCapture","cancelDrag","release","undefined","handlePointerDown","isPrimary","button","preventDefault","focus","preventScroll","setPointerCapture","handlePointerMove","handlePointerUp","handlePointerCancel","handleLostPointerCapture","handleKeyDown","key","defaultPrevented","repeat","isComposing","altKey","ctrlKey","metaKey","visibleRegion","Math","min","describedBy","filter","Boolean","join","_el$","_tmpl$2","$$keydown","addEventListener","$$pointerup","$$pointermove","$$pointerdown","_$use","_$insert","_$createComponent","when","children","_el$3","_tmpl$3","_el$4","firstChild","_$effect","_p$","_v$8","_v$9","_v$0","_v$1","e","_$setAttribute","t","a","o","_$memo","_el$2","_tmpl$","_v$","id","_v$2","_v$3","_v$4","_v$5","_v$6","_v$7","i","n","s","_$className","_$delegateEvents","_$createComponent","_$setAttribute","_$memo","_$className","_$delegateEvents"],"sources":["../../../../src/components/ui/annotation-surface/annotation-surface.tsx"],"sourcesContent":["import {\n createEffect,\n createSignal,\n createUniqueId,\n onCleanup,\n Show,\n splitProps,\n type JSX,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport './annotation-surface.css'\nimport {\n clampSurfaceFraction,\n normalizedSurfacePoint,\n type AnnotationSurfacePoint,\n} from './geometry'\n\nexport type AnnotationSurfaceRegion = Readonly<{\n x: number\n y: number\n width: number\n height: number\n}>\n\nexport type AnnotationSurfaceDrag = Readonly<{\n start: AnnotationSurfacePoint\n current: AnnotationSurfacePoint\n}>\n\nexport type AnnotationSurfaceTool = 'region' | 'point'\nexport type AnnotationSurfaceDragPhase = 'start' | 'move' | 'end' | 'cancel' | 'keyboard'\nexport type AnnotationSurfacePointerEvent = PointerEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceKeyboardEvent = KeyboardEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceInputEvent =\n | AnnotationSurfacePointerEvent\n | AnnotationSurfaceKeyboardEvent\n\ntype SurfaceElementProps = Pick<JSX.HTMLAttributes<HTMLDivElement>, 'id' | 'aria-describedby'>\n\nexport type AnnotationSurfaceProps = SurfaceElementProps & {\n /** Accessible instructions for the keyboard-operated surface. */\n label: string\n /** Region draws a captured drag; point reports a single placement point. */\n tool: AnnotationSurfaceTool\n /** Normalized 0..1 geometry supplied by the host; absent means no region. */\n region?: AnnotationSurfaceRegion\n /** Visible idle guidance. It is hidden while a region is present. */\n hint?: JSX.Element\n /** Disable new drawing while the host is busy. Defaults to true. */\n interactive?: boolean\n /** Changing this value cancels an in-flight drag owned by the host context. */\n resetKey?: string | number\n /** Receives one normalized point in point mode. */\n onPoint?: (point: AnnotationSurfacePoint, event: AnnotationSurfaceInputEvent) => void\n /** Receives drag phases; cancel has no drag and fires at most once per capture. */\n onDragChange?: (\n drag: AnnotationSurfaceDrag | undefined,\n phase: AnnotationSurfaceDragPhase,\n event?: AnnotationSurfaceInputEvent\n ) => void\n /** Domain keyboard policy stays with the host and receives the native event. */\n onKeyDown?: (event: AnnotationSurfaceKeyboardEvent) => void\n /** Ref to the actual focusable and pointer-capturing HTMLDivElement. */\n ref?: (element: HTMLDivElement) => void\n /** Layout only; appearance remains owned by the shared component. */\n class?: string\n}\n\ntype ActiveDrag = AnnotationSurfaceDrag & {\n pointerId: number\n target: HTMLDivElement\n}\n\nfunction pointFrom(event: PointerEvent, target: HTMLDivElement): AnnotationSurfacePoint {\n const bounds = target.getBoundingClientRect()\n return normalizedSurfacePoint(event.clientX, event.clientY, bounds)\n}\n\n/**\n * AnnotationSurface.\n *\n * A keyboard-focusable, viewport-shaped drawing surface for hosts that own an\n * annotation domain. It renders normalized region geometry and idle guidance,\n * captures region drags, and reports normalized points without reading or\n * rendering screenshot pixels. The host keeps tool policy, domain geometry,\n * persistence and capture commands.\n *\n * This bespoke application widget is necessary because a generic button or\n * slider cannot represent a two-dimensional drawing viewport. Its keyboard\n * behavior is supplied by the host and forwarded as a native key event. Space\n * creates a centered region or places a point at the center; Escape is left to\n * the host first, which can prevent the default gesture cancellation while it\n * applies its own draft and mode rules.\n */\nexport function AnnotationSurface(props: AnnotationSurfaceProps) {\n const [local] = splitProps(props, [\n 'id',\n 'aria-describedby',\n 'label',\n 'tool',\n 'region',\n 'hint',\n 'interactive',\n 'resetKey',\n 'onPoint',\n 'onDragChange',\n 'onKeyDown',\n 'ref',\n 'class',\n ])\n\n const [dragging, setDragging] = createSignal(false)\n const hintId = createUniqueId()\n let activeDrag: ActiveDrag | undefined\n let previousResetKey = local.resetKey\n let previousTool = local.tool\n\n const isInteractive = () => local.interactive ?? true\n\n function releaseCapture(drag: ActiveDrag): void {\n try {\n if (drag.target.hasPointerCapture(drag.pointerId))\n drag.target.releasePointerCapture(drag.pointerId)\n } catch {\n // The browser may release capture while a host reset or unmount is running.\n }\n }\n\n function cancelDrag(event?: AnnotationSurfaceInputEvent, release = true): void {\n const drag = activeDrag\n if (!drag) return\n\n activeDrag = undefined\n setDragging(false)\n if (release) releaseCapture(drag)\n local.onDragChange?.(undefined, 'cancel', event)\n }\n\n createEffect(() => {\n const resetKey = local.resetKey\n const tool = local.tool\n const interactive = isInteractive()\n if (activeDrag && (resetKey !== previousResetKey || tool !== previousTool || !interactive)) {\n cancelDrag()\n }\n previousResetKey = resetKey\n previousTool = tool\n })\n\n onCleanup(() => cancelDrag())\n\n function handlePointerDown(event: AnnotationSurfacePointerEvent): void {\n if (!isInteractive() || !event.isPrimary || event.button !== 0) return\n event.preventDefault()\n event.currentTarget.focus({ preventScroll: true })\n const point = pointFrom(event, event.currentTarget)\n if (activeDrag) return\n\n if (local.tool === 'point') {\n local.onPoint?.(point, event)\n return\n }\n\n try {\n event.currentTarget.setPointerCapture(event.pointerId)\n } catch {\n // A drag without real pointer capture can lose its final coordinates.\n return\n }\n\n const drag: ActiveDrag = {\n pointerId: event.pointerId,\n target: event.currentTarget,\n start: point,\n current: point,\n }\n activeDrag = drag\n setDragging(true)\n local.onDragChange?.({ start: point, current: point }, 'start', event)\n }\n\n function handlePointerMove(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = { ...drag, current }\n local.onDragChange?.({ start: drag.start, current }, 'move', event)\n }\n\n function handlePointerUp(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = undefined\n setDragging(false)\n releaseCapture(drag)\n local.onDragChange?.({ start: drag.start, current }, 'end', event)\n }\n\n function handlePointerCancel(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event)\n }\n\n function handleLostPointerCapture(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event, false)\n }\n\n function handleKeyDown(event: AnnotationSurfaceKeyboardEvent): void {\n local.onKeyDown?.(event)\n if (event.key === 'Escape') {\n if (!event.defaultPrevented) cancelDrag()\n return\n }\n if (\n event.defaultPrevented ||\n !isInteractive() ||\n event.key !== ' ' ||\n event.repeat ||\n event.isComposing ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n activeDrag\n )\n return\n\n event.preventDefault()\n if (local.tool === 'point') {\n local.onPoint?.({ x: 0.5, y: 0.5 }, event)\n return\n }\n\n local.onDragChange?.(\n {\n start: { x: 0.25, y: 0.25 },\n current: { x: 0.75, y: 0.75 },\n },\n 'keyboard',\n event\n )\n }\n\n const visibleRegion = (): AnnotationSurfaceRegion | undefined => {\n const region = local.region\n if (!region) return undefined\n const x = clampSurfaceFraction(region.x)\n const y = clampSurfaceFraction(region.y)\n return {\n x,\n y,\n width: Math.min(clampSurfaceFraction(region.width), 1 - x),\n height: Math.min(clampSurfaceFraction(region.height), 1 - y),\n }\n }\n\n const describedBy = () =>\n [local['aria-describedby'], local.hint && !visibleRegion() ? hintId : undefined]\n .filter(Boolean)\n .join(' ') || undefined\n\n return (\n <div\n id={local.id}\n aria-describedby={describedBy()}\n role=\"application\"\n aria-roledescription=\"annotation surface\"\n aria-label={local.label}\n aria-disabled={isInteractive() ? undefined : 'true'}\n tabIndex={0}\n data-tool={local.tool}\n data-dragging={dragging() ? 'true' : 'false'}\n class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n ref={(element) => local.ref?.(element)}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerCancel}\n onLostPointerCapture={handleLostPointerCapture}\n onKeyDown={handleKeyDown}\n >\n <Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>\n <Show when={local.hint && !visibleRegion()}>\n <span\n id={hintId}\n class=\"dev-annotation-surface__hint pointer-events-none absolute inset-0 grid place-items-center p-4 text-center text-xs text-muted-foreground\"\n >\n {local.hint}\n </span>\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AAyEA,SAASqD,UAAUX,OAAqBU,QAAgD;CACtF,MAAME,SAASF,OAAOG,sBAAsB;CAC5C,OAAO9C,uBAAuBiC,MAAMc,SAASd,MAAMe,SAASH,MAAM;AACpE;;;;;;;;;;;;;;;;;AAkBA,SAAgBI,kBAAkBC,OAA+B;CAC/D,MAAM,CAACC,SAASvD,WAAWsD,OAAO;EAChC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CAED,MAAM,CAACE,UAAUC,eAAe7D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Y,QAAM8D,OAExC3E,MAAM1B,MAAIsG,OACN3E,SAAS,IAAI,SAAS,SAAO4E,OACrClI,GACL,iQACAqD,MAAMX,KACR;GAACiF,QAAAb,IAAAK,KAAAC,aAAAvB,MAAA,MAAAiB,IAAAK,IAAAQ,GAAA;GAAAE,SAAAf,IAAAO,KAAAD,aAAAvB,MAAA,oBAAAiB,IAAAO,IAAAQ,IAAA;GAAAC,SAAAhB,IAAAQ,KAAAF,aAAAvB,MAAA,cAAAiB,IAAAQ,IAAAQ,IAAA;GAAAC,SAAAjB,IAAAS,KAAAH,aAAAvB,MAAA,iBAAAiB,IAAAS,IAAAQ,IAAA;GAAAC,SAAAlB,IAAAqB,KAAAf,aAAAvB,MAAA,aAAAiB,IAAAqB,IAAAH,IAAA;GAAAC,SAAAnB,IAAAsB,KAAAhB,aAAAvB,MAAA,iBAAAiB,IAAAsB,IAAAH,IAAA;GAAAC,SAAApB,IAAAuB,KAAAC,UAAAzC,MAAAiB,IAAAuB,IAAAH,IAAA;GAAA,OAAApB;EAAA,GAAA;GAAAK,GAAAjD,KAAAA;GAAAmD,GAAAnD,KAAAA;GAAAoD,GAAApD,KAAAA;GAAAqD,GAAArD,KAAAA;GAAAiE,GAAAjE,KAAAA;GAAAkE,GAAAlE,KAAAA;GAAAmE,GAAAnE,KAAAA;EAAA,CAAA;EAAA,OAAA2B;CAAA,EAAA,CAAA;AAuCP;AAAC0C,eAAA;CAAA;CAAA;CAAA;CAAA;AAAA,CAAA"}
@@ -0,0 +1,10 @@
1
+ export type AnnotationSurfacePoint = Readonly<{
2
+ x: number;
3
+ y: number;
4
+ }>;
5
+ type SurfaceBounds = Readonly<Pick<DOMRectReadOnly, 'left' | 'top' | 'width' | 'height'>>;
6
+ /** Pointer coordinates normalized to the surface; degenerate bounds resolve to the origin. */
7
+ export declare function normalizedSurfacePoint(clientX: number, clientY: number, bounds: SurfaceBounds): AnnotationSurfacePoint;
8
+ export declare function clampSurfaceFraction(value: number): number;
9
+ export {};
10
+ //# sourceMappingURL=geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/annotation-surface/geometry.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAEvE,KAAK,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAA;AAczF,8FAA8F;AAC9F,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,aAAa,GACpB,sBAAsB,CAKxB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE1D"}
@@ -0,0 +1,19 @@
1
+ //#region src/components/ui/annotation-surface/geometry.ts
2
+ function fraction(client, start, length) {
3
+ if (!Number.isFinite(client) || !Number.isFinite(start) || !Number.isFinite(length) || length <= 0) return 0;
4
+ return Math.min(1, Math.max(0, (client - start) / length));
5
+ }
6
+ /** Pointer coordinates normalized to the surface; degenerate bounds resolve to the origin. */
7
+ function normalizedSurfacePoint(clientX, clientY, bounds) {
8
+ return {
9
+ x: fraction(clientX, bounds.left, bounds.width),
10
+ y: fraction(clientY, bounds.top, bounds.height)
11
+ };
12
+ }
13
+ function clampSurfaceFraction(value) {
14
+ return Number.isFinite(value) ? Math.min(1, Math.max(0, value)) : 0;
15
+ }
16
+ //#endregion
17
+ export { clampSurfaceFraction, normalizedSurfacePoint };
18
+
19
+ //# sourceMappingURL=geometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.js","names":[],"sources":["../../../../src/components/ui/annotation-surface/geometry.ts"],"sourcesContent":["export type AnnotationSurfacePoint = Readonly<{ x: number; y: number }>\n\ntype SurfaceBounds = Readonly<Pick<DOMRectReadOnly, 'left' | 'top' | 'width' | 'height'>>\n\nfunction fraction(client: number, start: number, length: number): number {\n if (\n !Number.isFinite(client) ||\n !Number.isFinite(start) ||\n !Number.isFinite(length) ||\n length <= 0\n )\n return 0\n\n return Math.min(1, Math.max(0, (client - start) / length))\n}\n\n/** Pointer coordinates normalized to the surface; degenerate bounds resolve to the origin. */\nexport function normalizedSurfacePoint(\n clientX: number,\n clientY: number,\n bounds: SurfaceBounds\n): AnnotationSurfacePoint {\n return {\n x: fraction(clientX, bounds.left, bounds.width),\n y: fraction(clientY, bounds.top, bounds.height),\n }\n}\n\nexport function clampSurfaceFraction(value: number): number {\n return Number.isFinite(value) ? Math.min(1, Math.max(0, value)) : 0\n}\n"],"mappings":";AAIA,SAAS,SAAS,QAAgB,OAAe,QAAwB;CACvE,IACE,CAAC,OAAO,SAAS,MAAM,KACvB,CAAC,OAAO,SAAS,KAAK,KACtB,CAAC,OAAO,SAAS,MAAM,KACvB,UAAU,GAEV,OAAO;CAET,OAAO,KAAK,IAAI,GAAG,KAAK,IAAI,IAAI,SAAS,SAAS,MAAM,CAAC;AAC3D;;AAGA,SAAgB,uBACd,SACA,SACA,QACwB;CACxB,OAAO;EACL,GAAG,SAAS,SAAS,OAAO,MAAM,OAAO,KAAK;EAC9C,GAAG,SAAS,SAAS,OAAO,KAAK,OAAO,MAAM;CAChD;AACF;AAEA,SAAgB,qBAAqB,OAAuB;CAC1D,OAAO,OAAO,SAAS,KAAK,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,CAAC,IAAI;AACpE"}
@@ -0,0 +1,4 @@
1
+ /** Keyboard-operable normalized drawing surface; hosts retain domain geometry and actions. */
2
+ export { AnnotationSurface, type AnnotationSurfaceDrag, type AnnotationSurfaceDragPhase, type AnnotationSurfaceInputEvent, type AnnotationSurfaceKeyboardEvent, type AnnotationSurfacePointerEvent, type AnnotationSurfaceProps, type AnnotationSurfaceRegion, type AnnotationSurfaceTool, } from './annotation-surface';
3
+ export type { AnnotationSurfacePoint } from './geometry';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/annotation-surface/index.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,EACL,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { AnnotationSurface } from "./annotation-surface.js";
2
+ export { AnnotationSurface };
@@ -32,7 +32,7 @@ import { type VariantProps } from '#lib/variants';
32
32
  * sheet opens.
33
33
  */
34
34
  declare const sheetVariants: (props?: ({
35
- side?: "end" | "start" | "bottom" | "top" | null | undefined;
35
+ side?: "top" | "bottom" | "start" | "end" | null | undefined;
36
36
  variant?: "inset" | "edge" | null | undefined;
37
37
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
38
38
  export type SheetContentProps = ComponentProps<typeof KobalteDialogContent> & VariantProps<typeof sheetVariants> & {
package/dist/index.d.ts CHANGED
@@ -16,6 +16,7 @@
16
16
  export * from './components/ui/accordion';
17
17
  export * from './components/ui/alert';
18
18
  export * from './components/ui/alert-dialog';
19
+ export * from './components/ui/annotation-surface';
19
20
  export * from './components/ui/aspect-ratio';
20
21
  export * from './components/ui/avatar';
21
22
  export * from './components/ui/board';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B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AAe,EACf,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,qBAAqB,EACrB,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,YAAY,GAClB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3F,OAAO,EACL,aAAa,EACb,SAAS,EACT,WAAW,EACX,aAAa,EACb,YAAY,EACZ,eAAe,EACf,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,SAAS,GACf,MAAM,cAAc,CAAA"}
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ import { controlInteractive, controlSize, controlSizeIcon, controlSizes, cva, su
4
4
  import { Alert, AlertDescription, AlertTitle, alertVariants } from "./components/ui/alert/alert.js";
5
5
  import { Heading, Text, headingElement, headingVariants, textElement, textVariants } from "./components/ui/typography/typography.js";
6
6
  import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger } from "./components/ui/alert-dialog/alert-dialog.js";
7
+ import { AnnotationSurface } from "./components/ui/annotation-surface/annotation-surface.js";
7
8
  import { AspectRatio } from "./components/ui/aspect-ratio/aspect-ratio.js";
8
9
  import { Avatar, AvatarFallback, AvatarImage, initialsFrom } from "./components/ui/avatar/avatar.js";
9
10
  import { Badge, badgeVariants } from "./components/ui/badge/badge.js";
@@ -128,4 +129,4 @@ import { AboutDialog } from "./components/composites/about-dialog/about-dialog.j
128
129
  import { HelpCenter } from "./components/composites/help-center/help-center.js";
129
130
  import { WorkspaceMark } from "./components/composites/workspace-mark/workspace-mark.js";
130
131
  import { writeClipboardText } from "./lib/clipboard.js";
131
- export { APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AboutDialog, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, AspectRatio, AttachmentCard, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbSeparator, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CalendarSurface, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChatComposer, Checkbox, CheckboxDescription, CheckboxLabel, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, ComposerAttachmentButton, ComposerHint, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualSidebar, ConversationAvatar, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, ListGroup, ListRow, ListRowControl, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MessageBody, MessageComposer, MessageDayDivider, MessageGroup, MessageRow, ModalDialog, Motion, NO_FLOATING_PREVIEW_OBSTACLES, NO_PREVIEW_MINI_PLAYER_OBSTACLES, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, PREVIEW_MINI_PLAYER_CORNER_RADIUS, PREVIEW_MINI_PLAYER_EDGE_GAP, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, PixelResizeHandle, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PropertyList, PropertyRow, PropertyTerm, PropertyValue, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow, SettingsSection, Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Spinner, SplitLayout, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, TranscriptComposition, Tree, TreeRow, UpdateDialog, ValueCombobox, VirtualWindow, WorkspaceMark, accentPresets, alertVariants, allTokens, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, builtinThemes, buttonVariants, clampFloatingPreviewPosition, clampPreviewMiniPlayerPosition, closePane, cn, colorTokens, computeLayoutFrames, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countLeaves, countLines, createAppMenuItems, createLayoutState, cva, defaultDarkThemeId, defaultLightThemeId, defaultThemeSelection, densityTokens, designTokens, diffLineVariants, diffStats, diffTargetPath, elevationTokens, entityIconVariants, expandAll, findTokenRanges, focusPane, fontOptions, fontSettingsBootstrapScript, formatBytes, formatReleaseDate, formatToken, headingElement, headingVariants, initialsFrom, inlineScriptLiteral, isPasteBlock, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, monogram, motionTokens, movePane, neighborLeaf, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeLayout, parseDiff, plainTextFromMarkdown, pruneBlocks, radiusTokens, recollapsePastes, remapCarriedBlocks, resizeFloatingPreview, resizePreviewMiniPlayer, resizeSplit, resolveAccentPreset, resolveFloatingPreviewFrame, resolvePreviewMiniPlayerFrame, resolvedDensity, sheetVariants, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, splitPane, statusDotVariants, stripTrailingBlankLines, surfaceInteractive, swapPanes, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, transcriptDisclosureKey, typographyTokens, undoClosePane, undocumentedTokenAliases, useSideRail, useTheme, validateTheme, validateThemeRegistry, withAccent, writeClipboardText, zIndexTokens };
132
+ export { APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AboutDialog, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnnotationSurface, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, AspectRatio, AttachmentCard, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbSeparator, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CalendarSurface, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChatComposer, Checkbox, CheckboxDescription, CheckboxLabel, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, ComposerAttachmentButton, ComposerHint, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualSidebar, ConversationAvatar, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, ListGroup, ListRow, ListRowControl, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MessageBody, MessageComposer, MessageDayDivider, MessageGroup, MessageRow, ModalDialog, Motion, NO_FLOATING_PREVIEW_OBSTACLES, NO_PREVIEW_MINI_PLAYER_OBSTACLES, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, PREVIEW_MINI_PLAYER_CORNER_RADIUS, PREVIEW_MINI_PLAYER_EDGE_GAP, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, PixelResizeHandle, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PropertyList, PropertyRow, PropertyTerm, PropertyValue, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow, SettingsSection, Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Spinner, SplitLayout, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, TranscriptComposition, Tree, TreeRow, UpdateDialog, ValueCombobox, VirtualWindow, WorkspaceMark, accentPresets, alertVariants, allTokens, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, builtinThemes, buttonVariants, clampFloatingPreviewPosition, clampPreviewMiniPlayerPosition, closePane, cn, colorTokens, computeLayoutFrames, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countLeaves, countLines, createAppMenuItems, createLayoutState, cva, defaultDarkThemeId, defaultLightThemeId, defaultThemeSelection, densityTokens, designTokens, diffLineVariants, diffStats, diffTargetPath, elevationTokens, entityIconVariants, expandAll, findTokenRanges, focusPane, fontOptions, fontSettingsBootstrapScript, formatBytes, formatReleaseDate, formatToken, headingElement, headingVariants, initialsFrom, inlineScriptLiteral, isPasteBlock, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, monogram, motionTokens, movePane, neighborLeaf, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeLayout, parseDiff, plainTextFromMarkdown, pruneBlocks, radiusTokens, recollapsePastes, remapCarriedBlocks, resizeFloatingPreview, resizePreviewMiniPlayer, resizeSplit, resolveAccentPreset, resolveFloatingPreviewFrame, resolvePreviewMiniPlayerFrame, resolvedDensity, sheetVariants, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, splitPane, statusDotVariants, stripTrailingBlankLines, surfaceInteractive, swapPanes, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, transcriptDisclosureKey, typographyTokens, undoClosePane, undocumentedTokenAliases, useSideRail, useTheme, validateTheme, validateThemeRegistry, withAccent, writeClipboardText, zIndexTokens };
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "annotation-surface",
3
+ "type": "registry:ui",
4
+ "title": "Annotation Surface",
5
+ "description": "Keyboard-operable normalized drawing surface; hosts retain domain geometry and actions.",
6
+ "dependencies": [],
7
+ "registryDependencies": [
8
+ "lib"
9
+ ],
10
+ "files": [
11
+ {
12
+ "path": "src/components/ui/annotation-surface/annotation-surface.css",
13
+ "type": "registry:ui",
14
+ "target": "components/ui/annotation-surface/annotation-surface.css"
15
+ },
16
+ {
17
+ "path": "src/components/ui/annotation-surface/annotation-surface.tsx",
18
+ "type": "registry:ui",
19
+ "target": "components/ui/annotation-surface/annotation-surface.tsx"
20
+ },
21
+ {
22
+ "path": "src/components/ui/annotation-surface/geometry.ts",
23
+ "type": "registry:ui",
24
+ "target": "components/ui/annotation-surface/geometry.ts"
25
+ },
26
+ {
27
+ "path": "src/components/ui/annotation-surface/index.ts",
28
+ "type": "registry:ui",
29
+ "target": "components/ui/annotation-surface/index.ts"
30
+ }
31
+ ]
32
+ }
@@ -77,6 +77,38 @@
77
77
  }
78
78
  ]
79
79
  },
80
+ {
81
+ "name": "annotation-surface",
82
+ "type": "registry:ui",
83
+ "title": "Annotation Surface",
84
+ "description": "Keyboard-operable normalized drawing surface; hosts retain domain geometry and actions.",
85
+ "dependencies": [],
86
+ "registryDependencies": [
87
+ "lib"
88
+ ],
89
+ "files": [
90
+ {
91
+ "path": "src/components/ui/annotation-surface/annotation-surface.css",
92
+ "type": "registry:ui",
93
+ "target": "components/ui/annotation-surface/annotation-surface.css"
94
+ },
95
+ {
96
+ "path": "src/components/ui/annotation-surface/annotation-surface.tsx",
97
+ "type": "registry:ui",
98
+ "target": "components/ui/annotation-surface/annotation-surface.tsx"
99
+ },
100
+ {
101
+ "path": "src/components/ui/annotation-surface/geometry.ts",
102
+ "type": "registry:ui",
103
+ "target": "components/ui/annotation-surface/geometry.ts"
104
+ },
105
+ {
106
+ "path": "src/components/ui/annotation-surface/index.ts",
107
+ "type": "registry:ui",
108
+ "target": "components/ui/annotation-surface/index.ts"
109
+ }
110
+ ]
111
+ },
80
112
  {
81
113
  "name": "aspect-ratio",
82
114
  "type": "registry:ui",