@artkit-ai/react 0.0.0-stage → 0.2.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.
- package/LICENSE +202 -0
- package/README.md +145 -2
- package/dist/cache.d.ts +31 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +95 -0
- package/dist/cache.js.map +1 -0
- package/dist/client.d.ts +68 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +233 -0
- package/dist/client.js.map +1 -0
- package/dist/components/card.d.ts +22 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +16 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/editor.d.ts +41 -0
- package/dist/components/editor.d.ts.map +1 -0
- package/dist/components/editor.js +111 -0
- package/dist/components/editor.js.map +1 -0
- package/dist/components/icons.d.ts +8 -0
- package/dist/components/icons.d.ts.map +1 -0
- package/dist/components/icons.js +14 -0
- package/dist/components/icons.js.map +1 -0
- package/dist/components/panel.d.ts +31 -0
- package/dist/components/panel.d.ts.map +1 -0
- package/dist/components/panel.js +132 -0
- package/dist/components/panel.js.map +1 -0
- package/dist/components/shared.d.ts +67 -0
- package/dist/components/shared.d.ts.map +1 -0
- package/dist/components/shared.js +100 -0
- package/dist/components/shared.js.map +1 -0
- package/dist/components/view.d.ts +39 -0
- package/dist/components/view.d.ts.map +1 -0
- package/dist/components/view.js +76 -0
- package/dist/components/view.js.map +1 -0
- package/dist/context.d.ts +64 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +13 -0
- package/dist/context.js.map +1 -0
- package/dist/controls.d.ts +145 -0
- package/dist/controls.d.ts.map +1 -0
- package/dist/controls.js +188 -0
- package/dist/controls.js.map +1 -0
- package/dist/download.d.ts +4 -0
- package/dist/download.d.ts.map +1 -0
- package/dist/download.js +20 -0
- package/dist/download.js.map +1 -0
- package/dist/editor-session.d.ts +96 -0
- package/dist/editor-session.d.ts.map +1 -0
- package/dist/editor-session.js +192 -0
- package/dist/editor-session.js.map +1 -0
- package/dist/hooks.d.ts +64 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +205 -0
- package/dist/hooks.js.map +1 -0
- package/dist/i18n.d.ts +135 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +145 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/kit-css.d.ts +3 -0
- package/dist/kit-css.d.ts.map +1 -0
- package/dist/kit-css.js +5 -0
- package/dist/kit-css.js.map +1 -0
- package/dist/partial-json.d.ts +8 -0
- package/dist/partial-json.d.ts.map +1 -0
- package/dist/partial-json.js +176 -0
- package/dist/partial-json.js.map +1 -0
- package/dist/provider.d.ts +42 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +95 -0
- package/dist/provider.js.map +1 -0
- package/dist/styles.d.ts +25 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +203 -0
- package/dist/styles.js.map +1 -0
- package/dist/toolbar.d.ts +90 -0
- package/dist/toolbar.d.ts.map +1 -0
- package/dist/toolbar.js +233 -0
- package/dist/toolbar.js.map +1 -0
- package/package.json +50 -3
- package/src/cache.ts +109 -0
- package/src/client.ts +342 -0
- package/src/components/card.tsx +86 -0
- package/src/components/editor.tsx +292 -0
- package/src/components/icons.tsx +14 -0
- package/src/components/panel.tsx +334 -0
- package/src/components/shared.tsx +198 -0
- package/src/components/view.tsx +196 -0
- package/src/context.ts +87 -0
- package/src/controls.tsx +587 -0
- package/src/download.ts +23 -0
- package/src/editor-session.ts +260 -0
- package/src/hooks.ts +296 -0
- package/src/i18n.ts +155 -0
- package/src/index.ts +128 -0
- package/src/kit-css.ts +5 -0
- package/src/partial-json.ts +160 -0
- package/src/provider.tsx +176 -0
- package/src/styles.ts +222 -0
- 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,QA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K,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,cAAc,GAAG,YAAY,CAMtF;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,EACR,SAAS,GACV,EAAE,qBAAqB,GAAG,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"}
|
package/dist/controls.js
ADDED
|
@@ -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,CAAC,IAAI,CAAC,CAAC;AAczF,MAAM,UAAU,MAAM,CAAC,EACrB,IAAI,EAAE,IAAI,EACV,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,IAAI,EACX,OAAO,EACP,SAAS,EACT,QAAQ,EACR,IAAI,GAAG,QAAQ,EACf,GAAG,IAAI,EACK;IACZ,OAAO,CACL,kBACE,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,gBAAgB,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,kBAC/C,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,eAC9C,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,KACvC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,KAC1D,IAAI,aAEP,IAAI,CAAC,CAAC,CAAC,KAAC,IAAI,mBAAa,MAAM,GAAG,C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AAY;+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"}
|
package/dist/download.js
ADDED
|
@@ -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,96 @@
|
|
|
1
|
+
import { type Artifact, type ArtifactRegistry, type ChangeSummary, type LintIssue } from '@artkit-ai/core';
|
|
2
|
+
/**
|
|
3
|
+
* Local draft of one artifact (spec §11.6). The editor never talks to the server while the user edits: every batch is
|
|
4
|
+
* applied here, with the same pure engine as the server (`applyOperations`), and kept until the application saves.
|
|
5
|
+
* Saving is the application's decision: the editor emits the draft and the application persists it (or not).
|
|
6
|
+
*/
|
|
7
|
+
export interface DraftSnapshot {
|
|
8
|
+
/** Version of the artifact the draft started from (the last one the application loaded or saved). */
|
|
9
|
+
baseVersion: number;
|
|
10
|
+
/** The draft as the user sees it. */
|
|
11
|
+
artifact: Artifact;
|
|
12
|
+
/** Operations applied since `baseVersion`, in order. */
|
|
13
|
+
operations: unknown[];
|
|
14
|
+
/** True when the draft differs from the base. */
|
|
15
|
+
dirty: boolean;
|
|
16
|
+
canUndo: boolean;
|
|
17
|
+
canRedo: boolean;
|
|
18
|
+
/** An edit is being applied. */
|
|
19
|
+
pending: boolean;
|
|
20
|
+
/** Last rejected batch, cleared by the next accepted one. */
|
|
21
|
+
error?: {
|
|
22
|
+
code: string;
|
|
23
|
+
message: string;
|
|
24
|
+
issues: {
|
|
25
|
+
path: string;
|
|
26
|
+
message: string;
|
|
27
|
+
hint?: string;
|
|
28
|
+
}[];
|
|
29
|
+
};
|
|
30
|
+
/** Lint issues of the draft. */
|
|
31
|
+
lint: LintIssue[];
|
|
32
|
+
/** Changes of the last accepted batch. */
|
|
33
|
+
changes: ChangeSummary[];
|
|
34
|
+
}
|
|
35
|
+
export interface DraftSessionOptions {
|
|
36
|
+
registry: ArtifactRegistry;
|
|
37
|
+
artifact: Artifact;
|
|
38
|
+
/** Locale of the model-facing messages produced by the engine (pt-BR or en). */
|
|
39
|
+
locale?: string;
|
|
40
|
+
/** Times within which consecutive typing batches share one undo step. */
|
|
41
|
+
coalesceMs?: number;
|
|
42
|
+
/** Undo steps kept in memory. */
|
|
43
|
+
maxUndo?: number;
|
|
44
|
+
now?: () => number;
|
|
45
|
+
}
|
|
46
|
+
export interface EmitOptions {
|
|
47
|
+
/** Continuous gestures (typing, dragging) share one undo step; discrete changes always get their own. */
|
|
48
|
+
kind?: 'typing' | 'continuous' | 'discrete';
|
|
49
|
+
}
|
|
50
|
+
type Listener = () => void;
|
|
51
|
+
/** Draft of one artifact with local undo and redo. Batches are applied in order, one at a time. */
|
|
52
|
+
export declare class DraftSession {
|
|
53
|
+
private readonly registry;
|
|
54
|
+
private readonly locale;
|
|
55
|
+
private readonly coalesceMs;
|
|
56
|
+
private readonly maxUndo;
|
|
57
|
+
private readonly now;
|
|
58
|
+
private base;
|
|
59
|
+
private current;
|
|
60
|
+
private undoStack;
|
|
61
|
+
private redoStack;
|
|
62
|
+
private queue;
|
|
63
|
+
private pending;
|
|
64
|
+
private error;
|
|
65
|
+
private lint;
|
|
66
|
+
private changes;
|
|
67
|
+
private snapshot;
|
|
68
|
+
private readonly listeners;
|
|
69
|
+
private disposed;
|
|
70
|
+
constructor(options: DraftSessionOptions);
|
|
71
|
+
/** The current snapshot. Its identity changes only when the state changes. */
|
|
72
|
+
getSnapshot: () => DraftSnapshot;
|
|
73
|
+
subscribe: (listener: Listener) => (() => void);
|
|
74
|
+
/**
|
|
75
|
+
* Applies a batch to the draft. Resolves to `true` when the batch was accepted. A rejected batch leaves the draft
|
|
76
|
+
* untouched and sets `snapshot.error`.
|
|
77
|
+
*/
|
|
78
|
+
apply(operations: unknown[], options?: EmitOptions): Promise<boolean>;
|
|
79
|
+
/** Steps back one edit (local). Returns false when there is nothing to undo. */
|
|
80
|
+
undo(): boolean;
|
|
81
|
+
/** Steps forward after an undo. Returns false when there is nothing to redo. */
|
|
82
|
+
redo(): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Adopts an artifact loaded or saved by the application. A clean draft follows the new artifact. A draft that has
|
|
85
|
+
* changes keeps its content, and the base moves to the new version so the next save is a complete one.
|
|
86
|
+
*/
|
|
87
|
+
load(artifact: Artifact): void;
|
|
88
|
+
/** Stops the session: later batches are ignored and listeners are dropped. */
|
|
89
|
+
dispose(): void;
|
|
90
|
+
private restore;
|
|
91
|
+
private lintOf;
|
|
92
|
+
private publish;
|
|
93
|
+
private buildSnapshot;
|
|
94
|
+
}
|
|
95
|
+
export {};
|
|
96
|
+
//# 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,EAEb,KAAK,gBAAgB,EAErB,KAAK,aAAa,EAElB,KAAK,SAAS,EACf,MAAM,iBAAiB,CAAC;AAEzB;;;;GAIG;AAEH,MAAM,WAAW,aAAa;IAC5B,qGAAqG;IACrG,WAAW,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,QAAQ,EAAE,QAAQ,CAAC;IACnB,wDAAwD;IACxD,UAAU,EAAE,OAAO,EAAE,CAAC;IACtB,iDAAiD;IACjD,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,CAAC;IACtG,gCAAgC;IAChC,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,0CAA0C;IAC1C,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iCAAiC;I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