@qalma/kit 0.3.0 → 0.5.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/README.md +196 -0
- package/fesm2022/qalma-kit-headless.mjs +932 -0
- package/fesm2022/qalma-kit-headless.mjs.map +1 -0
- package/fesm2022/qalma-kit.mjs +93 -1148
- package/fesm2022/qalma-kit.mjs.map +1 -1
- package/package.json +5 -1
- package/types/qalma-kit-headless.d.ts +303 -0
- package/types/qalma-kit-headless.d.ts.map +1 -0
- package/types/qalma-kit.d.ts +36 -319
- package/types/qalma-kit.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qalma-kit.mjs","sources":["../../../../libs/ui-kit/src/lib/cn.ts","../../../../libs/ui-kit/src/lib/button.ts","../../../../libs/ui-kit/src/lib/toolbar-button.ts","../../../../libs/ui-kit/src/lib/toolbar-commands.ts","../../../../libs/ui-kit/src/lib/toolbar-registry.ts","../../../../libs/ui-kit/src/lib/toolbar-icons.ts","../../../../libs/ui-kit/src/lib/anchor-to-rect.ts","../../../../libs/ui-kit/src/lib/dismissible-overlay.ts","../../../../libs/ui-kit/src/lib/keyboard-navigable-list.ts","../../../../libs/ui-kit/src/lib/drag-handle-controller.ts","../../../../libs/ui-kit/src/lib/drag-handle-directive.ts","../../../../libs/ui-kit/src/lib/drag-handle.ts","../../../../libs/ui-kit/src/lib/flip-above-placement.ts","../../../../libs/ui-kit/src/lib/suggestion-menu-base.ts","../../../../libs/ui-kit/src/lib/mention-menu.ts","../../../../libs/ui-kit/src/lib/slash-command-menu.ts","../../../../libs/ui-kit/src/lib/link-popover.model.ts","../../../../libs/ui-kit/src/lib/link-popover-controller.ts","../../../../libs/ui-kit/src/lib/link-popover.ts","../../../../libs/ui-kit/src/lib/contextual-toolbar.ts","../../../../libs/ui-kit/src/lib/selection-toolbar-controller.ts","../../../../libs/ui-kit/src/lib/selection-toolbar-directive.ts","../../../../libs/ui-kit/src/qalma-kit.ts"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","import { Directive, ElementRef, computed, inject, input } from '@angular/core';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from './cn';\n\nexport const buttonVariants = cva(\n 'inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_ng-icon]:shrink-0',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/90',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n outline:\n 'border border-border bg-card text-foreground hover:bg-secondary hover:text-secondary-foreground',\n ghost:\n 'text-foreground hover:bg-secondary hover:text-secondary-foreground',\n accent: 'bg-accent text-accent-foreground hover:bg-accent/90',\n link: 'text-accent underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2',\n sm: 'h-8 rounded-md px-3 text-xs',\n lg: 'h-11 rounded-md px-6 text-base',\n icon: 'h-9 w-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nexport type ButtonVariant = NonNullable<\n VariantProps<typeof buttonVariants>['variant']\n>;\nexport type ButtonSize = NonNullable<\n VariantProps<typeof buttonVariants>['size']\n>;\n\n/**\n * Headless-styled button directive so it composes onto native `<button>` and\n * `<a>` elements while reading from the host's Tailwind design tokens.\n */\n@Directive({\n selector: 'button[qalmaBtn], a[qalmaBtn]',\n host: {\n '[class]': 'computedClass()',\n },\n})\nexport class QalmaButton {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly initialClass =\n this.host.nativeElement.getAttribute('class') ?? '';\n\n readonly variant = input<ButtonVariant>('default');\n readonly size = input<ButtonSize>('default');\n\n protected readonly computedClass = computed(() =>\n cn(\n buttonVariants({ variant: this.variant(), size: this.size() }),\n this.initialClass,\n ),\n );\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { NgIcon } from '@ng-icons/core';\nimport { QalmaCommand } from '@qalma/editor';\n\n/**\n * Default styling for a toolbar command button. Icon-only, square, and driven\n * entirely by the host's shadcn-style design tokens (`text-muted-foreground`,\n * `bg-secondary`, `bg-accent-subtle`…) so it themes with the surrounding app.\n * The `qalma-command-active` class is toggled by the `QalmaCommand` directive\n * when the underlying command is active.\n */\nexport const TOOLBAR_BUTTON_CLASS =\n 'inline-flex h-[1.85rem] w-[1.85rem] cursor-pointer items-center justify-center rounded-[0.4rem] border border-transparent text-muted-foreground transition hover:bg-secondary hover:text-foreground disabled:cursor-not-allowed disabled:opacity-45 [&.qalma-command-active]:border-accent/40 [&.qalma-command-active]:bg-accent-subtle [&.qalma-command-active]:text-accent';\n\n/**\n * Generic, declarative toolbar button for a single editor command.\n *\n * Renders a native `<button>` wired to the `QalmaCommand` directive (execute /\n * active / disabled / aria) with an `<ng-icon>`, so a whole toolbar becomes a\n * list of `<qalma-toolbar-button command icon label />` instead of the\n * six-line `<button qalmaCommand><ng-icon></button>` block repeated per\n * command. The host uses `display: contents` so the inner button participates\n * directly in the surrounding toolbar's flex layout.\n *\n * Icons resolve from the `NgIcon` provider scope of the surrounding component\n * (register them with `provideIcons({ … })` as usual).\n */\n@Component({\n selector: 'qalma-toolbar-button',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgIcon, QalmaCommand],\n host: {\n class: 'contents',\n },\n template: `\n <button\n type=\"button\"\n [qalmaCommand]=\"command()\"\n [qalmaCommandValue]=\"value()\"\n [class]=\"buttonClass\"\n [title]=\"label()\"\n [attr.aria-label]=\"label()\"\n >\n <ng-icon [class]=\"iconClass()\" [name]=\"icon()\" aria-hidden=\"true\" />\n </button>\n `,\n})\nexport class QalmaToolbarButton {\n /** Command name to execute, e.g. `toggleBold`. */\n readonly command = input.required<string>();\n /** Optional command payload (forwarded to `qalmaCommandValue`). */\n readonly value = input<unknown>();\n /** Lucide (or any registered) icon name, e.g. `lucideBold`. */\n readonly icon = input.required<string>();\n /** Accessible name — used for both `title` and `aria-label`. */\n readonly label = input.required<string>();\n /** Optional icon-size class override (default: `text-[0.9rem]`). */\n readonly iconClass = input('text-[0.9rem]');\n\n protected readonly buttonClass = TOOLBAR_BUTTON_CLASS;\n}\n","import type { TemplateRef } from '@angular/core';\n\n/**\n * A single command button in a toolbar registry: which editor command to run,\n * which icon to show, and its accessible label. `value` is forwarded to the\n * command as its payload when present.\n */\nexport interface ToolbarCommandItem {\n readonly command: string;\n readonly icon: string;\n readonly label: string;\n readonly value?: unknown;\n}\n\n/**\n * An escape hatch for controls that are not a plain command button (color\n * pickers, upload buttons, a language `<select>`…). The consumer supplies an\n * `<ng-template>` and the toolbar renders it inline at this position.\n */\nexport interface ToolbarTemplateItem {\n readonly template: TemplateRef<unknown>;\n}\n\nexport type ToolbarItem = ToolbarCommandItem | ToolbarTemplateItem;\n\n/** One separator-delimited run of items. Empty groups render nothing. */\nexport type ToolbarGroup = readonly ToolbarItem[];\n\nexport function isToolbarCommandItem(\n item: ToolbarItem,\n): item is ToolbarCommandItem {\n return 'command' in item;\n}\n\n// ---------------------------------------------------------------------------\n// Default command fragments — the declarative source of truth for the standard\n// editor toolbar, reusable across consumers (playground, sandbox, downstream\n// apps). Compose them into `ToolbarGroup[]` and hand them to\n// `<qalma-toolbar-registry>`; interleave custom controls with `ToolbarTemplateItem`.\n// ---------------------------------------------------------------------------\n\nexport const QALMA_TOOLBAR_HEADINGS: readonly ToolbarCommandItem[] = [\n { command: 'setParagraph', icon: 'lucidePilcrow', label: 'Paragraph' },\n { command: 'toggleHeading1', icon: 'lucideHeading1', label: 'Heading 1' },\n { command: 'toggleHeading2', icon: 'lucideHeading2', label: 'Heading 2' },\n { command: 'toggleHeading3', icon: 'lucideHeading3', label: 'Heading 3' },\n];\n\nexport const QALMA_TOOLBAR_INLINE_MARKS: readonly ToolbarCommandItem[] = [\n { command: 'toggleBold', icon: 'lucideBold', label: 'Bold' },\n { command: 'toggleItalic', icon: 'lucideItalic', label: 'Italic' },\n { command: 'toggleUnderline', icon: 'lucideUnderline', label: 'Underline' },\n {\n command: 'toggleStrike',\n icon: 'lucideStrikethrough',\n label: 'Strikethrough',\n },\n { command: 'toggleInlineCode', icon: 'lucideCode', label: 'Inline code' },\n { command: 'toggleMonospace', icon: 'lucideLetterText', label: 'Monospace' },\n { command: 'toggleSubscript', icon: 'lucideSubscript', label: 'Subscript' },\n {\n command: 'toggleSuperscript',\n icon: 'lucideSuperscript',\n label: 'Superscript',\n },\n];\n\nexport const QALMA_TOOLBAR_ALIGN: readonly ToolbarCommandItem[] = [\n { command: 'setTextAlignLeft', icon: 'lucideAlignLeft', label: 'Align left' },\n {\n command: 'setTextAlignCenter',\n icon: 'lucideAlignCenter',\n label: 'Align center',\n },\n {\n command: 'setTextAlignRight',\n icon: 'lucideAlignRight',\n label: 'Align right',\n },\n {\n command: 'setTextAlignJustify',\n icon: 'lucideAlignJustify',\n label: 'Justify',\n },\n];\n\nexport const QALMA_TOOLBAR_LISTS: readonly ToolbarCommandItem[] = [\n { command: 'toggleBulletList', icon: 'lucideList', label: 'Bullet list' },\n {\n command: 'toggleOrderedList',\n icon: 'lucideListOrdered',\n label: 'Ordered list',\n },\n { command: 'toggleTaskList', icon: 'lucideListTodo', label: 'Task list' },\n { command: 'liftListItem', icon: 'lucideOutdent', label: 'Outdent' },\n { command: 'sinkListItem', icon: 'lucideIndent', label: 'Indent' },\n { command: 'toggleBlockquote', icon: 'lucideTextQuote', label: 'Blockquote' },\n { command: 'toggleCodeBlock', icon: 'lucideSquareCode', label: 'Code block' },\n];\n\n/** Always-available table entry point (inserting a new table). */\nexport const QALMA_TOOLBAR_TABLE_INSERT: ToolbarCommandItem = {\n command: 'insertTable',\n icon: 'lucideTable',\n label: 'Insert table',\n};\n\n/** Table editing commands — only meaningful while the selection is in a table. */\nexport const QALMA_TOOLBAR_TABLE_OPS: readonly ToolbarCommandItem[] = [\n {\n command: 'addRowAfter',\n icon: 'lucideBetweenHorizontalEnd',\n label: 'Add row',\n },\n {\n command: 'addColumnAfter',\n icon: 'lucideBetweenVerticalEnd',\n label: 'Add column',\n },\n { command: 'deleteRow', icon: 'lucideRows3', label: 'Delete row' },\n { command: 'deleteColumn', icon: 'lucideColumns3', label: 'Delete column' },\n {\n command: 'toggleHeaderRow',\n icon: 'lucideHeading',\n label: 'Toggle header row',\n },\n { command: 'deleteTable', icon: 'lucideTrash2', label: 'Delete table' },\n];\n\nexport const QALMA_TOOLBAR_HISTORY: readonly ToolbarCommandItem[] = [\n { command: 'undo', icon: 'lucideUndo2', label: 'Undo' },\n { command: 'redo', icon: 'lucideRedo2', label: 'Redo' },\n];\n\n/** Standalone command that usually sits alongside the color controls. */\nexport const QALMA_TOOLBAR_CLEAR_FORMATTING: ToolbarCommandItem = {\n command: 'clearFormatting',\n icon: 'lucideEraser',\n label: 'Clear formatting',\n};\n\n/** Standalone command that usually sits alongside the link/insert controls. */\nexport const QALMA_TOOLBAR_UNSET_LINK: ToolbarCommandItem = {\n command: 'unsetLink',\n icon: 'lucideUnlink',\n label: 'Unlink',\n};\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n computed,\n input,\n} from '@angular/core';\n\nimport { QalmaToolbarButton } from './toolbar-button';\nimport {\n ToolbarCommandItem,\n ToolbarGroup,\n ToolbarItem,\n ToolbarTemplateItem,\n isToolbarCommandItem,\n} from './toolbar-commands';\n\n/** Vertical divider rendered between non-empty toolbar groups. */\nexport const TOOLBAR_SEPARATOR_CLASS =\n 'mx-0.5 h-5 w-px shrink-0 self-center bg-border';\n\n/**\n * Renders a declarative toolbar registry: an ordered list of groups, each a\n * list of command buttons and/or inline custom-control templates, with a\n * separator drawn between non-empty groups.\n *\n * Meant to sit inside the editor's `<qalma-toolbar>` (which owns the\n * `role=\"toolbar\"` semantics); the host uses `display: contents` so the\n * rendered buttons participate directly in that container's flex layout.\n *\n * ```html\n * <qalma-toolbar class=\"flex …\">\n * <ng-template #colors> … custom controls … </ng-template>\n * <qalma-toolbar-registry [groups]=\"[headings, marks, [{ template: colors }]]\" />\n * </qalma-toolbar>\n * ```\n */\n@Component({\n selector: 'qalma-toolbar-registry',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, QalmaToolbarButton],\n host: {\n class: 'contents',\n },\n template: `\n @for (group of visibleGroups(); track $index; let first = $first) {\n @if (!first) {\n <span [class]=\"separatorClass()\" aria-hidden=\"true\"></span>\n }\n @for (item of group; track $index) {\n @if (asCommand(item); as command) {\n <qalma-toolbar-button\n [command]=\"command.command\"\n [value]=\"command.value\"\n [icon]=\"command.icon\"\n [label]=\"command.label\"\n />\n } @else {\n <ng-container [ngTemplateOutlet]=\"asTemplate(item)\" />\n }\n }\n }\n `,\n})\nexport class QalmaToolbarRegistry {\n readonly groups = input.required<readonly ToolbarGroup[]>();\n readonly separatorClass = input(TOOLBAR_SEPARATOR_CLASS);\n\n /** Drop empty groups so they neither render content nor a dangling separator. */\n protected readonly visibleGroups = computed(() =>\n this.groups().filter((group) => group.length > 0),\n );\n\n protected asCommand(item: ToolbarItem): ToolbarCommandItem | null {\n return isToolbarCommandItem(item) ? item : null;\n }\n\n protected asTemplate(item: ToolbarItem): TemplateRef<unknown> {\n return (item as ToolbarTemplateItem).template;\n }\n}\n","import { provideIcons } from '@ng-icons/core';\nimport {\n lucideAlignCenter,\n lucideAlignJustify,\n lucideAlignLeft,\n lucideAlignRight,\n lucideBetweenHorizontalEnd,\n lucideBetweenVerticalEnd,\n lucideBold,\n lucideCode,\n lucideColumns3,\n lucideEraser,\n lucideHeading,\n lucideHeading1,\n lucideHeading2,\n lucideHeading3,\n lucideIndent,\n lucideItalic,\n lucideLetterText,\n lucideList,\n lucideListOrdered,\n lucideListTodo,\n lucideOutdent,\n lucidePilcrow,\n lucideRedo2,\n lucideRows3,\n lucideSquareCode,\n lucideStrikethrough,\n lucideSubscript,\n lucideSuperscript,\n lucideTable,\n lucideTextQuote,\n lucideTrash2,\n lucideUnderline,\n lucideUndo2,\n lucideUnlink,\n} from '@ng-icons/lucide';\n\n/**\n * Registers the Lucide icons referenced by the default toolbar command\n * fragments (`QALMA_TOOLBAR_*`), so consumers can wire the standard toolbar\n * without re-declaring the icon set:\n *\n * ```ts\n * providers: [provideQalmaToolbarIcons()]\n * ```\n *\n * Add your own `provideIcons({ … })` alongside it for any custom controls\n * (color pickers, upload buttons…) that live outside the command registry.\n */\nexport function provideQalmaToolbarIcons() {\n return provideIcons({\n lucideAlignCenter,\n lucideAlignJustify,\n lucideAlignLeft,\n lucideAlignRight,\n lucideBetweenHorizontalEnd,\n lucideBetweenVerticalEnd,\n lucideBold,\n lucideCode,\n lucideColumns3,\n lucideEraser,\n lucideHeading,\n lucideHeading1,\n lucideHeading2,\n lucideHeading3,\n lucideIndent,\n lucideItalic,\n lucideLetterText,\n lucideList,\n lucideListOrdered,\n lucideListTodo,\n lucideOutdent,\n lucidePilcrow,\n lucideRedo2,\n lucideRows3,\n lucideSquareCode,\n lucideStrikethrough,\n lucideSubscript,\n lucideSuperscript,\n lucideTable,\n lucideTextQuote,\n lucideTrash2,\n lucideUnderline,\n lucideUndo2,\n lucideUnlink,\n });\n}\n","export interface AnchorRect {\n readonly top: number;\n readonly bottom: number;\n readonly left: number;\n readonly right: number;\n}\n\nexport interface AnchorSize {\n readonly width: number;\n readonly height: number;\n}\n\nexport type AnchorPlacement = 'top' | 'bottom' | 'left' | 'right';\nexport type AnchorAlign = 'start' | 'center' | 'end';\n\nexport interface AnchorToRectOptions {\n /** Which side of the anchor rect the floating element renders on. */\n readonly placement: AnchorPlacement;\n /** Rect (viewport or scroll surface) the result is clamped within. */\n readonly boundary: AnchorRect;\n /** Size of the floating element being positioned. */\n readonly size: AnchorSize;\n /** Distance between the anchor rect and the floating element. Default 8. */\n readonly gap?: number;\n /** Minimum distance kept from the boundary edges. Default 8. */\n readonly edgeMargin?: number;\n /**\n * Cross-axis alignment relative to the anchor rect. `start` | `center` |\n * `end` align to the anchor rect itself; a number instead pins the\n * floating element's center to that viewport coordinate (clamped within\n * the anchor rect), e.g. to follow a pointer's Y while hovering a tall\n * block. Defaults to `start`.\n */\n readonly align?: AnchorAlign | number;\n}\n\nexport interface AnchorPosition {\n readonly top: number;\n readonly left: number;\n}\n\nconst DEFAULT_GAP = 8;\nconst DEFAULT_EDGE_MARGIN = 8;\n\nexport function anchorToRect(\n anchor: AnchorRect,\n options: AnchorToRectOptions,\n): AnchorPosition {\n const gap = options.gap ?? DEFAULT_GAP;\n const edgeMargin = options.edgeMargin ?? DEFAULT_EDGE_MARGIN;\n const { boundary, size } = options;\n\n if (options.placement === 'left' || options.placement === 'right') {\n const mainAxis =\n options.placement === 'left'\n ? anchor.left - gap - size.width\n : anchor.right + gap;\n const crossAxis = resolveCrossAxis(\n options.align,\n anchor.top,\n anchor.bottom,\n size.height,\n );\n\n return {\n left: clamp(\n mainAxis,\n boundary.left + edgeMargin,\n boundary.right - edgeMargin - size.width,\n ),\n top: clamp(\n crossAxis,\n boundary.top + edgeMargin,\n boundary.bottom - edgeMargin - size.height,\n ),\n };\n }\n\n const mainAxis =\n options.placement === 'bottom'\n ? anchor.bottom + gap\n : anchor.top - gap - size.height;\n const crossAxis = resolveCrossAxis(\n options.align,\n anchor.left,\n anchor.right,\n size.width,\n );\n\n return {\n top: clamp(\n mainAxis,\n boundary.top + edgeMargin,\n boundary.bottom - edgeMargin - size.height,\n ),\n left: clamp(\n crossAxis,\n boundary.left + edgeMargin,\n boundary.right - edgeMargin - size.width,\n ),\n };\n}\n\nfunction resolveCrossAxis(\n align: AnchorAlign | number | undefined,\n start: number,\n end: number,\n size: number,\n): number {\n const span = end - start;\n\n if (size >= span) {\n // The floating element doesn't fit within the anchor (e.g. a\n // single-line block shorter than the button anchored to it). Center it\n // instead of clamping to an arbitrary edge.\n return start + span / 2 - size / 2;\n }\n\n if (typeof align === 'number') {\n return clamp(align - size / 2, start, end - size);\n }\n\n switch (align) {\n case 'end':\n return end - size;\n case 'center':\n return start + (end - start) / 2 - size / 2;\n case 'start':\n default:\n return start;\n }\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n const lo = Math.min(min, max);\n const hi = Math.max(min, max);\n\n return Math.min(Math.max(value, lo), hi);\n}\n","import type { DestroyRef } from '@angular/core';\n\nexport interface DismissibleOverlayOptions {\n /** Returns true when the event target is part of the overlay/trigger and should not dismiss it. */\n isInside: (target: EventTarget | null) => boolean;\n onDismiss: () => void;\n}\n\n/**\n * Shared outside-click / Escape dismiss behavior for floating overlays\n * (popovers, contextual menus, autocomplete lists). Generalizes the\n * ad-hoc click-outside/Escape handling that used to be reimplemented\n * separately per feature.\n */\nexport class DismissibleOverlay {\n private readonly pointerDown = (event: PointerEvent): void => {\n if (!this.options.isInside(event.target)) {\n this.options.onDismiss();\n }\n };\n\n private readonly keydown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') {\n this.options.onDismiss();\n }\n };\n\n constructor(private readonly options: DismissibleOverlayOptions) {}\n\n connect(destroyRef: DestroyRef): void {\n document.addEventListener('pointerdown', this.pointerDown, true);\n document.addEventListener('keydown', this.keydown);\n\n destroyRef.onDestroy(() => {\n document.removeEventListener('pointerdown', this.pointerDown, true);\n document.removeEventListener('keydown', this.keydown);\n });\n }\n}\n","export interface KeyboardNavigableListOptions<T> {\n items: () => readonly T[];\n activeIndex: () => number;\n setActiveIndex: (index: number) => void;\n onSelect: (item: T, index: number) => void;\n}\n\n/**\n * Arrow-key navigation + Enter-to-select for autocomplete-style popovers\n * (mention menu, slash command menu). Shared so both features stop\n * reimplementing the same wrap-around index math.\n *\n * Takes a plain key string rather than a `KeyboardEvent` — some callers\n * relay keys through a `CustomEvent` (no real `KeyboardEvent` to read),\n * so preventing the default action is left to the caller.\n */\nexport class KeyboardNavigableList<T> {\n constructor(private readonly options: KeyboardNavigableListOptions<T>) {}\n\n /** Returns true when the key was handled (caller should stop further propagation / preventDefault). */\n handleKey(key: string): boolean {\n const items = this.options.items();\n\n if (items.length === 0) {\n return false;\n }\n\n switch (key) {\n case 'ArrowDown':\n this.options.setActiveIndex(\n (this.options.activeIndex() + 1) % items.length,\n );\n\n return true;\n case 'ArrowUp':\n this.options.setActiveIndex(\n (this.options.activeIndex() - 1 + items.length) % items.length,\n );\n\n return true;\n case 'Enter': {\n const index = this.options.activeIndex();\n const item = items[index];\n\n if (item === undefined) {\n return false;\n }\n\n this.options.onSelect(item, index);\n\n return true;\n }\n default:\n return false;\n }\n }\n}\n","import { DestroyRef, signal } from '@angular/core';\nimport {\n DragHandleCommandValue,\n DragHandleMoveCommandValue,\n QalmaEditorController,\n} from '@qalma/editor';\nimport { anchorToRect } from './anchor-to-rect';\n\nconst DRAG_START_DISTANCE = 8;\nconst HANDLE_EDGE_MARGIN = 8;\nconst HANDLE_GAP = 8;\nconst HANDLE_BUTTON_SIZE = 30;\nconst DROP_LINE_EDGE_MARGIN = 8;\n\nexport interface QalmaDragHandleView {\n target: DragHandleCommandValue;\n transform: string;\n blockType: string;\n canMoveUp: boolean;\n canMoveDown: boolean;\n}\n\nexport interface QalmaDragDropIndicator {\n target: DragHandleMoveCommandValue;\n transform: string;\n width: number;\n}\n\nexport interface QalmaDragBlockHighlight {\n transform: string;\n width: number;\n height: number;\n}\n\ninterface QalmaDragSession {\n handle: QalmaDragHandleView;\n sourceBlock: HTMLElement;\n originX: number;\n originY: number;\n dragging: boolean;\n previousBodyCursor: string;\n previousBodyUserSelect: string;\n pointerMove: (event: Event) => void;\n pointerUp: (event: Event) => void;\n pointerCancel: (event: Event) => void;\n}\n\ninterface DragHandleBlockRange extends DragHandleCommandValue {\n to: number;\n}\n\ninterface DragDropCandidate {\n target: DragHandleMoveCommandValue;\n lineX: number;\n lineY: number;\n lineWidth: number;\n}\n\nexport class QalmaDragHandleController {\n private readonly handleState = signal<QalmaDragHandleView | null>(null);\n private readonly dropIndicatorState =\n signal<QalmaDragDropIndicator | null>(null);\n private readonly draggedBlockHighlightState =\n signal<QalmaDragBlockHighlight | null>(null);\n\n readonly handle = this.handleState.asReadonly();\n readonly dropIndicator = this.dropIndicatorState.asReadonly();\n readonly draggedBlockHighlight = this.draggedBlockHighlightState.asReadonly();\n\n private surface: HTMLElement | null = null;\n private currentBlock: HTMLElement | null = null;\n private pendingBlock: HTMLElement | null = null;\n private lastPointerClientY: number | null = null;\n private refreshFrame: number | null = null;\n private handleKey: string | null = null;\n private dragSession: QalmaDragSession | null = null;\n\n constructor(private readonly editor: () => QalmaEditorController) {}\n\n connect(surface: HTMLElement, destroyRef: DestroyRef): void {\n this.surface = surface;\n\n const pointerMove = (event: Event) => this.handlePointerMove(event);\n const pointerLeave = (event: Event) => this.handlePointerLeave(event);\n const scheduleRefresh = () => this.scheduleRefresh();\n\n surface.addEventListener('pointermove', pointerMove, {\n passive: true,\n });\n surface.addEventListener('mouseleave', pointerLeave);\n surface.addEventListener('scroll', scheduleRefresh, {\n passive: true,\n });\n window.addEventListener('scroll', scheduleRefresh, {\n passive: true,\n });\n window.addEventListener('resize', scheduleRefresh, {\n passive: true,\n });\n\n destroyRef.onDestroy(() => {\n this.finishDrag(false);\n this.cancelScheduledRefresh();\n this.surface = null;\n this.currentBlock = null;\n this.pendingBlock = null;\n surface.removeEventListener('pointermove', pointerMove);\n surface.removeEventListener('mouseleave', pointerLeave);\n surface.removeEventListener('scroll', scheduleRefresh);\n window.removeEventListener('scroll', scheduleRefresh);\n window.removeEventListener('resize', scheduleRefresh);\n });\n }\n\n hide(): void {\n this.currentBlock = null;\n this.pendingBlock = null;\n this.lastPointerClientY = null;\n this.cancelScheduledRefresh();\n this.setHandle(null);\n }\n\n startDrag(event: PointerEvent, handle: QalmaDragHandleView): void {\n if (event.button !== 0 || this.dragSession) {\n return;\n }\n\n const surface = this.surface;\n const sourceBlock =\n surface && findDragHandleBlockByPos(surface, handle.target.pos);\n\n if (!surface || !sourceBlock) {\n return;\n }\n\n event.preventDefault();\n\n const session: QalmaDragSession = {\n handle,\n sourceBlock,\n originX: event.clientX,\n originY: event.clientY,\n dragging: false,\n previousBodyCursor: document.body.style.cursor,\n previousBodyUserSelect: document.body.style.userSelect,\n pointerMove: (moveEvent) => this.handleDragPointerMove(moveEvent),\n pointerUp: (upEvent) => this.handleDragPointerUp(upEvent),\n pointerCancel: () => this.finishDrag(false),\n };\n\n this.dragSession = session;\n window.addEventListener('pointermove', session.pointerMove, {\n passive: false,\n });\n window.addEventListener('pointerup', session.pointerUp, {\n passive: false,\n });\n window.addEventListener('pointercancel', session.pointerCancel);\n }\n\n private handlePointerMove(event: Event): void {\n if (this.dragSession?.dragging) {\n return;\n }\n\n const surface = this.surface;\n const target = event.target;\n\n if (!surface || !(target instanceof Element)) {\n return;\n }\n\n const block = findDragHandleBlock(target, surface);\n\n if (!block) {\n return;\n }\n\n if (event instanceof MouseEvent) {\n this.lastPointerClientY = event.clientY;\n }\n\n this.pendingBlock = block;\n this.scheduleRefresh();\n }\n\n private handlePointerLeave(event: Event): void {\n if (this.dragSession?.dragging) {\n return;\n }\n\n const relatedTarget =\n event instanceof MouseEvent ? event.relatedTarget : null;\n\n if (\n relatedTarget instanceof Element &&\n relatedTarget.closest('[data-qalma-drag-handle]')\n ) {\n return;\n }\n\n this.hide();\n }\n\n private handleDragPointerMove(event: Event): void {\n const session = this.dragSession;\n\n if (!session || !(event instanceof MouseEvent)) {\n return;\n }\n\n const distance = Math.hypot(\n event.clientX - session.originX,\n event.clientY - session.originY,\n );\n\n if (!session.dragging && distance < DRAG_START_DISTANCE) {\n return;\n }\n\n event.preventDefault();\n\n if (!session.dragging) {\n this.activateDragSession(session);\n }\n\n this.updateDropIndicator(event.clientY);\n }\n\n private handleDragPointerUp(event: Event): void {\n if (this.dragSession?.dragging && event instanceof MouseEvent) {\n event.preventDefault();\n }\n\n this.finishDrag(true);\n }\n\n private activateDragSession(session: QalmaDragSession): void {\n session.dragging = true;\n this.surface?.setAttribute('data-qalma-drag-active', 'true');\n document.body.style.cursor = 'grabbing';\n document.body.style.userSelect = 'none';\n this.updateDraggedBlockHighlight(session.sourceBlock);\n }\n\n private updateDropIndicator(clientY: number): void {\n const surface = this.surface;\n const session = this.dragSession;\n const candidate =\n surface && session\n ? findDragDropCandidate(surface, session.handle.target.pos, clientY)\n : null;\n\n if (\n !candidate ||\n !this.editor().canExecute('moveBlockTo', candidate.target)\n ) {\n this.setDropIndicator(null);\n\n return;\n }\n\n this.setDropIndicator({\n target: candidate.target,\n transform: `translate3d(${Math.round(candidate.lineX)}px, ${Math.round(candidate.lineY)}px, 0)`,\n width: Math.round(candidate.lineWidth),\n });\n }\n\n private updateDraggedBlockHighlight(block: HTMLElement): void {\n const rect = block.getBoundingClientRect();\n\n this.draggedBlockHighlightState.set({\n transform: `translate3d(${Math.round(rect.left)}px, ${Math.round(rect.top)}px, 0)`,\n width: Math.round(rect.width),\n height: Math.round(rect.height),\n });\n }\n\n private finishDrag(shouldDrop: boolean): void {\n const session = this.dragSession;\n\n if (!session) {\n return;\n }\n\n const dropTarget = this.dropIndicatorState()?.target ?? null;\n\n window.removeEventListener('pointermove', session.pointerMove);\n window.removeEventListener('pointerup', session.pointerUp);\n window.removeEventListener('pointercancel', session.pointerCancel);\n this.surface?.removeAttribute('data-qalma-drag-active');\n document.body.style.cursor = session.previousBodyCursor;\n document.body.style.userSelect = session.previousBodyUserSelect;\n this.dragSession = null;\n this.setDropIndicator(null);\n this.draggedBlockHighlightState.set(null);\n\n if (shouldDrop && session.dragging && dropTarget) {\n this.editor().execute('moveBlockTo', dropTarget);\n this.hide();\n }\n }\n\n private scheduleRefresh(): void {\n if (this.refreshFrame !== null) {\n return;\n }\n\n this.refreshFrame = requestAnimationFrame(() => {\n this.refreshFrame = null;\n this.refresh();\n });\n }\n\n private refresh(): void {\n const block = this.pendingBlock ?? this.currentBlock;\n this.pendingBlock = null;\n\n if (!block) {\n this.hide();\n\n return;\n }\n\n this.updateFromBlock(block);\n }\n\n private updateFromBlock(block: HTMLElement): void {\n const surface = this.surface;\n const target = parseDragHandleTarget(block);\n\n if (!surface || !target) {\n this.hide();\n\n return;\n }\n\n const rect = block.getBoundingClientRect();\n\n if (!isRectVisibleInsideSurface(rect, surface)) {\n this.hide();\n\n return;\n }\n\n const surfaceRect = surface.getBoundingClientRect();\n const position = anchorToRect(rect, {\n placement: 'left',\n boundary: surfaceRect,\n size: { width: HANDLE_BUTTON_SIZE, height: HANDLE_BUTTON_SIZE },\n gap: HANDLE_GAP,\n edgeMargin: HANDLE_EDGE_MARGIN,\n align: this.lastPointerClientY ?? rect.top + rect.height / 2,\n });\n const canMoveUp = this.editor().canExecute('moveBlockUp', target);\n const canMoveDown = this.editor().canExecute('moveBlockDown', target);\n\n this.currentBlock = block;\n this.setHandle({\n target,\n transform: `translate3d(${Math.round(position.left)}px, ${Math.round(position.top)}px, 0)`,\n blockType: block.dataset['qalmaDragHandleType'] ?? 'block',\n canMoveUp,\n canMoveDown,\n });\n }\n\n private cancelScheduledRefresh(): void {\n if (this.refreshFrame === null) {\n return;\n }\n\n cancelAnimationFrame(this.refreshFrame);\n this.refreshFrame = null;\n }\n\n private setHandle(handle: QalmaDragHandleView | null): void {\n const nextKey = handle\n ? [\n handle.target.pos,\n handle.transform,\n handle.blockType,\n handle.canMoveUp,\n handle.canMoveDown,\n ].join(':')\n : null;\n\n if (nextKey === this.handleKey) {\n return;\n }\n\n this.handleKey = nextKey;\n this.handleState.set(handle);\n }\n\n private setDropIndicator(\n indicator: QalmaDragDropIndicator | null,\n ): void {\n this.dropIndicatorState.set(indicator);\n }\n}\n\nfunction findDragDropCandidate(\n surface: HTMLElement,\n sourcePos: number,\n clientY: number,\n): DragDropCandidate | null {\n const blocks = Array.from(\n surface.querySelectorAll<HTMLElement>('[data-qalma-drag-handle-block]'),\n );\n const lineRect = getDropLineRect(surface);\n let lastCandidate: DragDropCandidate | null = null;\n\n for (const block of blocks) {\n const range = parseDragHandleBlockRange(block);\n\n if (!range) {\n continue;\n }\n\n const rect = block.getBoundingClientRect();\n const midpoint = rect.top + rect.height / 2;\n\n if (clientY < midpoint) {\n return {\n target: {\n pos: sourcePos,\n targetPos: range.pos,\n },\n lineX: lineRect.left,\n lineY: rect.top,\n lineWidth: lineRect.width,\n };\n }\n\n lastCandidate = {\n target: {\n pos: sourcePos,\n targetPos: range.to,\n },\n lineX: lineRect.left,\n lineY: rect.bottom,\n lineWidth: lineRect.width,\n };\n }\n\n return lastCandidate;\n}\n\nfunction getDropLineRect(surface: HTMLElement): {\n left: number;\n width: number;\n} {\n const content = surface.querySelector<HTMLElement>('.ProseMirror') ?? surface;\n const rect = content.getBoundingClientRect();\n const width = Math.max(0, rect.width - DROP_LINE_EDGE_MARGIN * 2);\n\n return {\n left: rect.left + DROP_LINE_EDGE_MARGIN,\n width,\n };\n}\n\nfunction findDragHandleBlock(\n target: Element,\n surface: HTMLElement,\n): HTMLElement | null {\n const block = target.closest<HTMLElement>('[data-qalma-drag-handle-block]');\n\n return block && surface.contains(block) ? block : null;\n}\n\nfunction findDragHandleBlockByPos(\n surface: HTMLElement,\n pos: number,\n): HTMLElement | null {\n const blocks = Array.from(\n surface.querySelectorAll<HTMLElement>('[data-qalma-drag-handle-block]'),\n );\n\n return (\n blocks.find((block) => parseDragHandleTarget(block)?.pos === pos) ?? null\n );\n}\n\nfunction parseDragHandleTarget(\n block: HTMLElement,\n): DragHandleCommandValue | null {\n const pos = Number(block.dataset['qalmaDragHandlePos']);\n\n return Number.isInteger(pos) ? { pos } : null;\n}\n\nfunction parseDragHandleBlockRange(\n block: HTMLElement,\n): DragHandleBlockRange | null {\n const target = parseDragHandleTarget(block);\n const to = Number(block.dataset['qalmaDragHandleTo']);\n\n return target && Number.isInteger(to) ? { ...target, to } : null;\n}\n\nfunction isRectVisibleInsideSurface(\n rect: DOMRect,\n surface: HTMLElement,\n): boolean {\n const surfaceRect = surface.getBoundingClientRect();\n\n return (\n rect.bottom > surfaceRect.top &&\n rect.top < surfaceRect.bottom &&\n rect.right > surfaceRect.left &&\n rect.left < surfaceRect.right\n );\n}\n","import {\n Directive,\n DestroyRef,\n ElementRef,\n afterNextRender,\n inject,\n input,\n} from '@angular/core';\nimport { QalmaEditorController } from '@qalma/editor';\n\nimport {\n QalmaDragHandleController,\n QalmaDragHandleView,\n} from './drag-handle-controller';\n\n@Directive({\n exportAs: 'qalmaDragHandle',\n selector: '[qalmaDragHandle]',\n})\nexport class QalmaDragHandleDirective {\n readonly editor = input.required<QalmaEditorController>({\n alias: 'qalmaDragHandle',\n });\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly controller = new QalmaDragHandleController(() =>\n this.editor(),\n );\n\n readonly handle = this.controller.handle;\n readonly dropIndicator = this.controller.dropIndicator;\n readonly draggedBlockHighlight = this.controller.draggedBlockHighlight;\n\n constructor() {\n afterNextRender(() => {\n this.controller.connect(this.host.nativeElement, this.destroyRef);\n });\n }\n\n hide(): void {\n this.controller.hide();\n }\n\n startDrag(event: PointerEvent, handle: QalmaDragHandleView): void {\n this.controller.startDrag(event, handle);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { QalmaEditorController } from '@qalma/editor';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport {\n lucideArrowDown,\n lucideArrowUp,\n lucideCopy,\n lucideGripVertical,\n lucideMousePointer2,\n lucideTrash2,\n} from '@ng-icons/lucide';\n\nimport { QalmaButton } from './button';\nimport { DismissibleOverlay } from './dismissible-overlay';\nimport {\n QalmaDragBlockHighlight,\n QalmaDragDropIndicator,\n QalmaDragHandleView,\n} from './drag-handle-controller';\n\nexport interface QalmaDragStart {\n event: PointerEvent;\n handle: QalmaDragHandleView;\n}\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgIcon, QalmaButton],\n providers: [\n provideIcons({\n lucideArrowDown,\n lucideArrowUp,\n lucideCopy,\n lucideGripVertical,\n lucideMousePointer2,\n lucideTrash2,\n }),\n ],\n selector: 'qalma-drag-handle',\n template: `\n @if (draggedBlockHighlight(); as highlight) {\n <div\n data-qalma-dragging-block-highlight\n class=\"pointer-events-none fixed left-0 top-0 z-20 rounded-md border border-accent bg-accent-subtle/80 opacity-70 shadow-md will-change-transform\"\n [style.transform]=\"highlight.transform\"\n [style.width.px]=\"highlight.width\"\n [style.height.px]=\"highlight.height\"\n ></div>\n }\n\n @if (dropIndicator(); as indicator) {\n <div\n data-qalma-drag-drop-line\n class=\"pointer-events-none fixed left-0 top-0 z-40 h-0.5 rounded-full bg-accent shadow-md will-change-transform\"\n [style.transform]=\"indicator.transform\"\n [style.width.px]=\"indicator.width\"\n ></div>\n }\n\n @if (handle(); as handle) {\n <div\n data-qalma-drag-handle\n class=\"fixed left-0 top-0 z-30 flex items-start gap-1 will-change-transform\"\n tabindex=\"-1\"\n [style.transform]=\"handle.transform\"\n (mousedown)=\"preserveSelection($event)\"\n (keydown.escape)=\"dismissFromKeyboard($event)\"\n >\n <button\n qalmaBtn\n variant=\"ghost\"\n size=\"icon\"\n type=\"button\"\n class=\"!h-[1.85rem] !w-[1.85rem] cursor-grab rounded-[0.4rem] border border-transparent bg-card/95 text-muted-foreground shadow-sm active:cursor-grabbing hover:border-border hover:bg-secondary hover:text-foreground\"\n [class.border-accent]=\"menuOpen()\"\n [class.text-accent]=\"menuOpen()\"\n (pointerdown)=\"startDrag($event, handle)\"\n (click)=\"toggleMenu()\"\n title=\"Block actions\"\n aria-label=\"Block actions\"\n [attr.aria-expanded]=\"menuOpen()\"\n >\n <ng-icon\n class=\"text-[0.9rem]\"\n name=\"lucideGripVertical\"\n aria-hidden=\"true\"\n />\n </button>\n\n @if (menuOpen()) {\n <div\n role=\"menu\"\n aria-label=\"Block actions\"\n class=\"w-44 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg\"\n >\n <button\n type=\"button\"\n class=\"flex h-8 w-full cursor-pointer items-center gap-2 rounded-sm px-2 text-left text-xs font-medium text-foreground transition hover:bg-secondary disabled:cursor-not-allowed disabled:opacity-45\"\n [disabled]=\"!canExecute('selectBlock', handle)\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"execute('selectBlock', handle)\"\n role=\"menuitem\"\n >\n <ng-icon name=\"lucideMousePointer2\" aria-hidden=\"true\" />\n Select block\n </button>\n <button\n type=\"button\"\n class=\"flex h-8 w-full cursor-pointer items-center gap-2 rounded-sm px-2 text-left text-xs font-medium text-foreground transition hover:bg-secondary disabled:cursor-not-allowed disabled:opacity-45\"\n [disabled]=\"!handle.canMoveUp\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"execute('moveBlockUp', handle)\"\n role=\"menuitem\"\n >\n <ng-icon name=\"lucideArrowUp\" aria-hidden=\"true\" />\n Move up\n </button>\n <button\n type=\"button\"\n class=\"flex h-8 w-full cursor-pointer items-center gap-2 rounded-sm px-2 text-left text-xs font-medium text-foreground transition hover:bg-secondary disabled:cursor-not-allowed disabled:opacity-45\"\n [disabled]=\"!handle.canMoveDown\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"execute('moveBlockDown', handle)\"\n role=\"menuitem\"\n >\n <ng-icon name=\"lucideArrowDown\" aria-hidden=\"true\" />\n Move down\n </button>\n <button\n type=\"button\"\n class=\"flex h-8 w-full cursor-pointer items-center gap-2 rounded-sm px-2 text-left text-xs font-medium text-foreground transition hover:bg-secondary disabled:cursor-not-allowed disabled:opacity-45\"\n [disabled]=\"!canExecute('duplicateBlock', handle)\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"execute('duplicateBlock', handle)\"\n role=\"menuitem\"\n >\n <ng-icon name=\"lucideCopy\" aria-hidden=\"true\" />\n Duplicate\n </button>\n <button\n type=\"button\"\n class=\"flex h-8 w-full cursor-pointer items-center gap-2 rounded-sm px-2 text-left text-xs font-medium text-destructive transition hover:bg-destructive/10 disabled:cursor-not-allowed disabled:opacity-45\"\n [disabled]=\"!canExecute('deleteBlock', handle)\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"execute('deleteBlock', handle)\"\n role=\"menuitem\"\n >\n <ng-icon name=\"lucideTrash2\" aria-hidden=\"true\" />\n Delete\n </button>\n </div>\n }\n </div>\n }\n `,\n})\nexport class QalmaDragHandle {\n readonly editor = input.required<QalmaEditorController>();\n readonly handle = input<QalmaDragHandleView | null>(null);\n readonly dropIndicator = input<QalmaDragDropIndicator | null>(null);\n readonly draggedBlockHighlight = input<QalmaDragBlockHighlight | null>(\n null,\n );\n readonly dismiss = output<void>();\n readonly dragStart = output<QalmaDragStart>();\n\n protected readonly menuOpen = signal(false);\n\n constructor() {\n // Close the block-actions menu on an outside pointerdown or Escape. A click\n // on the handle button or the menu itself (both under `[data-qalma-drag-handle]`)\n // is treated as inside, so it doesn't self-dismiss. Connected for the\n // component's lifetime; the callback is a no-op while the menu is closed.\n new DismissibleOverlay({\n isInside: (target) =>\n target instanceof Element &&\n !!target.closest('[data-qalma-drag-handle]'),\n onDismiss: () => this.menuOpen.set(false),\n }).connect(inject(DestroyRef));\n }\n\n protected toggleMenu(): void {\n this.menuOpen.update((open) => !open);\n }\n\n protected startDrag(\n event: PointerEvent,\n handle: QalmaDragHandleView,\n ): void {\n this.menuOpen.set(false);\n this.dragStart.emit({ event, handle });\n }\n\n protected canExecute(\n command: string,\n handle: QalmaDragHandleView,\n ): boolean {\n return this.editor().canExecute(command, handle.target);\n }\n\n protected execute(command: string, handle: QalmaDragHandleView): void {\n if (this.editor().execute(command, handle.target)) {\n this.dismissHandle();\n }\n }\n\n protected preserveSelection(event: MouseEvent): void {\n event.preventDefault();\n }\n\n protected dismissFromKeyboard(event: Event): void {\n event.preventDefault();\n this.dismissHandle();\n }\n\n protected dismissHandle(): void {\n this.menuOpen.set(false);\n this.dismiss.emit();\n }\n}\n","/**\n * Fixed-position coordinates for a suggestion menu anchored to a caret/range\n * rect. Exactly one of `top`/`bottom` is a number (the other is `null`): the\n * menu is pinned below the anchor by `top`, or above it by `bottom`.\n */\nexport interface SuggestionMenuPlacement {\n readonly left: number;\n readonly top: number | null;\n readonly bottom: number | null;\n readonly maxHeight: number;\n}\n\nexport interface FlipAbovePlacementOptions {\n /** Menu width, used to clamp `left` within the viewport. */\n readonly width: number;\n /** Ideal menu height for the current option count. */\n readonly desiredHeight: number;\n /** Floor for the computed `maxHeight` (e.g. one option / a loading row). */\n readonly minHeight: number;\n /** Viewport edge margin (default 12). */\n readonly margin?: number;\n /** Gap between the anchor and the menu (default 8). */\n readonly gap?: number;\n}\n\nconst DEFAULT_MARGIN = 12;\nconst DEFAULT_GAP = 8;\n\n/**\n * Positions a floating list under an anchor rect, flipping it above when there\n * is not enough room below, and clamping its height and horizontal position to\n * the viewport. Shared by the mention and slash-command menus, whose flip\n * behavior `anchorToRect` does not cover (it has no flip / dynamic max-height).\n */\nexport function flipAbovePlacement(\n rect: { readonly top: number; readonly bottom: number; readonly left: number },\n options: FlipAbovePlacementOptions,\n): SuggestionMenuPlacement {\n const {\n width,\n desiredHeight,\n minHeight,\n margin = DEFAULT_MARGIN,\n gap = DEFAULT_GAP,\n } = options;\n\n const availableBelow = window.innerHeight - rect.bottom - margin - gap;\n const availableAbove = rect.top - margin - gap;\n const openAbove =\n availableBelow < desiredHeight && availableAbove > availableBelow;\n const availableHeight = Math.max(\n minHeight,\n openAbove ? availableAbove : availableBelow,\n );\n const maxHeight = Math.min(desiredHeight, availableHeight);\n const leftBoundary = Math.max(margin, window.innerWidth - width - margin);\n\n return {\n left: Math.min(Math.max(rect.left, margin), leftBoundary),\n top: openAbove ? null : rect.bottom + gap,\n bottom: openAbove ? window.innerHeight - rect.top + gap : null,\n maxHeight,\n };\n}\n","import {\n Directive,\n ElementRef,\n Signal,\n inject,\n input,\n output,\n} from '@angular/core';\n\nimport { SuggestionMenuPlacement } from './flip-above-placement';\n\n/** Option buttons carry this attribute so the base can focus/scroll to one by index. */\nexport const SUGGESTION_OPTION_INDEX_ATTR = 'data-suggestion-index';\n/** The scrollable options container carries this attribute (optional). */\nexport const SUGGESTION_OPTIONS_SCROLLER_ATTR = 'data-suggestion-options';\n\n/**\n * Shared behavior for caret-anchored suggestion menus (mention, slash command):\n * flip-above placement input, active-option highlighting, and in-menu keyboard\n * handling (Escape dismisses, Arrow moves + focuses, Enter/Space picks) with\n * wrap-around and optional scroll-into-view. Concrete menus only supply their\n * own item markup and expose their option list via `optionList`.\n */\n@Directive()\nexport abstract class QalmaSuggestionMenu<TOption extends { readonly id: string }> {\n protected readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n readonly placement = input<SuggestionMenuPlacement | null>(null);\n readonly activeIndex = input(0);\n\n readonly activate = output<number>();\n readonly pick = output<TOption>();\n readonly dismiss = output<void>();\n\n /** The rendered options, bound by the concrete menu (`options`/`suggestions`). */\n protected abstract readonly optionList: Signal<readonly TOption[]>;\n\n protected preserveSelection(event: MouseEvent): void {\n event.preventDefault();\n }\n\n protected handleOptionKeydown(\n event: KeyboardEvent,\n option: TOption,\n index: number,\n ): void {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.dismiss.emit();\n\n return;\n }\n\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n\n const nextIndex = this.getNextIndex(\n index,\n event.key === 'ArrowDown' ? 1 : -1,\n );\n\n this.activate.emit(nextIndex);\n queueMicrotask(() => this.focusOption(nextIndex));\n\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar') {\n event.preventDefault();\n this.pick.emit(option);\n }\n }\n\n protected focusOption(index: number): void {\n this.optionElement(index)?.focus();\n // No-op for menus without a marked scroller (native focus handles scroll).\n this.scrollOptionIntoView(index);\n }\n\n protected scrollOptionIntoView(index: number): void {\n const scroller = this.optionsScroller();\n const option = this.optionElement(index);\n\n if (!scroller || !option) {\n return;\n }\n\n const optionTop = option.offsetTop - scroller.offsetTop;\n const optionBottom = optionTop + option.offsetHeight;\n const visibleTop = scroller.scrollTop;\n const visibleBottom = visibleTop + scroller.clientHeight;\n\n if (optionTop < visibleTop) {\n scroller.scrollTop = optionTop;\n } else if (optionBottom > visibleBottom) {\n scroller.scrollTop = optionBottom - scroller.clientHeight;\n }\n }\n\n private getNextIndex(index: number, delta: number): number {\n const length = this.optionList().length;\n\n return length > 0 ? (index + delta + length) % length : index;\n }\n\n private optionElement(index: number): HTMLElement | null {\n return this.elementRef.nativeElement.querySelector<HTMLElement>(\n `[${SUGGESTION_OPTION_INDEX_ATTR}=\"${index}\"]`,\n );\n }\n\n private optionsScroller(): HTMLElement | null {\n return this.elementRef.nativeElement.querySelector<HTMLElement>(\n `[${SUGGESTION_OPTIONS_SCROLLER_ATTR}]`,\n );\n }\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\nimport { QalmaSuggestionMenu } from './suggestion-menu-base';\n\nexport interface QalmaMentionOption {\n readonly id: string;\n readonly label: string;\n readonly description: string;\n}\n\n/**\n * Caret-anchored mention suggestion menu: an avatar-initial list with a loading\n * state. Positioning, keyboard handling and active highlighting come from\n * {@link QalmaSuggestionMenu}; feed it a `placement` (see `flipAbovePlacement`)\n * and the filtered `suggestions`.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'qalma-mention-menu',\n template: `\n @if (placement(); as placement) {\n <div\n role=\"listbox\"\n aria-label=\"Mention suggestions\"\n class=\"fixed z-20 w-[min(280px,calc(100vw-24px))] overflow-hidden rounded-md border border-border bg-popover p-1 text-sm text-popover-foreground shadow-lg outline-none\"\n [style.left.px]=\"placement.left\"\n [style.top.px]=\"placement.top\"\n [style.bottom.px]=\"placement.bottom\"\n [style.max-height.px]=\"placement.maxHeight\"\n >\n @if (loading()) {\n <div\n class=\"flex items-center gap-2 px-2 py-2 text-sm text-muted-foreground\"\n >\n <span\n class=\"size-7 animate-pulse rounded-sm border border-border bg-secondary\"\n aria-hidden=\"true\"\n ></span>\n <span>Loading…</span>\n </div>\n } @else {\n <div class=\"max-h-full overflow-y-auto\">\n @for (\n option of suggestions();\n track option.id;\n let index = $index\n ) {\n <button\n type=\"button\"\n role=\"option\"\n [attr.data-suggestion-index]=\"index\"\n class=\"group grid h-12 w-full min-w-0 cursor-pointer grid-cols-[1.75rem_minmax(0,1fr)] items-center gap-2 rounded-sm px-2 text-left transition-colors hover:bg-accent-subtle hover:text-foreground focus:bg-accent-subtle focus:text-foreground focus:outline-none\"\n [class.bg-accent-subtle]=\"index === activeIndex()\"\n [class.text-foreground]=\"index === activeIndex()\"\n [attr.aria-selected]=\"index === activeIndex()\"\n [attr.tabindex]=\"index === activeIndex() ? 0 : -1\"\n (mouseenter)=\"activate.emit(index)\"\n (mousedown)=\"preserveSelection($event)\"\n (keydown)=\"handleOptionKeydown($event, option, index)\"\n (click)=\"pick.emit(option)\"\n >\n <span\n class=\"flex size-7 items-center justify-center rounded-sm border border-border bg-card text-xs font-semibold text-foreground\"\n [class.border-accent]=\"index === activeIndex()\"\n [class.bg-background]=\"index === activeIndex()\"\n [class.text-accent]=\"index === activeIndex()\"\n aria-hidden=\"true\"\n >\n {{ option.label.slice(0, 1) }}\n </span>\n <span class=\"min-w-0\">\n <span class=\"block truncate font-medium leading-5\">{{\n option.label\n }}</span>\n @if (index === activeIndex()) {\n <span\n class=\"block truncate text-xs leading-4 text-foreground\"\n >\n {{ option.description }}\n </span>\n } @else {\n <span\n class=\"block truncate text-xs leading-4 text-muted-foreground group-hover:text-foreground group-focus:text-foreground\"\n >\n {{ option.description }}\n </span>\n }\n </span>\n </button>\n }\n </div>\n }\n </div>\n }\n `,\n})\nexport class QalmaMentionMenu extends QalmaSuggestionMenu<QalmaMentionOption> {\n readonly suggestions = input<readonly QalmaMentionOption[]>([]);\n readonly loading = input(false);\n\n protected readonly optionList = this.suggestions;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n effect,\n input,\n} from '@angular/core';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport {\n lucideCode,\n lucideHeading1,\n lucideHeading2,\n lucideHeading3,\n lucideList,\n lucideListOrdered,\n lucideListTodo,\n lucideMinus,\n lucidePilcrow,\n lucideSquareCode,\n lucideTable,\n lucideTextQuote,\n} from '@ng-icons/lucide';\nimport { QalmaCommandValue } from '@qalma/editor';\n\nimport { QalmaSuggestionMenu } from './suggestion-menu-base';\n\nexport interface QalmaSlashCommandOption {\n readonly id: string;\n readonly label: string;\n readonly description: string;\n readonly icon: string;\n readonly shortcut: string;\n /** Editor command to run when the option is picked. */\n readonly command: string;\n readonly value?: QalmaCommandValue;\n readonly placement?: 'block' | 'inline';\n /** Extra terms the consumer can match against when filtering. */\n readonly keywords: readonly string[];\n}\n\n/**\n * Caret-anchored slash-command menu: an icon + shortcut list with a \"Commands\"\n * header and an Escape hint footer, scrolling the active option into view.\n * Positioning, keyboard handling and active highlighting come from\n * {@link QalmaSuggestionMenu}; feed it a `placement` (see `flipAbovePlacement`)\n * and the filtered `options`. Ships the default block-command icon set.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgIcon],\n providers: [\n provideIcons({\n lucideCode,\n lucideHeading1,\n lucideHeading2,\n lucideHeading3,\n lucideList,\n lucideListOrdered,\n lucideListTodo,\n lucideMinus,\n lucidePilcrow,\n lucideSquareCode,\n lucideTable,\n lucideTextQuote,\n }),\n ],\n selector: 'qalma-slash-command-menu',\n template: `\n @if (placement(); as placement) {\n <div\n role=\"listbox\"\n aria-label=\"Slash command suggestions\"\n class=\"fixed z-20 flex w-[min(320px,calc(100vw-24px))] flex-col overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg outline-none\"\n [style.left.px]=\"placement.left\"\n [style.top.px]=\"placement.top\"\n [style.bottom.px]=\"placement.bottom\"\n [style.max-height.px]=\"placement.maxHeight\"\n >\n <div\n class=\"shrink-0 px-2 py-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground\"\n >\n Commands\n </div>\n <div data-suggestion-options class=\"min-h-0 flex-1 overflow-y-auto\">\n @for (option of options(); track option.id; let index = $index) {\n <button\n type=\"button\"\n role=\"option\"\n [attr.data-suggestion-index]=\"index\"\n class=\"group grid h-11 w-full min-w-0 cursor-pointer grid-cols-[1.75rem_minmax(0,1fr)_auto] items-center gap-2 rounded-sm px-2 text-left text-sm transition-colors hover:bg-accent-subtle hover:text-foreground focus:bg-accent-subtle focus:text-foreground focus:outline-none\"\n [class.bg-accent-subtle]=\"index === activeIndex()\"\n [class.text-foreground]=\"index === activeIndex()\"\n [attr.aria-selected]=\"index === activeIndex()\"\n [attr.tabindex]=\"index === activeIndex() ? 0 : -1\"\n (mouseenter)=\"activate.emit(index)\"\n (mousedown)=\"preserveSelection($event)\"\n (keydown)=\"handleOptionKeydown($event, option, index)\"\n (click)=\"pick.emit(option)\"\n >\n <span\n class=\"flex size-7 items-center justify-center rounded-sm border border-border bg-card text-[14px] text-foreground\"\n [class.border-accent]=\"index === activeIndex()\"\n [class.bg-background]=\"index === activeIndex()\"\n [class.text-accent]=\"index === activeIndex()\"\n >\n <ng-icon [name]=\"option.icon\" aria-hidden=\"true\" />\n </span>\n <span class=\"min-w-0\">\n <span class=\"block truncate font-medium leading-5\">{{\n option.label\n }}</span>\n @if (index === activeIndex()) {\n <span\n class=\"block truncate text-xs leading-4 text-foreground\"\n >\n {{ option.description }}\n </span>\n } @else {\n <span\n class=\"block truncate text-xs leading-4 text-muted-foreground group-hover:text-foreground group-focus:text-foreground\"\n >\n {{ option.description }}\n </span>\n }\n </span>\n <kbd\n class=\"rounded-sm border border-border bg-card px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground\"\n [class.border-accent]=\"index === activeIndex()\"\n [class.bg-background]=\"index === activeIndex()\"\n [class.text-accent]=\"index === activeIndex()\"\n >\n {{ option.shortcut }}\n </kbd>\n </button>\n }\n </div>\n <div\n class=\"mt-1 flex h-8 shrink-0 items-center justify-between border-t border-border px-2 text-[11px] text-muted-foreground\"\n >\n <span>Close menu</span>\n <kbd\n class=\"rounded-sm border border-border bg-card px-1.5 py-0.5 font-mono\"\n >esc</kbd\n >\n </div>\n </div>\n }\n `,\n})\nexport class QalmaSlashCommandMenu extends QalmaSuggestionMenu<QalmaSlashCommandOption> {\n readonly options = input<readonly QalmaSlashCommandOption[]>([]);\n\n protected readonly optionList = this.options;\n\n constructor() {\n super();\n\n effect(() => {\n const activeIndex = this.activeIndex();\n\n this.options();\n queueMicrotask(() => this.scrollOptionIntoView(activeIndex));\n });\n }\n}\n","import { anchorToRect } from './anchor-to-rect';\n\nexport interface LinkPopover extends LinkPopoverPlacement {\n editing: boolean;\n element: HTMLAnchorElement | null;\n href: string;\n rel: string | null;\n target: '_blank' | null;\n text: string;\n}\n\nexport interface LinkPopoverPlacement {\n left: number;\n top: number;\n}\n\nconst LINK_POPOVER_WIDTH = 360;\n// Both the editing and preview rows are a single h-9 (36px) control plus\n// padding/border; this is an estimate since the actual element isn't\n// rendered yet when the placement is computed.\nconst LINK_POPOVER_HEIGHT_ESTIMATE = 56;\n\nexport function createLinkPopoverPlacement(\n element: HTMLElement,\n): LinkPopoverPlacement {\n const rect = element.getBoundingClientRect();\n\n return anchorToRect(rect, {\n placement: 'bottom',\n boundary: {\n top: 0,\n bottom: window.innerHeight,\n left: 0,\n right: window.innerWidth,\n },\n size: { width: LINK_POPOVER_WIDTH, height: LINK_POPOVER_HEIGHT_ESTIMATE },\n gap: 8,\n edgeMargin: 16,\n align: 'start',\n });\n}\n\nexport function findEditorLinkElement(\n target: EventTarget | null,\n): HTMLAnchorElement | null {\n if (!(target instanceof Element)) {\n return null;\n }\n\n const element = target.closest<HTMLAnchorElement>('.ProseMirror a[href]');\n\n return element instanceof HTMLAnchorElement ? element : null;\n}\n","import { signal } from '@angular/core';\nimport { LinkState, QalmaEditorController } from '@qalma/editor';\n\nimport {\n createLinkPopoverPlacement,\n findEditorLinkElement,\n LinkPopover,\n} from './link-popover.model';\n\nexport class LinkPopoverController {\n readonly popover = signal<LinkPopover | null>(null);\n readonly href = signal('');\n\n private hideTimeout: ReturnType<typeof setTimeout> | undefined;\n\n constructor(private readonly editor: QalmaEditorController) {}\n\n showToolbarEditor(event: MouseEvent): void {\n const linkState = this.editor.query<LinkState>('link');\n const target = event.currentTarget;\n\n if (!(target instanceof HTMLElement)) {\n return;\n }\n\n this.keepOpen();\n this.href.set(linkState?.href ?? 'https://');\n this.popover.set({\n ...createLinkPopoverPlacement(target),\n editing: true,\n element: null,\n href: linkState?.href ?? '',\n rel: linkState?.rel ?? null,\n target: linkState?.target ?? null,\n text: linkState?.text ?? '',\n });\n }\n\n showPreview(event: Event): void {\n const element = findEditorLinkElement(event.target);\n\n if (!element) {\n return;\n }\n\n this.keepOpen();\n this.popover.set({\n ...createLinkPopoverPlacement(element),\n editing: false,\n element,\n href: element.href,\n rel: element.rel || null,\n target: element.target === '_blank' ? '_blank' : null,\n text: element.textContent?.trim() ?? '',\n });\n }\n\n scheduleHideFromEvent(event: MouseEvent | FocusEvent): void {\n const nextTarget = event.relatedTarget;\n\n if (\n nextTarget instanceof Element &&\n (findEditorLinkElement(nextTarget) ||\n nextTarget.closest('[data-qalma-link-popover]'))\n ) {\n return;\n }\n\n if (!this.popover()?.editing) {\n this.scheduleHide();\n }\n }\n\n edit(popover: LinkPopover): void {\n this.keepOpen();\n this.selectLink(popover);\n this.href.set(popover.href);\n this.popover.set({\n ...popover,\n editing: true,\n });\n }\n\n save(popover: LinkPopover): void {\n const href = this.href().trim();\n\n if (!href) {\n return;\n }\n\n this.selectLink(popover);\n this.editor.execute('setLink', href);\n this.hide();\n }\n\n remove(popover: LinkPopover): void {\n this.selectLink(popover);\n this.editor.execute('unsetLink');\n this.hide();\n }\n\n hide(): void {\n this.clearHideTimeout();\n this.popover.set(null);\n }\n\n keepOpen(): void {\n this.clearHideTimeout();\n }\n\n scheduleHide(): void {\n this.clearHideTimeout();\n\n if (this.popover()?.editing) {\n return;\n }\n\n this.hideTimeout = setTimeout(() => {\n if (this.popover()?.editing) {\n this.hideTimeout = undefined;\n\n return;\n }\n\n this.popover.set(null);\n this.hideTimeout = undefined;\n }, 160);\n }\n\n private selectLink(popover: LinkPopover): void {\n if (popover.element) {\n this.editor.execute('selectLink', {\n element: popover.element,\n });\n }\n }\n\n private clearHideTimeout(): void {\n if (!this.hideTimeout) {\n return;\n }\n\n clearTimeout(this.hideTimeout);\n this.hideTimeout = undefined;\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n input,\n output,\n} from '@angular/core';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport {\n lucideCheck,\n lucideExternalLink,\n lucideLink,\n lucidePencil,\n lucideUnlink,\n lucideX,\n} from '@ng-icons/lucide';\n\nimport { LinkPopover } from './link-popover.model';\nimport { QalmaButton } from './button';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgIcon, QalmaButton],\n providers: [\n provideIcons({\n lucideCheck,\n lucideExternalLink,\n lucideLink,\n lucidePencil,\n lucideUnlink,\n lucideX,\n }),\n ],\n selector: 'qalma-link-popover',\n template: `\n @if (popover(); as popover) {\n <div\n data-qalma-link-popover\n role=\"dialog\"\n aria-label=\"Link preview\"\n class=\"fixed z-20 w-[min(360px,calc(100vw-32px))] rounded-md border border-border bg-popover p-1.5 text-sm text-popover-foreground shadow-lg outline-none\"\n [style.left.px]=\"popover.left\"\n [style.top.px]=\"popover.top\"\n (mouseenter)=\"keepOpen.emit()\"\n (mouseleave)=\"scheduleHide.emit()\"\n (focusin)=\"keepOpen.emit()\"\n (focusout)=\"scheduleHide.emit()\"\n >\n @if (popover.editing) {\n <div class=\"flex items-center gap-1.5\">\n <label\n class=\"flex h-9 min-w-0 flex-1 items-center gap-2 rounded-md border border-input bg-background px-2 text-sm transition focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30\"\n >\n <ng-icon\n class=\"shrink-0 text-muted-foreground\"\n name=\"lucideLink\"\n aria-hidden=\"true\"\n />\n <input\n class=\"min-w-0 flex-1 bg-transparent text-foreground outline-none placeholder:text-muted-foreground\"\n type=\"url\"\n aria-label=\"Edit link URL\"\n [value]=\"href()\"\n (input)=\"updateHref($event)\"\n />\n </label>\n <button\n qalmaBtn\n size=\"icon\"\n type=\"button\"\n [disabled]=\"!href().trim()\"\n (click)=\"save.emit(popover)\"\n title=\"Save link\"\n aria-label=\"Save link\"\n >\n <ng-icon name=\"lucideCheck\" aria-hidden=\"true\" />\n </button>\n <button\n qalmaBtn\n variant=\"outline\"\n size=\"icon\"\n type=\"button\"\n (click)=\"dismiss.emit()\"\n title=\"Cancel\"\n aria-label=\"Cancel\"\n >\n <ng-icon name=\"lucideX\" aria-hidden=\"true\" />\n </button>\n </div>\n } @else {\n <div class=\"flex items-center gap-1.5\">\n <a\n class=\"inline-flex h-9 min-w-0 flex-1 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-accent transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n [href]=\"popover.href\"\n [target]=\"popover.target ?? '_blank'\"\n [rel]=\"popover.rel ?? 'noopener noreferrer'\"\n title=\"Open link\"\n >\n <span class=\"min-w-0 truncate font-medium\">{{\n popover.href\n }}</span>\n <ng-icon\n class=\"shrink-0 text-base\"\n name=\"lucideExternalLink\"\n aria-hidden=\"true\"\n />\n </a>\n <button\n qalmaBtn\n variant=\"outline\"\n size=\"icon\"\n type=\"button\"\n (click)=\"edit.emit(popover)\"\n title=\"Edit link\"\n aria-label=\"Edit link\"\n >\n <ng-icon name=\"lucidePencil\" aria-hidden=\"true\" />\n </button>\n <button\n qalmaBtn\n variant=\"ghost\"\n size=\"icon\"\n type=\"button\"\n class=\"text-destructive hover:bg-destructive/10 hover:text-destructive\"\n (click)=\"remove.emit(popover)\"\n title=\"Unlink\"\n aria-label=\"Unlink\"\n >\n <ng-icon name=\"lucideUnlink\" aria-hidden=\"true\" />\n </button>\n </div>\n }\n </div>\n }\n `,\n})\nexport class QalmaLinkPopover {\n readonly popover = input<LinkPopover | null>(null);\n readonly href = input.required<string>();\n\n readonly hrefChange = output<string>();\n readonly edit = output<LinkPopover>();\n readonly save = output<LinkPopover>();\n readonly remove = output<LinkPopover>();\n readonly dismiss = output<void>();\n readonly keepOpen = output<void>();\n readonly scheduleHide = output<void>();\n\n protected updateHref(event: Event): void {\n const target = event.target;\n\n if (target instanceof HTMLInputElement) {\n this.hrefChange.emit(target.value);\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n output,\n} from '@angular/core';\nimport {\n QalmaCommand,\n QalmaEditorController,\n QalmaToolbar,\n} from '@qalma/editor';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport {\n lucideBold,\n lucideCode,\n lucideItalic,\n lucideLetterText,\n lucideLink,\n} from '@ng-icons/lucide';\n\nimport { QalmaButton } from './button';\n\nexport interface QalmaContextualToolbarPlacement {\n transform: string;\n}\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgIcon, QalmaButton, QalmaCommand, QalmaToolbar],\n providers: [\n provideIcons({\n lucideBold,\n lucideCode,\n lucideItalic,\n lucideLetterText,\n lucideLink,\n }),\n ],\n selector: 'qalma-contextual-toolbar',\n template: `\n @if (placement(); as placement) {\n <qalma-toolbar\n label=\"Selection formatting\"\n class=\"fixed left-0 top-0 z-30 flex items-center gap-0.5 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg will-change-transform\"\n [style.transform]=\"placement.transform\"\n (mousedown)=\"preserveSelection($event)\"\n (keydown.escape)=\"dismissFromKeyboard($event)\"\n >\n <button\n qalmaBtn\n variant=\"ghost\"\n size=\"icon\"\n type=\"button\"\n class=\"!h-[1.85rem] !w-[1.85rem] cursor-pointer rounded-[0.4rem] disabled:cursor-not-allowed [&.qalma-command-active]:bg-accent-subtle [&.qalma-command-active]:text-accent\"\n qalmaCommand=\"toggleBold\"\n title=\"Bold\"\n aria-label=\"Bold\"\n >\n <ng-icon\n class=\"text-[0.9rem]\"\n name=\"lucideBold\"\n aria-hidden=\"true\"\n />\n </button>\n <button\n qalmaBtn\n variant=\"ghost\"\n size=\"icon\"\n type=\"button\"\n class=\"!h-[1.85rem] !w-[1.85rem] cursor-pointer rounded-[0.4rem] disabled:cursor-not-allowed [&.qalma-command-active]:bg-accent-subtle [&.qalma-command-active]:text-accent\"\n qalmaCommand=\"toggleItalic\"\n title=\"Italic\"\n aria-label=\"Italic\"\n >\n <ng-icon\n class=\"text-[0.9rem]\"\n name=\"lucideItalic\"\n aria-hidden=\"true\"\n />\n </button>\n <button\n qalmaBtn\n variant=\"ghost\"\n size=\"icon\"\n type=\"button\"\n class=\"!h-[1.85rem] !w-[1.85rem] cursor-pointer rounded-[0.4rem] disabled:cursor-not-allowed [&.qalma-command-active]:bg-accent-subtle [&.qalma-command-active]:text-accent\"\n qalmaCommand=\"toggleInlineCode\"\n title=\"Inline code\"\n aria-label=\"Inline code\"\n >\n <ng-icon\n class=\"text-[0.9rem]\"\n name=\"lucideCode\"\n aria-hidden=\"true\"\n />\n </button>\n <button\n qalmaBtn\n variant=\"ghost\"\n size=\"icon\"\n type=\"button\"\n class=\"!h-[1.85rem] !w-[1.85rem] cursor-pointer rounded-[0.4rem] disabled:cursor-not-allowed [&.qalma-command-active]:bg-accent-subtle [&.qalma-command-active]:text-accent\"\n qalmaCommand=\"toggleMonospace\"\n title=\"Monospace\"\n aria-label=\"Monospace\"\n >\n <ng-icon\n class=\"text-[0.9rem]\"\n name=\"lucideLetterText\"\n aria-hidden=\"true\"\n />\n </button>\n <span class=\"mx-0.5 h-5 w-px bg-border\" aria-hidden=\"true\"></span>\n <button\n qalmaBtn\n variant=\"ghost\"\n size=\"icon\"\n type=\"button\"\n class=\"!h-[1.85rem] !w-[1.85rem] cursor-pointer rounded-[0.4rem] disabled:cursor-not-allowed [&.qalma-command-active]:bg-accent-subtle [&.qalma-command-active]:text-accent\"\n [class.qalma-command-active]=\"linkActive()\"\n [attr.aria-pressed]=\"linkActive()\"\n [disabled]=\"!canSetLink()\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"requestLink.emit($event)\"\n title=\"Link\"\n aria-label=\"Link\"\n >\n <ng-icon\n class=\"text-[0.9rem]\"\n name=\"lucideLink\"\n aria-hidden=\"true\"\n />\n </button>\n </qalma-toolbar>\n }\n `,\n})\nexport class QalmaContextualToolbar {\n readonly editor = input.required<QalmaEditorController>();\n readonly placement = input<QalmaContextualToolbarPlacement | null>(\n null,\n );\n readonly requestLink = output<MouseEvent>();\n readonly dismiss = output<void>();\n\n protected readonly canSetLink = computed(() =>\n this.editor().canExecute('setLink', 'https://angular.dev'),\n );\n protected readonly linkActive = computed(() =>\n this.editor().isCommandActive('setLink'),\n );\n\n protected preserveSelection(event: MouseEvent): void {\n event.preventDefault();\n }\n\n protected dismissFromKeyboard(event: Event): void {\n event.preventDefault();\n this.dismiss.emit();\n }\n}\n","import { DestroyRef, signal } from '@angular/core';\nimport {\n QalmaEditorController,\n SelectionState,\n} from '@qalma/editor';\n\nimport { QalmaContextualToolbarPlacement } from './contextual-toolbar';\n\nconst TOOLBAR_EDGE_MARGIN = 16;\nconst TOOLBAR_GAP = 8;\n\nexport class QalmaSelectionToolbarController {\n private readonly placementState =\n signal<QalmaContextualToolbarPlacement | null>(null);\n readonly placement = this.placementState.asReadonly();\n\n private surface: HTMLElement | null = null;\n private refreshFrame: number | null = null;\n private placementKey: string | null = null;\n\n constructor(private readonly editor: () => QalmaEditorController) {}\n\n connect(surface: HTMLElement, destroyRef: DestroyRef): void {\n this.surface = surface;\n\n const refresh = () => this.refresh();\n const scheduleRefresh = () => this.scheduleRefresh();\n const handleKeydown = (event: Event) => this.handleKeydown(event);\n\n surface.addEventListener('qalma-selection-update', refresh);\n surface.addEventListener('keydown', handleKeydown);\n surface.addEventListener('keyup', refresh);\n surface.addEventListener('mouseup', refresh);\n surface.addEventListener('scroll', scheduleRefresh, {\n passive: true,\n });\n window.addEventListener('scroll', scheduleRefresh, {\n passive: true,\n });\n window.addEventListener('resize', scheduleRefresh, {\n passive: true,\n });\n\n destroyRef.onDestroy(() => {\n this.cancelScheduledRefresh();\n this.surface = null;\n surface.removeEventListener('qalma-selection-update', refresh);\n surface.removeEventListener('keydown', handleKeydown);\n surface.removeEventListener('keyup', refresh);\n surface.removeEventListener('mouseup', refresh);\n surface.removeEventListener('scroll', scheduleRefresh);\n window.removeEventListener('scroll', scheduleRefresh);\n window.removeEventListener('resize', scheduleRefresh);\n });\n }\n\n refresh(): void {\n const surface = this.surface;\n const selection = this.editor().query<SelectionState>('selection');\n\n if (\n !surface ||\n !selection ||\n selection.empty ||\n selection.text.trim().length === 0\n ) {\n this.hide();\n\n return;\n }\n\n const domSelection = window.getSelection();\n\n if (\n !domSelection ||\n domSelection.rangeCount === 0 ||\n !isSelectionInsideSurface(domSelection, surface)\n ) {\n this.hide();\n\n return;\n }\n\n const rect = getVisibleSelectionRect(domSelection.getRangeAt(0));\n\n if (!rect || !isRectVisibleInsideSurface(rect, surface)) {\n this.hide();\n\n return;\n }\n\n const viewportWidth =\n document.documentElement.clientWidth || window.innerWidth;\n const x = Math.round(\n clamp(\n rect.left + rect.width / 2,\n TOOLBAR_EDGE_MARGIN,\n viewportWidth - TOOLBAR_EDGE_MARGIN,\n ),\n );\n const y = Math.round(Math.max(TOOLBAR_EDGE_MARGIN, rect.top - TOOLBAR_GAP));\n\n this.setPlacement({\n transform: `translate3d(${x}px, ${y}px, 0) translate(-50%, -100%)`,\n });\n }\n\n hide(): void {\n this.setPlacement(null);\n }\n\n handleKeydown(event: Event): void {\n if (\n !(event instanceof KeyboardEvent) ||\n event.key !== 'Escape' ||\n !this.placement()\n ) {\n return;\n }\n\n event.preventDefault();\n this.hide();\n }\n\n private scheduleRefresh(): void {\n if (!this.placement() || this.refreshFrame !== null) {\n return;\n }\n\n this.refreshFrame = requestAnimationFrame(() => {\n this.refreshFrame = null;\n this.refresh();\n });\n }\n\n private cancelScheduledRefresh(): void {\n if (this.refreshFrame === null) {\n return;\n }\n\n cancelAnimationFrame(this.refreshFrame);\n this.refreshFrame = null;\n }\n\n private setPlacement(\n placement: QalmaContextualToolbarPlacement | null,\n ): void {\n const nextKey = placement?.transform ?? null;\n\n if (nextKey === this.placementKey) {\n return;\n }\n\n this.placementKey = nextKey;\n this.placementState.set(placement);\n }\n}\n\nfunction getVisibleSelectionRect(range: Range): DOMRect | null {\n const rect = range.getBoundingClientRect();\n\n if (rect.width > 0 || rect.height > 0) {\n return rect;\n }\n\n for (const clientRect of Array.from(range.getClientRects())) {\n if (clientRect.width > 0 || clientRect.height > 0) {\n return clientRect;\n }\n }\n\n return null;\n}\n\nfunction isSelectionInsideSurface(\n selection: globalThis.Selection,\n surface: HTMLElement,\n): boolean {\n return (\n isNodeInsideSurface(selection.anchorNode, surface) &&\n isNodeInsideSurface(selection.focusNode, surface)\n );\n}\n\nfunction isNodeInsideSurface(node: Node | null, surface: HTMLElement): boolean {\n const element = node instanceof Element ? node : node?.parentElement;\n\n return Boolean(element && surface.contains(element));\n}\n\nfunction isRectVisibleInsideSurface(\n rect: DOMRect,\n surface: HTMLElement,\n): boolean {\n const surfaceRect = surface.getBoundingClientRect();\n\n return (\n rect.bottom > surfaceRect.top &&\n rect.top < surfaceRect.bottom &&\n rect.right > surfaceRect.left &&\n rect.left < surfaceRect.right\n );\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n","import {\n Directive,\n DestroyRef,\n ElementRef,\n afterNextRender,\n inject,\n input,\n} from '@angular/core';\nimport { QalmaEditorController } from '@qalma/editor';\n\nimport { QalmaSelectionToolbarController } from './selection-toolbar-controller';\n\n@Directive({\n exportAs: 'qalmaSelectionToolbar',\n selector: '[qalmaSelectionToolbar]',\n})\nexport class QalmaSelectionToolbarDirective {\n readonly editor = input.required<QalmaEditorController>({\n alias: 'qalmaSelectionToolbar',\n });\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly controller = new QalmaSelectionToolbarController(() =>\n this.editor(),\n );\n\n readonly placement = this.controller.placement;\n\n constructor() {\n afterNextRender(() => {\n this.controller.connect(this.host.nativeElement, this.destroyRef);\n });\n }\n\n refresh(): void {\n this.controller.refresh();\n }\n\n hide(): void {\n this.controller.hide();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["DEFAULT_GAP","clamp","isRectVisibleInsideSurface"],"mappings":";;;;;;;;;;AAGM,SAAU,EAAE,CAAC,GAAG,MAAoB,EAAA;AACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC9B;;ACAO,MAAM,cAAc,GAAG,GAAG,CAC/B,gVAAgV,EAChV;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,wDAAwD;AACjE,YAAA,SAAS,EACP,8DAA8D;AAChE,YAAA,OAAO,EACL,iGAAiG;AACnG,YAAA,KAAK,EACH,oEAAoE;AACtE,YAAA,MAAM,EAAE,qDAAqD;AAC7D,YAAA,IAAI,EAAE,gDAAgD;AACvD,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,OAAO,EAAE,eAAe;AACxB,YAAA,EAAE,EAAE,6BAA6B;AACjC,YAAA,EAAE,EAAE,gCAAgC;AACpC,YAAA,IAAI,EAAE,SAAS;AAChB,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,IAAI,EAAE,SAAS;AAChB,KAAA;AACF,CAAA;AAUH;;;AAGG;MAOU,WAAW,CAAA;AACL,IAAA,IAAI,GAAG,MAAM,CAA0B,UAAU,CAAC;AAClD,IAAA,YAAY,GAC3B,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE;AAE5C,IAAA,OAAO,GAAG,KAAK,CAAgB,SAAS,8EAAC;AACzC,IAAA,IAAI,GAAG,KAAK,CAAa,SAAS,2EAA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AA,EAAA,CAAA;;4FAA9B,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAJ1C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,QAAQ,EAAE,yBAAyB;AACpC,iBAAA;;;ACfD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"qalma-kit.mjs","sources":["../../../../libs/ui-kit/src/lib/toolbar-button.ts","../../../../libs/ui-kit/src/lib/toolbar-commands.ts","../../../../libs/ui-kit/src/lib/toolbar-registry.ts","../../../../libs/ui-kit/src/lib/toolbar-icons.ts","../../../../libs/ui-kit/src/lib/cn.ts","../../../../libs/ui-kit/src/lib/button.ts","../../../../libs/ui-kit/src/lib/drag-handle.ts","../../../../libs/ui-kit/src/lib/mention-menu.ts","../../../../libs/ui-kit/src/lib/slash-command-menu.ts","../../../../libs/ui-kit/src/lib/link-popover.ts","../../../../libs/ui-kit/src/lib/contextual-toolbar.ts","../../../../libs/ui-kit/src/index.ts","../../../../libs/ui-kit/src/qalma-kit.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { NgIcon } from '@ng-icons/core';\nimport { QalmaCommand } from '@qalma/editor';\n\n/**\n * Default styling for a toolbar command button. Icon-only, square, and driven\n * entirely by the host's shadcn-style design tokens (`text-muted-foreground`,\n * `bg-card`, `bg-secondary`, `bg-accent-subtle`…) so it themes with the\n * surrounding app.\n * The `qalma-command-active` class is toggled by the `QalmaCommand` directive\n * when the underlying command is active.\n */\nexport const TOOLBAR_BUTTON_CLASS =\n 'inline-flex h-[1.85rem] w-[1.85rem] cursor-pointer items-center justify-center rounded-[0.4rem] border border-border bg-card text-muted-foreground transition hover:border-accent/50 hover:bg-secondary hover:text-foreground disabled:cursor-not-allowed disabled:opacity-45 [&.qalma-command-active]:border-accent/40 [&.qalma-command-active]:bg-accent-subtle [&.qalma-command-active]:text-accent';\n\n/**\n * Generic, declarative toolbar button for a single editor command.\n *\n * Renders a native `<button>` wired to the `QalmaCommand` directive (execute /\n * active / disabled / aria) with an `<ng-icon>`, so a whole toolbar becomes a\n * list of `<qalma-toolbar-button command icon label />` instead of the\n * six-line `<button qalmaCommand><ng-icon></button>` block repeated per\n * command. The host uses `display: contents` so the inner button participates\n * directly in the surrounding toolbar's flex layout.\n *\n * Icons resolve from the `NgIcon` provider scope of the surrounding component\n * (register them with `provideIcons({ … })` as usual).\n */\n@Component({\n selector: 'qalma-toolbar-button',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgIcon, QalmaCommand],\n host: {\n class: 'contents',\n },\n template: `\n <button\n type=\"button\"\n [qalmaCommand]=\"command()\"\n [qalmaCommandValue]=\"value()\"\n [class]=\"buttonClass\"\n [title]=\"label()\"\n [attr.aria-label]=\"label()\"\n >\n <ng-icon [class]=\"iconClass()\" [name]=\"icon()\" aria-hidden=\"true\" />\n </button>\n `,\n})\nexport class QalmaToolbarButton {\n /** Command name to execute, e.g. `toggleBold`. */\n readonly command = input.required<string>();\n /** Optional command payload (forwarded to `qalmaCommandValue`). */\n readonly value = input<unknown>();\n /** Lucide (or any registered) icon name, e.g. `lucideBold`. */\n readonly icon = input.required<string>();\n /** Accessible name — used for both `title` and `aria-label`. */\n readonly label = input.required<string>();\n /** Optional icon-size class override (default: `text-[0.9rem]`). */\n readonly iconClass = input('text-[0.9rem]');\n\n protected readonly buttonClass = TOOLBAR_BUTTON_CLASS;\n}\n","import type { TemplateRef } from '@angular/core';\n\n/**\n * A single command button in a toolbar registry: which editor command to run,\n * which icon to show, and its accessible label. `value` is forwarded to the\n * command as its payload when present.\n */\nexport interface ToolbarCommandItem {\n readonly command: string;\n readonly icon: string;\n readonly label: string;\n readonly value?: unknown;\n}\n\n/**\n * An escape hatch for controls that are not a plain command button (color\n * pickers, upload buttons, a language `<select>`…). The consumer supplies an\n * `<ng-template>` and the toolbar renders it inline at this position.\n */\nexport interface ToolbarTemplateItem {\n readonly template: TemplateRef<unknown>;\n}\n\nexport type ToolbarItem = ToolbarCommandItem | ToolbarTemplateItem;\n\n/** One separator-delimited run of items. Empty groups render nothing. */\nexport type ToolbarGroup = readonly ToolbarItem[];\n\nexport function isToolbarCommandItem(\n item: ToolbarItem,\n): item is ToolbarCommandItem {\n return 'command' in item;\n}\n\n// ---------------------------------------------------------------------------\n// Default command fragments — the declarative source of truth for the standard\n// editor toolbar, reusable across consumers (playground, sandbox, downstream\n// apps). Compose them into `ToolbarGroup[]` and hand them to\n// `<qalma-toolbar-registry>`; interleave custom controls with `ToolbarTemplateItem`.\n// ---------------------------------------------------------------------------\n\nexport const QALMA_TOOLBAR_HEADINGS: readonly ToolbarCommandItem[] = [\n { command: 'setParagraph', icon: 'lucidePilcrow', label: 'Paragraph' },\n { command: 'toggleHeading1', icon: 'lucideHeading1', label: 'Heading 1' },\n { command: 'toggleHeading2', icon: 'lucideHeading2', label: 'Heading 2' },\n { command: 'toggleHeading3', icon: 'lucideHeading3', label: 'Heading 3' },\n];\n\nexport const QALMA_TOOLBAR_INLINE_MARKS: readonly ToolbarCommandItem[] = [\n { command: 'toggleBold', icon: 'lucideBold', label: 'Bold' },\n { command: 'toggleItalic', icon: 'lucideItalic', label: 'Italic' },\n { command: 'toggleUnderline', icon: 'lucideUnderline', label: 'Underline' },\n {\n command: 'toggleStrike',\n icon: 'lucideStrikethrough',\n label: 'Strikethrough',\n },\n { command: 'toggleInlineCode', icon: 'lucideCode', label: 'Inline code' },\n { command: 'toggleMonospace', icon: 'lucideLetterText', label: 'Monospace' },\n { command: 'toggleSubscript', icon: 'lucideSubscript', label: 'Subscript' },\n {\n command: 'toggleSuperscript',\n icon: 'lucideSuperscript',\n label: 'Superscript',\n },\n];\n\nexport const QALMA_TOOLBAR_ALIGN: readonly ToolbarCommandItem[] = [\n { command: 'setTextAlignLeft', icon: 'lucideAlignLeft', label: 'Align left' },\n {\n command: 'setTextAlignCenter',\n icon: 'lucideAlignCenter',\n label: 'Align center',\n },\n {\n command: 'setTextAlignRight',\n icon: 'lucideAlignRight',\n label: 'Align right',\n },\n {\n command: 'setTextAlignJustify',\n icon: 'lucideAlignJustify',\n label: 'Justify',\n },\n];\n\nexport const QALMA_TOOLBAR_LISTS: readonly ToolbarCommandItem[] = [\n { command: 'toggleBulletList', icon: 'lucideList', label: 'Bullet list' },\n {\n command: 'toggleOrderedList',\n icon: 'lucideListOrdered',\n label: 'Ordered list',\n },\n { command: 'toggleTaskList', icon: 'lucideListTodo', label: 'Task list' },\n { command: 'liftListItem', icon: 'lucideOutdent', label: 'Outdent' },\n { command: 'sinkListItem', icon: 'lucideIndent', label: 'Indent' },\n { command: 'toggleBlockquote', icon: 'lucideTextQuote', label: 'Blockquote' },\n { command: 'toggleCodeBlock', icon: 'lucideSquareCode', label: 'Code block' },\n];\n\n/** Always-available table entry point (inserting a new table). */\nexport const QALMA_TOOLBAR_TABLE_INSERT: ToolbarCommandItem = {\n command: 'insertTable',\n icon: 'lucideTable',\n label: 'Insert table',\n};\n\n/** Table editing commands — only meaningful while the selection is in a table. */\nexport const QALMA_TOOLBAR_TABLE_OPS: readonly ToolbarCommandItem[] = [\n {\n command: 'addRowAfter',\n icon: 'lucideBetweenHorizontalEnd',\n label: 'Add row',\n },\n {\n command: 'addColumnAfter',\n icon: 'lucideBetweenVerticalEnd',\n label: 'Add column',\n },\n { command: 'deleteRow', icon: 'lucideRows3', label: 'Delete row' },\n { command: 'deleteColumn', icon: 'lucideColumns3', label: 'Delete column' },\n {\n command: 'toggleHeaderRow',\n icon: 'lucideHeading',\n label: 'Toggle header row',\n },\n { command: 'deleteTable', icon: 'lucideTrash2', label: 'Delete table' },\n];\n\nexport const QALMA_TOOLBAR_HISTORY: readonly ToolbarCommandItem[] = [\n { command: 'undo', icon: 'lucideUndo2', label: 'Undo' },\n { command: 'redo', icon: 'lucideRedo2', label: 'Redo' },\n];\n\n/** Standalone command that usually sits alongside the color controls. */\nexport const QALMA_TOOLBAR_CLEAR_FORMATTING: ToolbarCommandItem = {\n command: 'clearFormatting',\n icon: 'lucideEraser',\n label: 'Clear formatting',\n};\n\n/** Standalone command that usually sits alongside the link/insert controls. */\nexport const QALMA_TOOLBAR_UNSET_LINK: ToolbarCommandItem = {\n command: 'unsetLink',\n icon: 'lucideUnlink',\n label: 'Unlink',\n};\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n computed,\n input,\n} from '@angular/core';\n\nimport { QalmaToolbarButton } from './toolbar-button';\nimport {\n ToolbarCommandItem,\n ToolbarGroup,\n ToolbarItem,\n ToolbarTemplateItem,\n isToolbarCommandItem,\n} from './toolbar-commands';\n\n/** Vertical divider rendered between non-empty toolbar groups. */\nexport const TOOLBAR_SEPARATOR_CLASS =\n 'mx-0.5 h-5 w-px shrink-0 self-center bg-border';\n\n/**\n * Renders a declarative toolbar registry: an ordered list of groups, each a\n * list of command buttons and/or inline custom-control templates, with a\n * separator drawn between non-empty groups.\n *\n * Meant to sit inside the editor's `<qalma-toolbar>` (which owns the\n * `role=\"toolbar\"` semantics); the host uses `display: contents` so the\n * rendered buttons participate directly in that container's flex layout.\n *\n * ```html\n * <qalma-toolbar class=\"flex …\">\n * <ng-template #colors> … custom controls … </ng-template>\n * <qalma-toolbar-registry [groups]=\"[headings, marks, [{ template: colors }]]\" />\n * </qalma-toolbar>\n * ```\n */\n@Component({\n selector: 'qalma-toolbar-registry',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, QalmaToolbarButton],\n host: {\n class: 'contents',\n },\n template: `\n @for (group of visibleGroups(); track $index; let first = $first) {\n @if (!first) {\n <span [class]=\"separatorClass()\" aria-hidden=\"true\"></span>\n }\n @for (item of group; track $index) {\n @if (asCommand(item); as command) {\n <qalma-toolbar-button\n [command]=\"command.command\"\n [value]=\"command.value\"\n [icon]=\"command.icon\"\n [label]=\"command.label\"\n />\n } @else {\n <ng-container [ngTemplateOutlet]=\"asTemplate(item)\" />\n }\n }\n }\n `,\n})\nexport class QalmaToolbarRegistry {\n readonly groups = input.required<readonly ToolbarGroup[]>();\n readonly separatorClass = input(TOOLBAR_SEPARATOR_CLASS);\n\n /** Drop empty groups so they neither render content nor a dangling separator. */\n protected readonly visibleGroups = computed(() =>\n this.groups().filter((group) => group.length > 0),\n );\n\n protected asCommand(item: ToolbarItem): ToolbarCommandItem | null {\n return isToolbarCommandItem(item) ? item : null;\n }\n\n protected asTemplate(item: ToolbarItem): TemplateRef<unknown> {\n return (item as ToolbarTemplateItem).template;\n }\n}\n","import { provideIcons } from '@ng-icons/core';\nimport {\n lucideAlignCenter,\n lucideAlignJustify,\n lucideAlignLeft,\n lucideAlignRight,\n lucideBetweenHorizontalEnd,\n lucideBetweenVerticalEnd,\n lucideBold,\n lucideCode,\n lucideColumns3,\n lucideEraser,\n lucideHeading,\n lucideHeading1,\n lucideHeading2,\n lucideHeading3,\n lucideIndent,\n lucideItalic,\n lucideLetterText,\n lucideList,\n lucideListOrdered,\n lucideListTodo,\n lucideOutdent,\n lucidePilcrow,\n lucideRedo2,\n lucideRows3,\n lucideSquareCode,\n lucideStrikethrough,\n lucideSubscript,\n lucideSuperscript,\n lucideTable,\n lucideTextQuote,\n lucideTrash2,\n lucideUnderline,\n lucideUndo2,\n lucideUnlink,\n} from '@ng-icons/lucide';\n\n/**\n * Registers the Lucide icons referenced by the default toolbar command\n * fragments (`QALMA_TOOLBAR_*`), so consumers can wire the standard toolbar\n * without re-declaring the icon set:\n *\n * ```ts\n * providers: [provideQalmaToolbarIcons()]\n * ```\n *\n * Add your own `provideIcons({ … })` alongside it for any custom controls\n * (color pickers, upload buttons…) that live outside the command registry.\n */\nexport function provideQalmaToolbarIcons() {\n return provideIcons({\n lucideAlignCenter,\n lucideAlignJustify,\n lucideAlignLeft,\n lucideAlignRight,\n lucideBetweenHorizontalEnd,\n lucideBetweenVerticalEnd,\n lucideBold,\n lucideCode,\n lucideColumns3,\n lucideEraser,\n lucideHeading,\n lucideHeading1,\n lucideHeading2,\n lucideHeading3,\n lucideIndent,\n lucideItalic,\n lucideLetterText,\n lucideList,\n lucideListOrdered,\n lucideListTodo,\n lucideOutdent,\n lucidePilcrow,\n lucideRedo2,\n lucideRows3,\n lucideSquareCode,\n lucideStrikethrough,\n lucideSubscript,\n lucideSuperscript,\n lucideTable,\n lucideTextQuote,\n lucideTrash2,\n lucideUnderline,\n lucideUndo2,\n lucideUnlink,\n });\n}\n","import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","import { Directive, ElementRef, computed, inject, input } from '@angular/core';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from './cn';\n\nexport const buttonVariants = cva(\n 'inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_ng-icon]:shrink-0',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/90',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n outline:\n 'border border-border bg-card text-foreground hover:bg-secondary hover:text-secondary-foreground',\n ghost:\n 'text-foreground hover:bg-secondary hover:text-secondary-foreground',\n accent: 'bg-accent text-accent-foreground hover:bg-accent/90',\n link: 'text-accent underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2',\n sm: 'h-8 rounded-md px-3 text-xs',\n lg: 'h-11 rounded-md px-6 text-base',\n icon: 'h-9 w-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nexport type ButtonVariant = NonNullable<\n VariantProps<typeof buttonVariants>['variant']\n>;\nexport type ButtonSize = NonNullable<\n VariantProps<typeof buttonVariants>['size']\n>;\n\n/**\n * Headless-styled button directive so it composes onto native `<button>` and\n * `<a>` elements while reading from the host's Tailwind design tokens.\n */\n@Directive({\n selector: 'button[qalmaBtn], a[qalmaBtn]',\n host: {\n '[class]': 'computedClass()',\n },\n})\nexport class QalmaButton {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly initialClass =\n this.host.nativeElement.getAttribute('class') ?? '';\n\n readonly variant = input<ButtonVariant>('default');\n readonly size = input<ButtonSize>('default');\n\n protected readonly computedClass = computed(() =>\n cn(\n buttonVariants({ variant: this.variant(), size: this.size() }),\n this.initialClass,\n ),\n );\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { QalmaEditorController } from '@qalma/editor';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport {\n lucideArrowDown,\n lucideArrowUp,\n lucideCopy,\n lucideGripVertical,\n lucideMousePointer2,\n lucideTrash2,\n} from '@ng-icons/lucide';\n\nimport {\n DismissibleOverlay,\n QalmaDragBlockHighlight,\n QalmaDragDropIndicator,\n QalmaDragHandleView,\n} from '@qalma/kit/headless';\n\nimport { QalmaButton } from './button';\n\nexport interface QalmaDragStart {\n event: PointerEvent;\n handle: QalmaDragHandleView;\n}\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgIcon, QalmaButton],\n providers: [\n provideIcons({\n lucideArrowDown,\n lucideArrowUp,\n lucideCopy,\n lucideGripVertical,\n lucideMousePointer2,\n lucideTrash2,\n }),\n ],\n selector: 'qalma-drag-handle',\n template: `\n @if (draggedBlockHighlight(); as highlight) {\n <div\n data-qalma-dragging-block-highlight\n class=\"pointer-events-none fixed left-0 top-0 z-20 rounded-md border border-accent bg-accent-subtle/80 opacity-70 shadow-md will-change-transform\"\n [style.transform]=\"highlight.transform\"\n [style.width.px]=\"highlight.width\"\n [style.height.px]=\"highlight.height\"\n ></div>\n }\n\n @if (dropIndicator(); as indicator) {\n <div\n data-qalma-drag-drop-line\n class=\"pointer-events-none fixed left-0 top-0 z-40 h-0.5 rounded-full bg-accent shadow-md will-change-transform\"\n [style.transform]=\"indicator.transform\"\n [style.width.px]=\"indicator.width\"\n ></div>\n }\n\n @if (handle(); as handle) {\n <div\n data-qalma-drag-handle\n class=\"fixed left-0 top-0 z-30 flex items-start gap-1 will-change-transform\"\n tabindex=\"-1\"\n [style.transform]=\"handle.transform\"\n (mousedown)=\"preserveSelection($event)\"\n (keydown.escape)=\"dismissFromKeyboard($event)\"\n >\n <button\n qalmaBtn\n variant=\"ghost\"\n size=\"icon\"\n type=\"button\"\n class=\"!h-[1.85rem] !w-[1.85rem] cursor-grab rounded-[0.4rem] border border-transparent bg-card/95 text-muted-foreground shadow-sm active:cursor-grabbing hover:border-border hover:bg-secondary hover:text-foreground\"\n [class.border-accent]=\"menuOpen()\"\n [class.text-accent]=\"menuOpen()\"\n (pointerdown)=\"startDrag($event, handle)\"\n (click)=\"toggleMenu()\"\n title=\"Block actions\"\n aria-label=\"Block actions\"\n [attr.aria-expanded]=\"menuOpen()\"\n >\n <ng-icon\n class=\"text-[0.9rem]\"\n name=\"lucideGripVertical\"\n aria-hidden=\"true\"\n />\n </button>\n\n @if (menuOpen()) {\n <div\n role=\"menu\"\n aria-label=\"Block actions\"\n class=\"w-44 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg\"\n >\n <button\n type=\"button\"\n class=\"flex h-8 w-full cursor-pointer items-center gap-2 rounded-sm px-2 text-left text-xs font-medium text-foreground transition hover:bg-secondary disabled:cursor-not-allowed disabled:opacity-45\"\n [disabled]=\"!canExecute('selectBlock', handle)\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"execute('selectBlock', handle)\"\n role=\"menuitem\"\n >\n <ng-icon name=\"lucideMousePointer2\" aria-hidden=\"true\" />\n Select block\n </button>\n <button\n type=\"button\"\n class=\"flex h-8 w-full cursor-pointer items-center gap-2 rounded-sm px-2 text-left text-xs font-medium text-foreground transition hover:bg-secondary disabled:cursor-not-allowed disabled:opacity-45\"\n [disabled]=\"!handle.canMoveUp\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"execute('moveBlockUp', handle)\"\n role=\"menuitem\"\n >\n <ng-icon name=\"lucideArrowUp\" aria-hidden=\"true\" />\n Move up\n </button>\n <button\n type=\"button\"\n class=\"flex h-8 w-full cursor-pointer items-center gap-2 rounded-sm px-2 text-left text-xs font-medium text-foreground transition hover:bg-secondary disabled:cursor-not-allowed disabled:opacity-45\"\n [disabled]=\"!handle.canMoveDown\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"execute('moveBlockDown', handle)\"\n role=\"menuitem\"\n >\n <ng-icon name=\"lucideArrowDown\" aria-hidden=\"true\" />\n Move down\n </button>\n <button\n type=\"button\"\n class=\"flex h-8 w-full cursor-pointer items-center gap-2 rounded-sm px-2 text-left text-xs font-medium text-foreground transition hover:bg-secondary disabled:cursor-not-allowed disabled:opacity-45\"\n [disabled]=\"!canExecute('duplicateBlock', handle)\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"execute('duplicateBlock', handle)\"\n role=\"menuitem\"\n >\n <ng-icon name=\"lucideCopy\" aria-hidden=\"true\" />\n Duplicate\n </button>\n <button\n type=\"button\"\n class=\"flex h-8 w-full cursor-pointer items-center gap-2 rounded-sm px-2 text-left text-xs font-medium text-destructive transition hover:bg-destructive/10 disabled:cursor-not-allowed disabled:opacity-45\"\n [disabled]=\"!canExecute('deleteBlock', handle)\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"execute('deleteBlock', handle)\"\n role=\"menuitem\"\n >\n <ng-icon name=\"lucideTrash2\" aria-hidden=\"true\" />\n Delete\n </button>\n </div>\n }\n </div>\n }\n `,\n})\nexport class QalmaDragHandle {\n readonly editor = input.required<QalmaEditorController>();\n readonly handle = input<QalmaDragHandleView | null>(null);\n readonly dropIndicator = input<QalmaDragDropIndicator | null>(null);\n readonly draggedBlockHighlight = input<QalmaDragBlockHighlight | null>(\n null,\n );\n readonly dismiss = output<void>();\n readonly dragStart = output<QalmaDragStart>();\n\n protected readonly menuOpen = signal(false);\n\n constructor() {\n // Close the block-actions menu on an outside pointerdown or Escape. A click\n // on the handle button or the menu itself (both under `[data-qalma-drag-handle]`)\n // is treated as inside, so it doesn't self-dismiss. Connected for the\n // component's lifetime; the callback is a no-op while the menu is closed.\n new DismissibleOverlay({\n isInside: (target) =>\n target instanceof Element &&\n !!target.closest('[data-qalma-drag-handle]'),\n onDismiss: () => this.menuOpen.set(false),\n }).connect(inject(DestroyRef));\n }\n\n protected toggleMenu(): void {\n this.menuOpen.update((open) => !open);\n }\n\n protected startDrag(\n event: PointerEvent,\n handle: QalmaDragHandleView,\n ): void {\n this.menuOpen.set(false);\n this.dragStart.emit({ event, handle });\n }\n\n protected canExecute(\n command: string,\n handle: QalmaDragHandleView,\n ): boolean {\n return this.editor().canExecute(command, handle.target);\n }\n\n protected execute(command: string, handle: QalmaDragHandleView): void {\n if (this.editor().execute(command, handle.target)) {\n this.dismissHandle();\n }\n }\n\n protected preserveSelection(event: MouseEvent): void {\n event.preventDefault();\n }\n\n protected dismissFromKeyboard(event: Event): void {\n event.preventDefault();\n this.dismissHandle();\n }\n\n protected dismissHandle(): void {\n this.menuOpen.set(false);\n this.dismiss.emit();\n }\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\nimport { QalmaSuggestionMenu } from '@qalma/kit/headless';\n\nexport interface QalmaMentionOption {\n readonly id: string;\n readonly label: string;\n readonly description: string;\n}\n\n/**\n * Caret-anchored mention suggestion menu: an avatar-initial list with a loading\n * state. Positioning, keyboard handling and active highlighting come from\n * {@link QalmaSuggestionMenu}; feed it a `placement` (see `flipAbovePlacement`)\n * and the filtered `suggestions`.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'qalma-mention-menu',\n template: `\n @if (placement(); as placement) {\n <div\n role=\"listbox\"\n aria-label=\"Mention suggestions\"\n class=\"fixed z-20 w-[min(280px,calc(100vw-24px))] overflow-hidden rounded-md border border-border bg-popover p-1 text-sm text-popover-foreground shadow-lg outline-none\"\n [style.left.px]=\"placement.left\"\n [style.top.px]=\"placement.top\"\n [style.bottom.px]=\"placement.bottom\"\n [style.max-height.px]=\"placement.maxHeight\"\n >\n @if (loading()) {\n <div\n class=\"flex items-center gap-2 px-2 py-2 text-sm text-muted-foreground\"\n >\n <span\n class=\"size-7 animate-pulse rounded-sm border border-border bg-secondary\"\n aria-hidden=\"true\"\n ></span>\n <span>Loading…</span>\n </div>\n } @else {\n <div class=\"max-h-full overflow-y-auto\">\n @for (\n option of suggestions();\n track option.id;\n let index = $index\n ) {\n <button\n type=\"button\"\n role=\"option\"\n [attr.data-suggestion-index]=\"index\"\n class=\"group grid h-12 w-full min-w-0 cursor-pointer grid-cols-[1.75rem_minmax(0,1fr)] items-center gap-2 rounded-sm px-2 text-left transition-colors hover:bg-accent-subtle hover:text-foreground focus:bg-accent-subtle focus:text-foreground focus:outline-none\"\n [class.bg-accent-subtle]=\"index === activeIndex()\"\n [class.text-foreground]=\"index === activeIndex()\"\n [attr.aria-selected]=\"index === activeIndex()\"\n [attr.tabindex]=\"index === activeIndex() ? 0 : -1\"\n (mouseenter)=\"activate.emit(index)\"\n (mousedown)=\"preserveSelection($event)\"\n (keydown)=\"handleOptionKeydown($event, option, index)\"\n (click)=\"pick.emit(option)\"\n >\n <span\n class=\"flex size-7 items-center justify-center rounded-sm border border-border bg-card text-xs font-semibold text-foreground\"\n [class.border-accent]=\"index === activeIndex()\"\n [class.bg-background]=\"index === activeIndex()\"\n [class.text-accent]=\"index === activeIndex()\"\n aria-hidden=\"true\"\n >\n {{ option.label.slice(0, 1) }}\n </span>\n <span class=\"min-w-0\">\n <span class=\"block truncate font-medium leading-5\">{{\n option.label\n }}</span>\n @if (index === activeIndex()) {\n <span\n class=\"block truncate text-xs leading-4 text-foreground\"\n >\n {{ option.description }}\n </span>\n } @else {\n <span\n class=\"block truncate text-xs leading-4 text-muted-foreground group-hover:text-foreground group-focus:text-foreground\"\n >\n {{ option.description }}\n </span>\n }\n </span>\n </button>\n }\n </div>\n }\n </div>\n }\n `,\n})\nexport class QalmaMentionMenu extends QalmaSuggestionMenu<QalmaMentionOption> {\n readonly suggestions = input<readonly QalmaMentionOption[]>([]);\n readonly loading = input(false);\n\n protected readonly optionList = this.suggestions;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n effect,\n input,\n} from '@angular/core';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport {\n lucideCode,\n lucideHeading1,\n lucideHeading2,\n lucideHeading3,\n lucideList,\n lucideListOrdered,\n lucideListTodo,\n lucideMinus,\n lucidePilcrow,\n lucideSquareCode,\n lucideTable,\n lucideTextQuote,\n} from '@ng-icons/lucide';\nimport { QalmaCommandValue } from '@qalma/editor';\n\nimport { QalmaSuggestionMenu } from '@qalma/kit/headless';\n\nexport interface QalmaSlashCommandOption {\n readonly id: string;\n readonly label: string;\n readonly description: string;\n readonly icon: string;\n readonly shortcut: string;\n /** Editor command to run when the option is picked. */\n readonly command: string;\n readonly value?: QalmaCommandValue;\n readonly placement?: 'block' | 'inline';\n /** Extra terms the consumer can match against when filtering. */\n readonly keywords: readonly string[];\n}\n\n/**\n * Caret-anchored slash-command menu: an icon + shortcut list with a \"Commands\"\n * header and an Escape hint footer, scrolling the active option into view.\n * Positioning, keyboard handling and active highlighting come from\n * {@link QalmaSuggestionMenu}; feed it a `placement` (see `flipAbovePlacement`)\n * and the filtered `options`. Ships the default block-command icon set.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgIcon],\n providers: [\n provideIcons({\n lucideCode,\n lucideHeading1,\n lucideHeading2,\n lucideHeading3,\n lucideList,\n lucideListOrdered,\n lucideListTodo,\n lucideMinus,\n lucidePilcrow,\n lucideSquareCode,\n lucideTable,\n lucideTextQuote,\n }),\n ],\n selector: 'qalma-slash-command-menu',\n template: `\n @if (placement(); as placement) {\n <div\n role=\"listbox\"\n aria-label=\"Slash command suggestions\"\n class=\"fixed z-20 flex w-[min(320px,calc(100vw-24px))] flex-col overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg outline-none\"\n [style.left.px]=\"placement.left\"\n [style.top.px]=\"placement.top\"\n [style.bottom.px]=\"placement.bottom\"\n [style.max-height.px]=\"placement.maxHeight\"\n >\n <div\n class=\"shrink-0 px-2 py-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground\"\n >\n Commands\n </div>\n <div data-suggestion-options class=\"min-h-0 flex-1 overflow-y-auto\">\n @for (option of options(); track option.id; let index = $index) {\n <button\n type=\"button\"\n role=\"option\"\n [attr.data-suggestion-index]=\"index\"\n class=\"group grid h-11 w-full min-w-0 cursor-pointer grid-cols-[1.75rem_minmax(0,1fr)_auto] items-center gap-2 rounded-sm px-2 text-left text-sm transition-colors hover:bg-accent-subtle hover:text-foreground focus:bg-accent-subtle focus:text-foreground focus:outline-none\"\n [class.bg-accent-subtle]=\"index === activeIndex()\"\n [class.text-foreground]=\"index === activeIndex()\"\n [attr.aria-selected]=\"index === activeIndex()\"\n [attr.tabindex]=\"index === activeIndex() ? 0 : -1\"\n (mouseenter)=\"activate.emit(index)\"\n (mousedown)=\"preserveSelection($event)\"\n (keydown)=\"handleOptionKeydown($event, option, index)\"\n (click)=\"pick.emit(option)\"\n >\n <span\n class=\"flex size-7 items-center justify-center rounded-sm border border-border bg-card text-[14px] text-foreground\"\n [class.border-accent]=\"index === activeIndex()\"\n [class.bg-background]=\"index === activeIndex()\"\n [class.text-accent]=\"index === activeIndex()\"\n >\n <ng-icon [name]=\"option.icon\" aria-hidden=\"true\" />\n </span>\n <span class=\"min-w-0\">\n <span class=\"block truncate font-medium leading-5\">{{\n option.label\n }}</span>\n @if (index === activeIndex()) {\n <span\n class=\"block truncate text-xs leading-4 text-foreground\"\n >\n {{ option.description }}\n </span>\n } @else {\n <span\n class=\"block truncate text-xs leading-4 text-muted-foreground group-hover:text-foreground group-focus:text-foreground\"\n >\n {{ option.description }}\n </span>\n }\n </span>\n <kbd\n class=\"rounded-sm border border-border bg-card px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground\"\n [class.border-accent]=\"index === activeIndex()\"\n [class.bg-background]=\"index === activeIndex()\"\n [class.text-accent]=\"index === activeIndex()\"\n >\n {{ option.shortcut }}\n </kbd>\n </button>\n }\n </div>\n <div\n class=\"mt-1 flex h-8 shrink-0 items-center justify-between border-t border-border px-2 text-[11px] text-muted-foreground\"\n >\n <span>Close menu</span>\n <kbd\n class=\"rounded-sm border border-border bg-card px-1.5 py-0.5 font-mono\"\n >esc</kbd\n >\n </div>\n </div>\n }\n `,\n})\nexport class QalmaSlashCommandMenu extends QalmaSuggestionMenu<QalmaSlashCommandOption> {\n readonly options = input<readonly QalmaSlashCommandOption[]>([]);\n\n protected readonly optionList = this.options;\n\n constructor() {\n super();\n\n effect(() => {\n const activeIndex = this.activeIndex();\n\n this.options();\n queueMicrotask(() => this.scrollOptionIntoView(activeIndex));\n });\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n input,\n output,\n} from '@angular/core';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport {\n lucideCheck,\n lucideExternalLink,\n lucideLink,\n lucidePencil,\n lucideUnlink,\n lucideX,\n} from '@ng-icons/lucide';\n\nimport { LinkPopover } from '@qalma/kit/headless';\n\nimport { QalmaButton } from './button';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgIcon, QalmaButton],\n providers: [\n provideIcons({\n lucideCheck,\n lucideExternalLink,\n lucideLink,\n lucidePencil,\n lucideUnlink,\n lucideX,\n }),\n ],\n selector: 'qalma-link-popover',\n template: `\n @if (popover(); as popover) {\n <div\n data-qalma-link-popover\n role=\"dialog\"\n aria-label=\"Link preview\"\n class=\"fixed z-20 w-[min(360px,calc(100vw-32px))] rounded-md border border-border bg-popover p-1.5 text-sm text-popover-foreground shadow-lg outline-none\"\n [style.left.px]=\"popover.left\"\n [style.top.px]=\"popover.top\"\n (mouseenter)=\"keepOpen.emit()\"\n (mouseleave)=\"scheduleHide.emit()\"\n (focusin)=\"keepOpen.emit()\"\n (focusout)=\"scheduleHide.emit()\"\n >\n @if (popover.editing) {\n <div class=\"flex items-center gap-1.5\">\n <label\n class=\"flex h-9 min-w-0 flex-1 items-center gap-2 rounded-md border border-input bg-background px-2 text-sm transition focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30\"\n >\n <ng-icon\n class=\"shrink-0 text-muted-foreground\"\n name=\"lucideLink\"\n aria-hidden=\"true\"\n />\n <input\n class=\"min-w-0 flex-1 bg-transparent text-foreground outline-none placeholder:text-muted-foreground\"\n type=\"url\"\n aria-label=\"Edit link URL\"\n [value]=\"href()\"\n (input)=\"updateHref($event)\"\n />\n </label>\n <button\n qalmaBtn\n size=\"icon\"\n type=\"button\"\n [disabled]=\"!href().trim()\"\n (click)=\"save.emit(popover)\"\n title=\"Save link\"\n aria-label=\"Save link\"\n >\n <ng-icon name=\"lucideCheck\" aria-hidden=\"true\" />\n </button>\n <button\n qalmaBtn\n variant=\"outline\"\n size=\"icon\"\n type=\"button\"\n (click)=\"dismiss.emit()\"\n title=\"Cancel\"\n aria-label=\"Cancel\"\n >\n <ng-icon name=\"lucideX\" aria-hidden=\"true\" />\n </button>\n </div>\n } @else {\n <div class=\"flex items-center gap-1.5\">\n <a\n class=\"inline-flex h-9 min-w-0 flex-1 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-accent transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n [href]=\"popover.href\"\n [target]=\"popover.target ?? '_blank'\"\n [rel]=\"popover.rel ?? 'noopener noreferrer'\"\n title=\"Open link\"\n >\n <span class=\"min-w-0 truncate font-medium\">{{\n popover.href\n }}</span>\n <ng-icon\n class=\"shrink-0 text-base\"\n name=\"lucideExternalLink\"\n aria-hidden=\"true\"\n />\n </a>\n <button\n qalmaBtn\n variant=\"outline\"\n size=\"icon\"\n type=\"button\"\n (click)=\"edit.emit(popover)\"\n title=\"Edit link\"\n aria-label=\"Edit link\"\n >\n <ng-icon name=\"lucidePencil\" aria-hidden=\"true\" />\n </button>\n <button\n qalmaBtn\n variant=\"ghost\"\n size=\"icon\"\n type=\"button\"\n class=\"text-destructive hover:bg-destructive/10 hover:text-destructive\"\n (click)=\"remove.emit(popover)\"\n title=\"Unlink\"\n aria-label=\"Unlink\"\n >\n <ng-icon name=\"lucideUnlink\" aria-hidden=\"true\" />\n </button>\n </div>\n }\n </div>\n }\n `,\n})\nexport class QalmaLinkPopover {\n readonly popover = input<LinkPopover | null>(null);\n readonly href = input.required<string>();\n\n readonly hrefChange = output<string>();\n readonly edit = output<LinkPopover>();\n readonly save = output<LinkPopover>();\n readonly remove = output<LinkPopover>();\n readonly dismiss = output<void>();\n readonly keepOpen = output<void>();\n readonly scheduleHide = output<void>();\n\n protected updateHref(event: Event): void {\n const target = event.target;\n\n if (target instanceof HTMLInputElement) {\n this.hrefChange.emit(target.value);\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n input,\n output,\n} from '@angular/core';\nimport { QalmaToolbar } from '@qalma/editor';\n\nimport { QalmaContextualToolbarPlacement } from '@qalma/kit/headless';\n\n/**\n * Floating, selection-anchored toolbar container. It owns the hard parts — the\n * fixed-position `transform` from a {@link QalmaContextualToolbarPlacement}\n * (see `QalmaSelectionToolbarDirective`), preserving the editor selection on\n * pointer-down, and Escape-to-dismiss — and projects whatever controls you put\n * inside it. Nothing about the button set is baked in: compose\n * `<qalma-toolbar-button>` for commands and your own buttons for app actions\n * (opening a link editor, a color picker, an AI action…).\n *\n * The container's `mousedown` handler preserves the selection for every\n * projected control via event bubbling, so inner buttons don't each need to.\n *\n * ```html\n * <qalma-contextual-toolbar\n * [placement]=\"selection.placement()\"\n * (dismiss)=\"selection.hide()\"\n * >\n * <qalma-toolbar-button command=\"toggleBold\" icon=\"lucideBold\" label=\"Bold\" />\n * <qalma-toolbar-button command=\"toggleItalic\" icon=\"lucideItalic\" label=\"Italic\" />\n * <button type=\"button\" [class]=\"TOOLBAR_BUTTON_CLASS\" (click)=\"openLinkEditor()\">…</button>\n * </qalma-contextual-toolbar>\n * ```\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [QalmaToolbar],\n selector: 'qalma-contextual-toolbar',\n template: `\n @if (placement(); as placement) {\n <qalma-toolbar\n [label]=\"label()\"\n class=\"fixed left-0 top-0 z-30 flex items-center gap-0.5 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg will-change-transform\"\n [style.transform]=\"placement.transform\"\n (mousedown)=\"preserveSelection($event)\"\n (keydown.escape)=\"dismissFromKeyboard($event)\"\n >\n <ng-content />\n </qalma-toolbar>\n }\n `,\n})\nexport class QalmaContextualToolbar {\n readonly placement = input<QalmaContextualToolbarPlacement | null>(null);\n /** Accessible name for the toolbar region. */\n readonly label = input('Selection formatting');\n readonly dismiss = output<void>();\n\n protected preserveSelection(event: MouseEvent): void {\n event.preventDefault();\n }\n\n protected dismissFromKeyboard(event: Event): void {\n event.preventDefault();\n this.dismiss.emit();\n }\n}\n","// @qalma/kit — Tailwind/shadcn-flavored UI for the Qalma editor.\n//\n// This entry point is the styled tier: components that pull `cva` + `@ng-icons`\n// and read the host's design tokens. It re-exports the entire dependency-free\n// `@qalma/kit/headless` surface (controllers, geometry, keyboard nav) so it\n// stays a superset — bring-your-own-design-system consumers can import the\n// leaner `@qalma/kit/headless` directly instead.\n//\n// The internal `QalmaButton` directive and `cn()` helper are intentionally NOT\n// exported: a host already has a button and a class-merge utility in its design\n// system. They remain private implementation details of the styled components.\nexport * from '@qalma/kit/headless';\n\n// Toolbar\nexport * from './lib/toolbar-button';\nexport * from './lib/toolbar-commands';\nexport * from './lib/toolbar-registry';\nexport * from './lib/toolbar-icons';\n\n// Editor surface components\nexport * from './lib/drag-handle';\nexport * from './lib/mention-menu';\nexport * from './lib/slash-command-menu';\nexport * from './lib/link-popover';\nexport * from './lib/contextual-toolbar';\n","/**\n * Generated bundle index. Do not edit.\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OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAdvB;;;;;;;;;;;;AAYT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAdS,YAAY,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAgBX,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAlBlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,OAAO,EAAE,CAAC,YAAY,CAAC;AACvB,oBAAA,QAAQ,EAAE,0BAA0B;AACpC,oBAAA,QAAQ,EAAE;;;;;;;;;;;;AAYT,EAAA,CAAA;AACF,iBAAA;;;AClDD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qalma/kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Tailwind-first, themeable UI components for the Qalma editor.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -49,6 +49,10 @@
|
|
|
49
49
|
".": {
|
|
50
50
|
"types": "./types/qalma-kit.d.ts",
|
|
51
51
|
"default": "./fesm2022/qalma-kit.mjs"
|
|
52
|
+
},
|
|
53
|
+
"./headless": {
|
|
54
|
+
"types": "./types/qalma-kit-headless.d.ts",
|
|
55
|
+
"default": "./fesm2022/qalma-kit-headless.mjs"
|
|
52
56
|
}
|
|
53
57
|
},
|
|
54
58
|
"type": "module"
|