@crystallize/design-system 1.11.3 → 1.11.5
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/index.css +28 -9
- package/dist/index.d.ts +38 -31
- package/dist/index.js +91 -67
- package/dist/index.mjs +55 -31
- package/package.json +4 -3
- package/src/action-menu/ActionMenu.stories.tsx +12 -0
- package/src/action-menu/action-menu.css +22 -3
- package/src/action-menu/action-menu.test.tsx +53 -0
- package/src/action-menu/action-menu.tsx +26 -5
- package/src/button/button.test.tsx +22 -0
- package/src/dropdown-menu/dropdown-menu-root.tsx +16 -10
- package/src/dropdown-menu/dropdown-menu.css +1 -1
- package/src/dropdown-menu/index.ts +3 -1
- package/src/popover/index.ts +1 -0
- package/src/popover/popover-close.tsx +18 -0
- package/src/popover/popover.css +11 -0
- package/src/popover/popover.stories.tsx +48 -0
- package/src/popover/popover.tsx +45 -0
- package/src/rich-text-editor/plugins/ActionsPlugin/index.tsx +4 -2
- package/src/rich-text-editor/tests/rich-text-editor-code.test.tsx +1 -1
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
import { useRef } from 'react';
|
|
10
11
|
import { CLEAR_EDITOR_COMMAND, LexicalEditor } from 'lexical';
|
|
11
12
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
12
13
|
|
|
@@ -34,11 +35,12 @@ export default function ActionsPlugin({
|
|
|
34
35
|
}): JSX.Element {
|
|
35
36
|
const [editor] = useLexicalComposerContext();
|
|
36
37
|
const tr = useTr();
|
|
38
|
+
const actionMenuAnchorRef = useRef<HTMLDivElement>(null);
|
|
37
39
|
|
|
38
40
|
return (
|
|
39
|
-
<div className="z-50 flex items-center ">
|
|
41
|
+
<div ref={actionMenuAnchorRef} className="z-50 flex items-center ">
|
|
40
42
|
<div></div>
|
|
41
|
-
<ActionMenu>
|
|
43
|
+
<ActionMenu container={actionMenuAnchorRef.current}>
|
|
42
44
|
{!prepend
|
|
43
45
|
? null
|
|
44
46
|
: prepend.map(actionItem => (
|
|
@@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event';
|
|
|
4
4
|
import { RichTextEditor } from '../rich-text-editor';
|
|
5
5
|
|
|
6
6
|
describe('RichTextEditor code node', () => {
|
|
7
|
-
it('can add a code block to an existing paragraph
|
|
7
|
+
it('can add a code block to an existing paragraph text', async () => {
|
|
8
8
|
const onChange = vi.fn();
|
|
9
9
|
|
|
10
10
|
render(
|