@crystallize/design-system 1.21.0 → 1.21.2
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 +12 -0
- package/dist/chunk-PB47BT3T.mjs +6018 -0
- package/dist/index.css +10 -4
- package/dist/index.d.ts +7 -28
- package/dist/index.js +37048 -35782
- package/dist/index.mjs +273 -9459
- package/dist/rich-text-editor-BA5R66CS.mjs +3227 -0
- package/dist/rich-text-editor-OUGDPSPV.css +2365 -0
- package/package.json +4 -3
- package/src/dialog/config.tsx +3 -9
- package/src/dialog/types.ts +0 -1
- package/src/rich-text-editor/index.tsx +15 -0
- package/src/rich-text-editor/rich-text-editor.css +4 -5
- package/src/rich-text-editor/rich-text-editor.tsx +2 -4
- package/src/tag/tag.css +4 -0
- package/src/tag/tag.tsx +1 -0
- package/src/rich-text-editor/index.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crystallize/design-system",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.2",
|
|
4
4
|
"types": "./dist/index.d.ts",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -73,9 +73,10 @@
|
|
|
73
73
|
"@storybook/react": "7.6.2",
|
|
74
74
|
"@storybook/react-vite": "7.6.2",
|
|
75
75
|
"@storybook/theming": "7.6.2",
|
|
76
|
-
"@testing-library/jest-dom": "
|
|
77
|
-
"@testing-library/react": "
|
|
76
|
+
"@testing-library/jest-dom": "^5.16.4",
|
|
77
|
+
"@testing-library/react": "^12.1.2",
|
|
78
78
|
"@testing-library/user-event": "14.5.1",
|
|
79
|
+
"@types/testing-library__jest-dom": "^5.14.5",
|
|
79
80
|
"@types/prettier": "2.7.2",
|
|
80
81
|
"@types/react": "17.0.1",
|
|
81
82
|
"@types/react-dom": "17.0.1",
|
package/src/dialog/config.tsx
CHANGED
|
@@ -9,21 +9,15 @@ export function confirm(config: DialogFuncProps) {
|
|
|
9
9
|
let currentConfig = { ...config, close, open: true };
|
|
10
10
|
let timeoutId: NodeJS.Timeout;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
function close(...args: any[]) {
|
|
12
|
+
function close() {
|
|
14
13
|
currentConfig = {
|
|
15
14
|
...currentConfig,
|
|
16
15
|
open: false,
|
|
17
|
-
afterClose: () => {
|
|
18
|
-
if (typeof config.afterClose === 'function') {
|
|
19
|
-
config.afterClose();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
destroy.apply(this, args);
|
|
23
|
-
},
|
|
24
16
|
};
|
|
25
17
|
|
|
26
18
|
render(currentConfig);
|
|
19
|
+
config.afterClose?.();
|
|
20
|
+
destroy();
|
|
27
21
|
}
|
|
28
22
|
|
|
29
23
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
package/src/dialog/types.ts
CHANGED
|
@@ -62,7 +62,6 @@ export type DialogFunc = (props: DialogFuncProps) => {
|
|
|
62
62
|
export type ModalStaticFunctions = Record<NonNullable<DialogFuncProps['type']>, DialogFunc>;
|
|
63
63
|
|
|
64
64
|
export interface ConfirmDialogProps extends DialogFuncProps {
|
|
65
|
-
afterClose?: () => void;
|
|
66
65
|
close: (...args: unknown[]) => void;
|
|
67
66
|
autoFocusButton?: null | 'ok' | 'cancel';
|
|
68
67
|
rootPrefixCls: string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { lazy, Suspense } from 'react';
|
|
2
|
+
|
|
3
|
+
const LazyRichTextEditor = lazy(() => import('./rich-text-editor'));
|
|
4
|
+
|
|
5
|
+
// Export types
|
|
6
|
+
export type { CrystallizeRichText } from './types/crystallize-rich-text-types';
|
|
7
|
+
export * from './types/types';
|
|
8
|
+
|
|
9
|
+
export const RichTextEditor = (props: any) => {
|
|
10
|
+
return (
|
|
11
|
+
<Suspense fallback={null}>
|
|
12
|
+
<LazyRichTextEditor {...props} />
|
|
13
|
+
</Suspense>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
@@ -17,8 +17,6 @@
|
|
|
17
17
|
position: relative;
|
|
18
18
|
line-height: 1.7;
|
|
19
19
|
|
|
20
|
-
--c-rte-min-height: 150px;
|
|
21
|
-
|
|
22
20
|
> * {
|
|
23
21
|
box-sizing: border-box;
|
|
24
22
|
}
|
|
@@ -26,7 +24,7 @@
|
|
|
26
24
|
@apply !font-sans font-normal text-gray-900-50;
|
|
27
25
|
|
|
28
26
|
.c-rte-editor-scroller {
|
|
29
|
-
min-height: var(--c-rte-min-height);
|
|
27
|
+
min-height: var(--c-rte-min-height, 150px);
|
|
30
28
|
border: 0;
|
|
31
29
|
resize: none;
|
|
32
30
|
cursor: text;
|
|
@@ -148,8 +146,9 @@
|
|
|
148
146
|
}
|
|
149
147
|
|
|
150
148
|
.c-rte-placeholder {
|
|
151
|
-
@apply pointer-events-none absolute
|
|
149
|
+
@apply pointer-events-none absolute right-10 top-0 inline-block select-none overflow-hidden text-ellipsis whitespace-nowrap text-[14px] font-normal text-gray-300-600;
|
|
152
150
|
font-style: italic;
|
|
151
|
+
left: var(--c-rte-content-pl, 1.5rem);
|
|
153
152
|
}
|
|
154
153
|
|
|
155
154
|
@keyframes CursorBlink {
|
|
@@ -163,7 +162,7 @@
|
|
|
163
162
|
@apply relative block border-0 px-6 py-2 !pt-0 text-sm outline-0;
|
|
164
163
|
tab-size: 1;
|
|
165
164
|
padding-bottom: 8px;
|
|
166
|
-
min-height: calc(var(--c-rte-min-height) - 8px);
|
|
165
|
+
min-height: calc(var(--c-rte-min-height, 150px) - 8px);
|
|
167
166
|
|
|
168
167
|
/* Allow for customization from the outside */
|
|
169
168
|
padding-top: var(--c-rte-content-pt, 0);
|
|
@@ -45,10 +45,6 @@ import type { CrystallizeRichTextActionMenuItem } from './types/types';
|
|
|
45
45
|
*/
|
|
46
46
|
// import DraggableBlockPlugin from './plugins/DraggableBlockPlugin';
|
|
47
47
|
|
|
48
|
-
// Export types
|
|
49
|
-
export type { CrystallizeRichText } from './types/crystallize-rich-text-types';
|
|
50
|
-
export * from './types/types';
|
|
51
|
-
|
|
52
48
|
type TRichTextBase = {
|
|
53
49
|
placeholder?: string;
|
|
54
50
|
onChange?: (data: CrystallizeRichText) => void;
|
|
@@ -186,3 +182,5 @@ function RichTextEditorWithoutContext({
|
|
|
186
182
|
</>
|
|
187
183
|
);
|
|
188
184
|
}
|
|
185
|
+
|
|
186
|
+
export default RichTextEditor;
|
package/src/tag/tag.css
CHANGED
package/src/tag/tag.tsx
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './rich-text-editor';
|