@tempots/beatui 0.94.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ar-CuI1Jgt6.cjs +1 -0
- package/dist/{ar-8Cko5i-Z.js → ar-DaKbK_t8.js} +88 -11
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/{auth-divider-Rt0WDKAe.js → auth-divider-BQIhr3-R.js} +99 -98
- package/dist/auth-divider-DvnUModP.cjs +1 -0
- package/dist/beatui.css +1628 -541
- package/dist/beatui.tailwind.css +1629 -542
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +9 -9
- package/dist/codehighlight/index.cjs.js +22 -0
- package/dist/codehighlight/index.es.js +76 -0
- package/dist/colors-B-p6IzX9.cjs +1 -0
- package/dist/{colors-BY0Ja_bf.js → colors-DwufPN8S.js} +18 -18
- package/dist/{de-Bt-d2iKj.js → de-3MTPDS1i.js} +83 -6
- package/dist/de-DthHehbh.cjs +1 -0
- package/dist/{deep-merge-CoLO4id0.js → deep-merge-BzIheQtH.js} +511 -517
- package/dist/deep-merge-EkjEgK0N.cjs +1 -0
- package/dist/{duration-input-47x7nbGh.cjs → duration-input-ClgYjeBa.cjs} +1 -1
- package/dist/{duration-input-DrVonjKK.js → duration-input-DGzmIImj.js} +5 -5
- package/dist/{editor-toolbar-group-CzdBZ1yr.js → editor-toolbar-group-Crlu1QJw.js} +3 -3
- package/dist/{editor-toolbar-group-DhKJdqER.cjs → editor-toolbar-group-mkL4QozO.cjs} +1 -1
- package/dist/es-B6GJLk9h.cjs +1 -0
- package/dist/{es-2llfNFX2.js → es-DwMUvBeU.js} +95 -18
- package/dist/{fa-CQVIBjKP.js → fa-0rvQiKrJ.js} +88 -11
- package/dist/fa-BwgP93iV.cjs +1 -0
- package/dist/{fr-CC3smTlW.js → fr-B4i6NzLl.js} +87 -10
- package/dist/fr-CQzk5zqY.cjs +1 -0
- package/dist/{he-CZilsN75.js → he-C71n-hsn.js} +88 -11
- package/dist/he-DcxxvRfs.cjs +1 -0
- package/dist/hi-D-KHVWg4.cjs +1 -0
- package/dist/{hi-CAZjwGv-.js → hi-xmrXpeVU.js} +88 -11
- package/dist/index-B5MAsOC-.cjs +1 -0
- package/dist/{index-B8cqD9ny.js → index-C3o9GSH6.js} +106 -105
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +8055 -5285
- package/dist/input-container-BvEcp7FU.js +275 -0
- package/dist/input-container-Di1YvVB_.cjs +1 -0
- package/dist/{it-D6RXFIL6.js → it-CDZTtOBC.js} +84 -7
- package/dist/it-D344Dutu.cjs +1 -0
- package/dist/ja-BNgnDZ27.cjs +1 -0
- package/dist/{ja-D7zsz4Ij.js → ja-Zz1LzidW.js} +92 -15
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +261 -257
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +2 -2
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +132 -133
- package/dist/{ko-taN2Npr4.js → ko-9laUsZDL.js} +91 -14
- package/dist/ko-D-WJ9NK7.cjs +1 -0
- package/dist/lexical/index.cjs.js +2 -39
- package/dist/lexical/index.es.js +2102 -20521
- package/dist/markdown/index.cjs.js +1 -1
- package/dist/markdown/index.es.js +41 -4
- package/dist/{menu-CV85y3Xf.js → menu-B8yoDMRS.js} +23 -23
- package/dist/menu-B92oSDct.cjs +1 -0
- package/dist/modal-BT0jjDqX.cjs +1 -0
- package/dist/{modal-ZitwUeXx.js → modal-DBguyX-b.js} +9 -9
- package/dist/monaco/index.cjs.js +2 -2
- package/dist/monaco/index.es.js +7 -7
- package/dist/nl-CrqUlFie.cjs +1 -0
- package/dist/{nl-CRC6r4Q4.js → nl-Dcll9fVA.js} +87 -10
- package/dist/{notice-E_p2hg1G.js → notice-E19wu9lA.js} +51 -51
- package/dist/notice-_9XhdrFw.cjs +1 -0
- package/dist/oneof-branch-detection-J_DYEEcD.js +1077 -0
- package/dist/oneof-branch-detection-ZUBZ6hqy.cjs +1 -0
- package/dist/pl-9UksIrvX.cjs +1 -0
- package/dist/{pl-C6qNs0Lq.js → pl-Dm9N9Gbr.js} +84 -7
- package/dist/prosemirror/index.cjs.js +3 -1
- package/dist/prosemirror/index.es.js +636 -4
- package/dist/{pt-CcWPLqBh.js → pt-CFi5cn0k.js} +89 -12
- package/dist/pt-_kfdzwqi.cjs +1 -0
- package/dist/{ru-Dt9-9m0E.js → ru-CEhZUw8R.js} +92 -15
- package/dist/ru-CW1WNNlr.cjs +1 -0
- package/dist/stack-BLMteGTn.js +15 -0
- package/dist/stack-dwLevGa2.cjs +1 -0
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +2 -2
- package/dist/tailwind/vite-plugin.cjs.js +1 -1
- package/dist/tailwind/vite-plugin.es.js +1 -1
- package/dist/text-input-DfqXolVe.js +55 -0
- package/dist/text-input-X_q01NsY.cjs +1 -0
- package/dist/toolbar-DY0ax2Qd.js +130 -0
- package/dist/toolbar-DoKdYXIL.cjs +1 -0
- package/dist/tr-B6GIRegf.cjs +1 -0
- package/dist/{tr-CDTWeRY0.js → tr-ZmnVDhLP.js} +83 -6
- package/dist/{translations-NBY7SubC.js → translations-A4kR7CW8.js} +1 -1
- package/dist/{translations-CiBhB2FV.js → translations-B1_yyDUK.js} +185 -106
- package/dist/{translations-BdCtLBZt.cjs → translations-C81buKAw.cjs} +1 -1
- package/dist/translations-Dbx7L7Q1.cjs +1 -0
- package/dist/types/beatui-i18n/default.d.ts +72 -0
- package/dist/types/beatui-i18n/locales/en.d.ts +72 -0
- package/dist/types/beatui-i18n/translations.d.ts +72 -0
- package/dist/types/codehighlight/code-highlight.d.ts +21 -0
- package/dist/types/codehighlight/index.d.ts +14 -0
- package/dist/types/components/button/toggle-button.d.ts +4 -4
- package/dist/types/components/data/avatar.d.ts +3 -1
- package/dist/types/components/data/badge.d.ts +10 -18
- package/dist/types/components/data/column-filter-panel.d.ts +31 -0
- package/dist/types/components/data/column-filter.d.ts +110 -0
- package/dist/types/components/data/column-header-menu.d.ts +42 -0
- package/dist/types/components/data/data-source.d.ts +190 -0
- package/dist/types/components/data/data-table-body.d.ts +12 -0
- package/dist/types/components/data/data-table-column-toggle.d.ts +4 -0
- package/dist/types/components/data/data-table-context.d.ts +53 -0
- package/dist/types/components/data/data-table-header.d.ts +6 -0
- package/dist/types/components/data/data-table-resolve.d.ts +26 -0
- package/dist/types/components/data/data-table-types.d.ts +201 -0
- package/dist/types/components/data/data-table.d.ts +38 -0
- package/dist/types/components/data/data-toolbar.d.ts +44 -0
- package/dist/types/components/data/date-picker-shared.d.ts +55 -0
- package/dist/types/components/data/date-picker.d.ts +58 -0
- package/dist/types/components/data/date-range-picker.d.ts +56 -0
- package/dist/types/components/data/filter.d.ts +268 -0
- package/dist/types/components/data/index.d.ts +13 -4
- package/dist/types/components/data/indicator.d.ts +41 -0
- package/dist/types/components/data/progress-bar.d.ts +2 -2
- package/dist/types/components/data/selection-checkbox.d.ts +63 -0
- package/dist/types/components/data/skeleton.d.ts +1 -1
- package/dist/types/components/data/sortable-header.d.ts +55 -0
- package/dist/types/components/data/unstyled-drop-zone.d.ts +2 -2
- package/dist/types/components/form/control/control.d.ts +9 -9
- package/dist/types/components/form/input/advanced-slider.d.ts +6 -6
- package/dist/types/components/form/input/appearance-selector.d.ts +9 -2
- package/dist/types/components/form/input/checkbox-input.d.ts +6 -7
- package/dist/types/components/form/input/color-input.d.ts +1 -1
- package/dist/types/components/form/input/color-swatch-input.d.ts +3 -3
- package/dist/types/components/form/input/combobox-input.d.ts +5 -5
- package/dist/types/components/form/input/combobox-tags-input.d.ts +5 -5
- package/dist/types/components/form/input/create-nullable-string-input.d.ts +2 -2
- package/dist/types/components/form/input/date-input.d.ts +4 -4
- package/dist/types/components/form/input/dropdown-input.d.ts +5 -5
- package/dist/types/components/form/input/editable-text.d.ts +2 -2
- package/dist/types/components/form/input/email-input.d.ts +4 -4
- package/dist/types/components/form/input/index.d.ts +1 -0
- package/dist/types/components/form/input/input-container.d.ts +1 -1
- package/dist/types/components/form/input/input-options.d.ts +28 -1
- package/dist/types/components/form/input/mask-input.d.ts +8 -2
- package/dist/types/components/form/input/native-select.d.ts +3 -3
- package/dist/types/components/form/input/nullable-date-input.d.ts +2 -2
- package/dist/types/components/form/input/nullable-email-input.d.ts +3 -3
- package/dist/types/components/form/input/nullable-rating-input.d.ts +8 -8
- package/dist/types/components/form/input/nullable-uuid-input.d.ts +4 -4
- package/dist/types/components/form/input/number-input.d.ts +3 -3
- package/dist/types/components/form/input/otp-input.d.ts +12 -12
- package/dist/types/components/form/input/rating-input.d.ts +7 -8
- package/dist/types/components/form/input/select-tags-input.d.ts +5 -5
- package/dist/types/components/form/input/switch.d.ts +2 -2
- package/dist/types/components/form/input/tri-state-checkbox-input.d.ts +82 -0
- package/dist/types/components/form/input/uuid-input.d.ts +2 -2
- package/dist/types/components/json-structure/controls/uuid-control.d.ts +1 -1
- package/dist/types/components/layout/card.d.ts +66 -0
- package/dist/types/components/layout/collapse.d.ts +2 -2
- package/dist/types/components/layout/flex.d.ts +26 -0
- package/dist/types/components/layout/index.d.ts +1 -0
- package/dist/types/components/lexical/floating/slash-command-palette.d.ts +2 -2
- package/dist/types/components/lexical/toolbar/toolbar-registry.d.ts +2 -1
- package/dist/types/components/media/pdf-page-viewer.d.ts +8 -5
- package/dist/types/components/misc/index.d.ts +1 -0
- package/dist/types/components/misc/loading-overlay.d.ts +29 -0
- package/dist/types/components/misc/notice.d.ts +4 -4
- package/dist/types/components/misc/notification-provider.d.ts +9 -3
- package/dist/types/components/misc/notification.d.ts +9 -9
- package/dist/types/components/navigation/breadcrumbs.d.ts +1 -1
- package/dist/types/components/navigation/menu.d.ts +6 -6
- package/dist/types/components/navigation/pagination.d.ts +17 -4
- package/dist/types/components/navigation/sidebar/sidebar-link.d.ts +2 -2
- package/dist/types/components/navigation/tabs/tabs.d.ts +17 -8
- package/dist/types/components/navigation/toolbar/toolbar.d.ts +12 -6
- package/dist/types/components/overlay/announcement-bar.d.ts +12 -4
- package/dist/types/components/overlay/dialogs.d.ts +2 -2
- package/dist/types/components/overlay/modal.d.ts +9 -2
- package/dist/types/components/overlay/tooltip.d.ts +6 -6
- package/dist/types/components/theme/types.d.ts +15 -4
- package/dist/types/lexical/index.d.ts +2 -2
- package/dist/types/lexical/plugins/index.d.ts +1 -1
- package/dist/types/lexical/plugins/slash-commands.d.ts +1 -1
- package/dist/types/lexical/plugins/text.d.ts +5 -0
- package/dist/types/lexical/types.d.ts +126 -5
- package/dist/types/lexical-i18n/default.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ar.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/de.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/en.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/es.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/fa.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/fr.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/he.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/hi.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/it.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ja.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ko.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/nl.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/pl.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/pt.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ru.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/tr.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ur.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/vi.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/zh.d.ts +1 -0
- package/dist/types/tokens/z-index.d.ts +18 -18
- package/dist/types/utils/use-animated-toggle.d.ts +12 -4
- package/dist/ur-CtFl_tz6.cjs +1 -0
- package/dist/{ur-CLrK5FPQ.js → ur-yYgj3NmT.js} +88 -11
- package/dist/use-animated-toggle-C3asw_Sg.js +207 -0
- package/dist/use-animated-toggle-cKcuItmz.cjs +1 -0
- package/dist/use-form-CaW192gw.cjs +2 -0
- package/dist/{use-form-BQRVnIp9.js → use-form-Dn6v2tEh.js} +153 -152
- package/dist/utils-DmEuG3Np.cjs +1 -0
- package/dist/utils-vUtP6iPG.js +165 -0
- package/dist/{vi-B1_QDUQJ.js → vi-D5u4CLQO.js} +89 -12
- package/dist/vi-DyCZSpsk.cjs +1 -0
- package/dist/widget-customization-DgW1SXN6.cjs +1 -0
- package/dist/{widget-customization-C-fSx3RB.js → widget-customization-Dkx7kNSe.js} +413 -398
- package/dist/{zh-rDtQ92Pp.js → zh-B0kwMMer.js} +91 -14
- package/dist/zh-C3ZxMQKb.cjs +1 -0
- package/package.json +209 -38
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -1
- package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist/ar-D2DjoXta.cjs +0 -1
- package/dist/auth-divider-C3E16pml.cjs +0 -1
- package/dist/colors-BI0YhONJ.cjs +0 -1
- package/dist/de-Cdf3432J.cjs +0 -1
- package/dist/deep-merge-Blrucd-E.cjs +0 -1
- package/dist/es-6fFPkKHL.cjs +0 -1
- package/dist/fa-GXyNzAXz.cjs +0 -1
- package/dist/fr-C6EYTwSH.cjs +0 -1
- package/dist/he-CJUgxvi8.cjs +0 -1
- package/dist/hi-DqIR4VtX.cjs +0 -1
- package/dist/hls.light.min-C6xKDzRR.cjs +0 -27
- package/dist/hls.light.min-hEMf_E8u.js +0 -8311
- package/dist/index-1JaBwDB-.js +0 -921
- package/dist/index-B-cwxUsP.cjs +0 -1
- package/dist/index-BFzxpY7y.js +0 -68
- package/dist/index-BOC0cVoY.cjs +0 -36
- package/dist/index-CN10Cyqr.cjs +0 -1
- package/dist/index-CTcbhnPw.cjs +0 -4
- package/dist/index-DF7RFzD9.cjs +0 -1
- package/dist/index-DJ9YIJcG.js +0 -14308
- package/dist/index-DfPkCwdC.js +0 -2709
- package/dist/input-container-9r1F3KuX.js +0 -263
- package/dist/input-container-DiYEl_y8.cjs +0 -1
- package/dist/it-BvHsJ7fH.cjs +0 -1
- package/dist/ja-B2gP7OHY.cjs +0 -1
- package/dist/ko-BddhddIA.cjs +0 -1
- package/dist/menu-De_-sGeb.cjs +0 -1
- package/dist/modal-DUlqGUW7.cjs +0 -1
- package/dist/nl-COrtZUnH.cjs +0 -1
- package/dist/notice-DAVOTnfA.cjs +0 -1
- package/dist/oneof-branch-detection-D6Xa8qNR.cjs +0 -8
- package/dist/oneof-branch-detection-DCPwyutI.js +0 -6290
- package/dist/pl-BHI4zBgV.cjs +0 -1
- package/dist/pt-BGzC9MhU.cjs +0 -1
- package/dist/ru-CXeFbIPb.cjs +0 -1
- package/dist/stack-4VUGISn6.cjs +0 -1
- package/dist/stack-Bm-UZosx.js +0 -879
- package/dist/string-B9vVyfq3.cjs +0 -1
- package/dist/string-DYyMxBl-.js +0 -19
- package/dist/text-input-BgPx8BbG.js +0 -45
- package/dist/text-input-DUnhBUd6.cjs +0 -1
- package/dist/timer-BJHOsuS6.cjs +0 -1
- package/dist/timer-Rd2sKnvH.js +0 -65
- package/dist/toolbar-DKOh_gbA.js +0 -118
- package/dist/toolbar-Dkc2y1dI.cjs +0 -1
- package/dist/tr-CdOtQAtA.cjs +0 -1
- package/dist/translations-Cy9hoMGV.cjs +0 -1
- package/dist/types/components/data/calendar-shared.d.ts +0 -59
- package/dist/types/components/data/calendar.d.ts +0 -107
- package/dist/types/components/data/icon-badge.d.ts +0 -14
- package/dist/types/components/data/range-calendar.d.ts +0 -104
- package/dist/types/components/data/tag.d.ts +0 -51
- package/dist/ur-C7itXvnC.cjs +0 -1
- package/dist/use-animated-toggle-C7PTmnZi.js +0 -195
- package/dist/use-animated-toggle-DrqK7nUS.cjs +0 -1
- package/dist/use-form-DTyNw0kM.cjs +0 -2
- package/dist/utils-DEbsp9Q9.js +0 -129
- package/dist/utils-DIUEhA-Z.cjs +0 -1
- package/dist/vi-CQrUWB3y.cjs +0 -1
- package/dist/widget-customization-xEBfEPhQ.cjs +0 -1
- package/dist/zh-DWswYYTS.cjs +0 -1
|
@@ -83,15 +83,15 @@ export interface MenuItemOptions {
|
|
|
83
83
|
*/
|
|
84
84
|
content: TNode;
|
|
85
85
|
/**
|
|
86
|
-
* Optional content displayed
|
|
86
|
+
* Optional content displayed before the menu item label,
|
|
87
87
|
* typically used for icons or selection indicators.
|
|
88
88
|
*/
|
|
89
|
-
|
|
89
|
+
before?: TNode;
|
|
90
90
|
/**
|
|
91
|
-
* Optional content displayed
|
|
91
|
+
* Optional content displayed after the menu item label,
|
|
92
92
|
* typically used for keyboard shortcuts or badges.
|
|
93
93
|
*/
|
|
94
|
-
|
|
94
|
+
after?: TNode;
|
|
95
95
|
/**
|
|
96
96
|
* Whether the menu item is disabled. Disabled items are skipped by keyboard
|
|
97
97
|
* navigation and cannot be activated.
|
|
@@ -177,8 +177,8 @@ export declare function Menu(options: MenuOptions): Renderable;
|
|
|
177
177
|
* MenuItem({
|
|
178
178
|
* key: 'edit',
|
|
179
179
|
* content: 'Edit',
|
|
180
|
-
*
|
|
181
|
-
*
|
|
180
|
+
* before: Icon({ icon: 'edit', size: 'sm' }),
|
|
181
|
+
* after: html.span(attr.class('shortcut'), 'Ctrl+E'),
|
|
182
182
|
* onClick: () => console.log('edit clicked'),
|
|
183
183
|
* })
|
|
184
184
|
* ```
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Value } from '@tempots/dom';
|
|
2
|
-
import { ControlSize } from '../theme';
|
|
2
|
+
import { ControlSize, PaginationVariant } from '../theme';
|
|
3
|
+
import { ThemeColorName } from '../../tokens';
|
|
3
4
|
/**
|
|
4
5
|
* Configuration options for the {@link Pagination} component.
|
|
5
6
|
*/
|
|
@@ -9,7 +10,7 @@ export interface PaginationOptions {
|
|
|
9
10
|
/** Total number of pages available. */
|
|
10
11
|
totalPages: Value<number>;
|
|
11
12
|
/** Callback invoked when a page is selected. */
|
|
12
|
-
|
|
13
|
+
onChange: (page: number) => void;
|
|
13
14
|
/** Number of page siblings to show around the current page. @default 1 */
|
|
14
15
|
siblings?: Value<number>;
|
|
15
16
|
/** Whether to show Previous/Next navigation buttons. @default true */
|
|
@@ -18,6 +19,10 @@ export interface PaginationOptions {
|
|
|
18
19
|
showFirstLast?: Value<boolean>;
|
|
19
20
|
/** Size affecting button dimensions and font size. @default 'md' */
|
|
20
21
|
size?: Value<ControlSize>;
|
|
22
|
+
/** Visual style variant for the pagination items. @default 'filled' */
|
|
23
|
+
variant?: Value<PaginationVariant>;
|
|
24
|
+
/** Theme color for the active page indicator. @default 'primary' */
|
|
25
|
+
color?: Value<ThemeColorName>;
|
|
21
26
|
/** Whether to distribute items across the full available width. @default false */
|
|
22
27
|
justify?: Value<boolean>;
|
|
23
28
|
/** Whether to dynamically adjust the number of visible page numbers to fit available space. @default false */
|
|
@@ -46,6 +51,14 @@ export interface PaginationOptions {
|
|
|
46
51
|
* ```
|
|
47
52
|
*/
|
|
48
53
|
export declare function generatePaginationRange(current: number, total: number, siblings: number): (number | 'dots')[];
|
|
54
|
+
/**
|
|
55
|
+
* Generates inline CSS custom properties for pagination theming based on variant and color.
|
|
56
|
+
*
|
|
57
|
+
* @param variant - The visual style variant
|
|
58
|
+
* @param color - The theme color
|
|
59
|
+
* @returns Semicolon-separated CSS custom property declarations
|
|
60
|
+
*/
|
|
61
|
+
export declare function generatePaginationStyles(variant: PaginationVariant, color: ThemeColorName): string;
|
|
49
62
|
/**
|
|
50
63
|
* A pagination component for navigating through multiple pages of content.
|
|
51
64
|
*
|
|
@@ -68,7 +81,7 @@ export declare function generatePaginationRange(current: number, total: number,
|
|
|
68
81
|
* Pagination({
|
|
69
82
|
* currentPage,
|
|
70
83
|
* totalPages,
|
|
71
|
-
*
|
|
84
|
+
* onChange: (page) => {
|
|
72
85
|
* currentPage.set(page)
|
|
73
86
|
* // Load page data...
|
|
74
87
|
* },
|
|
@@ -79,4 +92,4 @@ export declare function generatePaginationRange(current: number, total: number,
|
|
|
79
92
|
* })
|
|
80
93
|
* ```
|
|
81
94
|
*/
|
|
82
|
-
export declare function Pagination({ currentPage, totalPages,
|
|
95
|
+
export declare function Pagination({ currentPage, totalPages, onChange, siblings, showPrevNext, showFirstLast, size, variant, color, justify, responsive, }: PaginationOptions): import("@tempots/core").Renderable<import("@tempots/dom").DOMContext, typeof import("@tempots/dom").DOM_RENDERABLE_TYPE>;
|
|
@@ -41,8 +41,8 @@ export type SidebarLinkOptions = {
|
|
|
41
41
|
content: TNode;
|
|
42
42
|
/** Optional icon identifier displayed at the start of the link. */
|
|
43
43
|
icon?: Value<string>;
|
|
44
|
-
/** Optional content displayed
|
|
45
|
-
|
|
44
|
+
/** Optional content displayed after the link label (e.g., badges, counts). */
|
|
45
|
+
after?: TNode;
|
|
46
46
|
/**
|
|
47
47
|
* Optional inline action button rendered at the end of the link.
|
|
48
48
|
* Useful for quick actions like delete, settings, or expand/collapse toggles.
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { TNode, Value } from '@tempots/dom';
|
|
2
|
-
import { ControlSize
|
|
2
|
+
import { ControlSize } from '../../theme';
|
|
3
3
|
import { ThemeColorName } from '../../../tokens';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Visual variant for tabs.
|
|
6
|
+
*
|
|
7
|
+
* - `'default'` — Standard tabs with bottom indicator
|
|
8
|
+
* - `'filled'` — Color-filled inactive tabs, white active tab
|
|
9
|
+
* - `'outline'` — Bordered tabs that connect to the panel
|
|
10
|
+
* - `'underline'` — Minimal underline indicator
|
|
11
|
+
* - `'pill'` — Contained segmented-button style
|
|
12
|
+
*/
|
|
13
|
+
export type TabsVariant = 'default' | 'filled' | 'outline' | 'underline' | 'pill';
|
|
5
14
|
export interface TabItem<T extends string> {
|
|
6
15
|
/** Unique identifier for the tab */
|
|
7
16
|
key: T;
|
|
@@ -22,17 +31,17 @@ export interface TabsOptions<T extends string> {
|
|
|
22
31
|
value: Value<T>;
|
|
23
32
|
/** Callback when tab changes */
|
|
24
33
|
onChange?: (key: T) => void;
|
|
25
|
-
/** Size of the tabs */
|
|
34
|
+
/** Size of the tabs. @default 'md' */
|
|
26
35
|
size?: Value<ControlSize>;
|
|
27
|
-
/** Visual variant */
|
|
36
|
+
/** Visual variant. @default 'default' */
|
|
28
37
|
variant?: Value<TabsVariant>;
|
|
29
|
-
/** Color used by certain variants (e.g., filled) */
|
|
38
|
+
/** Color used by certain variants (e.g., filled). @default 'primary' */
|
|
30
39
|
color?: Value<ThemeColorName>;
|
|
31
|
-
/** Whether tabs are disabled */
|
|
40
|
+
/** Whether tabs are disabled. @default false */
|
|
32
41
|
disabled?: Value<boolean>;
|
|
33
|
-
/** Orientation of the tabs */
|
|
42
|
+
/** Orientation of the tabs. @default 'horizontal' */
|
|
34
43
|
orientation?: Value<TabsDirection>;
|
|
35
|
-
/** Whether to show tab content */
|
|
44
|
+
/** Whether to show tab content. @default true */
|
|
36
45
|
showContent?: Value<boolean>;
|
|
37
46
|
/** ARIA label for the tab list */
|
|
38
47
|
ariaLabel?: Value<string>;
|
|
@@ -26,12 +26,15 @@ export interface ToolbarOptions {
|
|
|
26
26
|
* @example
|
|
27
27
|
* ```typescript
|
|
28
28
|
* Toolbar(
|
|
29
|
+
* { ariaLabel: 'Text formatting' },
|
|
29
30
|
* ToolbarGroup(
|
|
31
|
+
* {},
|
|
30
32
|
* ToolbarButton({ onClick: () => bold() }, Icon({ icon: 'bold' })),
|
|
31
33
|
* ToolbarButton({ onClick: () => italic() }, Icon({ icon: 'italic' })),
|
|
32
34
|
* ),
|
|
33
35
|
* ToolbarDivider(),
|
|
34
36
|
* ToolbarGroup(
|
|
37
|
+
* {},
|
|
35
38
|
* ToolbarButton({ onClick: () => alignLeft() }, Icon({ icon: 'align-left' })),
|
|
36
39
|
* ToolbarButton({ onClick: () => alignCenter() }, Icon({ icon: 'align-center' })),
|
|
37
40
|
* ),
|
|
@@ -40,7 +43,7 @@ export interface ToolbarOptions {
|
|
|
40
43
|
* )
|
|
41
44
|
* ```
|
|
42
45
|
*/
|
|
43
|
-
export declare function Toolbar(...children: TNode[]): import("@tempots/dom").Renderable;
|
|
46
|
+
export declare function Toolbar(options: ToolbarOptions, ...children: TNode[]): import("@tempots/dom").Renderable;
|
|
44
47
|
/**
|
|
45
48
|
* Configuration options for the {@link ToolbarButton} component.
|
|
46
49
|
* Extends {@link ButtonOptions} with toolbar-specific properties.
|
|
@@ -75,7 +78,7 @@ export interface ToolbarButtonOptions extends ButtonOptions {
|
|
|
75
78
|
* )
|
|
76
79
|
* ```
|
|
77
80
|
*/
|
|
78
|
-
export declare function ToolbarButton(options:
|
|
81
|
+
export declare function ToolbarButton(options: ToolbarButtonOptions, ...children: TNode[]): import("@tempots/core").Renderable<import("@tempots/dom").DOMContext, typeof import("@tempots/dom").DOM_RENDERABLE_TYPE>;
|
|
79
82
|
/**
|
|
80
83
|
* Configuration options for the {@link ToolbarGroup} component.
|
|
81
84
|
*/
|
|
@@ -98,13 +101,14 @@ export interface ToolbarGroupOptions {
|
|
|
98
101
|
* @example
|
|
99
102
|
* ```typescript
|
|
100
103
|
* ToolbarGroup(
|
|
104
|
+
* { ariaLabel: 'Text style' },
|
|
101
105
|
* ToolbarButton({ onClick: () => bold() }, Icon({ icon: 'bold' })),
|
|
102
106
|
* ToolbarButton({ onClick: () => italic() }, Icon({ icon: 'italic' })),
|
|
103
107
|
* ToolbarButton({ onClick: () => underline() }, Icon({ icon: 'underline' })),
|
|
104
108
|
* )
|
|
105
109
|
* ```
|
|
106
110
|
*/
|
|
107
|
-
export declare function ToolbarGroup(...children: TNode[]): import("@tempots/dom").Renderable;
|
|
111
|
+
export declare function ToolbarGroup(options: ToolbarGroupOptions, ...children: TNode[]): import("@tempots/dom").Renderable;
|
|
108
112
|
/**
|
|
109
113
|
* Visual divider for separating groups of items within a {@link Toolbar}.
|
|
110
114
|
*
|
|
@@ -115,9 +119,10 @@ export declare function ToolbarGroup(...children: TNode[]): import("@tempots/dom
|
|
|
115
119
|
* @example
|
|
116
120
|
* ```typescript
|
|
117
121
|
* Toolbar(
|
|
118
|
-
*
|
|
122
|
+
* {},
|
|
123
|
+
* ToolbarGroup({}, boldBtn, italicBtn),
|
|
119
124
|
* ToolbarDivider(),
|
|
120
|
-
* ToolbarGroup(alignLeftBtn, alignCenterBtn),
|
|
125
|
+
* ToolbarGroup({}, alignLeftBtn, alignCenterBtn),
|
|
121
126
|
* )
|
|
122
127
|
* ```
|
|
123
128
|
*/
|
|
@@ -133,7 +138,8 @@ export declare function ToolbarDivider(): import("@tempots/dom").Renderable;
|
|
|
133
138
|
* @example
|
|
134
139
|
* ```typescript
|
|
135
140
|
* Toolbar(
|
|
136
|
-
*
|
|
141
|
+
* {},
|
|
142
|
+
* ToolbarGroup({}, editBtns),
|
|
137
143
|
* ToolbarSpacer(),
|
|
138
144
|
* ToolbarButton({ onClick: save }, 'Save'),
|
|
139
145
|
* )
|
|
@@ -23,17 +23,25 @@ export type AnnouncementBarOptions = {
|
|
|
23
23
|
* Callback invoked when the user dismisses the announcement bar.
|
|
24
24
|
* When provided and `closable` is not explicitly set, the bar is implicitly made dismissible.
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
onClose?: () => void;
|
|
27
27
|
/**
|
|
28
28
|
* Additional CSS class names to apply to the announcement bar element.
|
|
29
29
|
*/
|
|
30
30
|
class?: Value<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Controls where the announcement bar is rendered in the DOM.
|
|
33
|
+
* - `true` (default) - Portals to the document body, fixed at the top of the viewport.
|
|
34
|
+
* - `false` - Renders inline as a child of the current parent element.
|
|
35
|
+
* - A CSS selector string - Portals to the element matching the selector.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
portal?: boolean | string;
|
|
31
39
|
};
|
|
32
40
|
/**
|
|
33
41
|
* Displays a colored announcement bar, typically at the top of a page or container.
|
|
34
42
|
*
|
|
35
43
|
* Supports an optional leading icon, user-dismissible close button, and theme color
|
|
36
|
-
* customization. When dismissed, the bar is removed from the DOM and the `
|
|
44
|
+
* customization. When dismissed, the bar is removed from the DOM and the `onClose`
|
|
37
45
|
* callback is invoked.
|
|
38
46
|
*
|
|
39
47
|
* @param options - Configuration options controlling color, icon, closability, and styling
|
|
@@ -43,7 +51,7 @@ export type AnnouncementBarOptions = {
|
|
|
43
51
|
* @example
|
|
44
52
|
* ```typescript
|
|
45
53
|
* AnnouncementBar(
|
|
46
|
-
* { color: 'warning', closable: true,
|
|
54
|
+
* { color: 'warning', closable: true, onClose: () => console.log('dismissed') },
|
|
47
55
|
* "You're on our launch Free plan with unlimited resumes and redaction!"
|
|
48
56
|
* )
|
|
49
57
|
* ```
|
|
@@ -57,4 +65,4 @@ export type AnnouncementBarOptions = {
|
|
|
57
65
|
* )
|
|
58
66
|
* ```
|
|
59
67
|
*/
|
|
60
|
-
export declare function AnnouncementBar({ color, icon, closable,
|
|
68
|
+
export declare function AnnouncementBar({ color, icon, closable, onClose, class: cls, portal: portalTarget, }: AnnouncementBarOptions, ...children: TNode[]): Renderable;
|
|
@@ -82,7 +82,7 @@ export declare function ConfirmationDialog(options: ConfirmationDialogOptions, f
|
|
|
82
82
|
/**
|
|
83
83
|
* Visual variant for the {@link AlertDialog}, controlling the default icon and color.
|
|
84
84
|
*/
|
|
85
|
-
export type AlertDialogVariant = 'info' | 'success' | 'warning' | '
|
|
85
|
+
export type AlertDialogVariant = 'info' | 'success' | 'warning' | 'danger';
|
|
86
86
|
/**
|
|
87
87
|
* Configuration options for the {@link AlertDialog} component.
|
|
88
88
|
*/
|
|
@@ -122,7 +122,7 @@ export interface AlertDialogOptions {
|
|
|
122
122
|
/**
|
|
123
123
|
* An alert dialog for displaying important messages to the user.
|
|
124
124
|
*
|
|
125
|
-
* Supports info, success, warning, and
|
|
125
|
+
* Supports info, success, warning, and danger variants with appropriate icons and colors.
|
|
126
126
|
* Has a single acknowledge button. Built on top of {@link Modal}.
|
|
127
127
|
*
|
|
128
128
|
* @param options - Configuration options for the alert content
|
|
@@ -128,7 +128,13 @@ export declare function Modal(options: ModalOptions, fn: (open: (content: ModalC
|
|
|
128
128
|
* )
|
|
129
129
|
* ```
|
|
130
130
|
*/
|
|
131
|
-
|
|
131
|
+
/**
|
|
132
|
+
* Configuration options for the {@link ConfirmModal} component.
|
|
133
|
+
*
|
|
134
|
+
* Extends {@link ModalOptions} with confirmation-specific settings for
|
|
135
|
+
* custom button labels and confirm/cancel callbacks.
|
|
136
|
+
*/
|
|
137
|
+
export interface ConfirmModalOptions extends ModalOptions {
|
|
132
138
|
/** Custom label for the confirm button. Falls back to the i18n `confirm` string. */
|
|
133
139
|
confirmText?: Value<string>;
|
|
134
140
|
/** Custom label for the cancel button. Falls back to the i18n `cancel` string. */
|
|
@@ -137,4 +143,5 @@ export declare function ConfirmModal(options: ModalOptions & {
|
|
|
137
143
|
onConfirm?: () => void;
|
|
138
144
|
/** Callback invoked when the user clicks the cancel button. */
|
|
139
145
|
onCancel?: () => void;
|
|
140
|
-
}
|
|
146
|
+
}
|
|
147
|
+
export declare function ConfirmModal(options: ConfirmModalOptions, fn: (open: (message: TNode) => void, close: () => void) => TNode): Renderable;
|
|
@@ -5,17 +5,17 @@ export type TooltipTrigger = FlyoutTrigger;
|
|
|
5
5
|
export interface TooltipOptions {
|
|
6
6
|
/** The tooltip content to display */
|
|
7
7
|
content: TNode;
|
|
8
|
-
/** Placement of the tooltip relative to the trigger element */
|
|
8
|
+
/** Placement of the tooltip relative to the trigger element. @default 'top' */
|
|
9
9
|
placement?: Value<Placement>;
|
|
10
|
-
/** Delay in milliseconds before showing the tooltip on hover */
|
|
10
|
+
/** Delay in milliseconds before showing the tooltip on hover. @default 250 */
|
|
11
11
|
showDelay?: Value<number>;
|
|
12
|
-
/** Delay in milliseconds before hiding the tooltip after mouse leave */
|
|
12
|
+
/** Delay in milliseconds before hiding the tooltip after mouse leave. @default 500 */
|
|
13
13
|
hideDelay?: Value<number>;
|
|
14
|
-
/** Offset in pixels from the main axis (vertical for top/bottom, horizontal for left/right) */
|
|
14
|
+
/** Offset in pixels from the main axis (vertical for top/bottom, horizontal for left/right). @default 8 */
|
|
15
15
|
mainAxisOffset?: Value<number>;
|
|
16
|
-
/** Offset in pixels from the cross axis (horizontal for top/bottom, vertical for left/right) */
|
|
16
|
+
/** Offset in pixels from the cross axis (horizontal for top/bottom, vertical for left/right). @default 0 */
|
|
17
17
|
crossAxisOffset?: Value<number>;
|
|
18
|
-
/** How to show the tooltip */
|
|
18
|
+
/** How to show the tooltip. @default 'hover-focus' */
|
|
19
19
|
showOn?: Value<TooltipTrigger>;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
@@ -4,12 +4,14 @@ import { AppearanceType } from '@tempots/ui';
|
|
|
4
4
|
/**
|
|
5
5
|
* Visual style variant for button components.
|
|
6
6
|
* - `'filled'`: Solid background with theme color
|
|
7
|
-
* - `'light'`:
|
|
7
|
+
* - `'light'`: Color-tinted background with normal text
|
|
8
8
|
* - `'outline'`: Transparent background with colored border
|
|
9
|
-
* - `'
|
|
10
|
-
* - `'
|
|
9
|
+
* - `'dashed'`: Transparent background with colored dashed border
|
|
10
|
+
* - `'default'`: Neutral background with subtle border and colored text
|
|
11
|
+
* - `'subtle'`: Transparent background with colored text, tinted background on hover
|
|
12
|
+
* - `'text'`: No background, text-only with underline on hover
|
|
11
13
|
*/
|
|
12
|
-
export type ButtonVariant = 'filled' | 'light' | 'outline' | 'dashed' | 'default' | 'text';
|
|
14
|
+
export type ButtonVariant = 'filled' | 'light' | 'outline' | 'dashed' | 'default' | 'subtle' | 'text';
|
|
13
15
|
/**
|
|
14
16
|
* Size options for form controls and interactive elements.
|
|
15
17
|
* Ranges from `'xs'` (extra small) to `'xl'` (extra large).
|
|
@@ -123,6 +125,15 @@ export type AlignSelf = 'auto' | 'flex-start' | 'flex-end' | 'safe flex-end' | '
|
|
|
123
125
|
* - `'outlined'`: Card with border outline
|
|
124
126
|
*/
|
|
125
127
|
export type CardVariant = 'default' | 'elevated' | 'flat' | 'outlined';
|
|
128
|
+
/**
|
|
129
|
+
* Visual style variant for pagination components.
|
|
130
|
+
* - `'filled'`: Solid primary background on active page
|
|
131
|
+
* - `'outline'`: Primary border on active page, no fill
|
|
132
|
+
* - `'light'`: Light color-tinted background on active page
|
|
133
|
+
* - `'subtle'`: Text-only with bold weight and underline on active page
|
|
134
|
+
* - `'pill'`: Fully rounded pill-shaped items with solid active fill
|
|
135
|
+
*/
|
|
136
|
+
export type PaginationVariant = 'filled' | 'outline' | 'light' | 'subtle' | 'pill';
|
|
126
137
|
/**
|
|
127
138
|
* Gap spacing size for centered layouts.
|
|
128
139
|
* Ranges from `'none'` (no gap) to `'xl'` (extra large gap).
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* pre-configured presets (Bare, Docked, Contextual), full plugin coverage,
|
|
7
7
|
* multi-format I/O, form integration, and theme/i18n support.
|
|
8
8
|
*/
|
|
9
|
-
export type { ContentFormatType, JsonContent, LexicalPluginDefinition, PluginConfig, HistoryPluginOptions, TablePluginOptions, AutoLinkPluginOptions, AutoLinkMatcher, CodePluginOptions, HashtagPluginOptions, OverflowPluginOptions, SlashCommandPluginOptions, SlashCommandDefinition, ToolbarGroupId, ToolbarButtonId, ToolbarConfig, ToolbarLayoutGroup, ToolbarLayoutSeparator, ToolbarLayoutEntry, MarkMetadata, MarkPluginCallbacks, CollaborationConfig, CollaborationUser, LexicalEditorBaseOptions, BareEditorOptions, DockedEditorOptions, ContextualEditorOptions, LexicalStringInputOptions, LexicalJsonInputOptions, LexicalInputOptions, HeadlessEditorOptions, CharacterCountInfo, SelectionInfo, EditorPresetType, EditorHeightMode, } from './types';
|
|
9
|
+
export type { ContentFormatType, JsonContent, LexicalPluginDefinition, PluginConfig, HistoryPluginOptions, TablePluginOptions, AutoLinkPluginOptions, AutoLinkMatcher, CodePluginOptions, HashtagPluginOptions, OverflowPluginOptions, SlashCommandPluginOptions, SlashCommandDefinition, ToolbarGroupId, ToolbarButtonId, ToolbarConfig, ToolbarLayoutGroup, ToolbarLayoutSeparator, ToolbarLayoutCustomGroup, ToolbarLayoutEntry, MarkMetadata, MarkPluginCallbacks, CollaborationConfig, CollaborationUser, LexicalEditorBaseOptions, BareEditorOptions, DockedEditorOptions, ContextualEditorOptions, LexicalStringInputOptions, LexicalJsonInputOptions, LexicalInputOptions, HeadlessEditorOptions, CharacterCountInfo, SelectionInfo, EditorPresetType, EditorHeightMode, ToolbarItemContext, ToolbarButtonItem, ToolbarSelectOption, ToolbarSelectItem, ToolbarCustomItem, CustomToolbarItem, CustomToolbarGroup, } from './types';
|
|
10
10
|
export { TOOLBAR_SEPARATOR } from './types';
|
|
11
11
|
export { getNodesForPlugins, createDefaultPluginConfig } from './nodes';
|
|
12
12
|
export { HorizontalRuleNode, $createHorizontalRuleNode, $isHorizontalRuleNode, } from './horizontal-rule-node';
|
|
13
13
|
export type { SerializedHorizontalRuleNode } from './horizontal-rule-node';
|
|
14
14
|
export { loadLexicalCore } from './lazy-loader';
|
|
15
|
-
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, buildInlineStyleImportMap, buildStyleImportMap, DEFAULT_INLINE_STYLE_PROPERTIES, } from './plugins';
|
|
15
|
+
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, insertTextAtCursor, loadOffsetUtils, registerHorizontalRulePlugin, HR_TRANSFORMER, buildInlineStyleImportMap, buildStyleImportMap, DEFAULT_INLINE_STYLE_PROPERTIES, } from './plugins';
|
|
16
16
|
export type { SlashCommandState, SlashCommandCallbacks } from './plugins';
|
|
17
17
|
export { createHeadlessEditor, markdownToLexicalJson, lexicalJsonToMarkdown, htmlToLexicalJson, lexicalJsonToHtml, } from './headless';
|
|
18
18
|
export { createCommand, ElementNode, DecoratorNode, TextNode, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_CRITICAL, } from 'lexical';
|
|
@@ -19,7 +19,7 @@ export { registerOverflowPlugin } from './overflow';
|
|
|
19
19
|
export { registerDragonPlugin } from './dragon';
|
|
20
20
|
export { registerYjsPlugin } from './yjs';
|
|
21
21
|
export { getSelectionInfo } from './selection';
|
|
22
|
-
export { getTextContent, getCharacterCount, getWordCount } from './text';
|
|
22
|
+
export { getTextContent, getCharacterCount, getWordCount, insertTextAtCursor, } from './text';
|
|
23
23
|
export { loadOffsetUtils } from './offset';
|
|
24
24
|
export { registerHorizontalRulePlugin, HR_TRANSFORMER } from './horizontal-rule';
|
|
25
25
|
export { registerElementStylePlugin, buildElementStyleExportMap, buildElementStyleImportMap, buildInlineStyleImportMap, buildStyleImportMap, DEFAULT_INLINE_STYLE_PROPERTIES, mergeElementStyle, getElementStyleProperty, } from './element-style';
|
|
@@ -10,7 +10,7 @@ export interface SlashCommandState {
|
|
|
10
10
|
export interface SlashCommandCallbacks {
|
|
11
11
|
onTrigger?: (state: SlashCommandState, removeText: () => void) => void;
|
|
12
12
|
onUpdate?: (state: SlashCommandState, removeText: () => void) => void;
|
|
13
|
-
|
|
13
|
+
onClose?: () => void;
|
|
14
14
|
onExecute?: (commandId: string, removeText: () => void) => void;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
@@ -11,3 +11,8 @@ export declare function getCharacterCount(editor: LexicalEditor): number;
|
|
|
11
11
|
* Get the word count of the editor content.
|
|
12
12
|
*/
|
|
13
13
|
export declare function getWordCount(editor: LexicalEditor): number;
|
|
14
|
+
/**
|
|
15
|
+
* Insert text at the current cursor position, replacing any selected text.
|
|
16
|
+
* Designed for use as a snippet `onSelect` callback helper.
|
|
17
|
+
*/
|
|
18
|
+
export declare function insertTextAtCursor(editor: LexicalEditor, text: string): void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { Renderable, TNode, Value } from '@tempots/dom';
|
|
1
|
+
import type { Renderable, Signal, TNode, Value } from '@tempots/dom';
|
|
2
2
|
import type { Merge } from '@tempots/std';
|
|
3
3
|
import type { LexicalEditor, LexicalNode, Klass } from 'lexical';
|
|
4
4
|
import type { InputOptions } from '../components/form/input/input-options';
|
|
5
|
+
import type { ControlSize } from '../components/theme';
|
|
5
6
|
/**
|
|
6
7
|
* Content format types supported by the editor
|
|
7
8
|
*/
|
|
@@ -282,7 +283,99 @@ export type ToolbarGroupId = 'text-formatting' | 'headings' | 'lists' | 'indent'
|
|
|
282
283
|
* Stable identifiers for individual toolbar buttons/controls.
|
|
283
284
|
* Each ID corresponds to a single button or widget within a toolbar group.
|
|
284
285
|
*/
|
|
285
|
-
export type ToolbarButtonId = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'clear-formatting' | 'paragraph' | 'heading-1' | 'heading-2' | 'heading-3' | 'heading-4' | 'heading-5' | 'heading-6' | 'bullet-list' | 'ordered-list' | 'check-list' | 'indent' | 'outdent' | 'blockquote' | 'code-block' | 'horizontal-rule' | 'insert-table' | 'link' | 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'font-family' | 'font-size' | 'font-color' | 'highlight-color' | 'background-color';
|
|
286
|
+
export type ToolbarButtonId = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'clear-formatting' | 'paragraph' | 'heading-1' | 'heading-2' | 'heading-3' | 'heading-4' | 'heading-5' | 'heading-6' | 'bullet-list' | 'ordered-list' | 'check-list' | 'indent' | 'outdent' | 'blockquote' | 'code-block' | 'horizontal-rule' | 'insert-table' | 'link' | 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'font-family' | 'font-size' | 'line-height' | 'font-color' | 'highlight-color' | 'background-color';
|
|
287
|
+
/**
|
|
288
|
+
* Context passed to custom toolbar items, providing access to editor state,
|
|
289
|
+
* reactive signals, and the built-in button factory.
|
|
290
|
+
*/
|
|
291
|
+
export interface ToolbarItemContext {
|
|
292
|
+
/** Editor signal (guaranteed non-null inside the toolbar) */
|
|
293
|
+
editor: Signal<LexicalEditor>;
|
|
294
|
+
/** Incremented on every editor state update — use in `.map()` for reactive queries */
|
|
295
|
+
stateUpdate: Signal<number>;
|
|
296
|
+
/** Whether the editor is read-only */
|
|
297
|
+
readOnly: Signal<boolean>;
|
|
298
|
+
/** Control size */
|
|
299
|
+
size: Value<ControlSize>;
|
|
300
|
+
/** Create a toolbar button matching built-in styling */
|
|
301
|
+
button: (opts: {
|
|
302
|
+
active?: Signal<boolean>;
|
|
303
|
+
onClick: () => void;
|
|
304
|
+
label: Value<string>;
|
|
305
|
+
icon: string;
|
|
306
|
+
}) => TNode;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* A custom icon button toolbar item, rendered identically to built-in buttons.
|
|
310
|
+
*/
|
|
311
|
+
export interface ToolbarButtonItem {
|
|
312
|
+
type: 'button';
|
|
313
|
+
/** Unique id (must not collide with built-in ToolbarButtonId values) */
|
|
314
|
+
id: string;
|
|
315
|
+
/** Accessible tooltip label */
|
|
316
|
+
label: string;
|
|
317
|
+
/** Iconify icon identifier (e.g. 'mdi:variable') */
|
|
318
|
+
icon: string;
|
|
319
|
+
/** Called when the button is clicked */
|
|
320
|
+
onClick: (editor: LexicalEditor) => void;
|
|
321
|
+
/** Optional reactive active state. Return a signal that tracks whether this button is "on". */
|
|
322
|
+
active?: (ctx: ToolbarItemContext) => Signal<boolean>;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* A single option in a select dropdown toolbar item.
|
|
326
|
+
*/
|
|
327
|
+
export interface ToolbarSelectOption {
|
|
328
|
+
/** Value passed to onSelect when this option is chosen */
|
|
329
|
+
value: string;
|
|
330
|
+
/** Display label in the dropdown */
|
|
331
|
+
label: string;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* A select dropdown toolbar item: renders a `<select>` and calls
|
|
335
|
+
* `onSelect(value, editor)` when the user picks an option.
|
|
336
|
+
*/
|
|
337
|
+
export interface ToolbarSelectItem {
|
|
338
|
+
type: 'select';
|
|
339
|
+
/** Unique id (must not collide with built-in ToolbarButtonId values) */
|
|
340
|
+
id: string;
|
|
341
|
+
/** Accessible tooltip / placeholder label */
|
|
342
|
+
label: string;
|
|
343
|
+
/** Dropdown options */
|
|
344
|
+
options: ToolbarSelectOption[];
|
|
345
|
+
/** Called when the user picks an option */
|
|
346
|
+
onSelect: (value: string, editor: LexicalEditor) => void;
|
|
347
|
+
/**
|
|
348
|
+
* Reset the dropdown to its placeholder after each selection.
|
|
349
|
+
* Use `true` for action menus (e.g. "Insert snippet"), `false` for
|
|
350
|
+
* stateful selections where the current value should remain visible.
|
|
351
|
+
* @default true
|
|
352
|
+
*/
|
|
353
|
+
resetOnSelect?: boolean;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* A fully custom toolbar item where the user supplies a render function
|
|
357
|
+
* that receives the full toolbar context.
|
|
358
|
+
*/
|
|
359
|
+
export interface ToolbarCustomItem {
|
|
360
|
+
type: 'custom';
|
|
361
|
+
/** Unique id (must not collide with built-in ToolbarButtonId values) */
|
|
362
|
+
id: string;
|
|
363
|
+
/** Render function. Receives the full toolbar context. */
|
|
364
|
+
render: (ctx: ToolbarItemContext) => TNode;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Union of all custom toolbar item types.
|
|
368
|
+
*/
|
|
369
|
+
export type CustomToolbarItem = ToolbarButtonItem | ToolbarSelectItem | ToolbarCustomItem;
|
|
370
|
+
/**
|
|
371
|
+
* A custom group definition containing one or more custom items.
|
|
372
|
+
*/
|
|
373
|
+
export interface CustomToolbarGroup {
|
|
374
|
+
/** Unique group id (must not collide with built-in ToolbarGroupId values) */
|
|
375
|
+
id: string;
|
|
376
|
+
/** Custom toolbar items in this group */
|
|
377
|
+
items: CustomToolbarItem[];
|
|
378
|
+
}
|
|
286
379
|
/**
|
|
287
380
|
* A group entry in the toolbar layout.
|
|
288
381
|
* Specifies which group to render, optionally restricting to specific buttons.
|
|
@@ -292,9 +385,10 @@ export interface ToolbarLayoutGroup {
|
|
|
292
385
|
group: ToolbarGroupId;
|
|
293
386
|
/**
|
|
294
387
|
* Optional subset of buttons/controls to include within this group.
|
|
388
|
+
* Accepts built-in `ToolbarButtonId` values and custom item IDs (strings).
|
|
295
389
|
* When omitted, all buttons in the group are shown (respecting maxHeadingLevel).
|
|
296
390
|
*/
|
|
297
|
-
items?: ToolbarButtonId[];
|
|
391
|
+
items?: (ToolbarButtonId | string)[];
|
|
298
392
|
}
|
|
299
393
|
/**
|
|
300
394
|
* A visual separator between toolbar groups.
|
|
@@ -302,11 +396,18 @@ export interface ToolbarLayoutGroup {
|
|
|
302
396
|
export interface ToolbarLayoutSeparator {
|
|
303
397
|
separator: true;
|
|
304
398
|
}
|
|
399
|
+
/**
|
|
400
|
+
* A layout entry referencing a custom group by its id.
|
|
401
|
+
*/
|
|
402
|
+
export interface ToolbarLayoutCustomGroup {
|
|
403
|
+
/** References a CustomToolbarGroup.id from ToolbarConfig.customGroups */
|
|
404
|
+
customGroup: string;
|
|
405
|
+
}
|
|
305
406
|
/**
|
|
306
407
|
* A single entry in the toolbar layout.
|
|
307
|
-
* Either a group
|
|
408
|
+
* Either a built-in group, a custom group, or a visual separator.
|
|
308
409
|
*/
|
|
309
|
-
export type ToolbarLayoutEntry = ToolbarLayoutGroup | ToolbarLayoutSeparator;
|
|
410
|
+
export type ToolbarLayoutEntry = ToolbarLayoutGroup | ToolbarLayoutCustomGroup | ToolbarLayoutSeparator;
|
|
310
411
|
/**
|
|
311
412
|
* Convenience constant for inserting a separator in a toolbar layout.
|
|
312
413
|
*/
|
|
@@ -347,12 +448,32 @@ export interface ToolbarConfig {
|
|
|
347
448
|
* A `{ value: '', label: 'Default' }` entry is always prepended automatically.
|
|
348
449
|
*/
|
|
349
450
|
fontSizes?: FontOption[];
|
|
451
|
+
/**
|
|
452
|
+
* Custom line-height options for the line-height dropdown.
|
|
453
|
+
* Each entry has a unitless CSS `value` (e.g. '1.5') and a display `label`.
|
|
454
|
+
* A `{ value: '', label: 'Default' }` entry is always prepended automatically.
|
|
455
|
+
*/
|
|
456
|
+
lineHeights?: FontOption[];
|
|
350
457
|
/**
|
|
351
458
|
* Declarative toolbar layout. When provided, takes full control over
|
|
352
459
|
* which groups/buttons appear and in what order.
|
|
353
460
|
* `visibleGroups` and `hiddenGroups` are ignored when `layout` is set.
|
|
461
|
+
* Use `{ customGroup: '<id>' }` entries to place custom groups.
|
|
354
462
|
*/
|
|
355
463
|
layout?: ToolbarLayoutEntry[];
|
|
464
|
+
/**
|
|
465
|
+
* Standalone custom toolbar items, registered by their `id`.
|
|
466
|
+
* Place them in built-in groups via `layout[].items` arrays.
|
|
467
|
+
*/
|
|
468
|
+
customItems?: CustomToolbarItem[];
|
|
469
|
+
/**
|
|
470
|
+
* Custom toolbar groups with user-defined buttons/dropdowns.
|
|
471
|
+
* When `layout` is not specified, custom groups are appended
|
|
472
|
+
* at the end of the default toolbar layout.
|
|
473
|
+
* When `layout` is specified, use `{ customGroup: '<id>' }` entries
|
|
474
|
+
* to place them.
|
|
475
|
+
*/
|
|
476
|
+
customGroups?: CustomToolbarGroup[];
|
|
356
477
|
}
|
|
357
478
|
/**
|
|
358
479
|
* Mark/annotation metadata
|