@atlaskit/editor-core 189.1.13 → 189.2.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 +18 -0
- package/dist/cjs/composable-editor/editor-internal.js +22 -1
- package/dist/cjs/create-editor/feature-flags-from-props.js +4 -5
- package/dist/cjs/i18n/cs.js +0 -1
- package/dist/cjs/i18n/da.js +0 -1
- package/dist/cjs/i18n/de.js +0 -1
- package/dist/cjs/i18n/en.js +0 -1
- package/dist/cjs/i18n/en_GB.js +0 -1
- package/dist/cjs/i18n/en_ZZ.js +0 -1
- package/dist/cjs/i18n/es.js +0 -1
- package/dist/cjs/i18n/fi.js +0 -1
- package/dist/cjs/i18n/fr.js +0 -1
- package/dist/cjs/i18n/hu.js +0 -1
- package/dist/cjs/i18n/it.js +0 -1
- package/dist/cjs/i18n/ja.js +0 -1
- package/dist/cjs/i18n/ko.js +0 -1
- package/dist/cjs/i18n/nb.js +0 -1
- package/dist/cjs/i18n/nl.js +0 -1
- package/dist/cjs/i18n/pl.js +0 -1
- package/dist/cjs/i18n/pt_BR.js +0 -1
- package/dist/cjs/i18n/ru.js +0 -1
- package/dist/cjs/i18n/sv.js +0 -1
- package/dist/cjs/i18n/th.js +0 -1
- package/dist/cjs/i18n/tr.js +0 -1
- package/dist/cjs/i18n/uk.js +0 -1
- package/dist/cjs/i18n/vi.js +0 -1
- package/dist/cjs/i18n/zh.js +0 -1
- package/dist/cjs/i18n/zh_TW.js +0 -1
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/presets/universal.js +3 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +10 -8
- package/dist/cjs/ui/ContentStyles/index.js +7 -7
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/editor-internal.js +25 -2
- package/dist/es2019/create-editor/feature-flags-from-props.js +4 -5
- package/dist/es2019/i18n/cs.js +0 -1
- package/dist/es2019/i18n/da.js +0 -1
- package/dist/es2019/i18n/de.js +0 -1
- package/dist/es2019/i18n/en.js +0 -1
- package/dist/es2019/i18n/en_GB.js +0 -1
- package/dist/es2019/i18n/en_ZZ.js +0 -1
- package/dist/es2019/i18n/es.js +0 -1
- package/dist/es2019/i18n/fi.js +0 -1
- package/dist/es2019/i18n/fr.js +0 -1
- package/dist/es2019/i18n/hu.js +0 -1
- package/dist/es2019/i18n/it.js +0 -1
- package/dist/es2019/i18n/ja.js +0 -1
- package/dist/es2019/i18n/ko.js +0 -1
- package/dist/es2019/i18n/nb.js +0 -1
- package/dist/es2019/i18n/nl.js +0 -1
- package/dist/es2019/i18n/pl.js +0 -1
- package/dist/es2019/i18n/pt_BR.js +0 -1
- package/dist/es2019/i18n/ru.js +0 -1
- package/dist/es2019/i18n/sv.js +0 -1
- package/dist/es2019/i18n/th.js +0 -1
- package/dist/es2019/i18n/tr.js +0 -1
- package/dist/es2019/i18n/uk.js +0 -1
- package/dist/es2019/i18n/vi.js +0 -1
- package/dist/es2019/i18n/zh.js +0 -1
- package/dist/es2019/i18n/zh_TW.js +0 -1
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/presets/universal.js +3 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +10 -8
- package/dist/es2019/ui/ContentStyles/index.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/editor-internal.js +23 -2
- package/dist/esm/create-editor/feature-flags-from-props.js +4 -5
- package/dist/esm/i18n/cs.js +0 -1
- package/dist/esm/i18n/da.js +0 -1
- package/dist/esm/i18n/de.js +0 -1
- package/dist/esm/i18n/en.js +0 -1
- package/dist/esm/i18n/en_GB.js +0 -1
- package/dist/esm/i18n/en_ZZ.js +0 -1
- package/dist/esm/i18n/es.js +0 -1
- package/dist/esm/i18n/fi.js +0 -1
- package/dist/esm/i18n/fr.js +0 -1
- package/dist/esm/i18n/hu.js +0 -1
- package/dist/esm/i18n/it.js +0 -1
- package/dist/esm/i18n/ja.js +0 -1
- package/dist/esm/i18n/ko.js +0 -1
- package/dist/esm/i18n/nb.js +0 -1
- package/dist/esm/i18n/nl.js +0 -1
- package/dist/esm/i18n/pl.js +0 -1
- package/dist/esm/i18n/pt_BR.js +0 -1
- package/dist/esm/i18n/ru.js +0 -1
- package/dist/esm/i18n/sv.js +0 -1
- package/dist/esm/i18n/th.js +0 -1
- package/dist/esm/i18n/tr.js +0 -1
- package/dist/esm/i18n/uk.js +0 -1
- package/dist/esm/i18n/vi.js +0 -1
- package/dist/esm/i18n/zh.js +0 -1
- package/dist/esm/i18n/zh_TW.js +0 -1
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/presets/universal.js +3 -2
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +10 -8
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/create-editor/get-ui-component.d.ts +1 -1
- package/dist/types/i18n/cs.d.ts +0 -1
- package/dist/types/i18n/da.d.ts +0 -1
- package/dist/types/i18n/de.d.ts +0 -1
- package/dist/types/i18n/en.d.ts +0 -1
- package/dist/types/i18n/en_GB.d.ts +0 -1
- package/dist/types/i18n/en_ZZ.d.ts +0 -1
- package/dist/types/i18n/es.d.ts +0 -1
- package/dist/types/i18n/fi.d.ts +0 -1
- package/dist/types/i18n/fr.d.ts +0 -1
- package/dist/types/i18n/hu.d.ts +0 -1
- package/dist/types/i18n/it.d.ts +0 -1
- package/dist/types/i18n/ja.d.ts +0 -1
- package/dist/types/i18n/ko.d.ts +0 -1
- package/dist/types/i18n/nb.d.ts +0 -1
- package/dist/types/i18n/nl.d.ts +0 -1
- package/dist/types/i18n/pl.d.ts +0 -1
- package/dist/types/i18n/pt_BR.d.ts +0 -1
- package/dist/types/i18n/ru.d.ts +0 -1
- package/dist/types/i18n/sv.d.ts +0 -1
- package/dist/types/i18n/th.d.ts +0 -1
- package/dist/types/i18n/tr.d.ts +0 -1
- package/dist/types/i18n/uk.d.ts +0 -1
- package/dist/types/i18n/vi.d.ts +0 -1
- package/dist/types/i18n/zh.d.ts +0 -1
- package/dist/types/i18n/zh_TW.d.ts +0 -1
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/insert-block/types.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +1 -1
- package/dist/types/{plugins/panel/styles.d.ts → ui/ContentStyles/panel.d.ts} +1 -1
- package/dist/types-ts4.5/create-editor/get-ui-component.d.ts +1 -1
- package/dist/types-ts4.5/i18n/cs.d.ts +0 -1
- package/dist/types-ts4.5/i18n/da.d.ts +0 -1
- package/dist/types-ts4.5/i18n/de.d.ts +0 -1
- package/dist/types-ts4.5/i18n/en.d.ts +0 -1
- package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -1
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -1
- package/dist/types-ts4.5/i18n/es.d.ts +0 -1
- package/dist/types-ts4.5/i18n/fi.d.ts +0 -1
- package/dist/types-ts4.5/i18n/fr.d.ts +0 -1
- package/dist/types-ts4.5/i18n/hu.d.ts +0 -1
- package/dist/types-ts4.5/i18n/it.d.ts +0 -1
- package/dist/types-ts4.5/i18n/ja.d.ts +0 -1
- package/dist/types-ts4.5/i18n/ko.d.ts +0 -1
- package/dist/types-ts4.5/i18n/nb.d.ts +0 -1
- package/dist/types-ts4.5/i18n/nl.d.ts +0 -1
- package/dist/types-ts4.5/i18n/pl.d.ts +0 -1
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -1
- package/dist/types-ts4.5/i18n/ru.d.ts +0 -1
- package/dist/types-ts4.5/i18n/sv.d.ts +0 -1
- package/dist/types-ts4.5/i18n/th.d.ts +0 -1
- package/dist/types-ts4.5/i18n/tr.d.ts +0 -1
- package/dist/types-ts4.5/i18n/uk.d.ts +0 -1
- package/dist/types-ts4.5/i18n/vi.d.ts +0 -1
- package/dist/types-ts4.5/i18n/zh.d.ts +0 -1
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +1 -1
- package/dist/types-ts4.5/types/editor-props.d.ts +1 -1
- package/dist/types-ts4.5/{plugins/panel/styles.d.ts → ui/ContentStyles/panel.d.ts} +1 -1
- package/package.json +6 -5
- package/report.api.md +1 -8
- package/tmp/api-report-tmp.d.ts +1 -8
- package/dist/cjs/plugins/panel/actions.js +0 -125
- package/dist/cjs/plugins/panel/index.js +0 -215
- package/dist/cjs/plugins/panel/message.js +0 -44
- package/dist/cjs/plugins/panel/nodeviews/panel.js +0 -94
- package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +0 -81
- package/dist/cjs/plugins/panel/pm-plugins/main.js +0 -28
- package/dist/cjs/plugins/panel/toolbar.js +0 -293
- package/dist/cjs/plugins/panel/types.js +0 -8
- package/dist/cjs/plugins/panel/utils.js +0 -53
- package/dist/es2019/plugins/panel/actions.js +0 -116
- package/dist/es2019/plugins/panel/index.js +0 -192
- package/dist/es2019/plugins/panel/message.js +0 -38
- package/dist/es2019/plugins/panel/nodeviews/panel.js +0 -82
- package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +0 -82
- package/dist/es2019/plugins/panel/pm-plugins/main.js +0 -21
- package/dist/es2019/plugins/panel/toolbar.js +0 -280
- package/dist/es2019/plugins/panel/types.js +0 -2
- package/dist/es2019/plugins/panel/utils.js +0 -48
- package/dist/esm/plugins/panel/actions.js +0 -116
- package/dist/esm/plugins/panel/index.js +0 -209
- package/dist/esm/plugins/panel/message.js +0 -38
- package/dist/esm/plugins/panel/nodeviews/panel.js +0 -87
- package/dist/esm/plugins/panel/pm-plugins/keymaps.js +0 -74
- package/dist/esm/plugins/panel/pm-plugins/main.js +0 -22
- package/dist/esm/plugins/panel/toolbar.js +0 -287
- package/dist/esm/plugins/panel/types.js +0 -2
- package/dist/esm/plugins/panel/utils.js +0 -46
- package/dist/types/plugins/panel/actions.d.ts +0 -12
- package/dist/types/plugins/panel/index.d.ts +0 -17
- package/dist/types/plugins/panel/message.d.ts +0 -37
- package/dist/types/plugins/panel/nodeviews/panel.d.ts +0 -36
- package/dist/types/plugins/panel/pm-plugins/keymaps.d.ts +0 -3
- package/dist/types/plugins/panel/pm-plugins/main.d.ts +0 -11
- package/dist/types/plugins/panel/toolbar.d.ts +0 -16
- package/dist/types/plugins/panel/types.d.ts +0 -21
- package/dist/types/plugins/panel/utils.d.ts +0 -5
- package/dist/types-ts4.5/plugins/panel/actions.d.ts +0 -12
- package/dist/types-ts4.5/plugins/panel/index.d.ts +0 -17
- package/dist/types-ts4.5/plugins/panel/message.d.ts +0 -37
- package/dist/types-ts4.5/plugins/panel/nodeviews/panel.d.ts +0 -36
- package/dist/types-ts4.5/plugins/panel/pm-plugins/keymaps.d.ts +0 -3
- package/dist/types-ts4.5/plugins/panel/pm-plugins/main.d.ts +0 -11
- package/dist/types-ts4.5/plugins/panel/toolbar.d.ts +0 -16
- package/dist/types-ts4.5/plugins/panel/types.d.ts +0 -21
- package/dist/types-ts4.5/plugins/panel/utils.d.ts +0 -5
- /package/dist/cjs/{plugins/panel/styles.js → ui/ContentStyles/panel.js} +0 -0
- /package/dist/es2019/{plugins/panel/styles.js → ui/ContentStyles/panel.js} +0 -0
- /package/dist/esm/{plugins/panel/styles.js → ui/ContentStyles/panel.js} +0 -0
|
@@ -62,7 +62,6 @@ declare const _default: {
|
|
|
62
62
|
'fabric.editor.single': string;
|
|
63
63
|
'fabric.editor.success': string;
|
|
64
64
|
'fabric.editor.taskPlaceholder': string;
|
|
65
|
-
'fabric.editor.textColor': string;
|
|
66
65
|
'fabric.editor.threeColumns': string;
|
|
67
66
|
'fabric.editor.threeColumnsWithSidebars': string;
|
|
68
67
|
'fabric.editor.twoColumns': string;
|
|
@@ -62,7 +62,6 @@ declare const _default: {
|
|
|
62
62
|
'fabric.editor.single': string;
|
|
63
63
|
'fabric.editor.success': string;
|
|
64
64
|
'fabric.editor.taskPlaceholder': string;
|
|
65
|
-
'fabric.editor.textColor': string;
|
|
66
65
|
'fabric.editor.threeColumns': string;
|
|
67
66
|
'fabric.editor.threeColumnsWithSidebars': string;
|
|
68
67
|
'fabric.editor.twoColumns': string;
|
|
@@ -62,7 +62,6 @@ declare const _default: {
|
|
|
62
62
|
'fabric.editor.single': string;
|
|
63
63
|
'fabric.editor.success': string;
|
|
64
64
|
'fabric.editor.taskPlaceholder': string;
|
|
65
|
-
'fabric.editor.textColor': string;
|
|
66
65
|
'fabric.editor.threeColumns': string;
|
|
67
66
|
'fabric.editor.threeColumnsWithSidebars': string;
|
|
68
67
|
'fabric.editor.twoColumns': string;
|
|
@@ -62,7 +62,6 @@ declare const _default: {
|
|
|
62
62
|
'fabric.editor.single': string;
|
|
63
63
|
'fabric.editor.success': string;
|
|
64
64
|
'fabric.editor.taskPlaceholder': string;
|
|
65
|
-
'fabric.editor.textColor': string;
|
|
66
65
|
'fabric.editor.threeColumns': string;
|
|
67
66
|
'fabric.editor.threeColumnsWithSidebars': string;
|
|
68
67
|
'fabric.editor.twoColumns': string;
|
|
@@ -62,7 +62,6 @@ declare const _default: {
|
|
|
62
62
|
'fabric.editor.single': string;
|
|
63
63
|
'fabric.editor.success': string;
|
|
64
64
|
'fabric.editor.taskPlaceholder': string;
|
|
65
|
-
'fabric.editor.textColor': string;
|
|
66
65
|
'fabric.editor.threeColumns': string;
|
|
67
66
|
'fabric.editor.threeColumnsWithSidebars': string;
|
|
68
67
|
'fabric.editor.twoColumns': string;
|
|
@@ -7,7 +7,6 @@ export { default as jiraIssuePlugin } from './jira-issue';
|
|
|
7
7
|
export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
|
|
8
8
|
export { default as macroPlugin } from './macro';
|
|
9
9
|
export { default as maxContentSizePlugin } from './max-content-size';
|
|
10
|
-
export { default as panelPlugin } from './panel';
|
|
11
10
|
export { default as pastePlugin } from './paste';
|
|
12
11
|
export { default as tasksAndDecisionsPlugin } from './tasks-and-decisions';
|
|
13
12
|
export { default as breakoutPlugin } from './breakout';
|
|
@@ -9,7 +9,7 @@ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
9
9
|
import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
|
|
10
10
|
import type { BlockTypePlugin } from '@atlaskit/editor-plugin-block-type';
|
|
11
11
|
import type { CodeBlockPlugin } from '../code-block';
|
|
12
|
-
import type { PanelPlugin } from '
|
|
12
|
+
import type { PanelPlugin } from '@atlaskit/editor-plugin-panel';
|
|
13
13
|
import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
|
|
14
14
|
import type { RulePlugin } from '@atlaskit/editor-plugin-rule';
|
|
15
15
|
import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
|
|
@@ -21,7 +21,7 @@ import type { FindReplaceOptions } from '../plugins/find-replace/types';
|
|
|
21
21
|
import type { LayoutPluginOptions } from '@atlaskit/editor-plugin-layout';
|
|
22
22
|
import type { MediaOptions, MediaState } from '@atlaskit/editor-plugin-media/types';
|
|
23
23
|
import type { MentionPluginConfig } from '@atlaskit/editor-plugin-mentions';
|
|
24
|
-
import type { PanelPluginConfig } from '
|
|
24
|
+
import type { PanelPluginConfig } from '@atlaskit/editor-plugin-panel';
|
|
25
25
|
import type { PlaceholderTextOptions } from '@atlaskit/editor-plugin-placeholder-text';
|
|
26
26
|
import type { TextColorPluginConfig } from '@atlaskit/editor-plugin-text-color';
|
|
27
27
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ThemeProps } from '@atlaskit/theme/types';
|
|
1
|
+
import type { ThemeProps } from '@atlaskit/theme/types';
|
|
2
2
|
export declare const panelStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "189.
|
|
3
|
+
"version": "189.2.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
49
49
|
"@atlaskit/avatar": "^21.4.0",
|
|
50
50
|
"@atlaskit/avatar-group": "^9.4.0",
|
|
51
|
-
"@atlaskit/button": "^16.
|
|
51
|
+
"@atlaskit/button": "^16.13.0",
|
|
52
52
|
"@atlaskit/checkbox": "^12.6.0",
|
|
53
53
|
"@atlaskit/code": "^14.6.0",
|
|
54
54
|
"@atlaskit/date": "^0.10.0",
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
"@atlaskit/editor-common": "^76.18.0",
|
|
57
57
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
58
58
|
"@atlaskit/editor-markdown-transformer": "^5.2.5",
|
|
59
|
-
"@atlaskit/editor-palette": "1.5.1",
|
|
60
59
|
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
61
60
|
"@atlaskit/editor-plugin-base": "^0.2.0",
|
|
62
61
|
"@atlaskit/editor-plugin-better-type-history": "^0.1.0",
|
|
@@ -88,6 +87,7 @@
|
|
|
88
87
|
"@atlaskit/editor-plugin-list": "^1.3.0",
|
|
89
88
|
"@atlaskit/editor-plugin-media": "^0.3.0",
|
|
90
89
|
"@atlaskit/editor-plugin-mentions": "^0.1.0",
|
|
90
|
+
"@atlaskit/editor-plugin-panel": "^0.1.0",
|
|
91
91
|
"@atlaskit/editor-plugin-paste": "^0.1.0",
|
|
92
92
|
"@atlaskit/editor-plugin-paste-options-toolbar": "^0.2.0",
|
|
93
93
|
"@atlaskit/editor-plugin-placeholder": "^0.1.0",
|
|
@@ -162,9 +162,10 @@
|
|
|
162
162
|
"@af/editor-libra": "*",
|
|
163
163
|
"@af/integration-testing": "*",
|
|
164
164
|
"@af/visual-regression": "*",
|
|
165
|
-
"@atlaskit/collab-provider": "9.15.
|
|
165
|
+
"@atlaskit/collab-provider": "9.15.4",
|
|
166
166
|
"@atlaskit/dropdown-menu": "^12.1.0",
|
|
167
167
|
"@atlaskit/editor-extension-dropbox": "^0.4.0",
|
|
168
|
+
"@atlaskit/editor-palette": "1.5.1",
|
|
168
169
|
"@atlaskit/flag": "^15.2.0",
|
|
169
170
|
"@atlaskit/icon-object": "^6.3.0",
|
|
170
171
|
"@atlaskit/inline-dialog": "^13.6.0",
|
|
@@ -186,7 +187,7 @@
|
|
|
186
187
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
187
188
|
"@atlassian/editor-extension-link-create": "^0.6.0",
|
|
188
189
|
"@atlassian/feature-flags-test-utils": "^0.1.1",
|
|
189
|
-
"@atlassian/link-picker-plugins": "^23.
|
|
190
|
+
"@atlassian/link-picker-plugins": "^23.2.0",
|
|
190
191
|
"@atlassian/search-provider": "2.4.8",
|
|
191
192
|
"@atlassian/ufo": "^0.2.0",
|
|
192
193
|
"@emotion/jest": "^11.8.0",
|
package/report.api.md
CHANGED
|
@@ -62,6 +62,7 @@ import { MentionProvider } from '@atlaskit/mention/resource';
|
|
|
62
62
|
import { MentionResource } from '@atlaskit/mention/resource';
|
|
63
63
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
64
64
|
import { Node as Node_2 } from '@atlaskit/editor-prosemirror/model';
|
|
65
|
+
import type { PanelPluginConfig } from '@atlaskit/editor-plugin-panel';
|
|
65
66
|
import { PerformanceTracking } from '@atlaskit/editor-common/types';
|
|
66
67
|
import type { PlaceholderTextOptions } from '@atlaskit/editor-plugin-placeholder-text';
|
|
67
68
|
import type { PluginConfig } from '@atlaskit/editor-plugin-table/types';
|
|
@@ -663,14 +664,6 @@ type OnEditorViewStateUpdated = (props: {
|
|
|
663
664
|
readonly newEditorState: Readonly<EditorState>;
|
|
664
665
|
}) => void;
|
|
665
666
|
|
|
666
|
-
// @public (undocumented)
|
|
667
|
-
interface PanelPluginConfig {
|
|
668
|
-
// (undocumented)
|
|
669
|
-
allowCustomPanel?: boolean;
|
|
670
|
-
// (undocumented)
|
|
671
|
-
allowCustomPanelEdit?: boolean;
|
|
672
|
-
}
|
|
673
|
-
|
|
674
667
|
export { PortalProvider };
|
|
675
668
|
|
|
676
669
|
export { PortalProviderAPI };
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ import { MentionProvider } from '@atlaskit/mention/resource';
|
|
|
51
51
|
import { MentionResource } from '@atlaskit/mention/resource';
|
|
52
52
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
53
53
|
import { Node as Node_2 } from '@atlaskit/editor-prosemirror/model';
|
|
54
|
+
import type { PanelPluginConfig } from '@atlaskit/editor-plugin-panel';
|
|
54
55
|
import { PerformanceTracking } from '@atlaskit/editor-common/types';
|
|
55
56
|
import type { PlaceholderTextOptions } from '@atlaskit/editor-plugin-placeholder-text';
|
|
56
57
|
import type { PluginConfig } from '@atlaskit/editor-plugin-table/types';
|
|
@@ -611,14 +612,6 @@ type OnEditorViewStateUpdated = (props: {
|
|
|
611
612
|
readonly newEditorState: Readonly<EditorState>;
|
|
612
613
|
}) => void;
|
|
613
614
|
|
|
614
|
-
// @public (undocumented)
|
|
615
|
-
interface PanelPluginConfig {
|
|
616
|
-
// (undocumented)
|
|
617
|
-
allowCustomPanel?: boolean;
|
|
618
|
-
// (undocumented)
|
|
619
|
-
allowCustomPanelEdit?: boolean;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
615
|
export { PortalProvider }
|
|
623
616
|
|
|
624
617
|
export { PortalProviderAPI }
|
|
@@ -1,125 +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.changePanelType = void 0;
|
|
8
|
-
exports.insertPanelWithAnalytics = insertPanelWithAnalytics;
|
|
9
|
-
exports.removePanel = void 0;
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
12
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
13
|
-
var _adfSchema = require("@atlaskit/adf-schema");
|
|
14
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
15
|
-
var _utils2 = require("./utils");
|
|
16
|
-
var _panel = require("@atlaskit/editor-common/panel");
|
|
17
|
-
var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
|
|
18
|
-
var _utils3 = require("@atlaskit/editor-common/utils");
|
|
19
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
|
-
var removePanel = exports.removePanel = function removePanel(editorAnalyticsAPI) {
|
|
22
|
-
return function (state, dispatch) {
|
|
23
|
-
var nodes = state.schema.nodes,
|
|
24
|
-
tr = state.tr;
|
|
25
|
-
var payload = {
|
|
26
|
-
action: _analytics.ACTION.DELETED,
|
|
27
|
-
actionSubject: _analytics.ACTION_SUBJECT.PANEL,
|
|
28
|
-
attributes: {
|
|
29
|
-
inputMethod: _analytics.INPUT_METHOD.TOOLBAR
|
|
30
|
-
},
|
|
31
|
-
eventType: _analytics.EVENT_TYPE.TRACK
|
|
32
|
-
};
|
|
33
|
-
var deleteTr = tr;
|
|
34
|
-
if ((0, _utils.findSelectedNodeOfType)(nodes.panel)(tr.selection)) {
|
|
35
|
-
deleteTr = (0, _utils.removeSelectedNode)(tr);
|
|
36
|
-
} else if ((0, _utils.findParentNodeOfType)(nodes.panel)(tr.selection)) {
|
|
37
|
-
deleteTr = (0, _utils.removeParentNodeOfType)(nodes.panel)(tr);
|
|
38
|
-
}
|
|
39
|
-
if (!deleteTr) {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
if (dispatch) {
|
|
43
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(deleteTr);
|
|
44
|
-
dispatch(deleteTr);
|
|
45
|
-
}
|
|
46
|
-
return true;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
var changePanelType = exports.changePanelType = function changePanelType(editorAnalyticsAPI) {
|
|
50
|
-
return function (panelType) {
|
|
51
|
-
var panelOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
52
|
-
var allowCustomPanel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
53
|
-
return function (state, dispatch) {
|
|
54
|
-
var nodes = state.schema.nodes,
|
|
55
|
-
tr = state.tr;
|
|
56
|
-
var panelNode = (0, _utils2.findPanel)(state);
|
|
57
|
-
if (panelNode === undefined) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
var newType = panelType;
|
|
61
|
-
var previousType = panelNode.node.attrs.panelType;
|
|
62
|
-
var newTr;
|
|
63
|
-
if (allowCustomPanel) {
|
|
64
|
-
var previousColor = panelNode.node.attrs.panelType === 'custom' ? panelNode.node.attrs.panelColor || 'none' : (0, _panel.getPanelTypeBackgroundNoTokens)(previousType);
|
|
65
|
-
var previousIcon = panelNode.node.attrs.panelIcon;
|
|
66
|
-
var previousIconId = panelNode.node.attrs.panelIconId;
|
|
67
|
-
var previousIconText = panelNode.node.attrs.panelIconText;
|
|
68
|
-
var newPanelOptions = _objectSpread({
|
|
69
|
-
color: previousColor,
|
|
70
|
-
emoji: previousIcon,
|
|
71
|
-
emojiId: previousIconId,
|
|
72
|
-
emojiText: previousIconText
|
|
73
|
-
}, panelOptions);
|
|
74
|
-
newTr = tr.setNodeMarkup(panelNode.pos, nodes.panel, {
|
|
75
|
-
panelIcon: newPanelOptions.emoji,
|
|
76
|
-
panelIconId: newPanelOptions.emojiId,
|
|
77
|
-
panelIconText: newPanelOptions.emojiText,
|
|
78
|
-
panelColor: newPanelOptions.color,
|
|
79
|
-
panelType: panelType
|
|
80
|
-
});
|
|
81
|
-
} else {
|
|
82
|
-
newTr = tr.setNodeMarkup(panelNode.pos, nodes.panel, {
|
|
83
|
-
panelType: panelType
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
var payload = {
|
|
87
|
-
action: _analytics.ACTION.CHANGED_TYPE,
|
|
88
|
-
actionSubject: _analytics.ACTION_SUBJECT.PANEL,
|
|
89
|
-
attributes: {
|
|
90
|
-
newType: newType,
|
|
91
|
-
previousType: previousType
|
|
92
|
-
},
|
|
93
|
-
eventType: _analytics.EVENT_TYPE.TRACK
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
// Select the panel if it was previously selected
|
|
97
|
-
var newTrWithSelection = state.selection instanceof _state.NodeSelection && state.selection.node.type.name === 'panel' ? newTr.setSelection(new _state.NodeSelection(tr.doc.resolve(panelNode.pos))) : newTr;
|
|
98
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(newTrWithSelection);
|
|
99
|
-
newTrWithSelection.setMeta('scrollIntoView', false);
|
|
100
|
-
if (dispatch) {
|
|
101
|
-
dispatch(newTrWithSelection);
|
|
102
|
-
}
|
|
103
|
-
return true;
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
function insertPanelWithAnalytics(inputMethod, analyticsAPI) {
|
|
108
|
-
return (0, _editorAnalytics.withAnalytics)(analyticsAPI, {
|
|
109
|
-
action: _analytics.ACTION.INSERTED,
|
|
110
|
-
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
111
|
-
actionSubjectId: _analytics.ACTION_SUBJECT_ID.PANEL,
|
|
112
|
-
attributes: {
|
|
113
|
-
inputMethod: inputMethod,
|
|
114
|
-
panelType: _adfSchema.PanelType.INFO // only info panels can be inserted via this action
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
eventType: _analytics.EVENT_TYPE.TRACK
|
|
118
|
-
})(function (state, dispatch) {
|
|
119
|
-
var nodes = state.schema.nodes;
|
|
120
|
-
if (nodes.panel && nodes.paragraph) {
|
|
121
|
-
return (0, _utils3.wrapSelectionIn)(nodes.panel)(state, dispatch);
|
|
122
|
-
}
|
|
123
|
-
return false;
|
|
124
|
-
});
|
|
125
|
-
}
|
|
@@ -1,215 +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.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
|
-
var _main = require("./pm-plugins/main");
|
|
11
|
-
var _toolbar = require("./toolbar");
|
|
12
|
-
var _keymaps = _interopRequireDefault(require("./pm-plugins/keymaps"));
|
|
13
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
14
|
-
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
15
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
16
|
-
var _messages = require("@atlaskit/editor-common/messages");
|
|
17
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
18
|
-
var _actions = require("./actions");
|
|
19
|
-
var panelPlugin = function panelPlugin(_ref) {
|
|
20
|
-
var _ref$config = _ref.config,
|
|
21
|
-
options = _ref$config === void 0 ? {} : _ref$config,
|
|
22
|
-
api = _ref.api;
|
|
23
|
-
return {
|
|
24
|
-
name: 'panel',
|
|
25
|
-
nodes: function nodes() {
|
|
26
|
-
var panelNode = (0, _adfSchema.panel)(!!options.allowCustomPanel);
|
|
27
|
-
return [{
|
|
28
|
-
name: 'panel',
|
|
29
|
-
node: panelNode
|
|
30
|
-
}];
|
|
31
|
-
},
|
|
32
|
-
pmPlugins: function pmPlugins() {
|
|
33
|
-
return [{
|
|
34
|
-
name: 'panel',
|
|
35
|
-
plugin: function plugin(_ref2) {
|
|
36
|
-
var providerFactory = _ref2.providerFactory,
|
|
37
|
-
dispatch = _ref2.dispatch;
|
|
38
|
-
return (0, _main.createPlugin)(dispatch, providerFactory, options);
|
|
39
|
-
}
|
|
40
|
-
}, {
|
|
41
|
-
name: 'panelKeyMap',
|
|
42
|
-
plugin: function plugin() {
|
|
43
|
-
return (0, _keymaps.default)();
|
|
44
|
-
}
|
|
45
|
-
}];
|
|
46
|
-
},
|
|
47
|
-
actions: {
|
|
48
|
-
insertPanel: function insertPanel(inputMethod) {
|
|
49
|
-
var _api$analytics;
|
|
50
|
-
return (0, _actions.insertPanelWithAnalytics)(inputMethod, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
pluginsOptions: {
|
|
54
|
-
quickInsert: function quickInsert(_ref3) {
|
|
55
|
-
var formatMessage = _ref3.formatMessage;
|
|
56
|
-
var quickInsertOptions = [{
|
|
57
|
-
id: 'infopanel',
|
|
58
|
-
title: formatMessage(_messages.blockTypeMessages.infoPanel),
|
|
59
|
-
keywords: ['panel'],
|
|
60
|
-
description: formatMessage(_messages.blockTypeMessages.infoPanelDescription),
|
|
61
|
-
priority: 800,
|
|
62
|
-
icon: function icon() {
|
|
63
|
-
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconPanel, null);
|
|
64
|
-
},
|
|
65
|
-
action: function action(insert, state) {
|
|
66
|
-
return createPanelAction({
|
|
67
|
-
state: state,
|
|
68
|
-
attributes: {
|
|
69
|
-
panelType: _adfSchema.PanelType.INFO
|
|
70
|
-
},
|
|
71
|
-
api: api
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}, {
|
|
75
|
-
id: 'notepanel',
|
|
76
|
-
title: formatMessage(_messages.blockTypeMessages.notePanel),
|
|
77
|
-
description: formatMessage(_messages.blockTypeMessages.notePanelDescription),
|
|
78
|
-
priority: 1000,
|
|
79
|
-
icon: function icon() {
|
|
80
|
-
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconPanelNote, null);
|
|
81
|
-
},
|
|
82
|
-
action: function action(insert, state) {
|
|
83
|
-
return createPanelAction({
|
|
84
|
-
state: state,
|
|
85
|
-
attributes: {
|
|
86
|
-
panelType: _adfSchema.PanelType.NOTE
|
|
87
|
-
},
|
|
88
|
-
api: api
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}, {
|
|
92
|
-
id: 'successpanel',
|
|
93
|
-
title: formatMessage(_messages.blockTypeMessages.successPanel),
|
|
94
|
-
description: formatMessage(_messages.blockTypeMessages.successPanelDescription),
|
|
95
|
-
keywords: ['tip'],
|
|
96
|
-
priority: 1000,
|
|
97
|
-
icon: function icon() {
|
|
98
|
-
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconPanelSuccess, null);
|
|
99
|
-
},
|
|
100
|
-
action: function action(insert, state) {
|
|
101
|
-
return createPanelAction({
|
|
102
|
-
state: state,
|
|
103
|
-
attributes: {
|
|
104
|
-
panelType: _adfSchema.PanelType.SUCCESS
|
|
105
|
-
},
|
|
106
|
-
api: api
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
id: 'warningpanel',
|
|
111
|
-
title: formatMessage(_messages.blockTypeMessages.warningPanel),
|
|
112
|
-
description: formatMessage(_messages.blockTypeMessages.warningPanelDescription),
|
|
113
|
-
priority: 1000,
|
|
114
|
-
icon: function icon() {
|
|
115
|
-
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconPanelWarning, null);
|
|
116
|
-
},
|
|
117
|
-
action: function action(insert, state) {
|
|
118
|
-
return createPanelAction({
|
|
119
|
-
state: state,
|
|
120
|
-
attributes: {
|
|
121
|
-
panelType: _adfSchema.PanelType.WARNING
|
|
122
|
-
},
|
|
123
|
-
api: api
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}, {
|
|
127
|
-
id: 'errorpanel',
|
|
128
|
-
title: formatMessage(_messages.blockTypeMessages.errorPanel),
|
|
129
|
-
description: formatMessage(_messages.blockTypeMessages.errorPanelDescription),
|
|
130
|
-
priority: 1000,
|
|
131
|
-
icon: function icon() {
|
|
132
|
-
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconPanelError, null);
|
|
133
|
-
},
|
|
134
|
-
action: function action(insert, state) {
|
|
135
|
-
return createPanelAction({
|
|
136
|
-
state: state,
|
|
137
|
-
attributes: {
|
|
138
|
-
panelType: _adfSchema.PanelType.ERROR
|
|
139
|
-
},
|
|
140
|
-
api: api
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}];
|
|
144
|
-
if (options.allowCustomPanel && options.allowCustomPanelEdit) {
|
|
145
|
-
quickInsertOptions.push({
|
|
146
|
-
id: 'custompanel',
|
|
147
|
-
title: formatMessage(_messages.blockTypeMessages.customPanel),
|
|
148
|
-
description: formatMessage(_messages.blockTypeMessages.customPanelDescription),
|
|
149
|
-
priority: 1000,
|
|
150
|
-
icon: function icon() {
|
|
151
|
-
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconCustomPanel, null);
|
|
152
|
-
},
|
|
153
|
-
action: function action(insert, state) {
|
|
154
|
-
return createPanelAction({
|
|
155
|
-
state: state,
|
|
156
|
-
attributes: {
|
|
157
|
-
panelType: _adfSchema.PanelType.CUSTOM,
|
|
158
|
-
panelIcon: ':rainbow:',
|
|
159
|
-
panelIconId: '1f308',
|
|
160
|
-
panelIconText: '🌈',
|
|
161
|
-
// TODO: https://product-fabric.atlassian.net/browse/DSP-7268
|
|
162
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
163
|
-
panelColor: _colors.T50
|
|
164
|
-
},
|
|
165
|
-
api: api
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
return quickInsertOptions;
|
|
171
|
-
},
|
|
172
|
-
floatingToolbar: function floatingToolbar(state, intl, providerFactory) {
|
|
173
|
-
return (0, _toolbar.getToolbarConfig)(state, intl, options, providerFactory, api);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Creates panel action and wrap selection transaction with analytics for the panel insertion.
|
|
181
|
-
*
|
|
182
|
-
* @example
|
|
183
|
-
* const tr = createPanelAction({
|
|
184
|
-
* state: editorState,
|
|
185
|
-
* attributes: { panelType: 'info' },
|
|
186
|
-
* });
|
|
187
|
-
* if (tr) {
|
|
188
|
-
* applyTransaction(tr);
|
|
189
|
-
* }
|
|
190
|
-
*/
|
|
191
|
-
function createPanelAction(_ref4) {
|
|
192
|
-
var state = _ref4.state,
|
|
193
|
-
attributes = _ref4.attributes,
|
|
194
|
-
api = _ref4.api;
|
|
195
|
-
var tr = (0, _utils.createWrapSelectionTransaction)({
|
|
196
|
-
state: state,
|
|
197
|
-
type: state.schema.nodes.panel,
|
|
198
|
-
nodeAttributes: attributes
|
|
199
|
-
});
|
|
200
|
-
if (tr) {
|
|
201
|
-
var _api$analytics2;
|
|
202
|
-
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
|
|
203
|
-
action: _analytics.ACTION.INSERTED,
|
|
204
|
-
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
205
|
-
actionSubjectId: _analytics.ACTION_SUBJECT_ID.PANEL,
|
|
206
|
-
attributes: {
|
|
207
|
-
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT,
|
|
208
|
-
panelType: attributes.panelType
|
|
209
|
-
},
|
|
210
|
-
eventType: _analytics.EVENT_TYPE.TRACK
|
|
211
|
-
})(tr);
|
|
212
|
-
}
|
|
213
|
-
return tr;
|
|
214
|
-
}
|
|
215
|
-
var _default = exports.default = panelPlugin;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.messages = void 0;
|
|
7
|
-
var _reactIntlNext = require("react-intl-next");
|
|
8
|
-
var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
9
|
-
info: {
|
|
10
|
-
id: 'fabric.editor.info',
|
|
11
|
-
defaultMessage: 'Info',
|
|
12
|
-
description: 'Panels provide a way to highlight text. The info panel has a blue background.'
|
|
13
|
-
},
|
|
14
|
-
note: {
|
|
15
|
-
id: 'fabric.editor.note',
|
|
16
|
-
defaultMessage: 'Note',
|
|
17
|
-
description: 'Panels provide a way to highlight text. The note panel has a purple background.'
|
|
18
|
-
},
|
|
19
|
-
success: {
|
|
20
|
-
id: 'fabric.editor.success',
|
|
21
|
-
defaultMessage: 'Success',
|
|
22
|
-
description: 'Panels provide a way to highlight text. The success panel has a green background.'
|
|
23
|
-
},
|
|
24
|
-
warning: {
|
|
25
|
-
id: 'fabric.editor.warning',
|
|
26
|
-
defaultMessage: 'Warning',
|
|
27
|
-
description: 'Panels provide a way to highlight text. The warning panel has a yellow background.'
|
|
28
|
-
},
|
|
29
|
-
error: {
|
|
30
|
-
id: 'fabric.editor.error',
|
|
31
|
-
defaultMessage: 'Error',
|
|
32
|
-
description: 'Panels provide a way to highlight text. The error panel has a red background.'
|
|
33
|
-
},
|
|
34
|
-
emoji: {
|
|
35
|
-
id: 'fabric.editor.panel.emoji',
|
|
36
|
-
defaultMessage: 'Add emoji',
|
|
37
|
-
description: 'Select the panel icon'
|
|
38
|
-
},
|
|
39
|
-
backgroundColor: {
|
|
40
|
-
id: 'fabric.editor.panel.backgroundColor',
|
|
41
|
-
defaultMessage: 'Background color',
|
|
42
|
-
description: 'Select the panel background color.'
|
|
43
|
-
}
|
|
44
|
-
});
|
|
@@ -1,94 +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.panelIcons = exports.getPanelNodeView = exports.PanelIcon = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
12
|
-
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
13
|
-
var _hint = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/hint"));
|
|
14
|
-
var _adfSchema = require("@atlaskit/adf-schema");
|
|
15
|
-
var _panel = require("@atlaskit/editor-common/panel");
|
|
16
|
-
var _emoji = require("@atlaskit/editor-common/emoji");
|
|
17
|
-
var _utils = require("../utils");
|
|
18
|
-
var _consts = require("@atlaskit/editor-shared-styles/consts");
|
|
19
|
-
var _icons = require("@atlaskit/editor-common/icons");
|
|
20
|
-
var panelIcons = exports.panelIcons = {
|
|
21
|
-
info: _icons.PanelInfoIcon,
|
|
22
|
-
success: _icons.PanelSuccessIcon,
|
|
23
|
-
note: _icons.PanelNoteIcon,
|
|
24
|
-
tip: _hint.default,
|
|
25
|
-
warning: _icons.PanelWarningIcon,
|
|
26
|
-
error: _icons.PanelErrorIcon,
|
|
27
|
-
custom: _icons.PanelInfoIcon
|
|
28
|
-
};
|
|
29
|
-
var PanelIcon = exports.PanelIcon = function PanelIcon(props) {
|
|
30
|
-
var allowCustomPanel = props.allowCustomPanel,
|
|
31
|
-
providerFactory = props.providerFactory,
|
|
32
|
-
_props$panelAttribute = props.panelAttributes,
|
|
33
|
-
panelType = _props$panelAttribute.panelType,
|
|
34
|
-
panelIcon = _props$panelAttribute.panelIcon,
|
|
35
|
-
panelIconId = _props$panelAttribute.panelIconId,
|
|
36
|
-
panelIconText = _props$panelAttribute.panelIconText;
|
|
37
|
-
if (allowCustomPanel && panelIcon && panelType === _adfSchema.PanelType.CUSTOM) {
|
|
38
|
-
return /*#__PURE__*/_react.default.createElement(_emoji.Emoji, {
|
|
39
|
-
providers: providerFactory,
|
|
40
|
-
shortName: panelIcon,
|
|
41
|
-
id: panelIconId,
|
|
42
|
-
fallback: panelIconText,
|
|
43
|
-
showTooltip: false,
|
|
44
|
-
allowTextFallback: false,
|
|
45
|
-
fitToHeight: _consts.akEditorCustomIconSize
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
var Icon = panelIcons[panelType];
|
|
49
|
-
return /*#__PURE__*/_react.default.createElement(Icon, {
|
|
50
|
-
label: "Panel ".concat(panelType)
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
var PanelNodeView = /*#__PURE__*/function () {
|
|
54
|
-
function PanelNodeView(node, view, getPos, pluginOptions, providerFactory) {
|
|
55
|
-
(0, _classCallCheck2.default)(this, PanelNodeView);
|
|
56
|
-
this.providerFactory = providerFactory;
|
|
57
|
-
this.pluginOptions = pluginOptions;
|
|
58
|
-
this.view = view;
|
|
59
|
-
this.node = node;
|
|
60
|
-
var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, (0, _utils.panelAttrsToDom)(node.attrs, pluginOptions.allowCustomPanel || false)),
|
|
61
|
-
dom = _DOMSerializer$render.dom,
|
|
62
|
-
contentDOM = _DOMSerializer$render.contentDOM;
|
|
63
|
-
this.getPos = getPos;
|
|
64
|
-
this.dom = dom;
|
|
65
|
-
this.contentDOM = contentDOM;
|
|
66
|
-
this.icon = this.dom.querySelector(".".concat(_panel.PanelSharedCssClassName.icon));
|
|
67
|
-
if (!this.icon) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
// set contentEditable as false to be able to select the custom panels with keyboard
|
|
71
|
-
this.icon.contentEditable = 'false';
|
|
72
|
-
_reactDom.default.render( /*#__PURE__*/_react.default.createElement(PanelIcon, {
|
|
73
|
-
allowCustomPanel: pluginOptions.allowCustomPanel,
|
|
74
|
-
panelAttributes: node.attrs,
|
|
75
|
-
providerFactory: this.providerFactory
|
|
76
|
-
}), this.icon);
|
|
77
|
-
}
|
|
78
|
-
(0, _createClass2.default)(PanelNodeView, [{
|
|
79
|
-
key: "ignoreMutation",
|
|
80
|
-
value: function ignoreMutation(mutation) {
|
|
81
|
-
// ignore mutation if it caused by the icon.
|
|
82
|
-
var isIcon = mutation.target === this.icon || mutation.target.parentNode === this.icon;
|
|
83
|
-
// ignore mutation if it caused by the lazy load emoji inside icon.
|
|
84
|
-
var isInsideIcon = this.icon.contains(mutation.target);
|
|
85
|
-
return isIcon || isInsideIcon;
|
|
86
|
-
}
|
|
87
|
-
}]);
|
|
88
|
-
return PanelNodeView;
|
|
89
|
-
}();
|
|
90
|
-
var getPanelNodeView = exports.getPanelNodeView = function getPanelNodeView(pluginOptions, providerFactory) {
|
|
91
|
-
return function (node, view, getPos) {
|
|
92
|
-
return new PanelNodeView(node, view, getPos, pluginOptions, providerFactory);
|
|
93
|
-
};
|
|
94
|
-
};
|