@keboola/design 13.0.1 → 13.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.
- package/AGENTS.md +2 -0
- package/CHANGELOG.md +31 -0
- package/README.md +2 -2
- package/dist/{AIKit-VB7CXeQk.js → AIKit-BVCWP9Ks.js} +261 -69
- package/dist/AIKit-BVCWP9Ks.js.map +1 -0
- package/dist/{CodeEditor-jZMw1ioj.js → CodeEditor-Df7VVx08.js} +2 -2
- package/dist/{CodeEditor-jZMw1ioj.js.map → CodeEditor-Df7VVx08.js.map} +1 -1
- package/dist/{ColorModeSwitch-BBzn1D0u.js → ColorModeSwitch-D8Cki137.js} +2 -2
- package/dist/{ColorModeSwitch-BBzn1D0u.js.map → ColorModeSwitch-D8Cki137.js.map} +1 -1
- package/dist/{DropdownMenu-C5FLPkvR.js → DropdownMenu-BJGLjpVc.js} +3 -3
- package/dist/{DropdownMenu-C5FLPkvR.js.map → DropdownMenu-BJGLjpVc.js.map} +1 -1
- package/dist/{SectionNav-BTBiitiQ.js → SectionNav-I2p2uXTd.js} +2 -2
- package/dist/{SectionNav-BTBiitiQ.js.map → SectionNav-I2p2uXTd.js.map} +1 -1
- package/dist/{Sidebar-BTv636Cq.js → Sidebar-D9ytIs8V.js} +2 -2
- package/dist/{Sidebar-BTv636Cq.js.map → Sidebar-D9ytIs8V.js.map} +1 -1
- package/dist/Toast-NrOdDDru.js +76 -0
- package/dist/Toast-NrOdDDru.js.map +1 -0
- package/dist/editors.js +1 -1
- package/dist/index.d.ts +46 -12
- package/dist/index.js +9 -8
- package/dist/internal/blocks/AIKit.js +1 -1
- package/dist/internal/blocks/ColorModeSwitch.js +1 -1
- package/dist/internal/blocks/ExportMenu.js +1 -1
- package/dist/internal/blocks/SectionNav.js +1 -1
- package/dist/internal/blocks/SplitButton.js +1 -1
- package/dist/internal/components/DropdownMenu.js +1 -1
- package/dist/internal/components/Sidebar.js +1 -1
- package/dist/internal/components/Toast.js +1 -1
- package/dist/internal/hooks/useAltDigitHotkey.js +51 -0
- package/dist/internal/hooks/useAltDigitHotkey.js.map +1 -0
- package/dist/markdown-editor.d.ts +22 -1
- package/dist/markdown-editor.js +443 -201
- package/dist/markdown-editor.js.map +1 -1
- package/dist/rjsf.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/AIKit-VB7CXeQk.js.map +0 -1
- package/dist/Toast-PfQf3vj-.js +0 -49
- package/dist/Toast-PfQf3vj-.js.map +0 -1
package/dist/editors.js
CHANGED
|
@@ -5,7 +5,7 @@ import { useStableCallback } from "./internal/hooks/useStableCallback.js";
|
|
|
5
5
|
import { FieldItem, useFieldContext } from "./FieldItem-BHViBJS3.js";
|
|
6
6
|
import { CHANGE_CLASS } from "./internal/components/MergeEditor/constants.js";
|
|
7
7
|
import { resolveToken } from "./themeTokens-7DEab0kp.js";
|
|
8
|
-
import { CodeEditor, LANGUAGE_MODES, buildBaseThemeStyles, buildBasicSetup, buildCanvasChrome, buildChromeStyles, buildCustomTheme, buildDiffWash, isLanguageMode, searchExtension, updateSearch, useThemedExtension, useTooltipsExtension, useVariableCompletion } from "./CodeEditor-
|
|
8
|
+
import { CodeEditor, LANGUAGE_MODES, buildBaseThemeStyles, buildBasicSetup, buildCanvasChrome, buildChromeStyles, buildCustomTheme, buildDiffWash, isLanguageMode, searchExtension, updateSearch, useThemedExtension, useTooltipsExtension, useVariableCompletion } from "./CodeEditor-Df7VVx08.js";
|
|
9
9
|
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
10
10
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { Decoration, EditorView, GutterMarker, ViewPlugin, gutter, gutterLineClass } from "@codemirror/view";
|
package/dist/index.d.ts
CHANGED
|
@@ -5092,9 +5092,13 @@ type Props$7 = {
|
|
|
5092
5092
|
currentStep?: number;
|
|
5093
5093
|
totalSteps?: number;
|
|
5094
5094
|
renderPreview?: (content: string) => ReactNode;
|
|
5095
|
+
/** Focuses the card on mount, unless the focused field already holds text. */
|
|
5096
|
+
autoFocus?: boolean;
|
|
5097
|
+
/** ⌥1–⌥9 picks an option from anywhere on the page, text fields included. */
|
|
5098
|
+
enableShortcuts?: boolean;
|
|
5095
5099
|
className?: string;
|
|
5096
5100
|
};
|
|
5097
|
-
declare const Question: ({ question, header, options, multiSelect, selectedOptionIds, onSelectionChange, customAnswer, onCustomAnswerChange, onCustomAnswerConfirm, showCustomAnswer, customAnswerPlaceholder, showSkip, onSkip, onClose, onNext, submitTooltip, onPrevious, currentStep, totalSteps, renderPreview, className }: Props$7) => import("react").JSX.Element;
|
|
5101
|
+
declare const Question: ({ question, header, options, multiSelect, selectedOptionIds, onSelectionChange, customAnswer, onCustomAnswerChange, onCustomAnswerConfirm, showCustomAnswer, customAnswerPlaceholder, showSkip, onSkip, onClose, onNext, submitTooltip, onPrevious, currentStep, totalSteps, renderPreview, autoFocus, enableShortcuts, className }: Props$7) => import("react").JSX.Element;
|
|
5098
5102
|
//#endregion
|
|
5099
5103
|
//#region src/blocks/AIKit/QuestionBlock.d.ts
|
|
5100
5104
|
type QuestionStep = {
|
|
@@ -5125,9 +5129,11 @@ type Props$122 = {
|
|
|
5125
5129
|
disabled?: boolean;
|
|
5126
5130
|
onClick: () => void;
|
|
5127
5131
|
icon?: ReactNode;
|
|
5132
|
+
/** `bubble`: shaped like a chat message and outlined — a reply waiting to be sent. */
|
|
5133
|
+
variant?: 'row' | 'bubble';
|
|
5128
5134
|
className?: string;
|
|
5129
5135
|
};
|
|
5130
|
-
declare const SuggestedPrompt: ({ label, disabled, onClick, icon, className }: Props$122) => import("react").JSX.Element;
|
|
5136
|
+
declare const SuggestedPrompt: ({ label, disabled, onClick, icon, variant, className }: Props$122) => import("react").JSX.Element;
|
|
5131
5137
|
//#endregion
|
|
5132
5138
|
//#region src/blocks/AIKit/ThinkingIndicator.d.ts
|
|
5133
5139
|
type ThinkingIndicatorProps = {
|
|
@@ -5379,18 +5385,18 @@ declare namespace toast {
|
|
|
5379
5385
|
//#region src/components/Toast/useNotification.d.ts
|
|
5380
5386
|
type Props$111 = {
|
|
5381
5387
|
enabled?: boolean;
|
|
5382
|
-
|
|
5388
|
+
/** Shows the notification again this many ms after the user dismisses it, while still enabled. */
|
|
5389
|
+
remindAfter?: number;
|
|
5390
|
+
} & ToastOptions;
|
|
5383
5391
|
/**
|
|
5384
|
-
*
|
|
5385
|
-
*
|
|
5386
|
-
* Use `Notification` for persistent, system-driven messages that require user acknowledgment
|
|
5387
|
-
* (e.g., trial expiration warnings, upgrade prompts, billing alerts).
|
|
5388
|
-
* The notification stays visible until the user dismisses it or the component unmounts.
|
|
5392
|
+
* A persistent, system-driven notification (trial expiry, upgrade prompt, billing alert).
|
|
5389
5393
|
*
|
|
5390
|
-
*
|
|
5391
|
-
*
|
|
5394
|
+
* - Stays until the user dismisses it or the component unmounts; `toast()` is for transient
|
|
5395
|
+
* feedback after a user action.
|
|
5396
|
+
* - A visible one updates in place when its string `title` or `description` changes; other
|
|
5397
|
+
* options apply the next time it shows.
|
|
5392
5398
|
*/
|
|
5393
|
-
declare const useNotification: ({ enabled, ...toastOptions }: Props$111) => void;
|
|
5399
|
+
declare const useNotification: ({ enabled, remindAfter, ...toastOptions }: Props$111) => void;
|
|
5394
5400
|
//#endregion
|
|
5395
5401
|
//#region src/components/Toast/Toaster.d.ts
|
|
5396
5402
|
type ToasterProps = ComponentProps<typeof Toaster$1>;
|
|
@@ -7190,6 +7196,34 @@ declare const setServerFieldErrors: (form: AnyFormApi, errors: readonly ServerFi
|
|
|
7190
7196
|
*/
|
|
7191
7197
|
declare const setSubmitError: (form: AnyFormApi, message: string) => void;
|
|
7192
7198
|
//#endregion
|
|
7199
|
+
//#region src/hooks/useAltDigitHotkey.d.ts
|
|
7200
|
+
/** The highest digit a numbered option can be picked with. */
|
|
7201
|
+
declare const MAX_DIGIT_HOTKEY = 9;
|
|
7202
|
+
/**
|
|
7203
|
+
* The 1–9 digit a key press names, or `null`.
|
|
7204
|
+
*
|
|
7205
|
+
* - Reads `code`, not `key`: on a Mac ⌥ plus a digit types `¡™£`, and some layouts need ⇧ for digits.
|
|
7206
|
+
* - Top-row and numpad digits both count; `0` does not.
|
|
7207
|
+
*/
|
|
7208
|
+
declare const digitFromKeyCode: (code: string) => number | null;
|
|
7209
|
+
type Options$1 = {
|
|
7210
|
+
/** How many numbered targets there are; digits past it, and past 9, do nothing. */
|
|
7211
|
+
count: number;
|
|
7212
|
+
/** Receives the 0-based index of the digit pressed. */
|
|
7213
|
+
onDigit: (index: number) => void;
|
|
7214
|
+
enabled?: boolean;
|
|
7215
|
+
/** The list's element; while a modal hides it (`aria-hidden`, `inert`), the keys pass through. */
|
|
7216
|
+
ref?: RefObject<HTMLElement | null>;
|
|
7217
|
+
};
|
|
7218
|
+
/**
|
|
7219
|
+
* ⌥1–⌥9 anywhere on the page, text fields included.
|
|
7220
|
+
*
|
|
7221
|
+
* - Prevents the default, so a field focused at the time gets no `¡™£`.
|
|
7222
|
+
* - Skips an event a handler before it already took, so two lists on screen never both fire.
|
|
7223
|
+
* - Leaves numpad digits alone: on Windows ⌥ plus numpad digits types an Alt code.
|
|
7224
|
+
*/
|
|
7225
|
+
declare const useAltDigitHotkey: ({ count, onDigit, enabled, ref }: Options$1) => void;
|
|
7226
|
+
//#endregion
|
|
7193
7227
|
//#region src/hooks/useAutosizeInput.d.ts
|
|
7194
7228
|
type UseAutosizeInputOptions = {
|
|
7195
7229
|
value?: string;
|
|
@@ -7329,5 +7363,5 @@ declare const contrastRatio: (fg: string, bg: string) => number;
|
|
|
7329
7363
|
/** WCAG level for normal-size text at a given ratio. */
|
|
7330
7364
|
declare const wcagLevel: (ratio: number) => 'AAA' | 'AA' | 'fail';
|
|
7331
7365
|
//#endregion
|
|
7332
|
-
export { Alert, AlertModal, AnswerActions, AnswerSummary, type AnswerItem as AnswerSummaryItem, type Props as AnswerSummaryProps, type Variant as AnswerSummaryVariant, AnswerVote, AppShell, type AppShellHeaderSpan, type AppShellSlot, ArgoDesignContext, AuthLayout, type RootProps as AuthLayoutProps, AutoSaveTextarea, Avatar, BLANK_VALUES, Badge, type Brand, BrandEditor, type BrandEditorProps, BrandId, BrandLogo, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, type CalendarProps, Card, type ChangeClassification, ChartPanel, type RootProps$1 as ChartPanelProps, ChatInlineIcon, Checkbox, ChipEditor, type Props$1 as ChipEditorProps, Clipboard, ClipboardButton, ClipboardInline, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, ColorModeSwitch, ColorScheme, type ColorSlot, Combobox, ComboboxField, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, CopyField, DEFAULT_COLOR_SCHEME, DEFAULT_FALLBACK_FONT, DEFAULT_FONT_OPTIONS, DEFAULT_BRAND_ID as DEFAULT_KEBOOLA_BRAND_ID, DEFAULT_WORKBENCH_BAR_HEIGHT_IN_REM, DEFAULT_WORKBENCH_PANEL_HEIGHT_IN_PX, DIAGRAM_LANGUAGES, DashboardHero, type RootProps$2 as DashboardHeroProps, DateInput, DatePicker, type DateRange, DateRangeInput, DateRangePicker, type DateRangePreset, DiagramSkeleton, type DiffChunk, type DiffInformation, type DiffRow, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, type RootProps$3 as EmptyStateProps, type Variant$1 as EmptyStateVariant, ErrorState, type RootProps$4 as ErrorStateProps, type Variant$2 as ErrorStateVariant, ExportMenu, ExportMenuItem, FileDownloadChip, FileUpload, type FileUploadAccept, type FileUploadRejection, type FileUploadRejectionCode, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, GoogleButton, HINT_UNDERLINE_CLASS_NAME, HelpBlock, HoverCard, InlineStepDetail, type Props$2 as InlineStepDetailProps, InlineStepGroup, type Props$3 as InlineStepGroupProps, InlineStepLabel, type Props$4 as InlineStepLabelProps, type Variant$3 as InlineStepLabelVariant, InputGroup, Kbd, Label, type LineInformation, Link, MIN_WORKBENCH_PANEL_HEIGHT_IN_PX, Markdown, MarkdownTable, MarkedText, type MergeConflict, MessageBubble, MicrosoftButton, Modal, MultiActionButtonGroup, MultiCombobox, MultiComboboxField, Navbar, NumberInput, OtpInput, type RootProps$5 as OtpInputProps, type OtpInputRenderSlotProps, PROMPT_INPUT_CONTAINER, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, type PanelImperativeHandle, PanelWithDetails, PasswordInput, PlanApproval, type PlanApprovalProps, type PlanApprovalStatus, PlanRewritingIndicator, type PlanRewritingIndicatorProps, Popconfirm, Popover, Progress, type PromptCommand, PromptInput, Props$5 as Props, Question, type QuestionAnswers, QuestionBlock, type Props$6 as QuestionBlockProps, type QuestionOption, type Props$7 as QuestionProps, type QuestionStep, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS, RadioGroup, type RadiusSize, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResolvedColorScheme, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, SectionNav, type SectionNavGroup, type SectionNavItem, type SectionNavItemRenderProps, Select, SelectItem, SelectItemGroup, SelectProps, Separator, type ServerFieldError, Sheet, type SideInformation, Sidebar, type SidebarMode, SidebarProvider, type SidebarSide, type SidebarSlot, Skeleton, SkeletonList, Slider, Slot, SplitButton, SpotlightBackdrop, SpotlightTarget, StatCard, StatCardGrid, type Props$8 as StatCardGridProps, type RootProps$6 as StatCardProps, type TrendDirection as StatCardTrendDirection, type TrendProps as StatCardTrendProps, type StepStatus, Stepper, type StepperOrientation, SuggestedPrompt, Switch, Table, type TableSortDirection, Tabs, TabsContent, TargetRect, TextInput, Textarea, Theme, ThemeProvider, ThemeScope, ThinkingIndicator, type ThinkingIndicatorProps, ThumbTooltipFn, TimeInput, TimePicker, Timeline, type ToastOptions, Toaster, Toggle, ToggleGroup, Tokens, ToolCallApproval, type ToolCallApprovalProps, type ToolCallApprovalStatus, ToolCallChip, type ToolCallChipProps, type ToolCallState, type ToolCallStatus, ToolCallStatusHeader, type Props$9 as ToolCallStatusHeaderProps, Tooltip, type Props$10 as TooltipProps, TooltipProvider, type Trigger, Truncated, UsageBar, UsageStats, UsageStatsRing, UseAutosizeInputOptions, UseAutosizeInputReturn, type ValidityState, type WithAccessibleName, type WordInformation, Workbench, type WorkbenchState, ZoomableSvg, agnes, appShellSlotSelector, argoVariants, brandSchema, channelsToHex, clampPercentage, cn, computeDiffRows, computeLineInformation, contrastRatio, copyToClipboard, defaultFilter, exampleCustomer, filterByWords, findLiteralMatches, findMentionToken, findSlashToken, formatPercentage, forwardAccessibleName, getChatInlineIconName, harbor, hasLiteralMatch, hexToChannels, isMac, kbdVariants, keboola, keboolaLegacySidebar, keys, matchByWords, mergeRefs, namedLabel, setServerFieldErrors, setSubmitError, svgToPngBlob, tableAriaSort, toSvgFileContent, toast, useAppForm, useArgoDesign, useAutosizeInput, useCommandState, useDefaultLayout, useFileDropTarget, useFileUploadRejections, useMergeDiff, useNotification, useOptionalSidebar, useScrollbarPosition, useSidebar, useStableCallback, useTargetRect, useTheme, useThemeScopeContainer, useWorkbench, wcagLevel, withBlankValues, withForm };
|
|
7366
|
+
export { Alert, AlertModal, AnswerActions, AnswerSummary, type AnswerItem as AnswerSummaryItem, type Props as AnswerSummaryProps, type Variant as AnswerSummaryVariant, AnswerVote, AppShell, type AppShellHeaderSpan, type AppShellSlot, ArgoDesignContext, AuthLayout, type RootProps as AuthLayoutProps, AutoSaveTextarea, Avatar, BLANK_VALUES, Badge, type Brand, BrandEditor, type BrandEditorProps, BrandId, BrandLogo, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, type CalendarProps, Card, type ChangeClassification, ChartPanel, type RootProps$1 as ChartPanelProps, ChatInlineIcon, Checkbox, ChipEditor, type Props$1 as ChipEditorProps, Clipboard, ClipboardButton, ClipboardInline, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, ColorModeSwitch, ColorScheme, type ColorSlot, Combobox, ComboboxField, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, CopyField, DEFAULT_COLOR_SCHEME, DEFAULT_FALLBACK_FONT, DEFAULT_FONT_OPTIONS, DEFAULT_BRAND_ID as DEFAULT_KEBOOLA_BRAND_ID, DEFAULT_WORKBENCH_BAR_HEIGHT_IN_REM, DEFAULT_WORKBENCH_PANEL_HEIGHT_IN_PX, DIAGRAM_LANGUAGES, DashboardHero, type RootProps$2 as DashboardHeroProps, DateInput, DatePicker, type DateRange, DateRangeInput, DateRangePicker, type DateRangePreset, DiagramSkeleton, type DiffChunk, type DiffInformation, type DiffRow, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, type RootProps$3 as EmptyStateProps, type Variant$1 as EmptyStateVariant, ErrorState, type RootProps$4 as ErrorStateProps, type Variant$2 as ErrorStateVariant, ExportMenu, ExportMenuItem, FileDownloadChip, FileUpload, type FileUploadAccept, type FileUploadRejection, type FileUploadRejectionCode, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, GoogleButton, HINT_UNDERLINE_CLASS_NAME, HelpBlock, HoverCard, InlineStepDetail, type Props$2 as InlineStepDetailProps, InlineStepGroup, type Props$3 as InlineStepGroupProps, InlineStepLabel, type Props$4 as InlineStepLabelProps, type Variant$3 as InlineStepLabelVariant, InputGroup, Kbd, Label, type LineInformation, Link, MAX_DIGIT_HOTKEY, MIN_WORKBENCH_PANEL_HEIGHT_IN_PX, Markdown, MarkdownTable, MarkedText, type MergeConflict, MessageBubble, MicrosoftButton, Modal, MultiActionButtonGroup, MultiCombobox, MultiComboboxField, Navbar, NumberInput, OtpInput, type RootProps$5 as OtpInputProps, type OtpInputRenderSlotProps, PROMPT_INPUT_CONTAINER, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, type PanelImperativeHandle, PanelWithDetails, PasswordInput, PlanApproval, type PlanApprovalProps, type PlanApprovalStatus, PlanRewritingIndicator, type PlanRewritingIndicatorProps, Popconfirm, Popover, Progress, type PromptCommand, PromptInput, Props$5 as Props, Question, type QuestionAnswers, QuestionBlock, type Props$6 as QuestionBlockProps, type QuestionOption, type Props$7 as QuestionProps, type QuestionStep, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS, RadioGroup, type RadiusSize, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResolvedColorScheme, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, SectionNav, type SectionNavGroup, type SectionNavItem, type SectionNavItemRenderProps, Select, SelectItem, SelectItemGroup, SelectProps, Separator, type ServerFieldError, Sheet, type SideInformation, Sidebar, type SidebarMode, SidebarProvider, type SidebarSide, type SidebarSlot, Skeleton, SkeletonList, Slider, Slot, SplitButton, SpotlightBackdrop, SpotlightTarget, StatCard, StatCardGrid, type Props$8 as StatCardGridProps, type RootProps$6 as StatCardProps, type TrendDirection as StatCardTrendDirection, type TrendProps as StatCardTrendProps, type StepStatus, Stepper, type StepperOrientation, SuggestedPrompt, Switch, Table, type TableSortDirection, Tabs, TabsContent, TargetRect, TextInput, Textarea, Theme, ThemeProvider, ThemeScope, ThinkingIndicator, type ThinkingIndicatorProps, ThumbTooltipFn, TimeInput, TimePicker, Timeline, type ToastOptions, Toaster, Toggle, ToggleGroup, Tokens, ToolCallApproval, type ToolCallApprovalProps, type ToolCallApprovalStatus, ToolCallChip, type ToolCallChipProps, type ToolCallState, type ToolCallStatus, ToolCallStatusHeader, type Props$9 as ToolCallStatusHeaderProps, Tooltip, type Props$10 as TooltipProps, TooltipProvider, type Trigger, Truncated, UsageBar, UsageStats, UsageStatsRing, UseAutosizeInputOptions, UseAutosizeInputReturn, type ValidityState, type WithAccessibleName, type WordInformation, Workbench, type WorkbenchState, ZoomableSvg, agnes, appShellSlotSelector, argoVariants, brandSchema, channelsToHex, clampPercentage, cn, computeDiffRows, computeLineInformation, contrastRatio, copyToClipboard, defaultFilter, digitFromKeyCode, exampleCustomer, filterByWords, findLiteralMatches, findMentionToken, findSlashToken, formatPercentage, forwardAccessibleName, getChatInlineIconName, harbor, hasLiteralMatch, hexToChannels, isMac, kbdVariants, keboola, keboolaLegacySidebar, keys, matchByWords, mergeRefs, namedLabel, setServerFieldErrors, setSubmitError, svgToPngBlob, tableAriaSort, toSvgFileContent, toast, useAltDigitHotkey, useAppForm, useArgoDesign, useAutosizeInput, useCommandState, useDefaultLayout, useFileDropTarget, useFileUploadRejections, useMergeDiff, useNotification, useOptionalSidebar, useScrollbarPosition, useSidebar, useStableCallback, useTargetRect, useTheme, useThemeScopeContainer, useWorkbench, wcagLevel, withBlankValues, withForm };
|
|
7333
7367
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { findLiteralMatches, hasLiteralMatch } from "./findLiteralMatches-DgGLzy
|
|
|
6
6
|
import { mergeRefs } from "./internal/utils/mergeRefs.js";
|
|
7
7
|
import { Button, ButtonInline, argoVariants } from "./Button-B21oVcPU.js";
|
|
8
8
|
import { ButtonGroup } from "./internal/components/ButtonGroup.js";
|
|
9
|
-
import { DropdownMenu } from "./DropdownMenu-
|
|
9
|
+
import { DropdownMenu } from "./DropdownMenu-BJGLjpVc.js";
|
|
10
10
|
import { ScrollArea, ScrollBar } from "./internal/components/ScrollArea.js";
|
|
11
11
|
import { SplitButton } from "./internal/blocks/SplitButton.js";
|
|
12
12
|
import { MultiActionButtonGroup } from "./MultiActionButtonGroup-AWLj1Tg7.js";
|
|
@@ -57,7 +57,7 @@ import { ComboboxField } from "./internal/blocks/Form/connectors/ComboboxField.j
|
|
|
57
57
|
import { MultiComboboxField } from "./internal/blocks/Form/connectors/MultiComboboxField.js";
|
|
58
58
|
import { ChipEditor } from "./internal/blocks/ChipEditor.js";
|
|
59
59
|
import { AutoSaveTextarea } from "./AutoSaveTextarea-C5iIr2Ts.js";
|
|
60
|
-
import { ColorModeSwitch } from "./ColorModeSwitch-
|
|
60
|
+
import { ColorModeSwitch } from "./ColorModeSwitch-D8Cki137.js";
|
|
61
61
|
import { DateInput } from "./DateInput-D0nWUasV.js";
|
|
62
62
|
import { PasswordInput } from "./internal/blocks/PasswordInput.js";
|
|
63
63
|
import { TimeInput } from "./internal/blocks/TimeInput.js";
|
|
@@ -66,15 +66,17 @@ import { OtpInput, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND
|
|
|
66
66
|
import { SearchInput } from "./SearchInput-D3qMkHaW.js";
|
|
67
67
|
import { SearchInputWithNavigation } from "./internal/blocks/SearchInputWithNavigation.js";
|
|
68
68
|
import { FileUpload, useFileDropTarget, useFileUploadRejections } from "./FileUpload-Ch2hrIWq.js";
|
|
69
|
-
import { AnswerActions, AnswerSummary, ChatInlineIcon, CollapsibleStepHeader, DIAGRAM_LANGUAGES, FileDownloadChip, InlineStepDetail, InlineStepGroup, InlineStepLabel, Markdown, MarkdownTable, MessageBubble, PROMPT_INPUT_CONTAINER, PlanApproval, PlanRewritingIndicator, PromptInput, Question, QuestionBlock, SuggestedPrompt, ThinkingIndicator, ToolCallApproval, ToolCallChip, ToolCallStatusHeader, UsageBar, UsageStats, UsageStatsRing, clampPercentage, findMentionToken, findSlashToken, formatPercentage, getChatInlineIconName } from "./AIKit-
|
|
69
|
+
import { AnswerActions, AnswerSummary, ChatInlineIcon, CollapsibleStepHeader, DIAGRAM_LANGUAGES, FileDownloadChip, InlineStepDetail, InlineStepGroup, InlineStepLabel, Markdown, MarkdownTable, MessageBubble, PROMPT_INPUT_CONTAINER, PlanApproval, PlanRewritingIndicator, PromptInput, Question, QuestionBlock, SuggestedPrompt, ThinkingIndicator, ToolCallApproval, ToolCallChip, ToolCallStatusHeader, UsageBar, UsageStats, UsageStatsRing, clampPercentage, findMentionToken, findSlashToken, formatPercentage, getChatInlineIconName } from "./AIKit-BVCWP9Ks.js";
|
|
70
70
|
import { Table, tableAriaSort } from "./Table-BaVT5Tkn.js";
|
|
71
71
|
import { Skeleton } from "./internal/components/Skeleton/Skeleton.js";
|
|
72
72
|
import { DiagramSkeleton } from "./internal/blocks/DiagramShared/DiagramSkeleton.js";
|
|
73
|
+
import { Kbd, kbdVariants, keys } from "./Kbd-J4n1J6i4.js";
|
|
73
74
|
import { Progress } from "./internal/components/Progress.js";
|
|
75
|
+
import { MAX_DIGIT_HOTKEY, digitFromKeyCode, useAltDigitHotkey } from "./internal/hooks/useAltDigitHotkey.js";
|
|
74
76
|
import { Collapsible } from "./Collapsible-BQXWEOBC.js";
|
|
75
77
|
import { Alert } from "./Alert-UI-CIs-1.js";
|
|
76
78
|
import { toast } from "./toast-CyXEdaCZ.js";
|
|
77
|
-
import { Toaster, useNotification } from "./Toast-
|
|
79
|
+
import { Toaster, useNotification } from "./Toast-NrOdDDru.js";
|
|
78
80
|
import { EmptySearchContent } from "./internal/components/EmptySearchContent.js";
|
|
79
81
|
import { Card } from "./Card-BQmBWHXl.js";
|
|
80
82
|
import { EmptyConfigurationActionCard } from "./internal/blocks/EmptyConfigurationActionCard.js";
|
|
@@ -91,9 +93,9 @@ import { AuthLayout } from "./internal/blocks/AuthLayout.js";
|
|
|
91
93
|
import { PageLayout } from "./PageLayout-DiAAILuS.js";
|
|
92
94
|
import { PageHeader } from "./PageHeader-CgfyXpf1.js";
|
|
93
95
|
import { PageToolbar } from "./PageToolbar-C06RKIif.js";
|
|
94
|
-
import { SectionNav } from "./SectionNav-
|
|
96
|
+
import { SectionNav } from "./SectionNav-I2p2uXTd.js";
|
|
95
97
|
import { ResizableHandle, ResizablePanel, ResizablePanelGroup, useDefaultLayout } from "./Resizable-D3vYToZH.js";
|
|
96
|
-
import { Sidebar, SidebarProvider, useOptionalSidebar, useSidebar } from "./Sidebar-
|
|
98
|
+
import { Sidebar, SidebarProvider, useOptionalSidebar, useSidebar } from "./Sidebar-D9ytIs8V.js";
|
|
97
99
|
import { useScrollbarPosition } from "./internal/hooks/useScrollbarPosition.js";
|
|
98
100
|
import { Navbar } from "./Navbar-B_DNpv5s.js";
|
|
99
101
|
import { DEFAULT_WORKBENCH_BAR_HEIGHT_IN_REM, DEFAULT_WORKBENCH_PANEL_HEIGHT_IN_PX, MIN_WORKBENCH_PANEL_HEIGHT_IN_PX, Workbench, useWorkbench } from "./Workbench-DmZzpkj7.js";
|
|
@@ -103,7 +105,6 @@ import { Stepper } from "./Stepper-BLkLhfnd.js";
|
|
|
103
105
|
import { Timeline } from "./Timeline-B-I6sb0M.js";
|
|
104
106
|
import { Avatar } from "./internal/components/Avatar.js";
|
|
105
107
|
import { MarkedText } from "./MarkedText-DlmlJO0u.js";
|
|
106
|
-
import { Kbd, kbdVariants, keys } from "./Kbd-J4n1J6i4.js";
|
|
107
108
|
import { Pagination } from "./Pagination-DH3f6LN0.js";
|
|
108
109
|
import { DiffType, DiffView, computeDiffRows, computeLineInformation } from "./DiffView-ppTIzh2h.js";
|
|
109
110
|
import { PaneHeader } from "./internal/components/MergeEditor/PaneHeader.js";
|
|
@@ -117,4 +118,4 @@ import { useAutosizeInput } from "./internal/hooks/useAutosizeInput.js";
|
|
|
117
118
|
import { ZoomableSvg, svgToPngBlob, toSvgFileContent } from "./ZoomableSvg-C65nta_r.js";
|
|
118
119
|
import { BrandEditor, DEFAULT_FALLBACK_FONT, DEFAULT_FONT_OPTIONS, channelsToHex, contrastRatio, hexToChannels, wcagLevel } from "./BrandEditor-P8OZX2hi.js";
|
|
119
120
|
import { Slot } from "@radix-ui/react-slot";
|
|
120
|
-
export { Alert, AlertModal, AnswerActions, AnswerSummary, AppShell, ArgoDesignContext, AuthLayout, AutoSaveTextarea, Avatar, BLANK_VALUES, Badge, BrandEditor, BrandLogo, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, Card, ChartPanel, ChatInlineIcon, Checkbox, ChipEditor, Clipboard, ClipboardButton, ClipboardInline, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, ColorModeSwitch, Combobox, ComboboxField, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, CopyField, DEFAULT_COLOR_SCHEME, DEFAULT_FALLBACK_FONT, DEFAULT_FONT_OPTIONS, DEFAULT_BRAND_ID as DEFAULT_KEBOOLA_BRAND_ID, DEFAULT_WORKBENCH_BAR_HEIGHT_IN_REM, DEFAULT_WORKBENCH_PANEL_HEIGHT_IN_PX, DIAGRAM_LANGUAGES, DashboardHero, DateInput, DatePicker, DateRangeInput, DateRangePicker, DiagramSkeleton, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, ErrorState, ExportMenu, FileDownloadChip, FileUpload, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, GoogleButton, HINT_UNDERLINE_CLASS_NAME, HelpBlock, HoverCard, InlineStepDetail, InlineStepGroup, InlineStepLabel, InputGroup, Kbd, Label, Link, MIN_WORKBENCH_PANEL_HEIGHT_IN_PX, Markdown, MarkdownTable, MarkedText, MessageBubble, MicrosoftButton, Modal, MultiActionButtonGroup, MultiCombobox, MultiComboboxField, Navbar, NumberInput, OtpInput, PROMPT_INPUT_CONTAINER, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, PanelWithDetails, PasswordInput, PlanApproval, PlanRewritingIndicator, Popconfirm, Popover, Progress, PromptInput, Question, QuestionBlock, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS, RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, SectionNav, Select, Separator, Sheet, Sidebar, SidebarProvider, Skeleton, SkeletonList, Slider, Slot, SplitButton, SpotlightBackdrop, StatCard, StatCardGrid, Stepper, SuggestedPrompt, Switch, Table, Tabs, TabsContent, TextInput, Textarea, ThemeProvider, ThemeScope, ThinkingIndicator, TimeInput, TimePicker, Timeline, Toaster, Toggle, ToggleGroup, ToolCallApproval, ToolCallChip, ToolCallStatusHeader, Tooltip, TooltipProvider, Truncated, UsageBar, UsageStats, UsageStatsRing, Workbench, ZoomableSvg, agnes, appShellSlotSelector, argoVariants, brandSchema, channelsToHex, clampPercentage, cn, computeDiffRows, computeLineInformation, contrastRatio, copyToClipboard, defaultFilter, exampleCustomer, filterByWords, findLiteralMatches, findMentionToken, findSlashToken, formatPercentage, forwardAccessibleName, getChatInlineIconName, harbor, hasLiteralMatch, hexToChannels, isMac, kbdVariants, keboola, keboolaLegacySidebar, keys, matchByWords, mergeRefs, namedLabel, setServerFieldErrors, setSubmitError, svgToPngBlob, tableAriaSort, toSvgFileContent, toast, useAppForm, useArgoDesign, useAutosizeInput, useCommandState, useDefaultLayout, useFileDropTarget, useFileUploadRejections, useMergeDiff, useNotification, useOptionalSidebar, useScrollbarPosition, useSidebar, useStableCallback, useTargetRect, useTheme, useThemeScopeContainer, useWorkbench, wcagLevel, withBlankValues, withForm };
|
|
121
|
+
export { Alert, AlertModal, AnswerActions, AnswerSummary, AppShell, ArgoDesignContext, AuthLayout, AutoSaveTextarea, Avatar, BLANK_VALUES, Badge, BrandEditor, BrandLogo, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, Card, ChartPanel, ChatInlineIcon, Checkbox, ChipEditor, Clipboard, ClipboardButton, ClipboardInline, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, ColorModeSwitch, Combobox, ComboboxField, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, CopyField, DEFAULT_COLOR_SCHEME, DEFAULT_FALLBACK_FONT, DEFAULT_FONT_OPTIONS, DEFAULT_BRAND_ID as DEFAULT_KEBOOLA_BRAND_ID, DEFAULT_WORKBENCH_BAR_HEIGHT_IN_REM, DEFAULT_WORKBENCH_PANEL_HEIGHT_IN_PX, DIAGRAM_LANGUAGES, DashboardHero, DateInput, DatePicker, DateRangeInput, DateRangePicker, DiagramSkeleton, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, ErrorState, ExportMenu, FileDownloadChip, FileUpload, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, GoogleButton, HINT_UNDERLINE_CLASS_NAME, HelpBlock, HoverCard, InlineStepDetail, InlineStepGroup, InlineStepLabel, InputGroup, Kbd, Label, Link, MAX_DIGIT_HOTKEY, MIN_WORKBENCH_PANEL_HEIGHT_IN_PX, Markdown, MarkdownTable, MarkedText, MessageBubble, MicrosoftButton, Modal, MultiActionButtonGroup, MultiCombobox, MultiComboboxField, Navbar, NumberInput, OtpInput, PROMPT_INPUT_CONTAINER, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, PanelWithDetails, PasswordInput, PlanApproval, PlanRewritingIndicator, Popconfirm, Popover, Progress, PromptInput, Question, QuestionBlock, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS, RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, SectionNav, Select, Separator, Sheet, Sidebar, SidebarProvider, Skeleton, SkeletonList, Slider, Slot, SplitButton, SpotlightBackdrop, StatCard, StatCardGrid, Stepper, SuggestedPrompt, Switch, Table, Tabs, TabsContent, TextInput, Textarea, ThemeProvider, ThemeScope, ThinkingIndicator, TimeInput, TimePicker, Timeline, Toaster, Toggle, ToggleGroup, ToolCallApproval, ToolCallChip, ToolCallStatusHeader, Tooltip, TooltipProvider, Truncated, UsageBar, UsageStats, UsageStatsRing, Workbench, ZoomableSvg, agnes, appShellSlotSelector, argoVariants, brandSchema, channelsToHex, clampPercentage, cn, computeDiffRows, computeLineInformation, contrastRatio, copyToClipboard, defaultFilter, digitFromKeyCode, exampleCustomer, filterByWords, findLiteralMatches, findMentionToken, findSlashToken, formatPercentage, forwardAccessibleName, getChatInlineIconName, harbor, hasLiteralMatch, hexToChannels, isMac, kbdVariants, keboola, keboolaLegacySidebar, keys, matchByWords, mergeRefs, namedLabel, setServerFieldErrors, setSubmitError, svgToPngBlob, tableAriaSort, toSvgFileContent, toast, useAltDigitHotkey, useAppForm, useArgoDesign, useAutosizeInput, useCommandState, useDefaultLayout, useFileDropTarget, useFileUploadRejections, useMergeDiff, useNotification, useOptionalSidebar, useScrollbarPosition, useSidebar, useStableCallback, useTargetRect, useTheme, useThemeScopeContainer, useWorkbench, wcagLevel, withBlankValues, withForm };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AnswerActions, AnswerSummary, ChatInlineIcon, CollapsibleStepHeader, DIAGRAM_LANGUAGES, FileDownloadChip, InlineStepDetail, InlineStepGroup, InlineStepLabel, Markdown, MarkdownTable, MessageBubble, PROMPT_INPUT_CONTAINER, PlanApproval, PlanRewritingIndicator, PromptInput, Question, QuestionBlock, SuggestedPrompt, ThinkingIndicator, ToolCallApproval, ToolCallChip, ToolCallStatusHeader, UsageBar, UsageStats, UsageStatsRing, clampPercentage, findMentionToken, findSlashToken, formatPercentage, getChatInlineIconName } from "../../AIKit-
|
|
1
|
+
import { AnswerActions, AnswerSummary, ChatInlineIcon, CollapsibleStepHeader, DIAGRAM_LANGUAGES, FileDownloadChip, InlineStepDetail, InlineStepGroup, InlineStepLabel, Markdown, MarkdownTable, MessageBubble, PROMPT_INPUT_CONTAINER, PlanApproval, PlanRewritingIndicator, PromptInput, Question, QuestionBlock, SuggestedPrompt, ThinkingIndicator, ToolCallApproval, ToolCallChip, ToolCallStatusHeader, UsageBar, UsageStats, UsageStatsRing, clampPercentage, findMentionToken, findSlashToken, formatPercentage, getChatInlineIconName } from "../../AIKit-BVCWP9Ks.js";
|
|
2
2
|
export { AnswerActions, AnswerSummary, ChatInlineIcon, CollapsibleStepHeader, DIAGRAM_LANGUAGES, FileDownloadChip, InlineStepDetail, InlineStepGroup, InlineStepLabel, Markdown, MarkdownTable, MessageBubble, PROMPT_INPUT_CONTAINER, PlanApproval, PlanRewritingIndicator, PromptInput, Question, QuestionBlock, SuggestedPrompt, ThinkingIndicator, ToolCallApproval, ToolCallChip, ToolCallStatusHeader, UsageBar, UsageStats, UsageStatsRing, clampPercentage, findMentionToken, findSlashToken, formatPercentage, getChatInlineIconName };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ColorModeSwitch } from "../../ColorModeSwitch-
|
|
1
|
+
import { ColorModeSwitch } from "../../ColorModeSwitch-D8Cki137.js";
|
|
2
2
|
export { ColorModeSwitch };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Tooltip } from "../../utils-Bd28bWgm.js";
|
|
2
2
|
import { Download } from "../../icons-wcA70iQx.js";
|
|
3
3
|
import { Button } from "../../Button-B21oVcPU.js";
|
|
4
|
-
import { DropdownMenu } from "../../DropdownMenu-
|
|
4
|
+
import { DropdownMenu } from "../../DropdownMenu-BJGLjpVc.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/blocks/ExportMenu/ExportMenu.tsx
|
|
7
7
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SectionNav } from "../../SectionNav-
|
|
1
|
+
import { SectionNav } from "../../SectionNav-I2p2uXTd.js";
|
|
2
2
|
export { SectionNav };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChevronDown } from "../../icons-wcA70iQx.js";
|
|
2
2
|
import { Button } from "../../Button-B21oVcPU.js";
|
|
3
3
|
import { ButtonGroup } from "../components/ButtonGroup.js";
|
|
4
|
-
import { DropdownMenu } from "../../DropdownMenu-
|
|
4
|
+
import { DropdownMenu } from "../../DropdownMenu-BJGLjpVc.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/blocks/SplitButton/SplitButton.tsx
|
|
7
7
|
const iconSizeMap = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DropdownMenu } from "../../DropdownMenu-
|
|
1
|
+
import { DropdownMenu } from "../../DropdownMenu-BJGLjpVc.js";
|
|
2
2
|
export { DropdownMenu };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Sidebar, SidebarProvider, useOptionalSidebar, useSidebar } from "../../Sidebar-
|
|
1
|
+
import { Sidebar, SidebarProvider, useOptionalSidebar, useSidebar } from "../../Sidebar-D9ytIs8V.js";
|
|
2
2
|
export { Sidebar, SidebarProvider, useOptionalSidebar, useSidebar };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useStableCallback } from "./useStableCallback.js";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
//#region src/hooks/useAltDigitHotkey.ts
|
|
4
|
+
const DIGIT_CODE = /^(?:Digit|Numpad)([1-9])$/;
|
|
5
|
+
/** The highest digit a numbered option can be picked with. */
|
|
6
|
+
const MAX_DIGIT_HOTKEY = 9;
|
|
7
|
+
/**
|
|
8
|
+
* The 1–9 digit a key press names, or `null`.
|
|
9
|
+
*
|
|
10
|
+
* - Reads `code`, not `key`: on a Mac ⌥ plus a digit types `¡™£`, and some layouts need ⇧ for digits.
|
|
11
|
+
* - Top-row and numpad digits both count; `0` does not.
|
|
12
|
+
*/
|
|
13
|
+
const digitFromKeyCode = (code) => {
|
|
14
|
+
const match = DIGIT_CODE.exec(code);
|
|
15
|
+
return match ? Number(match[1]) : null;
|
|
16
|
+
};
|
|
17
|
+
/** ⌥ (Alt) alone: ⌘, Ctrl and ⇧ are someone else's, and Windows sends AltGr as Ctrl+Alt. */
|
|
18
|
+
const isAltOnly = (event) => event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey;
|
|
19
|
+
/**
|
|
20
|
+
* ⌥1–⌥9 anywhere on the page, text fields included.
|
|
21
|
+
*
|
|
22
|
+
* - Prevents the default, so a field focused at the time gets no `¡™£`.
|
|
23
|
+
* - Skips an event a handler before it already took, so two lists on screen never both fire.
|
|
24
|
+
* - Leaves numpad digits alone: on Windows ⌥ plus numpad digits types an Alt code.
|
|
25
|
+
*/
|
|
26
|
+
const useAltDigitHotkey = ({ count, onDigit, enabled = true, ref }) => {
|
|
27
|
+
const handleDigit = useStableCallback(onDigit);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!enabled || count === 0) return;
|
|
30
|
+
const handleKeyDown = (event) => {
|
|
31
|
+
if (event.defaultPrevented || event.repeat || !isAltOnly(event)) return;
|
|
32
|
+
if (event.location === KeyboardEvent.DOM_KEY_LOCATION_NUMPAD) return;
|
|
33
|
+
if (ref?.current?.closest("[aria-hidden=\"true\"], [inert]")) return;
|
|
34
|
+
const digit = digitFromKeyCode(event.code);
|
|
35
|
+
if (digit === null || digit > Math.min(count, 9)) return;
|
|
36
|
+
event.preventDefault();
|
|
37
|
+
handleDigit(digit - 1);
|
|
38
|
+
};
|
|
39
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
40
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
41
|
+
}, [
|
|
42
|
+
count,
|
|
43
|
+
enabled,
|
|
44
|
+
handleDigit,
|
|
45
|
+
ref
|
|
46
|
+
]);
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { MAX_DIGIT_HOTKEY, digitFromKeyCode, useAltDigitHotkey };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=useAltDigitHotkey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAltDigitHotkey.js","names":[],"sources":["../../../src/hooks/useAltDigitHotkey.ts"],"sourcesContent":["import { type RefObject, useEffect } from 'react';\n\nimport { useStableCallback } from './useStableCallback';\n\nconst DIGIT_CODE = /^(?:Digit|Numpad)([1-9])$/;\n\n/** The highest digit a numbered option can be picked with. */\nexport const MAX_DIGIT_HOTKEY = 9;\n\n/**\n * The 1–9 digit a key press names, or `null`.\n *\n * - Reads `code`, not `key`: on a Mac ⌥ plus a digit types `¡™£`, and some layouts need ⇧ for digits.\n * - Top-row and numpad digits both count; `0` does not.\n */\nexport const digitFromKeyCode = (code: string): number | null => {\n const match = DIGIT_CODE.exec(code);\n return match ? Number(match[1]) : null;\n};\n\n/** ⌥ (Alt) alone: ⌘, Ctrl and ⇧ are someone else's, and Windows sends AltGr as Ctrl+Alt. */\nconst isAltOnly = (event: KeyboardEvent) =>\n event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey;\n\ntype Options = {\n /** How many numbered targets there are; digits past it, and past 9, do nothing. */\n count: number;\n /** Receives the 0-based index of the digit pressed. */\n onDigit: (index: number) => void;\n enabled?: boolean;\n /** The list's element; while a modal hides it (`aria-hidden`, `inert`), the keys pass through. */\n ref?: RefObject<HTMLElement | null>;\n};\n\n/**\n * ⌥1–⌥9 anywhere on the page, text fields included.\n *\n * - Prevents the default, so a field focused at the time gets no `¡™£`.\n * - Skips an event a handler before it already took, so two lists on screen never both fire.\n * - Leaves numpad digits alone: on Windows ⌥ plus numpad digits types an Alt code.\n */\nexport const useAltDigitHotkey = ({ count, onDigit, enabled = true, ref }: Options) => {\n const handleDigit = useStableCallback(onDigit);\n\n useEffect(() => {\n if (!enabled || count === 0) return;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.defaultPrevented || event.repeat || !isAltOnly(event)) return;\n if (event.location === KeyboardEvent.DOM_KEY_LOCATION_NUMPAD) return;\n if (ref?.current?.closest('[aria-hidden=\"true\"], [inert]')) return;\n const digit = digitFromKeyCode(event.code);\n if (digit === null || digit > Math.min(count, MAX_DIGIT_HOTKEY)) return;\n event.preventDefault();\n handleDigit(digit - 1);\n };\n\n window.addEventListener('keydown', handleKeyDown);\n return () => window.removeEventListener('keydown', handleKeyDown);\n }, [count, enabled, handleDigit, ref]);\n};\n"],"mappings":";;;AAIA,MAAM,aAAa;;AAGnB,MAAa,mBAAmB;;;;;;;AAQhC,MAAa,oBAAoB,SAAgC;CAC/D,MAAM,QAAQ,WAAW,KAAK,IAAI;CAClC,OAAO,QAAQ,OAAO,MAAM,EAAE,IAAI;AACpC;;AAGA,MAAM,aAAa,UACjB,MAAM,UAAU,CAAC,MAAM,WAAW,CAAC,MAAM,WAAW,CAAC,MAAM;;;;;;;;AAmB7D,MAAa,qBAAqB,EAAE,OAAO,SAAS,UAAU,MAAM,UAAmB;CACrF,MAAM,cAAc,kBAAkB,OAAO;CAE7C,gBAAgB;EACd,IAAI,CAAC,WAAW,UAAU,GAAG;EAE7B,MAAM,iBAAiB,UAAyB;GAC9C,IAAI,MAAM,oBAAoB,MAAM,UAAU,CAAC,UAAU,KAAK,GAAG;GACjE,IAAI,MAAM,aAAa,cAAc,yBAAyB;GAC9D,IAAI,KAAK,SAAS,QAAQ,iCAA+B,GAAG;GAC5D,MAAM,QAAQ,iBAAiB,MAAM,IAAI;GACzC,IAAI,UAAU,QAAQ,QAAQ,KAAK,IAAI,OAAA,CAAuB,GAAG;GACjE,MAAM,eAAe;GACrB,YAAY,QAAQ,CAAC;EACvB;EAEA,OAAO,iBAAiB,WAAW,aAAa;EAChD,aAAa,OAAO,oBAAoB,WAAW,aAAa;CAClE,GAAG;EAAC;EAAO;EAAS;EAAa;CAAG,CAAC;AACvC"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
+
//#region src/blocks/MarkdownEditor/plugins/ToolbarPlugin.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* How the toolbar is presented.
|
|
5
|
+
*
|
|
6
|
+
* - `floating`: a popup over the selection, portalled to `document.body`.
|
|
7
|
+
* - `fixed`: a static bar at the top of the editor, visible with no selection.
|
|
8
|
+
*/
|
|
9
|
+
type ToolbarMode = 'floating' | 'fixed';
|
|
10
|
+
//#endregion
|
|
2
11
|
//#region src/blocks/MarkdownEditor/MarkdownEditor.d.ts
|
|
3
12
|
type MarkdownEditorProps = {
|
|
4
13
|
/** Markdown string (controlled) */
|
|
@@ -27,6 +36,8 @@ type MarkdownEditorProps = {
|
|
|
27
36
|
alt: string;
|
|
28
37
|
}) => ReactNode;
|
|
29
38
|
showToolbar?: boolean;
|
|
39
|
+
/** How `showToolbar` presents the toolbar. Defaults to `floating`. */
|
|
40
|
+
toolbarMode?: ToolbarMode;
|
|
30
41
|
/**
|
|
31
42
|
* No prose wrapper, min-height or padding — blends into surrounding text for inline editing.
|
|
32
43
|
* Set typography via `className`.
|
|
@@ -46,8 +57,18 @@ type MarkdownEditorProps = {
|
|
|
46
57
|
* Ignored in `compact` mode.
|
|
47
58
|
*/
|
|
48
59
|
minRows?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Typed and pasted URLs and emails become links, and export as typed (`a_b`, not `a\_b`).
|
|
62
|
+
* Ignored with `singleLine`.
|
|
63
|
+
*/
|
|
64
|
+
autoLink?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* A plain-text paste is read as markdown (fences, lists, tables) instead of one paragraph per
|
|
67
|
+
* line. HTML pastes are unchanged. Ignored with `singleLine`.
|
|
68
|
+
*/
|
|
69
|
+
pasteMarkdown?: boolean;
|
|
49
70
|
};
|
|
50
|
-
declare const MarkdownEditor: ({ value, onChange, readOnly, placeholder, autoFocus, disabled, onSave, onCancel, onImageUpload, className, imageRenderer, showToolbar, compact, saveOnBlur, singleLine, clampDisplay, minRows }: MarkdownEditorProps) => import("react").JSX.Element;
|
|
71
|
+
declare const MarkdownEditor: ({ value, onChange, readOnly, placeholder, autoFocus, disabled, onSave, onCancel, onImageUpload, className, imageRenderer, showToolbar, toolbarMode, compact, saveOnBlur, singleLine, clampDisplay, minRows, autoLink, pasteMarkdown }: MarkdownEditorProps) => import("react").JSX.Element;
|
|
51
72
|
//#endregion
|
|
52
73
|
export { MarkdownEditor, type MarkdownEditorProps };
|
|
53
74
|
//# sourceMappingURL=markdown-editor.d.ts.map
|