@atlaskit/editor-toolbar 0.3.5 → 0.3.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/CHANGELOG.md +17 -0
- package/dist/types/hooks/ui-context.d.ts +5 -5
- package/dist/types/ui/ColorPalette/types.d.ts +30 -30
- package/dist/types/ui/ToolbarButton.d.ts +5 -5
- package/dist/types/ui/ToolbarDropdownItem.d.ts +9 -9
- package/dist/types/ui/ToolbarDropdownMenu.d.ts +4 -4
- package/dist/types/ui/ToolbarDropdownMenuContext.d.ts +1 -1
- package/dist/types/ui/ToolbarNestedDropdownMenu.d.ts +3 -3
- package/dist/types/ui/ToolbarSection.d.ts +1 -1
- package/dist/types/ui/ToolbarTooltip.d.ts +1 -1
- package/dist/types-ts4.5/hooks/ui-context.d.ts +5 -5
- package/dist/types-ts4.5/ui/ColorPalette/types.d.ts +30 -30
- package/dist/types-ts4.5/ui/ToolbarButton.d.ts +5 -5
- package/dist/types-ts4.5/ui/ToolbarDropdownItem.d.ts +9 -9
- package/dist/types-ts4.5/ui/ToolbarDropdownMenu.d.ts +4 -4
- package/dist/types-ts4.5/ui/ToolbarDropdownMenuContext.d.ts +1 -1
- package/dist/types-ts4.5/ui/ToolbarNestedDropdownMenu.d.ts +3 -3
- package/dist/types-ts4.5/ui/ToolbarSection.d.ts +1 -1
- package/dist/types-ts4.5/ui/ToolbarTooltip.d.ts +1 -1
- package/package.json +1 -2
- package/afm-cc/tsconfig.json +0 -54
- package/afm-dev-agents/tsconfig.json +0 -54
- package/afm-jira/tsconfig.json +0 -54
- package/afm-passionfruit/tsconfig.json +0 -54
- package/afm-post-office/tsconfig.json +0 -54
- package/afm-rovo-extension/tsconfig.json +0 -54
- package/afm-townsquare/tsconfig.json +0 -54
- package/afm-volt/tsconfig.json +0 -54
- package/build/tsconfig.json +0 -17
- package/examples/basic.tsx +0 -3
- package/examples/config.jsonc +0 -8
- package/examples/toolbar/examples/ExampleManuallyComposedToolbar.tsx +0 -638
- package/examples/toolbar/examples/useExampleToolbarState.tsx +0 -86
- package/examples/toolbar-ui.tsx +0 -26
- package/src/hooks/ui-context.tsx +0 -63
- package/src/index.ts +0 -74
- package/src/types.ts +0 -3
- package/src/ui/ColorPalette/Color.tsx +0 -118
- package/src/ui/ColorPalette/getColorMessage.ts +0 -27
- package/src/ui/ColorPalette/index.tsx +0 -125
- package/src/ui/ColorPalette/types.ts +0 -96
- package/src/ui/ColorPalette/utils.ts +0 -102
- package/src/ui/Toolbar.tsx +0 -57
- package/src/ui/ToolbarButton.tsx +0 -120
- package/src/ui/ToolbarButtonGroup.tsx +0 -57
- package/src/ui/ToolbarColorSwatch.tsx +0 -37
- package/src/ui/ToolbarDropdownItem.tsx +0 -142
- package/src/ui/ToolbarDropdownItemSection.tsx +0 -21
- package/src/ui/ToolbarDropdownMenu.tsx +0 -112
- package/src/ui/ToolbarDropdownMenuContext.tsx +0 -44
- package/src/ui/ToolbarKeyboardShortcutHint.tsx +0 -11
- package/src/ui/ToolbarNestedDropdownMenu.tsx +0 -45
- package/src/ui/ToolbarSection.tsx +0 -44
- package/src/ui/ToolbarTooltip.tsx +0 -18
- package/src/ui/icons/AIAdjustLengthIcon.tsx +0 -2
- package/src/ui/icons/AICasualIcon.tsx +0 -2
- package/src/ui/icons/AIChangeToneIcon.tsx +0 -2
- package/src/ui/icons/AIChatIcon.tsx +0 -50
- package/src/ui/icons/AICommandIcon.tsx +0 -2
- package/src/ui/icons/AIHeartIcon.tsx +0 -2
- package/src/ui/icons/AILengthenIcon.tsx +0 -2
- package/src/ui/icons/AIProfessionalIcon.tsx +0 -2
- package/src/ui/icons/AIShortenIcon.tsx +0 -2
- package/src/ui/icons/AISpellcheckIcon.tsx +0 -2
- package/src/ui/icons/AISummarizeIcon.tsx +0 -2
- package/src/ui/icons/AITranslateIcon.tsx +0 -2
- package/src/ui/icons/AddIcon.tsx +0 -2
- package/src/ui/icons/AlignTextCenterIcon.tsx +0 -2
- package/src/ui/icons/AlignTextLeftIcon.tsx +0 -2
- package/src/ui/icons/AlignTextRightIcon.tsx +0 -2
- package/src/ui/icons/AppsIcon.tsx +0 -2
- package/src/ui/icons/BoldIcon.tsx +0 -2
- package/src/ui/icons/ClearFormattingIcon.tsx +0 -2
- package/src/ui/icons/CodeIcon.tsx +0 -2
- package/src/ui/icons/CommentIcon.tsx +0 -2
- package/src/ui/icons/EmojiIcon.tsx +0 -2
- package/src/ui/icons/HeadingFiveIcon.tsx +0 -2
- package/src/ui/icons/HeadingFourIcon.tsx +0 -2
- package/src/ui/icons/HeadingOneIcon.tsx +0 -2
- package/src/ui/icons/HeadingSixIcon.tsx +0 -2
- package/src/ui/icons/HeadingThreeIcon.tsx +0 -2
- package/src/ui/icons/HeadingTwoIcon.tsx +0 -2
- package/src/ui/icons/HistoryIcon.tsx +0 -2
- package/src/ui/icons/ImageIcon.tsx +0 -2
- package/src/ui/icons/IndentIcon.tsx +0 -2
- package/src/ui/icons/ItalicIcon.tsx +0 -2
- package/src/ui/icons/LayoutIcon.tsx +0 -2
- package/src/ui/icons/LinkIcon.tsx +0 -2
- package/src/ui/icons/ListBulletedIcon.tsx +0 -2
- package/src/ui/icons/ListNumberedIcon.tsx +0 -2
- package/src/ui/icons/MentionIcon.tsx +0 -2
- package/src/ui/icons/MoreItemsIcon.tsx +0 -22
- package/src/ui/icons/NestedDropdownRightIcon.tsx +0 -22
- package/src/ui/icons/OutdentIcon.tsx +0 -2
- package/src/ui/icons/PinIcon.tsx +0 -2
- package/src/ui/icons/PinnedIcon.tsx +0 -2
- package/src/ui/icons/QuoteIcon.tsx +0 -2
- package/src/ui/icons/RedoIcon.tsx +0 -2
- package/src/ui/icons/ShowMoreHorizontal.tsx +0 -22
- package/src/ui/icons/StrikeThroughIcon.tsx +0 -2
- package/src/ui/icons/SubscriptIcon.tsx +0 -31
- package/src/ui/icons/SuperscriptIcon.tsx +0 -31
- package/src/ui/icons/TableIcon.tsx +0 -2
- package/src/ui/icons/TaskIcon.tsx +0 -2
- package/src/ui/icons/TextColorIcon.tsx +0 -43
- package/src/ui/icons/TextIcon.tsx +0 -2
- package/src/ui/icons/UnderlineIcon.tsx +0 -2
- package/src/ui/icons/UndoIcon.tsx +0 -2
- package/tsconfig.app.json +0 -65
- package/tsconfig.dev.json +0 -56
- package/tsconfig.json +0 -18
|
@@ -1,638 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import { cssMap } from '@atlaskit/css';
|
|
4
|
-
import { Box } from '@atlaskit/primitives/compiled';
|
|
5
|
-
import Toggle from '@atlaskit/toggle';
|
|
6
|
-
import { token } from '@atlaskit/tokens';
|
|
7
|
-
import { type IconColor } from '@atlaskit/tokens/css-type-schema';
|
|
8
|
-
|
|
9
|
-
import { AddIcon } from '../../../src/ui/icons/AddIcon';
|
|
10
|
-
import { AIAdjustLengthIcon } from '../../../src/ui/icons/AIAdjustLengthIcon';
|
|
11
|
-
import { AICasualIcon } from '../../../src/ui/icons/AICasualIcon';
|
|
12
|
-
import { AIChangeToneIcon } from '../../../src/ui/icons/AIChangeToneIcon';
|
|
13
|
-
import { AIChatIcon } from '../../../src/ui/icons/AIChatIcon';
|
|
14
|
-
import { AICommandIcon } from '../../../src/ui/icons/AICommandIcon';
|
|
15
|
-
import { AIHeartIcon } from '../../../src/ui/icons/AIHeartIcon';
|
|
16
|
-
import { AILengthenIcon } from '../../../src/ui/icons/AILengthenIcon';
|
|
17
|
-
import { AIBriefcaseIcon } from '../../../src/ui/icons/AIProfessionalIcon';
|
|
18
|
-
import { AIShortenIcon } from '../../../src/ui/icons/AIShortenIcon';
|
|
19
|
-
import { AISpellcheckIcon } from '../../../src/ui/icons/AISpellcheckIcon';
|
|
20
|
-
import { AITranslateIcon } from '../../../src/ui/icons/AITranslateIcon';
|
|
21
|
-
import { AppsIcon } from '../../../src/ui/icons/AppsIcon';
|
|
22
|
-
import { BoldIcon } from '../../../src/ui/icons/BoldIcon';
|
|
23
|
-
import { ClearFormattingIcon } from '../../../src/ui/icons/ClearFormattingIcon';
|
|
24
|
-
import { CommentIcon } from '../../../src/ui/icons/CommentIcon';
|
|
25
|
-
import { HeadingFiveIcon } from '../../../src/ui/icons/HeadingFiveIcon';
|
|
26
|
-
import { HeadingFourIcon } from '../../../src/ui/icons/HeadingFourIcon';
|
|
27
|
-
import { HeadingOneIcon } from '../../../src/ui/icons/HeadingOneIcon';
|
|
28
|
-
import { HeadingSixIcon } from '../../../src/ui/icons/HeadingSixIcon';
|
|
29
|
-
import { HeadingThreeIcon } from '../../../src/ui/icons/HeadingThreeIcon';
|
|
30
|
-
import { HeadingTwoIcon } from '../../../src/ui/icons/HeadingTwoIcon';
|
|
31
|
-
import { ItalicIcon } from '../../../src/ui/icons/ItalicIcon';
|
|
32
|
-
import { LinkIcon } from '../../../src/ui/icons/LinkIcon';
|
|
33
|
-
import { ListBulletedIcon } from '../../../src/ui/icons/ListBulletedIcon';
|
|
34
|
-
import { ListNumberedIcon } from '../../../src/ui/icons/ListNumberedIcon';
|
|
35
|
-
import { MoreItemsIcon } from '../../../src/ui/icons/MoreItemsIcon';
|
|
36
|
-
import { NestedDropdownRightIcon } from '../../../src/ui/icons/NestedDropdownRightIcon';
|
|
37
|
-
import { PinIcon } from '../../../src/ui/icons/PinIcon';
|
|
38
|
-
import { PinnedIcon } from '../../../src/ui/icons/PinnedIcon';
|
|
39
|
-
import { QuoteIcon } from '../../../src/ui/icons/QuoteIcon';
|
|
40
|
-
import { TextColorIcon } from '../../../src/ui/icons/TextColorIcon';
|
|
41
|
-
import { TextIcon } from '../../../src/ui/icons/TextIcon';
|
|
42
|
-
import { Toolbar } from '../../../src/ui/Toolbar';
|
|
43
|
-
import { ToolbarButton } from '../../../src/ui/ToolbarButton';
|
|
44
|
-
import { ToolbarButtonGroup } from '../../../src/ui/ToolbarButtonGroup';
|
|
45
|
-
import { ToolbarColorSwatch } from '../../../src/ui/ToolbarColorSwatch';
|
|
46
|
-
import { ToolbarDropdownItem } from '../../../src/ui/ToolbarDropdownItem';
|
|
47
|
-
import { ToolbarDropdownItemSection } from '../../../src/ui/ToolbarDropdownItemSection';
|
|
48
|
-
import { ToolbarDropdownMenu } from '../../../src/ui/ToolbarDropdownMenu';
|
|
49
|
-
import { ToolbarKeyboardShortcutHint } from '../../../src/ui/ToolbarKeyboardShortcutHint';
|
|
50
|
-
import { ToolbarNestedDropdownMenu } from '../../../src/ui/ToolbarNestedDropdownMenu';
|
|
51
|
-
import { ToolbarSection } from '../../../src/ui/ToolbarSection';
|
|
52
|
-
import { ToolbarTooltip } from '../../../src/ui/ToolbarTooltip';
|
|
53
|
-
|
|
54
|
-
import { useExampleToolbarState } from './useExampleToolbarState';
|
|
55
|
-
|
|
56
|
-
const headingSizeStylesMap = cssMap({
|
|
57
|
-
xlarge: {
|
|
58
|
-
font: token('font.heading.xlarge'),
|
|
59
|
-
},
|
|
60
|
-
large: {
|
|
61
|
-
font: token('font.heading.large'),
|
|
62
|
-
},
|
|
63
|
-
medium: {
|
|
64
|
-
font: token('font.heading.medium'),
|
|
65
|
-
},
|
|
66
|
-
small: {
|
|
67
|
-
font: token('font.heading.small'),
|
|
68
|
-
},
|
|
69
|
-
xsmall: {
|
|
70
|
-
font: token('font.heading.xsmall'),
|
|
71
|
-
},
|
|
72
|
-
xxsmall: {
|
|
73
|
-
font: token('font.heading.xxsmall'),
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
export const ExampleManuallyComposedToolbar = () => {
|
|
78
|
-
const {
|
|
79
|
-
textStyle,
|
|
80
|
-
onSetTextStyle,
|
|
81
|
-
formatting,
|
|
82
|
-
onToggleFormatting,
|
|
83
|
-
listOrAlignment,
|
|
84
|
-
onToggleListOrAlignment,
|
|
85
|
-
pinning,
|
|
86
|
-
onTogglePinning,
|
|
87
|
-
onClick,
|
|
88
|
-
lastAction,
|
|
89
|
-
} = useExampleToolbarState();
|
|
90
|
-
|
|
91
|
-
const [isRovoDisabled, setIsRovoDisabled] = useState(false);
|
|
92
|
-
const toggleRovoButton = () => {
|
|
93
|
-
setIsRovoDisabled(!isRovoDisabled);
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const [isAdjustLengthDisabled, setIsAdjustLengthDisabled] = useState(false);
|
|
97
|
-
const toggleAdjustLengthButton = () => {
|
|
98
|
-
setIsAdjustLengthDisabled(!isAdjustLengthDisabled);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const [isTextStylesDisabled, setIsTextStylesDisabled] = useState(false);
|
|
102
|
-
const toggleTextStylesButton = () => {
|
|
103
|
-
setIsTextStylesDisabled(!isTextStylesDisabled);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
const [isImproveWritingDisabled, setIsImproveWritingDisabled] = useState(false);
|
|
107
|
-
const toggleImproveWritingButton = () => {
|
|
108
|
-
setIsImproveWritingDisabled(!isImproveWritingDisabled);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
const [isBoldDisabled, setIsBoldDisabled] = useState(false);
|
|
112
|
-
const toggleBoldStyle = () => {
|
|
113
|
-
setIsBoldDisabled(!isBoldDisabled);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
const [isItalicDisabled, setIsItalicDisabled] = useState(false);
|
|
117
|
-
const toggleItalicStyle = () => {
|
|
118
|
-
setIsItalicDisabled(!isItalicDisabled);
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const [isTextColorDisabled, setIsTextColorDisabled] = useState(false);
|
|
122
|
-
const toggleTextColorButton = () => {
|
|
123
|
-
setIsTextColorDisabled(!isTextColorDisabled);
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
const [isBulletedListDisabled, setIsBulletedListDisabled] = useState(false);
|
|
127
|
-
const toggleBulletedListButton = () => {
|
|
128
|
-
setIsBulletedListDisabled(!isBulletedListDisabled);
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const [isNumberedListDisabled, setIsNumberedListDisabled] = useState(false);
|
|
132
|
-
const toggleNumberedListButton = () => {
|
|
133
|
-
setIsNumberedListDisabled(!isNumberedListDisabled);
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const [isLinkDisabled, setIsLinkDisabled] = useState(false);
|
|
137
|
-
const toggleLinkButton = () => {
|
|
138
|
-
setIsLinkDisabled(!isLinkDisabled);
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
const [isCommentDisabled, setIsCommentDisabled] = useState(false);
|
|
142
|
-
const toggleCommentButton = () => {
|
|
143
|
-
setIsCommentDisabled(!isCommentDisabled);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const [isCreateJiraWorkItemDisabled, setIsCreateJiraWorkItemDisabled] = useState(false);
|
|
147
|
-
const toggleCreateJiraWorkItemButton = () => {
|
|
148
|
-
setIsCreateJiraWorkItemDisabled(!isCreateJiraWorkItemDisabled);
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
const [isAppsAndExtensionsDisabled, setIsAppsAndExtensionsDisabled] = useState(false);
|
|
152
|
-
const toggleAppsAndExtensionsButton = () => {
|
|
153
|
-
setIsAppsAndExtensionsDisabled(!isAppsAndExtensionsDisabled);
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
return (
|
|
157
|
-
<>
|
|
158
|
-
<Toolbar label="Editor Toolbar">
|
|
159
|
-
<ToolbarSection>
|
|
160
|
-
<ToolbarButtonGroup>
|
|
161
|
-
<ToolbarTooltip content="Ask Rovo">
|
|
162
|
-
<ToolbarButton
|
|
163
|
-
iconBefore={<AIChatIcon label="Ask Rovo" />}
|
|
164
|
-
onClick={onClick('Ask Rovo')}
|
|
165
|
-
isDisabled={isRovoDisabled}
|
|
166
|
-
>
|
|
167
|
-
Ask Rovo
|
|
168
|
-
</ToolbarButton>
|
|
169
|
-
</ToolbarTooltip>
|
|
170
|
-
<ToolbarDropdownMenu iconBefore={<MoreItemsIcon label="More formatting" />}>
|
|
171
|
-
<ToolbarDropdownItemSection>
|
|
172
|
-
<ToolbarNestedDropdownMenu
|
|
173
|
-
elemBefore={<AIAdjustLengthIcon label="Adjust length" />}
|
|
174
|
-
text="Adjust length"
|
|
175
|
-
elemAfter={<NestedDropdownRightIcon label={'Choose desired tone'} />}
|
|
176
|
-
isDisabled={isAdjustLengthDisabled}
|
|
177
|
-
>
|
|
178
|
-
<ToolbarDropdownItemSection>
|
|
179
|
-
<ToolbarDropdownItem
|
|
180
|
-
elemBefore={<AIShortenIcon label="Make shorter" />}
|
|
181
|
-
onClick={onClick('Make shorter')}
|
|
182
|
-
>
|
|
183
|
-
Make shorter
|
|
184
|
-
</ToolbarDropdownItem>
|
|
185
|
-
<ToolbarDropdownItem
|
|
186
|
-
elemBefore={<AILengthenIcon label="Make longer" />}
|
|
187
|
-
onClick={onClick('Make longer')}
|
|
188
|
-
>
|
|
189
|
-
Make longer
|
|
190
|
-
</ToolbarDropdownItem>
|
|
191
|
-
</ToolbarDropdownItemSection>
|
|
192
|
-
</ToolbarNestedDropdownMenu>
|
|
193
|
-
<ToolbarNestedDropdownMenu
|
|
194
|
-
elemBefore={<AIChangeToneIcon label="Change tone" />}
|
|
195
|
-
text="Change tone"
|
|
196
|
-
elemAfter={<NestedDropdownRightIcon label={'Choose desired tone'} />}
|
|
197
|
-
>
|
|
198
|
-
<ToolbarDropdownItemSection>
|
|
199
|
-
<ToolbarDropdownItem
|
|
200
|
-
elemBefore={<AIBriefcaseIcon label="More professional" />}
|
|
201
|
-
onClick={onClick('More professional')}
|
|
202
|
-
>
|
|
203
|
-
More professional
|
|
204
|
-
</ToolbarDropdownItem>
|
|
205
|
-
<ToolbarDropdownItem
|
|
206
|
-
elemBefore={<AICasualIcon label="More casual" />}
|
|
207
|
-
onClick={onClick('More casual')}
|
|
208
|
-
>
|
|
209
|
-
More casual
|
|
210
|
-
</ToolbarDropdownItem>
|
|
211
|
-
<ToolbarDropdownItem
|
|
212
|
-
elemBefore={<AIHeartIcon label="More empathetic" />}
|
|
213
|
-
onClick={onClick('More empathetic')}
|
|
214
|
-
>
|
|
215
|
-
More empathetic
|
|
216
|
-
</ToolbarDropdownItem>
|
|
217
|
-
</ToolbarDropdownItemSection>
|
|
218
|
-
</ToolbarNestedDropdownMenu>
|
|
219
|
-
<ToolbarDropdownItem
|
|
220
|
-
elemBefore={<AISpellcheckIcon label="Fix spelling and grammar" />}
|
|
221
|
-
onClick={onClick('Fix spelling and grammar')}
|
|
222
|
-
>
|
|
223
|
-
Fix spelling and grammar
|
|
224
|
-
</ToolbarDropdownItem>
|
|
225
|
-
<ToolbarNestedDropdownMenu
|
|
226
|
-
elemBefore={<AITranslateIcon label="Translate" />}
|
|
227
|
-
text="Translate"
|
|
228
|
-
elemAfter={<NestedDropdownRightIcon label={'Choose language option'} />}
|
|
229
|
-
>
|
|
230
|
-
<ToolbarDropdownItemSection>
|
|
231
|
-
<ToolbarDropdownItem
|
|
232
|
-
elemBefore={<AITranslateIcon label="Language 1" />}
|
|
233
|
-
onClick={onClick('Language 1')}
|
|
234
|
-
>
|
|
235
|
-
Language 1
|
|
236
|
-
</ToolbarDropdownItem>
|
|
237
|
-
<ToolbarDropdownItem
|
|
238
|
-
elemBefore={<AITranslateIcon label="Language 2" />}
|
|
239
|
-
onClick={onClick('More casual')}
|
|
240
|
-
>
|
|
241
|
-
Language 2
|
|
242
|
-
</ToolbarDropdownItem>
|
|
243
|
-
<ToolbarDropdownItem
|
|
244
|
-
elemBefore={<AITranslateIcon label="Language 3" />}
|
|
245
|
-
onClick={onClick('Language 3')}
|
|
246
|
-
>
|
|
247
|
-
Language 3
|
|
248
|
-
</ToolbarDropdownItem>
|
|
249
|
-
</ToolbarDropdownItemSection>
|
|
250
|
-
</ToolbarNestedDropdownMenu>
|
|
251
|
-
</ToolbarDropdownItemSection>
|
|
252
|
-
</ToolbarDropdownMenu>
|
|
253
|
-
</ToolbarButtonGroup>
|
|
254
|
-
<ToolbarButtonGroup>
|
|
255
|
-
<ToolbarTooltip content="Improve writing">
|
|
256
|
-
<ToolbarButton
|
|
257
|
-
iconBefore={<AICommandIcon label="Improve writing" />}
|
|
258
|
-
onClick={onClick('Improve writing')}
|
|
259
|
-
isDisabled={isImproveWritingDisabled}
|
|
260
|
-
>
|
|
261
|
-
Improve writing
|
|
262
|
-
</ToolbarButton>
|
|
263
|
-
</ToolbarTooltip>
|
|
264
|
-
</ToolbarButtonGroup>
|
|
265
|
-
</ToolbarSection>
|
|
266
|
-
|
|
267
|
-
<ToolbarSection>
|
|
268
|
-
<ToolbarButtonGroup>
|
|
269
|
-
<ToolbarTooltip content="Text styles">
|
|
270
|
-
<ToolbarDropdownMenu
|
|
271
|
-
iconBefore={
|
|
272
|
-
{
|
|
273
|
-
none: <TextIcon label="Normal text" />,
|
|
274
|
-
normal: <TextIcon label="Normal text" />,
|
|
275
|
-
heading1: <HeadingOneIcon label="Heading One" />,
|
|
276
|
-
heading2: <HeadingTwoIcon label="Heading Two" />,
|
|
277
|
-
heading3: <HeadingThreeIcon label="Heading Three" />,
|
|
278
|
-
heading4: <HeadingFourIcon label="Heading Four" />,
|
|
279
|
-
heading5: <HeadingFiveIcon label="Heading Five" />,
|
|
280
|
-
heading6: <HeadingSixIcon label="Heading Six" />,
|
|
281
|
-
quote: <QuoteIcon label="Quote" />,
|
|
282
|
-
}[textStyle]
|
|
283
|
-
}
|
|
284
|
-
isDisabled={isTextStylesDisabled}
|
|
285
|
-
>
|
|
286
|
-
<ToolbarDropdownItemSection>
|
|
287
|
-
<ToolbarDropdownItem
|
|
288
|
-
elemBefore={<TextIcon label="Normal text" />}
|
|
289
|
-
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⌥0" />}
|
|
290
|
-
onClick={onClick('Normal text', onSetTextStyle('normal'))}
|
|
291
|
-
isSelected={textStyle === 'normal'}
|
|
292
|
-
ariaKeyshortcuts="⌘⌥0"
|
|
293
|
-
>
|
|
294
|
-
Normal text
|
|
295
|
-
</ToolbarDropdownItem>
|
|
296
|
-
<ToolbarDropdownItem
|
|
297
|
-
elemBefore={<HeadingOneIcon label="Heading One" />}
|
|
298
|
-
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⌥1" />}
|
|
299
|
-
onClick={onClick('Heading one', onSetTextStyle('heading1'))}
|
|
300
|
-
isSelected={textStyle === 'heading1'}
|
|
301
|
-
ariaKeyshortcuts="⌘⌥1"
|
|
302
|
-
>
|
|
303
|
-
<Box xcss={headingSizeStylesMap.xlarge}>Heading 1</Box>
|
|
304
|
-
</ToolbarDropdownItem>
|
|
305
|
-
<ToolbarDropdownItem
|
|
306
|
-
elemBefore={<HeadingTwoIcon label="Heading Two" />}
|
|
307
|
-
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⌥2" />}
|
|
308
|
-
onClick={onClick('Heading two', onSetTextStyle('heading2'))}
|
|
309
|
-
isSelected={textStyle === 'heading2'}
|
|
310
|
-
ariaKeyshortcuts="⌘⌥2"
|
|
311
|
-
>
|
|
312
|
-
<Box xcss={headingSizeStylesMap.large}>Heading 2</Box>
|
|
313
|
-
</ToolbarDropdownItem>
|
|
314
|
-
<ToolbarDropdownItem
|
|
315
|
-
elemBefore={<HeadingThreeIcon label="Heading Three" />}
|
|
316
|
-
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⌥3" />}
|
|
317
|
-
onClick={onClick('Heading three', onSetTextStyle('heading3'))}
|
|
318
|
-
isSelected={textStyle === 'heading3'}
|
|
319
|
-
textStyle="heading3"
|
|
320
|
-
ariaKeyshortcuts="⌘⌥3"
|
|
321
|
-
>
|
|
322
|
-
<Box xcss={headingSizeStylesMap.medium}>Heading 3</Box>
|
|
323
|
-
</ToolbarDropdownItem>
|
|
324
|
-
<ToolbarDropdownItem
|
|
325
|
-
elemBefore={<HeadingFourIcon label="Heading Four" />}
|
|
326
|
-
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⌥4" />}
|
|
327
|
-
onClick={onClick('Heading four', onSetTextStyle('heading4'))}
|
|
328
|
-
isSelected={textStyle === 'heading4'}
|
|
329
|
-
ariaKeyshortcuts="⌘⌥4"
|
|
330
|
-
>
|
|
331
|
-
<Box xcss={headingSizeStylesMap.small}>Heading 4</Box>
|
|
332
|
-
</ToolbarDropdownItem>
|
|
333
|
-
<ToolbarDropdownItem
|
|
334
|
-
elemBefore={<HeadingFiveIcon label="Heading Five" />}
|
|
335
|
-
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⌥5" />}
|
|
336
|
-
onClick={onClick('Heading five', onSetTextStyle('heading5'))}
|
|
337
|
-
isSelected={textStyle === 'heading5'}
|
|
338
|
-
ariaKeyshortcuts="⌘⌥5"
|
|
339
|
-
>
|
|
340
|
-
<Box xcss={headingSizeStylesMap.xsmall}>Heading 5</Box>
|
|
341
|
-
</ToolbarDropdownItem>
|
|
342
|
-
<ToolbarDropdownItem
|
|
343
|
-
elemBefore={<HeadingSixIcon label="Heading Six" />}
|
|
344
|
-
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⌥6" />}
|
|
345
|
-
onClick={onClick('Heading six', onSetTextStyle('heading6'))}
|
|
346
|
-
isSelected={textStyle === 'heading6'}
|
|
347
|
-
ariaKeyshortcuts="⌘⌥6"
|
|
348
|
-
>
|
|
349
|
-
<Box xcss={headingSizeStylesMap.xxsmall}>Heading 6</Box>
|
|
350
|
-
</ToolbarDropdownItem>
|
|
351
|
-
<ToolbarDropdownItem
|
|
352
|
-
elemBefore={<QuoteIcon label="Quote" />}
|
|
353
|
-
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⌥9" />}
|
|
354
|
-
onClick={onClick('Quote', onSetTextStyle('quote'))}
|
|
355
|
-
isSelected={textStyle === 'quote'}
|
|
356
|
-
ariaKeyshortcuts="⌘⌥9"
|
|
357
|
-
>
|
|
358
|
-
Quote
|
|
359
|
-
</ToolbarDropdownItem>
|
|
360
|
-
</ToolbarDropdownItemSection>
|
|
361
|
-
</ToolbarDropdownMenu>
|
|
362
|
-
</ToolbarTooltip>
|
|
363
|
-
</ToolbarButtonGroup>
|
|
364
|
-
|
|
365
|
-
<ToolbarButtonGroup>
|
|
366
|
-
<ToolbarTooltip content={formatting.italic && !formatting.bold ? 'Italic' : 'Bold'}>
|
|
367
|
-
<ToolbarButton
|
|
368
|
-
iconBefore={
|
|
369
|
-
formatting.italic && !formatting.bold ? (
|
|
370
|
-
<ItalicIcon label="Italic" />
|
|
371
|
-
) : (
|
|
372
|
-
<BoldIcon label="Bold" />
|
|
373
|
-
)
|
|
374
|
-
}
|
|
375
|
-
onClick={onClick(
|
|
376
|
-
formatting.italic && !formatting.bold ? 'Italic' : 'Bold',
|
|
377
|
-
onToggleFormatting(formatting.italic && !formatting.bold ? 'italic' : 'bold'),
|
|
378
|
-
)}
|
|
379
|
-
isSelected={formatting.bold || formatting.italic}
|
|
380
|
-
isDisabled={formatting.italic ? isItalicDisabled : isBoldDisabled}
|
|
381
|
-
ariaKeyshortcuts={formatting.italic && !formatting.bold ? '⌘I' : '⌘B'}
|
|
382
|
-
/>
|
|
383
|
-
</ToolbarTooltip>
|
|
384
|
-
<ToolbarDropdownMenu iconBefore={<MoreItemsIcon label="More formatting" />}>
|
|
385
|
-
<ToolbarDropdownItemSection>
|
|
386
|
-
<ToolbarDropdownItem
|
|
387
|
-
elemBefore={<BoldIcon label="Bold" />}
|
|
388
|
-
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘B" />}
|
|
389
|
-
onClick={onClick('Bold', onToggleFormatting('bold'))}
|
|
390
|
-
isSelected={formatting.bold}
|
|
391
|
-
isDisabled={isBoldDisabled}
|
|
392
|
-
ariaKeyshortcuts="⌘B"
|
|
393
|
-
>
|
|
394
|
-
Bold
|
|
395
|
-
</ToolbarDropdownItem>
|
|
396
|
-
<ToolbarDropdownItem
|
|
397
|
-
elemBefore={<ItalicIcon label="Italic" />}
|
|
398
|
-
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘I" />}
|
|
399
|
-
onClick={onClick('Italic', onToggleFormatting('italic'))}
|
|
400
|
-
isSelected={formatting.italic}
|
|
401
|
-
isDisabled={isItalicDisabled}
|
|
402
|
-
ariaKeyshortcuts="⌘I"
|
|
403
|
-
>
|
|
404
|
-
Italic
|
|
405
|
-
</ToolbarDropdownItem>
|
|
406
|
-
</ToolbarDropdownItemSection>
|
|
407
|
-
<ToolbarDropdownItemSection>
|
|
408
|
-
<ToolbarDropdownItem
|
|
409
|
-
elemBefore={<ClearFormattingIcon label="Clear formatting" />}
|
|
410
|
-
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘\" />}
|
|
411
|
-
onClick={onClick('Clear formatting')}
|
|
412
|
-
ariaKeyshortcuts="⌘\"
|
|
413
|
-
>
|
|
414
|
-
Clear formatting
|
|
415
|
-
</ToolbarDropdownItem>
|
|
416
|
-
</ToolbarDropdownItemSection>
|
|
417
|
-
</ToolbarDropdownMenu>
|
|
418
|
-
</ToolbarButtonGroup>
|
|
419
|
-
<ToolbarButtonGroup>
|
|
420
|
-
<ToolbarTooltip content="Text color">
|
|
421
|
-
<ToolbarDropdownMenu
|
|
422
|
-
iconBefore={
|
|
423
|
-
<ToolbarColorSwatch
|
|
424
|
-
highlightColor={token('color.background.accent.blue.subtlest')}
|
|
425
|
-
>
|
|
426
|
-
<TextColorIcon
|
|
427
|
-
label={'Text color'}
|
|
428
|
-
iconColor={token('color.text.accent.magenta') as IconColor}
|
|
429
|
-
shouldRecommendSmallIcon={true}
|
|
430
|
-
size={'small'}
|
|
431
|
-
isDisabled={isTextColorDisabled}
|
|
432
|
-
spacing={'compact'}
|
|
433
|
-
/>
|
|
434
|
-
</ToolbarColorSwatch>
|
|
435
|
-
}
|
|
436
|
-
isDisabled={isTextColorDisabled}
|
|
437
|
-
>
|
|
438
|
-
<ToolbarDropdownItemSection>
|
|
439
|
-
<ToolbarDropdownItem
|
|
440
|
-
elemBefore={<TextIcon label="Text color" />}
|
|
441
|
-
onClick={onClick('Text color')}
|
|
442
|
-
>
|
|
443
|
-
Text color
|
|
444
|
-
</ToolbarDropdownItem>
|
|
445
|
-
</ToolbarDropdownItemSection>
|
|
446
|
-
</ToolbarDropdownMenu>
|
|
447
|
-
</ToolbarTooltip>
|
|
448
|
-
</ToolbarButtonGroup>
|
|
449
|
-
|
|
450
|
-
<ToolbarButtonGroup>
|
|
451
|
-
<ToolbarTooltip
|
|
452
|
-
content={listOrAlignment === 'numbered' ? 'Numbered list' : 'Bulleted list'}
|
|
453
|
-
>
|
|
454
|
-
<ToolbarButton
|
|
455
|
-
iconBefore={
|
|
456
|
-
listOrAlignment === 'numbered' ? (
|
|
457
|
-
<ListNumberedIcon label="Numbered list" />
|
|
458
|
-
) : (
|
|
459
|
-
<ListBulletedIcon label="Bulleted list" />
|
|
460
|
-
)
|
|
461
|
-
}
|
|
462
|
-
onClick={onClick(
|
|
463
|
-
listOrAlignment === 'numbered' ? 'Numbered list' : 'Bulleted list',
|
|
464
|
-
onToggleListOrAlignment(listOrAlignment === 'numbered' ? 'numbered' : 'bulleted'),
|
|
465
|
-
)}
|
|
466
|
-
isSelected={listOrAlignment !== 'none'}
|
|
467
|
-
isDisabled={
|
|
468
|
-
listOrAlignment === 'numbered' ? isNumberedListDisabled : isBulletedListDisabled
|
|
469
|
-
}
|
|
470
|
-
/>
|
|
471
|
-
</ToolbarTooltip>
|
|
472
|
-
<ToolbarDropdownMenu
|
|
473
|
-
iconBefore={<MoreItemsIcon label="Lists, indentation and alignment" />}
|
|
474
|
-
>
|
|
475
|
-
<ToolbarDropdownItemSection>
|
|
476
|
-
<ToolbarDropdownItem
|
|
477
|
-
elemBefore={<ListBulletedIcon label="Bulleted list" />}
|
|
478
|
-
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⇧8" />}
|
|
479
|
-
onClick={onClick('Bulleted list', onToggleListOrAlignment('bulleted'))}
|
|
480
|
-
isSelected={listOrAlignment === 'bulleted'}
|
|
481
|
-
isDisabled={isBulletedListDisabled}
|
|
482
|
-
ariaKeyshortcuts="⌘⇧8"
|
|
483
|
-
>
|
|
484
|
-
Bulleted list
|
|
485
|
-
</ToolbarDropdownItem>
|
|
486
|
-
<ToolbarDropdownItem
|
|
487
|
-
elemBefore={<ListNumberedIcon label="Numbered list" />}
|
|
488
|
-
elemAfter={<ToolbarKeyboardShortcutHint shortcut="⌘⇧7" />}
|
|
489
|
-
onClick={onClick('Numbered list', onToggleListOrAlignment('numbered'))}
|
|
490
|
-
isSelected={listOrAlignment === 'numbered'}
|
|
491
|
-
isDisabled={isNumberedListDisabled}
|
|
492
|
-
ariaKeyshortcuts="⌘⇧7"
|
|
493
|
-
>
|
|
494
|
-
Numbered list
|
|
495
|
-
</ToolbarDropdownItem>
|
|
496
|
-
</ToolbarDropdownItemSection>
|
|
497
|
-
</ToolbarDropdownMenu>
|
|
498
|
-
</ToolbarButtonGroup>
|
|
499
|
-
</ToolbarSection>
|
|
500
|
-
|
|
501
|
-
<ToolbarSection>
|
|
502
|
-
<ToolbarButtonGroup>
|
|
503
|
-
<ToolbarTooltip content="Link">
|
|
504
|
-
<ToolbarButton
|
|
505
|
-
iconBefore={<LinkIcon label="Link" />}
|
|
506
|
-
onClick={onClick('Link')}
|
|
507
|
-
isDisabled={isLinkDisabled}
|
|
508
|
-
/>
|
|
509
|
-
</ToolbarTooltip>
|
|
510
|
-
</ToolbarButtonGroup>
|
|
511
|
-
</ToolbarSection>
|
|
512
|
-
|
|
513
|
-
<ToolbarSection>
|
|
514
|
-
<ToolbarButtonGroup>
|
|
515
|
-
<ToolbarTooltip content="Comment">
|
|
516
|
-
<ToolbarButton
|
|
517
|
-
iconBefore={<CommentIcon label="Comment" />}
|
|
518
|
-
onClick={onClick('Comment')}
|
|
519
|
-
isDisabled={isCommentDisabled}
|
|
520
|
-
>
|
|
521
|
-
Comment
|
|
522
|
-
</ToolbarButton>
|
|
523
|
-
</ToolbarTooltip>
|
|
524
|
-
</ToolbarButtonGroup>
|
|
525
|
-
</ToolbarSection>
|
|
526
|
-
|
|
527
|
-
<ToolbarSection>
|
|
528
|
-
<ToolbarButtonGroup>
|
|
529
|
-
<ToolbarTooltip content="Apps and extensions">
|
|
530
|
-
<ToolbarDropdownMenu
|
|
531
|
-
iconBefore={<AppsIcon label="Apps and extensions" />}
|
|
532
|
-
isDisabled={isAppsAndExtensionsDisabled}
|
|
533
|
-
>
|
|
534
|
-
<ToolbarDropdownItemSection>
|
|
535
|
-
<ToolbarDropdownItem
|
|
536
|
-
elemBefore={<AddIcon label="Create Jira work item" />}
|
|
537
|
-
onClick={onClick('Create Jira work item')}
|
|
538
|
-
isDisabled={isCreateJiraWorkItemDisabled}
|
|
539
|
-
>
|
|
540
|
-
Create Jira work item
|
|
541
|
-
</ToolbarDropdownItem>
|
|
542
|
-
</ToolbarDropdownItemSection>
|
|
543
|
-
</ToolbarDropdownMenu>
|
|
544
|
-
</ToolbarTooltip>
|
|
545
|
-
</ToolbarButtonGroup>
|
|
546
|
-
</ToolbarSection>
|
|
547
|
-
|
|
548
|
-
<ToolbarSection>
|
|
549
|
-
<ToolbarButtonGroup>
|
|
550
|
-
<ToolbarTooltip
|
|
551
|
-
content={pinning === 'pinned' ? 'Unpin the toolbar' : 'Pin the toolbar at the top'}
|
|
552
|
-
>
|
|
553
|
-
<ToolbarButton
|
|
554
|
-
iconBefore={
|
|
555
|
-
pinning === 'pinned' ? (
|
|
556
|
-
<PinnedIcon label="Unpin toolbar" />
|
|
557
|
-
) : (
|
|
558
|
-
<PinIcon label="Pin toolbar" />
|
|
559
|
-
)
|
|
560
|
-
}
|
|
561
|
-
onClick={onClick(
|
|
562
|
-
pinning === 'pinned' ? 'Unpin toolbar' : 'Pin toolbar',
|
|
563
|
-
onTogglePinning,
|
|
564
|
-
)}
|
|
565
|
-
/>
|
|
566
|
-
</ToolbarTooltip>
|
|
567
|
-
</ToolbarButtonGroup>
|
|
568
|
-
</ToolbarSection>
|
|
569
|
-
</Toolbar>
|
|
570
|
-
<Box as="pre">
|
|
571
|
-
{`
|
|
572
|
-
Last action: ${lastAction || 'None'}
|
|
573
|
-
Text style: ${textStyle}
|
|
574
|
-
Formatting: ${Object.entries(formatting)
|
|
575
|
-
.filter(([, value]) => value)
|
|
576
|
-
.map(([key]) => key)
|
|
577
|
-
.join(', ')}
|
|
578
|
-
List/Align: ${listOrAlignment}
|
|
579
|
-
Pinning: ${pinning}
|
|
580
|
-
`}
|
|
581
|
-
</Box>
|
|
582
|
-
<Box>
|
|
583
|
-
<div>
|
|
584
|
-
Disable Rovo Button
|
|
585
|
-
<Toggle onChange={toggleRovoButton} />
|
|
586
|
-
</div>
|
|
587
|
-
<div>
|
|
588
|
-
Disable Adjust Length Button
|
|
589
|
-
<Toggle onChange={toggleAdjustLengthButton} />
|
|
590
|
-
</div>
|
|
591
|
-
<div>
|
|
592
|
-
Disable Improve Writing Button
|
|
593
|
-
<Toggle onChange={toggleImproveWritingButton} />
|
|
594
|
-
</div>
|
|
595
|
-
<div>
|
|
596
|
-
Disable Text Styles
|
|
597
|
-
<Toggle onChange={toggleTextStylesButton} />
|
|
598
|
-
</div>
|
|
599
|
-
<div>
|
|
600
|
-
Disable Bold Formatting
|
|
601
|
-
<Toggle onChange={toggleBoldStyle} />
|
|
602
|
-
</div>
|
|
603
|
-
<div>
|
|
604
|
-
Disable Italic Formatting
|
|
605
|
-
<Toggle onChange={toggleItalicStyle} />
|
|
606
|
-
</div>
|
|
607
|
-
<div>
|
|
608
|
-
Disable Text Color
|
|
609
|
-
<Toggle onChange={toggleTextColorButton} />
|
|
610
|
-
</div>
|
|
611
|
-
<div>
|
|
612
|
-
Disable Bulleted List
|
|
613
|
-
<Toggle onChange={toggleBulletedListButton} />
|
|
614
|
-
</div>
|
|
615
|
-
<div>
|
|
616
|
-
Disable Numbered List
|
|
617
|
-
<Toggle onChange={toggleNumberedListButton} />
|
|
618
|
-
</div>
|
|
619
|
-
<div>
|
|
620
|
-
Disable Link
|
|
621
|
-
<Toggle onChange={toggleLinkButton} />
|
|
622
|
-
</div>
|
|
623
|
-
<div>
|
|
624
|
-
Disable Comment
|
|
625
|
-
<Toggle onChange={toggleCommentButton} />
|
|
626
|
-
</div>
|
|
627
|
-
<div>
|
|
628
|
-
Disable Apps and Extensions
|
|
629
|
-
<Toggle onChange={toggleAppsAndExtensionsButton} />
|
|
630
|
-
</div>
|
|
631
|
-
<div>
|
|
632
|
-
Disable Create Jira Work Item
|
|
633
|
-
<Toggle onChange={toggleCreateJiraWorkItemButton} />
|
|
634
|
-
</div>
|
|
635
|
-
</Box>
|
|
636
|
-
</>
|
|
637
|
-
);
|
|
638
|
-
};
|