@atlaskit/editor-core 182.0.3 → 182.1.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/.eslintrc.js +2 -0
- package/CHANGELOG.md +40 -0
- package/README.md +20 -0
- package/architecture/0001-record-architecture-decisions.md +25 -0
- package/architecture/0002-deep-equality-check-for-getsharedstate.md +67 -0
- package/architecture/0003-explicit-plugin-dependencies.md +291 -0
- package/dist/cjs/actions/index.js +17 -6
- package/dist/cjs/analytics-api/attach-payload-into-transaction.js +2 -1
- package/dist/cjs/create-editor/ErrorBoundary.js +1 -16
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +3 -3
- package/dist/cjs/editor-next/editor-internal.js +2 -1
- package/dist/cjs/editor-next/index.js +5 -1
- package/dist/cjs/editor.js +9 -5
- package/dist/cjs/keymaps/index.js +12 -0
- package/dist/cjs/labs/next/internal/hooks/use-editor/index.js +5 -7
- package/dist/cjs/labs/next/presets/default.js +1 -2
- package/dist/cjs/plugins/card/index.js +16 -5
- package/dist/cjs/plugins/card/pm-plugins/actions.js +10 -1
- package/dist/cjs/plugins/card/pm-plugins/analytics/create-analytics-queue.js +48 -0
- package/dist/cjs/plugins/card/pm-plugins/analytics/events-from-tr.js +337 -0
- package/dist/cjs/plugins/card/pm-plugins/analytics/index.js +19 -0
- package/dist/cjs/plugins/card/pm-plugins/analytics/types.js +5 -0
- package/dist/cjs/plugins/card/pm-plugins/analytics/utils.js +139 -0
- package/dist/cjs/plugins/card/pm-plugins/doc.js +99 -22
- package/dist/cjs/plugins/card/pm-plugins/main.js +16 -10
- package/dist/cjs/plugins/card/pm-plugins/reducers.js +7 -0
- package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +3 -7
- package/dist/cjs/plugins/card/toolbar.js +18 -8
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +12 -8
- package/dist/cjs/plugins/card/ui/EditorSmartCardEventsNext.js +202 -0
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +12 -4
- package/dist/cjs/plugins/card/utils.js +4 -2
- package/dist/cjs/plugins/extension/context-panel.js +3 -2
- package/dist/cjs/plugins/extension/index.js +4 -1
- package/dist/cjs/plugins/help-dialog/ui/index.js +29 -8
- package/dist/cjs/plugins/hyperlink/Toolbar.js +12 -2
- package/dist/cjs/plugins/hyperlink/commands.js +9 -5
- package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +4 -0
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +2 -2
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/insert-block/index.js +5 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +25 -23
- package/dist/cjs/plugins/media/index.js +9 -5
- package/dist/cjs/plugins/media/pm-plugins/main.js +5 -4
- package/dist/cjs/plugins/media/utils/media-single.js +1 -4
- package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +2 -1
- package/dist/cjs/plugins/paste/handlers.js +5 -5
- package/dist/cjs/plugins/paste/index.js +4 -2
- package/dist/cjs/plugins/paste/pm-plugins/main.js +6 -4
- package/dist/cjs/plugins/rule/commands.js +2 -2
- package/dist/cjs/plugins/rule/index.js +5 -4
- package/dist/cjs/plugins/rule/pm-plugins/input-rule.js +6 -8
- package/dist/cjs/plugins/rule/pm-plugins/keymap.js +2 -2
- package/dist/cjs/plugins/text-color/index.js +5 -2
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +3 -4
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +10 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +2 -4
- package/dist/cjs/ui/ColorPalette/index.js +6 -0
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +15 -10
- package/dist/cjs/ui/ConfigPanel/ConfigPanelFieldsLoader.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +248 -17
- package/dist/cjs/ui/ConfigPanel/FormContent.js +12 -6
- package/dist/cjs/ui/ConfigPanel/utils.js +2 -12
- package/dist/cjs/ui/ContentStyles/index.js +2 -5
- package/dist/cjs/ui/MediaAndEmbedsToolbar/index.js +16 -8
- package/dist/cjs/utils/document.js +5 -3
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +10 -4
- package/dist/es2019/analytics-api/attach-payload-into-transaction.js +2 -1
- package/dist/es2019/create-editor/ErrorBoundary.js +1 -13
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +2 -2
- package/dist/es2019/editor-next/editor-internal.js +2 -1
- package/dist/es2019/editor-next/index.js +5 -1
- package/dist/es2019/editor.js +5 -2
- package/dist/es2019/keymaps/index.js +1 -1
- package/dist/es2019/labs/next/internal/hooks/use-editor/index.js +4 -6
- package/dist/es2019/labs/next/presets/default.js +1 -2
- package/dist/es2019/plugins/card/index.js +15 -5
- package/dist/es2019/plugins/card/pm-plugins/actions.js +4 -0
- package/dist/es2019/plugins/card/pm-plugins/analytics/create-analytics-queue.js +38 -0
- package/dist/es2019/plugins/card/pm-plugins/analytics/events-from-tr.js +316 -0
- package/dist/es2019/plugins/card/pm-plugins/analytics/index.js +2 -0
- package/dist/es2019/plugins/card/pm-plugins/analytics/types.js +1 -0
- package/dist/es2019/plugins/card/pm-plugins/analytics/utils.js +124 -0
- package/dist/es2019/plugins/card/pm-plugins/doc.js +94 -20
- package/dist/es2019/plugins/card/pm-plugins/main.js +17 -8
- package/dist/es2019/plugins/card/pm-plugins/reducers.js +8 -0
- package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +3 -7
- package/dist/es2019/plugins/card/toolbar.js +16 -8
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +13 -9
- package/dist/es2019/plugins/card/ui/EditorSmartCardEventsNext.js +180 -0
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +11 -2
- package/dist/es2019/plugins/card/utils.js +6 -2
- package/dist/es2019/plugins/extension/context-panel.js +3 -2
- package/dist/es2019/plugins/extension/index.js +45 -41
- package/dist/es2019/plugins/help-dialog/ui/index.js +17 -1
- package/dist/es2019/plugins/hyperlink/Toolbar.js +13 -4
- package/dist/es2019/plugins/hyperlink/commands.js +9 -6
- package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +4 -0
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +2 -2
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/insert-block/index.js +96 -91
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +3 -2
- package/dist/es2019/plugins/media/index.js +202 -198
- package/dist/es2019/plugins/media/pm-plugins/main.js +5 -4
- package/dist/es2019/plugins/media/utils/media-single.js +1 -5
- package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +3 -2
- package/dist/es2019/plugins/paste/handlers.js +6 -6
- package/dist/es2019/plugins/paste/index.js +18 -14
- package/dist/es2019/plugins/paste/pm-plugins/main.js +7 -5
- package/dist/es2019/plugins/rule/commands.js +2 -2
- package/dist/es2019/plugins/rule/index.js +49 -46
- package/dist/es2019/plugins/rule/pm-plugins/input-rule.js +6 -7
- package/dist/es2019/plugins/rule/pm-plugins/keymap.js +2 -2
- package/dist/es2019/plugins/text-color/index.js +49 -44
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +3 -3
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +10 -0
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +2 -4
- package/dist/es2019/ui/ColorPalette/index.js +2 -2
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +8 -4
- package/dist/es2019/ui/ConfigPanel/ConfigPanelFieldsLoader.js +3 -1
- package/dist/es2019/ui/ConfigPanel/Fields/ColorPicker.js +238 -13
- package/dist/es2019/ui/ConfigPanel/FormContent.js +12 -6
- package/dist/es2019/ui/ConfigPanel/utils.js +1 -11
- package/dist/es2019/ui/ContentStyles/index.js +2 -5
- package/dist/es2019/ui/MediaAndEmbedsToolbar/index.js +12 -10
- package/dist/es2019/utils/document.js +5 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +17 -6
- package/dist/esm/analytics-api/attach-payload-into-transaction.js +2 -1
- package/dist/esm/create-editor/ErrorBoundary.js +1 -16
- package/dist/esm/create-editor/ReactEditorViewInternal.js +2 -2
- package/dist/esm/editor-next/editor-internal.js +2 -1
- package/dist/esm/editor-next/index.js +5 -1
- package/dist/esm/editor.js +9 -5
- package/dist/esm/keymaps/index.js +1 -1
- package/dist/esm/labs/next/internal/hooks/use-editor/index.js +4 -6
- package/dist/esm/labs/next/presets/default.js +1 -2
- package/dist/esm/plugins/card/index.js +13 -5
- package/dist/esm/plugins/card/pm-plugins/actions.js +8 -0
- package/dist/esm/plugins/card/pm-plugins/analytics/create-analytics-queue.js +41 -0
- package/dist/esm/plugins/card/pm-plugins/analytics/events-from-tr.js +328 -0
- package/dist/esm/plugins/card/pm-plugins/analytics/index.js +2 -0
- package/dist/esm/plugins/card/pm-plugins/analytics/types.js +1 -0
- package/dist/esm/plugins/card/pm-plugins/analytics/utils.js +124 -0
- package/dist/esm/plugins/card/pm-plugins/doc.js +98 -22
- package/dist/esm/plugins/card/pm-plugins/main.js +16 -10
- package/dist/esm/plugins/card/pm-plugins/reducers.js +7 -0
- package/dist/esm/plugins/card/pm-plugins/util/resolve.js +3 -7
- package/dist/esm/plugins/card/toolbar.js +18 -8
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +13 -9
- package/dist/esm/plugins/card/ui/EditorSmartCardEventsNext.js +191 -0
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +12 -4
- package/dist/esm/plugins/card/utils.js +4 -2
- package/dist/esm/plugins/extension/context-panel.js +3 -2
- package/dist/esm/plugins/extension/index.js +4 -1
- package/dist/esm/plugins/help-dialog/ui/index.js +29 -8
- package/dist/esm/plugins/hyperlink/Toolbar.js +13 -3
- package/dist/esm/plugins/hyperlink/commands.js +9 -5
- package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +4 -0
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +2 -2
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/insert-block/index.js +5 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +25 -23
- package/dist/esm/plugins/media/index.js +9 -5
- package/dist/esm/plugins/media/pm-plugins/main.js +5 -4
- package/dist/esm/plugins/media/utils/media-single.js +1 -4
- package/dist/esm/plugins/panel/pm-plugins/keymaps.js +3 -2
- package/dist/esm/plugins/paste/handlers.js +6 -6
- package/dist/esm/plugins/paste/index.js +4 -2
- package/dist/esm/plugins/paste/pm-plugins/main.js +7 -5
- package/dist/esm/plugins/rule/commands.js +2 -2
- package/dist/esm/plugins/rule/index.js +5 -4
- package/dist/esm/plugins/rule/pm-plugins/input-rule.js +6 -8
- package/dist/esm/plugins/rule/pm-plugins/keymap.js +2 -2
- package/dist/esm/plugins/text-color/index.js +5 -2
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +3 -4
- package/dist/esm/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +10 -0
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +2 -4
- package/dist/esm/ui/ColorPalette/index.js +2 -2
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +15 -10
- package/dist/esm/ui/ConfigPanel/ConfigPanelFieldsLoader.js +3 -1
- package/dist/esm/ui/ConfigPanel/Fields/ColorPicker.js +244 -19
- package/dist/esm/ui/ConfigPanel/FormContent.js +12 -6
- package/dist/esm/ui/ConfigPanel/utils.js +0 -10
- package/dist/esm/ui/ContentStyles/index.js +2 -5
- package/dist/esm/ui/MediaAndEmbedsToolbar/index.js +16 -8
- package/dist/esm/utils/document.js +5 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +3 -2
- package/dist/types/create-editor/ErrorBoundary.d.ts +2 -2
- package/dist/types/editor-next/index.d.ts +1 -0
- package/dist/types/editor.d.ts +1 -0
- package/dist/types/keymaps/index.d.ts +1 -1
- package/dist/types/labs/next/internal/hooks/use-editor/index.d.ts +2 -1
- package/dist/types/labs/next/presets/cxhtml.d.ts +1 -5
- package/dist/types/labs/next/presets/default.d.ts +2 -10
- package/dist/types/labs/next/presets/mobile.d.ts +1 -5
- package/dist/types/plugins/card/pm-plugins/actions.d.ts +2 -1
- package/dist/types/plugins/card/pm-plugins/analytics/create-analytics-queue.d.ts +10 -0
- package/dist/types/plugins/card/pm-plugins/analytics/events-from-tr.d.ts +17 -0
- package/dist/types/plugins/card/pm-plugins/analytics/index.d.ts +2 -0
- package/dist/types/plugins/card/pm-plugins/analytics/types.d.ts +10 -0
- package/dist/types/plugins/card/pm-plugins/analytics/utils.d.ts +26 -0
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +8 -7
- package/dist/types/plugins/card/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/card/pm-plugins/util/resolve.d.ts +2 -2
- package/dist/types/plugins/card/pm-plugins/util/state.d.ts +3 -0
- package/dist/types/plugins/card/types.d.ts +81 -7
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +2 -1
- package/dist/types/plugins/card/ui/EditorSmartCardEventsNext.d.ts +18 -0
- package/dist/types/plugins/card/utils.d.ts +1 -1
- package/dist/types/plugins/extension/context-panel.d.ts +2 -1
- package/dist/types/plugins/extension/index.d.ts +2 -0
- package/dist/types/plugins/hyperlink/commands.d.ts +3 -2
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +2 -1
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/insert-block/index.d.ts +2 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +2 -1
- package/dist/types/plugins/media/index.d.ts +2 -0
- package/dist/types/plugins/media/pm-plugins/main.d.ts +3 -2
- package/dist/types/plugins/media/utils/media-single.d.ts +1 -1
- package/dist/types/plugins/paste/index.d.ts +2 -0
- package/dist/types/plugins/paste/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/rule/commands.d.ts +2 -1
- package/dist/types/plugins/rule/index.d.ts +5 -1
- package/dist/types/plugins/rule/pm-plugins/input-rule.d.ts +1 -1
- package/dist/types/plugins/rule/pm-plugins/keymap.d.ts +2 -1
- package/dist/types/plugins/text-color/index.d.ts +2 -0
- package/dist/types/plugins/text-color/ui/ToolbarTextColor/index.d.ts +2 -0
- package/dist/types/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +10 -0
- package/dist/types/types/editor-appearance-component.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +2 -0
- package/dist/types/ui/ColorPalette/index.d.ts +2 -2
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +3 -1
- package/dist/types/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +3 -1
- package/dist/types/ui/ConfigPanel/Fields/ColorPicker.d.ts +12 -1
- package/dist/types/ui/ConfigPanel/FormContent.d.ts +2 -2
- package/dist/types/ui/ConfigPanel/types.d.ts +3 -0
- package/dist/types/ui/ConfigPanel/utils.d.ts +0 -1
- package/dist/types/ui/MediaAndEmbedsToolbar/index.d.ts +1 -1
- package/package.json +14 -13
- package/report.api.md +10 -0
- package/dist/cjs/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +0 -12
- package/dist/cjs/plugins/feature-flags-context/get-feature-flags.js +0 -11
- package/dist/cjs/plugins/feature-flags-context/index.js +0 -50
- package/dist/cjs/plugins/feature-flags-context/plugin-key.js +0 -9
- package/dist/es2019/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +0 -1
- package/dist/es2019/plugins/feature-flags-context/get-feature-flags.js +0 -2
- package/dist/es2019/plugins/feature-flags-context/index.js +0 -29
- package/dist/es2019/plugins/feature-flags-context/plugin-key.js +0 -2
- package/dist/esm/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +0 -1
- package/dist/esm/plugins/feature-flags-context/get-feature-flags.js +0 -4
- package/dist/esm/plugins/feature-flags-context/index.js +0 -40
- package/dist/esm/plugins/feature-flags-context/plugin-key.js +0 -2
- package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +0 -1
- package/dist/types/plugins/feature-flags-context/get-feature-flags.d.ts +0 -3
- package/dist/types/plugins/feature-flags-context/index.d.ts +0 -9
- package/dist/types/plugins/feature-flags-context/plugin-key.d.ts +0 -2
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import { jsx, css } from '@emotion/react';
|
|
3
3
|
import { Fragment } from 'react';
|
|
4
4
|
import { Field } from '@atlaskit/form';
|
|
5
|
+
import { hexToEditorTableChartsPaletteColor } from '@atlaskit/editor-palette';
|
|
5
6
|
import { DEFAULT_BORDER_COLOR } from '../../../ui/ColorPalette/Palettes/common';
|
|
6
|
-
import { isValidHex } from '../utils';
|
|
7
7
|
import { validate } from '../utils';
|
|
8
8
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
9
9
|
import { requiredIndicator } from './common/RequiredIndicator';
|
|
10
10
|
import { headingSizes } from '@atlaskit/theme/typography';
|
|
11
11
|
import FieldMessages from '../FieldMessages';
|
|
12
12
|
import ColorPickerButton from '../../ColorPickerButton';
|
|
13
|
-
|
|
13
|
+
import { chartsColorPaletteTooltipMessages } from '../../../ui/ColorPalette';
|
|
14
14
|
/*
|
|
15
15
|
NOTE: color used here are not yet in atlaskit code
|
|
16
16
|
this is part of extended color pack from ADG, which is yet to be release
|
|
@@ -19,7 +19,7 @@ import ColorPickerButton from '../../ColorPickerButton';
|
|
|
19
19
|
Colour sequence source: https://product-fabric.atlassian.net/browse/ED-12650?focusedCommentId=204875
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
const colorPalette = [{
|
|
22
|
+
export const colorPalette = [{
|
|
23
23
|
label: 'Light Blue',
|
|
24
24
|
value: '#7AB2FFFF'
|
|
25
25
|
},
|
|
@@ -125,6 +125,197 @@ const colorPalette = [{
|
|
|
125
125
|
...color,
|
|
126
126
|
border: DEFAULT_BORDER_COLOR
|
|
127
127
|
}));
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Extended chart colors.
|
|
131
|
+
* Decided here https://product-fabric.atlassian.net/wiki/spaces/EUXQ/pages/3477245015/Tokenising+table+charts+color
|
|
132
|
+
*/
|
|
133
|
+
export const extendedColorPalette = [{
|
|
134
|
+
label: 'Darker Blue',
|
|
135
|
+
value: '#003884'
|
|
136
|
+
},
|
|
137
|
+
// 1000
|
|
138
|
+
{
|
|
139
|
+
label: 'Darker Teal',
|
|
140
|
+
value: '#206B74'
|
|
141
|
+
},
|
|
142
|
+
// 1000
|
|
143
|
+
{
|
|
144
|
+
label: 'Darker Green',
|
|
145
|
+
value: '#055C3F'
|
|
146
|
+
},
|
|
147
|
+
// 1000
|
|
148
|
+
{
|
|
149
|
+
label: 'Darker Yellow',
|
|
150
|
+
value: '#946104'
|
|
151
|
+
},
|
|
152
|
+
// 1000
|
|
153
|
+
{
|
|
154
|
+
label: 'Darker Orange',
|
|
155
|
+
value: '#974F0C'
|
|
156
|
+
},
|
|
157
|
+
// 1000
|
|
158
|
+
{
|
|
159
|
+
label: 'Darker Red',
|
|
160
|
+
value: '#A32000'
|
|
161
|
+
},
|
|
162
|
+
// 1000
|
|
163
|
+
{
|
|
164
|
+
label: 'Darker Magenta',
|
|
165
|
+
value: '#943D73'
|
|
166
|
+
},
|
|
167
|
+
// 1000
|
|
168
|
+
{
|
|
169
|
+
label: 'Darker Purple',
|
|
170
|
+
value: '#44368B'
|
|
171
|
+
},
|
|
172
|
+
// 1000
|
|
173
|
+
{
|
|
174
|
+
label: 'Darker Gray',
|
|
175
|
+
value: '#44546F'
|
|
176
|
+
},
|
|
177
|
+
// 1000
|
|
178
|
+
|
|
179
|
+
{
|
|
180
|
+
label: 'Dark Blue',
|
|
181
|
+
value: '#0055CC'
|
|
182
|
+
},
|
|
183
|
+
// 800
|
|
184
|
+
{
|
|
185
|
+
label: 'Dark Teal',
|
|
186
|
+
value: '#1D7F8C'
|
|
187
|
+
},
|
|
188
|
+
// 800
|
|
189
|
+
{
|
|
190
|
+
label: 'Dark Green',
|
|
191
|
+
value: '#177D52'
|
|
192
|
+
},
|
|
193
|
+
// 800
|
|
194
|
+
{
|
|
195
|
+
label: 'Dark Yellow',
|
|
196
|
+
value: '#FF9D00'
|
|
197
|
+
},
|
|
198
|
+
// 800
|
|
199
|
+
{
|
|
200
|
+
label: 'Dark Orange',
|
|
201
|
+
value: '#B65C02'
|
|
202
|
+
},
|
|
203
|
+
// 800
|
|
204
|
+
{
|
|
205
|
+
label: 'Dark Red',
|
|
206
|
+
value: '#D32D03'
|
|
207
|
+
},
|
|
208
|
+
// 800
|
|
209
|
+
{
|
|
210
|
+
label: 'Dark Magenta',
|
|
211
|
+
value: '#CD519D'
|
|
212
|
+
},
|
|
213
|
+
// 800
|
|
214
|
+
{
|
|
215
|
+
label: 'Dark Purple',
|
|
216
|
+
value: '#5A43D0'
|
|
217
|
+
},
|
|
218
|
+
// 800
|
|
219
|
+
{
|
|
220
|
+
label: 'Dark Gray',
|
|
221
|
+
value: '#758195'
|
|
222
|
+
},
|
|
223
|
+
// 800
|
|
224
|
+
|
|
225
|
+
{
|
|
226
|
+
label: 'Blue',
|
|
227
|
+
value: '#247FFF'
|
|
228
|
+
},
|
|
229
|
+
// 600
|
|
230
|
+
{
|
|
231
|
+
label: 'Teal',
|
|
232
|
+
value: '#1D9AAA'
|
|
233
|
+
},
|
|
234
|
+
// 600
|
|
235
|
+
{
|
|
236
|
+
label: 'Green',
|
|
237
|
+
value: '#23A971'
|
|
238
|
+
},
|
|
239
|
+
// 600
|
|
240
|
+
{
|
|
241
|
+
label: 'Yellow',
|
|
242
|
+
value: '#FFBE33'
|
|
243
|
+
},
|
|
244
|
+
// 600
|
|
245
|
+
{
|
|
246
|
+
label: 'Orange',
|
|
247
|
+
value: '#D97008'
|
|
248
|
+
},
|
|
249
|
+
// 600
|
|
250
|
+
{
|
|
251
|
+
label: 'Red',
|
|
252
|
+
value: '#FC552C'
|
|
253
|
+
},
|
|
254
|
+
// 600
|
|
255
|
+
{
|
|
256
|
+
label: 'Magenta',
|
|
257
|
+
value: '#DA62AC'
|
|
258
|
+
},
|
|
259
|
+
// 600
|
|
260
|
+
{
|
|
261
|
+
label: 'Purple',
|
|
262
|
+
value: '#8B77EE'
|
|
263
|
+
},
|
|
264
|
+
// 600
|
|
265
|
+
{
|
|
266
|
+
label: 'Gray',
|
|
267
|
+
value: '#8590A2'
|
|
268
|
+
},
|
|
269
|
+
// 600
|
|
270
|
+
|
|
271
|
+
{
|
|
272
|
+
label: 'Light Blue',
|
|
273
|
+
value: '#7AB2FF'
|
|
274
|
+
},
|
|
275
|
+
// 400
|
|
276
|
+
{
|
|
277
|
+
label: 'Light Teal',
|
|
278
|
+
value: '#60C6D2'
|
|
279
|
+
},
|
|
280
|
+
// 400
|
|
281
|
+
{
|
|
282
|
+
label: 'Light Green',
|
|
283
|
+
value: '#6BE1B0'
|
|
284
|
+
},
|
|
285
|
+
// 400
|
|
286
|
+
{
|
|
287
|
+
label: 'Light Yellow',
|
|
288
|
+
value: '#FFDB57'
|
|
289
|
+
},
|
|
290
|
+
// 400
|
|
291
|
+
{
|
|
292
|
+
label: 'Light Orange',
|
|
293
|
+
value: '#FAA53D'
|
|
294
|
+
},
|
|
295
|
+
// 400
|
|
296
|
+
{
|
|
297
|
+
label: 'Light Red',
|
|
298
|
+
value: '#FF8F73'
|
|
299
|
+
},
|
|
300
|
+
// 400
|
|
301
|
+
{
|
|
302
|
+
label: 'Light Magenta',
|
|
303
|
+
value: '#E774BB'
|
|
304
|
+
},
|
|
305
|
+
// 400
|
|
306
|
+
{
|
|
307
|
+
label: 'Light Purple',
|
|
308
|
+
value: '#B5A7FB'
|
|
309
|
+
},
|
|
310
|
+
// 400
|
|
311
|
+
{
|
|
312
|
+
label: 'Light Gray',
|
|
313
|
+
value: '#8993A5'
|
|
314
|
+
} // 400
|
|
315
|
+
].map(color => ({
|
|
316
|
+
...color,
|
|
317
|
+
border: DEFAULT_BORDER_COLOR
|
|
318
|
+
}));
|
|
128
319
|
const colorPickerWrapper = css`
|
|
129
320
|
display: flex;
|
|
130
321
|
justify-content: space-between;
|
|
@@ -136,29 +327,62 @@ const colorPickerLabel = css`
|
|
|
136
327
|
font-size: ${headingSizes.h400.size}px;
|
|
137
328
|
margin-top: 0;
|
|
138
329
|
`;
|
|
330
|
+
export const EXPANDED_COLOR_PICKER_COLUMNS = 9;
|
|
331
|
+
export const ORIGINAL_COLOR_PICKER_COLUMNS = 5;
|
|
139
332
|
const ColorPicker = props => {
|
|
140
333
|
const {
|
|
141
334
|
name,
|
|
142
335
|
title,
|
|
143
336
|
currentColor,
|
|
144
|
-
colorPalette,
|
|
145
337
|
onChange,
|
|
146
|
-
onFieldChange
|
|
338
|
+
onFieldChange,
|
|
339
|
+
featureFlags
|
|
147
340
|
} = props;
|
|
148
341
|
const onColorChange = color => {
|
|
149
342
|
const colorValue = color.value;
|
|
150
|
-
if (!isValidHex(colorValue)) {
|
|
151
|
-
throw new Error('invalid hex value');
|
|
152
|
-
}
|
|
153
343
|
onChange(colorValue);
|
|
154
344
|
onFieldChange(name, currentColor !== colorValue);
|
|
155
345
|
};
|
|
156
|
-
|
|
346
|
+
const {
|
|
347
|
+
useSomewhatSemanticTextColorNames,
|
|
348
|
+
expandedChartColors
|
|
349
|
+
} = featureFlags !== null && featureFlags !== void 0 ? featureFlags : {
|
|
350
|
+
useSomewhatSemanticTextColorNames: false,
|
|
351
|
+
expandedChartColors: false
|
|
352
|
+
};
|
|
353
|
+
return expandedChartColors ? jsx(ColorPickerButton, {
|
|
354
|
+
title: title
|
|
355
|
+
// Original color palette had hex code with alpha channel.
|
|
356
|
+
// However, alpha channel was always FF, and it was not used
|
|
357
|
+
// Expanded color palette does not have alpha channel, so
|
|
358
|
+
// removing last two characters from hex code with alpha here.
|
|
359
|
+
,
|
|
360
|
+
currentColor: currentColor.substring(0, 7),
|
|
361
|
+
onChange: onColorChange,
|
|
362
|
+
colorPalette: extendedColorPalette,
|
|
363
|
+
hexToPaletteColor: hexToEditorTableChartsPaletteColor,
|
|
364
|
+
paletteColorTooltipMessages: chartsColorPaletteTooltipMessages
|
|
365
|
+
// We did not want to create new FF or update
|
|
366
|
+
// useSomewhatSemanticTextColorNames name
|
|
367
|
+
// because it is temporary and require extra work.
|
|
368
|
+
// So even though it says text color names,
|
|
369
|
+
// we are going to use for all color pickers
|
|
370
|
+
// such as text, background and table charts.
|
|
371
|
+
,
|
|
372
|
+
showSomewhatSemanticTooltips: useSomewhatSemanticTextColorNames,
|
|
373
|
+
cols: EXPANDED_COLOR_PICKER_COLUMNS,
|
|
374
|
+
alignX: "right",
|
|
375
|
+
placement: "ConfigPanel",
|
|
376
|
+
size: {
|
|
377
|
+
width: 3 * gridSize(),
|
|
378
|
+
height: 3 * gridSize()
|
|
379
|
+
}
|
|
380
|
+
}) : jsx(ColorPickerButton, {
|
|
157
381
|
title: title,
|
|
158
382
|
currentColor: currentColor,
|
|
159
383
|
onChange: onColorChange,
|
|
160
384
|
colorPalette: colorPalette,
|
|
161
|
-
cols:
|
|
385
|
+
cols: ORIGINAL_COLOR_PICKER_COLUMNS,
|
|
162
386
|
alignX: "right",
|
|
163
387
|
placement: "ConfigPanel",
|
|
164
388
|
size: {
|
|
@@ -170,7 +394,8 @@ const ColorPicker = props => {
|
|
|
170
394
|
const ColorPickerField = ({
|
|
171
395
|
name,
|
|
172
396
|
field,
|
|
173
|
-
onFieldChange
|
|
397
|
+
onFieldChange,
|
|
398
|
+
featureFlags
|
|
174
399
|
}) => {
|
|
175
400
|
const {
|
|
176
401
|
label,
|
|
@@ -196,9 +421,9 @@ const ColorPickerField = ({
|
|
|
196
421
|
name: name,
|
|
197
422
|
title: label,
|
|
198
423
|
currentColor: fieldProps.value,
|
|
199
|
-
colorPalette: colorPalette,
|
|
200
424
|
onChange: fieldProps.onChange,
|
|
201
|
-
onFieldChange: onFieldChange
|
|
425
|
+
onFieldChange: onFieldChange,
|
|
426
|
+
featureFlags: featureFlags
|
|
202
427
|
})), error && jsx(FieldMessages, {
|
|
203
428
|
error: error,
|
|
204
429
|
description: ""
|
|
@@ -22,7 +22,8 @@ export function FieldComponent({
|
|
|
22
22
|
parentName,
|
|
23
23
|
extensionManifest,
|
|
24
24
|
firstVisibleFieldName,
|
|
25
|
-
onFieldChange
|
|
25
|
+
onFieldChange,
|
|
26
|
+
featureFlags
|
|
26
27
|
}) {
|
|
27
28
|
var _parameters$errors;
|
|
28
29
|
const {
|
|
@@ -67,7 +68,8 @@ export function FieldComponent({
|
|
|
67
68
|
return /*#__PURE__*/React.createElement(ColorPicker, {
|
|
68
69
|
name: parentedName,
|
|
69
70
|
field: field,
|
|
70
|
-
onFieldChange: onFieldChange
|
|
71
|
+
onFieldChange: onFieldChange,
|
|
72
|
+
featureFlags: featureFlags
|
|
71
73
|
});
|
|
72
74
|
case 'date':
|
|
73
75
|
return /*#__PURE__*/React.createElement(Date, {
|
|
@@ -134,7 +136,8 @@ export function FieldComponent({
|
|
|
134
136
|
fields: field.fields,
|
|
135
137
|
parameters: resolvedParameters,
|
|
136
138
|
onFieldChange: onFieldChange,
|
|
137
|
-
extensionManifest: extensionManifest
|
|
139
|
+
extensionManifest: extensionManifest,
|
|
140
|
+
featureFlags: featureFlags
|
|
138
141
|
}));
|
|
139
142
|
}
|
|
140
143
|
case 'tab-group':
|
|
@@ -149,7 +152,8 @@ export function FieldComponent({
|
|
|
149
152
|
fields: tabField.fields,
|
|
150
153
|
parameters: tabParameters,
|
|
151
154
|
onFieldChange: onFieldChange,
|
|
152
|
-
extensionManifest: extensionManifest
|
|
155
|
+
extensionManifest: extensionManifest,
|
|
156
|
+
featureFlags: featureFlags
|
|
153
157
|
});
|
|
154
158
|
};
|
|
155
159
|
return /*#__PURE__*/React.createElement(TabGroup, {
|
|
@@ -182,7 +186,8 @@ export default function FormContent({
|
|
|
182
186
|
onClickRemove,
|
|
183
187
|
onFieldChange,
|
|
184
188
|
firstVisibleFieldName,
|
|
185
|
-
contextIdentifierProvider
|
|
189
|
+
contextIdentifierProvider,
|
|
190
|
+
featureFlags
|
|
186
191
|
}) {
|
|
187
192
|
return /*#__PURE__*/React.createElement(FormErrorBoundary, {
|
|
188
193
|
contextIdentifierProvider: contextIdentifierProvider,
|
|
@@ -195,7 +200,8 @@ export default function FormContent({
|
|
|
195
200
|
parentName: parentName,
|
|
196
201
|
extensionManifest: extensionManifest,
|
|
197
202
|
firstVisibleFieldName: firstVisibleFieldName,
|
|
198
|
-
onFieldChange: onFieldChange
|
|
203
|
+
onFieldChange: onFieldChange,
|
|
204
|
+
featureFlags: featureFlags
|
|
199
205
|
});
|
|
200
206
|
|
|
201
207
|
// only to be supported by String fields at this time
|
|
@@ -36,14 +36,4 @@ export const getSafeParentedName = (name, parentName) => {
|
|
|
36
36
|
};
|
|
37
37
|
const duplicateFieldRegex = /:[0-9]+$/;
|
|
38
38
|
export const isDuplicateField = key => duplicateFieldRegex.test(key);
|
|
39
|
-
export const getNameFromDuplicateField = key => key.replace(duplicateFieldRegex, '');
|
|
40
|
-
|
|
41
|
-
/*
|
|
42
|
-
ColorPickerButton only accepts 8 digit hex alpha values, for example:
|
|
43
|
-
#123fffaa (8 digits, hex alpha)
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
export const isValidHex = color => {
|
|
47
|
-
const hexRegexPattern = new RegExp('^#([a-fA-F0-9]{8})$');
|
|
48
|
-
return hexRegexPattern.test(color);
|
|
49
|
-
};
|
|
39
|
+
export const getNameFromDuplicateField = key => key.replace(duplicateFieldRegex, '');
|
|
@@ -31,7 +31,6 @@ import { statusStyles } from '../../plugins/status/styles';
|
|
|
31
31
|
import { smartCardStyles } from '../../plugins/card/styles';
|
|
32
32
|
import { dateStyles } from '../../plugins/date/styles';
|
|
33
33
|
import { embedCardStyles } from '../../plugins/card/ui/styled';
|
|
34
|
-
import { useFeatureFlags } from '../../plugins/feature-flags-context';
|
|
35
34
|
import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
|
|
36
35
|
const contentStyles = props => css`
|
|
37
36
|
.ProseMirror {
|
|
@@ -160,16 +159,14 @@ const contentStyles = props => css`
|
|
|
160
159
|
`;
|
|
161
160
|
export const createEditorContentStyle = styles => {
|
|
162
161
|
return /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
163
|
-
const featureFlags = useFeatureFlags();
|
|
164
162
|
const {
|
|
165
163
|
className,
|
|
166
164
|
children
|
|
167
165
|
} = props;
|
|
168
166
|
const theme = useTheme();
|
|
169
167
|
const memoizedStyle = useMemo(() => contentStyles({
|
|
170
|
-
theme
|
|
171
|
-
|
|
172
|
-
}), [theme, featureFlags]);
|
|
168
|
+
theme
|
|
169
|
+
}), [theme]);
|
|
173
170
|
return jsx("div", {
|
|
174
171
|
className: className,
|
|
175
172
|
ref: ref,
|
|
@@ -135,7 +135,7 @@ const shouldHideLayoutToolbar = (selection, {
|
|
|
135
135
|
}, allowResizingInTables) => {
|
|
136
136
|
return hasParentNodeOfType([nodes.bodiedExtension, nodes.listItem, nodes.expand, nodes.nestedExpand, ...(allowResizingInTables ? [] : [nodes.table])].filter(Boolean))(selection);
|
|
137
137
|
};
|
|
138
|
-
const buildLayoutButtons = (state, intl, nodeType, allowResizing, allowResizingInTables) => {
|
|
138
|
+
const buildLayoutButtons = (state, intl, nodeType, allowResizing, allowResizingInTables, allowWrapping = true, allowAlignment = true) => {
|
|
139
139
|
const {
|
|
140
140
|
selection
|
|
141
141
|
} = state;
|
|
@@ -145,14 +145,16 @@ const buildLayoutButtons = (state, intl, nodeType, allowResizing, allowResizingI
|
|
|
145
145
|
const {
|
|
146
146
|
layout
|
|
147
147
|
} = selection.node.attrs;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
type: 'separator'
|
|
154
|
-
}, ...mapIconsToToolbarItem(breakoutIcons, layout, intl, nodeType)]);
|
|
155
|
-
}
|
|
156
|
-
return toolbarItems;
|
|
148
|
+
const alignmentToolbarItems = allowAlignment ? mapIconsToToolbarItem(alignmentIcons, layout, intl, nodeType) : [];
|
|
149
|
+
const wrappingToolbarItems = allowWrapping ? mapIconsToToolbarItem(wrappingIcons, layout, intl, nodeType) : [];
|
|
150
|
+
const breakOutToolbarItems = !allowResizing ? mapIconsToToolbarItem(breakoutIcons, layout, intl, nodeType) : [];
|
|
151
|
+
const items = [...alignmentToolbarItems, ...getSeparatorBetweenAlignmentAndWrapping(allowAlignment, allowWrapping), ...wrappingToolbarItems, ...getSeparatorBeforeBreakoutItems(allowAlignment, allowWrapping, allowResizing), ...breakOutToolbarItems];
|
|
152
|
+
return items;
|
|
157
153
|
};
|
|
154
|
+
const getSeparatorBetweenAlignmentAndWrapping = (allowAlignment, allowWrapping) => allowAlignment && allowWrapping ? [{
|
|
155
|
+
type: 'separator'
|
|
156
|
+
}] : [];
|
|
157
|
+
const getSeparatorBeforeBreakoutItems = (allowAlignment, allowWrapping, allowResizing) => !allowResizing && (allowAlignment || allowWrapping) ? [{
|
|
158
|
+
type: 'separator'
|
|
159
|
+
}] : [];
|
|
158
160
|
export default buildLayoutButtons;
|
|
@@ -303,10 +303,12 @@ const maySanitizePrivateContent = (entity, providerFactory, sanitizePrivateConte
|
|
|
303
303
|
export const getStepRange = transaction => {
|
|
304
304
|
let from = -1;
|
|
305
305
|
let to = -1;
|
|
306
|
-
transaction.
|
|
307
|
-
|
|
306
|
+
transaction.mapping.maps.forEach((stepMap, index) => {
|
|
307
|
+
stepMap.forEach((oldStart, oldEnd) => {
|
|
308
|
+
const newStart = transaction.mapping.slice(index).map(oldStart, -1);
|
|
309
|
+
const newEnd = transaction.mapping.slice(index).map(oldEnd);
|
|
308
310
|
from = newStart < from || from === -1 ? newStart : from;
|
|
309
|
-
to = newEnd
|
|
311
|
+
to = newEnd > to || to === -1 ? newEnd : to;
|
|
310
312
|
});
|
|
311
313
|
});
|
|
312
314
|
if (from !== -1) {
|
package/dist/es2019/version.json
CHANGED
|
@@ -11,7 +11,6 @@ import { findParentNode, safeInsert } from 'prosemirror-utils';
|
|
|
11
11
|
import { createDispatch } from '../event-dispatcher';
|
|
12
12
|
import { getCollabProvider } from '../plugins/collab-edit/native-collab-provider-plugin';
|
|
13
13
|
import { findNodePosWithLocalId } from '../plugins/extension/utils';
|
|
14
|
-
import { getFeatureFlags } from '../plugins/feature-flags-context/get-feature-flags';
|
|
15
14
|
import { toJSON } from '../utils';
|
|
16
15
|
import { getEditorValueWithMedia, __temporaryFixForConfigPanel as _temporaryFixForConfigPanel } from '../utils/action';
|
|
17
16
|
import deprecationWarnings from '../utils/deprecation-warnings';
|
|
@@ -32,19 +31,19 @@ var EditorActions = /*#__PURE__*/function () {
|
|
|
32
31
|
});
|
|
33
32
|
_defineProperty(this, "getResolvedEditorState", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
34
33
|
var _getCollabProvider;
|
|
35
|
-
var
|
|
34
|
+
var _this$getFeatureFlags, useNativeCollabPlugin, editorValue, editorView;
|
|
36
35
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
37
36
|
while (1) {
|
|
38
37
|
switch (_context.prev = _context.next) {
|
|
39
38
|
case 0:
|
|
39
|
+
_this$getFeatureFlags = _this.getFeatureFlags(), useNativeCollabPlugin = _this$getFeatureFlags.useNativeCollabPlugin;
|
|
40
40
|
if (_this.editorView) {
|
|
41
|
-
_context.next =
|
|
41
|
+
_context.next = 3;
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
44
|
throw new Error('Called getResolvedEditorState before editorView is ready');
|
|
45
|
-
case
|
|
46
|
-
|
|
47
|
-
if (featureFlags.useNativeCollabPlugin) {
|
|
45
|
+
case 3:
|
|
46
|
+
if (useNativeCollabPlugin) {
|
|
48
47
|
_context.next = 10;
|
|
49
48
|
break;
|
|
50
49
|
}
|
|
@@ -90,13 +89,22 @@ var EditorActions = /*#__PURE__*/function () {
|
|
|
90
89
|
value: function _privateGetEventDispatcher() {
|
|
91
90
|
return this.eventDispatcher;
|
|
92
91
|
}
|
|
92
|
+
}, {
|
|
93
|
+
key: "getFeatureFlags",
|
|
94
|
+
value: function getFeatureFlags() {
|
|
95
|
+
return {};
|
|
96
|
+
}
|
|
93
97
|
|
|
94
98
|
// This method needs to be public for EditorContext component.
|
|
95
99
|
}, {
|
|
96
100
|
key: "_privateRegisterEditor",
|
|
97
101
|
value: function _privateRegisterEditor(editorView, eventDispatcher, contentTransformer) {
|
|
102
|
+
var getFeatureFlags = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {
|
|
103
|
+
return {};
|
|
104
|
+
};
|
|
98
105
|
this.contentTransformer = contentTransformer;
|
|
99
106
|
this.eventDispatcher = eventDispatcher;
|
|
107
|
+
this.getFeatureFlags = getFeatureFlags;
|
|
100
108
|
if (!this.editorView && editorView) {
|
|
101
109
|
this.editorView = editorView;
|
|
102
110
|
this.listeners.forEach(function (cb) {
|
|
@@ -118,6 +126,9 @@ var EditorActions = /*#__PURE__*/function () {
|
|
|
118
126
|
this.contentTransformer = undefined;
|
|
119
127
|
this.contentEncode = undefined;
|
|
120
128
|
this.eventDispatcher = undefined;
|
|
129
|
+
this.getFeatureFlags = function () {
|
|
130
|
+
return {};
|
|
131
|
+
};
|
|
121
132
|
}
|
|
122
133
|
}, {
|
|
123
134
|
key: "_privateSubscribe",
|
|
@@ -11,10 +11,11 @@ export var attachPayloadIntoTransaction = function attachPayloadIntoTransaction(
|
|
|
11
11
|
payload = getStateContext(editorState, payload);
|
|
12
12
|
payload = mapActionSubjectIdToAttributes(payload);
|
|
13
13
|
var storedMarks = tr.storedMarks;
|
|
14
|
+
var pos = tr.mapping.map(editorState.selection.$from.pos, -1);
|
|
14
15
|
tr.step(new AnalyticsStep([{
|
|
15
16
|
payload: payload,
|
|
16
17
|
channel: channel
|
|
17
|
-
}], actionsToIgnore,
|
|
18
|
+
}], actionsToIgnore, pos) // We need to create the step based on a position, this prevent split history for relative changes.
|
|
18
19
|
);
|
|
19
20
|
|
|
20
21
|
// When you add a new step all the storedMarks are removed it
|
|
@@ -12,7 +12,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
12
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
13
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
14
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
|
-
import memoizeOne from 'memoize-one';
|
|
16
15
|
import React from 'react';
|
|
17
16
|
import uuid from 'uuid';
|
|
18
17
|
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
@@ -20,7 +19,6 @@ import { IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
|
20
19
|
import { sniffUserBrowserExtensions } from '@atlaskit/editor-common/utils';
|
|
21
20
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../plugins/analytics';
|
|
22
21
|
import { editorAnalyticsChannel } from '../plugins/analytics/consts';
|
|
23
|
-
import { getFeatureFlags } from '../plugins/feature-flags-context';
|
|
24
22
|
import { getDocStructure } from '../utils/document-logger';
|
|
25
23
|
import { WithEditorView } from './WithEditorView';
|
|
26
24
|
import { isOutdatedBrowser } from '@atlaskit/editor-common/utils';
|
|
@@ -35,12 +33,6 @@ export var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component
|
|
|
35
33
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
36
34
|
error: undefined
|
|
37
35
|
});
|
|
38
|
-
_defineProperty(_assertThisInitialized(_this), "getFeatureFlags", memoizeOne(function (editorView) {
|
|
39
|
-
if (!editorView) {
|
|
40
|
-
return {};
|
|
41
|
-
}
|
|
42
|
-
return getFeatureFlags(editorView.state);
|
|
43
|
-
}));
|
|
44
36
|
_defineProperty(_assertThisInitialized(_this), "sendErrorData", /*#__PURE__*/function () {
|
|
45
37
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(analyticsErrorPayload) {
|
|
46
38
|
var _window, _window$navigator;
|
|
@@ -147,20 +139,13 @@ export var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component
|
|
|
147
139
|
docStructure: attributes.docStructure
|
|
148
140
|
};
|
|
149
141
|
});
|
|
142
|
+
_this.featureFlags = props.featureFlags;
|
|
150
143
|
if (props.editorView) {
|
|
151
144
|
_this.experienceStore = ExperienceStore.getInstance(props.editorView);
|
|
152
145
|
}
|
|
153
146
|
return _this;
|
|
154
147
|
}
|
|
155
148
|
_createClass(ErrorBoundaryWithEditorView, [{
|
|
156
|
-
key: "featureFlags",
|
|
157
|
-
get:
|
|
158
|
-
// Memoizing this as react alternative suggestion of https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops
|
|
159
|
-
|
|
160
|
-
function get() {
|
|
161
|
-
return this.getFeatureFlags(this.props.editorView);
|
|
162
|
-
}
|
|
163
|
-
}, {
|
|
164
149
|
key: "componentDidCatch",
|
|
165
150
|
value: function componentDidCatch(error, errorInfo) {
|
|
166
151
|
var _this2 = this;
|
|
@@ -24,7 +24,7 @@ import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
|
24
24
|
import { findChangedNodesFromTransaction, validateNodes, validNode } from '../utils/nodes';
|
|
25
25
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent, FULL_WIDTH_MODE, PLATFORMS, getAnalyticsEventsFromTransaction } from '@atlaskit/editor-common/analytics';
|
|
26
26
|
import { createFeatureFlagsFromProps } from './feature-flags-from-props';
|
|
27
|
-
import { getEnabledFeatureFlagKeys } from '
|
|
27
|
+
import { getEnabledFeatureFlagKeys } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
28
28
|
import { createErrorReporter, createPMPlugins, processPluginsList } from './create-editor';
|
|
29
29
|
import { getDocStructure } from '../utils/document-logger';
|
|
30
30
|
import { isFullPage } from '../utils/is-full-page';
|
|
@@ -479,7 +479,7 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
479
479
|
className: getUAPrefix(),
|
|
480
480
|
key: "ProseMirror",
|
|
481
481
|
ref: _this.handleEditorViewRef,
|
|
482
|
-
"aria-label": _this.props.intl.formatMessage(editorMessages.editorAssistiveLabel),
|
|
482
|
+
"aria-label": _this.props.editorProps.assistiveLabel ? _this.props.editorProps.assistiveLabel : _this.props.intl.formatMessage(editorMessages.editorAssistiveLabel),
|
|
483
483
|
role: "textbox"
|
|
484
484
|
}));
|
|
485
485
|
_this.pluginInjectionAPI = new EditorPluginInjectionAPI({
|
|
@@ -69,7 +69,8 @@ export function EditorInternalWithoutHooks(_ref) {
|
|
|
69
69
|
useShallow: useShallow
|
|
70
70
|
}), jsx(ErrorBoundary, {
|
|
71
71
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
72
|
-
contextIdentifierProvider: props.contextIdentifierProvider
|
|
72
|
+
contextIdentifierProvider: props.contextIdentifierProvider,
|
|
73
|
+
featureFlags: featureFlags
|
|
73
74
|
}, jsx(WidthProvider, {
|
|
74
75
|
css: css({
|
|
75
76
|
height: '100%'
|
|
@@ -26,6 +26,7 @@ import { defaultProps, propTypes } from './utils/editorPropTypes';
|
|
|
26
26
|
import trackEditorActions from './utils/trackEditorActions';
|
|
27
27
|
import _onEditorCreated from './utils/onEditorCreated';
|
|
28
28
|
import deprecationWarnings from './utils/deprecationWarnings';
|
|
29
|
+
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
29
30
|
import { basePlugin } from '../plugins';
|
|
30
31
|
var EditorNext = /*#__PURE__*/function (_React$Component) {
|
|
31
32
|
_inherits(EditorNext, _React$Component);
|
|
@@ -47,6 +48,9 @@ var EditorNext = /*#__PURE__*/function (_React$Component) {
|
|
|
47
48
|
_defineProperty(_assertThisInitialized(_this), "handleAnalyticsEvent", function (data) {
|
|
48
49
|
return fireAnalyticsEvent(_this.createAnalyticsEvent)(data);
|
|
49
50
|
});
|
|
51
|
+
_defineProperty(_assertThisInitialized(_this), "getFeatureFlags", function () {
|
|
52
|
+
return createFeatureFlagsFromProps(_this.props);
|
|
53
|
+
});
|
|
50
54
|
_defineProperty(_assertThisInitialized(_this), "getExperienceStore", function () {
|
|
51
55
|
return _this.experienceStore;
|
|
52
56
|
});
|
|
@@ -84,7 +88,7 @@ var EditorNext = /*#__PURE__*/function (_React$Component) {
|
|
|
84
88
|
}, {
|
|
85
89
|
key: "registerEditorForActions",
|
|
86
90
|
value: function registerEditorForActions(editorView, eventDispatcher, contentTransformer) {
|
|
87
|
-
this.editorActions._privateRegisterEditor(editorView, eventDispatcher, contentTransformer);
|
|
91
|
+
this.editorActions._privateRegisterEditor(editorView, eventDispatcher, contentTransformer, this.getFeatureFlags);
|
|
88
92
|
}
|
|
89
93
|
}, {
|
|
90
94
|
key: "unregisterEditorFromActions",
|