@bettercms-ai/kit 3.0.1 → 3.0.2
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/dist/brand/logo.js +67 -18
- package/dist/brand/logo.js.map +1 -1
- package/dist/context.js +8 -3
- package/dist/context.js.map +1 -1
- package/dist/controls/button.js +451 -134
- package/dist/controls/button.js.map +1 -1
- package/dist/controls/choice.js +336 -95
- package/dist/controls/choice.js.map +1 -1
- package/dist/controls/code.js +245 -72
- package/dist/controls/code.js.map +1 -1
- package/dist/controls/color.js +108 -31
- package/dist/controls/color.js.map +1 -1
- package/dist/controls/date.js +268 -83
- package/dist/controls/date.js.map +1 -1
- package/dist/controls/form-picker.js +26 -9
- package/dist/controls/form-picker.js.map +1 -1
- package/dist/controls/icon.js +341 -100
- package/dist/controls/icon.js.map +1 -1
- package/dist/controls/json.js +20 -7
- package/dist/controls/json.js.map +1 -1
- package/dist/controls/link.js +561 -156
- package/dist/controls/link.js.map +1 -1
- package/dist/controls/location.js +124 -35
- package/dist/controls/location.js.map +1 -1
- package/dist/controls/media.js +928 -267
- package/dist/controls/media.js.map +1 -1
- package/dist/controls/number.js +80 -23
- package/dist/controls/number.js.map +1 -1
- package/dist/controls/reference.js +516 -155
- package/dist/controls/reference.js.map +1 -1
- package/dist/controls/rich-text/article-shell.js +327 -86
- package/dist/controls/rich-text/article-shell.js.map +1 -1
- package/dist/controls/rich-text/author.js +78 -21
- package/dist/controls/rich-text/author.js.map +1 -1
- package/dist/controls/rich-text/blocks.js +1084 -315
- package/dist/controls/rich-text/blocks.js.map +1 -1
- package/dist/controls/rich-text/button.js +30 -9
- package/dist/controls/rich-text/button.js.map +1 -1
- package/dist/controls/rich-text/catalog.js +168 -51
- package/dist/controls/rich-text/catalog.js.map +1 -1
- package/dist/controls/rich-text/columns.js +104 -31
- package/dist/controls/rich-text/columns.js.map +1 -1
- package/dist/controls/rich-text/component-card.js +790 -209
- package/dist/controls/rich-text/component-card.js.map +1 -1
- package/dist/controls/rich-text/component-panel.js +102 -40
- package/dist/controls/rich-text/component-panel.js.map +1 -1
- package/dist/controls/rich-text/control.js +101 -32
- package/dist/controls/rich-text/control.js.map +1 -1
- package/dist/controls/rich-text/editor.js +423 -121
- package/dist/controls/rich-text/editor.js.map +1 -1
- package/dist/controls/rich-text/embed.js +184 -51
- package/dist/controls/rich-text/embed.js.map +1 -1
- package/dist/controls/rich-text/floating.js +171 -42
- package/dist/controls/rich-text/floating.js.map +1 -1
- package/dist/controls/rich-text/footnote.js +89 -28
- package/dist/controls/rich-text/footnote.js.map +1 -1
- package/dist/controls/rich-text/gallery.js +88 -27
- package/dist/controls/rich-text/gallery.js.map +1 -1
- package/dist/controls/rich-text/link-form.js +111 -34
- package/dist/controls/rich-text/link-form.js.map +1 -1
- package/dist/controls/rich-text/plain.js +8 -3
- package/dist/controls/rich-text/plain.js.map +1 -1
- package/dist/controls/rich-text/related.js +86 -25
- package/dist/controls/rich-text/related.js.map +1 -1
- package/dist/controls/rich-text/toc.js +48 -15
- package/dist/controls/rich-text/toc.js.map +1 -1
- package/dist/controls/rich-text/toolbar.js +408 -107
- package/dist/controls/rich-text/toolbar.js.map +1 -1
- package/dist/controls/scale.js +169 -52
- package/dist/controls/scale.js.map +1 -1
- package/dist/controls/slot.js +238 -73
- package/dist/controls/slot.js.map +1 -1
- package/dist/controls/table/table-editor.js +1766 -500
- package/dist/controls/table/table-editor.js.map +1 -1
- package/dist/controls/table/table-link.js +119 -38
- package/dist/controls/table/table-link.js.map +1 -1
- package/dist/controls/table/table.js +26 -9
- package/dist/controls/table/table.js.map +1 -1
- package/dist/controls/text.js +221 -68
- package/dist/controls/text.js.map +1 -1
- package/dist/controls/unknown-value.js +79 -22
- package/dist/controls/unknown-value.js.map +1 -1
- package/dist/engine/array.js +821 -228
- package/dist/engine/array.js.map +1 -1
- package/dist/engine/bits.js +38 -13
- package/dist/engine/bits.js.map +1 -1
- package/dist/engine/breadcrumb.js +25 -8
- package/dist/engine/breadcrumb.js.map +1 -1
- package/dist/engine/expand.js +38 -13
- package/dist/engine/expand.js.map +1 -1
- package/dist/engine/field-list.js +14 -5
- package/dist/engine/field-list.js.map +1 -1
- package/dist/engine/field-shell.js +849 -244
- package/dist/engine/field-shell.js.map +1 -1
- package/dist/engine/frame.js +275 -78
- package/dist/engine/frame.js.map +1 -1
- package/dist/engine/grouping.js +630 -193
- package/dist/engine/grouping.js.map +1 -1
- package/dist/engine/item-list.js +187 -50
- package/dist/engine/item-list.js.map +1 -1
- package/dist/engine/kit-field.js +320 -95
- package/dist/engine/kit-field.js.map +1 -1
- package/dist/engine/schema-form.js +101 -32
- package/dist/engine/schema-form.js.map +1 -1
- package/dist/engine/slot.js +146 -45
- package/dist/engine/slot.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/icons.js +14 -5
- package/dist/lib/icons.js.map +1 -1
- package/dist/styles.css +5821 -1
- package/dist/table/table-view.js +49 -16
- package/dist/table/table-view.js.map +1 -1
- package/dist/testing/test-form.js +14 -5
- package/dist/testing/test-form.js.map +1 -1
- package/dist/theme.js +8 -3
- package/dist/theme.js.map +1 -1
- package/dist/ui/action-tray.js +97 -24
- package/dist/ui/action-tray.js.map +1 -1
- package/dist/ui/autocomplete.js +135 -38
- package/dist/ui/autocomplete.js.map +1 -1
- package/dist/ui/button.js +108 -31
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/choice-switch.js +14 -5
- package/dist/ui/choice-switch.js.map +1 -1
- package/dist/ui/controls.js +279 -86
- package/dist/ui/controls.js.map +1 -1
- package/dist/ui/display.js +401 -116
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/expanded-editor-modal.js +100 -27
- package/dist/ui/expanded-editor-modal.js.map +1 -1
- package/dist/ui/floating-panel.js +130 -37
- package/dist/ui/floating-panel.js.map +1 -1
- package/dist/ui/index.js +2 -2
- package/dist/ui/input.js +196 -59
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/mode-bar.js +32 -11
- package/dist/ui/mode-bar.js.map +1 -1
- package/dist/ui/overlay.js +616 -179
- package/dist/ui/overlay.js.map +1 -1
- package/dist/ui/path-crumbs.js +374 -113
- package/dist/ui/path-crumbs.js.map +1 -1
- package/dist/ui/select.js +311 -78
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/shortcut-hint.d.ts +3 -0
- package/dist/ui/shortcut-hint.js +33 -7
- package/dist/ui/shortcut-hint.js.map +1 -1
- package/dist/ui/spinner.js +20 -7
- package/dist/ui/spinner.js.map +1 -1
- package/dist/ui/split-button.js +35 -10
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/tab.js +50 -17
- package/dist/ui/tab.js.map +1 -1
- package/dist/ui/toast.js +107 -30
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/tooltip-root.js +24 -7
- package/dist/ui/tooltip-root.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../../lib/cn.js";
|
|
2
2
|
import { useKitEnv, useKitServices } from "../../context.js";
|
|
3
3
|
import { Button } from "../../ui/button.js";
|
|
4
|
-
import { shortcutHintsOn } from "../../ui/shortcut-hint.js";
|
|
4
|
+
import { platformKeys, shortcutHintsOn } from "../../ui/shortcut-hint.js";
|
|
5
5
|
import { Menu, MenuContent, MenuItem, MenuSeparator, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Tooltip } from "../../ui/overlay.js";
|
|
6
6
|
import { Textarea } from "../../ui/input.js";
|
|
7
7
|
import { LinkPopoverBody } from "../link.js";
|
|
@@ -23,7 +23,7 @@ import { checklistShortcut, insertChecklist, syncTaskA11y, toggleTaskAtPointer,
|
|
|
23
23
|
import { FN_MARK, FOOTNOTE_POPOVER_CLASS, FOOTNOTE_REFUSED, FootnoteEditor, FootnotesList, backToMarker, caretAfterMarker, insertFootnote, renumberFootnotes } from "./footnote.js";
|
|
24
24
|
import { ButtonLinkPanel, applyButton, buttonAt, buttonInitial, insertButton, removeButton } from "./button.js";
|
|
25
25
|
import * as React from "react";
|
|
26
|
-
import { Fragment,
|
|
26
|
+
import { Fragment, jsxDEV } from "react/jsx-dev-runtime";
|
|
27
27
|
import { IconArrowBarToDown, IconArrowBarToUp, IconCopy, IconGripVertical, IconPlus, IconTransform, IconTrash } from "@tabler/icons-react";
|
|
28
28
|
import { AnimatePresence, motion, useReducedMotion } from "framer-motion";
|
|
29
29
|
import { createPortal, flushSync } from "react-dom";
|
|
@@ -46,6 +46,7 @@ import { createPortal, flushSync } from "react-dom";
|
|
|
46
46
|
* Everything the editor offers is limited to what the field accepts (`features`): a toolbar button, a slash command, a
|
|
47
47
|
* Markdown shortcut or pasted markup the field cannot hold is not offered, or is turned into what it can hold and said so.
|
|
48
48
|
*/
|
|
49
|
+
var _jsxFileName = "D:/Github/bettercms/bettercms-backend/packages/kit/src/controls/rich-text/editor.tsx";
|
|
49
50
|
var RT_PROSE = "text-kit-base leading-[1.6] text-kit-fg [&>*+*]:mt-3 [&_span[class]:not([data-rt-isolate]_*)]:!text-inherit [&_span[class]:not([data-rt-isolate]_*)]:![-webkit-text-fill-color:currentColor] [&_span[class]:not([data-rt-isolate]_*)]:!bg-none [&_span[class]:not([data-rt-isolate]_*)]:!opacity-100 [&_span[class]:not([data-rt-isolate]_*)]:!visible [&_h1:not([data-rt-isolate]_*)]:text-[28px] [&_h1:not([data-rt-isolate]_*)]:font-semibold [&_h1:not([data-rt-isolate]_*)]:leading-9 [&_h1:not([data-rt-isolate]_*)]:tracking-[-0.01em] [&_h2:not([data-rt-isolate]_*)]:text-[22px] [&_h2:not([data-rt-isolate]_*)]:font-semibold [&_h2:not([data-rt-isolate]_*)]:leading-8 [&_h2:not([data-rt-isolate]_*)]:tracking-[-0.01em] [&_h3:not([data-rt-isolate]_*)]:text-kit-lg [&_h3:not([data-rt-isolate]_*)]:font-semibold [&_h4:not([data-rt-isolate]_*)]:text-kit-md [&_h4:not([data-rt-isolate]_*)]:font-semibold [&_h5:not([data-rt-isolate]_*)]:text-kit-base [&_h5:not([data-rt-isolate]_*)]:font-semibold [&_h6:not([data-rt-isolate]_*)]:text-kit-sm [&_h6:not([data-rt-isolate]_*)]:font-semibold [&_h6:not([data-rt-isolate]_*)]:uppercase [&_h6:not([data-rt-isolate]_*)]:tracking-wide [&_h6:not([data-rt-isolate]_*)]:text-kit-fg-2 [&>h1]:mt-6 [&>h2]:mt-6 [&>h3]:mt-5 [&>*:first-child]:mt-0 [&_ul:not([data-rt-isolate]_*)]:list-disc [&_ul:not([data-rt-isolate]_*)]:pl-5 [&_ol:not([data-rt-isolate]_*)]:list-decimal [&_ol:not([data-rt-isolate]_*)]:pl-5 [&_li:not([data-rt-isolate]_*)]:pl-1 [&_li+li:not([data-rt-isolate]_*)]:mt-1 [&_li:not([data-rt-isolate]_*)]:marker:text-kit-fg-3 [&_ul[data-task]:not([data-rt-isolate]_*)]:list-none [&_ul[data-task]:not([data-rt-isolate]_*)]:pl-0 [&_ul[data-task]>li:not([data-rt-isolate]_*)]:relative [&_ul[data-task]>li:not([data-rt-isolate]_*)]:pl-7 [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:absolute [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:left-0 [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:top-[0.2em] [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:flex [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:size-4 [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:items-center [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:justify-center [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:rounded-kit-md [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:border [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:border-kit-line-strong [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:bg-kit-surface [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:text-[11px] [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:font-semibold [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:leading-none [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:content-[''] [&_ul[data-task]>li[data-checked=true]:not([data-rt-isolate]_*)]:text-kit-fg-3 [&_ul[data-task]>li[data-checked=true]:not([data-rt-isolate]_*)]:line-through [&_ul[data-task]>li[data-checked=true]:not([data-rt-isolate]_*)]:before:border-kit-inverse [&_ul[data-task]>li[data-checked=true]:not([data-rt-isolate]_*)]:before:bg-kit-inverse [&_ul[data-task]>li[data-checked=true]:not([data-rt-isolate]_*)]:before:text-kit-fg-inverse [&_ul[data-task]>li[data-checked=true]:not([data-rt-isolate]_*)]:before:content-['✓'] [&_blockquote:not([data-rt-isolate]_*)]:border-l-2 [&_blockquote:not([data-rt-isolate]_*)]:border-kit-line-strong [&_blockquote:not([data-rt-isolate]_*)]:pl-4 [&_blockquote:not([data-rt-isolate]_*)]:text-kit-fg-2 [&_blockquote:not([data-rt-isolate]_*)]:italic [&_a:not([data-rt-isolate]_*)]:text-kit-accent-fg [&_a:not([data-rt-isolate]_*)]:underline [&_a:not([data-rt-isolate]_*)]:decoration-kit-accent-line [&_a:not([data-rt-isolate]_*)]:underline-offset-2 [&_a[data-button]:not([data-rt-isolate]_*)]:inline-flex [&_a[data-button]:not([data-rt-isolate]_*)]:h-9 [&_a[data-button]:not([data-rt-isolate]_*)]:items-center [&_a[data-button]:not([data-rt-isolate]_*)]:rounded-kit-md [&_a[data-button]:not([data-rt-isolate]_*)]:bg-kit-inverse [&_a[data-button]:not([data-rt-isolate]_*)]:px-3.5 [&_a[data-button]:not([data-rt-isolate]_*)]:text-kit-sm [&_a[data-button]:not([data-rt-isolate]_*)]:font-medium [&_a[data-button]:not([data-rt-isolate]_*)]:text-kit-fg-inverse [&_a[data-button]:not([data-rt-isolate]_*)]:no-underline [&_abbr:not([data-rt-isolate]_*)]:cursor-help [&_abbr:not([data-rt-isolate]_*)]:underline [&_abbr:not([data-rt-isolate]_*)]:decoration-dotted [&_abbr:not([data-rt-isolate]_*)]:underline-offset-2 [&_sup:not([data-rt-isolate]_*)]:text-[0.7em] [&_sup:not([data-rt-isolate]_*)]:leading-none [&_code:not([data-rt-isolate]_*)]:rounded-kit-md [&_code:not([data-rt-isolate]_*)]:bg-kit-muted [&_code:not([data-rt-isolate]_*)]:px-1 [&_code:not([data-rt-isolate]_*)]:py-px [&_code:not([data-rt-isolate]_*)]:font-kit-mono [&_code:not([data-rt-isolate]_*)]:text-[0.9em] [&_pre:not([data-rt-isolate]_*)]:overflow-x-auto [&_pre:not([data-rt-isolate]_*)]:whitespace-pre-wrap [&_pre:not([data-rt-isolate]_*)]:rounded-kit-lg [&_pre:not([data-rt-isolate]_*)]:bg-kit-code [&_pre:not([data-rt-isolate]_*)]:text-kit-code-fg [&_pre:not([data-rt-isolate]_*)]:p-3 [&_pre:not([data-rt-isolate]_*)]:font-kit-mono [&_pre:not([data-rt-isolate]_*)]:text-kit-sm [&_pre:not([data-rt-isolate]_*)]:border [&_pre:not([data-rt-isolate]_*)]:border-kit-line [&_pre_code:not([data-rt-isolate]_*)]:rounded-none [&_pre_code:not([data-rt-isolate]_*)]:bg-transparent [&_pre_code:not([data-rt-isolate]_*)]:p-0 [&_pre_code:not([data-rt-isolate]_*)]:text-[1em] [&_hr:not([data-rt-isolate]_*)]:my-6 [&_hr:not([data-rt-isolate]_*)]:border-kit-line [&_figure:not([data-rt-isolate]_*)]:my-4 [&_img:not([data-rt-isolate]_*)]:rounded-kit-lg [&_img:not([data-rt-isolate]_*)]:border [&_img:not([data-rt-isolate]_*)]:border-kit-line [&_figcaption:not([data-rt-isolate]_*)]:mt-1.5 [&_figcaption:not([data-rt-isolate]_*)]:text-center [&_figcaption:not([data-rt-isolate]_*)]:text-kit-sm [&_figcaption:not([data-rt-isolate]_*)]:text-kit-fg-3 [&_figure_img:not([data-rt-isolate]_*)]:block [&_figure[data-size=s]_img:not([data-rt-isolate]_*)]:w-1/3 [&_figure[data-size=m]_img:not([data-rt-isolate]_*)]:w-1/2 [&_figure[data-size=l]_img:not([data-rt-isolate]_*)]:w-3/4 [&_figure[data-align=center]_img:not([data-rt-isolate]_*)]:mx-auto [&_figure[data-align=right]_img:not([data-rt-isolate]_*)]:ml-auto [&_figure[data-align=full]_img:not([data-rt-isolate]_*)]:w-full [&_div[data-callout]:not([data-rt-isolate]_*)]:rounded-kit-lg [&_div[data-callout]:not([data-rt-isolate]_*)]:border [&_div[data-callout]:not([data-rt-isolate]_*)]:border-kit-info-line [&_div[data-callout]:not([data-rt-isolate]_*)]:bg-kit-info-soft [&_div[data-callout]:not([data-rt-isolate]_*)]:px-4 [&_div[data-callout]:not([data-rt-isolate]_*)]:py-3 [&_div[data-callout]:not([data-rt-isolate]_*)]:text-kit-fg [&_div[data-callout=tip]:not([data-rt-isolate]_*)]:border-kit-success-line [&_div[data-callout=tip]:not([data-rt-isolate]_*)]:bg-kit-success-soft [&_div[data-callout=warning]:not([data-rt-isolate]_*)]:border-kit-warning-line [&_div[data-callout=warning]:not([data-rt-isolate]_*)]:bg-kit-warning-soft [&_div[data-callout]>p[data-title]:not([data-rt-isolate]_*)]:font-medium [&_details:not([data-rt-isolate]_*)]:rounded-kit-md [&_summary:not([data-rt-isolate]_*)]:cursor-pointer [&_summary:not([data-rt-isolate]_*)]:font-medium [&_details>div:not([data-rt-isolate]_*)]:mt-1 [&_details>div:not([data-rt-isolate]_*)]:border-l [&_details>div:not([data-rt-isolate]_*)]:border-kit-line [&_details>div:not([data-rt-isolate]_*)]:pl-4 [&_details>div:not([data-rt-isolate]_*)]:ml-1 [&_div[data-rt=columns]:not([data-rt-isolate]_*)]:grid [&_div[data-rt=columns]:not([data-rt-isolate]_*)]:gap-4 [&_div[data-cols='2']:not([data-rt-isolate]_*)]:grid-cols-2 [&_div[data-cols='3']:not([data-rt-isolate]_*)]:grid-cols-3 [&_div[data-cols='4']:not([data-rt-isolate]_*)]:grid-cols-4 [&_div[data-gap=s]:not([data-rt-isolate]_*)]:gap-2 [&_div[data-gap=l]:not([data-rt-isolate]_*)]:gap-7 [&_div[data-rt=file]:not([data-rt-isolate]_*)]:rounded-kit-lg [&_div[data-rt=file]:not([data-rt-isolate]_*)]:border [&_div[data-rt=file]:not([data-rt-isolate]_*)]:border-kit-line [&_div[data-rt=file]:not([data-rt-isolate]_*)]:px-3 [&_div[data-rt=file]:not([data-rt-isolate]_*)]:py-2.5 [&_div[data-rt=file]:not([data-rt-isolate]_*)]:text-kit-sm [&_div[data-embed]:not([data-rt-isolate]_*)]:flex [&_div[data-embed]:not([data-rt-isolate]_*)]:aspect-video [&_div[data-embed]:not([data-rt-isolate]_*)]:items-center [&_div[data-embed]:not([data-rt-isolate]_*)]:justify-center [&_div[data-embed]:not([data-rt-isolate]_*)]:rounded-kit-lg [&_div[data-embed]:not([data-rt-isolate]_*)]:border [&_div[data-embed]:not([data-rt-isolate]_*)]:border-kit-line [&_div[data-embed]:not([data-rt-isolate]_*)]:bg-kit-subtle [&_div[data-embed]:not([data-rt-isolate]_*)]:text-kit-sm [&_div[data-embed]:not([data-rt-isolate]_*)]:text-kit-fg-3 [&_div[data-block]:not([data-rt-isolate]_*)]:flex [&_div[data-block]:not([data-rt-isolate]_*)]:items-center [&_div[data-block]:not([data-rt-isolate]_*)]:gap-2 [&_div[data-block]:not([data-rt-isolate]_*)]:rounded-kit-lg [&_div[data-block]:not([data-rt-isolate]_*)]:border [&_div[data-block]:not([data-rt-isolate]_*)]:border-dashed [&_div[data-block]:not([data-rt-isolate]_*)]:border-kit-accent-line [&_div[data-block]:not([data-rt-isolate]_*)]:bg-kit-accent-softer [&_div[data-block]:not([data-rt-isolate]_*)]:px-3 [&_div[data-block]:not([data-rt-isolate]_*)]:py-3 [&_div[data-block]:not([data-rt-isolate]_*)]:text-kit-sm [&_div[data-block]:not([data-rt-isolate]_*)]:text-kit-accent-fg [&_table:not([data-rt-isolate]_*)]:w-full [&_table:not([data-rt-isolate]_*)]:border-collapse [&_table:not([data-rt-isolate]_*)]:text-kit-sm [&_td:not([data-rt-isolate]_*)]:border [&_td:not([data-rt-isolate]_*)]:border-kit-line [&_td:not([data-rt-isolate]_*)]:px-2.5 [&_td:not([data-rt-isolate]_*)]:py-1.5 [&_td:not([data-rt-isolate]_*)]:align-top [&_th:not([data-rt-isolate]_*)]:border [&_th:not([data-rt-isolate]_*)]:border-kit-line [&_th:not([data-rt-isolate]_*)]:bg-kit-subtle [&_th:not([data-rt-isolate]_*)]:px-2.5 [&_th:not([data-rt-isolate]_*)]:py-1.5 [&_th:not([data-rt-isolate]_*)]:text-left [&_th:not([data-rt-isolate]_*)]:align-top [&_th:not([data-rt-isolate]_*)]:font-medium";
|
|
50
51
|
/** Panel density (≈340px inspector): 13px text, smaller headings. */
|
|
51
52
|
var RT_PANEL = "text-kit-sm leading-[1.6] [&_h1:not([data-rt-isolate]_*)]:text-kit-xl [&_h1:not([data-rt-isolate]_*)]:leading-7 [&_h2:not([data-rt-isolate]_*)]:text-kit-lg [&_h2:not([data-rt-isolate]_*)]:leading-7 [&_h3:not([data-rt-isolate]_*)]:text-kit-md [&_h4:not([data-rt-isolate]_*)]:text-kit-base [&_h5:not([data-rt-isolate]_*)]:text-kit-sm [&_h6:not([data-rt-isolate]_*)]:text-kit-xs";
|
|
@@ -396,6 +397,14 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
396
397
|
setStickyTop(top);
|
|
397
398
|
}, [toolbarOpen, dense]);
|
|
398
399
|
const hasSlash = !!slash;
|
|
400
|
+
const slashWasOpen = React.useRef(false);
|
|
401
|
+
React.useEffect(() => {
|
|
402
|
+
if (hasSlash) slashWasOpen.current = true;
|
|
403
|
+
else if (slashWasOpen.current) {
|
|
404
|
+
slashWasOpen.current = false;
|
|
405
|
+
emit();
|
|
406
|
+
}
|
|
407
|
+
}, [hasSlash, emit]);
|
|
399
408
|
React.useEffect(() => {
|
|
400
409
|
if (!hasSlash) return;
|
|
401
410
|
let raf = 0;
|
|
@@ -814,15 +823,18 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
814
823
|
return;
|
|
815
824
|
}
|
|
816
825
|
if (ne.inputType === "insertText" && ne.data === "`" && allows("code")) liveInlineCode();
|
|
817
|
-
emit();
|
|
818
826
|
const s = window.getSelection();
|
|
819
|
-
if (!s || !s.rangeCount)
|
|
827
|
+
if (!s || !s.rangeCount) {
|
|
828
|
+
emit();
|
|
829
|
+
return setSlash(null);
|
|
830
|
+
}
|
|
820
831
|
const r = s.getRangeAt(0);
|
|
832
|
+
const opensAt = (n) => {
|
|
833
|
+
const blk = closestBlock(ref.current, n);
|
|
834
|
+
return !!blk && textBeforeCaret(blk) === "/";
|
|
835
|
+
};
|
|
821
836
|
if (!slash) {
|
|
822
|
-
|
|
823
|
-
const blk = closestBlock(ref.current, r.startContainer);
|
|
824
|
-
if (!blk || textBeforeCaret(blk) !== "/") return;
|
|
825
|
-
const rect = caretRect();
|
|
837
|
+
const rect = !single && ne.inputType === "insertText" && ne.data === "/" && r.startContainer.nodeType === 3 && opensAt(r.startContainer) ? caretRect() : null;
|
|
826
838
|
if (rect) setSlash({
|
|
827
839
|
rect,
|
|
828
840
|
node: r.startContainer,
|
|
@@ -831,6 +843,7 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
831
843
|
folder: false,
|
|
832
844
|
active: 0
|
|
833
845
|
});
|
|
846
|
+
else emit();
|
|
834
847
|
return;
|
|
835
848
|
}
|
|
836
849
|
if (r.startContainer !== slash.node || r.startOffset <= slash.offset || slash.node.data[slash.offset] !== "/") return setSlash(null);
|
|
@@ -849,7 +862,7 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
849
862
|
const anchor = (s?.anchorNode?.nodeType === 1 ? s.anchorNode : s?.anchorNode?.parentElement)?.closest("a") ?? null;
|
|
850
863
|
if (anchor && ref.current && buttonAt(ref.current, anchor)) return openButton(anchor);
|
|
851
864
|
if (!anchor && (!s || s.isCollapsed || !s.toString().trim())) {
|
|
852
|
-
notify("Select some text first", { description: hints ? "Then press ⌘K to link it." : "Then link it." });
|
|
865
|
+
notify("Select some text first", { description: hints ? platformKeys("Then press ⌘K to link it.") : "Then link it." });
|
|
853
866
|
return;
|
|
854
867
|
}
|
|
855
868
|
const rect = s && s.rangeCount ? rangeRect(s.getRangeAt(0), ref.current) : ref.current.getBoundingClientRect();
|
|
@@ -914,7 +927,28 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
914
927
|
return;
|
|
915
928
|
}
|
|
916
929
|
run(() => {
|
|
917
|
-
const
|
|
930
|
+
const s = window.getSelection();
|
|
931
|
+
const el = ref.current;
|
|
932
|
+
if (el && s && s.rangeCount && !s.isCollapsed) {
|
|
933
|
+
const sentinel = `https://bcms-link.invalid/${rid()}`;
|
|
934
|
+
if (exec("createLink", sentinel)) {
|
|
935
|
+
el.querySelectorAll("a[href]").forEach((a) => a.getAttribute("href") === sentinel && applyTextLink(a, v));
|
|
936
|
+
return;
|
|
937
|
+
}
|
|
938
|
+
const r = s.getRangeAt(0);
|
|
939
|
+
const blk = closestBlock(el, r.startContainer);
|
|
940
|
+
if (blk && blk === closestBlock(el, r.endContainer)) {
|
|
941
|
+
const a = document.createElement("a");
|
|
942
|
+
applyTextLink(a, v);
|
|
943
|
+
a.append(r.extractContents());
|
|
944
|
+
r.insertNode(a);
|
|
945
|
+
r.selectNodeContents(a);
|
|
946
|
+
s.removeAllRanges();
|
|
947
|
+
s.addRange(r);
|
|
948
|
+
return;
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
const text = s?.toString() || v.href;
|
|
918
952
|
const attr = (s) => esc(s).replace(/"/g, """);
|
|
919
953
|
insertHtmlAtCaret(`<a href="${attr(v.href)}"${v.newTab ? ` target="_blank"` : ""}${v.rel ? ` rel="${attr(v.rel)}"` : ""}>${esc(text)}</a>`);
|
|
920
954
|
});
|
|
@@ -938,7 +972,7 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
938
972
|
s?.addRange(range);
|
|
939
973
|
insertTextAtCaret(out);
|
|
940
974
|
emit();
|
|
941
|
-
notify("Rewritten with AI", { description: hints ? "Press ⌘Z to undo" : void 0 });
|
|
975
|
+
notify("Rewritten with AI", { description: hints ? platformKeys("Press ⌘Z to undo") : void 0 });
|
|
942
976
|
}, (err) => notify("Could not rewrite the selection", { description: err instanceof Error ? err.message : String(err) }));
|
|
943
977
|
};
|
|
944
978
|
const onGripDown = (e) => {
|
|
@@ -1232,6 +1266,8 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1232
1266
|
const btn = dense ? "size-5 [&_svg:not([data-rt-isolate]_*)]:size-3.5" : "size-[22px] [&_svg:not([data-rt-isolate]_*)]:size-3.5";
|
|
1233
1267
|
const gutterMode = readOnly || dense || single ? "none" : gutterRoom ? "outside" : "inset";
|
|
1234
1268
|
const showGutter = gutterMode !== "none";
|
|
1269
|
+
/** BL-540: a one-line or panel field counts no words */
|
|
1270
|
+
const counts = !single && !dense;
|
|
1235
1271
|
const minH = expanded ? "min-h-[60vh]" : single ? "min-h-9" : dense ? "min-h-[120px]" : "min-h-[190px]";
|
|
1236
1272
|
const turnStyles = stylesFor(allows).filter((s) => [
|
|
1237
1273
|
"p",
|
|
@@ -1240,9 +1276,9 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1240
1276
|
"h3",
|
|
1241
1277
|
"blockquote"
|
|
1242
1278
|
].includes(s.tag));
|
|
1243
|
-
return /* @__PURE__ */
|
|
1279
|
+
return /* @__PURE__ */ jsxDEV(CatalogComponentsProvider, {
|
|
1244
1280
|
value: components ?? null,
|
|
1245
|
-
children: /* @__PURE__ */
|
|
1281
|
+
children: /* @__PURE__ */ jsxDEV("div", {
|
|
1246
1282
|
ref: wrap,
|
|
1247
1283
|
"data-rt-editor": "",
|
|
1248
1284
|
className: cn("relative [--rt-toolbar-h:2rem] pointer-coarse:[--rt-toolbar-h:2.75rem]", "rounded-kit-lg border transition-colors duration-150", expanded ? "bg-[var(--kit-surface-raised)]" : "bg-kit-surface", invalid ? "border-[var(--kit-field-invalid)]" : toolbarOpen ? "border-kit-line-strong" : "border-kit-line"),
|
|
@@ -1265,7 +1301,7 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1265
1301
|
}, 400);
|
|
1266
1302
|
},
|
|
1267
1303
|
children: [
|
|
1268
|
-
readOnly ? null : /* @__PURE__ */
|
|
1304
|
+
readOnly ? null : /* @__PURE__ */ jsxDEV(FormatToolbar, {
|
|
1269
1305
|
open: toolbarOpen,
|
|
1270
1306
|
sticky: !dense,
|
|
1271
1307
|
stickyTop,
|
|
@@ -1280,10 +1316,16 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1280
1316
|
if (o) inserted.current = false;
|
|
1281
1317
|
setInsertOpen(o);
|
|
1282
1318
|
},
|
|
1283
|
-
onMenuOpen: (name, o) =>
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1319
|
+
onMenuOpen: (name, o) => {
|
|
1320
|
+
setMenus((m) => ({
|
|
1321
|
+
...m,
|
|
1322
|
+
[name]: o
|
|
1323
|
+
}));
|
|
1324
|
+
if (!o) requestAnimationFrame(() => {
|
|
1325
|
+
const ae = document.activeElement;
|
|
1326
|
+
if (!ae || ae === document.body) restoreSel();
|
|
1327
|
+
});
|
|
1328
|
+
},
|
|
1287
1329
|
onStyle,
|
|
1288
1330
|
onMark,
|
|
1289
1331
|
onList: (kind) => allows(kind) && run(() => {
|
|
@@ -1319,11 +1361,15 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1319
1361
|
onFullscreen: () => setModalOpen(true),
|
|
1320
1362
|
onMarkdown: toggleMarkdown,
|
|
1321
1363
|
saveSel
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1364
|
+
}, void 0, false, {
|
|
1365
|
+
fileName: _jsxFileName,
|
|
1366
|
+
lineNumber: 1405,
|
|
1367
|
+
columnNumber: 9
|
|
1368
|
+
}, this),
|
|
1369
|
+
md ? /* @__PURE__ */ jsxDEV("div", {
|
|
1324
1370
|
className: "px-3 pb-2.5 pt-2.5",
|
|
1325
1371
|
children: [
|
|
1326
|
-
/* @__PURE__ */
|
|
1372
|
+
/* @__PURE__ */ jsxDEV(Textarea, {
|
|
1327
1373
|
"aria-label": "Field content as Markdown",
|
|
1328
1374
|
spellCheck: false,
|
|
1329
1375
|
value: md.text,
|
|
@@ -1337,14 +1383,22 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1337
1383
|
},
|
|
1338
1384
|
className: cn("font-kit-mono text-kit-xs leading-5", expanded ? "min-h-[60vh]" : dense ? "min-h-[120px]" : "min-h-[190px]"),
|
|
1339
1385
|
style: scrollable ? { maxHeight } : void 0
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1386
|
+
}, void 0, false, {
|
|
1387
|
+
fileName: _jsxFileName,
|
|
1388
|
+
lineNumber: 1477,
|
|
1389
|
+
columnNumber: 11
|
|
1390
|
+
}, this),
|
|
1391
|
+
/* @__PURE__ */ jsxDEV("p", {
|
|
1342
1392
|
className: "mt-1.5 text-kit-2xs text-kit-fg-3",
|
|
1343
1393
|
children: "Markdown. Switching back converts it to blocks."
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1394
|
+
}, void 0, false, {
|
|
1395
|
+
fileName: _jsxFileName,
|
|
1396
|
+
lineNumber: 1489,
|
|
1397
|
+
columnNumber: 11
|
|
1398
|
+
}, this),
|
|
1399
|
+
/* @__PURE__ */ jsxDEV(AnimatePresence, {
|
|
1346
1400
|
initial: false,
|
|
1347
|
-
children: mdConfirm ? /* @__PURE__ */
|
|
1401
|
+
children: mdConfirm ? /* @__PURE__ */ jsxDEV(motion.div, {
|
|
1348
1402
|
initial: {
|
|
1349
1403
|
opacity: 0,
|
|
1350
1404
|
y: reduceMotion ? 0 : 4
|
|
@@ -1362,28 +1416,52 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1362
1416
|
"aria-label": "Convert edited Markdown?",
|
|
1363
1417
|
className: "mt-2 flex flex-wrap items-center gap-2 rounded-kit-lg border border-kit-line bg-kit-subtle px-3 py-2",
|
|
1364
1418
|
children: [
|
|
1365
|
-
/* @__PURE__ */
|
|
1419
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
1366
1420
|
className: "flex-1 text-kit-sm font-medium text-kit-fg",
|
|
1367
1421
|
children: "Convert edited Markdown?"
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1422
|
+
}, void 0, false, {
|
|
1423
|
+
fileName: _jsxFileName,
|
|
1424
|
+
lineNumber: 1502,
|
|
1425
|
+
columnNumber: 17
|
|
1426
|
+
}, this),
|
|
1427
|
+
/* @__PURE__ */ jsxDEV(Button, {
|
|
1370
1428
|
size: "xs",
|
|
1371
1429
|
variant: "ghost",
|
|
1372
1430
|
onClick: () => setMdConfirm(false),
|
|
1373
1431
|
children: "Keep editing Markdown"
|
|
1374
|
-
}
|
|
1375
|
-
|
|
1432
|
+
}, void 0, false, {
|
|
1433
|
+
fileName: _jsxFileName,
|
|
1434
|
+
lineNumber: 1503,
|
|
1435
|
+
columnNumber: 17
|
|
1436
|
+
}, this),
|
|
1437
|
+
/* @__PURE__ */ jsxDEV(Button, {
|
|
1376
1438
|
size: "xs",
|
|
1377
1439
|
variant: "primary",
|
|
1378
1440
|
autoFocus: true,
|
|
1379
1441
|
onClick: convertMarkdown,
|
|
1380
1442
|
children: "Convert to rich text"
|
|
1381
|
-
}
|
|
1443
|
+
}, void 0, false, {
|
|
1444
|
+
fileName: _jsxFileName,
|
|
1445
|
+
lineNumber: 1506,
|
|
1446
|
+
columnNumber: 17
|
|
1447
|
+
}, this)
|
|
1382
1448
|
]
|
|
1383
|
-
}, "confirm"
|
|
1384
|
-
|
|
1449
|
+
}, "confirm", true, {
|
|
1450
|
+
fileName: _jsxFileName,
|
|
1451
|
+
lineNumber: 1492,
|
|
1452
|
+
columnNumber: 15
|
|
1453
|
+
}, this) : null
|
|
1454
|
+
}, void 0, false, {
|
|
1455
|
+
fileName: _jsxFileName,
|
|
1456
|
+
lineNumber: 1490,
|
|
1457
|
+
columnNumber: 11
|
|
1458
|
+
}, this)
|
|
1385
1459
|
]
|
|
1386
|
-
}
|
|
1460
|
+
}, void 0, true, {
|
|
1461
|
+
fileName: _jsxFileName,
|
|
1462
|
+
lineNumber: 1476,
|
|
1463
|
+
columnNumber: 9
|
|
1464
|
+
}, this) : /* @__PURE__ */ jsxDEV("div", {
|
|
1387
1465
|
ref: scroller,
|
|
1388
1466
|
className: cn("relative", scrollable && "overflow-y-auto"),
|
|
1389
1467
|
style: scrollable ? { maxHeight } : void 0,
|
|
@@ -1395,7 +1473,7 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1395
1473
|
placeGutter(b?.getAttribute("data-rt-island") === "component" ? null : b);
|
|
1396
1474
|
},
|
|
1397
1475
|
children: [
|
|
1398
|
-
/* @__PURE__ */
|
|
1476
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
1399
1477
|
ref,
|
|
1400
1478
|
id: inModal ? void 0 : id,
|
|
1401
1479
|
role: "textbox",
|
|
@@ -1477,17 +1555,25 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1477
1555
|
}
|
|
1478
1556
|
},
|
|
1479
1557
|
className: cn(RT_PROSE, dense && "text-kit-sm leading-[1.6] [&_h1:not([data-rt-isolate]_*)]:text-kit-xl [&_h1:not([data-rt-isolate]_*)]:leading-7 [&_h2:not([data-rt-isolate]_*)]:text-kit-lg [&_h2:not([data-rt-isolate]_*)]:leading-7 [&_h3:not([data-rt-isolate]_*)]:text-kit-md [&_h4:not([data-rt-isolate]_*)]:text-kit-base [&_h5:not([data-rt-isolate]_*)]:text-kit-sm [&_h6:not([data-rt-isolate]_*)]:text-kit-xs", "peer relative outline-none focus-visible:shadow-none [&_*:not([data-rt-isolate]_*)]:outline-none", "[&>p[data-hint]]:before:pointer-events-none [&>p[data-hint]]:before:float-left [&>p[data-hint]]:before:h-0 [&>p[data-hint]]:before:text-kit-fg-4 [&>p[data-hint]]:before:content-[attr(data-hint)]", "[&_a[data-button]:not([data-rt-isolate]_*)]:cursor-pointer [&_ul[data-task]>li:not([data-rt-isolate]_*)]:before:cursor-pointer", "[&_sup[data-rt=fn]]:mx-px [&_sup[data-rt=fn]]:cursor-pointer [&_sup[data-rt=fn]]:rounded-kit-sm [&_sup[data-rt=fn]]:px-0.5 [&_sup[data-rt=fn]]:text-[0.72em] [&_sup[data-rt=fn]]:leading-[0] [&_sup[data-rt=fn]]:font-semibold [&_sup[data-rt=fn]]:text-kit-accent-fg [&_sup[data-rt=fn]:hover]:bg-kit-accent-soft", dense ? "px-2.5 py-2" : "px-4 py-3.5", minH)
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1558
|
+
}, void 0, false, {
|
|
1559
|
+
fileName: _jsxFileName,
|
|
1560
|
+
lineNumber: 1527,
|
|
1561
|
+
columnNumber: 11
|
|
1562
|
+
}, this),
|
|
1563
|
+
empty ? /* @__PURE__ */ jsxDEV("div", {
|
|
1482
1564
|
"aria-hidden": true,
|
|
1483
1565
|
className: cn("pointer-events-none absolute text-kit-fg-4 peer-focus:hidden", dense ? "text-kit-sm" : "text-kit-base", dense ? "left-2.5 top-2" : "left-4 top-3.5"),
|
|
1484
1566
|
children: ph
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1567
|
+
}, void 0, false, {
|
|
1568
|
+
fileName: _jsxFileName,
|
|
1569
|
+
lineNumber: 1622,
|
|
1570
|
+
columnNumber: 13
|
|
1571
|
+
}, this) : null,
|
|
1572
|
+
gutter && showGutter ? /* @__PURE__ */ jsxDEV("div", {
|
|
1487
1573
|
"data-rt-gutter": "",
|
|
1488
1574
|
className: cn("absolute z-[3] flex items-start", gutterMode === "outside" ? "-left-12 pr-1" : "left-0"),
|
|
1489
1575
|
style: { top: gutter.top + Math.max(-2, Math.min(4, gutter.height / 2 - 12)) },
|
|
1490
|
-
children: [gutterMode === "outside" ? /* @__PURE__ */
|
|
1576
|
+
children: [gutterMode === "outside" ? /* @__PURE__ */ jsxDEV(Popover, {
|
|
1491
1577
|
open: gutterInsert,
|
|
1492
1578
|
onOpenChange: (o) => {
|
|
1493
1579
|
if (o) {
|
|
@@ -1496,18 +1582,30 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1496
1582
|
}
|
|
1497
1583
|
setGutterInsert(o);
|
|
1498
1584
|
},
|
|
1499
|
-
children: [/* @__PURE__ */
|
|
1585
|
+
children: [/* @__PURE__ */ jsxDEV(Tooltip, {
|
|
1500
1586
|
content: "Add a block below",
|
|
1501
1587
|
disabled: gutterInsert,
|
|
1502
|
-
children: /* @__PURE__ */
|
|
1588
|
+
children: /* @__PURE__ */ jsxDEV(PopoverTrigger, {
|
|
1503
1589
|
"aria-label": "Add a block below",
|
|
1504
1590
|
className: cn("flex items-center justify-center rounded-kit-md text-kit-fg-3 hover:bg-kit-hover hover:text-kit-fg data-[popup-open]:bg-kit-hover data-[popup-open]:text-kit-fg", btn),
|
|
1505
|
-
children: /* @__PURE__ */
|
|
1591
|
+
children: /* @__PURE__ */ jsxDEV(IconPlus, {
|
|
1506
1592
|
stroke: 1.5,
|
|
1507
1593
|
"aria-hidden": true
|
|
1508
|
-
}
|
|
1509
|
-
|
|
1510
|
-
|
|
1594
|
+
}, void 0, false, {
|
|
1595
|
+
fileName: _jsxFileName,
|
|
1596
|
+
lineNumber: 1651,
|
|
1597
|
+
columnNumber: 23
|
|
1598
|
+
}, this)
|
|
1599
|
+
}, void 0, false, {
|
|
1600
|
+
fileName: _jsxFileName,
|
|
1601
|
+
lineNumber: 1647,
|
|
1602
|
+
columnNumber: 21
|
|
1603
|
+
}, this)
|
|
1604
|
+
}, void 0, false, {
|
|
1605
|
+
fileName: _jsxFileName,
|
|
1606
|
+
lineNumber: 1646,
|
|
1607
|
+
columnNumber: 19
|
|
1608
|
+
}, this), gutterInsert ? /* @__PURE__ */ jsxDEV(InsertMenuContent, {
|
|
1511
1609
|
side: "bottom",
|
|
1512
1610
|
align: "start",
|
|
1513
1611
|
allows,
|
|
@@ -1525,14 +1623,22 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1525
1623
|
placeCaret(p);
|
|
1526
1624
|
insertBlock(it);
|
|
1527
1625
|
}
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1626
|
+
}, void 0, false, {
|
|
1627
|
+
fileName: _jsxFileName,
|
|
1628
|
+
lineNumber: 1655,
|
|
1629
|
+
columnNumber: 21
|
|
1630
|
+
}, this) : null]
|
|
1631
|
+
}, void 0, true, {
|
|
1632
|
+
fileName: _jsxFileName,
|
|
1633
|
+
lineNumber: 1636,
|
|
1634
|
+
columnNumber: 17
|
|
1635
|
+
}, this) : null, /* @__PURE__ */ jsxDEV(Menu, {
|
|
1530
1636
|
open: blockMenu,
|
|
1531
1637
|
onOpenChange: setBlockMenu,
|
|
1532
|
-
children: [/* @__PURE__ */
|
|
1638
|
+
children: [/* @__PURE__ */ jsxDEV(Tooltip, {
|
|
1533
1639
|
content: "Drag to move, click for options",
|
|
1534
1640
|
disabled: blockMenu || !!drag,
|
|
1535
|
-
children: /* @__PURE__ */
|
|
1641
|
+
children: /* @__PURE__ */ jsxDEV(MenuTrigger, {
|
|
1536
1642
|
"aria-label": "Block options",
|
|
1537
1643
|
onPointerDown: onGripDown,
|
|
1538
1644
|
onKeyDown: (e) => {
|
|
@@ -1542,86 +1648,182 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1542
1648
|
}
|
|
1543
1649
|
},
|
|
1544
1650
|
className: cn("flex cursor-grab items-center justify-center rounded-kit-md text-kit-fg-3 hover:bg-kit-hover hover:text-kit-fg active:cursor-grabbing", gutterMode === "inset" ? "h-[22px] w-4 rounded-kit-sm [&_svg:not([data-rt-isolate]_*)]:size-3.5" : btn, (blockMenu || drag) && "bg-kit-hover text-kit-fg"),
|
|
1545
|
-
children: /* @__PURE__ */
|
|
1651
|
+
children: /* @__PURE__ */ jsxDEV(IconGripVertical, {
|
|
1546
1652
|
stroke: 1.5,
|
|
1547
1653
|
"aria-hidden": true
|
|
1548
|
-
}
|
|
1549
|
-
|
|
1550
|
-
|
|
1654
|
+
}, void 0, false, {
|
|
1655
|
+
fileName: _jsxFileName,
|
|
1656
|
+
lineNumber: 1694,
|
|
1657
|
+
columnNumber: 21
|
|
1658
|
+
}, this)
|
|
1659
|
+
}, void 0, false, {
|
|
1660
|
+
fileName: _jsxFileName,
|
|
1661
|
+
lineNumber: 1679,
|
|
1662
|
+
columnNumber: 19
|
|
1663
|
+
}, this)
|
|
1664
|
+
}, void 0, false, {
|
|
1665
|
+
fileName: _jsxFileName,
|
|
1666
|
+
lineNumber: 1678,
|
|
1667
|
+
columnNumber: 17
|
|
1668
|
+
}, this), /* @__PURE__ */ jsxDEV(MenuContent, {
|
|
1551
1669
|
className: "w-56",
|
|
1552
1670
|
align: "start",
|
|
1553
1671
|
finalFocus: false,
|
|
1554
1672
|
children: [
|
|
1555
|
-
turnStyles.length > 1 ? /* @__PURE__ */
|
|
1556
|
-
icon: /* @__PURE__ */
|
|
1673
|
+
turnStyles.length > 1 ? /* @__PURE__ */ jsxDEV(MenuSub, { children: [/* @__PURE__ */ jsxDEV(MenuSubTrigger, {
|
|
1674
|
+
icon: /* @__PURE__ */ jsxDEV(IconTransform, { stroke: 1.5 }, void 0, false, {
|
|
1675
|
+
fileName: _jsxFileName,
|
|
1676
|
+
lineNumber: 1700,
|
|
1677
|
+
columnNumber: 45
|
|
1678
|
+
}, this),
|
|
1557
1679
|
disabled: !gIsText,
|
|
1558
1680
|
children: "Turn into"
|
|
1559
|
-
}
|
|
1681
|
+
}, void 0, false, {
|
|
1682
|
+
fileName: _jsxFileName,
|
|
1683
|
+
lineNumber: 1700,
|
|
1684
|
+
columnNumber: 23
|
|
1685
|
+
}, this), /* @__PURE__ */ jsxDEV(MenuSubContent, {
|
|
1560
1686
|
className: "w-48",
|
|
1561
|
-
children: turnStyles.map((t) => /* @__PURE__ */
|
|
1687
|
+
children: turnStyles.map((t) => /* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1562
1688
|
icon: t.icon,
|
|
1563
1689
|
onClick: () => turnInto$1(gBlock ?? null, t.tag),
|
|
1564
1690
|
children: t.label
|
|
1565
|
-
}, t.tag
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1691
|
+
}, t.tag, false, {
|
|
1692
|
+
fileName: _jsxFileName,
|
|
1693
|
+
lineNumber: 1705,
|
|
1694
|
+
columnNumber: 27
|
|
1695
|
+
}, this))
|
|
1696
|
+
}, void 0, false, {
|
|
1697
|
+
fileName: _jsxFileName,
|
|
1698
|
+
lineNumber: 1703,
|
|
1699
|
+
columnNumber: 23
|
|
1700
|
+
}, this)] }, void 0, true, {
|
|
1701
|
+
fileName: _jsxFileName,
|
|
1702
|
+
lineNumber: 1699,
|
|
1703
|
+
columnNumber: 21
|
|
1704
|
+
}, this) : null,
|
|
1705
|
+
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1706
|
+
icon: /* @__PURE__ */ jsxDEV(IconCopy, { stroke: 1.5 }, void 0, false, {
|
|
1707
|
+
fileName: _jsxFileName,
|
|
1708
|
+
lineNumber: 1712,
|
|
1709
|
+
columnNumber: 35
|
|
1710
|
+
}, this),
|
|
1569
1711
|
shortcut: "⌘D",
|
|
1570
1712
|
onClick: () => gBlock && duplicateBlock$1(gBlock),
|
|
1571
1713
|
children: "Duplicate"
|
|
1572
|
-
}
|
|
1573
|
-
|
|
1574
|
-
|
|
1714
|
+
}, void 0, false, {
|
|
1715
|
+
fileName: _jsxFileName,
|
|
1716
|
+
lineNumber: 1712,
|
|
1717
|
+
columnNumber: 19
|
|
1718
|
+
}, this),
|
|
1719
|
+
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1720
|
+
icon: /* @__PURE__ */ jsxDEV(IconArrowBarToUp, { stroke: 1.5 }, void 0, false, {
|
|
1721
|
+
fileName: _jsxFileName,
|
|
1722
|
+
lineNumber: 1715,
|
|
1723
|
+
columnNumber: 35
|
|
1724
|
+
}, this),
|
|
1575
1725
|
shortcut: "⌘⇧↑",
|
|
1576
1726
|
disabled: !gBlock?.previousElementSibling,
|
|
1577
1727
|
onClick: () => gBlock && moveBlock$1(gBlock, -1),
|
|
1578
1728
|
children: "Move up"
|
|
1579
|
-
}
|
|
1580
|
-
|
|
1581
|
-
|
|
1729
|
+
}, void 0, false, {
|
|
1730
|
+
fileName: _jsxFileName,
|
|
1731
|
+
lineNumber: 1715,
|
|
1732
|
+
columnNumber: 19
|
|
1733
|
+
}, this),
|
|
1734
|
+
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1735
|
+
icon: /* @__PURE__ */ jsxDEV(IconArrowBarToDown, { stroke: 1.5 }, void 0, false, {
|
|
1736
|
+
fileName: _jsxFileName,
|
|
1737
|
+
lineNumber: 1718,
|
|
1738
|
+
columnNumber: 35
|
|
1739
|
+
}, this),
|
|
1582
1740
|
shortcut: "⌘⇧↓",
|
|
1583
1741
|
disabled: !gBlock?.nextElementSibling,
|
|
1584
1742
|
onClick: () => gBlock && moveBlock$1(gBlock, 1),
|
|
1585
1743
|
children: "Move down"
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
|
|
1744
|
+
}, void 0, false, {
|
|
1745
|
+
fileName: _jsxFileName,
|
|
1746
|
+
lineNumber: 1718,
|
|
1747
|
+
columnNumber: 19
|
|
1748
|
+
}, this),
|
|
1749
|
+
/* @__PURE__ */ jsxDEV(MenuSeparator, {}, void 0, false, {
|
|
1750
|
+
fileName: _jsxFileName,
|
|
1751
|
+
lineNumber: 1721,
|
|
1752
|
+
columnNumber: 19
|
|
1753
|
+
}, this),
|
|
1754
|
+
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1589
1755
|
danger: true,
|
|
1590
|
-
icon: /* @__PURE__ */
|
|
1756
|
+
icon: /* @__PURE__ */ jsxDEV(IconTrash, { stroke: 1.5 }, void 0, false, {
|
|
1757
|
+
fileName: _jsxFileName,
|
|
1758
|
+
lineNumber: 1722,
|
|
1759
|
+
columnNumber: 42
|
|
1760
|
+
}, this),
|
|
1591
1761
|
onClick: () => gBlock && deleteBlock(gBlock),
|
|
1592
1762
|
children: "Delete"
|
|
1593
|
-
}
|
|
1763
|
+
}, void 0, false, {
|
|
1764
|
+
fileName: _jsxFileName,
|
|
1765
|
+
lineNumber: 1722,
|
|
1766
|
+
columnNumber: 19
|
|
1767
|
+
}, this)
|
|
1594
1768
|
]
|
|
1595
|
-
}
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1769
|
+
}, void 0, true, {
|
|
1770
|
+
fileName: _jsxFileName,
|
|
1771
|
+
lineNumber: 1697,
|
|
1772
|
+
columnNumber: 17
|
|
1773
|
+
}, this)]
|
|
1774
|
+
}, void 0, true, {
|
|
1775
|
+
fileName: _jsxFileName,
|
|
1776
|
+
lineNumber: 1677,
|
|
1777
|
+
columnNumber: 15
|
|
1778
|
+
}, this)]
|
|
1779
|
+
}, void 0, true, {
|
|
1780
|
+
fileName: _jsxFileName,
|
|
1781
|
+
lineNumber: 1629,
|
|
1782
|
+
columnNumber: 13
|
|
1783
|
+
}, this) : null,
|
|
1784
|
+
drag?.line != null ? /* @__PURE__ */ jsxDEV("div", {
|
|
1599
1785
|
className: "pointer-events-none absolute inset-x-3 z-[6] h-0.5 rounded-full bg-kit-info",
|
|
1600
1786
|
style: { top: drag.line }
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1787
|
+
}, void 0, false, {
|
|
1788
|
+
fileName: _jsxFileName,
|
|
1789
|
+
lineNumber: 1729,
|
|
1790
|
+
columnNumber: 33
|
|
1791
|
+
}, this) : null,
|
|
1792
|
+
islands.map(({ id: key, el }) => createPortal(/* @__PURE__ */ jsxDEV(Island, {
|
|
1603
1793
|
el,
|
|
1604
1794
|
ctx: islandCtx
|
|
1605
|
-
}
|
|
1795
|
+
}, void 0, false, {
|
|
1796
|
+
fileName: _jsxFileName,
|
|
1797
|
+
lineNumber: 1732,
|
|
1798
|
+
columnNumber: 58
|
|
1799
|
+
}, this), el, key))
|
|
1606
1800
|
]
|
|
1607
|
-
}
|
|
1608
|
-
|
|
1801
|
+
}, void 0, true, {
|
|
1802
|
+
fileName: _jsxFileName,
|
|
1803
|
+
lineNumber: 1514,
|
|
1804
|
+
columnNumber: 9
|
|
1805
|
+
}, this),
|
|
1806
|
+
/* @__PURE__ */ jsxDEV(FootnotesList, {
|
|
1609
1807
|
notes: footnotes,
|
|
1610
1808
|
readOnly,
|
|
1611
1809
|
density: dense ? "dense" : "default",
|
|
1612
1810
|
onEdit: (m) => openFootnote(m),
|
|
1613
1811
|
onBack: (m) => ref.current && backToMarker(ref.current, m)
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1812
|
+
}, void 0, false, {
|
|
1813
|
+
fileName: _jsxFileName,
|
|
1814
|
+
lineNumber: 1737,
|
|
1815
|
+
columnNumber: 7
|
|
1816
|
+
}, this),
|
|
1817
|
+
counts || notice ? /* @__PURE__ */ jsxDEV("div", {
|
|
1616
1818
|
className: "flex h-7 items-center justify-end gap-3 rounded-b-kit-lg border-t border-kit-line-subtle px-3 text-kit-2xs text-kit-fg-3",
|
|
1617
|
-
children: [notice ? /* @__PURE__ */
|
|
1819
|
+
children: [notice ? /* @__PURE__ */ jsxDEV("span", {
|
|
1618
1820
|
role: "status",
|
|
1619
1821
|
"aria-live": "polite",
|
|
1620
1822
|
className: "mr-auto min-w-0 truncate text-kit-fg-2",
|
|
1621
1823
|
children: [
|
|
1622
1824
|
notice.message,
|
|
1623
1825
|
notice.description ? ` ${notice.description}` : "",
|
|
1624
|
-
notice.action ? /* @__PURE__ */
|
|
1826
|
+
notice.action ? /* @__PURE__ */ jsxDEV("button", {
|
|
1625
1827
|
type: "button",
|
|
1626
1828
|
className: "ml-1.5 font-medium text-kit-fg underline underline-offset-2",
|
|
1627
1829
|
onClick: () => {
|
|
@@ -1629,9 +1831,17 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1629
1831
|
setNotice(null);
|
|
1630
1832
|
},
|
|
1631
1833
|
children: notice.action.label
|
|
1632
|
-
}
|
|
1834
|
+
}, void 0, false, {
|
|
1835
|
+
fileName: _jsxFileName,
|
|
1836
|
+
lineNumber: 1754,
|
|
1837
|
+
columnNumber: 17
|
|
1838
|
+
}, this) : null
|
|
1633
1839
|
]
|
|
1634
|
-
}
|
|
1840
|
+
}, void 0, true, {
|
|
1841
|
+
fileName: _jsxFileName,
|
|
1842
|
+
lineNumber: 1750,
|
|
1843
|
+
columnNumber: 13
|
|
1844
|
+
}, this) : null, counts ? /* @__PURE__ */ jsxDEV("span", {
|
|
1635
1845
|
className: "tabular-nums",
|
|
1636
1846
|
children: [
|
|
1637
1847
|
words.toLocaleString("en-US"),
|
|
@@ -1642,9 +1852,17 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1642
1852
|
Math.max(1, Math.round(words / 220)),
|
|
1643
1853
|
" min read"
|
|
1644
1854
|
]
|
|
1645
|
-
}
|
|
1646
|
-
|
|
1647
|
-
|
|
1855
|
+
}, void 0, true, {
|
|
1856
|
+
fileName: _jsxFileName,
|
|
1857
|
+
lineNumber: 1768,
|
|
1858
|
+
columnNumber: 13
|
|
1859
|
+
}, this) : null]
|
|
1860
|
+
}, void 0, true, {
|
|
1861
|
+
fileName: _jsxFileName,
|
|
1862
|
+
lineNumber: 1748,
|
|
1863
|
+
columnNumber: 9
|
|
1864
|
+
}, this) : null,
|
|
1865
|
+
bubble && !quiet && !readOnly && !slash && !link && !md && !menus.style && !menus.more && !insertOpen ? /* @__PURE__ */ jsxDEV(SelectionBubble, {
|
|
1648
1866
|
rect: bubble,
|
|
1649
1867
|
avoid: toolbarOpen ? wrap.current?.querySelector("[role=\"toolbar\"][aria-label=\"Text formatting\"]")?.getBoundingClientRect() : null,
|
|
1650
1868
|
fmt,
|
|
@@ -1659,12 +1877,20 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1659
1877
|
},
|
|
1660
1878
|
onLink: openLink,
|
|
1661
1879
|
onComment: commentSel
|
|
1662
|
-
}
|
|
1663
|
-
|
|
1880
|
+
}, void 0, false, {
|
|
1881
|
+
fileName: _jsxFileName,
|
|
1882
|
+
lineNumber: 1778,
|
|
1883
|
+
columnNumber: 9
|
|
1884
|
+
}, this) : null,
|
|
1885
|
+
slash && !md ? createPortal(/* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1664
1886
|
"data-floating-layer": "",
|
|
1665
1887
|
className: "pointer-events-auto fixed inset-0 z-[var(--kit-z-popover,84)]",
|
|
1666
1888
|
onMouseDown: () => setSlash(null)
|
|
1667
|
-
}
|
|
1889
|
+
}, void 0, false, {
|
|
1890
|
+
fileName: _jsxFileName,
|
|
1891
|
+
lineNumber: 1800,
|
|
1892
|
+
columnNumber: 15
|
|
1893
|
+
}, this), /* @__PURE__ */ jsxDEV(motion.div, {
|
|
1668
1894
|
initial: {
|
|
1669
1895
|
opacity: 0,
|
|
1670
1896
|
y: flipUp ? -4 : 4
|
|
@@ -1680,7 +1906,7 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1680
1906
|
},
|
|
1681
1907
|
"data-floating-layer": "",
|
|
1682
1908
|
className: "pointer-events-auto fixed z-[calc(var(--kit-z-popover,84)_+_1)]",
|
|
1683
|
-
children: /* @__PURE__ */
|
|
1909
|
+
children: /* @__PURE__ */ jsxDEV(SlashMenuPanel, {
|
|
1684
1910
|
query: slash.query,
|
|
1685
1911
|
folder: slash.folder,
|
|
1686
1912
|
active: slash.active,
|
|
@@ -1691,12 +1917,24 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1691
1917
|
}),
|
|
1692
1918
|
onPick: pickSlash,
|
|
1693
1919
|
maxHeight: slashMaxH
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
|
|
1920
|
+
}, void 0, false, {
|
|
1921
|
+
fileName: _jsxFileName,
|
|
1922
|
+
lineNumber: 1812,
|
|
1923
|
+
columnNumber: 17
|
|
1924
|
+
}, this)
|
|
1925
|
+
}, void 0, false, {
|
|
1926
|
+
fileName: _jsxFileName,
|
|
1927
|
+
lineNumber: 1801,
|
|
1928
|
+
columnNumber: 15
|
|
1929
|
+
}, this)] }, void 0, true, {
|
|
1930
|
+
fileName: _jsxFileName,
|
|
1931
|
+
lineNumber: 1799,
|
|
1932
|
+
columnNumber: 13
|
|
1933
|
+
}, this), document.body) : null,
|
|
1934
|
+
/* @__PURE__ */ jsxDEV(Popover, {
|
|
1697
1935
|
open: !!fnEdit,
|
|
1698
1936
|
onOpenChange: (o) => !o && closeFootnote(),
|
|
1699
|
-
children: [/* @__PURE__ */
|
|
1937
|
+
children: [/* @__PURE__ */ jsxDEV(PopoverAnchor, { render: /* @__PURE__ */ jsxDEV("span", {
|
|
1700
1938
|
className: "pointer-events-none fixed",
|
|
1701
1939
|
style: fnEdit ? {
|
|
1702
1940
|
top: fnEdit.rect.bottom,
|
|
@@ -1707,10 +1945,18 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1707
1945
|
top: 0,
|
|
1708
1946
|
left: 0
|
|
1709
1947
|
}
|
|
1710
|
-
}
|
|
1948
|
+
}, void 0, false, {
|
|
1949
|
+
fileName: _jsxFileName,
|
|
1950
|
+
lineNumber: 1822,
|
|
1951
|
+
columnNumber: 19
|
|
1952
|
+
}, this) }, void 0, false, {
|
|
1953
|
+
fileName: _jsxFileName,
|
|
1954
|
+
lineNumber: 1821,
|
|
1955
|
+
columnNumber: 9
|
|
1956
|
+
}, this), /* @__PURE__ */ jsxDEV(PopoverContent, {
|
|
1711
1957
|
className: FOOTNOTE_POPOVER_CLASS,
|
|
1712
1958
|
finalFocus: false,
|
|
1713
|
-
children: fnEdit ? /* @__PURE__ */
|
|
1959
|
+
children: fnEdit ? /* @__PURE__ */ jsxDEV(FootnoteEditor, {
|
|
1714
1960
|
n: footnotes.findIndex((f) => f.el === fnEdit.el) + 1,
|
|
1715
1961
|
note: fnEdit.el.getAttribute("data-note") ?? "",
|
|
1716
1962
|
onChange: (v) => {
|
|
@@ -1719,13 +1965,25 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1719
1965
|
},
|
|
1720
1966
|
onRemove: () => removeFootnote(fnEdit.el),
|
|
1721
1967
|
onDone: closeFootnote
|
|
1722
|
-
}, footnotes.findIndex((f) => f.el === fnEdit.el)
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1968
|
+
}, footnotes.findIndex((f) => f.el === fnEdit.el), false, {
|
|
1969
|
+
fileName: _jsxFileName,
|
|
1970
|
+
lineNumber: 1826,
|
|
1971
|
+
columnNumber: 13
|
|
1972
|
+
}, this) : null
|
|
1973
|
+
}, void 0, false, {
|
|
1974
|
+
fileName: _jsxFileName,
|
|
1975
|
+
lineNumber: 1824,
|
|
1976
|
+
columnNumber: 9
|
|
1977
|
+
}, this)]
|
|
1978
|
+
}, void 0, true, {
|
|
1979
|
+
fileName: _jsxFileName,
|
|
1980
|
+
lineNumber: 1820,
|
|
1981
|
+
columnNumber: 7
|
|
1982
|
+
}, this),
|
|
1983
|
+
/* @__PURE__ */ jsxDEV(Popover, {
|
|
1726
1984
|
open: !!link,
|
|
1727
1985
|
onOpenChange: (o) => !o && setLink(null),
|
|
1728
|
-
children: [/* @__PURE__ */
|
|
1986
|
+
children: [/* @__PURE__ */ jsxDEV(PopoverAnchor, { render: /* @__PURE__ */ jsxDEV("span", {
|
|
1729
1987
|
className: "pointer-events-none fixed",
|
|
1730
1988
|
style: link ? {
|
|
1731
1989
|
top: link.rect.bottom,
|
|
@@ -1736,10 +1994,18 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1736
1994
|
top: 0,
|
|
1737
1995
|
left: 0
|
|
1738
1996
|
}
|
|
1739
|
-
}
|
|
1997
|
+
}, void 0, false, {
|
|
1998
|
+
fileName: _jsxFileName,
|
|
1999
|
+
lineNumber: 1844,
|
|
2000
|
+
columnNumber: 19
|
|
2001
|
+
}, this) }, void 0, false, {
|
|
2002
|
+
fileName: _jsxFileName,
|
|
2003
|
+
lineNumber: 1843,
|
|
2004
|
+
columnNumber: 9
|
|
2005
|
+
}, this), /* @__PURE__ */ jsxDEV(PopoverContent, {
|
|
1740
2006
|
className: "w-[340px] rounded-kit-lg p-3",
|
|
1741
2007
|
finalFocus: false,
|
|
1742
|
-
children: link?.button ? /* @__PURE__ */
|
|
2008
|
+
children: link?.button ? /* @__PURE__ */ jsxDEV(ButtonLinkPanel, {
|
|
1743
2009
|
initial: link.initial,
|
|
1744
2010
|
label: link.button.label,
|
|
1745
2011
|
allowNewTab,
|
|
@@ -1751,9 +2017,13 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1751
2017
|
if (ref.current) removeButton(ref.current, a);
|
|
1752
2018
|
emit();
|
|
1753
2019
|
}
|
|
1754
|
-
}
|
|
2020
|
+
}, void 0, false, {
|
|
2021
|
+
fileName: _jsxFileName,
|
|
2022
|
+
lineNumber: 1848,
|
|
2023
|
+
columnNumber: 13
|
|
2024
|
+
}, this) : link ? /* @__PURE__ */ jsxDEV("div", {
|
|
1755
2025
|
className: "flex flex-col gap-2",
|
|
1756
|
-
children: /* @__PURE__ */
|
|
2026
|
+
children: /* @__PURE__ */ jsxDEV(LinkPopoverBody, {
|
|
1757
2027
|
initial: toLinkValue(link.initial),
|
|
1758
2028
|
hideNewTab: !allowNewTab,
|
|
1759
2029
|
onSave: (v) => saveLink(fromLinkValue(v, allowNewTab)),
|
|
@@ -1764,17 +2034,33 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1764
2034
|
setLink(null);
|
|
1765
2035
|
emit();
|
|
1766
2036
|
} : void 0
|
|
1767
|
-
}
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
2037
|
+
}, void 0, false, {
|
|
2038
|
+
fileName: _jsxFileName,
|
|
2039
|
+
lineNumber: 1863,
|
|
2040
|
+
columnNumber: 15
|
|
2041
|
+
}, this)
|
|
2042
|
+
}, void 0, false, {
|
|
2043
|
+
fileName: _jsxFileName,
|
|
2044
|
+
lineNumber: 1862,
|
|
2045
|
+
columnNumber: 13
|
|
2046
|
+
}, this) : null
|
|
2047
|
+
}, void 0, false, {
|
|
2048
|
+
fileName: _jsxFileName,
|
|
2049
|
+
lineNumber: 1846,
|
|
2050
|
+
columnNumber: 9
|
|
2051
|
+
}, this)]
|
|
2052
|
+
}, void 0, true, {
|
|
2053
|
+
fileName: _jsxFileName,
|
|
2054
|
+
lineNumber: 1842,
|
|
2055
|
+
columnNumber: 7
|
|
2056
|
+
}, this),
|
|
2057
|
+
!hideFullscreen ? /* @__PURE__ */ jsxDEV(ExpandedEditorModal, {
|
|
1772
2058
|
open: modalOpen,
|
|
1773
2059
|
onOpenChange: setModalOpen,
|
|
1774
2060
|
crumbs: expandCrumbs?.length ? expandCrumbs : ["Text"],
|
|
1775
2061
|
returnFocus: () => ref.current,
|
|
1776
2062
|
meta: bodyCountLabel(value),
|
|
1777
|
-
children: modalOpen ? /* @__PURE__ */
|
|
2063
|
+
children: modalOpen ? /* @__PURE__ */ jsxDEV(RichTextEditor, {
|
|
1778
2064
|
value,
|
|
1779
2065
|
onChange,
|
|
1780
2066
|
readOnly,
|
|
@@ -1791,11 +2077,27 @@ function RichTextEditor({ value, onChange, readOnly, placeholder, docKey, featur
|
|
|
1791
2077
|
autoFocus: true,
|
|
1792
2078
|
onComment,
|
|
1793
2079
|
components
|
|
1794
|
-
}
|
|
1795
|
-
|
|
2080
|
+
}, void 0, false, {
|
|
2081
|
+
fileName: _jsxFileName,
|
|
2082
|
+
lineNumber: 1886,
|
|
2083
|
+
columnNumber: 13
|
|
2084
|
+
}, this) : null
|
|
2085
|
+
}, void 0, false, {
|
|
2086
|
+
fileName: _jsxFileName,
|
|
2087
|
+
lineNumber: 1884,
|
|
2088
|
+
columnNumber: 9
|
|
2089
|
+
}, this) : null
|
|
1796
2090
|
]
|
|
1797
|
-
}
|
|
1798
|
-
|
|
2091
|
+
}, void 0, true, {
|
|
2092
|
+
fileName: _jsxFileName,
|
|
2093
|
+
lineNumber: 1373,
|
|
2094
|
+
columnNumber: 5
|
|
2095
|
+
}, this)
|
|
2096
|
+
}, void 0, false, {
|
|
2097
|
+
fileName: _jsxFileName,
|
|
2098
|
+
lineNumber: 1372,
|
|
2099
|
+
columnNumber: 5
|
|
2100
|
+
}, this);
|
|
1799
2101
|
}
|
|
1800
2102
|
//#endregion
|
|
1801
2103
|
export { RT_PANEL, RT_PROSE, RichTextEditor, bodyCountLabel, countComponents, countWords, slashPlacement };
|