asma-ui-richeditor 0.1.2 → 0.1.3-alpha2
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/CHANGELOG.md +687 -0
- package/dist/asma-ui-richeditor.es.js +8 -8
- package/dist/src/rich-input/RichInput.d.ts +10 -18
- package/dist/src/rich-input/components/CustomMenuItem.d.ts +2 -0
- package/dist/src/rich-input/components/FontSizeSelect.d.ts +5 -0
- package/dist/src/rich-input/components/LinkDialog.d.ts +9 -0
- package/dist/src/rich-input/components/Toolbar.d.ts +10 -0
- package/dist/src/rich-input/helpers/EditorExtensions.d.ts +4 -0
- package/dist/src/rich-input/hooks/useToggleMenuVisibility.hook.d.ts +6 -0
- package/dist/src/rich-input/interfaces/types.d.ts +26 -0
- package/dist/tailwind.config.d.ts +11 -0
- package/package.json +137 -131
- package/dist/src/rich-input/MenuBar.d.ts +0 -4
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import { type FC
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
is_error?: boolean;
|
|
13
|
-
ghost?: boolean;
|
|
14
|
-
helperText?: string;
|
|
15
|
-
isRequired?: boolean;
|
|
16
|
-
hideMenuBar?: boolean;
|
|
17
|
-
noDefaultStyles?: boolean;
|
|
18
|
-
}
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import type { IRichInput } from './interfaces/types';
|
|
3
|
+
/**
|
|
4
|
+
* ASMA RichInput - A rich text editor component.
|
|
5
|
+
*
|
|
6
|
+
* @param readOnly - Determines the display style in read-only mode.
|
|
7
|
+
* Options:
|
|
8
|
+
* - `'plain'`: Displays the editor with a white background and no borders.
|
|
9
|
+
* - `'outlined'`: Displays the editor with a gray background and visible borders.
|
|
10
|
+
*/
|
|
19
11
|
declare const RichInput: FC<IRichInput>;
|
|
20
12
|
export { RichInput };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { ILocale } from '../interfaces/types';
|
|
4
|
+
export declare const LinkDialog: React.FC<{
|
|
5
|
+
open: boolean;
|
|
6
|
+
setOpen: (value: boolean) => void;
|
|
7
|
+
editor: Editor;
|
|
8
|
+
locale?: ILocale;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
|
2
|
+
import type { ILocale } from '../interfaces/types';
|
|
3
|
+
export declare const Toolbar: ({ editor, onClose, error, focused, openLinkDialog, locale, }: {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
error?: boolean | undefined;
|
|
7
|
+
focused: boolean;
|
|
8
|
+
openLinkDialog: () => void;
|
|
9
|
+
locale?: ILocale | undefined;
|
|
10
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const defaultExtensions: (import("@tiptap/core").Node<any, any> | import("@tiptap/core").Mark<import("@tiptap/extension-text-style").TextStyleOptions, any>)[];
|
|
2
|
+
export declare const editModeExtensions: (import("@tiptap/core").Node<import("@tiptap/extension-heading").HeadingOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-list-item").ListItemOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-bullet-list").BulletListOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-bold").BoldOptions, any> | import("@tiptap/core").Extension<{
|
|
3
|
+
types: string[];
|
|
4
|
+
}, any>)[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Editor, UseEditorOptions } from '@tiptap/react';
|
|
2
|
+
import type { MutableRefObject } from 'react';
|
|
3
|
+
export interface CustomCSSProperties extends React.CSSProperties {
|
|
4
|
+
'--max-scrollable-height'?: string;
|
|
5
|
+
}
|
|
6
|
+
export type ILocale = 'en' | 'no';
|
|
7
|
+
export interface IRichInput extends UseEditorOptions {
|
|
8
|
+
dataTest: string;
|
|
9
|
+
inputRef?: MutableRefObject<Editor | null>;
|
|
10
|
+
immediatelyRender?: boolean;
|
|
11
|
+
id?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
editorClassName?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
error?: boolean;
|
|
18
|
+
readOnly?: 'plain' | 'outlined';
|
|
19
|
+
helperText?: string;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
hideToolbar?: boolean;
|
|
22
|
+
noDefaultStyles?: boolean;
|
|
23
|
+
maxScrollableHeight?: number | string;
|
|
24
|
+
toolbarDefaultVisible?: boolean;
|
|
25
|
+
locale?: ILocale;
|
|
26
|
+
}
|
|
@@ -122,7 +122,9 @@ declare const _default: {
|
|
|
122
122
|
"opacity-in": string;
|
|
123
123
|
"opacity-in-5": string;
|
|
124
124
|
"opacity-appear-3": string;
|
|
125
|
+
"opacity-appear-1s": string;
|
|
125
126
|
"opacity-out": string;
|
|
127
|
+
spin: string;
|
|
126
128
|
};
|
|
127
129
|
keyframes: {
|
|
128
130
|
"slide-in": {
|
|
@@ -173,6 +175,14 @@ declare const _default: {
|
|
|
173
175
|
height: string;
|
|
174
176
|
};
|
|
175
177
|
};
|
|
178
|
+
spin: {
|
|
179
|
+
"0%": {
|
|
180
|
+
transform: string;
|
|
181
|
+
};
|
|
182
|
+
"100%": {
|
|
183
|
+
transform: string;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
176
186
|
};
|
|
177
187
|
colors: {
|
|
178
188
|
inherit: string;
|
|
@@ -196,6 +206,7 @@ declare const _default: {
|
|
|
196
206
|
"gama-600": string;
|
|
197
207
|
"gama-700": string;
|
|
198
208
|
"gama-800": string;
|
|
209
|
+
"gama-900": string;
|
|
199
210
|
"delta-10": string;
|
|
200
211
|
"delta-50": string;
|
|
201
212
|
"delta-100": string;
|
package/package.json
CHANGED
|
@@ -1,133 +1,139 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
},
|
|
6
|
-
"version": "0.1.2",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist/**/*",
|
|
10
|
-
"dist/style.css",
|
|
11
|
-
"tw-configs/**/*"
|
|
12
|
-
],
|
|
13
|
-
"keywords": [],
|
|
14
|
-
"author": "asma-team",
|
|
15
|
-
"types": "./dist/index.d.ts",
|
|
16
|
-
"main": "./dist/asma-ui-richeditor.es.js",
|
|
17
|
-
"module": "./dist/asma-ui-richeditor.es.js",
|
|
18
|
-
"license": "UNLICENSED",
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"@emotion/react": "^11.11.1",
|
|
21
|
-
"@emotion/styled": "^11.11.0",
|
|
22
|
-
"@fontsource/roboto": "^5.0.4",
|
|
23
|
-
"@mui/material": "^5.13.7",
|
|
24
|
-
"@tiptap/extension-blockquote": "^2.6.5",
|
|
25
|
-
"@tiptap/extension-bold": "^2.6.5",
|
|
26
|
-
"@tiptap/extension-bullet-list": "^2.6.5",
|
|
27
|
-
"@tiptap/extension-color": "^2.6.5",
|
|
28
|
-
"@tiptap/extension-document": "^2.6.5",
|
|
29
|
-
"@tiptap/extension-hard-break": "^2.6.5",
|
|
30
|
-
"@tiptap/extension-heading": "^2.6.5",
|
|
31
|
-
"@tiptap/extension-horizontal-rule": "^2.6.5",
|
|
32
|
-
"@tiptap/extension-italic": "^2.6.5",
|
|
33
|
-
"@tiptap/extension-list-item": "^2.6.5",
|
|
34
|
-
"@tiptap/extension-ordered-list": "^2.6.5",
|
|
35
|
-
"@tiptap/extension-paragraph": "^2.6.5",
|
|
36
|
-
"@tiptap/extension-placeholder": "^2.6.5",
|
|
37
|
-
"@tiptap/extension-strike": "^2.6.5",
|
|
38
|
-
"@tiptap/extension-text": "^2.6.5",
|
|
39
|
-
"@tiptap/extension-text-style": "^2.6.5",
|
|
40
|
-
"@tiptap/react": "^2.6.5",
|
|
41
|
-
"clsx": "^2.1.1",
|
|
42
|
-
"node": "18.17.0",
|
|
43
|
-
"react": "^18.2.0",
|
|
44
|
-
"react-dom": "^18.2.0"
|
|
45
|
-
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@changesets/cli": "^2.26.2",
|
|
48
|
-
"@faker-js/faker": "^8.0.2",
|
|
49
|
-
"@rollup/plugin-terser": "^0.4.3",
|
|
50
|
-
"@storybook/addon-a11y": "^7.6.9",
|
|
51
|
-
"@storybook/addon-essentials": "^7.6.9",
|
|
52
|
-
"@storybook/addon-interactions": "^7.6.9",
|
|
53
|
-
"@storybook/addon-links": "^7.6.9",
|
|
54
|
-
"@storybook/addon-mdx-gfm": "^7.6.9",
|
|
55
|
-
"@storybook/addon-styling": "^1.3.7",
|
|
56
|
-
"@storybook/addons": "^7.6.9",
|
|
57
|
-
"@storybook/blocks": "^7.6.9",
|
|
58
|
-
"@storybook/manager-api": "^7.6.9",
|
|
59
|
-
"@storybook/preset-create-react-app": "^7.6.9",
|
|
60
|
-
"@storybook/react": "^7.6.9",
|
|
61
|
-
"@storybook/react-vite": "^7.6.9",
|
|
62
|
-
"@storybook/test-runner": "^0.16.0",
|
|
63
|
-
"@storybook/testing-library": "^0.2.2",
|
|
64
|
-
"@storybook/theming": "^7.6.9",
|
|
65
|
-
"@types/lodash-es": "^4.17.7",
|
|
66
|
-
"@types/node": "^18.0.3",
|
|
67
|
-
"@types/react": "^18.0.37",
|
|
68
|
-
"@types/react-dom": "^18.0.11",
|
|
69
|
-
"@typescript-eslint/eslint-plugin": "^5.59.0",
|
|
70
|
-
"@typescript-eslint/parser": "^5.59.0",
|
|
71
|
-
"@vitejs/plugin-react": "^4.0.0",
|
|
72
|
-
"asma-core-ui": "^3.0.71",
|
|
73
|
-
"autoprefixer": "^10.4.14",
|
|
74
|
-
"axe-playwright": "^1.2.3",
|
|
75
|
-
"axios": "^1.6.8",
|
|
76
|
-
"eslint": "^8.38.0",
|
|
77
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
78
|
-
"eslint-plugin-react-refresh": "^0.3.4",
|
|
79
|
-
"eslint-plugin-storybook": "^0.6.15",
|
|
80
|
-
"postcss": "^8.4.24",
|
|
81
|
-
"prop-types": "^15.8.1",
|
|
82
|
-
"rollup-plugin-typescript2": "^0.35.0",
|
|
83
|
-
"storybook": "^7.6.9",
|
|
84
|
-
"storybook-addon-themes": "^6.1.0",
|
|
85
|
-
"tailwind-scrollbar": "^3.1.0",
|
|
86
|
-
"tailwindcss": "^3.3.2",
|
|
87
|
-
"typescript": "^5.0.2",
|
|
88
|
-
"typescript-plugin-css-modules": "^5.0.1",
|
|
89
|
-
"vite": "^4.3.9",
|
|
90
|
-
"vite-plugin-css-injected-by-js": "^3.5.1",
|
|
91
|
-
"vite-plugin-dts": "^3.1.1",
|
|
92
|
-
"vite-tsconfig-paths": "^4.2.0"
|
|
93
|
-
},
|
|
94
|
-
"peerDependencies": {
|
|
95
|
-
"@emotion/react": "^11.*",
|
|
96
|
-
"@emotion/styled": "^11.*",
|
|
97
|
-
"@mui/material": "^5.*",
|
|
98
|
-
"immer": "^9.*",
|
|
99
|
-
"react": "^18.*",
|
|
100
|
-
"react-dom": "^18.*"
|
|
101
|
-
},
|
|
102
|
-
"resolutions": {
|
|
103
|
-
"@types/node": "18.0.3",
|
|
104
|
-
"node": "18.17.0"
|
|
105
|
-
},
|
|
106
|
-
"exports": {
|
|
107
|
-
".": {
|
|
108
|
-
"import": "./dist/asma-ui-richeditor.es.js"
|
|
2
|
+
"name": "asma-ui-richeditor",
|
|
3
|
+
"publishConfig": {
|
|
4
|
+
"access": "public"
|
|
109
5
|
},
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
6
|
+
"version": "0.1.3-alpha2",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/**/*",
|
|
10
|
+
"dist/style.css",
|
|
11
|
+
"tw-configs/**/*"
|
|
12
|
+
],
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "asma-team",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"main": "./dist/asma-ui-richeditor.es.js",
|
|
17
|
+
"module": "./dist/asma-ui-richeditor.es.js",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "vite",
|
|
20
|
+
"build": "npx tsc && rm -rf ./dist && vite build",
|
|
21
|
+
"preview": "vite preview",
|
|
22
|
+
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
|
|
23
|
+
"version": "echo $npm_package_version",
|
|
24
|
+
"lint:fix": "eslint --fix src/**/*.{jsx,ts,tsx}",
|
|
25
|
+
"prettier": "prettier --write src//**/*.{ts,tsx,scss} --config ./.prettierrc",
|
|
26
|
+
"storybook": "storybook dev -p 6006",
|
|
27
|
+
"storybook:no-browser": "storybook dev -p 6006 --no-open",
|
|
28
|
+
"storybook:node18": "export NODE_OPTIONS=--openssl-legacy-provider && storybook dev -p 6006",
|
|
29
|
+
"storybook:node18:win": "set NODE_OPTIONS=--openssl-legacy-provider && storybook dev -p 6006",
|
|
30
|
+
"build-storybook": "export NODE_OPTIONS=--max_old_space_size=6240 && storybook build",
|
|
31
|
+
"test-storybook": "test-storybook",
|
|
32
|
+
"changeset:pre-beta": "changeset pre enter beta",
|
|
33
|
+
"changeset:pre-exit": "changeset pre exit",
|
|
34
|
+
"changeset:version": "changeset version",
|
|
35
|
+
"changeset:publish": "changeset publish",
|
|
36
|
+
"changeset:status": "changeset status"
|
|
37
|
+
},
|
|
38
|
+
"license": "UNLICENSED",
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@emotion/react": "^11.11.1",
|
|
41
|
+
"@emotion/styled": "^11.11.0",
|
|
42
|
+
"@fontsource/roboto": "^5.0.4",
|
|
43
|
+
"@iconify/react": "^5.0.2",
|
|
44
|
+
"@mui/material": "^5.13.7",
|
|
45
|
+
"@tiptap/core": "^2.8.0",
|
|
46
|
+
"@tiptap/extension-blockquote": "^2.6.5",
|
|
47
|
+
"@tiptap/extension-bold": "^2.6.5",
|
|
48
|
+
"@tiptap/extension-bullet-list": "^2.6.5",
|
|
49
|
+
"@tiptap/extension-color": "^2.6.5",
|
|
50
|
+
"@tiptap/extension-document": "^2.6.5",
|
|
51
|
+
"@tiptap/extension-hard-break": "^2.6.5",
|
|
52
|
+
"@tiptap/extension-heading": "^2.6.5",
|
|
53
|
+
"@tiptap/extension-horizontal-rule": "^2.6.5",
|
|
54
|
+
"@tiptap/extension-italic": "^2.6.5",
|
|
55
|
+
"@tiptap/extension-link": "^2.8.0",
|
|
56
|
+
"@tiptap/extension-list-item": "^2.6.5",
|
|
57
|
+
"@tiptap/extension-ordered-list": "^2.6.5",
|
|
58
|
+
"@tiptap/extension-paragraph": "^2.6.5",
|
|
59
|
+
"@tiptap/extension-placeholder": "^2.6.5",
|
|
60
|
+
"@tiptap/extension-strike": "^2.6.5",
|
|
61
|
+
"@tiptap/extension-text": "^2.6.5",
|
|
62
|
+
"@tiptap/extension-text-style": "^2.6.5",
|
|
63
|
+
"@tiptap/extension-underline": "^2.8.0",
|
|
64
|
+
"@tiptap/react": "^2.6.5",
|
|
65
|
+
"clsx": "^2.1.1",
|
|
66
|
+
"node": "18.17.0",
|
|
67
|
+
"react": "^18.2.0",
|
|
68
|
+
"react-dom": "^18.2.0",
|
|
69
|
+
"tailwind-merge": "^2.5.4",
|
|
70
|
+
"tiptap-extension-font-size": "^1.2.0"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@changesets/cli": "^2.26.2",
|
|
74
|
+
"@faker-js/faker": "^8.0.2",
|
|
75
|
+
"@rollup/plugin-terser": "^0.4.3",
|
|
76
|
+
"@storybook/addon-a11y": "^7.6.9",
|
|
77
|
+
"@storybook/addon-essentials": "^7.6.9",
|
|
78
|
+
"@storybook/addon-interactions": "^7.6.9",
|
|
79
|
+
"@storybook/addon-links": "^7.6.9",
|
|
80
|
+
"@storybook/addon-mdx-gfm": "^7.6.9",
|
|
81
|
+
"@storybook/addon-styling": "^1.3.7",
|
|
82
|
+
"@storybook/addons": "^7.6.9",
|
|
83
|
+
"@storybook/blocks": "^7.6.9",
|
|
84
|
+
"@storybook/manager-api": "^7.6.9",
|
|
85
|
+
"@storybook/preset-create-react-app": "^7.6.9",
|
|
86
|
+
"@storybook/react": "^7.6.9",
|
|
87
|
+
"@storybook/react-vite": "^7.6.9",
|
|
88
|
+
"@storybook/test-runner": "^0.16.0",
|
|
89
|
+
"@storybook/testing-library": "^0.2.2",
|
|
90
|
+
"@storybook/theming": "^7.6.9",
|
|
91
|
+
"@types/lodash-es": "^4.17.7",
|
|
92
|
+
"@types/node": "^18.0.3",
|
|
93
|
+
"@types/react": "^18.0.37",
|
|
94
|
+
"@types/react-dom": "^18.0.11",
|
|
95
|
+
"@typescript-eslint/eslint-plugin": "^5.59.0",
|
|
96
|
+
"@typescript-eslint/parser": "^5.59.0",
|
|
97
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
98
|
+
"asma-core-ui": "^3.0.116",
|
|
99
|
+
"autoprefixer": "^10.4.14",
|
|
100
|
+
"axe-playwright": "^1.2.3",
|
|
101
|
+
"axios": "^1.6.8",
|
|
102
|
+
"eslint": "^8.38.0",
|
|
103
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
104
|
+
"eslint-plugin-react-refresh": "^0.3.4",
|
|
105
|
+
"eslint-plugin-storybook": "^0.6.15",
|
|
106
|
+
"postcss": "^8.4.24",
|
|
107
|
+
"prop-types": "^15.8.1",
|
|
108
|
+
"rollup-plugin-typescript2": "^0.35.0",
|
|
109
|
+
"storybook": "^7.6.9",
|
|
110
|
+
"storybook-addon-themes": "^6.1.0",
|
|
111
|
+
"tailwind-scrollbar": "^3.1.0",
|
|
112
|
+
"tailwindcss": "^3.3.2",
|
|
113
|
+
"typescript": "^5.0.2",
|
|
114
|
+
"typescript-plugin-css-modules": "^5.0.1",
|
|
115
|
+
"vite": "^4.3.9",
|
|
116
|
+
"vite-plugin-css-injected-by-js": "^3.5.1",
|
|
117
|
+
"vite-plugin-dts": "^3.1.1",
|
|
118
|
+
"vite-tsconfig-paths": "^4.2.0"
|
|
119
|
+
},
|
|
120
|
+
"peerDependencies": {
|
|
121
|
+
"@emotion/react": "^11.*",
|
|
122
|
+
"@emotion/styled": "^11.*",
|
|
123
|
+
"@mui/material": "^5.*",
|
|
124
|
+
"immer": "^9.*",
|
|
125
|
+
"react": "^18.*",
|
|
126
|
+
"react-dom": "^18.*"
|
|
127
|
+
},
|
|
128
|
+
"resolutions": {
|
|
129
|
+
"@types/node": "18.0.3",
|
|
130
|
+
"node": "18.17.0"
|
|
131
|
+
},
|
|
132
|
+
"exports": {
|
|
133
|
+
".": {
|
|
134
|
+
"import": "./dist/asma-ui-richeditor.es.js"
|
|
135
|
+
},
|
|
136
|
+
"./dist/style.css": "./dist/style.css",
|
|
137
|
+
"./tw-configs/twConfigs.json": "./tw-configs/twConfigs.json"
|
|
138
|
+
}
|
|
139
|
+
}
|