@artkit-ai/react 0.0.0-stage → 0.1.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 (118) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +145 -2
  3. package/dist/cache.d.ts +35 -0
  4. package/dist/cache.d.ts.map +1 -0
  5. package/dist/cache.js +116 -0
  6. package/dist/cache.js.map +1 -0
  7. package/dist/client.d.ts +79 -0
  8. package/dist/client.d.ts.map +1 -0
  9. package/dist/client.js +260 -0
  10. package/dist/client.js.map +1 -0
  11. package/dist/components/approval.d.ts +34 -0
  12. package/dist/components/approval.d.ts.map +1 -0
  13. package/dist/components/approval.js +80 -0
  14. package/dist/components/approval.js.map +1 -0
  15. package/dist/components/card.d.ts +22 -0
  16. package/dist/components/card.d.ts.map +1 -0
  17. package/dist/components/card.js +16 -0
  18. package/dist/components/card.js.map +1 -0
  19. package/dist/components/editor.d.ts +28 -0
  20. package/dist/components/editor.d.ts.map +1 -0
  21. package/dist/components/editor.js +161 -0
  22. package/dist/components/editor.js.map +1 -0
  23. package/dist/components/icons.d.ts +8 -0
  24. package/dist/components/icons.d.ts.map +1 -0
  25. package/dist/components/icons.js +14 -0
  26. package/dist/components/icons.js.map +1 -0
  27. package/dist/components/panel.d.ts +34 -0
  28. package/dist/components/panel.d.ts.map +1 -0
  29. package/dist/components/panel.js +216 -0
  30. package/dist/components/panel.js.map +1 -0
  31. package/dist/components/shared.d.ts +71 -0
  32. package/dist/components/shared.d.ts.map +1 -0
  33. package/dist/components/shared.js +104 -0
  34. package/dist/components/shared.js.map +1 -0
  35. package/dist/components/version-diff.d.ts +35 -0
  36. package/dist/components/version-diff.d.ts.map +1 -0
  37. package/dist/components/version-diff.js +85 -0
  38. package/dist/components/version-diff.js.map +1 -0
  39. package/dist/components/view.d.ts +40 -0
  40. package/dist/components/view.d.ts.map +1 -0
  41. package/dist/components/view.js +75 -0
  42. package/dist/components/view.js.map +1 -0
  43. package/dist/context.d.ts +59 -0
  44. package/dist/context.d.ts.map +1 -0
  45. package/dist/context.js +13 -0
  46. package/dist/context.js.map +1 -0
  47. package/dist/controls.d.ts +145 -0
  48. package/dist/controls.d.ts.map +1 -0
  49. package/dist/controls.js +188 -0
  50. package/dist/controls.js.map +1 -0
  51. package/dist/download.d.ts +4 -0
  52. package/dist/download.d.ts.map +1 -0
  53. package/dist/download.js +20 -0
  54. package/dist/download.js.map +1 -0
  55. package/dist/editor-session.d.ts +184 -0
  56. package/dist/editor-session.d.ts.map +1 -0
  57. package/dist/editor-session.js +614 -0
  58. package/dist/editor-session.js.map +1 -0
  59. package/dist/hooks.d.ts +85 -0
  60. package/dist/hooks.d.ts.map +1 -0
  61. package/dist/hooks.js +297 -0
  62. package/dist/hooks.js.map +1 -0
  63. package/dist/i18n.d.ts +197 -0
  64. package/dist/i18n.d.ts.map +1 -0
  65. package/dist/i18n.js +207 -0
  66. package/dist/i18n.js.map +1 -0
  67. package/dist/index.d.ts +22 -0
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.js +22 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/kit-css.d.ts +3 -0
  72. package/dist/kit-css.d.ts.map +1 -0
  73. package/dist/kit-css.js +5 -0
  74. package/dist/kit-css.js.map +1 -0
  75. package/dist/line-diff.d.ts +25 -0
  76. package/dist/line-diff.d.ts.map +1 -0
  77. package/dist/line-diff.js +96 -0
  78. package/dist/line-diff.js.map +1 -0
  79. package/dist/partial-json.d.ts +8 -0
  80. package/dist/partial-json.d.ts.map +1 -0
  81. package/dist/partial-json.js +176 -0
  82. package/dist/partial-json.js.map +1 -0
  83. package/dist/provider.d.ts +42 -0
  84. package/dist/provider.d.ts.map +1 -0
  85. package/dist/provider.js +95 -0
  86. package/dist/provider.js.map +1 -0
  87. package/dist/styles.d.ts +25 -0
  88. package/dist/styles.d.ts.map +1 -0
  89. package/dist/styles.js +203 -0
  90. package/dist/styles.js.map +1 -0
  91. package/dist/toolbar.d.ts +90 -0
  92. package/dist/toolbar.d.ts.map +1 -0
  93. package/dist/toolbar.js +233 -0
  94. package/dist/toolbar.js.map +1 -0
  95. package/package.json +50 -3
  96. package/src/cache.ts +132 -0
  97. package/src/client.ts +390 -0
  98. package/src/components/approval.tsx +219 -0
  99. package/src/components/card.tsx +87 -0
  100. package/src/components/editor.tsx +392 -0
  101. package/src/components/icons.tsx +14 -0
  102. package/src/components/panel.tsx +591 -0
  103. package/src/components/shared.tsx +207 -0
  104. package/src/components/version-diff.tsx +266 -0
  105. package/src/components/view.tsx +199 -0
  106. package/src/context.ts +82 -0
  107. package/src/controls.tsx +587 -0
  108. package/src/download.ts +23 -0
  109. package/src/editor-session.ts +738 -0
  110. package/src/hooks.ts +411 -0
  111. package/src/i18n.ts +217 -0
  112. package/src/index.ts +160 -0
  113. package/src/kit-css.ts +5 -0
  114. package/src/line-diff.ts +111 -0
  115. package/src/partial-json.ts +160 -0
  116. package/src/provider.tsx +176 -0
  117. package/src/styles.ts +222 -0
  118. package/src/toolbar.tsx +536 -0
@@ -0,0 +1,145 @@
1
+ import { type Color, type Theme } from '@artkit-ai/core';
2
+ import type { LucideIcon } from 'lucide-react';
3
+ import { type ButtonHTMLAttributes, type ReactElement, type ReactNode } from 'react';
4
+ export type ControlVariant = 'default' | 'primary' | 'quiet' | 'danger';
5
+ export type ControlSize = 'sm' | 'md';
6
+ export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
7
+ icon?: LucideIcon;
8
+ variant?: ControlVariant;
9
+ size?: ControlSize;
10
+ /** Toggle state (`aria-pressed`). */
11
+ pressed?: boolean;
12
+ type?: 'button' | 'submit';
13
+ }
14
+ export declare function Button({ icon: Icon, variant, size, pressed, className, children, type, ...rest }: ButtonProps): ReactElement;
15
+ export interface IconButtonProps extends Omit<ButtonProps, 'icon' | 'children' | 'aria-label'> {
16
+ icon: LucideIcon;
17
+ label: string;
18
+ }
19
+ /** Square icon-only button; the label becomes the accessible name and tooltip. */
20
+ export declare function IconButton({ icon, label, title, ...rest }: IconButtonProps): ReactElement;
21
+ export interface FieldProps {
22
+ label: ReactNode;
23
+ hint?: ReactNode;
24
+ htmlFor?: string;
25
+ children: ReactNode;
26
+ className?: string;
27
+ }
28
+ /** Label above a control (and an optional hint below it). */
29
+ export declare function Field({ label, hint, htmlFor, children, className }: FieldProps): ReactElement;
30
+ /** Fields side by side, wrapping on narrow panels. */
31
+ export declare function FieldRow({ children, label }: {
32
+ children: ReactNode;
33
+ label?: string;
34
+ }): ReactElement;
35
+ export interface TextFieldProps {
36
+ label: string;
37
+ value: string;
38
+ onCommit(value: string): void;
39
+ multiline?: boolean;
40
+ disabled?: boolean;
41
+ placeholder?: string;
42
+ hint?: ReactNode;
43
+ rows?: number;
44
+ }
45
+ /** Text input that commits on blur (or Enter for single-line fields), not on every keystroke. */
46
+ export declare function TextField({ label, value, onCommit, multiline, disabled, placeholder, hint, rows, }: TextFieldProps): ReactElement;
47
+ export interface NumberFieldProps {
48
+ label: string;
49
+ value: number | undefined;
50
+ onCommit(value: number): void;
51
+ min?: number;
52
+ max?: number;
53
+ step?: number;
54
+ disabled?: boolean;
55
+ placeholder?: string;
56
+ /** Unit shown after the value (e.g. "in", "pt", "%"). */
57
+ unit?: string;
58
+ }
59
+ /** Number input that commits on blur or Enter, clamped to min/max. */
60
+ export declare function NumberField({ label, value, onCommit, min, max, step, disabled, placeholder, unit, }: NumberFieldProps): ReactElement;
61
+ export interface SelectFieldProps<T extends string> {
62
+ label: string;
63
+ value: T | undefined;
64
+ options: readonly {
65
+ value: T;
66
+ label: string;
67
+ }[];
68
+ onChange(value: T): void;
69
+ disabled?: boolean;
70
+ hint?: ReactNode;
71
+ }
72
+ export declare function SelectField<T extends string>({ label, value, options, onChange, disabled, hint, }: SelectFieldProps<T>): ReactElement;
73
+ export interface SwitchProps {
74
+ label: string;
75
+ checked: boolean;
76
+ onChange(value: boolean): void;
77
+ disabled?: boolean;
78
+ }
79
+ /** On/off switch (`role="switch"`) with its label beside it. */
80
+ export declare function Switch({ label, checked, onChange, disabled }: SwitchProps): ReactElement;
81
+ export interface ToggleProps {
82
+ label: string;
83
+ pressed: boolean;
84
+ onChange(value: boolean): void;
85
+ disabled?: boolean;
86
+ /** Button content (e.g. an icon or "B"); without it the toggle is drawn as a switch. */
87
+ children?: ReactNode;
88
+ icon?: LucideIcon;
89
+ }
90
+ /** Pressed-state button (formatting toggles) or, without content, a labelled switch. */
91
+ export declare function Toggle({ label, pressed, onChange, disabled, children, icon }: ToggleProps): ReactElement;
92
+ export interface SegmentedProps<T extends string> {
93
+ label: string;
94
+ value: T | undefined;
95
+ options: readonly {
96
+ value: T;
97
+ label: string;
98
+ icon?: LucideIcon;
99
+ }[];
100
+ onChange(value: T): void;
101
+ disabled?: boolean;
102
+ }
103
+ /** Small set of mutually exclusive options shown as joined buttons. */
104
+ export declare function Segmented<T extends string>({ label, value, options, onChange, disabled, }: SegmentedProps<T>): ReactElement;
105
+ export interface ColorPickerProps {
106
+ label: string;
107
+ value: Color | undefined;
108
+ theme: Theme;
109
+ locale: string;
110
+ onChange(color: Color | undefined): void;
111
+ /** Offer a hex input besides the theme tokens. */
112
+ allowHex?: boolean;
113
+ /** Offer a "none" option (for optional fills). */
114
+ allowNone?: boolean;
115
+ disabled?: boolean;
116
+ }
117
+ /** Theme token swatches with an optional hex field. */
118
+ export declare function ColorPicker({ label, value, theme, locale, onChange, allowHex, allowNone, disabled, }: ColorPickerProps): ReactElement;
119
+ export interface InspectorProps {
120
+ label: string;
121
+ children: ReactNode;
122
+ className?: string;
123
+ }
124
+ /** Side properties panel of an editor: stacked sections separated by rules. */
125
+ export declare function Inspector({ label, children, className }: InspectorProps): ReactElement;
126
+ export interface InspectorSectionProps {
127
+ title?: ReactNode;
128
+ /** Accessible name when the title is not plain text. */
129
+ label?: string;
130
+ actions?: ReactNode;
131
+ children: ReactNode;
132
+ className?: string;
133
+ }
134
+ export declare function InspectorSection({ title, label, actions, children, className, }: InspectorSectionProps): ReactElement;
135
+ /** Wrapping row of buttons. */
136
+ export declare function ButtonRow({ children, label }: {
137
+ children: ReactNode;
138
+ label?: string;
139
+ }): ReactElement;
140
+ /** Muted helper text for empty states and instructions. */
141
+ export declare function Hint({ children }: {
142
+ children: ReactNode;
143
+ }): ReactElement;
144
+ export declare const controlsCss = "\n.ak-ctl-button,:where(.ak-ctl-scope) :where(button:not([class])){display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;padding:0 12px;margin:0;font:inherit;font-size:13px;font-weight:600;line-height:1;white-space:nowrap;border:1px solid var(--ak-color-border,#dde0e2);border-radius:var(--ak-radius-sm,6px);background:var(--ak-color-background,#fff);color:var(--ak-color-text,#1d2f3c);cursor:pointer;transition:background-color .15s,border-color .15s,color .15s,box-shadow .15s}\n.ak-ctl-button svg,:where(.ak-ctl-scope) :where(button:not([class])) svg{width:16px;height:16px;flex-shrink:0}\n.ak-ctl-button:hover:not(:disabled),:where(.ak-ctl-scope) :where(button:not([class])):hover:not(:disabled){background:var(--ak-color-hover,#f2f3f4);border-color:var(--ak-color-border-strong,#8e979d)}\n.ak-ctl-button:active:not(:disabled),:where(.ak-ctl-scope) :where(button:not([class])):active:not(:disabled){background:var(--ak-color-active,#e8eaec)}\n.ak-ctl-button[aria-pressed=\"true\"],:where(.ak-ctl-scope) :where(button:not([class]))[aria-pressed=\"true\"]{background:var(--ak-color-fill-accent,#e7f2ef);color:var(--ak-color-accent,#0f7a5a);border-color:var(--ak-color-accent,#0f7a5a)}\n.ak-ctl-button:disabled,:where(.ak-ctl-scope) :where(button:not([class])):disabled{opacity:.4;cursor:not-allowed}\n.ak-ctl-button:focus-visible,:where(.ak-ctl-scope) :where(button:not([class])):focus-visible,.ak-ctl-switch:focus-visible,.ak-ctl-swatch:focus-visible,.ak-ctl-segmented button:focus-visible{outline:2px solid var(--ak-color-focus,#0f7a5a);outline-offset:2px}\n.ak-ctl-button[data-size=\"sm\"]{height:28px;padding:0 10px;font-size:12px}\n.ak-ctl-button[data-size=\"sm\"] svg{width:14px;height:14px}\n.ak-ctl-button[data-icon-only]{width:32px;padding:0}\n.ak-ctl-button[data-icon-only][data-size=\"sm\"]{width:28px}\n.ak-ctl-button[data-variant=\"primary\"]{border-color:transparent;background:var(--ak-gradient-button,#00dd80);color:var(--ak-color-on-primary,#1d2f3c)}\n.ak-ctl-button[data-variant=\"primary\"]:hover:not(:disabled){border-color:transparent;background:var(--ak-gradient-button-hover,#16a683)}\n.ak-ctl-button[data-variant=\"quiet\"]{border-color:transparent;background:transparent;color:var(--ak-color-muted,#56636d)}\n.ak-ctl-button[data-variant=\"quiet\"]:hover:not(:disabled){border-color:transparent;color:var(--ak-color-text,#1d2f3c)}\n.ak-ctl-button[data-variant=\"quiet\"][aria-pressed=\"true\"]{border-color:var(--ak-color-accent,#0f7a5a);color:var(--ak-color-accent,#0f7a5a)}\n.ak-ctl-button[data-variant=\"danger\"]{color:var(--ak-color-danger,#9f343a)}\n.ak-ctl-button[data-variant=\"danger\"]:hover:not(:disabled){background:var(--ak-color-fill-danger,#f5ebeb);border-color:var(--ak-color-danger,#9f343a)}\n.ak-ctl-input,.ak-ctl-select,.ak-ctl-textarea,:where(.ak-ctl-scope) :where(input:not([class]):not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"color\"]):not([type=\"range\"]):not([type=\"file\"]),select:not([class]),textarea:not([class])){box-sizing:border-box;width:100%;min-width:0;height:32px;margin:0;padding:0 10px;font:inherit;font-size:13px;line-height:1.3;color:var(--ak-color-text,#1d2f3c);background:var(--ak-color-background,#fff);border:1px solid var(--ak-color-border-strong,#8e979d);border-radius:var(--ak-radius-sm,6px);transition:border-color .15s,box-shadow .15s}\n.ak-ctl-input:hover:not(:disabled),.ak-ctl-select:hover:not(:disabled),.ak-ctl-textarea:hover:not(:disabled),:where(.ak-ctl-scope) :where(input:not([class]):not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"color\"]):not([type=\"range\"]):not([type=\"file\"]),select:not([class]),textarea:not([class])):hover:not(:disabled){border-color:var(--ak-color-muted,#56636d)}\n.ak-ctl-input:focus,.ak-ctl-select:focus,.ak-ctl-textarea:focus,:where(.ak-ctl-scope) :where(input:not([class]):not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"color\"]):not([type=\"range\"]):not([type=\"file\"]),select:not([class]),textarea:not([class])):focus{outline:none;border-color:var(--ak-color-accent,#0f7a5a);box-shadow:0 0 0 1px var(--ak-color-accent,#0f7a5a)}\n.ak-ctl-input:disabled,.ak-ctl-select:disabled,.ak-ctl-textarea:disabled,:where(.ak-ctl-scope) :where(input:not([class]):not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"color\"]):not([type=\"range\"]):not([type=\"file\"]),select:not([class]),textarea:not([class])):disabled{opacity:.5;cursor:not-allowed}\n.ak-ctl-input::placeholder,.ak-ctl-textarea::placeholder{color:var(--ak-color-muted,#56636d);opacity:.8}\n.ak-ctl-select,:where(.ak-ctl-scope) :where(select:not([class])){cursor:pointer;padding-right:6px}\n.ak-ctl-textarea,:where(.ak-ctl-scope) :where(textarea:not([class])){height:auto;min-height:72px;padding:8px 10px;line-height:1.5;resize:vertical}\n.ak-ctl-input[data-size=\"sm\"],.ak-ctl-select[data-size=\"sm\"]{height:28px;font-size:12px;padding:0 8px}\n.ak-ctl-field{display:flex;flex-direction:column;gap:4px;min-width:0;margin:0}\n.ak-ctl-label{display:block;padding:0;font-size:12px;font-weight:600;line-height:16px;color:var(--ak-color-muted,#56636d)}\n.ak-ctl-hint{font-size:12px;line-height:16px;color:var(--ak-color-muted,#56636d)}\n.ak-ctl-row{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-end}\n.ak-ctl-row>.ak-ctl-field{flex:1 1 64px}\n.ak-ctl-buttons{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0;padding:0;border:0;min-inline-size:0}\n.ak-ctl-affix{position:relative;display:flex;align-items:center;min-width:0}\n.ak-ctl-affix .ak-ctl-input{padding-right:30px}\n.ak-ctl-unit{position:absolute;right:8px;font-size:12px;color:var(--ak-color-muted,#56636d);pointer-events:none}\n.ak-ctl-hex{max-width:160px}\n.ak-ctl-hex .ak-ctl-input{padding-left:30px;padding-right:8px;font-family:var(--ak-font-mono,ui-monospace,monospace)}\n.ak-ctl-hex-preview{position:absolute;left:7px;width:16px;height:16px;border-radius:4px;border:1px solid var(--ak-color-border-strong,#8e979d);background:repeating-conic-gradient(var(--ak-color-border,#dde0e2) 0 25%,transparent 0 50%) 50%/8px 8px}\n.ak-ctl-colors{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;border:0;min-inline-size:0}\n.ak-ctl-colors:disabled{opacity:.5}\n.ak-ctl-swatches{display:flex;flex-wrap:wrap;gap:6px}\n.ak-ctl-swatch{width:24px;height:24px;min-width:0;padding:0;border:1px solid var(--ak-color-border-strong,#8e979d);border-radius:var(--ak-radius-sm,6px);cursor:pointer;transition:transform .1s}\n.ak-ctl-swatch:hover:not(:disabled){transform:scale(1.08)}\n.ak-ctl-swatch[aria-pressed=\"true\"]{border:2px solid var(--ak-color-accent,#0f7a5a);box-shadow:inset 0 0 0 2px var(--ak-color-background,#fff)}\n.ak-ctl-swatch-none{background:linear-gradient(135deg,transparent 44%,var(--ak-color-danger,#9f343a) 44%,var(--ak-color-danger,#9f343a) 56%,transparent 56%),var(--ak-color-background,#fff)}\n.ak-ctl-switch{display:inline-flex;align-items:center;gap:10px;min-height:28px;margin:0;padding:0;border:0;background:none;color:var(--ak-color-text,#1d2f3c);font:inherit;font-size:13px;font-weight:600;text-align:left;cursor:pointer;border-radius:var(--ak-radius-sm,6px)}\n.ak-ctl-switch:disabled{opacity:.4;cursor:not-allowed}\n.ak-ctl-switch-track{position:relative;flex-shrink:0;width:32px;height:18px;border-radius:999px;background:var(--ak-color-border-strong,#8e979d);transition:background-color .15s}\n.ak-ctl-switch-thumb{position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:var(--ak-color-background,#fff);transition:transform .15s}\n.ak-ctl-switch[aria-checked=\"true\"] .ak-ctl-switch-track{background:var(--ak-color-primary-deep,#16a683)}\n.ak-ctl-switch[aria-checked=\"true\"] .ak-ctl-switch-thumb{transform:translateX(14px)}\n.ak-ctl-segmented{display:inline-flex;gap:2px;padding:2px;border:1px solid var(--ak-color-border,#dde0e2);border-radius:var(--ak-radius-sm,6px);background:var(--ak-color-surface,#f4f7f7)}\n.ak-ctl-segmented button{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:28px;height:26px;padding:0 8px;border:0;border-radius:4px;background:transparent;color:var(--ak-color-muted,#56636d);font:inherit;font-size:12px;font-weight:600;cursor:pointer}\n.ak-ctl-segmented button svg{width:14px;height:14px}\n.ak-ctl-segmented button:hover:not(:disabled){color:var(--ak-color-text,#1d2f3c)}\n.ak-ctl-segmented button[aria-checked=\"true\"]{background:var(--ak-color-background,#fff);color:var(--ak-color-accent,#0f7a5a);box-shadow:0 0 0 1px var(--ak-color-border,#dde0e2)}\n.ak-ctl-inspector{display:flex;flex-direction:column;min-width:0;max-height:80vh;overflow-y:auto;background:var(--ak-color-background,#fff);color:var(--ak-color-text,#1d2f3c);border:1px solid var(--ak-color-border,#dde0e2);border-radius:var(--ak-radius-md,8px);font-size:13px}\n.ak-ctl-section{display:flex;flex-direction:column;gap:12px;margin:0;padding:14px;border:0;border-top:1px solid var(--ak-color-border,#dde0e2)}\n.ak-ctl-section:first-child{border-top:0}\n.ak-ctl-section-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:20px}\n.ak-ctl-section-title{margin:0;font-family:var(--ak-font-heading,\"Sora\",system-ui,sans-serif);font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--ak-color-text,#1d2f3c)}\n.ak-ctl-section-actions{display:flex;gap:4px}\n.ak-ctl-empty{margin:0;font-size:13px;line-height:1.55;color:var(--ak-color-muted,#56636d)}\n.ak-ctl-card{display:flex;flex-direction:column;gap:8px;margin:0;padding:10px;border:1px solid var(--ak-color-border,#dde0e2);border-radius:var(--ak-radius-md,8px);background:var(--ak-color-surface,#f4f7f7);min-inline-size:0}\n.ak-ctl-list{display:flex;flex-direction:column;gap:2px;margin:0;padding:0;list-style:none}\n.ak-ctl-list-item{display:flex;align-items:center;gap:8px;width:100%;min-height:32px;padding:0 10px;border:1px solid transparent;border-radius:var(--ak-radius-sm,6px);background:none;color:var(--ak-color-text,#1d2f3c);font:inherit;font-size:13px;text-align:left;cursor:pointer}\n.ak-ctl-list-item:hover:not(:disabled){background:var(--ak-color-hover,#f2f3f4)}\n.ak-ctl-list-item[aria-current=\"true\"]{background:var(--ak-color-fill-accent,#e7f2ef);border-color:var(--ak-color-accent,#0f7a5a);color:var(--ak-color-accent,#0f7a5a)}\n";
145
+ //# sourceMappingURL=controls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../src/controls.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,KAAK,EAA8B,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACnG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAUf,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AACxE,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtC,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACxF,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,qCAAqC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC5B;AAED,wBAAgB,MAAM,C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G,YAAY,CAgBtC;AAED,+BAA+B;AAC/B,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAMpG;AAED,2DAA2D;AAC3D,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,YAAY,CAExE;AAeD,eAAO,MAAM,WAAW,qjUAqEvB,CAAC"}
@@ -0,0 +1,188 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { COLOR_TOKENS, isColorToken, resolveColor } from '@artkit-ai/core';
3
+ import { useEffect, useId, useState, } from 'react';
4
+ /*
5
+ * Standard form controls for kind editors and side panels (Mouts design: 32px controls, 6px radius, accent
6
+ * pressed state, focus ring). Every kind uses these, so buttons, fields, selects, switches and property
7
+ * panels look the same in documents, sheets, slides and diagrams, in light and dark themes.
8
+ */
9
+ const pt = (locale) => (locale ?? '').toLowerCase().startsWith('pt');
10
+ export function Button({ icon: Icon, variant = 'default', size = 'md', pressed, className, children, type = 'button', ...rest }) {
11
+ return (_jsxs("button", { type: type, className: `ak-ctl-button${className ? ` ${className}` : ''}`, "data-variant": variant === 'default' ? undefined : variant, "data-size": size === 'md' ? undefined : size, ...(pressed === undefined ? {} : { 'aria-pressed': pressed }), ...rest, children: [Icon ? _jsx(Icon, { "aria-hidden": "true" }) : null, children] }));
12
+ }
13
+ /** Square icon-only button; the label becomes the accessible name and tooltip. */
14
+ export function IconButton({ icon, label, title, ...rest }) {
15
+ return _jsx(Button, { icon: icon, "aria-label": label, title: title ?? label, "data-icon-only": "", ...rest });
16
+ }
17
+ /** Label above a control (and an optional hint below it). */
18
+ export function Field({ label, hint, htmlFor, children, className }) {
19
+ return (_jsxs("div", { className: `ak-ctl-field${className ? ` ${className}` : ''}`, children: [_jsx("label", { className: "ak-ctl-label", htmlFor: htmlFor, children: label }), children, hint ? _jsx("span", { className: "ak-ctl-hint", children: hint }) : null] }));
20
+ }
21
+ /** Fields side by side, wrapping on narrow panels. */
22
+ export function FieldRow({ children, label }) {
23
+ return (_jsx("div", { className: "ak-ctl-row", ...(label ? { role: 'group', 'aria-label': label } : {}), children: children }));
24
+ }
25
+ /** Text input that commits on blur (or Enter for single-line fields), not on every keystroke. */
26
+ export function TextField({ label, value, onCommit, multiline, disabled, placeholder, hint, rows = 4, }) {
27
+ const id = useId();
28
+ const [draft, setDraft] = useState(value);
29
+ useEffect(() => setDraft(value), [value]);
30
+ const commit = () => {
31
+ if (draft !== value)
32
+ onCommit(draft);
33
+ };
34
+ return (_jsx(Field, { label: label, htmlFor: id, hint: hint, children: multiline ? (_jsx("textarea", { id: id, className: "ak-ctl-textarea", value: draft, disabled: disabled, placeholder: placeholder, rows: rows, onChange: (event) => setDraft(event.target.value), onBlur: commit })) : (_jsx("input", { id: id, className: "ak-ctl-input", value: draft, disabled: disabled, placeholder: placeholder, onChange: (event) => setDraft(event.target.value), onBlur: commit, onKeyDown: (event) => {
35
+ if (event.key === 'Enter')
36
+ commit();
37
+ } })) }));
38
+ }
39
+ /** Number input that commits on blur or Enter, clamped to min/max. */
40
+ export function NumberField({ label, value, onCommit, min, max, step = 0.01, disabled, placeholder, unit, }) {
41
+ const id = useId();
42
+ const [draft, setDraft] = useState(value === undefined ? '' : String(value));
43
+ useEffect(() => setDraft(value === undefined ? '' : String(value)), [value]);
44
+ const commit = () => {
45
+ const parsed = Number(draft);
46
+ if (draft.trim() === '' || !Number.isFinite(parsed)) {
47
+ setDraft(value === undefined ? '' : String(value));
48
+ return;
49
+ }
50
+ const clamped = Math.max(min ?? -Infinity, Math.min(max ?? Infinity, parsed));
51
+ if (clamped !== value)
52
+ onCommit(clamped);
53
+ setDraft(String(clamped));
54
+ };
55
+ const input = (_jsx("input", { id: id, className: "ak-ctl-input", type: "number", inputMode: "decimal", value: draft, min: min, max: max, step: step, disabled: disabled, placeholder: placeholder, onChange: (event) => setDraft(event.target.value), onBlur: commit, onKeyDown: (event) => {
56
+ if (event.key === 'Enter')
57
+ commit();
58
+ } }));
59
+ return (_jsx(Field, { label: label, htmlFor: id, children: unit ? (_jsxs("span", { className: "ak-ctl-affix", children: [input, _jsx("span", { className: "ak-ctl-unit", "aria-hidden": "true", children: unit })] })) : (input) }));
60
+ }
61
+ export function SelectField({ label, value, options, onChange, disabled, hint, }) {
62
+ const id = useId();
63
+ return (_jsx(Field, { label: label, htmlFor: id, hint: hint, children: _jsxs("select", { id: id, className: "ak-ctl-select", value: value ?? '', disabled: disabled, onChange: (event) => onChange(event.target.value), children: [value === undefined ? _jsx("option", { value: "", children: "\u2014" }) : null, options.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value)))] }) }));
64
+ }
65
+ /** On/off switch (`role="switch"`) with its label beside it. */
66
+ export function Switch({ label, checked, onChange, disabled }) {
67
+ return (_jsxs("button", { type: "button", role: "switch", "aria-checked": checked, className: "ak-ctl-switch", disabled: disabled, onClick: () => onChange(!checked), children: [_jsx("span", { className: "ak-ctl-switch-track", "aria-hidden": "true", children: _jsx("span", { className: "ak-ctl-switch-thumb" }) }), _jsx("span", { className: "ak-ctl-switch-label", children: label })] }));
68
+ }
69
+ /** Pressed-state button (formatting toggles) or, without content, a labelled switch. */
70
+ export function Toggle({ label, pressed, onChange, disabled, children, icon }) {
71
+ if (children === undefined && icon === undefined)
72
+ return _jsx(Switch, { label: label, checked: pressed, onChange: onChange, ...(disabled ? { disabled } : {}) });
73
+ return (_jsx(Button, { size: "sm", pressed: pressed, "aria-label": label, title: label, disabled: disabled, "data-icon-only": "", ...(icon ? { icon } : {}), onClick: () => onChange(!pressed), children: children }));
74
+ }
75
+ /** Small set of mutually exclusive options shown as joined buttons. */
76
+ export function Segmented({ label, value, options, onChange, disabled, }) {
77
+ return (_jsx("div", { className: "ak-ctl-segmented", role: "radiogroup", "aria-label": label, children: options.map(({ value: option, label: text, icon: Icon }) => (_jsx("button", { type: "button", role: "radio", "aria-checked": value === option, "aria-label": Icon ? text : undefined, title: text, disabled: disabled, onClick: () => onChange(option), children: Icon ? _jsx(Icon, { "aria-hidden": "true" }) : text }, option))) }));
78
+ }
79
+ const HEX = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
80
+ /** Theme token swatches with an optional hex field. */
81
+ export function ColorPicker({ label, value, theme, locale, onChange, allowHex, allowNone, disabled, }) {
82
+ const [hex, setHex] = useState(value && !isColorToken(value) ? value : '');
83
+ useEffect(() => setHex(value && !isColorToken(value) ? value : ''), [value]);
84
+ const none = pt(locale) ? 'Nenhuma' : 'None';
85
+ return (_jsxs("fieldset", { className: "ak-ctl-colors", disabled: disabled, children: [_jsx("legend", { className: "ak-ctl-label", children: label }), _jsxs("div", { className: "ak-ctl-swatches", children: [allowNone ? (_jsx("button", { type: "button", "aria-pressed": value === undefined, className: "ak-ctl-swatch ak-ctl-swatch-none", "aria-label": none, title: none, onClick: () => onChange(undefined) })) : null, COLOR_TOKENS.map((token) => (_jsx("button", { type: "button", "aria-pressed": value === token, className: "ak-ctl-swatch", style: { background: resolveColor(theme, token) }, "aria-label": token, title: token, onClick: () => onChange(token) }, token)))] }), allowHex ? (_jsxs("span", { className: "ak-ctl-affix ak-ctl-hex", children: [_jsx("span", { className: "ak-ctl-hex-preview", "aria-hidden": "true", style: HEX.test(hex) ? { background: hex } : undefined }), _jsx("input", { className: "ak-ctl-input", "data-size": "sm", "aria-label": `${label} (hex)`, placeholder: "#RRGGBB", value: hex, onChange: (event) => setHex(event.target.value), onBlur: () => {
86
+ if (HEX.test(hex) && hex !== value)
87
+ onChange(hex);
88
+ }, onKeyDown: (event) => {
89
+ if (event.key === 'Enter' && HEX.test(hex))
90
+ onChange(hex);
91
+ } })] })) : null] }));
92
+ }
93
+ /** Side properties panel of an editor: stacked sections separated by rules. */
94
+ export function Inspector({ label, children, className }) {
95
+ return (_jsx("aside", { className: `ak-ctl-inspector${className ? ` ${className}` : ''}`, "aria-label": label, children: children }));
96
+ }
97
+ export function InspectorSection({ title, label, actions, children, className, }) {
98
+ const ariaLabel = label ?? (typeof title === 'string' ? title : undefined);
99
+ return (_jsxs("section", { className: `ak-ctl-section${className ? ` ${className}` : ''}`, ...(ariaLabel ? { 'aria-label': ariaLabel } : {}), children: [title || actions ? (_jsxs("header", { className: "ak-ctl-section-head", children: [title ? _jsx("h3", { className: "ak-ctl-section-title", children: title }) : null, actions ? _jsx("div", { className: "ak-ctl-section-actions", children: actions }) : null] })) : null, children] }));
100
+ }
101
+ /** Wrapping row of buttons. */
102
+ export function ButtonRow({ children, label }) {
103
+ return (_jsx("div", { className: "ak-ctl-buttons", ...(label ? { role: 'group', 'aria-label': label } : {}), children: children }));
104
+ }
105
+ /** Muted helper text for empty states and instructions. */
106
+ export function Hint({ children }) {
107
+ return _jsx("p", { className: "ak-ctl-empty", children: children });
108
+ }
109
+ const BUTTON = 'display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;padding:0 12px;margin:0;font:inherit;font-size:13px;font-weight:600;line-height:1;white-space:nowrap;border:1px solid var(--ak-color-border,#dde0e2);border-radius:var(--ak-radius-sm,6px);background:var(--ak-color-background,#fff);color:var(--ak-color-text,#1d2f3c);cursor:pointer;transition:background-color .15s,border-color .15s,color .15s,box-shadow .15s';
110
+ const FIELD = 'box-sizing:border-box;width:100%;min-width:0;height:32px;margin:0;padding:0 10px;font:inherit;font-size:13px;line-height:1.3;color:var(--ak-color-text,#1d2f3c);background:var(--ak-color-background,#fff);border:1px solid var(--ak-color-border-strong,#8e979d);border-radius:var(--ak-radius-sm,6px);transition:border-color .15s,box-shadow .15s';
111
+ /**
112
+ * Plain `<button>`, `<input>`, `<select>` and `<textarea>` without a class inside `.ak-ctl-scope` get the
113
+ * standard look too (zero specificity, so any kind class still wins).
114
+ */
115
+ const SCOPE = ':where(.ak-ctl-scope)';
116
+ const PLAIN_BUTTON = `${SCOPE} :where(button:not([class]))`;
117
+ const PLAIN_FIELD = `${SCOPE} :where(input:not([class]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]),select:not([class]),textarea:not([class]))`;
118
+ export const controlsCss = `
119
+ .ak-ctl-button,${PLAIN_BUTTON}{${BUTTON}}
120
+ .ak-ctl-button svg,${PLAIN_BUTTON} svg{width:16px;height:16px;flex-shrink:0}
121
+ .ak-ctl-button:hover:not(:disabled),${PLAIN_BUTTON}:hover:not(:disabled){background:var(--ak-color-hover,#f2f3f4);border-color:var(--ak-color-border-strong,#8e979d)}
122
+ .ak-ctl-button:active:not(:disabled),${PLAIN_BUTTON}:active:not(:disabled){background:var(--ak-color-active,#e8eaec)}
123
+ .ak-ctl-button[aria-pressed="true"],${PLAIN_BUTTON}[aria-pressed="true"]{background:var(--ak-color-fill-accent,#e7f2ef);color:var(--ak-color-accent,#0f7a5a);border-color:var(--ak-color-accent,#0f7a5a)}
124
+ .ak-ctl-button:disabled,${PLAIN_BUTTON}:disabled{opacity:.4;cursor:not-allowed}
125
+ .ak-ctl-button:focus-visible,${PLAIN_BUTTON}:focus-visible,.ak-ctl-switch:focus-visible,.ak-ctl-swatch:focus-visible,.ak-ctl-segmented button:focus-visible{outline:2px solid var(--ak-color-focus,#0f7a5a);outline-offset:2px}
126
+ .ak-ctl-button[data-size="sm"]{height:28px;padding:0 10px;font-size:12px}
127
+ .ak-ctl-button[data-size="sm"] svg{width:14px;height:14px}
128
+ .ak-ctl-button[data-icon-only]{width:32px;padding:0}
129
+ .ak-ctl-button[data-icon-only][data-size="sm"]{width:28px}
130
+ .ak-ctl-button[data-variant="primary"]{border-color:transparent;background:var(--ak-gradient-button,#00dd80);color:var(--ak-color-on-primary,#1d2f3c)}
131
+ .ak-ctl-button[data-variant="primary"]:hover:not(:disabled){border-color:transparent;background:var(--ak-gradient-button-hover,#16a683)}
132
+ .ak-ctl-button[data-variant="quiet"]{border-color:transparent;background:transparent;color:var(--ak-color-muted,#56636d)}
133
+ .ak-ctl-button[data-variant="quiet"]:hover:not(:disabled){border-color:transparent;color:var(--ak-color-text,#1d2f3c)}
134
+ .ak-ctl-button[data-variant="quiet"][aria-pressed="true"]{border-color:var(--ak-color-accent,#0f7a5a);color:var(--ak-color-accent,#0f7a5a)}
135
+ .ak-ctl-button[data-variant="danger"]{color:var(--ak-color-danger,#9f343a)}
136
+ .ak-ctl-button[data-variant="danger"]:hover:not(:disabled){background:var(--ak-color-fill-danger,#f5ebeb);border-color:var(--ak-color-danger,#9f343a)}
137
+ .ak-ctl-input,.ak-ctl-select,.ak-ctl-textarea,${PLAIN_FIELD}{${FIELD}}
138
+ .ak-ctl-input:hover:not(:disabled),.ak-ctl-select:hover:not(:disabled),.ak-ctl-textarea:hover:not(:disabled),${PLAIN_FIELD}:hover:not(:disabled){border-color:var(--ak-color-muted,#56636d)}
139
+ .ak-ctl-input:focus,.ak-ctl-select:focus,.ak-ctl-textarea:focus,${PLAIN_FIELD}:focus{outline:none;border-color:var(--ak-color-accent,#0f7a5a);box-shadow:0 0 0 1px var(--ak-color-accent,#0f7a5a)}
140
+ .ak-ctl-input:disabled,.ak-ctl-select:disabled,.ak-ctl-textarea:disabled,${PLAIN_FIELD}:disabled{opacity:.5;cursor:not-allowed}
141
+ .ak-ctl-input::placeholder,.ak-ctl-textarea::placeholder{color:var(--ak-color-muted,#56636d);opacity:.8}
142
+ .ak-ctl-select,${SCOPE} :where(select:not([class])){cursor:pointer;padding-right:6px}
143
+ .ak-ctl-textarea,${SCOPE} :where(textarea:not([class])){height:auto;min-height:72px;padding:8px 10px;line-height:1.5;resize:vertical}
144
+ .ak-ctl-input[data-size="sm"],.ak-ctl-select[data-size="sm"]{height:28px;font-size:12px;padding:0 8px}
145
+ .ak-ctl-field{display:flex;flex-direction:column;gap:4px;min-width:0;margin:0}
146
+ .ak-ctl-label{display:block;padding:0;font-size:12px;font-weight:600;line-height:16px;color:var(--ak-color-muted,#56636d)}
147
+ .ak-ctl-hint{font-size:12px;line-height:16px;color:var(--ak-color-muted,#56636d)}
148
+ .ak-ctl-row{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-end}
149
+ .ak-ctl-row>.ak-ctl-field{flex:1 1 64px}
150
+ .ak-ctl-buttons{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0;padding:0;border:0;min-inline-size:0}
151
+ .ak-ctl-affix{position:relative;display:flex;align-items:center;min-width:0}
152
+ .ak-ctl-affix .ak-ctl-input{padding-right:30px}
153
+ .ak-ctl-unit{position:absolute;right:8px;font-size:12px;color:var(--ak-color-muted,#56636d);pointer-events:none}
154
+ .ak-ctl-hex{max-width:160px}
155
+ .ak-ctl-hex .ak-ctl-input{padding-left:30px;padding-right:8px;font-family:var(--ak-font-mono,ui-monospace,monospace)}
156
+ .ak-ctl-hex-preview{position:absolute;left:7px;width:16px;height:16px;border-radius:4px;border:1px solid var(--ak-color-border-strong,#8e979d);background:repeating-conic-gradient(var(--ak-color-border,#dde0e2) 0 25%,transparent 0 50%) 50%/8px 8px}
157
+ .ak-ctl-colors{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;border:0;min-inline-size:0}
158
+ .ak-ctl-colors:disabled{opacity:.5}
159
+ .ak-ctl-swatches{display:flex;flex-wrap:wrap;gap:6px}
160
+ .ak-ctl-swatch{width:24px;height:24px;min-width:0;padding:0;border:1px solid var(--ak-color-border-strong,#8e979d);border-radius:var(--ak-radius-sm,6px);cursor:pointer;transition:transform .1s}
161
+ .ak-ctl-swatch:hover:not(:disabled){transform:scale(1.08)}
162
+ .ak-ctl-swatch[aria-pressed="true"]{border:2px solid var(--ak-color-accent,#0f7a5a);box-shadow:inset 0 0 0 2px var(--ak-color-background,#fff)}
163
+ .ak-ctl-swatch-none{background:linear-gradient(135deg,transparent 44%,var(--ak-color-danger,#9f343a) 44%,var(--ak-color-danger,#9f343a) 56%,transparent 56%),var(--ak-color-background,#fff)}
164
+ .ak-ctl-switch{display:inline-flex;align-items:center;gap:10px;min-height:28px;margin:0;padding:0;border:0;background:none;color:var(--ak-color-text,#1d2f3c);font:inherit;font-size:13px;font-weight:600;text-align:left;cursor:pointer;border-radius:var(--ak-radius-sm,6px)}
165
+ .ak-ctl-switch:disabled{opacity:.4;cursor:not-allowed}
166
+ .ak-ctl-switch-track{position:relative;flex-shrink:0;width:32px;height:18px;border-radius:999px;background:var(--ak-color-border-strong,#8e979d);transition:background-color .15s}
167
+ .ak-ctl-switch-thumb{position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:var(--ak-color-background,#fff);transition:transform .15s}
168
+ .ak-ctl-switch[aria-checked="true"] .ak-ctl-switch-track{background:var(--ak-color-primary-deep,#16a683)}
169
+ .ak-ctl-switch[aria-checked="true"] .ak-ctl-switch-thumb{transform:translateX(14px)}
170
+ .ak-ctl-segmented{display:inline-flex;gap:2px;padding:2px;border:1px solid var(--ak-color-border,#dde0e2);border-radius:var(--ak-radius-sm,6px);background:var(--ak-color-surface,#f4f7f7)}
171
+ .ak-ctl-segmented button{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:28px;height:26px;padding:0 8px;border:0;border-radius:4px;background:transparent;color:var(--ak-color-muted,#56636d);font:inherit;font-size:12px;font-weight:600;cursor:pointer}
172
+ .ak-ctl-segmented button svg{width:14px;height:14px}
173
+ .ak-ctl-segmented button:hover:not(:disabled){color:var(--ak-color-text,#1d2f3c)}
174
+ .ak-ctl-segmented button[aria-checked="true"]{background:var(--ak-color-background,#fff);color:var(--ak-color-accent,#0f7a5a);box-shadow:0 0 0 1px var(--ak-color-border,#dde0e2)}
175
+ .ak-ctl-inspector{display:flex;flex-direction:column;min-width:0;max-height:80vh;overflow-y:auto;background:var(--ak-color-background,#fff);color:var(--ak-color-text,#1d2f3c);border:1px solid var(--ak-color-border,#dde0e2);border-radius:var(--ak-radius-md,8px);font-size:13px}
176
+ .ak-ctl-section{display:flex;flex-direction:column;gap:12px;margin:0;padding:14px;border:0;border-top:1px solid var(--ak-color-border,#dde0e2)}
177
+ .ak-ctl-section:first-child{border-top:0}
178
+ .ak-ctl-section-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:20px}
179
+ .ak-ctl-section-title{margin:0;font-family:var(--ak-font-heading,"Sora",system-ui,sans-serif);font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--ak-color-text,#1d2f3c)}
180
+ .ak-ctl-section-actions{display:flex;gap:4px}
181
+ .ak-ctl-empty{margin:0;font-size:13px;line-height:1.55;color:var(--ak-color-muted,#56636d)}
182
+ .ak-ctl-card{display:flex;flex-direction:column;gap:8px;margin:0;padding:10px;border:1px solid var(--ak-color-border,#dde0e2);border-radius:var(--ak-radius-md,8px);background:var(--ak-color-surface,#f4f7f7);min-inline-size:0}
183
+ .ak-ctl-list{display:flex;flex-direction:column;gap:2px;margin:0;padding:0;list-style:none}
184
+ .ak-ctl-list-item{display:flex;align-items:center;gap:8px;width:100%;min-height:32px;padding:0 10px;border:1px solid transparent;border-radius:var(--ak-radius-sm,6px);background:none;color:var(--ak-color-text,#1d2f3c);font:inherit;font-size:13px;text-align:left;cursor:pointer}
185
+ .ak-ctl-list-item:hover:not(:disabled){background:var(--ak-color-hover,#f2f3f4)}
186
+ .ak-ctl-list-item[aria-current="true"]{background:var(--ak-color-fill-accent,#e7f2ef);border-color:var(--ak-color-accent,#0f7a5a);color:var(--ak-color-accent,#0f7a5a)}
187
+ `;
188
+ //# sourceMappingURL=controls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controls.js","sourceRoot":"","sources":["../src/controls.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAc,YAAY,EAAE,YAAY,EAAc,MAAM,iBAAiB,CAAC;AAEnG,OAAO,EAIL,SAAS,EACT,KAAK,EACL,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf;;;;GAIG;AAEH,MAAM,EAAE,GAAG,CAAC,MAA0B,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,UAAU,CAA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K,SAAS,EAAC,gBAAgB,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,YACtF,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,IAAI,CAAC,EAAE,QAAQ,EAA2B;IACxD,OAAO,YAAG,SAAS,EAAC,cAAc,YAAE,QAAQ,GAAK,CAAC;AACpD,CAAC;AAED,MAAM,MAAM,GACV,ybAAyb,CAAC;AAC5b,MAAM,KAAK,GACT,sVAAsV,CAAC;AAEzV;;;GAGG;AACH,MAAM,KAAK,GAAG,uBAAuB,CAAC;AACtC,MAAM,YAAY,GAAG,GAAG,KAAK,8BAA8B,CAAC;AAC5D,MAAM,WAAW,GAAG,GAAG,KAAK,6KAA6K,CAAC;AAE1M,MAAM,CAAC,MAAM,WAAW,GAAG;iBACV,YAAY,IAAI,MAAM;qBAClB,YAAY;sCACK,YAAY;uCACX,YAAY;sCACb,YAAY;0BACxB,YAAY;+BACP,YAAY;;;;;;;;;;;;gDAYK,WAAW,IAAI,KAAK;+GAC2C,WAAW;kEACxD,WAAW;2EACF,WAAW;;iBAErE,KAAK;mBACH,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CvB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ClientExportResult } from './client.js';
2
+ /** Saves exported bytes through a temporary object URL. No-op outside the browser. */
3
+ export declare function triggerDownload(file: Pick<ClientExportResult, 'bytes' | 'mimeType' | 'filename'>): void;
4
+ //# sourceMappingURL=download.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../src/download.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC,GAAG,IAAI,CAmBvG"}
@@ -0,0 +1,20 @@
1
+ /** Saves exported bytes through a temporary object URL. No-op outside the browser. */
2
+ export function triggerDownload(file) {
3
+ if (typeof document === 'undefined' ||
4
+ typeof URL === 'undefined' ||
5
+ typeof URL.createObjectURL !== 'function')
6
+ return;
7
+ const blob = new Blob([file.bytes.slice()], { type: file.mimeType });
8
+ const url = URL.createObjectURL(blob);
9
+ const anchor = document.createElement('a');
10
+ anchor.href = url;
11
+ anchor.download = file.filename;
12
+ anchor.rel = 'noopener';
13
+ anchor.style.display = 'none';
14
+ document.body.appendChild(anchor);
15
+ anchor.click();
16
+ anchor.remove();
17
+ // Revoking synchronously can cancel the download in some browsers.
18
+ setTimeout(() => URL.revokeObjectURL(url), 1000);
19
+ }
20
+ //# sourceMappingURL=download.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download.js","sourceRoot":"","sources":["../src/download.ts"],"names":[],"mappings":"AAEA,sFAAsF;AACtF,MAAM,UAAU,eAAe,CAAC,IAAiE;IAC/F,IACE,OAAO,QAAQ,KAAK,WAAW;QAC/B,OAAO,GAAG,KAAK,WAAW;QAC1B,OAAO,GAAG,CAAC,eAAe,KAAK,UAAU;QAEzC,OAAO;IACT,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrE,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAChC,MAAM,CAAC,GAAG,GAAG,UAAU,CAAC;IACxB,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,CAAC,KAAK,EAAE,CAAC;IACf,MAAM,CAAC,MAAM,EAAE,CAAC;IAChB,mEAAmE;IACnE,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,184 @@
1
+ import { type Artifact, ArtifactError, type ArtifactRegistry, type ChangeSummary, type CommitResult, type EmitOptions } from '@artkit-ai/core';
2
+ /** The editable part of an artifact: content plus the envelope fields operations can change. */
3
+ export interface EnvelopeState {
4
+ content: unknown;
5
+ title: string;
6
+ themeId: string;
7
+ locale: string;
8
+ }
9
+ export interface SendRequest {
10
+ baseVersion: number;
11
+ operations: unknown[];
12
+ idempotencyKey: string;
13
+ }
14
+ export interface EditorSessionOptions {
15
+ registry: ArtifactRegistry;
16
+ /** Last confirmed version. */
17
+ artifact: Artifact;
18
+ /** Commits a batch (usually `client.apply`). */
19
+ send(request: SendRequest): Promise<CommitResult>;
20
+ /** Loads the latest version, or a specific one, after a conflict or a rebased commit. */
21
+ load(version?: number): Promise<Artifact>;
22
+ /** Typing operations emitted within this window become one batch (default 600 ms). */
23
+ groupingWindowMs?: number;
24
+ /** Upper bound for one typing batch while the user keeps typing (default 5 s). */
25
+ maxGroupingMs?: number;
26
+ /** Undo entries kept (default 100). */
27
+ maxUndo?: number;
28
+ /** Locale of error messages produced locally. */
29
+ locale?: string;
30
+ createKey?(): string;
31
+ onCommitted?(result: CommitResult): void;
32
+ }
33
+ export type SessionStatus = 'idle' | 'editing' | 'saving' | 'conflict';
34
+ export interface SessionConflict {
35
+ /**
36
+ * `server`: the server answered VERSION_CONFLICT; `rebase`: a newer version arrived and the pending
37
+ * operations no longer apply on it; `undo`/`redo`: the artifact changed after the edit being undone.
38
+ */
39
+ reason: 'server' | 'rebase' | 'undo' | 'redo';
40
+ /** What changed in the newer version, for the conflict diff. */
41
+ changes: ChangeSummary[];
42
+ /** The local operations that would be reapplied. */
43
+ operations: unknown[];
44
+ latest: Artifact;
45
+ }
46
+ export type SessionEvent = {
47
+ type: 'saved';
48
+ version: number;
49
+ } | {
50
+ type: 'undone';
51
+ version: number;
52
+ } | {
53
+ type: 'redone';
54
+ version: number;
55
+ } | {
56
+ type: 'rebased';
57
+ version: number;
58
+ } | {
59
+ type: 'rejected';
60
+ error: ArtifactError;
61
+ } | {
62
+ type: 'rolled_back';
63
+ error: ArtifactError;
64
+ } | {
65
+ type: 'conflict';
66
+ reason: SessionConflict['reason'];
67
+ } | {
68
+ type: 'conflict_resolved';
69
+ choice: ConflictChoice;
70
+ };
71
+ export type ConflictChoice = 'keep-theirs' | 'reapply';
72
+ export interface EditorSessionState {
73
+ confirmed: Artifact;
74
+ /** Optimistic state: confirmed version plus every unconfirmed local operation. */
75
+ view: EnvelopeState;
76
+ status: SessionStatus;
77
+ /** Local operations not confirmed yet (buffered, queued or in flight). */
78
+ dirty: boolean;
79
+ canUndo: boolean;
80
+ canRedo: boolean;
81
+ error?: ArtifactError;
82
+ conflict?: SessionConflict;
83
+ /** Set after a LOCKED rejection; editing stays disabled until then. */
84
+ lockedUntil?: string;
85
+ /** Last notable event, with a sequence number so hosts can announce each one once. */
86
+ event?: SessionEvent & {
87
+ seq: number;
88
+ };
89
+ }
90
+ export declare function envelopeOf(artifact: Pick<Artifact, 'content' | 'title' | 'themeId' | 'locale'>): EnvelopeState;
91
+ /**
92
+ * Operations that turn `from` into `to`. Kinds do not provide inverse operations, so undo and redo send
93
+ * `replace_content` with the snapshot (plus envelope operations); the commit still becomes a new version
94
+ * (spec §8.5).
95
+ */
96
+ export declare function operationsBetween(from: EnvelopeState, to: EnvelopeState): unknown[];
97
+ /**
98
+ * Framework-free editing session behind `ArtifactEditor` (spec §13.6): batching of typing operations,
99
+ * optimistic apply with the kind's own logic, rollback on rejection, local undo/redo over the user's own
100
+ * batches, rebase of pending operations on newer versions, conflict resolution and lock handling.
101
+ *
102
+ * Batches are sent one at a time, each against the version the previous one produced.
103
+ */
104
+ export declare class EditorSession {
105
+ private readonly options;
106
+ private readonly windowMs;
107
+ private readonly maxGroupingMs;
108
+ private readonly maxUndo;
109
+ private confirmed;
110
+ private view;
111
+ private buffer;
112
+ private bufferStartedAt;
113
+ private timer;
114
+ private lockTimer;
115
+ private queue;
116
+ private inflight;
117
+ private undoStack;
118
+ private redoStack;
119
+ private error;
120
+ private conflict;
121
+ private lockedUntil;
122
+ private deferredRemote;
123
+ private event;
124
+ private seq;
125
+ private disposed;
126
+ private readonly listeners;
127
+ private idleWaiters;
128
+ private snapshot;
129
+ constructor(options: EditorSessionOptions);
130
+ subscribe: (listener: () => void) => (() => void);
131
+ getSnapshot: () => EditorSessionState;
132
+ /** Resolves once nothing is buffered, queued or in flight (or a conflict is waiting for the user). */
133
+ whenIdle(): Promise<void>;
134
+ private isIdle;
135
+ private buildSnapshot;
136
+ private notify;
137
+ private announce;
138
+ private isLocked;
139
+ private applyLocal;
140
+ private pendingOperations;
141
+ /**
142
+ * Recomputes the optimistic view from the confirmed version. When the unconfirmed operations no
143
+ * longer apply, they move into a `rebase` conflict and the view falls back to the confirmed version.
144
+ */
145
+ private rebaseView;
146
+ private changesBetween;
147
+ /**
148
+ * Called by the kind editor. Operations are applied optimistically right away; invalid ones are
149
+ * rejected locally (returns false) and never reach the server.
150
+ */
151
+ emit: (operations: unknown[], options?: EmitOptions) => boolean;
152
+ /** Sends buffered typing operations now (e.g. on blur or before navigation). */
153
+ flush(): void;
154
+ private key;
155
+ private schedule;
156
+ private clearTimer;
157
+ private flushBuffer;
158
+ undo: () => void;
159
+ redo: () => void;
160
+ dismissError: () => void;
161
+ private pump;
162
+ private resolveHistoryCommand;
163
+ private onCommitted;
164
+ /** Incorporates a version that arrived while a request was in flight. */
165
+ private applyDeferred;
166
+ private pushUndo;
167
+ private onRejected;
168
+ private setLocked;
169
+ /**
170
+ * A version arrived from outside the session (refetch, agent commit, prop). Pending local operations
171
+ * are rebased on it; when they no longer apply, a `rebase` conflict asks the user what to keep.
172
+ */
173
+ receive: (artifact: Artifact) => void;
174
+ private incorporate;
175
+ resolveConflict: (choice: ConflictChoice) => void;
176
+ /**
177
+ * Stops timers and listeners. Buffered typing is still sent unless `discard` is set, so closing the
178
+ * editor right after typing does not lose the last keystrokes.
179
+ */
180
+ dispose(options?: {
181
+ discard?: boolean;
182
+ }): void;
183
+ }
184
+ //# sourceMappingURL=editor-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-session.d.ts","sourceRoot":"","sources":["../src/editor-session.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EACb,aAAa,EACb,KAAK,gBAAgB,EAErB,KAAK,aAAa,EAClB,KAAK,YAAY,EAEjB,KAAK,WAAW,EAEjB,MAAM,iBAAiB,CAAC;AAEzB,gGAAgG;AAChG,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,EAAE,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,8BAA8B;IAC9B,QAAQ,EAAE,QAAQ,CAAC;IACnB,gDAAgD;IAChD,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAClD,yFAAyF;IACzF,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1C,sFAAsF;IACtF,gBAAgB,CA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