@tempots/beatui 0.81.0 → 0.82.1
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/_commonjsHelpers-DKOUU3wS.cjs +1 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/{ar-DwHLVgKj.cjs → ar-D7CXDmVZ.cjs} +1 -1
- package/dist/{ar-Bo_FZZi7.js → ar-nOSKXpIW.js} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +63 -1349
- package/dist/auth-divider-BqZPH1-z.cjs +1 -0
- package/dist/auth-divider-Wr-S16kF.js +1355 -0
- package/dist/beatui.css +2035 -295
- package/dist/beatui.tailwind.css +2036 -296
- package/dist/better-auth/index.cjs.js +1 -0
- package/dist/better-auth/index.es.js +754 -0
- package/dist/{de-zI5mdV4M.cjs → de-WzsOu9Gn.cjs} +1 -1
- package/dist/{de-CCqwOkqN.js → de-f2xcEb34.js} +1 -1
- package/dist/{deep-merge-1uN6CG6K.js → deep-merge-BYm0y62g.js} +271 -285
- package/dist/deep-merge-d7sf0xmN.cjs +1 -0
- package/dist/duration-input-B9UNmUCh.cjs +1 -0
- package/dist/{duration-input-C9kpsw-t.js → duration-input-DqcJbxKD.js} +31 -29
- package/dist/editor-toolbar-group--a-xgsJw.cjs +1 -0
- package/dist/editor-toolbar-group-CVpl5mxF.js +31 -0
- package/dist/{es-BF02UrPL.js → es-CDqqzpCw.js} +1 -1
- package/dist/{es-Cw90CAbu.cjs → es-Ds2Xf3wV.cjs} +1 -1
- package/dist/{fa-DPQV4YB8.js → fa-C7tE_hR3.js} +1 -1
- package/dist/{fa-B4lssnzR.cjs → fa-Ct1UtDB7.cjs} +1 -1
- package/dist/{fr-1Kd6z1F-.cjs → fr-CzAkRFed.cjs} +1 -1
- package/dist/{fr-dmxPhwkD.js → fr-yOW_68YY.js} +1 -1
- package/dist/{he-BtQbrVt3.js → he-D2oUloCJ.js} +1 -1
- package/dist/{he-CJ3XnuPm.cjs → he-DlXALrK7.cjs} +1 -1
- package/dist/{hi-BpfnFKHp.cjs → hi-3dBhLwDs.cjs} +1 -1
- package/dist/{hi-D_Le4Yka.js → hi-D5ZlZoQq.js} +1 -1
- package/dist/{hls.light.min-Bhrf47iR.cjs → hls.light.min-C6xKDzRR.cjs} +1 -1
- package/dist/{hls.light.min-C6VwviEa.js → hls.light.min-hEMf_E8u.js} +1 -1
- package/dist/{index-CfaWytS2.cjs → index-05UbKOYe.cjs} +1 -1
- package/dist/{index-K6u33-GC.cjs → index-Bt7FYl80.cjs} +19 -19
- package/dist/{index-YtW7SCWB.js → index-C2Lq1m45.js} +1434 -1463
- package/dist/{index-CGEzILlC.js → index-lYhXnu6I.js} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +2389 -2738
- package/dist/input-container-C6qEIjcA.cjs +1 -0
- package/dist/input-container-DiCjOzR2.js +247 -0
- package/dist/{it-DyHjSuHN.js → it-6e6X-4BB.js} +1 -1
- package/dist/{it-COCZ9NyB.cjs → it-DohtcWi9.cjs} +1 -1
- package/dist/{ja-X43lABza.js → ja-BxNuNo2H.js} +1 -1
- package/dist/{ja--NdggLU9.cjs → ja-eyTArrgS.cjs} +1 -1
- package/dist/json-schema/index.cjs.js +1 -8
- package/dist/json-schema/index.es.js +1359 -7608
- package/dist/json-schema-display/index.cjs.js +1 -0
- package/dist/json-schema-display/index.es.js +846 -0
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +542 -698
- package/dist/{ko-BUvb0ggK.cjs → ko-BFLCDMMs.cjs} +1 -1
- package/dist/{ko-B9g9iw99.js → ko-Ch0jFsBV.js} +1 -1
- package/dist/lexical/index.cjs.js +46 -0
- package/dist/lexical/index.es.js +21370 -0
- package/dist/lexical.css +1124 -0
- package/dist/menu-CZzRsQP_.js +372 -0
- package/dist/menu-ClrU72xH.cjs +1 -0
- package/dist/modal-I5srcntN.cjs +1 -0
- package/dist/modal-v3u2Fpnd.js +488 -0
- package/dist/{nl-0S25Gsld.cjs → nl-Bx2ACvr4.cjs} +1 -1
- package/dist/{nl-Ew5jnSsT.js → nl-NuTdZO1s.js} +1 -1
- package/dist/{notice-C-964yaY.js → notice-BuZvdvZh.js} +84 -82
- package/dist/notice-CLDdy1MW.cjs +1 -0
- package/dist/oneof-branch-detection-DsM1K5xc.cjs +8 -0
- package/dist/oneof-branch-detection-Dt8ss9lc.js +6281 -0
- package/dist/{pl-C9f6UBSe.js → pl-Bs4nLJ__.js} +1 -1
- package/dist/{pl-B3k-K3S4.cjs → pl-QHl6sl8f.cjs} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{pt-DYtAvbrw.js → pt-BETjHZrL.js} +1 -1
- package/dist/{pt-CKoikRO5.cjs → pt-DZGw2Z-1.cjs} +1 -1
- package/dist/{ru-ZexN-b8V.js → ru-Bi1_DEKM.js} +1 -1
- package/dist/{ru-COb7RSDt.cjs → ru-D03IuLqh.cjs} +1 -1
- package/dist/session-id-3KiilioY.js +8 -0
- package/dist/session-id-B5lJMzbB.cjs +1 -0
- package/dist/stack-BJgsPJ9A.js +873 -0
- package/dist/stack-DcZ_u50f.cjs +1 -0
- package/dist/string-B9vVyfq3.cjs +1 -0
- package/dist/string-DYyMxBl-.js +19 -0
- package/dist/styles-url-B2dzXrYt.cjs +1 -0
- package/dist/styles-url-Cw_mxshe.js +4 -0
- package/dist/text-input-B3VBat1k.js +44 -0
- package/dist/text-input-Ds8e7Z1G.cjs +1 -0
- package/dist/{toolbar-DNpBIoJo.js → toolbar-D994_E_s.js} +4 -4
- package/dist/toolbar-x0_8lmKu.cjs +1 -0
- package/dist/{tr-tO_EH-Y2.cjs → tr-B_-_1wua.cjs} +1 -1
- package/dist/{tr-BDvn05-H.js → tr-DiYB-FwX.js} +1 -1
- package/dist/translations-B4-Zd2LM.cjs +1 -0
- package/dist/translations-Cq8bUKJP.js +584 -0
- package/dist/{translations-DwGC_94w.cjs → translations-D62qqNV9.cjs} +1 -1
- package/dist/{translations-CfWR4loD.js → translations-DPr6c05Z.js} +1 -1
- package/dist/types/better-auth/bridge.d.ts +2 -0
- package/dist/types/better-auth/callbacks.d.ts +6 -0
- package/dist/types/better-auth/components/authenticated.d.ts +4 -0
- package/dist/types/better-auth/components/better-auth-container.d.ts +4 -0
- package/dist/types/better-auth/components/better-auth-modal.d.ts +4 -0
- package/dist/types/better-auth/components/magic-link-form.d.ts +7 -0
- package/dist/types/better-auth/components/passkey-management.d.ts +6 -0
- package/dist/types/better-auth/components/passkey-signin.d.ts +12 -0
- package/dist/types/better-auth/components/two-factor-setup.d.ts +8 -0
- package/dist/types/better-auth/components/two-factor-verify.d.ts +10 -0
- package/dist/types/better-auth/i18n/default.d.ts +29 -0
- package/dist/types/better-auth/i18n/locales/en.d.ts +28 -0
- package/dist/types/better-auth/i18n/translations.d.ts +27 -0
- package/dist/types/better-auth/index.d.ts +22 -0
- package/dist/types/better-auth/provider.d.ts +6 -0
- package/dist/types/better-auth/session.d.ts +14 -0
- package/dist/types/better-auth/social-mapping.d.ts +2 -0
- package/dist/types/better-auth/types.d.ts +164 -0
- package/dist/types/components/auth/auth-container.d.ts +1 -1
- package/dist/types/components/auth/social-providers.d.ts +1 -1
- package/dist/types/components/auth/types.d.ts +2 -0
- package/dist/types/components/editor-toolbar/editor-toolbar-button.d.ts +16 -0
- package/dist/types/components/editor-toolbar/editor-toolbar-group.d.ts +9 -0
- package/dist/types/components/editor-toolbar/index.d.ts +2 -0
- package/dist/types/components/json-schema-display/display-widget-customization.d.ts +61 -0
- package/dist/types/components/json-schema-display/display-wrapper.d.ts +14 -0
- package/dist/types/components/json-schema-display/displays/any-display.d.ts +14 -0
- package/dist/types/components/json-schema-display/displays/array-display.d.ts +13 -0
- package/dist/types/components/json-schema-display/displays/boolean-display.d.ts +13 -0
- package/dist/types/components/json-schema-display/displays/composition-display.d.ts +14 -0
- package/dist/types/components/json-schema-display/displays/enum-const-display.d.ts +13 -0
- package/dist/types/components/json-schema-display/displays/generic-display.d.ts +18 -0
- package/dist/types/components/json-schema-display/displays/null-display.d.ts +13 -0
- package/dist/types/components/json-schema-display/displays/number-display.d.ts +13 -0
- package/dist/types/components/json-schema-display/displays/object-display.d.ts +13 -0
- package/dist/types/components/json-schema-display/displays/string-display.d.ts +14 -0
- package/dist/types/components/json-schema-display/index.d.ts +14 -0
- package/dist/types/components/json-schema-display/json-schema-display.d.ts +25 -0
- package/dist/types/components/json-schema-display/mismatch.d.ts +14 -0
- package/dist/types/components/json-structure/controls/control-utils.d.ts +19 -0
- package/dist/types/components/json-structure/controls/index.d.ts +1 -0
- package/dist/types/components/lexical/bare-editor.d.ts +29 -0
- package/dist/types/components/lexical/code/index.d.ts +1 -0
- package/dist/types/components/lexical/code/language-selector.d.ts +13 -0
- package/dist/types/components/lexical/contextual-editor.d.ts +22 -0
- package/dist/types/components/lexical/docked-editor.d.ts +23 -0
- package/dist/types/components/lexical/floating/block-handle.d.ts +16 -0
- package/dist/types/components/lexical/floating/floating-toolbar.d.ts +12 -0
- package/dist/types/components/lexical/floating/index.d.ts +6 -0
- package/dist/types/components/lexical/floating/slash-command-palette.d.ts +20 -0
- package/dist/types/components/lexical/index.d.ts +8 -0
- package/dist/types/components/lexical/lexical-editor-input.d.ts +30 -0
- package/dist/types/components/lexical/table/index.d.ts +1 -0
- package/dist/types/components/lexical/table/table-controls.d.ts +12 -0
- package/dist/types/components/lexical/toolbar/index.d.ts +6 -0
- package/dist/types/components/lexical/toolbar/lexical-toolbar.d.ts +12 -0
- package/dist/types/components/lexical/toolbar/toolbar-button.d.ts +1 -0
- package/dist/types/components/lexical/toolbar/toolbar-group.d.ts +1 -0
- package/dist/types/components/lexical/toolbar/toolbar-helpers.d.ts +30 -0
- package/dist/types/components/prosemirror/etoolbar-button.d.ts +1 -11
- package/dist/types/components/prosemirror/etoolbar-group.d.ts +1 -4
- package/dist/types/json-schema-display/index.d.ts +1 -0
- package/dist/types/lexical/commands/index.d.ts +17 -0
- package/dist/types/lexical/headless.d.ts +39 -0
- package/dist/types/lexical/horizontal-rule-node.d.ts +20 -0
- package/dist/types/lexical/index.d.ts +20 -0
- package/dist/types/lexical/lazy-loader.d.ts +35 -0
- package/dist/types/lexical/nodes.d.ts +29 -0
- package/dist/types/lexical/plugins/auto-link.d.ts +7 -0
- package/dist/types/lexical/plugins/clipboard.d.ts +11 -0
- package/dist/types/lexical/plugins/code-shiki.d.ts +11 -0
- package/dist/types/lexical/plugins/code.d.ts +7 -0
- package/dist/types/lexical/plugins/dragon.d.ts +6 -0
- package/dist/types/lexical/plugins/file-io.d.ts +10 -0
- package/dist/types/lexical/plugins/hashtag.d.ts +7 -0
- package/dist/types/lexical/plugins/history.d.ts +7 -0
- package/dist/types/lexical/plugins/horizontal-rule.d.ts +12 -0
- package/dist/types/lexical/plugins/html-io.d.ts +9 -0
- package/dist/types/lexical/plugins/index.d.ts +24 -0
- package/dist/types/lexical/plugins/link.d.ts +6 -0
- package/dist/types/lexical/plugins/list.d.ts +6 -0
- package/dist/types/lexical/plugins/mark.d.ts +15 -0
- package/dist/types/lexical/plugins/markdown-io.d.ts +13 -0
- package/dist/types/lexical/plugins/offset.d.ts +6 -0
- package/dist/types/lexical/plugins/overflow.d.ts +7 -0
- package/dist/types/lexical/plugins/plain-text.d.ts +6 -0
- package/dist/types/lexical/plugins/rich-text.d.ts +6 -0
- package/dist/types/lexical/plugins/selection.d.ts +6 -0
- package/dist/types/lexical/plugins/slash-commands.d.ts +26 -0
- package/dist/types/lexical/plugins/table.d.ts +11 -0
- package/dist/types/lexical/plugins/text.d.ts +13 -0
- package/dist/types/lexical/plugins/yjs.d.ts +9 -0
- package/dist/types/lexical/styles-url.d.ts +2 -0
- package/dist/types/lexical/styles.d.ts +2 -0
- package/dist/types/lexical/types.d.ts +634 -0
- package/dist/types/lexical-i18n/default.d.ts +92 -0
- package/dist/types/lexical-i18n/index.d.ts +21 -0
- package/dist/types/lexical-i18n/locales/ar.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/de.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/en.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/es.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/fa.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/fr.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/he.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/hi.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/it.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/ja.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/ko.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/nl.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/pl.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/pt.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/ru.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/tr.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/ur.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/vi.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/zh.d.ts +91 -0
- package/dist/types/lexical-i18n/translations.d.ts +21 -0
- package/dist/{ur-DbEqQgS6.js → ur-B69X-xNs.js} +1 -1
- package/dist/{ur-BbnYJ3HS.cjs → ur-DyUSmIbo.cjs} +1 -1
- package/dist/use-animated-toggle-ChycsEoj.js +175 -0
- package/dist/use-animated-toggle-DR6CyMac.cjs +1 -0
- package/dist/use-form-B56E_x5Y.js +859 -0
- package/dist/use-form-Cnp3XQ5X.cjs +2 -0
- package/dist/utils-DEbsp9Q9.js +129 -0
- package/dist/utils-DIUEhA-Z.cjs +1 -0
- package/dist/{vi-CpZUeuSj.js → vi-BdzxA60L.js} +1 -1
- package/dist/{vi-ByBwvGQY.cjs → vi-CBmPaHxg.cjs} +1 -1
- package/dist/widget-customization-Dk7XcVly.cjs +1 -0
- package/dist/widget-customization-Ds9sicAg.js +1073 -0
- package/dist/{zh-DnxK0ieB.cjs → zh-Cb1b8uik.cjs} +1 -1
- package/dist/{zh-DJyhKO0I.js → zh-Dn1UJiZa.js} +1 -1
- package/package.json +59 -8
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/_commonjsHelpers-DwGv2jUC.cjs +0 -1
- package/dist/deep-merge-CBIkQM4E.cjs +0 -1
- package/dist/duration-input-DHWhQJnn.cjs +0 -1
- package/dist/modal-CSHIhHvI.js +0 -654
- package/dist/modal-cc8Ehngz.cjs +0 -1
- package/dist/notice-C_BWqu2K.cjs +0 -1
- package/dist/toolbar-D5FcnRju.cjs +0 -1
- package/dist/translations-0tLX4x7M.js +0 -866
- package/dist/translations-WPN3ibDg.cjs +0 -1
- package/dist/use-form-D4JFOcjo.cjs +0 -2
- package/dist/use-form-D4rqJkvG.js +0 -1731
- package/dist/widget-customization-BSjJz3_Y.js +0 -1195
- package/dist/widget-customization-CrFVrt4V.cjs +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utilities for JSON Structure controls
|
|
3
|
+
*/
|
|
4
|
+
import type { StructureContext } from '../structure-context';
|
|
5
|
+
import type { TypeDefinition } from '../structure-types';
|
|
6
|
+
/**
|
|
7
|
+
* Create input wrapper options from context
|
|
8
|
+
* Shared by all control components
|
|
9
|
+
*/
|
|
10
|
+
export declare function createInputOptions(ctx: StructureContext): {
|
|
11
|
+
label: string | undefined;
|
|
12
|
+
description: string | undefined;
|
|
13
|
+
required: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Get the default value for a type based on its definition
|
|
17
|
+
* Used when creating new items in arrays, sets, maps, tuples, and objects
|
|
18
|
+
*/
|
|
19
|
+
export declare function makeDefaultValue(definition: TypeDefinition): unknown;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Renderable } from '@tempots/dom';
|
|
2
|
+
import type { BareEditorOptions } from '../../lexical/types';
|
|
3
|
+
/**
|
|
4
|
+
* BareEditor - Foundational headless rich text editor component
|
|
5
|
+
*
|
|
6
|
+
* A minimal Lexical editor surface with no UI chrome. This is the base component
|
|
7
|
+
* that Docked and Contextual presets will build upon.
|
|
8
|
+
*
|
|
9
|
+
* Features:
|
|
10
|
+
* - Headless editor surface (contenteditable)
|
|
11
|
+
* - Plugin-based architecture (rich-text, plain-text, history, clipboard, list, link)
|
|
12
|
+
* - Multiple content formats (markdown, JSON)
|
|
13
|
+
* - Theme integration (light/dark)
|
|
14
|
+
* - Reactive value binding
|
|
15
|
+
* - Read-only mode support
|
|
16
|
+
* - Event callbacks (onInput, onChange, onBlur, onReady, onError)
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const content = prop('')
|
|
21
|
+
* BareEditor({
|
|
22
|
+
* value: content,
|
|
23
|
+
* format: 'markdown',
|
|
24
|
+
* plugins: { richText: true, history: true },
|
|
25
|
+
* onInput: (value) => console.log('Input:', value),
|
|
26
|
+
* })
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare const BareEditor: (options: BareEditorOptions) => Renderable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './language-selector';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Signal, TNode } from '@tempots/dom';
|
|
2
|
+
import type { LexicalEditor } from 'lexical';
|
|
3
|
+
export interface LanguageSelectorOptions {
|
|
4
|
+
editor: Signal<LexicalEditor | null>;
|
|
5
|
+
stateUpdate: Signal<number>;
|
|
6
|
+
readOnly?: Signal<boolean>;
|
|
7
|
+
languages?: string[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Language selector that appears when a code block is selected.
|
|
11
|
+
* Allows changing the programming language for syntax highlighting.
|
|
12
|
+
*/
|
|
13
|
+
export declare function LanguageSelector({ editor, stateUpdate, readOnly, languages, }: LanguageSelectorOptions): TNode;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Renderable } from '@tempots/dom';
|
|
2
|
+
import type { ContextualEditorOptions } from '../../lexical/types';
|
|
3
|
+
/**
|
|
4
|
+
* ContextualEditor - Rich text editor with floating toolbar and block handle
|
|
5
|
+
*
|
|
6
|
+
* A clean editor surface that shows a floating toolbar when text is selected
|
|
7
|
+
* and a block handle at the left of each block for changing block types.
|
|
8
|
+
* No permanent UI chrome.
|
|
9
|
+
*
|
|
10
|
+
* Default plugins: richText, history, clipboard, list, link
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const content = prop('')
|
|
15
|
+
* ContextualEditor({
|
|
16
|
+
* value: content,
|
|
17
|
+
* format: 'markdown',
|
|
18
|
+
* onInput: (value) => console.log('Input:', value),
|
|
19
|
+
* })
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const ContextualEditor: (options: ContextualEditorOptions) => Renderable;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Renderable } from '@tempots/dom';
|
|
2
|
+
import type { DockedEditorOptions } from '../../lexical/types';
|
|
3
|
+
/**
|
|
4
|
+
* DockedEditor - Rich text editor with a persistent toolbar
|
|
5
|
+
*
|
|
6
|
+
* Extends the BareEditor pattern by adding a configurable toolbar above
|
|
7
|
+
* (or below) the editor surface. Includes all standard formatting groups:
|
|
8
|
+
* text-formatting, headings, lists, blocks, links, and history.
|
|
9
|
+
*
|
|
10
|
+
* Default plugins: richText, history, clipboard, list, link
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const content = prop('')
|
|
15
|
+
* DockedEditor({
|
|
16
|
+
* value: content,
|
|
17
|
+
* format: 'markdown',
|
|
18
|
+
* toolbar: { maxHeadingLevel: 3, hiddenGroups: ['tables'] },
|
|
19
|
+
* onInput: (value) => console.log('Input:', value),
|
|
20
|
+
* })
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const DockedEditor: (options: DockedEditorOptions) => Renderable;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Signal, TNode } from '@tempots/dom';
|
|
2
|
+
import type { LexicalEditor } from 'lexical';
|
|
3
|
+
export interface BlockCommand {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
handler: (editor: LexicalEditor) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const DEFAULT_BLOCK_COMMANDS: BlockCommand[];
|
|
10
|
+
export interface BlockHandleOptions {
|
|
11
|
+
editor: Signal<LexicalEditor | null>;
|
|
12
|
+
stateUpdate: Signal<number>;
|
|
13
|
+
readOnly?: Signal<boolean>;
|
|
14
|
+
commands?: BlockCommand[];
|
|
15
|
+
}
|
|
16
|
+
export declare function BlockHandle({ editor, stateUpdate, readOnly, commands, }: BlockHandleOptions): TNode;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Signal, TNode } from '@tempots/dom';
|
|
2
|
+
import type { LexicalEditor } from 'lexical';
|
|
3
|
+
import type { ToolbarGroupId } from '../../../lexical/types';
|
|
4
|
+
import { ControlSize } from '../../theme';
|
|
5
|
+
export interface FloatingToolbarOptions {
|
|
6
|
+
editor: Signal<LexicalEditor | null>;
|
|
7
|
+
stateUpdate: Signal<number>;
|
|
8
|
+
groups?: ToolbarGroupId[];
|
|
9
|
+
readOnly?: Signal<boolean>;
|
|
10
|
+
size?: ControlSize;
|
|
11
|
+
}
|
|
12
|
+
export declare function FloatingToolbar({ editor, stateUpdate, groups, readOnly, size, }: FloatingToolbarOptions): TNode;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { FloatingToolbar } from './floating-toolbar';
|
|
2
|
+
export type { FloatingToolbarOptions } from './floating-toolbar';
|
|
3
|
+
export { SlashCommandPalette, DEFAULT_SLASH_COMMANDS, } from './slash-command-palette';
|
|
4
|
+
export type { SlashCommandPaletteOptions } from './slash-command-palette';
|
|
5
|
+
export { BlockHandle, DEFAULT_BLOCK_COMMANDS } from './block-handle';
|
|
6
|
+
export type { BlockHandleOptions, BlockCommand } from './block-handle';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Signal, Prop, TNode } from '@tempots/dom';
|
|
2
|
+
import type { LexicalEditor } from 'lexical';
|
|
3
|
+
import type { SlashCommandDefinition } from '../../../lexical/types';
|
|
4
|
+
export interface SlashCommandPaletteOptions {
|
|
5
|
+
editor: Signal<LexicalEditor | null>;
|
|
6
|
+
commands: SlashCommandDefinition[];
|
|
7
|
+
isVisible: Prop<boolean>;
|
|
8
|
+
filterText: Signal<string>;
|
|
9
|
+
position: Signal<{
|
|
10
|
+
top: number;
|
|
11
|
+
left: number;
|
|
12
|
+
}>;
|
|
13
|
+
onSelect: (command: SlashCommandDefinition) => void;
|
|
14
|
+
onDismiss: () => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Default slash commands for the editor
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEFAULT_SLASH_COMMANDS: SlashCommandDefinition[];
|
|
20
|
+
export declare function SlashCommandPalette({ commands, isVisible, filterText, position, onSelect, onDismiss, }: SlashCommandPaletteOptions): TNode;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { BareEditor } from './bare-editor';
|
|
2
|
+
export { DockedEditor } from './docked-editor';
|
|
3
|
+
export { LexicalToolbar } from './toolbar';
|
|
4
|
+
export type { LexicalToolbarOptions } from './toolbar';
|
|
5
|
+
export { ContextualEditor } from './contextual-editor';
|
|
6
|
+
export { LexicalEditorInput } from './lexical-editor-input';
|
|
7
|
+
export { FloatingToolbar, SlashCommandPalette, DEFAULT_SLASH_COMMANDS, BlockHandle, DEFAULT_BLOCK_COMMANDS, } from './floating';
|
|
8
|
+
export type { FloatingToolbarOptions, SlashCommandPaletteOptions, BlockHandleOptions, BlockCommand, } from './floating';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Renderable } from '@tempots/dom';
|
|
2
|
+
import type { LexicalInputOptions } from '../../lexical/types';
|
|
3
|
+
/**
|
|
4
|
+
* LexicalEditorInput - Form-compatible rich text editor input
|
|
5
|
+
*
|
|
6
|
+
* Wraps BareEditor with BeatUI's form system integration (InputContainer).
|
|
7
|
+
* Supports markdown, HTML, and JSON formats. Compatible with form controllers
|
|
8
|
+
* and validation.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const content = prop('')
|
|
13
|
+
* LexicalEditorInput({
|
|
14
|
+
* value: content,
|
|
15
|
+
* format: 'markdown',
|
|
16
|
+
* placeholder: 'Enter text...',
|
|
17
|
+
* onInput: (v) => console.log(v),
|
|
18
|
+
* })
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example With form controller:
|
|
22
|
+
* ```ts
|
|
23
|
+
* Control(LexicalEditorInput, {
|
|
24
|
+
* controller: formController.field('description'),
|
|
25
|
+
* label: 'Description',
|
|
26
|
+
* format: 'markdown',
|
|
27
|
+
* })
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const LexicalEditorInput: (options: LexicalInputOptions) => Renderable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './table-controls';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Signal, TNode } from '@tempots/dom';
|
|
2
|
+
import type { LexicalEditor } from 'lexical';
|
|
3
|
+
export interface TableControlsOptions {
|
|
4
|
+
editor: Signal<LexicalEditor | null>;
|
|
5
|
+
stateUpdate: Signal<number>;
|
|
6
|
+
readOnly?: Signal<boolean>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Table context menu that appears when a table cell is selected.
|
|
10
|
+
* Provides operations like insert/delete rows/columns.
|
|
11
|
+
*/
|
|
12
|
+
export declare function TableControls({ editor, stateUpdate, readOnly, }: TableControlsOptions): TNode;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { LexicalToolbar } from './lexical-toolbar';
|
|
2
|
+
export type { LexicalToolbarOptions } from './lexical-toolbar';
|
|
3
|
+
export { LexicalToolbarButton } from './toolbar-button';
|
|
4
|
+
export type { LexicalToolbarButtonOptions } from './toolbar-button';
|
|
5
|
+
export { LexicalToolbarGroup } from './toolbar-group';
|
|
6
|
+
export { createToolbarHelpers, createButtonFactory } from './toolbar-helpers';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Signal, Value, TNode } from '@tempots/dom';
|
|
2
|
+
import { type LexicalEditor } from 'lexical';
|
|
3
|
+
import type { ToolbarConfig } from '../../../lexical/types';
|
|
4
|
+
import { ControlSize } from '../../theme';
|
|
5
|
+
export interface LexicalToolbarOptions {
|
|
6
|
+
editor: Signal<LexicalEditor | null>;
|
|
7
|
+
stateUpdate: Signal<number>;
|
|
8
|
+
toolbar?: ToolbarConfig;
|
|
9
|
+
readOnly?: Signal<boolean>;
|
|
10
|
+
size?: Value<ControlSize>;
|
|
11
|
+
}
|
|
12
|
+
export declare function LexicalToolbar({ editor, stateUpdate, toolbar, readOnly, size, }: LexicalToolbarOptions): TNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EditorToolbarButton as LexicalToolbarButton, type EditorToolbarButtonOptions as LexicalToolbarButtonOptions, } from '../../editor-toolbar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EditorToolbarGroup as LexicalToolbarGroup } from '../../editor-toolbar';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Signal, Value } from '@tempots/dom';
|
|
2
|
+
import { type LexicalEditor, type TextFormatType, type RangeSelection, type ElementNode, type LexicalCommand } from 'lexical';
|
|
3
|
+
import { ControlSize } from '../../theme';
|
|
4
|
+
/**
|
|
5
|
+
* Create reactive state and action helpers for Lexical toolbar integration.
|
|
6
|
+
* Both the docked toolbar and floating toolbar share these helpers.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createToolbarHelpers(ed: Signal<LexicalEditor>, stateUpdate: Signal<number>): {
|
|
9
|
+
withSelection: <T>(fn: (sel: RangeSelection) => T, fallback: T) => Signal<T>;
|
|
10
|
+
getAnchorElement: (sel: RangeSelection) => ElementNode | import("lexical").TextNode;
|
|
11
|
+
textFormatActive: (fmt: TextFormatType) => Signal<boolean>;
|
|
12
|
+
blockTypeActive: (type: string) => Signal<boolean>;
|
|
13
|
+
listTypeActive: (listType: string) => Signal<boolean>;
|
|
14
|
+
headingActive: (level: number) => import("@tempots/dom").Computed<boolean>;
|
|
15
|
+
linkActive: () => Signal<boolean>;
|
|
16
|
+
dispatch: <T>(command: LexicalCommand<T>, payload: T) => () => void;
|
|
17
|
+
toggleBlock: (type: string, create: () => ElementNode) => () => void;
|
|
18
|
+
toggleLink: () => void;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Create a button factory bound to shared readOnly and size props.
|
|
22
|
+
* Returns a function that takes a display signal and produces
|
|
23
|
+
* a group-specific button builder.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createButtonFactory(readOnly: Signal<boolean>, size: Value<ControlSize>): (display: Signal<boolean>) => (opts: {
|
|
26
|
+
active: Signal<boolean>;
|
|
27
|
+
onClick: () => void;
|
|
28
|
+
label: string;
|
|
29
|
+
icon: string;
|
|
30
|
+
}) => import("@tempots/dom").Renderable;
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ControlSize } from '../theme';
|
|
3
|
-
export declare function EToolbarButton({ active, display, onClick, disabled, label, icon, size, }: {
|
|
4
|
-
active: Signal<boolean>;
|
|
5
|
-
display: Signal<boolean>;
|
|
6
|
-
onClick: () => void;
|
|
7
|
-
disabled: Signal<boolean>;
|
|
8
|
-
label: Value<string>;
|
|
9
|
-
icon: Value<string>;
|
|
10
|
-
size: Value<ControlSize>;
|
|
11
|
-
}): import("@tempots/dom").Renderable;
|
|
1
|
+
export { EditorToolbarButton as EToolbarButton } from '../editor-toolbar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../components/json-schema-display';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lexical commands re-exports and custom BeatUI commands.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports commonly used Lexical commands so consumers don't need
|
|
5
|
+
* to import from 'lexical' directly for basic operations.
|
|
6
|
+
*/
|
|
7
|
+
export { FORMAT_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, UNDO_COMMAND, REDO_COMMAND, INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND, SELECTION_CHANGE_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, INSERT_PARAGRAPH_COMMAND, PASTE_COMMAND, COPY_COMMAND, CUT_COMMAND, CLEAR_EDITOR_COMMAND, CLICK_COMMAND, FOCUS_COMMAND, BLUR_COMMAND, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_EDITOR, createCommand, } from 'lexical';
|
|
8
|
+
export { INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, INSERT_CHECK_LIST_COMMAND, REMOVE_LIST_COMMAND, } from '@lexical/list';
|
|
9
|
+
/** Command to toggle the slash command palette */
|
|
10
|
+
export declare const TOGGLE_SLASH_COMMAND_PALETTE: import("lexical").LexicalCommand<void>;
|
|
11
|
+
/** Command to insert a horizontal rule */
|
|
12
|
+
export declare const INSERT_HORIZONTAL_RULE_COMMAND: import("lexical").LexicalCommand<void>;
|
|
13
|
+
/** Command to insert an image (future use) */
|
|
14
|
+
export declare const INSERT_IMAGE_COMMAND: import("lexical").LexicalCommand<{
|
|
15
|
+
src: string;
|
|
16
|
+
alt?: string;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { LexicalEditor, SerializedEditorState } from 'lexical';
|
|
2
|
+
import type { HeadlessEditorOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Create a headless Lexical editor instance (no DOM mounting).
|
|
5
|
+
* Useful for server-side rendering, testing, or programmatic content manipulation.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const editor = await createHeadlessEditor({
|
|
10
|
+
* nodes: [MyCustomNode],
|
|
11
|
+
* plugins: [myPlugin],
|
|
12
|
+
* })
|
|
13
|
+
*
|
|
14
|
+
* editor.update(() => {
|
|
15
|
+
* const root = $getRoot()
|
|
16
|
+
* root.clear()
|
|
17
|
+
* // ... manipulate content
|
|
18
|
+
* })
|
|
19
|
+
*
|
|
20
|
+
* const json = editor.getEditorState().toJSON()
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function createHeadlessEditor(options?: HeadlessEditorOptions): Promise<LexicalEditor>;
|
|
24
|
+
/**
|
|
25
|
+
* Convert markdown string to Lexical JSON using a headless editor.
|
|
26
|
+
*/
|
|
27
|
+
export declare function markdownToLexicalJson(markdown: string): Promise<SerializedEditorState>;
|
|
28
|
+
/**
|
|
29
|
+
* Convert Lexical JSON to markdown string using a headless editor.
|
|
30
|
+
*/
|
|
31
|
+
export declare function lexicalJsonToMarkdown(json: SerializedEditorState): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Convert HTML string to Lexical JSON using a headless editor.
|
|
34
|
+
*/
|
|
35
|
+
export declare function htmlToLexicalJson(html: string): Promise<SerializedEditorState>;
|
|
36
|
+
/**
|
|
37
|
+
* Convert Lexical JSON to HTML string using a headless editor.
|
|
38
|
+
*/
|
|
39
|
+
export declare function lexicalJsonToHtml(json: SerializedEditorState): Promise<string>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DecoratorNode, type DOMConversionMap, type DOMExportOutput, type LexicalNode, type SerializedLexicalNode, type Spread } from 'lexical';
|
|
2
|
+
export type SerializedHorizontalRuleNode = Spread<{
|
|
3
|
+
type: 'horizontal-rule';
|
|
4
|
+
version: 1;
|
|
5
|
+
}, SerializedLexicalNode>;
|
|
6
|
+
export declare class HorizontalRuleNode extends DecoratorNode<null> {
|
|
7
|
+
static getType(): string;
|
|
8
|
+
static clone(node: HorizontalRuleNode): HorizontalRuleNode;
|
|
9
|
+
static importJSON(_serializedNode: SerializedHorizontalRuleNode): HorizontalRuleNode;
|
|
10
|
+
static importDOM(): DOMConversionMap | null;
|
|
11
|
+
exportJSON(): SerializedHorizontalRuleNode;
|
|
12
|
+
exportDOM(): DOMExportOutput;
|
|
13
|
+
createDOM(): HTMLElement;
|
|
14
|
+
updateDOM(): false;
|
|
15
|
+
getTextContent(): string;
|
|
16
|
+
isInline(): false;
|
|
17
|
+
decorate(): null;
|
|
18
|
+
}
|
|
19
|
+
export declare function $createHorizontalRuleNode(): HorizontalRuleNode;
|
|
20
|
+
export declare function $isHorizontalRuleNode(node: LexicalNode | null | undefined): node is HorizontalRuleNode;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lexical Editor Integration - Entry Point
|
|
3
|
+
* @module @tempots/beatui/lexical
|
|
4
|
+
*
|
|
5
|
+
* Provides rich text editing via Facebook's Lexical framework with three
|
|
6
|
+
* pre-configured presets (Bare, Docked, Contextual), full plugin coverage,
|
|
7
|
+
* multi-format I/O, form integration, and theme/i18n support.
|
|
8
|
+
*/
|
|
9
|
+
export type { ContentFormatType, StringContent, JsonContent, EditorContent, LexicalPluginDefinition, PluginConfig, HistoryPluginOptions, TablePluginOptions, AutoLinkPluginOptions, AutoLinkMatcher, CodePluginOptions, HashtagPluginOptions, OverflowPluginOptions, SlashCommandPluginOptions, SlashCommandDefinition, ToolbarGroupId, ToolbarConfig, MarkMetadata, MarkPluginCallbacks, CollaborationConfig, CollaborationUser, LexicalEditorBaseOptions, BareEditorOptions, DockedEditorOptions, ContextualEditorOptions, LexicalStringInputOptions, LexicalJsonInputOptions, LexicalInputOptions, HeadlessEditorOptions, CharacterCountInfo, SelectionInfo, EditorPresetType, EditorHeightMode, } from './types';
|
|
10
|
+
export { getNodesForPlugins, createDefaultPluginConfig } from './nodes';
|
|
11
|
+
export { HorizontalRuleNode, $createHorizontalRuleNode, $isHorizontalRuleNode, } from './horizontal-rule-node';
|
|
12
|
+
export type { SerializedHorizontalRuleNode } from './horizontal-rule-node';
|
|
13
|
+
export { loadLexicalCore } from './lazy-loader';
|
|
14
|
+
export { registerRichTextPlugin, registerPlainTextPlugin, registerHistoryPlugin, registerClipboardPlugin, registerListPlugin, registerLinkPlugin, registerSlashCommandsPlugin, executeSlashCommand, exportToMarkdown, importFromMarkdown, getMarkdownTransformers, exportToHtml, importFromHtml, exportEditorToFile, importFileToEditor, registerTablePlugin, insertTable, registerCodePlugin, registerCodeShikiPlugin, registerHashtagPlugin, registerAutoLinkPlugin, registerMarkPlugin, applyMark, removeMark, registerOverflowPlugin, registerDragonPlugin, registerYjsPlugin, getSelectionInfo, getTextContent, getCharacterCount, getWordCount, loadOffsetUtils, registerHorizontalRulePlugin, HR_TRANSFORMER, } from './plugins';
|
|
15
|
+
export type { SlashCommandState, SlashCommandCallbacks } from './plugins';
|
|
16
|
+
export { createHeadlessEditor, markdownToLexicalJson, lexicalJsonToMarkdown, htmlToLexicalJson, lexicalJsonToHtml, } from './headless';
|
|
17
|
+
export { createCommand, ElementNode, DecoratorNode, TextNode, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_CRITICAL, } from 'lexical';
|
|
18
|
+
export type { LexicalEditor, LexicalNode, EditorState, SerializedEditorState, SerializedLexicalNode, NodeKey, EditorThemeClasses, } from 'lexical';
|
|
19
|
+
export * from './commands';
|
|
20
|
+
export * from '../components/lexical';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lexical module loaders.
|
|
3
|
+
*
|
|
4
|
+
* All imports are static to ensure a single module instance is shared
|
|
5
|
+
* across all code paths (avoiding Lexical error #195 - dual module instances).
|
|
6
|
+
*
|
|
7
|
+
* The async function signatures are preserved for backward compatibility.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Get the Lexical core module.
|
|
11
|
+
* Returns the statically imported module to ensure a single instance
|
|
12
|
+
* is shared across all code paths (avoiding Lexical error #195).
|
|
13
|
+
*/
|
|
14
|
+
export declare function loadLexicalCore(): Promise<typeof import('lexical')>;
|
|
15
|
+
export declare function loadRichText(): Promise<typeof import('@lexical/rich-text')>;
|
|
16
|
+
export declare function loadPlainText(): Promise<typeof import('@lexical/plain-text')>;
|
|
17
|
+
export declare function loadHistory(): Promise<typeof import('@lexical/history')>;
|
|
18
|
+
export declare function loadList(): Promise<typeof import('@lexical/list')>;
|
|
19
|
+
export declare function loadLink(): Promise<typeof import('@lexical/link')>;
|
|
20
|
+
export declare function loadClipboard(): Promise<typeof import('@lexical/clipboard')>;
|
|
21
|
+
export declare function loadMarkdown(): Promise<typeof import('@lexical/markdown')>;
|
|
22
|
+
export declare function loadHtml(): Promise<typeof import('@lexical/html')>;
|
|
23
|
+
export declare function loadTable(): Promise<typeof import('@lexical/table')>;
|
|
24
|
+
export declare function loadCode(): Promise<typeof import('@lexical/code')>;
|
|
25
|
+
export declare function loadHashtag(): Promise<typeof import('@lexical/hashtag')>;
|
|
26
|
+
export declare function loadMark(): Promise<typeof import('@lexical/mark')>;
|
|
27
|
+
export declare function loadOverflow(): Promise<typeof import('@lexical/overflow')>;
|
|
28
|
+
export declare function loadSelection(): Promise<typeof import('@lexical/selection')>;
|
|
29
|
+
export declare function loadText(): Promise<typeof import('@lexical/text')>;
|
|
30
|
+
export declare function loadUtils(): Promise<typeof import('@lexical/utils')>;
|
|
31
|
+
export declare function loadOffset(): Promise<typeof import('@lexical/offset')>;
|
|
32
|
+
export declare function loadDragon(): Promise<typeof import('@lexical/dragon')>;
|
|
33
|
+
export declare function loadFile(): Promise<typeof import('@lexical/file')>;
|
|
34
|
+
export declare function loadYjs(): Promise<typeof import('@lexical/yjs')>;
|
|
35
|
+
export declare function loadHeadless(): Promise<typeof import('@lexical/headless')>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Klass, LexicalNode } from 'lexical';
|
|
2
|
+
import type { EditorPresetType, PluginConfig } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Compute the list of Lexical node classes required for the given plugin configuration.
|
|
5
|
+
* Each plugin maps to specific node types that must be registered with createEditor().
|
|
6
|
+
*
|
|
7
|
+
* Note: Node classes are imported statically (not lazily) because they are needed during
|
|
8
|
+
* editor initialization. These are small registration classes, not the full plugin logic.
|
|
9
|
+
*
|
|
10
|
+
* Common content nodes (HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode,
|
|
11
|
+
* CodeNode, CodeHighlightNode) are always registered so that content in any format
|
|
12
|
+
* (markdown, HTML, JSON) can be parsed and displayed correctly, even when the
|
|
13
|
+
* corresponding editing plugins are not enabled.
|
|
14
|
+
*
|
|
15
|
+
* @param config - The plugin configuration object
|
|
16
|
+
* @returns Array of Lexical node classes to register
|
|
17
|
+
*/
|
|
18
|
+
export declare function getNodesForPlugins(config: PluginConfig): Array<Klass<LexicalNode>>;
|
|
19
|
+
/**
|
|
20
|
+
* Get the default plugin configuration for a given editor preset.
|
|
21
|
+
*
|
|
22
|
+
* - **bare**: Minimal (richText + history + clipboard)
|
|
23
|
+
* - **docked**: Batteries-included (richText + history + clipboard + list + link + autoLink + code + table)
|
|
24
|
+
* - **contextual**: Same as docked (block handle is managed by the component, not a plugin)
|
|
25
|
+
*
|
|
26
|
+
* @param preset - The editor preset type
|
|
27
|
+
* @returns Default plugin configuration for the preset
|
|
28
|
+
*/
|
|
29
|
+
export declare function createDefaultPluginConfig(preset: EditorPresetType): PluginConfig;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type LexicalEditor } from 'lexical';
|
|
2
|
+
import type { AutoLinkPluginOptions } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Register automatic link detection and creation.
|
|
5
|
+
* Detects URLs and email addresses as you type and converts them to links.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerAutoLinkPlugin(editor: LexicalEditor, options?: AutoLinkPluginOptions): Promise<() => void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LexicalEditor } from 'lexical';
|
|
2
|
+
import '@lexical/clipboard';
|
|
3
|
+
/**
|
|
4
|
+
* Register clipboard handling (copy/paste with rich text preservation).
|
|
5
|
+
* Wraps @lexical/clipboard functionality.
|
|
6
|
+
*
|
|
7
|
+
* Note: Lexical handles clipboard operations internally through its command system.
|
|
8
|
+
* This plugin ensures the clipboard utilities from @lexical/clipboard are available
|
|
9
|
+
* and registers paste handlers for HTML sanitization.
|
|
10
|
+
*/
|
|
11
|
+
export declare function registerClipboardPlugin(_editor: LexicalEditor): Promise<() => void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LexicalEditor } from 'lexical';
|
|
2
|
+
import type { CodePluginOptions } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Register Shiki-based syntax highlighting for code blocks.
|
|
5
|
+
* This is an opt-in alternative to the default @lexical/code highlighting.
|
|
6
|
+
* Provides more accurate and theme-aware syntax highlighting using Shiki.
|
|
7
|
+
*
|
|
8
|
+
* Note: @lexical/code-shiki is an optional peer dependency and must be
|
|
9
|
+
* installed separately. If not available, falls back to default highlighting.
|
|
10
|
+
*/
|
|
11
|
+
export declare function registerCodeShikiPlugin(editor: LexicalEditor, _options?: CodePluginOptions): Promise<() => void>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LexicalEditor } from 'lexical';
|
|
2
|
+
import type { CodePluginOptions } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Register code block support with syntax highlighting.
|
|
5
|
+
* Wraps @lexical/code functionality.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerCodePlugin(editor: LexicalEditor, _options?: CodePluginOptions): Promise<() => void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LexicalEditor } from 'lexical';
|
|
2
|
+
import type { ContentFormatType } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Export editor content to a downloadable file.
|
|
5
|
+
*/
|
|
6
|
+
export declare function exportEditorToFile(editor: LexicalEditor, format: ContentFormatType, filename?: string): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Import content from a file into the editor.
|
|
9
|
+
*/
|
|
10
|
+
export declare function importFileToEditor(editor: LexicalEditor, file: File, format?: ContentFormatType): Promise<void>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LexicalEditor } from 'lexical';
|
|
2
|
+
import type { HashtagPluginOptions } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Register hashtag support.
|
|
5
|
+
* Wraps @lexical/hashtag functionality.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerHashtagPlugin(editor: LexicalEditor, options?: HashtagPluginOptions): Promise<() => void>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LexicalEditor } from 'lexical';
|
|
2
|
+
import type { HistoryPluginOptions } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Register undo/redo history support.
|
|
5
|
+
* Wraps @lexical/history's registerHistory.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerHistoryPlugin(editor: LexicalEditor, options?: HistoryPluginOptions): Promise<() => void>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LexicalEditor } from 'lexical';
|
|
2
|
+
import type { ElementTransformer } from '@lexical/markdown';
|
|
3
|
+
/**
|
|
4
|
+
* Register the INSERT_HORIZONTAL_RULE_COMMAND handler on the given editor.
|
|
5
|
+
* Returns a cleanup function to unregister the handler.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerHorizontalRulePlugin(editor: LexicalEditor): () => void;
|
|
8
|
+
/**
|
|
9
|
+
* Markdown transformer for horizontal rules (---).
|
|
10
|
+
* Use this with $convertToMarkdownString / $convertFromMarkdownString.
|
|
11
|
+
*/
|
|
12
|
+
export declare const HR_TRANSFORMER: ElementTransformer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type LexicalEditor } from 'lexical';
|
|
2
|
+
/**
|
|
3
|
+
* Export the editor content to HTML string.
|
|
4
|
+
*/
|
|
5
|
+
export declare function exportToHtml(editor: LexicalEditor): Promise<string>;
|
|
6
|
+
/**
|
|
7
|
+
* Import HTML content into the editor, replacing current content.
|
|
8
|
+
*/
|
|
9
|
+
export declare function importFromHtml(editor: LexicalEditor, html: string): Promise<void>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { registerRichTextPlugin } from './rich-text';
|
|
2
|
+
export { registerPlainTextPlugin } from './plain-text';
|
|
3
|
+
export { registerHistoryPlugin } from './history';
|
|
4
|
+
export { registerClipboardPlugin } from './clipboard';
|
|
5
|
+
export { registerListPlugin } from './list';
|
|
6
|
+
export { registerLinkPlugin } from './link';
|
|
7
|
+
export { registerSlashCommandsPlugin, executeSlashCommand, } from './slash-commands';
|
|
8
|
+
export type { SlashCommandState, SlashCommandCallbacks } from './slash-commands';
|
|
9
|
+
export { exportToMarkdown, importFromMarkdown, getMarkdownTransformers, } from './markdown-io';
|
|
10
|
+
export { exportToHtml, importFromHtml } from './html-io';
|
|
11
|
+
export { exportEditorToFile, importFileToEditor } from './file-io';
|
|
12
|
+
export { registerTablePlugin, insertTable } from './table';
|
|
13
|
+
export { registerCodePlugin } from './code';
|
|
14
|
+
export { registerCodeShikiPlugin } from './code-shiki';
|
|
15
|
+
export { registerHashtagPlugin } from './hashtag';
|
|
16
|
+
export { registerAutoLinkPlugin } from './auto-link';
|
|
17
|
+
export { registerMarkPlugin, applyMark, removeMark } from './mark';
|
|
18
|
+
export { registerOverflowPlugin } from './overflow';
|
|
19
|
+
export { registerDragonPlugin } from './dragon';
|
|
20
|
+
export { registerYjsPlugin } from './yjs';
|
|
21
|
+
export { getSelectionInfo } from './selection';
|
|
22
|
+
export { getTextContent, getCharacterCount, getWordCount } from './text';
|
|
23
|
+
export { loadOffsetUtils } from './offset';
|
|
24
|
+
export { registerHorizontalRulePlugin, HR_TRANSFORMER } from './horizontal-rule';
|