@exsto/ds 0.0.1-rc.6 → 0.0.1-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/chunks/toggle-C2c5oDaE.js +629 -0
- package/dist/chunks/toggle-C2c5oDaE.js.map +1 -0
- package/dist/ds/src/rich-text-editor.d.ts +8 -0
- package/dist/index.js +3 -470
- package/dist/index.js.map +1 -1
- package/dist/rich-text-editor.js +846 -0
- package/dist/rich-text-editor.js.map +1 -0
- package/dist/styles.css +159 -0
- package/dist/ui/src/components/edyn/rich-text-content/allow-list.d.ts +11 -0
- package/dist/ui/src/components/edyn/rich-text-content/index.d.ts +2 -0
- package/dist/ui/src/components/edyn/rich-text-content/rich-text-content.d.ts +22 -0
- package/dist/ui/src/components/edyn/rich-text-content/rich-text-content.test.d.ts +8 -0
- package/dist/ui/src/components/edyn/rich-text-editor/extensions.d.ts +18 -0
- package/dist/ui/src/components/edyn/rich-text-editor/index.d.ts +3 -0
- package/dist/ui/src/components/edyn/rich-text-editor/mention-list.d.ts +17 -0
- package/dist/ui/src/components/edyn/rich-text-editor/rich-text-editor.d.ts +53 -0
- package/dist/ui/src/components/edyn/rich-text-editor/rich-text-editor.test.d.ts +6 -0
- package/dist/ui/src/components/edyn/rich-text-editor/serialize.d.ts +13 -0
- package/dist/ui/src/components/edyn/rich-text-editor/toolbar.d.ts +20 -0
- package/dist/ui/src/components/edyn/rich-text-editor/types.d.ts +68 -0
- package/dist/ui/src/components/ui/popover/popover.d.ts +1 -1
- package/dist/ui/src/index.d.ts +1 -0
- package/package.json +21 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/** One person (or anything else) the app offers when the writer types @. */
|
|
2
|
+
export interface IRichTextMentionItem {
|
|
3
|
+
/** What the HTML carries. By default the value is written as `@${id}`, so an email address works as an id. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** What the chip shows while the text is being edited. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** A second, muted line in the list (a role, an email address). */
|
|
8
|
+
secondary?: string;
|
|
9
|
+
}
|
|
10
|
+
/** A page of results. Return a plain array instead when there is only ever one page. */
|
|
11
|
+
export interface IRichTextMentionPage {
|
|
12
|
+
items: IRichTextMentionItem[];
|
|
13
|
+
/** True when asking for `page + 1` would return more. The list loads it when it is scrolled to the end. */
|
|
14
|
+
hasMore?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface IRichTextMentionSearchOptions {
|
|
17
|
+
/** 1-based. */
|
|
18
|
+
page: number;
|
|
19
|
+
/** Aborted when the writer types on or closes the list: pass it to `fetch` so a stale search stops. */
|
|
20
|
+
signal: AbortSignal;
|
|
21
|
+
}
|
|
22
|
+
export type TRichTextMentionSearch = (query: string, options: IRichTextMentionSearchOptions) => Promise<IRichTextMentionItem[] | IRichTextMentionPage>;
|
|
23
|
+
export interface IRichTextMention {
|
|
24
|
+
/** Asked for the first page when the writer types @ and again for every change of the text after it, debounced. */
|
|
25
|
+
search: TRichTextMentionSearch;
|
|
26
|
+
/**
|
|
27
|
+
* How a mention is written into the HTML. The chip exists only while editing; the HTML carries this text
|
|
28
|
+
* and no element. Default: `@${item.id}`.
|
|
29
|
+
*/
|
|
30
|
+
toText?: (item: Pick<IRichTextMentionItem, 'id' | 'label'>) => string;
|
|
31
|
+
/** Milliseconds to wait after the last keystroke before searching. Default 250. */
|
|
32
|
+
debounce?: number;
|
|
33
|
+
}
|
|
34
|
+
/** A field of a template (a mail merge token). Inserted as the plain text `{{id}}`. */
|
|
35
|
+
export interface IRichTextField {
|
|
36
|
+
id: string;
|
|
37
|
+
label: string;
|
|
38
|
+
}
|
|
39
|
+
/** What a ref to the editor can do, for a button outside it (a merge tag, say). */
|
|
40
|
+
export interface IRichTextEditorHandle {
|
|
41
|
+
/** Writes plain text at the caret (over the selection), and puts focus back in the editor. */
|
|
42
|
+
insertText: (text: string) => void;
|
|
43
|
+
focus: () => void;
|
|
44
|
+
}
|
|
45
|
+
/** Every string the editor shows, so an app can translate them. */
|
|
46
|
+
export interface IRichTextLabels {
|
|
47
|
+
toolbar: string;
|
|
48
|
+
bold: string;
|
|
49
|
+
italic: string;
|
|
50
|
+
underline: string;
|
|
51
|
+
bulletList: string;
|
|
52
|
+
numberedList: string;
|
|
53
|
+
link: string;
|
|
54
|
+
horizontalRule: string;
|
|
55
|
+
insertField: string;
|
|
56
|
+
linkAddress: string;
|
|
57
|
+
linkApply: string;
|
|
58
|
+
linkRemove: string;
|
|
59
|
+
linkInvalid: string;
|
|
60
|
+
mentionList: string;
|
|
61
|
+
mentionSearching: string;
|
|
62
|
+
mentionEmpty: string;
|
|
63
|
+
mentionError: string;
|
|
64
|
+
mentionLoadingMore: string;
|
|
65
|
+
/** Announced as the list changes. `{count}` is replaced. */
|
|
66
|
+
mentionResults: string;
|
|
67
|
+
}
|
|
68
|
+
export declare const DEFAULT_RICH_TEXT_LABELS: IRichTextLabels;
|
|
@@ -2,7 +2,7 @@ import { Popover as PopoverPrimitive } from '@base-ui/react/popover';
|
|
|
2
2
|
import type * as React from 'react';
|
|
3
3
|
export declare const Popover: ({ ...props }: PopoverPrimitive.Root.Props) => React.JSX.Element;
|
|
4
4
|
export declare const PopoverTrigger: ({ ...props }: PopoverPrimitive.Trigger.Props) => React.JSX.Element;
|
|
5
|
-
export declare const PopoverContent: ({ className, align, alignOffset, side, sideOffset, ...props }: PopoverPrimitive.Popup.Props & Pick<PopoverPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">) => React.JSX.Element;
|
|
5
|
+
export declare const PopoverContent: ({ className, align, alignOffset, side, sideOffset, anchor, ...props }: PopoverPrimitive.Popup.Props & Pick<PopoverPrimitive.Positioner.Props, "align" | "alignOffset" | "anchor" | "side" | "sideOffset">) => React.JSX.Element;
|
|
6
6
|
export declare const PopoverHeader: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
|
|
7
7
|
export declare const PopoverTitle: ({ className, ...props }: PopoverPrimitive.Title.Props) => React.JSX.Element;
|
|
8
8
|
export declare const PopoverDescription: ({ className, ...props }: PopoverPrimitive.Description.Props) => React.JSX.Element;
|
package/dist/ui/src/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './components/edyn/date-range-picker';
|
|
|
4
4
|
export * from './components/edyn/initials-avatar';
|
|
5
5
|
export * from './components/edyn/multi-select';
|
|
6
6
|
export * from './components/edyn/progress-line';
|
|
7
|
+
export * from './components/edyn/rich-text-content';
|
|
7
8
|
export * from './components/edyn/video-player';
|
|
8
9
|
export * from './components/ui/accordion';
|
|
9
10
|
export * from './components/ui/alert';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exsto/ds",
|
|
3
|
-
"version": "0.0.1-rc.
|
|
3
|
+
"version": "0.0.1-rc.7",
|
|
4
4
|
"description": "The eDynamix design system: React components and design tokens.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
"types": "./dist/ds/src/index.d.ts",
|
|
28
28
|
"default": "./dist/index.js"
|
|
29
29
|
},
|
|
30
|
+
"./rich-text-editor": {
|
|
31
|
+
"types": "./dist/ds/src/rich-text-editor.d.ts",
|
|
32
|
+
"default": "./dist/rich-text-editor.js"
|
|
33
|
+
},
|
|
30
34
|
"./styles.css": {
|
|
31
35
|
"types": "./dist/styles.css.d.ts",
|
|
32
36
|
"default": "./dist/styles.css"
|
|
@@ -46,6 +50,22 @@
|
|
|
46
50
|
"@shadcn/react": "^0.3.1",
|
|
47
51
|
"@tabler/icons-react": "^3.44.0",
|
|
48
52
|
"@tanstack/react-virtual": "^3.13.0",
|
|
53
|
+
"@tiptap/core": "3.32.2",
|
|
54
|
+
"@tiptap/extension-bold": "3.32.2",
|
|
55
|
+
"@tiptap/extension-document": "3.32.2",
|
|
56
|
+
"@tiptap/extension-hard-break": "3.32.2",
|
|
57
|
+
"@tiptap/extension-horizontal-rule": "3.32.2",
|
|
58
|
+
"@tiptap/extension-italic": "3.32.2",
|
|
59
|
+
"@tiptap/extension-link": "3.32.2",
|
|
60
|
+
"@tiptap/extension-list": "3.32.2",
|
|
61
|
+
"@tiptap/extension-mention": "3.32.2",
|
|
62
|
+
"@tiptap/extension-paragraph": "3.32.2",
|
|
63
|
+
"@tiptap/extension-text": "3.32.2",
|
|
64
|
+
"@tiptap/extension-underline": "3.32.2",
|
|
65
|
+
"@tiptap/extensions": "3.32.2",
|
|
66
|
+
"@tiptap/pm": "3.32.2",
|
|
67
|
+
"@tiptap/react": "3.32.2",
|
|
68
|
+
"@tiptap/suggestion": "3.32.2",
|
|
49
69
|
"class-variance-authority": "^0.7.1",
|
|
50
70
|
"clsx": "^2.1.1",
|
|
51
71
|
"cmdk": "^1.1.1",
|