caplink-saas-ui-shared-component-library 1.72.0 → 1.74.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/components/rich-text/character-counter.d.ts +8 -0
- package/dist/components/rich-text/classNames.d.ts +10 -0
- package/dist/components/rich-text/extensions.d.ts +1 -8
- package/dist/components/rich-text/index.d.ts +5 -1
- package/dist/components/rich-text/lib/is-rich-text-empty.d.ts +1 -1
- package/dist/components/rich-text/model/index.d.ts +2 -0
- package/dist/components/rich-text/model/use-editor.d.ts +15 -0
- package/dist/components/rich-text/rich-text-menu.d.ts +6 -1
- package/dist/components/rich-text/rich-text.d.ts +7 -4
- package/dist/components/rich-text/rich-text.primitives.d.ts +9 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.es.js +24608 -22595
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +199 -151
- package/dist/index.umd.js.map +1 -1
- package/dist/package.json +10 -9
- package/package.json +10 -9
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type CharacterCounterProps = {
|
|
2
|
+
currentCount: string;
|
|
3
|
+
maxCount: string;
|
|
4
|
+
editable: boolean;
|
|
5
|
+
isExceeded?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function CharacterCounter({ currentCount, maxCount, editable, isExceeded }: CharacterCounterProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const TEXT_BASE_CLASS = "sl-text-md sl-text-foreground-v2-700";
|
|
2
|
+
export declare const TEXT_BOLD_CLASS: string;
|
|
3
|
+
export declare const TEXT_ITALIC_CLASS: string;
|
|
4
|
+
export declare const TEXT_UNDERLINE_CLASS = "sl-text-underline";
|
|
5
|
+
export declare const LINK_CLASS: string;
|
|
6
|
+
export declare const HEADING_BASE_CLASS: string;
|
|
7
|
+
export declare const HEADING_1_CLASS: string;
|
|
8
|
+
export declare const HEADING_2_CLASS: string;
|
|
9
|
+
export declare const HEADING_3_CLASS: string;
|
|
10
|
+
export declare const HEADING_4_CLASS: string;
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Should be used to prevent showing rich text editor with empty P Tags
|
|
5
|
-
* @example content === <p class="..."></p> ? null : <RichTextEditor />
|
|
6
|
-
*/
|
|
7
|
-
export declare const P_TAG_CLASS_NAME = "sl-text-md sl-text-foreground-v2-700";
|
|
8
|
-
export declare const extensions: (import('@tiptap/react').Extension<import('@tiptap/starter-kit').StarterKitOptions, any> | import('@tiptap/react').Node<import('@tiptap/extension-heading').HeadingOptions, any> | import('@tiptap/react').Mark<import('@tiptap/extension-underline').UnderlineOptions, any>)[];
|
|
1
|
+
export declare const extensions: (import('@tiptap/core').Extension<import('@tiptap/starter-kit').StarterKitOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-heading').HeadingOptions, any>)[];
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export { RichText, type RichTextEditorProps, type RichTextViewerProps, type ActiveMenuButtons, } from './rich-text';
|
|
1
|
+
export { RichText, type RichTextEditorProps, type RichTextViewerProps, type ActiveMenuButtons, type VariableOption, TEXT_BASE_CLASS, P_TAG_CLASS_NAME, } from './rich-text';
|
|
2
|
+
export { TEXT_BOLD_CLASS, TEXT_ITALIC_CLASS, TEXT_UNDERLINE_CLASS, LINK_CLASS, HEADING_BASE_CLASS, HEADING_1_CLASS, HEADING_2_CLASS, HEADING_3_CLASS, HEADING_4_CLASS, } from './classNames';
|
|
3
|
+
export { useRichTextEditor } from './model';
|
|
4
|
+
export type { UseEditorProps } from './model';
|
|
5
|
+
export { isRichTextEmpty } from './lib/is-rich-text-empty';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function isRichTextEmpty(
|
|
1
|
+
export declare function isRichTextEmpty(content: string): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Editor, Content, JSONContent } from '@tiptap/react';
|
|
2
|
+
export type UseEditorProps = {
|
|
3
|
+
maxLength?: number;
|
|
4
|
+
content?: Content;
|
|
5
|
+
editable?: boolean;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
onChange?: (value: {
|
|
8
|
+
text: string;
|
|
9
|
+
html: string;
|
|
10
|
+
json: JSONContent;
|
|
11
|
+
}) => void;
|
|
12
|
+
allowExceedMaxLength?: boolean;
|
|
13
|
+
immediatelyRender?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare function useRichTextEditor({ maxLength, content, editable, placeholder, onChange, allowExceedMaxLength, immediatelyRender, }: UseEditorProps): Editor | null;
|
|
@@ -16,13 +16,18 @@ export type ActiveMenuButtons = {
|
|
|
16
16
|
unlink?: boolean;
|
|
17
17
|
undo?: boolean;
|
|
18
18
|
redo?: boolean;
|
|
19
|
+
variables?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type VariableOption = {
|
|
22
|
+
label: string;
|
|
23
|
+
value: string;
|
|
19
24
|
};
|
|
20
25
|
type RichTextEditorMenuProps = {
|
|
21
26
|
className?: string;
|
|
22
27
|
editor: Editor;
|
|
23
28
|
activeMenuButtons?: ActiveMenuButtons;
|
|
24
29
|
menuChildren?: ReactNode;
|
|
25
|
-
|
|
30
|
+
customVariableList?: VariableOption[];
|
|
26
31
|
};
|
|
27
32
|
export declare function RichTextMenu(props: RichTextEditorMenuProps): import("react/jsx-runtime").JSX.Element | null;
|
|
28
33
|
export {};
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { RichTextEditorProps, RichTextViewerProps } from './rich-text.primitives';
|
|
2
|
-
import {
|
|
2
|
+
import { TEXT_BASE_CLASS } from './classNames';
|
|
3
|
+
import { ActiveMenuButtons, VariableOption } from './rich-text-menu';
|
|
3
4
|
export declare const RichText: {
|
|
4
5
|
Viewer: {
|
|
5
|
-
({ className, content }: RichTextViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
({ className, content, immediatelyRender }: RichTextViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
displayName: string;
|
|
7
8
|
};
|
|
8
9
|
Editor: {
|
|
9
|
-
({ className, maxLength, content, editable, placeholder, onChange, containerClassName, withMenu, activeMenuButtons, menuChildren,
|
|
10
|
+
({ className, maxLength, content, editable, placeholder, onChange, containerClassName, withMenu, activeMenuButtons, menuChildren, customVariableList, editor: externalEditor, allowExceedMaxLength, immediatelyRender, }: RichTextEditorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
10
11
|
displayName: string;
|
|
11
12
|
};
|
|
12
13
|
P_TAG_CLASS_NAME: string;
|
|
13
14
|
};
|
|
14
|
-
export
|
|
15
|
+
export { TEXT_BASE_CLASS };
|
|
16
|
+
export { TEXT_BASE_CLASS as P_TAG_CLASS_NAME };
|
|
17
|
+
export type { RichTextEditorProps, RichTextViewerProps, ActiveMenuButtons, VariableOption };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Content, JSONContent } from '@tiptap/react';
|
|
2
|
-
import { ActiveMenuButtons } from './rich-text-menu';
|
|
1
|
+
import { Content, JSONContent, Editor } from '@tiptap/react';
|
|
2
|
+
import { ActiveMenuButtons, VariableOption } from './rich-text-menu';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
export type RichTextEditorProps = {
|
|
5
5
|
className?: string;
|
|
@@ -16,18 +16,22 @@ export type RichTextEditorProps = {
|
|
|
16
16
|
}) => void;
|
|
17
17
|
activeMenuButtons?: ActiveMenuButtons;
|
|
18
18
|
menuChildren?: ReactNode;
|
|
19
|
-
|
|
19
|
+
customVariableList?: VariableOption[];
|
|
20
|
+
editor?: Editor | null;
|
|
21
|
+
allowExceedMaxLength?: boolean;
|
|
22
|
+
immediatelyRender?: boolean;
|
|
20
23
|
};
|
|
21
24
|
declare const RichTextEditor: {
|
|
22
|
-
({ className, maxLength, content, editable, placeholder, onChange, containerClassName, withMenu, activeMenuButtons, menuChildren,
|
|
25
|
+
({ className, maxLength, content, editable, placeholder, onChange, containerClassName, withMenu, activeMenuButtons, menuChildren, customVariableList, editor: externalEditor, allowExceedMaxLength, immediatelyRender, }: RichTextEditorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
23
26
|
displayName: string;
|
|
24
27
|
};
|
|
25
28
|
export type RichTextViewerProps = {
|
|
26
29
|
className?: string;
|
|
27
30
|
content?: Content;
|
|
31
|
+
immediatelyRender?: boolean;
|
|
28
32
|
};
|
|
29
33
|
declare const RichTextViewer: {
|
|
30
|
-
({ className, content }: RichTextViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
({ className, content, immediatelyRender }: RichTextViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
31
35
|
displayName: string;
|
|
32
36
|
};
|
|
33
37
|
export { RichTextEditor, RichTextViewer };
|
package/dist/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ import { Textarea, TextareaProps, textareaVariants } from './components/textarea
|
|
|
24
24
|
import { Dialog, DialogProps, DialogContentProps } from './components/dialog';
|
|
25
25
|
import { ToastProvider, Toaster, ToastFnProps, useToast } from './components/toast';
|
|
26
26
|
import { IconButton, IconButtonProps, iconButtonVariants } from './components/icon-button';
|
|
27
|
-
import { RichText, RichTextEditorProps, RichTextViewerProps } from './components/rich-text';
|
|
27
|
+
import { RichText, RichTextEditorProps, RichTextViewerProps, ActiveMenuButtons, VariableOption, TEXT_BASE_CLASS, P_TAG_CLASS_NAME, TEXT_BOLD_CLASS, TEXT_ITALIC_CLASS, TEXT_UNDERLINE_CLASS, LINK_CLASS, HEADING_BASE_CLASS, HEADING_1_CLASS, HEADING_2_CLASS, HEADING_3_CLASS, HEADING_4_CLASS, useRichTextEditor, UseEditorProps, isRichTextEmpty } from './components/rich-text';
|
|
28
28
|
import { AlertDialog, AlertDialogProps, AlertDialogContentProps } from './components/alert-dialog';
|
|
29
29
|
import { DownloadFileButton, DownloadFileButtonProps, DownloadFileButtonVariant } from './components/download-file-button';
|
|
30
30
|
import { UploadImageInput, UploadImageInputProps, UploadImageInputVariant } from './components/upload-image-input';
|
|
@@ -57,8 +57,8 @@ import { CapLinkProvider } from './providers';
|
|
|
57
57
|
import { IconTextButtonProps } from './components/icon-text-button';
|
|
58
58
|
import { Badge, BadgeProps } from './components/badge';
|
|
59
59
|
import { CustomPaginationProps } from './components/pagination';
|
|
60
|
-
export { Accordion, accordionVariants, FancyAccordion, FancyAccordionStatusEnum, Tabs, Status, Switch, Tooltip, Popover, Radio, Checkbox, InputOTP, Card, Input, SearchStringInput, Breadcrumb, Alert, alertVariants, ProgressBar, Button, buttonVariants, AlertBanner, Sheet, CopyTextButton, Textarea, textareaVariants, Dialog, ToastProvider, Toaster, useToast, IconButton, iconButtonVariants, AlertDialog, DownloadFileButton, UploadImageInput, InputPassword, Searchbar, RichText, DocumentFolder, DocumentFolderDataEditor, Table, NumericInput, Select, Workbook, WorkbookTabs, ConditionalFormattingCondition, };
|
|
61
|
-
export type { AccordionProps, CardProps, InputProps, SearchStringInputProps, TextareaProps, AlertProps, ProgressBarProps, ButtonProps, AlertBannerProps, SheetProps, SheetContentProps, CopyTextButtonProps, DialogProps, DialogContentProps, ToastFnProps, IconButtonProps, AlertDialogProps, AlertDialogContentProps, DownloadFileButtonProps, DownloadFileButtonVariant, UploadImageInputProps, UploadImageInputVariant, SearchbarProps, RichTextViewerProps, RichTextEditorProps, DocumentFolderCellProps, DataEditorCellProps, DataViewerProps, TablePaginationProps, WorkbookProps, WorkbookTabsProps, ConditionalFormatting, ConditionalFormattingRule, };
|
|
60
|
+
export { Accordion, accordionVariants, FancyAccordion, FancyAccordionStatusEnum, Tabs, Status, Switch, Tooltip, Popover, Radio, Checkbox, InputOTP, Card, Input, SearchStringInput, Breadcrumb, Alert, alertVariants, ProgressBar, Button, buttonVariants, AlertBanner, Sheet, CopyTextButton, Textarea, textareaVariants, Dialog, ToastProvider, Toaster, useToast, IconButton, iconButtonVariants, AlertDialog, DownloadFileButton, UploadImageInput, InputPassword, Searchbar, RichText, TEXT_BASE_CLASS, P_TAG_CLASS_NAME, TEXT_BOLD_CLASS, TEXT_ITALIC_CLASS, TEXT_UNDERLINE_CLASS, LINK_CLASS, HEADING_BASE_CLASS, HEADING_1_CLASS, HEADING_2_CLASS, HEADING_3_CLASS, HEADING_4_CLASS, useRichTextEditor, isRichTextEmpty, DocumentFolder, DocumentFolderDataEditor, Table, NumericInput, Select, Workbook, WorkbookTabs, ConditionalFormattingCondition, };
|
|
61
|
+
export type { AccordionProps, CardProps, InputProps, SearchStringInputProps, TextareaProps, AlertProps, ProgressBarProps, ButtonProps, AlertBannerProps, SheetProps, SheetContentProps, CopyTextButtonProps, DialogProps, DialogContentProps, ToastFnProps, IconButtonProps, AlertDialogProps, AlertDialogContentProps, DownloadFileButtonProps, DownloadFileButtonVariant, UploadImageInputProps, UploadImageInputVariant, SearchbarProps, RichTextViewerProps, RichTextEditorProps, ActiveMenuButtons, VariableOption, UseEditorProps, DocumentFolderCellProps, DataEditorCellProps, DataViewerProps, TablePaginationProps, WorkbookProps, WorkbookTabsProps, ConditionalFormatting, ConditionalFormattingRule, };
|
|
62
62
|
/** ----------- Updated Components ----------- */
|
|
63
63
|
/** ----------- SVG Icons & Components ----------- */
|
|
64
64
|
export { AnimatedLoaderIcon, EmptySearchIcon, EmptyFolderIcon, EmptyPageIcon, EmptyTaskIcon, EmptyDocumentIcon, UnderConstructionIcon, } from './svg';
|