@atlaskit/editor-core 183.1.6 → 184.0.4
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 +7 -3
- package/CHANGELOG.md +29 -0
- package/dist/cjs/labs/next/full-page.js +2 -6
- package/dist/cjs/labs/next/presets/create-stub-internal-apis.js +4 -2
- package/dist/cjs/labs/next/presets/default.js +2 -2
- package/dist/cjs/labs/next/presets/universal.js +2 -1
- package/dist/cjs/plugins/breakout/index.js +54 -35
- package/dist/cjs/plugins/card/toolbar.js +4 -3
- package/dist/cjs/plugins/collab-edit/plugin-state.js +2 -3
- package/dist/cjs/plugins/copy-button/commands.js +8 -1
- package/dist/cjs/plugins/extension/index.js +1 -1
- package/dist/cjs/plugins/extension/nodeviews/extension.js +5 -3
- package/dist/cjs/plugins/extension/pm-plugins/main.js +6 -6
- package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +34 -4
- package/dist/cjs/plugins/extension/ui/Extension/ExtensionComponent.js +4 -2
- package/dist/cjs/plugins/extension/ui/Extension/index.js +4 -2
- package/dist/cjs/plugins/help-dialog/index.js +12 -8
- package/dist/cjs/plugins/index.js +0 -14
- package/dist/cjs/plugins/layout/pm-plugins/main.js +0 -1
- package/dist/cjs/plugins/media/index.js +15 -5
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/index.js +22 -14
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +53 -34
- package/dist/cjs/plugins/media/styles.js +1 -1
- package/dist/cjs/plugins/media/toolbar/index.js +4 -3
- package/dist/cjs/plugins/paste/pm-plugins/main.js +7 -1
- package/dist/cjs/test-utils.js +6 -1
- package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +1 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -2
- package/dist/cjs/ui/ColorPickerButton/index.js +2 -2
- package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +6 -10
- package/dist/cjs/ui/ContentStyles/index.js +9 -10
- package/dist/cjs/ui/ContextPanel/index.js +67 -56
- package/dist/cjs/ui/MediaAndEmbedsToolbar/index.js +10 -11
- package/dist/cjs/ui/Resizer/index.js +8 -8
- package/dist/cjs/ui/WidthEmitter/index.js +10 -4
- package/dist/cjs/ui/styles.js +6 -0
- package/dist/cjs/utils/clipboard.js +18 -11
- package/dist/cjs/utils/performance/instrumented-plugin.js +14 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/labs/next/full-page.js +2 -5
- package/dist/es2019/labs/next/presets/create-stub-internal-apis.js +4 -2
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/labs/next/presets/universal.js +2 -1
- package/dist/es2019/plugins/breakout/index.js +48 -31
- package/dist/es2019/plugins/card/toolbar.js +4 -3
- package/dist/es2019/plugins/collab-edit/plugin-state.js +2 -4
- package/dist/es2019/plugins/copy-button/commands.js +9 -2
- package/dist/es2019/plugins/extension/index.js +1 -1
- package/dist/es2019/plugins/extension/nodeviews/extension.js +5 -3
- package/dist/es2019/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +38 -2
- package/dist/es2019/plugins/extension/ui/Extension/ExtensionComponent.js +4 -2
- package/dist/es2019/plugins/extension/ui/Extension/index.js +4 -2
- package/dist/es2019/plugins/help-dialog/index.js +14 -9
- package/dist/es2019/plugins/index.js +0 -2
- package/dist/es2019/plugins/layout/pm-plugins/main.js +0 -1
- package/dist/es2019/plugins/media/index.js +15 -5
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/index.js +21 -10
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +53 -33
- package/dist/es2019/plugins/media/styles.js +1 -7
- package/dist/es2019/plugins/media/toolbar/index.js +4 -4
- package/dist/es2019/plugins/paste/pm-plugins/main.js +7 -1
- package/dist/es2019/test-utils.js +6 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +1 -1
- package/dist/es2019/ui/ColorPickerButton/index.js +2 -2
- package/dist/es2019/ui/ConfigPanel/Fields/ColorPicker.js +5 -10
- package/dist/es2019/ui/ContentStyles/index.js +1 -2
- package/dist/es2019/ui/ContextPanel/index.js +66 -43
- package/dist/es2019/ui/MediaAndEmbedsToolbar/index.js +8 -9
- package/dist/es2019/ui/Resizer/index.js +1 -1
- package/dist/es2019/ui/WidthEmitter/index.js +10 -4
- package/dist/es2019/ui/styles.js +6 -0
- package/dist/es2019/utils/clipboard.js +12 -7
- package/dist/es2019/utils/performance/instrumented-plugin.js +15 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/labs/next/full-page.js +2 -5
- package/dist/esm/labs/next/presets/create-stub-internal-apis.js +4 -2
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/labs/next/presets/universal.js +2 -1
- package/dist/esm/plugins/breakout/index.js +54 -35
- package/dist/esm/plugins/card/toolbar.js +4 -3
- package/dist/esm/plugins/collab-edit/plugin-state.js +2 -3
- package/dist/esm/plugins/copy-button/commands.js +9 -2
- package/dist/esm/plugins/extension/index.js +1 -1
- package/dist/esm/plugins/extension/nodeviews/extension.js +5 -3
- package/dist/esm/plugins/extension/pm-plugins/main.js +6 -6
- package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +33 -2
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +4 -2
- package/dist/esm/plugins/extension/ui/Extension/index.js +4 -2
- package/dist/esm/plugins/help-dialog/index.js +12 -8
- package/dist/esm/plugins/index.js +0 -2
- package/dist/esm/plugins/layout/pm-plugins/main.js +0 -1
- package/dist/esm/plugins/media/index.js +15 -5
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/index.js +22 -14
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +54 -35
- package/dist/esm/plugins/media/styles.js +2 -2
- package/dist/esm/plugins/media/toolbar/index.js +4 -3
- package/dist/esm/plugins/paste/pm-plugins/main.js +7 -1
- package/dist/esm/test-utils.js +6 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +1 -1
- package/dist/esm/ui/ColorPickerButton/index.js +2 -2
- package/dist/esm/ui/ConfigPanel/Fields/ColorPicker.js +5 -10
- package/dist/esm/ui/ContentStyles/index.js +1 -2
- package/dist/esm/ui/ContextPanel/index.js +64 -53
- package/dist/esm/ui/MediaAndEmbedsToolbar/index.js +10 -11
- package/dist/esm/ui/Resizer/index.js +1 -1
- package/dist/esm/ui/WidthEmitter/index.js +10 -4
- package/dist/esm/ui/styles.js +6 -0
- package/dist/esm/utils/clipboard.js +16 -10
- package/dist/esm/utils/performance/instrumented-plugin.js +14 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +1 -1
- package/dist/types/create-editor/get-plugins.d.ts +2 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/plugins/breakout/index.d.ts +4 -0
- package/dist/types/plugins/breakout/ui/LayoutButton.d.ts +1 -1
- package/dist/types/plugins/card/index.d.ts +2 -2
- package/dist/types/plugins/collab-edit/actions.d.ts +3 -2
- package/dist/types/plugins/collab-edit/events/handlers.d.ts +3 -3
- package/dist/types/plugins/collab-edit/events/initialize.d.ts +1 -1
- package/dist/types/plugins/collab-edit/events/send-transaction.d.ts +1 -1
- package/dist/types/plugins/collab-edit/index.d.ts +0 -1
- package/dist/types/plugins/collab-edit/native-collab-provider-plugin.d.ts +2 -2
- package/dist/types/plugins/collab-edit/participants.d.ts +1 -1
- package/dist/types/plugins/collab-edit/plugin.d.ts +0 -2
- package/dist/types/plugins/collab-edit/types.d.ts +1 -3
- package/dist/types/plugins/collab-edit/ui/to-avatar.d.ts +1 -1
- package/dist/types/plugins/collab-edit/utils.d.ts +2 -1
- package/dist/types/plugins/extension/index.d.ts +2 -1
- package/dist/types/plugins/extension/nodeviews/extension.d.ts +4 -1
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +3 -1
- package/dist/types/plugins/extension/ui/Extension/Extension/index.d.ts +6 -0
- package/dist/types/plugins/extension/ui/Extension/ExtensionComponent.d.ts +3 -0
- package/dist/types/plugins/extension/ui/Extension/index.d.ts +3 -0
- package/dist/types/plugins/help-dialog/index.d.ts +3 -1
- package/dist/types/plugins/index.d.ts +0 -3
- package/dist/types/plugins/media/index.d.ts +12 -2
- package/dist/types/plugins/media/nodeviews/mediaNodeView/index.d.ts +4 -2
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types/plugins/media/nodeviews/types.d.ts +2 -1
- package/dist/types/plugins/media/toolbar/index.d.ts +3 -1
- package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +2 -2
- package/dist/types/test-utils.d.ts +3 -1
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ColorPickerButton/index.d.ts +3 -3
- package/dist/types/ui/ContextPanel/index.d.ts +3 -4
- package/dist/types/ui/MediaAndEmbedsToolbar/index.d.ts +3 -1
- package/dist/types/ui/PluginSlot/index.d.ts +1 -1
- package/dist/types/ui/Resizer/types.d.ts +2 -2
- package/dist/types/utils/clipboard.d.ts +1 -0
- package/dist/types-ts4.5/actions/index.d.ts +1 -1
- package/dist/types-ts4.5/create-editor/get-plugins.d.ts +2 -0
- package/dist/types-ts4.5/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/breakout/index.d.ts +6 -0
- package/dist/types-ts4.5/plugins/breakout/ui/LayoutButton.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/collab-edit/actions.d.ts +3 -2
- package/dist/types-ts4.5/plugins/collab-edit/events/handlers.d.ts +3 -3
- package/dist/types-ts4.5/plugins/collab-edit/events/initialize.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/events/send-transaction.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/collab-edit/native-collab-provider-plugin.d.ts +2 -2
- package/dist/types-ts4.5/plugins/collab-edit/participants.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/plugin.d.ts +0 -2
- package/dist/types-ts4.5/plugins/collab-edit/types.d.ts +1 -3
- package/dist/types-ts4.5/plugins/collab-edit/ui/to-avatar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/utils.d.ts +2 -1
- package/dist/types-ts4.5/plugins/extension/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/extension/nodeviews/extension.d.ts +4 -1
- package/dist/types-ts4.5/plugins/extension/pm-plugins/main.d.ts +3 -1
- package/dist/types-ts4.5/plugins/extension/ui/Extension/Extension/index.d.ts +6 -0
- package/dist/types-ts4.5/plugins/extension/ui/Extension/ExtensionComponent.d.ts +3 -0
- package/dist/types-ts4.5/plugins/extension/ui/Extension/index.d.ts +3 -0
- package/dist/types-ts4.5/plugins/help-dialog/index.d.ts +5 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/media/index.d.ts +9 -2
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaNodeView/index.d.ts +4 -2
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/nodeviews/types.d.ts +2 -1
- package/dist/types-ts4.5/plugins/media/toolbar/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +2 -2
- package/dist/types-ts4.5/test-utils.d.ts +3 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types-ts4.5/ui/ColorPickerButton/index.d.ts +3 -3
- package/dist/types-ts4.5/ui/ContextPanel/index.d.ts +3 -4
- package/dist/types-ts4.5/ui/MediaAndEmbedsToolbar/index.d.ts +3 -1
- package/dist/types-ts4.5/ui/PluginSlot/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/Resizer/types.d.ts +2 -2
- package/dist/types-ts4.5/utils/clipboard.d.ts +1 -0
- package/package.json +25 -23
- package/report.api.md +15 -63
- package/dist/cjs/plugins/collab-edit/provider/index.js +0 -5
- package/dist/cjs/plugins/collab-edit/provider/types.js +0 -5
- package/dist/cjs/plugins/grid/index.js +0 -207
- package/dist/cjs/plugins/grid/styles.js +0 -16
- package/dist/cjs/plugins/grid/types.js +0 -5
- package/dist/cjs/plugins/width/index.js +0 -88
- package/dist/cjs/ui/ContextPanel/context.js +0 -89
- package/dist/es2019/plugins/collab-edit/provider/index.js +0 -1
- package/dist/es2019/plugins/collab-edit/provider/types.js +0 -1
- package/dist/es2019/plugins/grid/index.js +0 -168
- package/dist/es2019/plugins/grid/styles.js +0 -36
- package/dist/es2019/plugins/grid/types.js +0 -1
- package/dist/es2019/plugins/width/index.js +0 -72
- package/dist/es2019/ui/ContextPanel/context.js +0 -65
- package/dist/esm/plugins/collab-edit/provider/index.js +0 -1
- package/dist/esm/plugins/collab-edit/provider/types.js +0 -1
- package/dist/esm/plugins/grid/index.js +0 -191
- package/dist/esm/plugins/grid/styles.js +0 -7
- package/dist/esm/plugins/grid/types.js +0 -1
- package/dist/esm/plugins/width/index.js +0 -78
- package/dist/esm/ui/ContextPanel/context.js +0 -79
- package/dist/types/plugins/collab-edit/provider/index.d.ts +0 -1
- package/dist/types/plugins/collab-edit/provider/types.d.ts +0 -1
- package/dist/types/plugins/grid/index.d.ts +0 -25
- package/dist/types/plugins/grid/styles.d.ts +0 -2
- package/dist/types/plugins/grid/types.d.ts +0 -7
- package/dist/types/plugins/width/index.d.ts +0 -18
- package/dist/types/ui/ContextPanel/context.d.ts +0 -24
- package/dist/types-ts4.5/plugins/collab-edit/provider/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/collab-edit/provider/types.d.ts +0 -1
- package/dist/types-ts4.5/plugins/grid/index.d.ts +0 -27
- package/dist/types-ts4.5/plugins/grid/styles.d.ts +0 -2
- package/dist/types-ts4.5/plugins/grid/types.d.ts +0 -7
- package/dist/types-ts4.5/plugins/width/index.d.ts +0 -18
- package/dist/types-ts4.5/ui/ContextPanel/context.d.ts +0 -24
|
@@ -28,16 +28,15 @@ var _styles14 = require("../../plugins/mentions/styles");
|
|
|
28
28
|
var _styles15 = require("../../plugins/emoji/styles");
|
|
29
29
|
var _styles16 = require("../../plugins/text-formatting/styles");
|
|
30
30
|
var _styles17 = require("../../plugins/placeholder-text/styles");
|
|
31
|
-
var _styles18 = require("../../plugins/
|
|
32
|
-
var _styles19 = require("../../plugins/
|
|
33
|
-
var _styles20 = require("../../plugins/
|
|
34
|
-
var _styles21 = require("../../plugins/expand/ui/styles");
|
|
31
|
+
var _styles18 = require("../../plugins/hyperlink/styles");
|
|
32
|
+
var _styles19 = require("../../plugins/extension/ui/styles");
|
|
33
|
+
var _styles20 = require("../../plugins/expand/ui/styles");
|
|
35
34
|
var _style = require("../../plugins/media/pm-plugins/alt-text/style");
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
35
|
+
var _styles21 = require("../../plugins/find-replace/styles");
|
|
36
|
+
var _styles22 = require("../../plugins/tasks-and-decisions/styles");
|
|
37
|
+
var _styles23 = require("../../plugins/status/styles");
|
|
38
|
+
var _styles24 = require("../../plugins/card/styles");
|
|
39
|
+
var _styles25 = require("../../plugins/date/styles");
|
|
41
40
|
var _styled = require("../../plugins/card/ui/styled");
|
|
42
41
|
var _getInlineNodeViewProducer = require("../../nodeviews/getInlineNodeViewProducer.styles");
|
|
43
42
|
var _templateObject;
|
|
@@ -47,7 +46,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
47
46
|
var contentStyles = function contentStyles(props) {
|
|
48
47
|
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
|
|
49
48
|
theme: props.theme
|
|
50
|
-
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles17.placeholderTextStyles, _styles5.placeholderStyles, (0, _styles7.codeBlockStyles)(props), (0, _styles6.blocktypeStyles)(props), (0, _styles16.textFormattingStyles)(props), _styles.textColorStyles, _styles8.listsStyles, (0, _styles9.ruleStyles)(props), _styles10.mediaStyles, (0, _styles11.layoutStyles)(props), _styles3.telepointerStyle, _styles4.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _styles12.panelStyles)(props), _styles13.fakeCursorStyles, _styles14.mentionsStyles, _styles15.emojiStyles, _styles.tasksAndDecisionsStyles,
|
|
49
|
+
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles17.placeholderTextStyles, _styles5.placeholderStyles, (0, _styles7.codeBlockStyles)(props), (0, _styles6.blocktypeStyles)(props), (0, _styles16.textFormattingStyles)(props), _styles.textColorStyles, _styles8.listsStyles, (0, _styles9.ruleStyles)(props), _styles10.mediaStyles, (0, _styles11.layoutStyles)(props), _styles3.telepointerStyle, _styles4.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _styles12.panelStyles)(props), _styles13.fakeCursorStyles, _styles14.mentionsStyles, _styles15.emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, _styles18.linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles19.extensionStyles, (0, _styles20.expandStyles)(props), _styles21.findReplaceStyles, _styles22.taskDecisionStyles, _styles23.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles24.smartCardStyles, _styles.smartCardSharedStyles, _styles25.dateStyles, _styled.embedCardStyles, _styles2.unsupportedStyles, _styles.resizerStyles, _style.ClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
51
50
|
};
|
|
52
51
|
var createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
53
52
|
return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
@@ -4,8 +4,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.content = exports.SwappableContentArea = void 0;
|
|
8
|
+
exports.default = ContextPanel;
|
|
9
|
+
exports.shouldPanelBePositionedOverEditor = exports.panel = void 0;
|
|
8
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
14
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
@@ -19,12 +22,12 @@ var _react2 = require("@emotion/react");
|
|
|
19
22
|
var _Transition = _interopRequireDefault(require("react-transition-group/Transition"));
|
|
20
23
|
var _colors = require("@atlaskit/theme/colors");
|
|
21
24
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
22
|
-
var
|
|
25
|
+
var _ui = require("@atlaskit/editor-common/ui");
|
|
23
26
|
var _WithPluginState = _interopRequireDefault(require("../WithPluginState"));
|
|
24
27
|
var _contextPanel = require("../../plugins/context-panel");
|
|
25
|
-
var _width = require("../../plugins/width");
|
|
26
28
|
var _WithEditorActions = _interopRequireDefault(require("../WithEditorActions"));
|
|
27
29
|
var _document = require("../../utils/document");
|
|
30
|
+
var _excluded = ["actions"];
|
|
28
31
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
29
32
|
/** @jsx jsx */
|
|
30
33
|
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; }
|
|
@@ -67,6 +70,13 @@ var SwappableContentArea = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
67
70
|
mounted: false,
|
|
68
71
|
currentPluginContent: undefined
|
|
69
72
|
});
|
|
73
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "focusEditor", function () {
|
|
74
|
+
var editorView = _this.props.editorView;
|
|
75
|
+
if (editorView && !editorView.hasFocus()) {
|
|
76
|
+
var _editorView$focus;
|
|
77
|
+
(_editorView$focus = editorView.focus) === null || _editorView$focus === void 0 ? void 0 : _editorView$focus.call(editorView);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
70
80
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "showPluginContent", function () {
|
|
71
81
|
var pluginContent = _this.props.pluginContent;
|
|
72
82
|
var currentPluginContent = _this.state.currentPluginContent;
|
|
@@ -92,7 +102,8 @@ var SwappableContentArea = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
92
102
|
timeout: _this.state.mounted ? ANIM_SPEED_MS : 0,
|
|
93
103
|
in: isVisible,
|
|
94
104
|
mountOnEnter: true,
|
|
95
|
-
unmountOnExit: true
|
|
105
|
+
unmountOnExit: true,
|
|
106
|
+
onExiting: _this.focusEditor
|
|
96
107
|
}, children);
|
|
97
108
|
});
|
|
98
109
|
return _this;
|
|
@@ -120,12 +131,13 @@ var SwappableContentArea = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
120
131
|
var width = _editorSharedStyles.akEditorContextPanelWidth;
|
|
121
132
|
var userVisible = !!this.props.visible;
|
|
122
133
|
var visible = userVisible || !!this.state.currentPluginContent;
|
|
123
|
-
return (0, _react2.jsx)(
|
|
134
|
+
return (0, _react2.jsx)(_ui.ContextPanelConsumer, null, function (_ref) {
|
|
124
135
|
var broadcastWidth = _ref.broadcastWidth,
|
|
125
136
|
broadcastPosition = _ref.broadcastPosition,
|
|
126
137
|
positionedOverEditor = _ref.positionedOverEditor;
|
|
138
|
+
var contextPanelWidth = visible ? width : 0;
|
|
127
139
|
var newPosition = editorWidth ? shouldPanelBePositionedOverEditor(editorWidth, width) : false;
|
|
128
|
-
broadcastWidth(
|
|
140
|
+
broadcastWidth(contextPanelWidth);
|
|
129
141
|
(newPosition && visible) !== positionedOverEditor && broadcastPosition(newPosition && visible);
|
|
130
142
|
return (0, _react2.jsx)("div", {
|
|
131
143
|
css: [panel, !visible && panelHidden,
|
|
@@ -155,57 +167,56 @@ var SwappableContentArea = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
155
167
|
}
|
|
156
168
|
}]);
|
|
157
169
|
return SwappableContentArea;
|
|
158
|
-
}(_react.default.PureComponent);
|
|
170
|
+
}(_react.default.PureComponent); // TODO: ED-17837 We have this workaround because we do
|
|
171
|
+
// not have access to the pluginInjectionApi at this location.
|
|
172
|
+
// It might be that we need to inject the pluginInjectionApi
|
|
173
|
+
// via context so that we can use it in this file (similar to
|
|
174
|
+
// WithEditorActions). To be investigated further.
|
|
159
175
|
exports.SwappableContentArea = SwappableContentArea;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
function
|
|
164
|
-
|
|
165
|
-
return _super2.apply(this, arguments);
|
|
176
|
+
// @ts-ignore
|
|
177
|
+
var widthPluginKey = {
|
|
178
|
+
key: 'widthPlugin$',
|
|
179
|
+
getState: function getState(state) {
|
|
180
|
+
return state['widthPlugin$'];
|
|
166
181
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
width: 0,
|
|
191
|
-
containerWidth: 0,
|
|
192
|
-
lineLength: _editorSharedStyles.akEditorDefaultLayoutWidth
|
|
193
|
-
} : _ref2$widthState;
|
|
194
|
-
var firstContent = contextPanel && contextPanel.contents.find(Boolean);
|
|
195
|
-
var editorWidth = _objectSpread(_objectSpread({}, widthState), {}, {
|
|
196
|
-
contentBreakoutModes: editorView ? (0, _document.getChildBreakoutModes)(editorView.state.doc, editorView.state.schema) : []
|
|
197
|
-
});
|
|
198
|
-
return (0, _react2.jsx)(SwappableContentArea, (0, _extends2.default)({}, _this3.props, {
|
|
199
|
-
editorView: editorView,
|
|
200
|
-
pluginContent: firstContent,
|
|
201
|
-
editorWidth: editorWidth
|
|
202
|
-
}));
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
}
|
|
182
|
+
};
|
|
183
|
+
function ContextPanelWithActions(_ref2) {
|
|
184
|
+
var actions = _ref2.actions,
|
|
185
|
+
props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
186
|
+
var eventDispatcher = actions._privateGetEventDispatcher();
|
|
187
|
+
var editorView = actions._privateGetEditorView();
|
|
188
|
+
if (!eventDispatcher) {
|
|
189
|
+
return (0, _react2.jsx)(SwappableContentArea, (0, _extends2.default)({
|
|
190
|
+
editorView: editorView
|
|
191
|
+
}, props));
|
|
192
|
+
}
|
|
193
|
+
return (0, _react2.jsx)(_WithPluginState.default, {
|
|
194
|
+
eventDispatcher: eventDispatcher,
|
|
195
|
+
plugins: {
|
|
196
|
+
contextPanel: _contextPanel.pluginKey,
|
|
197
|
+
widthState: widthPluginKey
|
|
198
|
+
},
|
|
199
|
+
render: function render(_ref3) {
|
|
200
|
+
var contextPanel = _ref3.contextPanel,
|
|
201
|
+
widthState = _ref3.widthState;
|
|
202
|
+
var firstContent = contextPanel && contextPanel.contents.find(Boolean);
|
|
203
|
+
var editorWidth = _objectSpread(_objectSpread({}, widthState), {}, {
|
|
204
|
+
contentBreakoutModes: editorView ? (0, _document.getChildBreakoutModes)(editorView.state.doc, editorView.state.schema) : []
|
|
206
205
|
});
|
|
206
|
+
return (0, _react2.jsx)(SwappableContentArea, (0, _extends2.default)({}, props, {
|
|
207
|
+
editorView: editorView,
|
|
208
|
+
pluginContent: firstContent,
|
|
209
|
+
editorWidth: editorWidth
|
|
210
|
+
}));
|
|
207
211
|
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
function ContextPanel(props) {
|
|
215
|
+
return (0, _react2.jsx)(_WithEditorActions.default, {
|
|
216
|
+
render: function render(actions) {
|
|
217
|
+
return (0, _react2.jsx)(ContextPanelWithActions, (0, _extends2.default)({
|
|
218
|
+
actions: actions
|
|
219
|
+
}, props));
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
@@ -17,7 +17,6 @@ var _alignImageLeft = _interopRequireDefault(require("@atlaskit/icon/glyph/edito
|
|
|
17
17
|
var _alignImageRight = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-image-right"));
|
|
18
18
|
var _alignImageCenter = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-image-center"));
|
|
19
19
|
var _richMediaUtils = require("../../utils/rich-media-utils");
|
|
20
|
-
var _width = require("../../plugins/width");
|
|
21
20
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
22
21
|
var _utils = require("../../plugins/analytics/utils");
|
|
23
22
|
var _analytics = require("../../plugins/analytics");
|
|
@@ -68,7 +67,7 @@ var getNodeWidth = function getNodeWidth(node, schema) {
|
|
|
68
67
|
}
|
|
69
68
|
return node.firstChild && node.firstChild.attrs.width || node.attrs.width;
|
|
70
69
|
};
|
|
71
|
-
var makeAlign = function makeAlign(layout, nodeType) {
|
|
70
|
+
var makeAlign = function makeAlign(layout, nodeType, widthPluginDependencyApi) {
|
|
72
71
|
return function (state, dispatch) {
|
|
73
72
|
var _ref = state.selection,
|
|
74
73
|
node = _ref.node;
|
|
@@ -77,7 +76,7 @@ var makeAlign = function makeAlign(layout, nodeType) {
|
|
|
77
76
|
if (!dispatch) {
|
|
78
77
|
return false;
|
|
79
78
|
}
|
|
80
|
-
var widthPluginState =
|
|
79
|
+
var widthPluginState = widthPluginDependencyApi === null || widthPluginDependencyApi === void 0 ? void 0 : widthPluginDependencyApi.sharedState.currentState();
|
|
81
80
|
if (!node || node.type !== nodeType || !widthPluginState) {
|
|
82
81
|
return false;
|
|
83
82
|
}
|
|
@@ -107,7 +106,7 @@ var makeAlign = function makeAlign(layout, nodeType) {
|
|
|
107
106
|
return true;
|
|
108
107
|
};
|
|
109
108
|
};
|
|
110
|
-
var mapIconsToToolbarItem = function mapIconsToToolbarItem(icons, layout, intl, nodeType) {
|
|
109
|
+
var mapIconsToToolbarItem = function mapIconsToToolbarItem(icons, layout, intl, nodeType, widthPluginDependencyApi) {
|
|
111
110
|
return icons.map(function (toolbarItem) {
|
|
112
111
|
var id = toolbarItem.id,
|
|
113
112
|
value = toolbarItem.value;
|
|
@@ -117,7 +116,7 @@ var mapIconsToToolbarItem = function mapIconsToToolbarItem(icons, layout, intl,
|
|
|
117
116
|
icon: toolbarItem.icon,
|
|
118
117
|
title: intl.formatMessage(layoutToMessages[value]),
|
|
119
118
|
selected: layout === value,
|
|
120
|
-
onClick: makeAlign(value, nodeType)
|
|
119
|
+
onClick: makeAlign(value, nodeType, widthPluginDependencyApi)
|
|
121
120
|
};
|
|
122
121
|
});
|
|
123
122
|
};
|
|
@@ -125,17 +124,17 @@ var shouldHideLayoutToolbar = function shouldHideLayoutToolbar(selection, _ref2,
|
|
|
125
124
|
var nodes = _ref2.nodes;
|
|
126
125
|
return (0, _prosemirrorUtils.hasParentNodeOfType)([nodes.bodiedExtension, nodes.listItem, nodes.expand, nodes.nestedExpand].concat((0, _toConsumableArray2.default)(allowResizingInTables ? [] : [nodes.table])).filter(Boolean))(selection);
|
|
127
126
|
};
|
|
128
|
-
var buildLayoutButtons = function buildLayoutButtons(state, intl, nodeType, allowResizing, allowResizingInTables) {
|
|
129
|
-
var allowWrapping = arguments.length >
|
|
130
|
-
var allowAlignment = arguments.length >
|
|
127
|
+
var buildLayoutButtons = function buildLayoutButtons(state, intl, nodeType, widthPluginDependencyApi, allowResizing, allowResizingInTables) {
|
|
128
|
+
var allowWrapping = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;
|
|
129
|
+
var allowAlignment = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
|
|
131
130
|
var selection = state.selection;
|
|
132
131
|
if (!(selection instanceof _prosemirrorState.NodeSelection) || !selection.node || !nodeType || shouldHideLayoutToolbar(selection, state.schema, allowResizingInTables)) {
|
|
133
132
|
return [];
|
|
134
133
|
}
|
|
135
134
|
var layout = selection.node.attrs.layout;
|
|
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) : [];
|
|
135
|
+
var alignmentToolbarItems = allowAlignment ? mapIconsToToolbarItem(alignmentIcons, layout, intl, nodeType, widthPluginDependencyApi) : [];
|
|
136
|
+
var wrappingToolbarItems = allowWrapping ? mapIconsToToolbarItem(wrappingIcons, layout, intl, nodeType, widthPluginDependencyApi) : [];
|
|
137
|
+
var breakOutToolbarItems = !allowResizing ? mapIconsToToolbarItem(breakoutIcons, layout, intl, nodeType, widthPluginDependencyApi) : [];
|
|
139
138
|
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
139
|
return items;
|
|
141
140
|
};
|
|
@@ -15,8 +15,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
17
|
var _reResizable = require("re-resizable");
|
|
18
|
-
var
|
|
19
|
-
var
|
|
18
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
19
|
+
var _utils2 = require("./utils");
|
|
20
20
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
21
21
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
22
22
|
var _analytics = require("../../plugins/analytics");
|
|
@@ -71,7 +71,7 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
71
71
|
isResizing: true
|
|
72
72
|
}, function () {
|
|
73
73
|
var newHighlights = highlights(width + innerPadding, snapPoints);
|
|
74
|
-
displayGrid === null || displayGrid === void 0 ? void 0 : displayGrid(newHighlights.length > 0, (0,
|
|
74
|
+
displayGrid === null || displayGrid === void 0 ? void 0 : displayGrid(newHighlights.length > 0, (0, _utils.gridTypeForLayout)(layout), newHighlights);
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
77
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleResize", function (_event, _direction, _elementRef, delta) {
|
|
@@ -96,7 +96,7 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
96
96
|
updateSize(newSize.width, newSize.layout);
|
|
97
97
|
}
|
|
98
98
|
var newHighlights = highlights(newWidth, snapPoints);
|
|
99
|
-
displayGrid === null || displayGrid === void 0 ? void 0 : displayGrid(newHighlights.length > 0, (0,
|
|
99
|
+
displayGrid === null || displayGrid === void 0 ? void 0 : displayGrid(newHighlights.length > 0, (0, _utils.gridTypeForLayout)(newSize.layout), newHighlights);
|
|
100
100
|
resizable.updateSize({
|
|
101
101
|
width: newWidth,
|
|
102
102
|
height: 'auto'
|
|
@@ -121,19 +121,19 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
123
|
var newWidth = getWidthFromSnapPoints(resizable.state.original.width + delta.width, snapPoints);
|
|
124
|
-
var snapWidth = (0,
|
|
124
|
+
var snapWidth = (0, _utils2.snapTo)(newWidth, snapPoints);
|
|
125
125
|
var newSize = calcNewSize(snapWidth, true);
|
|
126
126
|
var newHighlights = highlights(newWidth, snapPoints);
|
|
127
127
|
if (dispatchAnalyticsEvent) {
|
|
128
128
|
dispatchAnalyticsEvent(getResizeAnalyticsEvent(nodeType, newSize.width, newSize.layout));
|
|
129
129
|
}
|
|
130
130
|
// show committed grid size
|
|
131
|
-
displayGrid === null || displayGrid === void 0 ? void 0 : displayGrid(newHighlights.length > 0, (0,
|
|
131
|
+
displayGrid === null || displayGrid === void 0 ? void 0 : displayGrid(newHighlights.length > 0, (0, _utils.gridTypeForLayout)(newSize.layout), newHighlights);
|
|
132
132
|
_this.setState({
|
|
133
133
|
isResizing: false
|
|
134
134
|
}, function () {
|
|
135
135
|
updateSize(newSize.width, newSize.layout);
|
|
136
|
-
displayGrid === null || displayGrid === void 0 ? void 0 : displayGrid(false, (0,
|
|
136
|
+
displayGrid === null || displayGrid === void 0 ? void 0 : displayGrid(false, (0, _utils.gridTypeForLayout)(layout), []);
|
|
137
137
|
});
|
|
138
138
|
});
|
|
139
139
|
return _this;
|
|
@@ -156,7 +156,7 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
156
156
|
ratio = _this$props4.ratio,
|
|
157
157
|
handleComponentFunc = _this$props4.handleComponentFunc;
|
|
158
158
|
var isResizing = this.state.isResizing;
|
|
159
|
-
|
|
159
|
+
_utils2.handleSides.forEach(function (side) {
|
|
160
160
|
var _handleStyles$side;
|
|
161
161
|
handles[side] = "richMedia-resize-handle-".concat(side);
|
|
162
162
|
handleStyles[side] = (_handleStyles$side = {
|
|
@@ -8,11 +8,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _width = require("../../plugins/width");
|
|
12
11
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
13
|
-
var _context = require("../ContextPanel/context");
|
|
14
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
13
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
// TODO: ED-17870 This workaround will be removed here.
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
var widthPluginKey = {
|
|
17
|
+
key: 'widthPlugin$',
|
|
18
|
+
getState: function getState(state) {
|
|
19
|
+
return state['widthPlugin$'];
|
|
20
|
+
}
|
|
21
|
+
};
|
|
16
22
|
// Why do we need this? Why not just use the width from the context directly rather than this?
|
|
17
23
|
// Well my friend - some of the VR tests break, seemingly due to the fact that existing behaviour
|
|
18
24
|
// assumes the initial value is 0, the width from context may not start from 0 however.
|
|
@@ -30,7 +36,7 @@ var useListener = function useListener(contextValue) {
|
|
|
30
36
|
};
|
|
31
37
|
var WidthEmitter = function WidthEmitter(_ref) {
|
|
32
38
|
var editorView = _ref.editorView;
|
|
33
|
-
var _useContext = (0, _react.useContext)(
|
|
39
|
+
var _useContext = (0, _react.useContext)(_ui.ContextPanel),
|
|
34
40
|
contextPanelWidthContext = _useContext.width;
|
|
35
41
|
var _useContext2 = (0, _react.useContext)(_ui.WidthContext),
|
|
36
42
|
containerWidthContext = _useContext2.width;
|
|
@@ -44,7 +50,7 @@ var WidthEmitter = function WidthEmitter(_ref) {
|
|
|
44
50
|
var dom = editorView.dom,
|
|
45
51
|
tr = editorView.state.tr,
|
|
46
52
|
dispatch = editorView.dispatch;
|
|
47
|
-
tr.setMeta(
|
|
53
|
+
tr.setMeta(widthPluginKey, {
|
|
48
54
|
width: width,
|
|
49
55
|
containerWidth: containerWidth,
|
|
50
56
|
lineLength: dom ? dom.clientWidth : undefined
|
package/dist/cjs/ui/styles.js
CHANGED
|
@@ -26,8 +26,14 @@ var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
|
26
26
|
var _scrollbar = require("@atlaskit/editor-shared-styles/scrollbar");
|
|
27
27
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
28
28
|
var buttonGroupStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: inline-flex;\n align-items: center;\n\n & > div {\n display: flex;\n }\n"])));
|
|
29
|
+
|
|
30
|
+
// This style is copied to packages/editor/editor-plugin-ai/src/ui/components/AtlassianIntelligenceToolbarButton/styles.tsx
|
|
31
|
+
// If you make change here, change in above file as well.
|
|
29
32
|
exports.buttonGroupStyle = buttonGroupStyle;
|
|
30
33
|
var separatorStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n width: 1px;\n height: 24px;\n display: inline-block;\n margin: 0 8px;\n user-select: none;\n"])), "var(--ds-border, ".concat(_colors.N30, ")"));
|
|
34
|
+
|
|
35
|
+
// This style is copied to packages/editor/editor-plugin-ai/src/ui/components/AtlassianIntelligenceToolbarButton/styles.tsx
|
|
36
|
+
// If you make change here, change in above file as well.
|
|
31
37
|
exports.separatorStyles = separatorStyles;
|
|
32
38
|
var wrapperStyle = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n\n > div,\n > span {\n display: flex;\n }\n\n > div > div {\n display: flex;\n }\n\n margin-left: 0;\n min-width: auto;\n"])));
|
|
33
39
|
exports.wrapperStyle = wrapperStyle;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.checkClipboardTypes = checkClipboardTypes;
|
|
9
|
-
exports.copyToClipboard = exports.copyHTMLToClipboard = void 0;
|
|
9
|
+
exports.copyToClipboard = exports.copyHTMLToClipboardPolyfill = exports.copyHTMLToClipboard = void 0;
|
|
10
10
|
exports.isPastedFile = isPastedFile;
|
|
11
11
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
12
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
@@ -88,7 +88,7 @@ var copyToClipboard = /*#__PURE__*/function () {
|
|
|
88
88
|
exports.copyToClipboard = copyToClipboard;
|
|
89
89
|
var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
90
90
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(elementToCopy, plainTextToCopy) {
|
|
91
|
-
var data
|
|
91
|
+
var data;
|
|
92
92
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
93
93
|
while (1) switch (_context2.prev = _context2.next) {
|
|
94
94
|
case 0:
|
|
@@ -115,17 +115,13 @@ var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
|
115
115
|
_context2.t0 = _context2["catch"](1);
|
|
116
116
|
throw new Error('Clipboard api is not supported');
|
|
117
117
|
case 10:
|
|
118
|
-
_context2.next =
|
|
118
|
+
_context2.next = 13;
|
|
119
119
|
break;
|
|
120
120
|
case 12:
|
|
121
|
-
//
|
|
121
|
+
// ED-17083 extension copy seems have issue with ClipboardItem API
|
|
122
122
|
// Hence of use of this polyfill
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
dt.setData('text/plain', plainTextToCopy || elementToCopy.innerText);
|
|
126
|
-
dt.setData('text/html', elementToCopy.innerHTML);
|
|
127
|
-
Clipboard.write(dt);
|
|
128
|
-
case 17:
|
|
123
|
+
copyHTMLToClipboardPolyfill(elementToCopy, plainTextToCopy);
|
|
124
|
+
case 13:
|
|
129
125
|
case "end":
|
|
130
126
|
return _context2.stop();
|
|
131
127
|
}
|
|
@@ -135,4 +131,15 @@ var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
|
135
131
|
return _ref3.apply(this, arguments);
|
|
136
132
|
};
|
|
137
133
|
}();
|
|
138
|
-
|
|
134
|
+
|
|
135
|
+
// At the time of development, Firefox doesn't support ClipboardItem API
|
|
136
|
+
// Hence of use of this polyfill
|
|
137
|
+
exports.copyHTMLToClipboard = copyHTMLToClipboard;
|
|
138
|
+
var copyHTMLToClipboardPolyfill = function copyHTMLToClipboardPolyfill(elementToCopy, plainTextToCopy) {
|
|
139
|
+
var Clipboard = clipboard;
|
|
140
|
+
var dt = new Clipboard.DT();
|
|
141
|
+
dt.setData('text/plain', plainTextToCopy || elementToCopy.innerText);
|
|
142
|
+
dt.setData('text/html', elementToCopy.innerHTML);
|
|
143
|
+
Clipboard.write(dt);
|
|
144
|
+
};
|
|
145
|
+
exports.copyHTMLToClipboardPolyfill = copyHTMLToClipboardPolyfill;
|
|
@@ -61,18 +61,30 @@ var InstrumentedPlugin = /*#__PURE__*/function (_SafePlugin) {
|
|
|
61
61
|
return result;
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
+
var _uiTracking$samplingR = uiTracking.samplingRate,
|
|
65
|
+
uiTrackingSamplingRate = _uiTracking$samplingR === void 0 ? 100 : _uiTracking$samplingR;
|
|
64
66
|
if (uiTracking.enabled && spec.view) {
|
|
65
67
|
var originalView = spec.view.bind(spec);
|
|
66
68
|
spec.view = function (editorView) {
|
|
67
69
|
var self = (0, _assertThisInitialized2.default)(_this);
|
|
68
70
|
var measure = "\uD83E\uDD89".concat(self.key, "::view::update");
|
|
69
71
|
var view = originalView(editorView);
|
|
72
|
+
var uiTrackingSamplingCounter = 0;
|
|
70
73
|
if (view.update) {
|
|
71
74
|
var originalUpdate = view.update;
|
|
72
75
|
view.update = function (view, state) {
|
|
73
|
-
|
|
76
|
+
var shouldTrack = uiTrackingSamplingRate && uiTrackingSamplingCounter === 0;
|
|
77
|
+
if (shouldTrack) {
|
|
78
|
+
(0, _utils.startMeasure)(measure);
|
|
79
|
+
}
|
|
74
80
|
originalUpdate(view, state);
|
|
75
|
-
|
|
81
|
+
if (shouldTrack) {
|
|
82
|
+
(0, _utils.stopMeasure)(measure, function () {});
|
|
83
|
+
}
|
|
84
|
+
uiTrackingSamplingCounter++;
|
|
85
|
+
if (uiTrackingSamplingRate && uiTrackingSamplingCounter >= uiTrackingSamplingRate) {
|
|
86
|
+
uiTrackingSamplingCounter = 0;
|
|
87
|
+
}
|
|
76
88
|
};
|
|
77
89
|
}
|
|
78
90
|
return view;
|
|
@@ -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 = "
|
|
9
|
+
var version = "184.0.4";
|
|
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
|
@@ -8,7 +8,6 @@ import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
|
8
8
|
import { BaseTheme } from '@atlaskit/editor-common/ui';
|
|
9
9
|
import { akEditorMenuZIndex, akEditorToolbarKeylineHeight } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import ContentStyles from '../../ui/ContentStyles';
|
|
11
|
-
import WidthEmitter from '../../ui/WidthEmitter';
|
|
12
11
|
import { ClickAreaBlock } from '../../ui/Addon';
|
|
13
12
|
import { scrollbarStyles } from '../../ui/styles';
|
|
14
13
|
import { tableFullPageEditorStyles } from '@atlaskit/editor-plugin-table/ui/common-styles';
|
|
@@ -17,7 +16,7 @@ import { Editor, EditorContent, useEditorSharedConfig } from './Editor';
|
|
|
17
16
|
import { Toolbar } from './Toolbar';
|
|
18
17
|
import { ContentComponents } from './ContentComponents';
|
|
19
18
|
import { useCreateAnalyticsHandler } from './internal/hooks/use-analytics';
|
|
20
|
-
import { ContextPanelWidthProvider } from '
|
|
19
|
+
import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
|
|
21
20
|
const fullPageEditorWrapper = css`
|
|
22
21
|
min-width: 340px;
|
|
23
22
|
height: 100%;
|
|
@@ -186,9 +185,7 @@ function FullPage(props) {
|
|
|
186
185
|
containerElement: scrollContainerRef.current
|
|
187
186
|
}))))), contextPanel && jsx("div", {
|
|
188
187
|
css: sidebarArea
|
|
189
|
-
}, contextPanel)
|
|
190
|
-
editorView: config === null || config === void 0 ? void 0 : config.editorView
|
|
191
|
-
}))))));
|
|
188
|
+
}, contextPanel))))));
|
|
192
189
|
}
|
|
193
190
|
FullPage.displayName = 'FullPageEditor';
|
|
194
191
|
const FullPageWithAnalytics = withAnalyticsEvents()(FullPage);
|
|
@@ -23,8 +23,10 @@ export const createStubInternalApis = () => {
|
|
|
23
23
|
// That means, there is no createAnalyticsEvent available at all.
|
|
24
24
|
// This should not happen, but if it does, we will send a mock function to avoid
|
|
25
25
|
// regression on SmartLinks (they are the only one using this function directly)
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
if (process.env.NODE_ENV === 'development') {
|
|
27
|
+
// eslint-disable-next-line no-console
|
|
28
|
+
console.error('This should never be called, if it does we have a problem');
|
|
29
|
+
}
|
|
28
30
|
return {
|
|
29
31
|
fire: () => {}
|
|
30
32
|
};
|
|
@@ -5,7 +5,7 @@ import blockTypePlugin from '../../../plugins/block-type';
|
|
|
5
5
|
import clearMarksOnChangeToEmptyDocumentPlugin from '../../../plugins/clear-marks-on-change-to-empty-document';
|
|
6
6
|
import hyperlinkPlugin from '../../../plugins/hyperlink';
|
|
7
7
|
import textFormattingPlugin from '../../../plugins/text-formatting';
|
|
8
|
-
import widthPlugin from '
|
|
8
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
9
9
|
import unsupportedContentPlugin from '../../../plugins/unsupported-content';
|
|
10
10
|
import basePlugin from '../../../plugins/base';
|
|
11
11
|
import editorDisabledPlugin from '../../../plugins/editor-disabled';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin,
|
|
1
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin, statusPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin, copyButtonPlugin, borderPlugin } from '../../../plugins';
|
|
2
|
+
import { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
2
3
|
import cardPlugin from '../../../plugins/card';
|
|
3
4
|
import { tablesPlugin } from '@atlaskit/editor-plugin-table';
|
|
4
5
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|