@pie-lib/editable-html-tip-tap 2.1.2-next.31 → 2.1.2-next.34
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.json +32 -0
- package/CHANGELOG.md +2532 -0
- package/LICENSE.md +5 -0
- package/lib/components/CharacterPicker.js +201 -0
- package/lib/components/CharacterPicker.js.map +1 -0
- package/lib/components/EditableHtml.js +376 -0
- package/lib/components/EditableHtml.js.map +1 -0
- package/lib/components/MenuBar.js +696 -0
- package/lib/components/MenuBar.js.map +1 -0
- package/lib/components/TiptapContainer.js +234 -0
- package/lib/components/TiptapContainer.js.map +1 -0
- package/lib/components/characters/characterUtils.js +378 -0
- package/lib/components/characters/characterUtils.js.map +1 -0
- package/lib/components/characters/custom-popper.js +44 -0
- package/lib/components/characters/custom-popper.js.map +1 -0
- package/lib/components/common/done-button.js +34 -0
- package/lib/components/common/done-button.js.map +1 -0
- package/lib/components/common/toolbar-buttons.js +144 -0
- package/lib/components/common/toolbar-buttons.js.map +1 -0
- package/lib/components/icons/CssIcon.js +25 -0
- package/lib/components/icons/CssIcon.js.map +1 -0
- package/lib/components/icons/RespArea.js +72 -0
- package/lib/components/icons/RespArea.js.map +1 -0
- package/lib/components/icons/TableIcons.js +53 -0
- package/lib/components/icons/TableIcons.js.map +1 -0
- package/lib/components/icons/TextAlign.js +157 -0
- package/lib/components/icons/TextAlign.js.map +1 -0
- package/lib/components/image/AltDialog.js +98 -0
- package/lib/components/image/AltDialog.js.map +1 -0
- package/lib/components/image/ImageToolbar.js +137 -0
- package/lib/components/image/ImageToolbar.js.map +1 -0
- package/lib/components/image/InsertImageHandler.js +135 -0
- package/lib/components/image/InsertImageHandler.js.map +1 -0
- package/lib/components/media/MediaDialog.js +594 -0
- package/lib/components/media/MediaDialog.js.map +1 -0
- package/lib/components/media/MediaToolbar.js +74 -0
- package/lib/components/media/MediaToolbar.js.map +1 -0
- package/lib/components/media/MediaWrapper.js +67 -0
- package/lib/components/media/MediaWrapper.js.map +1 -0
- package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js +84 -0
- package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js.map +1 -0
- package/lib/components/respArea/DragInTheBlank/choice.js +250 -0
- package/lib/components/respArea/DragInTheBlank/choice.js.map +1 -0
- package/lib/components/respArea/ExplicitConstructedResponse.js +136 -0
- package/lib/components/respArea/ExplicitConstructedResponse.js.map +1 -0
- package/lib/components/respArea/InlineDropdown.js +209 -0
- package/lib/components/respArea/InlineDropdown.js.map +1 -0
- package/lib/components/respArea/MathTemplated.js +130 -0
- package/lib/components/respArea/MathTemplated.js.map +1 -0
- package/lib/components/respArea/ToolbarIcon.js +81 -0
- package/lib/components/respArea/ToolbarIcon.js.map +1 -0
- package/lib/components/respArea/inlineDropdownUtils.js +67 -0
- package/lib/components/respArea/inlineDropdownUtils.js.map +1 -0
- package/lib/constants.js +11 -0
- package/lib/constants.js.map +1 -0
- package/lib/extensions/css.js +217 -0
- package/lib/extensions/css.js.map +1 -0
- package/lib/extensions/custom-toolbar-wrapper.js +92 -0
- package/lib/extensions/custom-toolbar-wrapper.js.map +1 -0
- package/lib/extensions/div-node.js +83 -0
- package/lib/extensions/div-node.js.map +1 -0
- package/lib/extensions/ensure-empty-root-div.js +48 -0
- package/lib/extensions/ensure-empty-root-div.js.map +1 -0
- package/lib/extensions/ensure-list-item-content-is-div.js +64 -0
- package/lib/extensions/ensure-list-item-content-is-div.js.map +1 -0
- package/lib/extensions/extended-list-item.js +15 -0
- package/lib/extensions/extended-list-item.js.map +1 -0
- package/lib/extensions/extended-table-cell.js +22 -0
- package/lib/extensions/extended-table-cell.js.map +1 -0
- package/lib/extensions/extended-table.js +75 -0
- package/lib/extensions/extended-table.js.map +1 -0
- package/lib/extensions/heading-paragraph.js +61 -0
- package/lib/extensions/heading-paragraph.js.map +1 -0
- package/lib/extensions/image-component.js +348 -0
- package/lib/extensions/image-component.js.map +1 -0
- package/lib/extensions/image.js +134 -0
- package/lib/extensions/image.js.map +1 -0
- package/lib/extensions/index.js +46 -0
- package/lib/extensions/index.js.map +1 -0
- package/lib/extensions/math.js +342 -0
- package/lib/extensions/math.js.map +1 -0
- package/lib/extensions/media.js +243 -0
- package/lib/extensions/media.js.map +1 -0
- package/lib/extensions/responseArea.js +446 -0
- package/lib/extensions/responseArea.js.map +1 -0
- package/lib/index.js +37 -0
- package/lib/index.js.map +1 -0
- package/lib/styles/editorContainerStyles.js +137 -0
- package/lib/styles/editorContainerStyles.js.map +1 -0
- package/lib/theme.js +8 -0
- package/lib/theme.js.map +1 -0
- package/lib/utils/helper.js +73 -0
- package/lib/utils/helper.js.map +1 -0
- package/lib/utils/size.js +26 -0
- package/lib/utils/size.js.map +1 -0
- package/package.json +24 -40
- package/src/__tests__/EditableHtml.test.jsx +554 -0
- package/src/__tests__/constants.test.js +19 -0
- package/src/__tests__/div-to-paragraph-conversion.test.jsx +125 -0
- package/src/__tests__/extensions.test.js +208 -0
- package/src/__tests__/index.test.jsx +154 -0
- package/src/__tests__/size-utils.test.js +64 -0
- package/src/__tests__/theme.test.js +17 -0
- package/src/components/CharacterPicker.jsx +207 -0
- package/src/components/EditableHtml.jsx +440 -0
- package/src/components/MenuBar.jsx +554 -0
- package/src/components/TiptapContainer.jsx +219 -0
- package/src/components/__tests__/AltDialog.test.jsx +147 -0
- package/src/components/__tests__/CharacterPicker.test.jsx +261 -0
- package/src/components/__tests__/CssIcon.test.jsx +46 -0
- package/src/components/__tests__/DragInTheBlank.test.jsx +255 -0
- package/src/components/__tests__/ExplicitConstructedResponse.test.jsx +204 -0
- package/src/components/__tests__/ImageToolbar.test.jsx +128 -0
- package/src/components/__tests__/InlineDropdown.test.jsx +388 -0
- package/src/components/__tests__/InsertImageHandler.test.js +161 -0
- package/src/components/__tests__/MediaDialog.test.jsx +293 -0
- package/src/components/__tests__/MediaToolbar.test.jsx +74 -0
- package/src/components/__tests__/MediaWrapper.test.jsx +81 -0
- package/src/components/__tests__/MenuBar.test.jsx +250 -0
- package/src/components/__tests__/RespArea.test.jsx +122 -0
- package/src/components/__tests__/TableIcons.test.jsx +149 -0
- package/src/components/__tests__/TextAlign.test.jsx +167 -0
- package/src/components/__tests__/TiptapContainer.test.jsx +138 -0
- package/src/components/__tests__/characterUtils.test.js +166 -0
- package/src/components/__tests__/choice.test.jsx +171 -0
- package/src/components/__tests__/custom-popper.test.jsx +82 -0
- package/src/components/__tests__/done-button.test.jsx +54 -0
- package/src/components/__tests__/toolbar-buttons.test.jsx +234 -0
- package/src/components/characters/characterUtils.js +447 -0
- package/src/components/characters/custom-popper.js +38 -0
- package/src/components/common/done-button.jsx +27 -0
- package/src/components/common/toolbar-buttons.jsx +122 -0
- package/src/components/icons/CssIcon.jsx +15 -0
- package/src/components/icons/RespArea.jsx +71 -0
- package/src/components/icons/TableIcons.jsx +52 -0
- package/src/components/icons/TextAlign.jsx +114 -0
- package/src/components/image/AltDialog.jsx +82 -0
- package/src/components/image/ImageToolbar.jsx +99 -0
- package/src/components/image/InsertImageHandler.js +107 -0
- package/src/components/media/MediaDialog.jsx +596 -0
- package/src/components/media/MediaToolbar.jsx +49 -0
- package/src/components/media/MediaWrapper.jsx +39 -0
- package/src/components/respArea/DragInTheBlank/DragInTheBlank.jsx +76 -0
- package/src/components/respArea/DragInTheBlank/choice.jsx +256 -0
- package/src/components/respArea/ExplicitConstructedResponse.jsx +135 -0
- package/src/components/respArea/InlineDropdown.jsx +220 -0
- package/src/components/respArea/MathTemplated.jsx +124 -0
- package/src/components/respArea/ToolbarIcon.jsx +66 -0
- package/src/components/respArea/__tests__/MathTemplated.test.jsx +210 -0
- package/src/components/respArea/inlineDropdownUtils.js +79 -0
- package/src/constants.js +5 -0
- package/src/extensions/__tests__/css.test.js +196 -0
- package/src/extensions/__tests__/custom-toolbar-wrapper.test.jsx +180 -0
- package/src/extensions/__tests__/divNode.test.js +87 -0
- package/src/extensions/__tests__/ensure-empty-root-div.test.js +57 -0
- package/src/extensions/__tests__/ensure-list-item-content-is-div.test.js +44 -0
- package/src/extensions/__tests__/extended-list-item.test.js +13 -0
- package/src/extensions/__tests__/extended-table-cell.test.js +22 -0
- package/src/extensions/__tests__/extended-table.test.js +183 -0
- package/src/extensions/__tests__/image-component.test.jsx +345 -0
- package/src/extensions/__tests__/image.test.js +237 -0
- package/src/extensions/__tests__/math.test.js +603 -0
- package/src/extensions/__tests__/media-node-view.test.jsx +298 -0
- package/src/extensions/__tests__/media.test.js +271 -0
- package/src/extensions/__tests__/responseArea.test.js +601 -0
- package/src/extensions/css.js +220 -0
- package/src/extensions/custom-toolbar-wrapper.jsx +78 -0
- package/src/extensions/div-node.js +86 -0
- package/src/extensions/ensure-empty-root-div.js +47 -0
- package/src/extensions/ensure-list-item-content-is-div.js +62 -0
- package/src/extensions/extended-list-item.js +10 -0
- package/src/extensions/extended-table-cell.js +19 -0
- package/src/extensions/extended-table.js +60 -0
- package/src/extensions/heading-paragraph.js +53 -0
- package/src/extensions/image-component.jsx +338 -0
- package/src/extensions/image.js +109 -0
- package/src/extensions/index.js +81 -0
- package/src/extensions/math.js +326 -0
- package/src/extensions/media.js +188 -0
- package/src/extensions/responseArea.js +401 -0
- package/src/index.jsx +5 -0
- package/src/styles/editorContainerStyles.js +145 -0
- package/src/theme.js +1 -0
- package/src/utils/__tests__/helper.test.js +126 -0
- package/src/utils/helper.js +69 -0
- package/src/utils/size.js +32 -0
- package/dist/components/CharacterPicker.d.ts +0 -31
- package/dist/components/CharacterPicker.js +0 -131
- package/dist/components/EditableHtml.d.ts +0 -11
- package/dist/components/EditableHtml.js +0 -291
- package/dist/components/MenuBar.d.ts +0 -11
- package/dist/components/MenuBar.js +0 -462
- package/dist/components/TiptapContainer.d.ts +0 -11
- package/dist/components/TiptapContainer.js +0 -154
- package/dist/components/characters/characterUtils.d.ts +0 -35
- package/dist/components/characters/characterUtils.js +0 -465
- package/dist/components/characters/custom-popper.d.ts +0 -14
- package/dist/components/characters/custom-popper.js +0 -32
- package/dist/components/common/done-button.d.ts +0 -30
- package/dist/components/common/done-button.js +0 -26
- package/dist/components/common/toolbar-buttons.d.ts +0 -38
- package/dist/components/common/toolbar-buttons.js +0 -91
- package/dist/components/icons/CssIcon.d.ts +0 -11
- package/dist/components/icons/CssIcon.js +0 -14
- package/dist/components/icons/RespArea.d.ts +0 -26
- package/dist/components/icons/RespArea.js +0 -42
- package/dist/components/icons/TableIcons.d.ts +0 -14
- package/dist/components/icons/TableIcons.js +0 -32
- package/dist/components/icons/TextAlign.d.ts +0 -18
- package/dist/components/icons/TextAlign.js +0 -134
- package/dist/components/image/AltDialog.d.ts +0 -22
- package/dist/components/image/AltDialog.js +0 -61
- package/dist/components/image/ImageToolbar.d.ts +0 -24
- package/dist/components/image/ImageToolbar.js +0 -80
- package/dist/components/image/InsertImageHandler.d.ts +0 -32
- package/dist/components/image/InsertImageHandler.js +0 -53
- package/dist/components/media/MediaDialog.d.ts +0 -43
- package/dist/components/media/MediaDialog.js +0 -389
- package/dist/components/media/MediaToolbar.d.ts +0 -19
- package/dist/components/media/MediaToolbar.js +0 -41
- package/dist/components/media/MediaWrapper.d.ts +0 -19
- package/dist/components/respArea/DragInTheBlank/DragInTheBlank.d.ts +0 -23
- package/dist/components/respArea/DragInTheBlank/DragInTheBlank.js +0 -58
- package/dist/components/respArea/DragInTheBlank/choice.d.ts +0 -56
- package/dist/components/respArea/DragInTheBlank/choice.js +0 -156
- package/dist/components/respArea/ExplicitConstructedResponse.d.ts +0 -20
- package/dist/components/respArea/ExplicitConstructedResponse.js +0 -83
- package/dist/components/respArea/InlineDropdown.d.ts +0 -18
- package/dist/components/respArea/InlineDropdown.js +0 -119
- package/dist/components/respArea/MathTemplated.d.ts +0 -19
- package/dist/components/respArea/MathTemplated.js +0 -97
- package/dist/components/respArea/ToolbarIcon.d.ts +0 -14
- package/dist/components/respArea/ToolbarIcon.js +0 -17
- package/dist/components/respArea/inlineDropdownUtils.d.ts +0 -15
- package/dist/components/respArea/inlineDropdownUtils.js +0 -15
- package/dist/constants.d.ts +0 -13
- package/dist/constants.js +0 -4
- package/dist/extensions/css.d.ts +0 -11
- package/dist/extensions/css.js +0 -115
- package/dist/extensions/custom-toolbar-wrapper.d.ts +0 -11
- package/dist/extensions/custom-toolbar-wrapper.js +0 -61
- package/dist/extensions/div-node.d.ts +0 -10
- package/dist/extensions/div-node.js +0 -42
- package/dist/extensions/ensure-empty-root-div.d.ts +0 -14
- package/dist/extensions/ensure-empty-root-div.js +0 -24
- package/dist/extensions/ensure-list-item-content-is-div.d.ts +0 -15
- package/dist/extensions/ensure-list-item-content-is-div.js +0 -31
- package/dist/extensions/extended-list-item.d.ts +0 -13
- package/dist/extensions/extended-list-item.js +0 -5
- package/dist/extensions/extended-table-cell.d.ts +0 -10
- package/dist/extensions/extended-table-cell.js +0 -6
- package/dist/extensions/extended-table.d.ts +0 -17
- package/dist/extensions/extended-table.js +0 -34
- package/dist/extensions/heading-paragraph.d.ts +0 -17
- package/dist/extensions/heading-paragraph.js +0 -30
- package/dist/extensions/image-component.d.ts +0 -22
- package/dist/extensions/image-component.js +0 -220
- package/dist/extensions/image.d.ts +0 -10
- package/dist/extensions/image.js +0 -68
- package/dist/extensions/index.d.ts +0 -16
- package/dist/extensions/index.js +0 -64
- package/dist/extensions/math.d.ts +0 -15
- package/dist/extensions/math.js +0 -158
- package/dist/extensions/media.d.ts +0 -19
- package/dist/extensions/media.js +0 -149
- package/dist/extensions/responseArea.d.ts +0 -27
- package/dist/extensions/responseArea.js +0 -259
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -7
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +0 -16
- package/dist/styles/editorContainerStyles.d.ts +0 -134
- package/dist/theme.d.ts +0 -9
- package/dist/utils/helper.d.ts +0 -9
- package/dist/utils/helper.js +0 -27
- package/dist/utils/size.d.ts +0 -9
- package/dist/utils/size.js +0 -14
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { fireEvent, render } from '@testing-library/react';
|
|
3
|
+
import { Button, MarkButton, RawButton, RawMarkButton } from '../common/toolbar-buttons';
|
|
4
|
+
|
|
5
|
+
describe('RawButton', () => {
|
|
6
|
+
it('renders without crashing', () => {
|
|
7
|
+
const { container } = render(<RawButton onClick={jest.fn()}>Click me</RawButton>);
|
|
8
|
+
expect(container).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('renders children', () => {
|
|
12
|
+
const { getByText } = render(<RawButton onClick={jest.fn()}>Test Button</RawButton>);
|
|
13
|
+
expect(getByText('Test Button')).toBeInTheDocument();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('calls onClick on mouse down', () => {
|
|
17
|
+
const onClick = jest.fn();
|
|
18
|
+
const { getByText } = render(<RawButton onClick={onClick}>Click</RawButton>);
|
|
19
|
+
fireEvent.mouseDown(getByText('Click'));
|
|
20
|
+
expect(onClick).toHaveBeenCalled();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('prevents default on mouse down', () => {
|
|
24
|
+
const onClick = jest.fn();
|
|
25
|
+
const { getByText } = render(<RawButton onClick={onClick}>Click</RawButton>);
|
|
26
|
+
const button = getByText('Click');
|
|
27
|
+
const event = new MouseEvent('mousedown', { bubbles: true, cancelable: true });
|
|
28
|
+
const preventDefaultSpy = jest.spyOn(event, 'preventDefault');
|
|
29
|
+
button.dispatchEvent(event);
|
|
30
|
+
expect(preventDefaultSpy).toHaveBeenCalled();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('calls onClick on Enter key press', () => {
|
|
34
|
+
const onClick = jest.fn();
|
|
35
|
+
const { getByText } = render(<RawButton onClick={onClick}>Click</RawButton>);
|
|
36
|
+
fireEvent.keyDown(getByText('Click'), { key: 'Enter' });
|
|
37
|
+
expect(onClick).toHaveBeenCalled();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('calls onClick on Space key press', () => {
|
|
41
|
+
const onClick = jest.fn();
|
|
42
|
+
const { getByText } = render(<RawButton onClick={onClick}>Click</RawButton>);
|
|
43
|
+
fireEvent.keyDown(getByText('Click'), { key: ' ' });
|
|
44
|
+
expect(onClick).toHaveBeenCalled();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('does not call onClick on other key press', () => {
|
|
48
|
+
const onClick = jest.fn();
|
|
49
|
+
const { getByText } = render(<RawButton onClick={onClick}>Click</RawButton>);
|
|
50
|
+
fireEvent.keyDown(getByText('Click'), { key: 'a' });
|
|
51
|
+
expect(onClick).not.toHaveBeenCalled();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('applies active style when active is true', () => {
|
|
55
|
+
const { getByText } = render(
|
|
56
|
+
<RawButton onClick={jest.fn()} active={true}>
|
|
57
|
+
Active
|
|
58
|
+
</RawButton>,
|
|
59
|
+
);
|
|
60
|
+
const button = getByText('Active');
|
|
61
|
+
expect(button).toHaveStyle({ color: 'black' });
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('applies disabled style when disabled is true', () => {
|
|
65
|
+
const { getByText } = render(
|
|
66
|
+
<RawButton onClick={jest.fn()} disabled={true}>
|
|
67
|
+
Disabled
|
|
68
|
+
</RawButton>,
|
|
69
|
+
);
|
|
70
|
+
const button = getByText('Disabled');
|
|
71
|
+
expect(button).toHaveStyle({ cursor: 'not-allowed' });
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('applies extraStyles when provided', () => {
|
|
75
|
+
const extraStyles = { backgroundColor: 'red' };
|
|
76
|
+
const { getByText } = render(
|
|
77
|
+
<RawButton onClick={jest.fn()} extraStyles={extraStyles}>
|
|
78
|
+
Styled
|
|
79
|
+
</RawButton>,
|
|
80
|
+
);
|
|
81
|
+
const button = getByText('Styled');
|
|
82
|
+
expect(button).toHaveStyle({ backgroundColor: 'red' });
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('has aria-label when provided', () => {
|
|
86
|
+
const { getByLabelText } = render(
|
|
87
|
+
<RawButton onClick={jest.fn()} ariaLabel="Test Button">
|
|
88
|
+
Button
|
|
89
|
+
</RawButton>,
|
|
90
|
+
);
|
|
91
|
+
expect(getByLabelText('Test Button')).toBeInTheDocument();
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('has aria-pressed attribute', () => {
|
|
95
|
+
const { getByText } = render(
|
|
96
|
+
<RawButton onClick={jest.fn()} active={true}>
|
|
97
|
+
Button
|
|
98
|
+
</RawButton>,
|
|
99
|
+
);
|
|
100
|
+
expect(getByText('Button')).toHaveAttribute('aria-pressed', 'true');
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('is focusable with tabIndex', () => {
|
|
104
|
+
const { getByText } = render(<RawButton onClick={jest.fn()}>Button</RawButton>);
|
|
105
|
+
expect(getByText('Button')).toHaveAttribute('tabIndex', '0');
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
describe('Button', () => {
|
|
110
|
+
it('is the same as RawButton', () => {
|
|
111
|
+
expect(Button).toBe(RawButton);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
describe('RawMarkButton', () => {
|
|
116
|
+
it('renders without crashing', () => {
|
|
117
|
+
const { container } = render(
|
|
118
|
+
<RawMarkButton onToggle={jest.fn()} mark="bold" label="Bold">
|
|
119
|
+
B
|
|
120
|
+
</RawMarkButton>,
|
|
121
|
+
);
|
|
122
|
+
expect(container).toBeInTheDocument();
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('renders children', () => {
|
|
126
|
+
const { getByText } = render(
|
|
127
|
+
<RawMarkButton onToggle={jest.fn()} mark="bold" label="Bold">
|
|
128
|
+
Bold
|
|
129
|
+
</RawMarkButton>,
|
|
130
|
+
);
|
|
131
|
+
expect(getByText('Bold')).toBeInTheDocument();
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('calls onToggle with mark on mouse down', () => {
|
|
135
|
+
const onToggle = jest.fn();
|
|
136
|
+
const { getByText } = render(
|
|
137
|
+
<RawMarkButton onToggle={onToggle} mark="italic" label="Italic">
|
|
138
|
+
I
|
|
139
|
+
</RawMarkButton>,
|
|
140
|
+
);
|
|
141
|
+
fireEvent.mouseDown(getByText('I'));
|
|
142
|
+
expect(onToggle).toHaveBeenCalledWith('italic');
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('prevents default on mouse down', () => {
|
|
146
|
+
const onToggle = jest.fn();
|
|
147
|
+
const { getByText } = render(
|
|
148
|
+
<RawMarkButton onToggle={onToggle} mark="bold" label="Bold">
|
|
149
|
+
B
|
|
150
|
+
</RawMarkButton>,
|
|
151
|
+
);
|
|
152
|
+
const button = getByText('B');
|
|
153
|
+
const event = new MouseEvent('mousedown', { bubbles: true, cancelable: true });
|
|
154
|
+
const preventDefaultSpy = jest.spyOn(event, 'preventDefault');
|
|
155
|
+
button.dispatchEvent(event);
|
|
156
|
+
expect(preventDefaultSpy).toHaveBeenCalled();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it('calls onToggle on Enter key press', () => {
|
|
160
|
+
const onToggle = jest.fn();
|
|
161
|
+
const { getByText } = render(
|
|
162
|
+
<RawMarkButton onToggle={onToggle} mark="underline" label="Underline">
|
|
163
|
+
U
|
|
164
|
+
</RawMarkButton>,
|
|
165
|
+
);
|
|
166
|
+
fireEvent.keyDown(getByText('U'), { key: 'Enter' });
|
|
167
|
+
expect(onToggle).toHaveBeenCalledWith('underline');
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
it('calls onToggle on Space key press', () => {
|
|
171
|
+
const onToggle = jest.fn();
|
|
172
|
+
const { getByText } = render(
|
|
173
|
+
<RawMarkButton onToggle={onToggle} mark="strike" label="Strike">
|
|
174
|
+
S
|
|
175
|
+
</RawMarkButton>,
|
|
176
|
+
);
|
|
177
|
+
fireEvent.keyDown(getByText('S'), { key: ' ' });
|
|
178
|
+
expect(onToggle).toHaveBeenCalledWith('strike');
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it('does not call onToggle on other key press', () => {
|
|
182
|
+
const onToggle = jest.fn();
|
|
183
|
+
const { getByText } = render(
|
|
184
|
+
<RawMarkButton onToggle={onToggle} mark="bold" label="Bold">
|
|
185
|
+
B
|
|
186
|
+
</RawMarkButton>,
|
|
187
|
+
);
|
|
188
|
+
fireEvent.keyDown(getByText('B'), { key: 'a' });
|
|
189
|
+
expect(onToggle).not.toHaveBeenCalled();
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
it('applies active style when active is true', () => {
|
|
193
|
+
const { getByText } = render(
|
|
194
|
+
<RawMarkButton onToggle={jest.fn()} mark="bold" label="Bold" active={true}>
|
|
195
|
+
B
|
|
196
|
+
</RawMarkButton>,
|
|
197
|
+
);
|
|
198
|
+
const button = getByText('B');
|
|
199
|
+
expect(button).toHaveStyle({ color: 'black' });
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
it('has aria-label from label prop', () => {
|
|
203
|
+
const { getByLabelText } = render(
|
|
204
|
+
<RawMarkButton onToggle={jest.fn()} mark="bold" label="Toggle Bold">
|
|
205
|
+
B
|
|
206
|
+
</RawMarkButton>,
|
|
207
|
+
);
|
|
208
|
+
expect(getByLabelText('Toggle Bold')).toBeInTheDocument();
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it('has aria-pressed attribute', () => {
|
|
212
|
+
const { getByText } = render(
|
|
213
|
+
<RawMarkButton onToggle={jest.fn()} mark="bold" label="Bold" active={true}>
|
|
214
|
+
B
|
|
215
|
+
</RawMarkButton>,
|
|
216
|
+
);
|
|
217
|
+
expect(getByText('B')).toHaveAttribute('aria-pressed', 'true');
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
it('is focusable with tabIndex', () => {
|
|
221
|
+
const { getByText } = render(
|
|
222
|
+
<RawMarkButton onToggle={jest.fn()} mark="bold" label="Bold">
|
|
223
|
+
B
|
|
224
|
+
</RawMarkButton>,
|
|
225
|
+
);
|
|
226
|
+
expect(getByText('B')).toHaveAttribute('tabIndex', '0');
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
describe('MarkButton', () => {
|
|
231
|
+
it('is the same as RawMarkButton', () => {
|
|
232
|
+
expect(MarkButton).toBe(RawMarkButton);
|
|
233
|
+
});
|
|
234
|
+
});
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
export const spanishConfig = {
|
|
2
|
+
characters: [
|
|
3
|
+
['á', 'é', 'í', 'ó', 'ú'],
|
|
4
|
+
['Á', 'É', 'Í', 'Ó', 'Ú'],
|
|
5
|
+
['—', '«', '»', 'ñ', 'ü'],
|
|
6
|
+
['-', '¿', '¡', 'Ñ', 'Ü'],
|
|
7
|
+
],
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const specialConfig = {
|
|
11
|
+
hasPreview: true,
|
|
12
|
+
characters: [
|
|
13
|
+
[
|
|
14
|
+
{
|
|
15
|
+
unicode: 'U+00A2',
|
|
16
|
+
description: 'CENT SIGN',
|
|
17
|
+
write: '¢',
|
|
18
|
+
label: '¢',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
unicode: 'U+00BF',
|
|
22
|
+
description: 'INVERTED QUESTION MARK',
|
|
23
|
+
write: '¿',
|
|
24
|
+
label: '¿',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
unicode: 'U+00B4',
|
|
28
|
+
description: 'ACUTE ACCENT',
|
|
29
|
+
write: '´',
|
|
30
|
+
label: '´',
|
|
31
|
+
extraProps: { style: { gridRow: 'span 2' } },
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
unicode: 'U+00E1',
|
|
35
|
+
description: 'LATIN SMALL LETTER A WITH ACUTE',
|
|
36
|
+
write: 'á',
|
|
37
|
+
label: 'á',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
unicode: 'U+00E9',
|
|
41
|
+
description: 'LATIN SMALL LETTER E WITH ACUTE',
|
|
42
|
+
write: 'é',
|
|
43
|
+
label: 'é',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
unicode: 'U+00ED',
|
|
47
|
+
description: 'LATIN SMALL LETTER I WITH ACUTE',
|
|
48
|
+
write: 'í',
|
|
49
|
+
label: 'í',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
unicode: 'U+00F3',
|
|
53
|
+
description: 'LATIN SMALL LETTER O WITH ACUTE',
|
|
54
|
+
write: 'ó',
|
|
55
|
+
label: 'ó',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
unicode: 'U+00FA',
|
|
59
|
+
description: 'LATIN SMALL LETTER U WITH ACUTE',
|
|
60
|
+
write: 'ú',
|
|
61
|
+
label: 'ú',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
unicode: 'U+00F1',
|
|
65
|
+
description: 'LATIN SMALL LETTER N WITH TILDE',
|
|
66
|
+
write: 'ñ',
|
|
67
|
+
label: 'ñ',
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
{
|
|
72
|
+
unicode: 'U+20AC',
|
|
73
|
+
description: 'EURO SIGN',
|
|
74
|
+
write: '€',
|
|
75
|
+
label: '€',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
unicode: 'U+00A1',
|
|
79
|
+
description: 'INVERTED EXCLAMATION MARK',
|
|
80
|
+
write: '¡',
|
|
81
|
+
label: '¡',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
unicode: 'U+00C1',
|
|
85
|
+
description: 'LATIN CAPITAL LETTER A WITH ACUTE',
|
|
86
|
+
write: 'Á',
|
|
87
|
+
label: 'Á',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
unicode: 'U+00C9',
|
|
91
|
+
description: 'LATIN CAPITAL LETTER E WITH ACUTE',
|
|
92
|
+
write: 'É',
|
|
93
|
+
label: 'É',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
unicode: 'U+00CD',
|
|
97
|
+
description: 'LATIN CAPITAL LETTER I WITH ACUTE',
|
|
98
|
+
write: 'Í',
|
|
99
|
+
label: 'Í',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
unicode: 'U+00D3',
|
|
103
|
+
description: 'LATIN CAPITAL LETTER O WITH ACUTE',
|
|
104
|
+
write: 'Ó',
|
|
105
|
+
label: 'Ó',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
unicode: 'U+00DA',
|
|
109
|
+
description: 'LATIN CAPITAL LETTER U WITH ACUTE',
|
|
110
|
+
write: 'Ú',
|
|
111
|
+
label: 'Ú',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
unicode: 'U+00D1',
|
|
115
|
+
description: 'LATIN CAPITAL LETTER N WITH TILDE',
|
|
116
|
+
write: 'Ñ',
|
|
117
|
+
label: 'Ñ',
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
[
|
|
121
|
+
{
|
|
122
|
+
unicode: 'U+00A3',
|
|
123
|
+
description: 'POUND SIGN',
|
|
124
|
+
write: '£',
|
|
125
|
+
label: '£',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
unicode: 'U+00AB',
|
|
129
|
+
description: 'LEFT-POINTING DOUBLE ANGLE QUOTATION MARK',
|
|
130
|
+
write: '«',
|
|
131
|
+
label: '«',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
unicode: 'U+005E',
|
|
135
|
+
description: 'CIRCUMFLEX ACCENT',
|
|
136
|
+
write: '^',
|
|
137
|
+
label: '^',
|
|
138
|
+
extraProps: { style: { gridRow: 'span 2' } },
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
unicode: 'U+00E2',
|
|
142
|
+
description: 'LATIN SMALL LETTER A WITH CIRCUMFLEX',
|
|
143
|
+
write: 'â',
|
|
144
|
+
label: 'â',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
unicode: 'U+00EA',
|
|
148
|
+
description: 'LATIN SMALL LETTER E WITH CIRCUMFLEX',
|
|
149
|
+
write: 'ê',
|
|
150
|
+
label: 'ê',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
unicode: 'U+00EE',
|
|
154
|
+
description: 'LATIN SMALL LETTER I WITH CIRCUMFLEX',
|
|
155
|
+
write: 'î',
|
|
156
|
+
label: 'î',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
unicode: 'U+00F4',
|
|
160
|
+
description: 'LATIN SMALL LETTER O WITH CIRCUMFLEX',
|
|
161
|
+
write: 'ô',
|
|
162
|
+
label: 'ô',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
unicode: 'U+00FB',
|
|
166
|
+
description: 'LATIN SMALL LETTER U WITH CIRCUMFLEX',
|
|
167
|
+
write: 'û',
|
|
168
|
+
label: 'û',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
unicode: 'U+00E7',
|
|
172
|
+
description: 'LATIN SMALL LETTER C WITH CEDILLA',
|
|
173
|
+
write: 'ç',
|
|
174
|
+
label: 'ç',
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
[
|
|
178
|
+
{
|
|
179
|
+
unicode: 'U+00A5',
|
|
180
|
+
description: 'YEN SIGN',
|
|
181
|
+
write: '¥',
|
|
182
|
+
label: '¥',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
unicode: 'U+00BB',
|
|
186
|
+
description: 'RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK',
|
|
187
|
+
write: '»',
|
|
188
|
+
label: '»',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
unicode: 'U+00C2',
|
|
192
|
+
description: 'LATIN CAPITAL LETTER A WITH CIRCUMFLEX',
|
|
193
|
+
write: 'Â',
|
|
194
|
+
label: 'Â',
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
unicode: 'U+00CA',
|
|
198
|
+
description: 'LATIN CAPITAL LETTER E WITH CIRCUMFLEX',
|
|
199
|
+
write: 'Ê',
|
|
200
|
+
label: 'Ê',
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
unicode: 'U+00CE',
|
|
204
|
+
description: 'LATIN CAPITAL LETTER I WITH CIRCUMFLEX',
|
|
205
|
+
write: 'Î',
|
|
206
|
+
label: 'Î',
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
unicode: 'U+00D4',
|
|
210
|
+
description: 'LATIN CAPITAL LETTER O WITH CIRCUMFLEX',
|
|
211
|
+
write: 'Ô',
|
|
212
|
+
label: 'Ô',
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
unicode: 'U+00DB',
|
|
216
|
+
description: 'LATIN CAPITAL LETTER U WITH CIRCUMFLEX',
|
|
217
|
+
write: 'Û',
|
|
218
|
+
label: 'Û',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
unicode: 'U+00C7',
|
|
222
|
+
description: 'LATIN CAPITAL LETTER C WITH CEDILLA',
|
|
223
|
+
write: 'Ç',
|
|
224
|
+
label: 'Ç',
|
|
225
|
+
},
|
|
226
|
+
],
|
|
227
|
+
[
|
|
228
|
+
{
|
|
229
|
+
unicode: 'U+200A',
|
|
230
|
+
description: 'HAIR SPACE',
|
|
231
|
+
write: String.fromCodePoint('0x200A'),
|
|
232
|
+
label: ' ',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
unicode: 'U+00A7',
|
|
236
|
+
description: 'SECTION SIGN',
|
|
237
|
+
write: '§',
|
|
238
|
+
label: '§',
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
unicode: 'U+00A8',
|
|
242
|
+
description: 'DIAERESIS',
|
|
243
|
+
write: '¨',
|
|
244
|
+
label: '¨',
|
|
245
|
+
extraProps: { style: { gridRow: 'span 2' } },
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
unicode: 'U+00E4',
|
|
249
|
+
description: 'LATIN SMALL LETTER A WITH DIAERESIS',
|
|
250
|
+
write: 'ä',
|
|
251
|
+
label: 'ä',
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
unicode: 'U+00EB',
|
|
255
|
+
description: 'LATIN SMALL LETTER E WITH DIAERESIS',
|
|
256
|
+
write: 'ë',
|
|
257
|
+
label: 'ë',
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
unicode: 'U+00EF',
|
|
261
|
+
description: 'LATIN SMALL LETTER I WITH DIAERESIS',
|
|
262
|
+
write: 'ï',
|
|
263
|
+
label: 'ï',
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
unicode: 'U+00F6',
|
|
267
|
+
description: 'LATIN SMALL LETTER O WITH DIAERESIS',
|
|
268
|
+
write: 'ö',
|
|
269
|
+
label: 'ö',
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
unicode: 'U+00FC',
|
|
273
|
+
description: 'LATIN SMALL LETTER U WITH DIAERESIS',
|
|
274
|
+
write: 'ü',
|
|
275
|
+
label: 'ü',
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
unicode: 'U+00DF',
|
|
279
|
+
description: 'LATIN SMALL LETTER SHARP S',
|
|
280
|
+
write: 'ß',
|
|
281
|
+
label: 'ß',
|
|
282
|
+
},
|
|
283
|
+
],
|
|
284
|
+
[
|
|
285
|
+
{
|
|
286
|
+
unicode: 'U+2009',
|
|
287
|
+
description: 'THIN SPACE',
|
|
288
|
+
write: String.fromCodePoint('0x2009'),
|
|
289
|
+
label: ' ',
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
unicode: 'U+2026',
|
|
293
|
+
description: 'HORIZONTAL ELLIPSIS',
|
|
294
|
+
write: '…',
|
|
295
|
+
label: '…',
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
unicode: 'U+00C4',
|
|
299
|
+
description: 'LATIN CAPITAL LETTER A WITH DIAERESIS',
|
|
300
|
+
write: 'Ä',
|
|
301
|
+
label: 'Ä',
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
unicode: 'U+00CB',
|
|
305
|
+
description: 'LATIN CAPITAL LETTER E WITH DIAERESIS',
|
|
306
|
+
write: 'Ë',
|
|
307
|
+
label: 'Ë',
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
unicode: 'U+00CF',
|
|
311
|
+
description: 'LATIN CAPITAL LETTER I WITH DIAERESIS',
|
|
312
|
+
write: 'Ï',
|
|
313
|
+
label: 'Ï',
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
unicode: 'U+00D6',
|
|
317
|
+
description: 'LATIN CAPITAL LETTER O WITH DIAERESIS',
|
|
318
|
+
write: 'Ö',
|
|
319
|
+
label: 'Ö',
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
unicode: 'U+00DC',
|
|
323
|
+
description: 'LATIN CAPITAL LETTER U WITH DIAERESIS',
|
|
324
|
+
write: 'Ü',
|
|
325
|
+
label: 'Ü',
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
unicode: 'U+2212',
|
|
329
|
+
description: 'MINUS SIGN',
|
|
330
|
+
write: '−',
|
|
331
|
+
label: '−',
|
|
332
|
+
},
|
|
333
|
+
],
|
|
334
|
+
[
|
|
335
|
+
{
|
|
336
|
+
unicode: 'U+00A0',
|
|
337
|
+
description: 'NO-BREAK SPACE',
|
|
338
|
+
write: String.fromCodePoint('0x00A0'),
|
|
339
|
+
label: ' ',
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
unicode: 'U+2022',
|
|
343
|
+
description: 'BULLET',
|
|
344
|
+
write: '•',
|
|
345
|
+
label: '•',
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
unicode: 'U+0060',
|
|
349
|
+
description: 'GRAVE ACCENT',
|
|
350
|
+
write: '`',
|
|
351
|
+
label: '`',
|
|
352
|
+
extraProps: { style: { gridRow: 'span 2' } },
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
unicode: 'U+00E0',
|
|
356
|
+
description: 'LATIN SMALL LETTER A WITH GRAVE',
|
|
357
|
+
write: 'à',
|
|
358
|
+
label: 'à',
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
unicode: 'U+00E8',
|
|
362
|
+
description: 'LATIN SMALL LETTER E WITH GRAVE',
|
|
363
|
+
write: 'è',
|
|
364
|
+
label: 'è',
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
unicode: 'U+00EC',
|
|
368
|
+
description: 'LATIN SMALL LETTER I WITH GRAVE',
|
|
369
|
+
write: 'ì',
|
|
370
|
+
label: 'ì',
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
unicode: 'U+00F2',
|
|
374
|
+
description: 'LATIN SMALL LETTER O WITH GRAVE',
|
|
375
|
+
write: 'ò',
|
|
376
|
+
label: 'ò',
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
unicode: 'U+00F9',
|
|
380
|
+
description: 'LATIN SMALL LETTER U WITH GRAVE',
|
|
381
|
+
write: 'ù',
|
|
382
|
+
label: 'ù',
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
unicode: 'U+2013',
|
|
386
|
+
description: 'EN DASH',
|
|
387
|
+
write: '–',
|
|
388
|
+
label: '–',
|
|
389
|
+
},
|
|
390
|
+
],
|
|
391
|
+
[
|
|
392
|
+
{
|
|
393
|
+
unicode: 'U+2003',
|
|
394
|
+
description: 'EM SPACE',
|
|
395
|
+
write: String.fromCodePoint('0x2003'),
|
|
396
|
+
label: ' ',
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
unicode: 'U+25E6',
|
|
400
|
+
description: 'WHITE BULLET',
|
|
401
|
+
write: '◦',
|
|
402
|
+
label: '◦',
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
unicode: 'U+00C0',
|
|
406
|
+
description: 'LATIN CAPITAL LETTER A WITH GRAVE',
|
|
407
|
+
write: 'À',
|
|
408
|
+
label: 'À',
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
unicode: 'U+00C8',
|
|
412
|
+
description: 'LATIN CAPITAL LETTER E WITH GRAVE',
|
|
413
|
+
write: 'È',
|
|
414
|
+
label: 'È',
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
unicode: 'U+00CC',
|
|
418
|
+
description: 'LATIN CAPITAL LETTER I WITH GRAVE',
|
|
419
|
+
write: 'Ì',
|
|
420
|
+
label: 'Ì',
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
unicode: 'U+00D2',
|
|
424
|
+
description: 'LATIN CAPITAL LETTER O WITH GRAVE',
|
|
425
|
+
write: 'Ò',
|
|
426
|
+
label: 'Ò',
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
unicode: 'U+00D9',
|
|
430
|
+
description: 'LATIN CAPITAL LETTER U WITH GRAVE',
|
|
431
|
+
write: 'Ù',
|
|
432
|
+
label: 'Ù',
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
unicode: 'U+2014',
|
|
436
|
+
description: 'EM DASH',
|
|
437
|
+
write: '—',
|
|
438
|
+
label: '—',
|
|
439
|
+
},
|
|
440
|
+
],
|
|
441
|
+
],
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
export const characterIcons = {
|
|
445
|
+
spanish: 'ñ',
|
|
446
|
+
special: '€',
|
|
447
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
import Popper from '@mui/material/Popper';
|
|
4
|
+
import Typography from '@mui/material/Typography';
|
|
5
|
+
|
|
6
|
+
const StyledPopper = styled(Popper)({
|
|
7
|
+
background: '#fff',
|
|
8
|
+
padding: '10px',
|
|
9
|
+
pointerEvents: 'none',
|
|
10
|
+
zIndex: 99999,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const StyledTypography = styled(Typography)({
|
|
14
|
+
fontSize: 50,
|
|
15
|
+
textAlign: 'center',
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const CustomPopper = ({ children, ...props }) => (
|
|
19
|
+
<StyledPopper
|
|
20
|
+
id="mouse-over-popover"
|
|
21
|
+
open
|
|
22
|
+
anchorOrigin={{
|
|
23
|
+
vertical: 'bottom',
|
|
24
|
+
horizontal: 'left',
|
|
25
|
+
}}
|
|
26
|
+
transformOrigin={{
|
|
27
|
+
vertical: 'top',
|
|
28
|
+
horizontal: 'left',
|
|
29
|
+
}}
|
|
30
|
+
disableRestoreFocus
|
|
31
|
+
disableAutoFocus
|
|
32
|
+
{...props}
|
|
33
|
+
>
|
|
34
|
+
<StyledTypography>{children}</StyledTypography>
|
|
35
|
+
</StyledPopper>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export default CustomPopper;
|