@atlaskit/editor-core 187.10.8 → 187.11.0
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 +10 -0
- package/dist/cjs/index.js +2 -94
- package/dist/cjs/plugins/help-dialog/ui/index.js +42 -42
- package/dist/cjs/plugins/paste/handlers.js +4 -6
- package/dist/cjs/plugins/text-formatting/actions.js +188 -0
- package/dist/cjs/plugins/text-formatting/commands/text-formatting.js +1 -180
- package/dist/cjs/plugins/text-formatting/index.js +17 -0
- package/dist/cjs/plugins/text-formatting/pm-plugins/keymap.js +8 -8
- package/dist/cjs/plugins/text-formatting/pm-plugins/main.js +8 -8
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -2
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +16 -16
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +8 -8
- package/dist/cjs/plugins/text-formatting/utils.js +8 -36
- package/dist/cjs/ui/ContentStyles/index.js +8 -9
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/index.js +0 -2
- package/dist/es2019/plugins/help-dialog/ui/index.js +1 -1
- package/dist/es2019/plugins/paste/handlers.js +5 -7
- package/dist/es2019/plugins/text-formatting/actions.js +161 -0
- package/dist/es2019/plugins/text-formatting/commands/text-formatting.js +1 -159
- package/dist/es2019/plugins/text-formatting/index.js +17 -0
- package/dist/es2019/plugins/text-formatting/pm-plugins/keymap.js +8 -8
- package/dist/es2019/plugins/text-formatting/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +1 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +9 -9
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +1 -1
- package/dist/es2019/plugins/text-formatting/utils.js +1 -29
- package/dist/es2019/ui/ContentStyles/index.js +2 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/plugins/help-dialog/ui/index.js +1 -1
- package/dist/esm/plugins/paste/handlers.js +5 -7
- package/dist/esm/plugins/text-formatting/actions.js +168 -0
- package/dist/esm/plugins/text-formatting/commands/text-formatting.js +1 -166
- package/dist/esm/plugins/text-formatting/index.js +17 -0
- package/dist/esm/plugins/text-formatting/pm-plugins/keymap.js +8 -8
- package/dist/esm/plugins/text-formatting/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +1 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +9 -9
- package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +1 -1
- package/dist/esm/plugins/text-formatting/utils.js +6 -33
- package/dist/esm/ui/ContentStyles/index.js +2 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/index.d.ts +6 -4
- package/dist/types/labs/next/presets/default.d.ts +78 -15
- package/dist/types/plugins/media/ui/ResizableMediaSingle/guidelines.d.ts +1 -1
- package/dist/types/plugins/paste/handlers.d.ts +1 -2
- package/dist/types/plugins/text-formatting/actions.d.ts +20 -0
- package/dist/types/plugins/text-formatting/commands/text-formatting.d.ts +0 -31
- package/dist/types/plugins/text-formatting/index.d.ts +18 -2
- package/dist/types/plugins/text-formatting/pm-plugins/main.d.ts +1 -2
- package/dist/types/plugins/text-formatting/pm-plugins/plugin-key.d.ts +1 -1
- package/dist/types/plugins/text-formatting/utils.d.ts +1 -5
- package/dist/types/types/editor-props.d.ts +1 -2
- package/dist/types/ui/ContentStyles/index.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +6 -4
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +78 -15
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/guidelines.d.ts +1 -1
- package/dist/types-ts4.5/plugins/paste/handlers.d.ts +1 -2
- package/dist/types-ts4.5/plugins/text-formatting/actions.d.ts +20 -0
- package/dist/types-ts4.5/plugins/text-formatting/commands/text-formatting.d.ts +0 -31
- package/dist/types-ts4.5/plugins/text-formatting/index.d.ts +18 -2
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/main.d.ts +1 -2
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/plugin-key.d.ts +1 -1
- package/dist/types-ts4.5/plugins/text-formatting/utils.d.ts +1 -5
- package/dist/types-ts4.5/types/editor-props.d.ts +1 -2
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +1 -1
- package/package.json +2 -2
- package/report.api.md +31 -145
- package/tmp/api-report-tmp.d.ts +30 -118
- package/dist/cjs/plugins/text-formatting/styles.js +0 -15
- package/dist/cjs/plugins/text-formatting/types.js +0 -5
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +0 -95
- package/dist/es2019/plugins/text-formatting/styles.js +0 -5
- package/dist/es2019/plugins/text-formatting/types.js +0 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +0 -88
- package/dist/esm/plugins/text-formatting/styles.js +0 -7
- package/dist/esm/plugins/text-formatting/types.js +0 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +0 -88
- package/dist/types/plugins/text-formatting/styles.d.ts +0 -2
- package/dist/types/plugins/text-formatting/types.d.ts +0 -30
- package/dist/types/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +0 -87
- package/dist/types-ts4.5/plugins/text-formatting/styles.d.ts +0 -2
- package/dist/types-ts4.5/plugins/text-formatting/types.d.ts +0 -30
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +0 -87
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
-
import type { TextFormattingState } from '
|
|
3
|
+
import type { TextFormattingState } from '@atlaskit/editor-common/types';
|
|
4
4
|
import { pluginKey } from './plugin-key';
|
|
5
5
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
export { pluginKey };
|
|
7
|
-
export type { TextFormattingState };
|
|
8
7
|
export declare const plugin: (dispatch: Dispatch, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => SafePlugin<TextFormattingState>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Mark as PMMark } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { MenuIconItem } from './ui/Toolbar/types';
|
|
4
4
|
export declare const hasCode: (state: EditorState, pos: number) => boolean;
|
|
@@ -6,10 +6,6 @@ export declare const hasCode: (state: EditorState, pos: number) => boolean;
|
|
|
6
6
|
* Determine if a mark (with specific attribute values) exists anywhere in the selection.
|
|
7
7
|
*/
|
|
8
8
|
export declare const markActive: (state: EditorState, mark: PMMark) => boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Determine if a mark of a specific type exists anywhere in the selection.
|
|
11
|
-
*/
|
|
12
|
-
export declare const anyMarkActive: (state: EditorState, markType: Mark | MarkType) => boolean;
|
|
13
9
|
export declare const checkFormattingIsPresent: (state: EditorState) => boolean;
|
|
14
10
|
export declare const compareItemsArrays: (items: MenuIconItem[], prevItems: MenuIconItem[]) => MenuIconItem[];
|
|
15
11
|
export declare const isArrayContainsContent: (items: MenuIconItem[], content: string) => boolean;
|
|
@@ -6,7 +6,7 @@ import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
|
6
6
|
import type { ExtensionHandlers, ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
7
7
|
import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
8
8
|
import type { ContextIdentifierProvider, Providers, SearchProvider } from '@atlaskit/editor-common/provider-factory';
|
|
9
|
-
import type { AllEditorPresetPluginTypes, Transformer, LinkingOptions } from '@atlaskit/editor-common/types';
|
|
9
|
+
import type { AllEditorPresetPluginTypes, Transformer, LinkingOptions, TextFormattingOptions } from '@atlaskit/editor-common/types';
|
|
10
10
|
import type { ErrorReportingHandler } from '@atlaskit/editor-common/utils';
|
|
11
11
|
import type { PluginConfig as TablesPluginConfig } from '@atlaskit/editor-plugin-table/types';
|
|
12
12
|
import type { MentionProvider } from '@atlaskit/mention/resource';
|
|
@@ -25,7 +25,6 @@ import type { PanelPluginConfig } from '../plugins/panel/types';
|
|
|
25
25
|
import type { PlaceholderTextOptions } from '../plugins/placeholder-text/types';
|
|
26
26
|
import type { QuickInsertOptions } from '../plugins/quick-insert/types';
|
|
27
27
|
import type { TextColorPluginConfig } from '../plugins/text-color/pm-plugins/main';
|
|
28
|
-
import type { TextFormattingOptions } from '../plugins/text-formatting/types';
|
|
29
28
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
30
29
|
import type { EditorAppearance } from './editor-appearance';
|
|
31
30
|
import type { EditorOnChangeHandler } from './editor-onchange';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { SerializedStyles } from '@emotion/react';
|
|
3
|
+
import type { SerializedStyles } from '@emotion/react';
|
|
4
4
|
import type { FeatureFlags } from '../../types/feature-flags';
|
|
5
5
|
export declare const linkStyles: SerializedStyles;
|
|
6
6
|
type ContentStylesProps = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "187.
|
|
3
|
+
"version": "187.11.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@atlaskit/code": "^14.6.0",
|
|
56
56
|
"@atlaskit/date": "^0.10.0",
|
|
57
57
|
"@atlaskit/datetime-picker": "^12.7.0",
|
|
58
|
-
"@atlaskit/editor-common": "^74.
|
|
58
|
+
"@atlaskit/editor-common": "^74.35.0",
|
|
59
59
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
60
60
|
"@atlaskit/editor-markdown-transformer": "^5.2.5",
|
|
61
61
|
"@atlaskit/editor-palette": "1.5.1",
|
package/report.api.md
CHANGED
|
@@ -156,6 +156,9 @@ import { setTextSelection } from '@atlaskit/editor-common/utils';
|
|
|
156
156
|
import type { SEVERITY } from '@atlaskit/editor-common/utils';
|
|
157
157
|
import type { TaskDecisionProvider } from '@atlaskit/task-decision';
|
|
158
158
|
import { TeamMentionResource } from '@atlaskit/mention/team-resource';
|
|
159
|
+
import { InputMethodBasic as TextFormattingInputMethodBasic } from '@atlaskit/editor-common/types';
|
|
160
|
+
import { InputMethodToolbar as TextFormattingInputMethodToolbar } from '@atlaskit/editor-common/types';
|
|
161
|
+
import type { TextFormattingOptions } from '@atlaskit/editor-common/types';
|
|
159
162
|
import { ToolbarUIComponentFactory } from '@atlaskit/editor-common/types';
|
|
160
163
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
161
164
|
import { TransactionTracking } from '@atlaskit/editor-common/types';
|
|
@@ -2161,77 +2164,34 @@ export type TextColorPluginState = {
|
|
|
2161
2164
|
color: null | string;
|
|
2162
2165
|
};
|
|
2163
2166
|
|
|
2164
|
-
|
|
2165
|
-
export type TextFormattingInputMethodBasic =
|
|
2166
|
-
| INPUT_METHOD.FORMATTING
|
|
2167
|
-
| INPUT_METHOD.SHORTCUT
|
|
2168
|
-
| TextFormattingInputMethodToolbar;
|
|
2167
|
+
export { TextFormattingInputMethodBasic };
|
|
2169
2168
|
|
|
2170
|
-
|
|
2171
|
-
export type TextFormattingInputMethodToolbar = INPUT_METHOD.TOOLBAR;
|
|
2169
|
+
export { TextFormattingInputMethodToolbar };
|
|
2172
2170
|
|
|
2173
2171
|
// @public (undocumented)
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
// (undocumented)
|
|
2198
|
-
emDisabled?: boolean;
|
|
2199
|
-
// (undocumented)
|
|
2200
|
-
emHidden?: boolean;
|
|
2201
|
-
// (undocumented)
|
|
2202
|
-
strikeActive?: boolean;
|
|
2203
|
-
// (undocumented)
|
|
2204
|
-
strikeDisabled?: boolean;
|
|
2205
|
-
// (undocumented)
|
|
2206
|
-
strikeHidden?: boolean;
|
|
2207
|
-
// (undocumented)
|
|
2208
|
-
strongActive?: boolean;
|
|
2209
|
-
// (undocumented)
|
|
2210
|
-
strongDisabled?: boolean;
|
|
2211
|
-
// (undocumented)
|
|
2212
|
-
strongHidden?: boolean;
|
|
2213
|
-
// (undocumented)
|
|
2214
|
-
subscriptActive?: boolean;
|
|
2215
|
-
// (undocumented)
|
|
2216
|
-
subscriptDisabled?: boolean;
|
|
2217
|
-
// (undocumented)
|
|
2218
|
-
subscriptHidden?: boolean;
|
|
2219
|
-
// (undocumented)
|
|
2220
|
-
superscriptActive?: boolean;
|
|
2221
|
-
// (undocumented)
|
|
2222
|
-
superscriptDisabled?: boolean;
|
|
2223
|
-
// (undocumented)
|
|
2224
|
-
superscriptHidden?: boolean;
|
|
2225
|
-
// (undocumented)
|
|
2226
|
-
underlineActive?: boolean;
|
|
2227
|
-
// (undocumented)
|
|
2228
|
-
underlineDisabled?: boolean;
|
|
2229
|
-
// (undocumented)
|
|
2230
|
-
underlineHidden?: boolean;
|
|
2231
|
-
}
|
|
2232
|
-
|
|
2233
|
-
// @public (undocumented)
|
|
2234
|
-
export const textFormattingStateKey: PluginKey<TextFormattingState>;
|
|
2172
|
+
export const textFormattingPlugin: NextEditorPlugin<
|
|
2173
|
+
'textFormatting',
|
|
2174
|
+
{
|
|
2175
|
+
pluginConfiguration: TextFormattingOptions | undefined;
|
|
2176
|
+
dependencies: [OptionalPlugin<typeof analyticsPlugin>];
|
|
2177
|
+
actions: {
|
|
2178
|
+
toggleSuperscript: ToggleMarkCommand;
|
|
2179
|
+
toggleSuperscriptWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
2180
|
+
toggleSubscript: ToggleMarkCommand;
|
|
2181
|
+
toggleSubscriptWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
2182
|
+
toggleStrike: ToggleMarkCommand;
|
|
2183
|
+
toggleStrikeWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
2184
|
+
toggleCode: ToggleMarkCommand;
|
|
2185
|
+
toggleCodeWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
2186
|
+
toggleUnderline: ToggleMarkCommand;
|
|
2187
|
+
toggleUnderlineWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
2188
|
+
toggleEm: ToggleMarkCommand;
|
|
2189
|
+
toggleEmWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
2190
|
+
toggleStrong: ToggleMarkCommand;
|
|
2191
|
+
toggleStrongWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
2192
|
+
};
|
|
2193
|
+
}
|
|
2194
|
+
>;
|
|
2235
2195
|
|
|
2236
2196
|
// @public (undocumented)
|
|
2237
2197
|
interface TextSelectionData {
|
|
@@ -2244,86 +2204,12 @@ interface TextSelectionData {
|
|
|
2244
2204
|
}
|
|
2245
2205
|
|
|
2246
2206
|
// @public (undocumented)
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
// @public (undocumented)
|
|
2250
|
-
export const toggleCodeWithAnalytics: (
|
|
2251
|
-
editorAnalyticsAPI: EditorAnalyticsAPI | undefined,
|
|
2252
|
-
) => ({
|
|
2253
|
-
inputMethod,
|
|
2254
|
-
}: {
|
|
2255
|
-
inputMethod: TextFormattingInputMethodBasic;
|
|
2256
|
-
}) => Command_2;
|
|
2257
|
-
|
|
2258
|
-
// @public (undocumented)
|
|
2259
|
-
export const toggleEm: () => Command_2;
|
|
2260
|
-
|
|
2261
|
-
// @public (undocumented)
|
|
2262
|
-
export const toggleEmWithAnalytics: (
|
|
2263
|
-
editorAnalyticsAPI: EditorAnalyticsAPI | undefined,
|
|
2264
|
-
) => ({
|
|
2265
|
-
inputMethod,
|
|
2266
|
-
}: {
|
|
2267
|
-
inputMethod: TextFormattingInputMethodBasic;
|
|
2268
|
-
}) => Command_2;
|
|
2269
|
-
|
|
2270
|
-
// @public (undocumented)
|
|
2271
|
-
export const toggleStrike: () => Command_2;
|
|
2272
|
-
|
|
2273
|
-
// @public (undocumented)
|
|
2274
|
-
export const toggleStrikeWithAnalytics: (
|
|
2275
|
-
editorAnalyticsAPI: EditorAnalyticsAPI | undefined,
|
|
2276
|
-
) => ({
|
|
2277
|
-
inputMethod,
|
|
2278
|
-
}: {
|
|
2279
|
-
inputMethod: TextFormattingInputMethodBasic;
|
|
2280
|
-
}) => Command_2;
|
|
2281
|
-
|
|
2282
|
-
// @public (undocumented)
|
|
2283
|
-
export const toggleStrong: () => Command_2;
|
|
2284
|
-
|
|
2285
|
-
// @public (undocumented)
|
|
2286
|
-
export const toggleStrongWithAnalytics: (
|
|
2287
|
-
editorAnalyticsAPI: EditorAnalyticsAPI | undefined,
|
|
2288
|
-
) => ({
|
|
2289
|
-
inputMethod,
|
|
2290
|
-
}: {
|
|
2291
|
-
inputMethod: TextFormattingInputMethodBasic;
|
|
2292
|
-
}) => Command_2;
|
|
2293
|
-
|
|
2294
|
-
// @public (undocumented)
|
|
2295
|
-
export const toggleSubscript: () => Command_2;
|
|
2296
|
-
|
|
2297
|
-
// @public (undocumented)
|
|
2298
|
-
export const toggleSubscriptWithAnalytics: (
|
|
2299
|
-
editorAnalyticsAPI: EditorAnalyticsAPI | undefined,
|
|
2300
|
-
) => ({
|
|
2301
|
-
inputMethod,
|
|
2302
|
-
}: {
|
|
2303
|
-
inputMethod: TextFormattingInputMethodBasic;
|
|
2304
|
-
}) => Command_2;
|
|
2305
|
-
|
|
2306
|
-
// @public (undocumented)
|
|
2307
|
-
export const toggleSuperscript: () => Command_2;
|
|
2308
|
-
|
|
2309
|
-
// @public (undocumented)
|
|
2310
|
-
export const toggleSuperscriptWithAnalytics: (
|
|
2311
|
-
editorAnalyticsAPI: EditorAnalyticsAPI | undefined,
|
|
2312
|
-
) => ({
|
|
2313
|
-
inputMethod,
|
|
2314
|
-
}: {
|
|
2315
|
-
inputMethod: TextFormattingInputMethodBasic;
|
|
2316
|
-
}) => Command_2;
|
|
2317
|
-
|
|
2318
|
-
// @public (undocumented)
|
|
2319
|
-
export const toggleUnderline: () => Command_2;
|
|
2207
|
+
type ToggleMarkCommand = () => Command_2;
|
|
2320
2208
|
|
|
2321
2209
|
// @public (undocumented)
|
|
2322
|
-
|
|
2210
|
+
type ToggleMarkWithAnalyticsCommand = (
|
|
2323
2211
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined,
|
|
2324
|
-
) => ({
|
|
2325
|
-
inputMethod,
|
|
2326
|
-
}: {
|
|
2212
|
+
) => (analyticsMetadata: {
|
|
2327
2213
|
inputMethod: TextFormattingInputMethodBasic;
|
|
2328
2214
|
}) => Command_2;
|
|
2329
2215
|
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -145,6 +145,9 @@ import { setTextSelection } from '@atlaskit/editor-common/utils';
|
|
|
145
145
|
import type { SEVERITY } from '@atlaskit/editor-common/utils';
|
|
146
146
|
import type { TaskDecisionProvider } from '@atlaskit/task-decision';
|
|
147
147
|
import { TeamMentionResource } from '@atlaskit/mention/team-resource';
|
|
148
|
+
import { InputMethodBasic as TextFormattingInputMethodBasic } from '@atlaskit/editor-common/types';
|
|
149
|
+
import { InputMethodToolbar as TextFormattingInputMethodToolbar } from '@atlaskit/editor-common/types';
|
|
150
|
+
import type { TextFormattingOptions } from '@atlaskit/editor-common/types';
|
|
148
151
|
import { ToolbarUIComponentFactory } from '@atlaskit/editor-common/types';
|
|
149
152
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
150
153
|
import { TransactionTracking } from '@atlaskit/editor-common/types';
|
|
@@ -1927,74 +1930,31 @@ export type TextColorPluginState = {
|
|
|
1927
1930
|
color: null | string;
|
|
1928
1931
|
};
|
|
1929
1932
|
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
codeDisabled?: boolean;
|
|
1956
|
-
// (undocumented)
|
|
1957
|
-
codeHidden?: boolean;
|
|
1958
|
-
// (undocumented)
|
|
1959
|
-
emActive?: boolean;
|
|
1960
|
-
// (undocumented)
|
|
1961
|
-
emDisabled?: boolean;
|
|
1962
|
-
// (undocumented)
|
|
1963
|
-
emHidden?: boolean;
|
|
1964
|
-
// (undocumented)
|
|
1965
|
-
strikeActive?: boolean;
|
|
1966
|
-
// (undocumented)
|
|
1967
|
-
strikeDisabled?: boolean;
|
|
1968
|
-
// (undocumented)
|
|
1969
|
-
strikeHidden?: boolean;
|
|
1970
|
-
// (undocumented)
|
|
1971
|
-
strongActive?: boolean;
|
|
1972
|
-
// (undocumented)
|
|
1973
|
-
strongDisabled?: boolean;
|
|
1974
|
-
// (undocumented)
|
|
1975
|
-
strongHidden?: boolean;
|
|
1976
|
-
// (undocumented)
|
|
1977
|
-
subscriptActive?: boolean;
|
|
1978
|
-
// (undocumented)
|
|
1979
|
-
subscriptDisabled?: boolean;
|
|
1980
|
-
// (undocumented)
|
|
1981
|
-
subscriptHidden?: boolean;
|
|
1982
|
-
// (undocumented)
|
|
1983
|
-
superscriptActive?: boolean;
|
|
1984
|
-
// (undocumented)
|
|
1985
|
-
superscriptDisabled?: boolean;
|
|
1986
|
-
// (undocumented)
|
|
1987
|
-
superscriptHidden?: boolean;
|
|
1988
|
-
// (undocumented)
|
|
1989
|
-
underlineActive?: boolean;
|
|
1990
|
-
// (undocumented)
|
|
1991
|
-
underlineDisabled?: boolean;
|
|
1992
|
-
// (undocumented)
|
|
1993
|
-
underlineHidden?: boolean;
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
// @public (undocumented)
|
|
1997
|
-
export const textFormattingStateKey: PluginKey<TextFormattingState>;
|
|
1933
|
+
export { TextFormattingInputMethodBasic }
|
|
1934
|
+
|
|
1935
|
+
export { TextFormattingInputMethodToolbar }
|
|
1936
|
+
|
|
1937
|
+
// @public (undocumented)
|
|
1938
|
+
export const textFormattingPlugin: NextEditorPlugin<'textFormatting', {
|
|
1939
|
+
pluginConfiguration: TextFormattingOptions | undefined;
|
|
1940
|
+
dependencies: [OptionalPlugin<typeof analyticsPlugin>];
|
|
1941
|
+
actions: {
|
|
1942
|
+
toggleSuperscript: ToggleMarkCommand;
|
|
1943
|
+
toggleSuperscriptWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
1944
|
+
toggleSubscript: ToggleMarkCommand;
|
|
1945
|
+
toggleSubscriptWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
1946
|
+
toggleStrike: ToggleMarkCommand;
|
|
1947
|
+
toggleStrikeWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
1948
|
+
toggleCode: ToggleMarkCommand;
|
|
1949
|
+
toggleCodeWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
1950
|
+
toggleUnderline: ToggleMarkCommand;
|
|
1951
|
+
toggleUnderlineWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
1952
|
+
toggleEm: ToggleMarkCommand;
|
|
1953
|
+
toggleEmWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
1954
|
+
toggleStrong: ToggleMarkCommand;
|
|
1955
|
+
toggleStrongWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
1956
|
+
};
|
|
1957
|
+
}>;
|
|
1998
1958
|
|
|
1999
1959
|
// @public (undocumented)
|
|
2000
1960
|
interface TextSelectionData {
|
|
@@ -2007,58 +1967,10 @@ interface TextSelectionData {
|
|
|
2007
1967
|
}
|
|
2008
1968
|
|
|
2009
1969
|
// @public (undocumented)
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
// @public (undocumented)
|
|
2013
|
-
export const toggleCodeWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ inputMethod }: {
|
|
2014
|
-
inputMethod: TextFormattingInputMethodBasic;
|
|
2015
|
-
}) => Command_2;
|
|
2016
|
-
|
|
2017
|
-
// @public (undocumented)
|
|
2018
|
-
export const toggleEm: () => Command_2;
|
|
2019
|
-
|
|
2020
|
-
// @public (undocumented)
|
|
2021
|
-
export const toggleEmWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ inputMethod }: {
|
|
2022
|
-
inputMethod: TextFormattingInputMethodBasic;
|
|
2023
|
-
}) => Command_2;
|
|
2024
|
-
|
|
2025
|
-
// @public (undocumented)
|
|
2026
|
-
export const toggleStrike: () => Command_2;
|
|
2027
|
-
|
|
2028
|
-
// @public (undocumented)
|
|
2029
|
-
export const toggleStrikeWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ inputMethod }: {
|
|
2030
|
-
inputMethod: TextFormattingInputMethodBasic;
|
|
2031
|
-
}) => Command_2;
|
|
2032
|
-
|
|
2033
|
-
// @public (undocumented)
|
|
2034
|
-
export const toggleStrong: () => Command_2;
|
|
2035
|
-
|
|
2036
|
-
// @public (undocumented)
|
|
2037
|
-
export const toggleStrongWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ inputMethod }: {
|
|
2038
|
-
inputMethod: TextFormattingInputMethodBasic;
|
|
2039
|
-
}) => Command_2;
|
|
2040
|
-
|
|
2041
|
-
// @public (undocumented)
|
|
2042
|
-
export const toggleSubscript: () => Command_2;
|
|
2043
|
-
|
|
2044
|
-
// @public (undocumented)
|
|
2045
|
-
export const toggleSubscriptWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ inputMethod }: {
|
|
2046
|
-
inputMethod: TextFormattingInputMethodBasic;
|
|
2047
|
-
}) => Command_2;
|
|
2048
|
-
|
|
2049
|
-
// @public (undocumented)
|
|
2050
|
-
export const toggleSuperscript: () => Command_2;
|
|
2051
|
-
|
|
2052
|
-
// @public (undocumented)
|
|
2053
|
-
export const toggleSuperscriptWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ inputMethod }: {
|
|
2054
|
-
inputMethod: TextFormattingInputMethodBasic;
|
|
2055
|
-
}) => Command_2;
|
|
2056
|
-
|
|
2057
|
-
// @public (undocumented)
|
|
2058
|
-
export const toggleUnderline: () => Command_2;
|
|
1970
|
+
type ToggleMarkCommand = () => Command_2;
|
|
2059
1971
|
|
|
2060
1972
|
// @public (undocumented)
|
|
2061
|
-
|
|
1973
|
+
type ToggleMarkWithAnalyticsCommand = (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (analyticsMetadata: {
|
|
2062
1974
|
inputMethod: TextFormattingInputMethodBasic;
|
|
2063
1975
|
}) => Command_2;
|
|
2064
1976
|
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.textFormattingStyles = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _react = require("@emotion/react");
|
|
10
|
-
var _styles = require("@atlaskit/editor-common/styles");
|
|
11
|
-
var _templateObject;
|
|
12
|
-
var textFormattingStyles = function textFormattingStyles(props) {
|
|
13
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n"])), (0, _styles.codeMarkSharedStyles)(props));
|
|
14
|
-
};
|
|
15
|
-
exports.textFormattingStyles = textFormattingStyles;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.toolbarMessages = void 0;
|
|
7
|
-
var _reactIntlNext = require("react-intl-next");
|
|
8
|
-
var toolbarMessages = (0, _reactIntlNext.defineMessages)({
|
|
9
|
-
underline: {
|
|
10
|
-
id: 'fabric.editor.underline',
|
|
11
|
-
defaultMessage: 'Underline',
|
|
12
|
-
description: 'Whether the text selection has underlined text'
|
|
13
|
-
},
|
|
14
|
-
strike: {
|
|
15
|
-
id: 'fabric.editor.strike',
|
|
16
|
-
defaultMessage: 'Strikethrough',
|
|
17
|
-
description: 'Whether the text selection has crossed out text'
|
|
18
|
-
},
|
|
19
|
-
code: {
|
|
20
|
-
id: 'fabric.editor.code',
|
|
21
|
-
defaultMessage: 'Code',
|
|
22
|
-
description: 'Whether the text selection has monospaced/code font'
|
|
23
|
-
},
|
|
24
|
-
codeOn: {
|
|
25
|
-
id: 'fabric.editor.code.on',
|
|
26
|
-
defaultMessage: '{textFormattingOff}, Code On',
|
|
27
|
-
description: 'Reports that code formatting has been turned on'
|
|
28
|
-
},
|
|
29
|
-
subscript: {
|
|
30
|
-
id: 'fabric.editor.subscript',
|
|
31
|
-
defaultMessage: 'Subscript',
|
|
32
|
-
description: 'Whether the text selection is written below the line in a slightly smaller size'
|
|
33
|
-
},
|
|
34
|
-
subscriptOffSuperscriptOn: {
|
|
35
|
-
id: 'fabric.editor.subscript.off.superscript.on',
|
|
36
|
-
defaultMessage: 'Subscript Off, Superscript On',
|
|
37
|
-
description: 'Reports text formatting in case when subscript off and superscript on'
|
|
38
|
-
},
|
|
39
|
-
superscript: {
|
|
40
|
-
id: 'fabric.editor.superscript',
|
|
41
|
-
defaultMessage: 'Superscript',
|
|
42
|
-
description: 'Whether the text selection is written above the line in a slightly smaller size'
|
|
43
|
-
},
|
|
44
|
-
superscriptOffSubscriptOn: {
|
|
45
|
-
id: 'fabric.editor.superscript.off.subscript.on',
|
|
46
|
-
defaultMessage: 'Superscript Off, Subscript On',
|
|
47
|
-
description: 'Describe text formatting in case when Superscript Off and Subscript on'
|
|
48
|
-
},
|
|
49
|
-
clearFormatting: {
|
|
50
|
-
id: 'fabric.editor.clearFormatting',
|
|
51
|
-
defaultMessage: 'Clear formatting',
|
|
52
|
-
description: 'Remove all rich text formatting from the selected text'
|
|
53
|
-
},
|
|
54
|
-
moreFormatting: {
|
|
55
|
-
id: 'fabric.editor.moreFormatting',
|
|
56
|
-
defaultMessage: 'More formatting',
|
|
57
|
-
description: 'Clicking this will show a menu with additional formatting options'
|
|
58
|
-
},
|
|
59
|
-
bold: {
|
|
60
|
-
id: 'fabric.editor.bold',
|
|
61
|
-
defaultMessage: 'Bold',
|
|
62
|
-
description: 'This refers to bold or “strong” formatting, indicates that its contents have strong importance, seriousness, or urgency.'
|
|
63
|
-
},
|
|
64
|
-
italic: {
|
|
65
|
-
id: 'fabric.editor.italic',
|
|
66
|
-
defaultMessage: 'Italic',
|
|
67
|
-
description: 'This refers to italics or emphasized formatting.'
|
|
68
|
-
},
|
|
69
|
-
on: {
|
|
70
|
-
id: 'fabric.editor.on',
|
|
71
|
-
defaultMessage: '{formattingType} On',
|
|
72
|
-
description: 'Reports that text formatting has been turned on'
|
|
73
|
-
},
|
|
74
|
-
off: {
|
|
75
|
-
id: 'fabric.editor.off',
|
|
76
|
-
defaultMessage: '{formattingType} Off',
|
|
77
|
-
description: 'Reports that text formatting has been turned off'
|
|
78
|
-
},
|
|
79
|
-
textFormattingOff: {
|
|
80
|
-
id: 'fabric.editor.text.formatting.off',
|
|
81
|
-
defaultMessage: 'Text formatting Off',
|
|
82
|
-
description: 'Reports that text formatting has been turned off'
|
|
83
|
-
},
|
|
84
|
-
navigateToEditorToolbar: {
|
|
85
|
-
id: 'fabric.editor.navigate.toolbar.editor',
|
|
86
|
-
defaultMessage: 'Navigate to editor toolbar',
|
|
87
|
-
description: 'Navigate to the main editor toolbar.'
|
|
88
|
-
},
|
|
89
|
-
navigateToFloatingToolbar: {
|
|
90
|
-
id: 'fabric.editor.navigate.toolbar.floating',
|
|
91
|
-
defaultMessage: 'Navigate to floating toolbar',
|
|
92
|
-
description: 'Navigate to a floating toolbar for relevant nodes (e.g. tables or panels).'
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
exports.toolbarMessages = toolbarMessages;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { defineMessages } from 'react-intl-next';
|
|
2
|
-
export const toolbarMessages = defineMessages({
|
|
3
|
-
underline: {
|
|
4
|
-
id: 'fabric.editor.underline',
|
|
5
|
-
defaultMessage: 'Underline',
|
|
6
|
-
description: 'Whether the text selection has underlined text'
|
|
7
|
-
},
|
|
8
|
-
strike: {
|
|
9
|
-
id: 'fabric.editor.strike',
|
|
10
|
-
defaultMessage: 'Strikethrough',
|
|
11
|
-
description: 'Whether the text selection has crossed out text'
|
|
12
|
-
},
|
|
13
|
-
code: {
|
|
14
|
-
id: 'fabric.editor.code',
|
|
15
|
-
defaultMessage: 'Code',
|
|
16
|
-
description: 'Whether the text selection has monospaced/code font'
|
|
17
|
-
},
|
|
18
|
-
codeOn: {
|
|
19
|
-
id: 'fabric.editor.code.on',
|
|
20
|
-
defaultMessage: '{textFormattingOff}, Code On',
|
|
21
|
-
description: 'Reports that code formatting has been turned on'
|
|
22
|
-
},
|
|
23
|
-
subscript: {
|
|
24
|
-
id: 'fabric.editor.subscript',
|
|
25
|
-
defaultMessage: 'Subscript',
|
|
26
|
-
description: 'Whether the text selection is written below the line in a slightly smaller size'
|
|
27
|
-
},
|
|
28
|
-
subscriptOffSuperscriptOn: {
|
|
29
|
-
id: 'fabric.editor.subscript.off.superscript.on',
|
|
30
|
-
defaultMessage: 'Subscript Off, Superscript On',
|
|
31
|
-
description: 'Reports text formatting in case when subscript off and superscript on'
|
|
32
|
-
},
|
|
33
|
-
superscript: {
|
|
34
|
-
id: 'fabric.editor.superscript',
|
|
35
|
-
defaultMessage: 'Superscript',
|
|
36
|
-
description: 'Whether the text selection is written above the line in a slightly smaller size'
|
|
37
|
-
},
|
|
38
|
-
superscriptOffSubscriptOn: {
|
|
39
|
-
id: 'fabric.editor.superscript.off.subscript.on',
|
|
40
|
-
defaultMessage: 'Superscript Off, Subscript On',
|
|
41
|
-
description: 'Describe text formatting in case when Superscript Off and Subscript on'
|
|
42
|
-
},
|
|
43
|
-
clearFormatting: {
|
|
44
|
-
id: 'fabric.editor.clearFormatting',
|
|
45
|
-
defaultMessage: 'Clear formatting',
|
|
46
|
-
description: 'Remove all rich text formatting from the selected text'
|
|
47
|
-
},
|
|
48
|
-
moreFormatting: {
|
|
49
|
-
id: 'fabric.editor.moreFormatting',
|
|
50
|
-
defaultMessage: 'More formatting',
|
|
51
|
-
description: 'Clicking this will show a menu with additional formatting options'
|
|
52
|
-
},
|
|
53
|
-
bold: {
|
|
54
|
-
id: 'fabric.editor.bold',
|
|
55
|
-
defaultMessage: 'Bold',
|
|
56
|
-
description: 'This refers to bold or “strong” formatting, indicates that its contents have strong importance, seriousness, or urgency.'
|
|
57
|
-
},
|
|
58
|
-
italic: {
|
|
59
|
-
id: 'fabric.editor.italic',
|
|
60
|
-
defaultMessage: 'Italic',
|
|
61
|
-
description: 'This refers to italics or emphasized formatting.'
|
|
62
|
-
},
|
|
63
|
-
on: {
|
|
64
|
-
id: 'fabric.editor.on',
|
|
65
|
-
defaultMessage: '{formattingType} On',
|
|
66
|
-
description: 'Reports that text formatting has been turned on'
|
|
67
|
-
},
|
|
68
|
-
off: {
|
|
69
|
-
id: 'fabric.editor.off',
|
|
70
|
-
defaultMessage: '{formattingType} Off',
|
|
71
|
-
description: 'Reports that text formatting has been turned off'
|
|
72
|
-
},
|
|
73
|
-
textFormattingOff: {
|
|
74
|
-
id: 'fabric.editor.text.formatting.off',
|
|
75
|
-
defaultMessage: 'Text formatting Off',
|
|
76
|
-
description: 'Reports that text formatting has been turned off'
|
|
77
|
-
},
|
|
78
|
-
navigateToEditorToolbar: {
|
|
79
|
-
id: 'fabric.editor.navigate.toolbar.editor',
|
|
80
|
-
defaultMessage: 'Navigate to editor toolbar',
|
|
81
|
-
description: 'Navigate to the main editor toolbar.'
|
|
82
|
-
},
|
|
83
|
-
navigateToFloatingToolbar: {
|
|
84
|
-
id: 'fabric.editor.navigate.toolbar.floating',
|
|
85
|
-
defaultMessage: 'Navigate to floating toolbar',
|
|
86
|
-
description: 'Navigate to a floating toolbar for relevant nodes (e.g. tables or panels).'
|
|
87
|
-
}
|
|
88
|
-
});
|