@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
|
@@ -4,12 +4,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default = void 0;
|
|
7
|
+
exports.extendedColorPalette = exports.default = exports.colorPalette = exports.ORIGINAL_COLOR_PICKER_COLUMNS = exports.EXPANDED_COLOR_PICKER_COLUMNS = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _react = require("@emotion/react");
|
|
11
11
|
var _react2 = require("react");
|
|
12
12
|
var _form = require("@atlaskit/form");
|
|
13
|
+
var _editorPalette = require("@atlaskit/editor-palette");
|
|
13
14
|
var _common = require("../../../ui/ColorPalette/Palettes/common");
|
|
14
15
|
var _utils = require("../utils");
|
|
15
16
|
var _constants = require("@atlaskit/theme/constants");
|
|
@@ -17,6 +18,7 @@ var _RequiredIndicator = require("./common/RequiredIndicator");
|
|
|
17
18
|
var _typography = require("@atlaskit/theme/typography");
|
|
18
19
|
var _FieldMessages = _interopRequireDefault(require("../FieldMessages"));
|
|
19
20
|
var _ColorPickerButton = _interopRequireDefault(require("../../ColorPickerButton"));
|
|
21
|
+
var _ColorPalette = require("../../../ui/ColorPalette");
|
|
20
22
|
var _templateObject, _templateObject2;
|
|
21
23
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
24
|
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) { (0, _defineProperty2.default)(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; } /** @jsx jsx */
|
|
@@ -135,29 +137,257 @@ var colorPalette = [{
|
|
|
135
137
|
border: _common.DEFAULT_BORDER_COLOR
|
|
136
138
|
});
|
|
137
139
|
});
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Extended chart colors.
|
|
143
|
+
* Decided here https://product-fabric.atlassian.net/wiki/spaces/EUXQ/pages/3477245015/Tokenising+table+charts+color
|
|
144
|
+
*/
|
|
145
|
+
exports.colorPalette = colorPalette;
|
|
146
|
+
var extendedColorPalette = [{
|
|
147
|
+
label: 'Darker Blue',
|
|
148
|
+
value: '#003884'
|
|
149
|
+
},
|
|
150
|
+
// 1000
|
|
151
|
+
{
|
|
152
|
+
label: 'Darker Teal',
|
|
153
|
+
value: '#206B74'
|
|
154
|
+
},
|
|
155
|
+
// 1000
|
|
156
|
+
{
|
|
157
|
+
label: 'Darker Green',
|
|
158
|
+
value: '#055C3F'
|
|
159
|
+
},
|
|
160
|
+
// 1000
|
|
161
|
+
{
|
|
162
|
+
label: 'Darker Yellow',
|
|
163
|
+
value: '#946104'
|
|
164
|
+
},
|
|
165
|
+
// 1000
|
|
166
|
+
{
|
|
167
|
+
label: 'Darker Orange',
|
|
168
|
+
value: '#974F0C'
|
|
169
|
+
},
|
|
170
|
+
// 1000
|
|
171
|
+
{
|
|
172
|
+
label: 'Darker Red',
|
|
173
|
+
value: '#A32000'
|
|
174
|
+
},
|
|
175
|
+
// 1000
|
|
176
|
+
{
|
|
177
|
+
label: 'Darker Magenta',
|
|
178
|
+
value: '#943D73'
|
|
179
|
+
},
|
|
180
|
+
// 1000
|
|
181
|
+
{
|
|
182
|
+
label: 'Darker Purple',
|
|
183
|
+
value: '#44368B'
|
|
184
|
+
},
|
|
185
|
+
// 1000
|
|
186
|
+
{
|
|
187
|
+
label: 'Darker Gray',
|
|
188
|
+
value: '#44546F'
|
|
189
|
+
},
|
|
190
|
+
// 1000
|
|
191
|
+
|
|
192
|
+
{
|
|
193
|
+
label: 'Dark Blue',
|
|
194
|
+
value: '#0055CC'
|
|
195
|
+
},
|
|
196
|
+
// 800
|
|
197
|
+
{
|
|
198
|
+
label: 'Dark Teal',
|
|
199
|
+
value: '#1D7F8C'
|
|
200
|
+
},
|
|
201
|
+
// 800
|
|
202
|
+
{
|
|
203
|
+
label: 'Dark Green',
|
|
204
|
+
value: '#177D52'
|
|
205
|
+
},
|
|
206
|
+
// 800
|
|
207
|
+
{
|
|
208
|
+
label: 'Dark Yellow',
|
|
209
|
+
value: '#FF9D00'
|
|
210
|
+
},
|
|
211
|
+
// 800
|
|
212
|
+
{
|
|
213
|
+
label: 'Dark Orange',
|
|
214
|
+
value: '#B65C02'
|
|
215
|
+
},
|
|
216
|
+
// 800
|
|
217
|
+
{
|
|
218
|
+
label: 'Dark Red',
|
|
219
|
+
value: '#D32D03'
|
|
220
|
+
},
|
|
221
|
+
// 800
|
|
222
|
+
{
|
|
223
|
+
label: 'Dark Magenta',
|
|
224
|
+
value: '#CD519D'
|
|
225
|
+
},
|
|
226
|
+
// 800
|
|
227
|
+
{
|
|
228
|
+
label: 'Dark Purple',
|
|
229
|
+
value: '#5A43D0'
|
|
230
|
+
},
|
|
231
|
+
// 800
|
|
232
|
+
{
|
|
233
|
+
label: 'Dark Gray',
|
|
234
|
+
value: '#758195'
|
|
235
|
+
},
|
|
236
|
+
// 800
|
|
237
|
+
|
|
238
|
+
{
|
|
239
|
+
label: 'Blue',
|
|
240
|
+
value: '#247FFF'
|
|
241
|
+
},
|
|
242
|
+
// 600
|
|
243
|
+
{
|
|
244
|
+
label: 'Teal',
|
|
245
|
+
value: '#1D9AAA'
|
|
246
|
+
},
|
|
247
|
+
// 600
|
|
248
|
+
{
|
|
249
|
+
label: 'Green',
|
|
250
|
+
value: '#23A971'
|
|
251
|
+
},
|
|
252
|
+
// 600
|
|
253
|
+
{
|
|
254
|
+
label: 'Yellow',
|
|
255
|
+
value: '#FFBE33'
|
|
256
|
+
},
|
|
257
|
+
// 600
|
|
258
|
+
{
|
|
259
|
+
label: 'Orange',
|
|
260
|
+
value: '#D97008'
|
|
261
|
+
},
|
|
262
|
+
// 600
|
|
263
|
+
{
|
|
264
|
+
label: 'Red',
|
|
265
|
+
value: '#FC552C'
|
|
266
|
+
},
|
|
267
|
+
// 600
|
|
268
|
+
{
|
|
269
|
+
label: 'Magenta',
|
|
270
|
+
value: '#DA62AC'
|
|
271
|
+
},
|
|
272
|
+
// 600
|
|
273
|
+
{
|
|
274
|
+
label: 'Purple',
|
|
275
|
+
value: '#8B77EE'
|
|
276
|
+
},
|
|
277
|
+
// 600
|
|
278
|
+
{
|
|
279
|
+
label: 'Gray',
|
|
280
|
+
value: '#8590A2'
|
|
281
|
+
},
|
|
282
|
+
// 600
|
|
283
|
+
|
|
284
|
+
{
|
|
285
|
+
label: 'Light Blue',
|
|
286
|
+
value: '#7AB2FF'
|
|
287
|
+
},
|
|
288
|
+
// 400
|
|
289
|
+
{
|
|
290
|
+
label: 'Light Teal',
|
|
291
|
+
value: '#60C6D2'
|
|
292
|
+
},
|
|
293
|
+
// 400
|
|
294
|
+
{
|
|
295
|
+
label: 'Light Green',
|
|
296
|
+
value: '#6BE1B0'
|
|
297
|
+
},
|
|
298
|
+
// 400
|
|
299
|
+
{
|
|
300
|
+
label: 'Light Yellow',
|
|
301
|
+
value: '#FFDB57'
|
|
302
|
+
},
|
|
303
|
+
// 400
|
|
304
|
+
{
|
|
305
|
+
label: 'Light Orange',
|
|
306
|
+
value: '#FAA53D'
|
|
307
|
+
},
|
|
308
|
+
// 400
|
|
309
|
+
{
|
|
310
|
+
label: 'Light Red',
|
|
311
|
+
value: '#FF8F73'
|
|
312
|
+
},
|
|
313
|
+
// 400
|
|
314
|
+
{
|
|
315
|
+
label: 'Light Magenta',
|
|
316
|
+
value: '#E774BB'
|
|
317
|
+
},
|
|
318
|
+
// 400
|
|
319
|
+
{
|
|
320
|
+
label: 'Light Purple',
|
|
321
|
+
value: '#B5A7FB'
|
|
322
|
+
},
|
|
323
|
+
// 400
|
|
324
|
+
{
|
|
325
|
+
label: 'Light Gray',
|
|
326
|
+
value: '#8993A5'
|
|
327
|
+
} // 400
|
|
328
|
+
].map(function (color) {
|
|
329
|
+
return _objectSpread(_objectSpread({}, color), {}, {
|
|
330
|
+
border: _common.DEFAULT_BORDER_COLOR
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
exports.extendedColorPalette = extendedColorPalette;
|
|
138
334
|
var colorPickerWrapper = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: ", "px;\n padding-right: ", "px;\n"])), 4 * (0, _constants.gridSize)(), (0, _constants.gridSize)());
|
|
139
335
|
var colorPickerLabel = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", "px;\n margin-top: 0;\n"])), _typography.headingSizes.h400.size);
|
|
336
|
+
var EXPANDED_COLOR_PICKER_COLUMNS = 9;
|
|
337
|
+
exports.EXPANDED_COLOR_PICKER_COLUMNS = EXPANDED_COLOR_PICKER_COLUMNS;
|
|
338
|
+
var ORIGINAL_COLOR_PICKER_COLUMNS = 5;
|
|
339
|
+
exports.ORIGINAL_COLOR_PICKER_COLUMNS = ORIGINAL_COLOR_PICKER_COLUMNS;
|
|
140
340
|
var ColorPicker = function ColorPicker(props) {
|
|
141
341
|
var name = props.name,
|
|
142
342
|
title = props.title,
|
|
143
343
|
currentColor = props.currentColor,
|
|
144
|
-
colorPalette = props.colorPalette,
|
|
145
344
|
onChange = props.onChange,
|
|
146
|
-
onFieldChange = props.onFieldChange
|
|
345
|
+
onFieldChange = props.onFieldChange,
|
|
346
|
+
featureFlags = props.featureFlags;
|
|
147
347
|
var onColorChange = function onColorChange(color) {
|
|
148
348
|
var colorValue = color.value;
|
|
149
|
-
if (!(0, _utils.isValidHex)(colorValue)) {
|
|
150
|
-
throw new Error('invalid hex value');
|
|
151
|
-
}
|
|
152
349
|
onChange(colorValue);
|
|
153
350
|
onFieldChange(name, currentColor !== colorValue);
|
|
154
351
|
};
|
|
155
|
-
|
|
352
|
+
var _ref = featureFlags !== null && featureFlags !== void 0 ? featureFlags : {
|
|
353
|
+
useSomewhatSemanticTextColorNames: false,
|
|
354
|
+
expandedChartColors: false
|
|
355
|
+
},
|
|
356
|
+
useSomewhatSemanticTextColorNames = _ref.useSomewhatSemanticTextColorNames,
|
|
357
|
+
expandedChartColors = _ref.expandedChartColors;
|
|
358
|
+
return expandedChartColors ? (0, _react.jsx)(_ColorPickerButton.default, {
|
|
359
|
+
title: title
|
|
360
|
+
// Original color palette had hex code with alpha channel.
|
|
361
|
+
// However, alpha channel was always FF, and it was not used
|
|
362
|
+
// Expanded color palette does not have alpha channel, so
|
|
363
|
+
// removing last two characters from hex code with alpha here.
|
|
364
|
+
,
|
|
365
|
+
currentColor: currentColor.substring(0, 7),
|
|
366
|
+
onChange: onColorChange,
|
|
367
|
+
colorPalette: extendedColorPalette,
|
|
368
|
+
hexToPaletteColor: _editorPalette.hexToEditorTableChartsPaletteColor,
|
|
369
|
+
paletteColorTooltipMessages: _ColorPalette.chartsColorPaletteTooltipMessages
|
|
370
|
+
// We did not want to create new FF or update
|
|
371
|
+
// useSomewhatSemanticTextColorNames name
|
|
372
|
+
// because it is temporary and require extra work.
|
|
373
|
+
// So even though it says text color names,
|
|
374
|
+
// we are going to use for all color pickers
|
|
375
|
+
// such as text, background and table charts.
|
|
376
|
+
,
|
|
377
|
+
showSomewhatSemanticTooltips: useSomewhatSemanticTextColorNames,
|
|
378
|
+
cols: EXPANDED_COLOR_PICKER_COLUMNS,
|
|
379
|
+
alignX: "right",
|
|
380
|
+
placement: "ConfigPanel",
|
|
381
|
+
size: {
|
|
382
|
+
width: 3 * (0, _constants.gridSize)(),
|
|
383
|
+
height: 3 * (0, _constants.gridSize)()
|
|
384
|
+
}
|
|
385
|
+
}) : (0, _react.jsx)(_ColorPickerButton.default, {
|
|
156
386
|
title: title,
|
|
157
387
|
currentColor: currentColor,
|
|
158
388
|
onChange: onColorChange,
|
|
159
389
|
colorPalette: colorPalette,
|
|
160
|
-
cols:
|
|
390
|
+
cols: ORIGINAL_COLOR_PICKER_COLUMNS,
|
|
161
391
|
alignX: "right",
|
|
162
392
|
placement: "ConfigPanel",
|
|
163
393
|
size: {
|
|
@@ -166,10 +396,11 @@ var ColorPicker = function ColorPicker(props) {
|
|
|
166
396
|
}
|
|
167
397
|
});
|
|
168
398
|
};
|
|
169
|
-
var ColorPickerField = function ColorPickerField(
|
|
170
|
-
var name =
|
|
171
|
-
field =
|
|
172
|
-
onFieldChange =
|
|
399
|
+
var ColorPickerField = function ColorPickerField(_ref2) {
|
|
400
|
+
var name = _ref2.name,
|
|
401
|
+
field = _ref2.field,
|
|
402
|
+
onFieldChange = _ref2.onFieldChange,
|
|
403
|
+
featureFlags = _ref2.featureFlags;
|
|
173
404
|
var label = field.label,
|
|
174
405
|
defaultValue = field.defaultValue,
|
|
175
406
|
isRequired = field.isRequired;
|
|
@@ -180,9 +411,9 @@ var ColorPickerField = function ColorPickerField(_ref) {
|
|
|
180
411
|
validate: function validate(value) {
|
|
181
412
|
return (0, _utils.validate)(field, value || '');
|
|
182
413
|
}
|
|
183
|
-
}, function (
|
|
184
|
-
var fieldProps =
|
|
185
|
-
error =
|
|
414
|
+
}, function (_ref3) {
|
|
415
|
+
var fieldProps = _ref3.fieldProps,
|
|
416
|
+
error = _ref3.error;
|
|
186
417
|
return (0, _react.jsx)(_react2.Fragment, null, (0, _react.jsx)("div", {
|
|
187
418
|
css: colorPickerWrapper
|
|
188
419
|
}, (0, _react.jsx)("label", {
|
|
@@ -194,9 +425,9 @@ var ColorPickerField = function ColorPickerField(_ref) {
|
|
|
194
425
|
name: name,
|
|
195
426
|
title: label,
|
|
196
427
|
currentColor: fieldProps.value,
|
|
197
|
-
colorPalette: colorPalette,
|
|
198
428
|
onChange: fieldProps.onChange,
|
|
199
|
-
onFieldChange: onFieldChange
|
|
429
|
+
onFieldChange: onFieldChange,
|
|
430
|
+
featureFlags: featureFlags
|
|
200
431
|
})), error && (0, _react.jsx)(_FieldMessages.default, {
|
|
201
432
|
error: error,
|
|
202
433
|
description: ""
|
|
@@ -34,7 +34,8 @@ function FieldComponent(_ref) {
|
|
|
34
34
|
parentName = _ref.parentName,
|
|
35
35
|
extensionManifest = _ref.extensionManifest,
|
|
36
36
|
firstVisibleFieldName = _ref.firstVisibleFieldName,
|
|
37
|
-
onFieldChange = _ref.onFieldChange
|
|
37
|
+
onFieldChange = _ref.onFieldChange,
|
|
38
|
+
featureFlags = _ref.featureFlags;
|
|
38
39
|
var _field = field,
|
|
39
40
|
name = _field.name,
|
|
40
41
|
type = _field.type;
|
|
@@ -75,7 +76,8 @@ function FieldComponent(_ref) {
|
|
|
75
76
|
return /*#__PURE__*/_react.default.createElement(_ColorPicker.default, {
|
|
76
77
|
name: parentedName,
|
|
77
78
|
field: field,
|
|
78
|
-
onFieldChange: onFieldChange
|
|
79
|
+
onFieldChange: onFieldChange,
|
|
80
|
+
featureFlags: featureFlags
|
|
79
81
|
});
|
|
80
82
|
case 'date':
|
|
81
83
|
return /*#__PURE__*/_react.default.createElement(_Date.default, {
|
|
@@ -144,7 +146,8 @@ function FieldComponent(_ref) {
|
|
|
144
146
|
fields: field.fields,
|
|
145
147
|
parameters: resolvedParameters,
|
|
146
148
|
onFieldChange: onFieldChange,
|
|
147
|
-
extensionManifest: extensionManifest
|
|
149
|
+
extensionManifest: extensionManifest,
|
|
150
|
+
featureFlags: featureFlags
|
|
148
151
|
}));
|
|
149
152
|
}
|
|
150
153
|
case 'tab-group':
|
|
@@ -161,7 +164,8 @@ function FieldComponent(_ref) {
|
|
|
161
164
|
fields: tabField.fields,
|
|
162
165
|
parameters: tabParameters,
|
|
163
166
|
onFieldChange: onFieldChange,
|
|
164
|
-
extensionManifest: extensionManifest
|
|
167
|
+
extensionManifest: extensionManifest,
|
|
168
|
+
featureFlags: featureFlags
|
|
165
169
|
});
|
|
166
170
|
};
|
|
167
171
|
return /*#__PURE__*/_react.default.createElement(_TabGroup.default, {
|
|
@@ -193,7 +197,8 @@ function FormContent(_ref3) {
|
|
|
193
197
|
onClickRemove = _ref3.onClickRemove,
|
|
194
198
|
onFieldChange = _ref3.onFieldChange,
|
|
195
199
|
firstVisibleFieldName = _ref3.firstVisibleFieldName,
|
|
196
|
-
contextIdentifierProvider = _ref3.contextIdentifierProvider
|
|
200
|
+
contextIdentifierProvider = _ref3.contextIdentifierProvider,
|
|
201
|
+
featureFlags = _ref3.featureFlags;
|
|
197
202
|
return /*#__PURE__*/_react.default.createElement(_FormErrorBoundary.FormErrorBoundary, {
|
|
198
203
|
contextIdentifierProvider: contextIdentifierProvider,
|
|
199
204
|
extensionKey: extensionManifest.key,
|
|
@@ -205,7 +210,8 @@ function FormContent(_ref3) {
|
|
|
205
210
|
parentName: parentName,
|
|
206
211
|
extensionManifest: extensionManifest,
|
|
207
212
|
firstVisibleFieldName: firstVisibleFieldName,
|
|
208
|
-
onFieldChange: onFieldChange
|
|
213
|
+
onFieldChange: onFieldChange,
|
|
214
|
+
featureFlags: featureFlags
|
|
209
215
|
});
|
|
210
216
|
|
|
211
217
|
// only to be supported by String fields at this time
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.validateRequired = exports.validate = exports.
|
|
6
|
+
exports.validateRequired = exports.validate = exports.isDuplicateField = exports.getSafeParentedName = exports.getOptionFromValue = exports.getNameFromDuplicateField = void 0;
|
|
7
7
|
var _types = require("./types");
|
|
8
8
|
var validate = function validate(field, value) {
|
|
9
9
|
return validateRequired(field, value);
|
|
@@ -59,14 +59,4 @@ exports.isDuplicateField = isDuplicateField;
|
|
|
59
59
|
var getNameFromDuplicateField = function getNameFromDuplicateField(key) {
|
|
60
60
|
return key.replace(duplicateFieldRegex, '');
|
|
61
61
|
};
|
|
62
|
-
|
|
63
|
-
/*
|
|
64
|
-
ColorPickerButton only accepts 8 digit hex alpha values, for example:
|
|
65
|
-
#123fffaa (8 digits, hex alpha)
|
|
66
|
-
*/
|
|
67
|
-
exports.getNameFromDuplicateField = getNameFromDuplicateField;
|
|
68
|
-
var isValidHex = function isValidHex(color) {
|
|
69
|
-
var hexRegexPattern = new RegExp('^#([a-fA-F0-9]{8})$');
|
|
70
|
-
return hexRegexPattern.test(color);
|
|
71
|
-
};
|
|
72
|
-
exports.isValidHex = isValidHex;
|
|
62
|
+
exports.getNameFromDuplicateField = getNameFromDuplicateField;
|
|
@@ -39,7 +39,6 @@ var _styles24 = require("../../plugins/status/styles");
|
|
|
39
39
|
var _styles25 = require("../../plugins/card/styles");
|
|
40
40
|
var _styles26 = require("../../plugins/date/styles");
|
|
41
41
|
var _styled = require("../../plugins/card/ui/styled");
|
|
42
|
-
var _featureFlagsContext = require("../../plugins/feature-flags-context");
|
|
43
42
|
var _getInlineNodeViewProducer = require("../../nodeviews/getInlineNodeViewProducer.styles");
|
|
44
43
|
var _templateObject;
|
|
45
44
|
/** @jsx jsx */
|
|
@@ -52,16 +51,14 @@ var contentStyles = function contentStyles(props) {
|
|
|
52
51
|
};
|
|
53
52
|
var createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
54
53
|
return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
55
|
-
var featureFlags = (0, _featureFlagsContext.useFeatureFlags)();
|
|
56
54
|
var className = props.className,
|
|
57
55
|
children = props.children;
|
|
58
56
|
var theme = (0, _react2.useTheme)();
|
|
59
57
|
var memoizedStyle = (0, _react.useMemo)(function () {
|
|
60
58
|
return contentStyles({
|
|
61
|
-
theme: theme
|
|
62
|
-
featureFlags: featureFlags
|
|
59
|
+
theme: theme
|
|
63
60
|
});
|
|
64
|
-
}, [theme
|
|
61
|
+
}, [theme]);
|
|
65
62
|
return (0, _react2.jsx)("div", {
|
|
66
63
|
className: className,
|
|
67
64
|
ref: ref,
|
|
@@ -126,20 +126,28 @@ var shouldHideLayoutToolbar = function shouldHideLayoutToolbar(selection, _ref2,
|
|
|
126
126
|
return (0, _prosemirrorUtils.hasParentNodeOfType)([nodes.bodiedExtension, nodes.listItem, nodes.expand, nodes.nestedExpand].concat((0, _toConsumableArray2.default)(allowResizingInTables ? [] : [nodes.table])).filter(Boolean))(selection);
|
|
127
127
|
};
|
|
128
128
|
var buildLayoutButtons = function buildLayoutButtons(state, intl, nodeType, allowResizing, allowResizingInTables) {
|
|
129
|
+
var allowWrapping = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
|
|
130
|
+
var allowAlignment = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;
|
|
129
131
|
var selection = state.selection;
|
|
130
132
|
if (!(selection instanceof _prosemirrorState.NodeSelection) || !selection.node || !nodeType || shouldHideLayoutToolbar(selection, state.schema, allowResizingInTables)) {
|
|
131
133
|
return [];
|
|
132
134
|
}
|
|
133
135
|
var layout = selection.node.attrs.layout;
|
|
134
|
-
var
|
|
136
|
+
var alignmentToolbarItems = allowAlignment ? mapIconsToToolbarItem(alignmentIcons, layout, intl, nodeType) : [];
|
|
137
|
+
var wrappingToolbarItems = allowWrapping ? mapIconsToToolbarItem(wrappingIcons, layout, intl, nodeType) : [];
|
|
138
|
+
var breakOutToolbarItems = !allowResizing ? mapIconsToToolbarItem(breakoutIcons, layout, intl, nodeType) : [];
|
|
139
|
+
var items = [].concat((0, _toConsumableArray2.default)(alignmentToolbarItems), (0, _toConsumableArray2.default)(getSeparatorBetweenAlignmentAndWrapping(allowAlignment, allowWrapping)), (0, _toConsumableArray2.default)(wrappingToolbarItems), (0, _toConsumableArray2.default)(getSeparatorBeforeBreakoutItems(allowAlignment, allowWrapping, allowResizing)), (0, _toConsumableArray2.default)(breakOutToolbarItems));
|
|
140
|
+
return items;
|
|
141
|
+
};
|
|
142
|
+
var getSeparatorBetweenAlignmentAndWrapping = function getSeparatorBetweenAlignmentAndWrapping(allowAlignment, allowWrapping) {
|
|
143
|
+
return allowAlignment && allowWrapping ? [{
|
|
135
144
|
type: 'separator'
|
|
136
|
-
}]
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
return toolbarItems;
|
|
145
|
+
}] : [];
|
|
146
|
+
};
|
|
147
|
+
var getSeparatorBeforeBreakoutItems = function getSeparatorBeforeBreakoutItems(allowAlignment, allowWrapping, allowResizing) {
|
|
148
|
+
return !allowResizing && (allowAlignment || allowWrapping) ? [{
|
|
149
|
+
type: 'separator'
|
|
150
|
+
}] : [];
|
|
143
151
|
};
|
|
144
152
|
var _default = buildLayoutButtons;
|
|
145
153
|
exports.default = _default;
|
|
@@ -323,10 +323,12 @@ var maySanitizePrivateContent = function maySanitizePrivateContent(entity, provi
|
|
|
323
323
|
var getStepRange = function getStepRange(transaction) {
|
|
324
324
|
var from = -1;
|
|
325
325
|
var to = -1;
|
|
326
|
-
transaction.
|
|
327
|
-
|
|
326
|
+
transaction.mapping.maps.forEach(function (stepMap, index) {
|
|
327
|
+
stepMap.forEach(function (oldStart, oldEnd) {
|
|
328
|
+
var newStart = transaction.mapping.slice(index).map(oldStart, -1);
|
|
329
|
+
var newEnd = transaction.mapping.slice(index).map(oldEnd);
|
|
328
330
|
from = newStart < from || from === -1 ? newStart : from;
|
|
329
|
-
to = newEnd
|
|
331
|
+
to = newEnd > to || to === -1 ? newEnd : to;
|
|
330
332
|
});
|
|
331
333
|
});
|
|
332
334
|
if (from !== -1) {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "182.0
|
|
9
|
+
var version = "182.1.0";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
package/dist/cjs/version.json
CHANGED
|
@@ -6,7 +6,6 @@ import { findParentNode, safeInsert } from 'prosemirror-utils';
|
|
|
6
6
|
import { createDispatch } from '../event-dispatcher';
|
|
7
7
|
import { getCollabProvider } from '../plugins/collab-edit/native-collab-provider-plugin';
|
|
8
8
|
import { findNodePosWithLocalId } from '../plugins/extension/utils';
|
|
9
|
-
import { getFeatureFlags } from '../plugins/feature-flags-context/get-feature-flags';
|
|
10
9
|
import { toJSON } from '../utils';
|
|
11
10
|
import { getEditorValueWithMedia, __temporaryFixForConfigPanel } from '../utils/action';
|
|
12
11
|
import deprecationWarnings from '../utils/deprecation-warnings';
|
|
@@ -25,11 +24,13 @@ export default class EditorActions {
|
|
|
25
24
|
});
|
|
26
25
|
_defineProperty(this, "getResolvedEditorState", async () => {
|
|
27
26
|
var _getCollabProvider;
|
|
27
|
+
const {
|
|
28
|
+
useNativeCollabPlugin
|
|
29
|
+
} = this.getFeatureFlags();
|
|
28
30
|
if (!this.editorView) {
|
|
29
31
|
throw new Error('Called getResolvedEditorState before editorView is ready');
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
if (!featureFlags.useNativeCollabPlugin) {
|
|
33
|
+
if (!useNativeCollabPlugin) {
|
|
33
34
|
const editorValue = await this.getValue();
|
|
34
35
|
if (!editorValue) {
|
|
35
36
|
throw new Error('editorValue is undefined');
|
|
@@ -59,11 +60,15 @@ export default class EditorActions {
|
|
|
59
60
|
_privateGetEventDispatcher() {
|
|
60
61
|
return this.eventDispatcher;
|
|
61
62
|
}
|
|
63
|
+
getFeatureFlags() {
|
|
64
|
+
return {};
|
|
65
|
+
}
|
|
62
66
|
|
|
63
67
|
// This method needs to be public for EditorContext component.
|
|
64
|
-
_privateRegisterEditor(editorView, eventDispatcher, contentTransformer) {
|
|
68
|
+
_privateRegisterEditor(editorView, eventDispatcher, contentTransformer, getFeatureFlags = () => ({})) {
|
|
65
69
|
this.contentTransformer = contentTransformer;
|
|
66
70
|
this.eventDispatcher = eventDispatcher;
|
|
71
|
+
this.getFeatureFlags = getFeatureFlags;
|
|
67
72
|
if (!this.editorView && editorView) {
|
|
68
73
|
this.editorView = editorView;
|
|
69
74
|
this.listeners.forEach(cb => cb(editorView, eventDispatcher));
|
|
@@ -81,6 +86,7 @@ export default class EditorActions {
|
|
|
81
86
|
this.contentTransformer = undefined;
|
|
82
87
|
this.contentEncode = undefined;
|
|
83
88
|
this.eventDispatcher = undefined;
|
|
89
|
+
this.getFeatureFlags = () => ({});
|
|
84
90
|
}
|
|
85
91
|
_privateSubscribe(cb) {
|
|
86
92
|
// If editor is registered and somebody is trying to add a listener,
|
|
@@ -14,10 +14,11 @@ export const attachPayloadIntoTransaction = ({
|
|
|
14
14
|
const {
|
|
15
15
|
storedMarks
|
|
16
16
|
} = tr;
|
|
17
|
+
const pos = tr.mapping.map(editorState.selection.$from.pos, -1);
|
|
17
18
|
tr.step(new AnalyticsStep([{
|
|
18
19
|
payload,
|
|
19
20
|
channel
|
|
20
|
-
}], actionsToIgnore,
|
|
21
|
+
}], actionsToIgnore, pos) // We need to create the step based on a position, this prevent split history for relative changes.
|
|
21
22
|
);
|
|
22
23
|
|
|
23
24
|
// When you add a new step all the storedMarks are removed it
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import memoizeOne from 'memoize-one';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import uuid from 'uuid';
|
|
5
4
|
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
@@ -7,28 +6,16 @@ import { IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
|
7
6
|
import { sniffUserBrowserExtensions } from '@atlaskit/editor-common/utils';
|
|
8
7
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../plugins/analytics';
|
|
9
8
|
import { editorAnalyticsChannel } from '../plugins/analytics/consts';
|
|
10
|
-
import { getFeatureFlags } from '../plugins/feature-flags-context';
|
|
11
9
|
import { getDocStructure } from '../utils/document-logger';
|
|
12
10
|
import { WithEditorView } from './WithEditorView';
|
|
13
11
|
import { isOutdatedBrowser } from '@atlaskit/editor-common/utils';
|
|
14
12
|
export class ErrorBoundaryWithEditorView extends React.Component {
|
|
15
|
-
// Memoizing this as react alternative suggestion of https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops
|
|
16
|
-
|
|
17
|
-
get featureFlags() {
|
|
18
|
-
return this.getFeatureFlags(this.props.editorView);
|
|
19
|
-
}
|
|
20
13
|
constructor(props) {
|
|
21
14
|
super(props);
|
|
22
15
|
_defineProperty(this, "browserExtensions", undefined);
|
|
23
16
|
_defineProperty(this, "state", {
|
|
24
17
|
error: undefined
|
|
25
18
|
});
|
|
26
|
-
_defineProperty(this, "getFeatureFlags", memoizeOne(editorView => {
|
|
27
|
-
if (!editorView) {
|
|
28
|
-
return {};
|
|
29
|
-
}
|
|
30
|
-
return getFeatureFlags(editorView.state);
|
|
31
|
-
}));
|
|
32
19
|
_defineProperty(this, "sendErrorData", async analyticsErrorPayload => {
|
|
33
20
|
var _window, _window$navigator;
|
|
34
21
|
const product = await this.getProductName();
|
|
@@ -105,6 +92,7 @@ export class ErrorBoundaryWithEditorView extends React.Component {
|
|
|
105
92
|
docStructure: attributes.docStructure
|
|
106
93
|
};
|
|
107
94
|
});
|
|
95
|
+
this.featureFlags = props.featureFlags;
|
|
108
96
|
if (props.editorView) {
|
|
109
97
|
this.experienceStore = ExperienceStore.getInstance(props.editorView);
|
|
110
98
|
}
|
|
@@ -13,7 +13,7 @@ import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
|
13
13
|
import { findChangedNodesFromTransaction, validateNodes, validNode } from '../utils/nodes';
|
|
14
14
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent, FULL_WIDTH_MODE, PLATFORMS, getAnalyticsEventsFromTransaction } from '@atlaskit/editor-common/analytics';
|
|
15
15
|
import { createFeatureFlagsFromProps } from './feature-flags-from-props';
|
|
16
|
-
import { getEnabledFeatureFlagKeys } from '
|
|
16
|
+
import { getEnabledFeatureFlagKeys } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
17
17
|
import { createErrorReporter, createPMPlugins, processPluginsList } from './create-editor';
|
|
18
18
|
import { getDocStructure } from '../utils/document-logger';
|
|
19
19
|
import { isFullPage } from '../utils/is-full-page';
|
|
@@ -479,7 +479,7 @@ export class ReactEditorView extends 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({
|
|
@@ -71,7 +71,8 @@ export function EditorInternalWithoutHooks({
|
|
|
71
71
|
useShallow: useShallow
|
|
72
72
|
}), jsx(ErrorBoundary, {
|
|
73
73
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
74
|
-
contextIdentifierProvider: props.contextIdentifierProvider
|
|
74
|
+
contextIdentifierProvider: props.contextIdentifierProvider,
|
|
75
|
+
featureFlags: featureFlags
|
|
75
76
|
}, jsx(WidthProvider, {
|
|
76
77
|
css: css({
|
|
77
78
|
height: '100%'
|
|
@@ -16,6 +16,7 @@ import { defaultProps, propTypes } from './utils/editorPropTypes';
|
|
|
16
16
|
import trackEditorActions from './utils/trackEditorActions';
|
|
17
17
|
import onEditorCreated from './utils/onEditorCreated';
|
|
18
18
|
import deprecationWarnings from './utils/deprecationWarnings';
|
|
19
|
+
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
19
20
|
import { basePlugin } from '../plugins';
|
|
20
21
|
export default class EditorNext extends React.Component {
|
|
21
22
|
/**
|
|
@@ -31,6 +32,9 @@ export default class EditorNext extends React.Component {
|
|
|
31
32
|
return (_this$props$onSave = (_this$props = this.props).onSave) === null || _this$props$onSave === void 0 ? void 0 : _this$props$onSave.call(_this$props, view);
|
|
32
33
|
});
|
|
33
34
|
_defineProperty(this, "handleAnalyticsEvent", data => fireAnalyticsEvent(this.createAnalyticsEvent)(data));
|
|
35
|
+
_defineProperty(this, "getFeatureFlags", () => {
|
|
36
|
+
return createFeatureFlagsFromProps(this.props);
|
|
37
|
+
});
|
|
34
38
|
_defineProperty(this, "getExperienceStore", () => this.experienceStore);
|
|
35
39
|
deprecationWarnings(props);
|
|
36
40
|
this.editorActions = (context || {}).editorActions || new EditorActions();
|
|
@@ -50,7 +54,7 @@ export default class EditorNext extends React.Component {
|
|
|
50
54
|
(_this$props$onDestroy = (_this$props2 = this.props).onDestroy) === null || _this$props$onDestroy === void 0 ? void 0 : _this$props$onDestroy.call(_this$props2);
|
|
51
55
|
}
|
|
52
56
|
registerEditorForActions(editorView, eventDispatcher, contentTransformer) {
|
|
53
|
-
this.editorActions._privateRegisterEditor(editorView, eventDispatcher, contentTransformer);
|
|
57
|
+
this.editorActions._privateRegisterEditor(editorView, eventDispatcher, contentTransformer, this.getFeatureFlags);
|
|
54
58
|
}
|
|
55
59
|
unregisterEditorFromActions() {
|
|
56
60
|
this.editorActions._privateUnregisterEditor();
|