@atlaskit/editor-core 161.0.0 → 162.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/dist/cjs/actions/index.js +76 -48
- package/dist/cjs/extensibility.js +2 -2
- package/dist/cjs/labs/next/full-page.js +1 -1
- package/dist/cjs/plugins/block-type/styles.js +5 -2
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +13 -11
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +11 -7
- package/dist/cjs/plugins/card/messages.js +4 -4
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +29 -11
- package/dist/cjs/plugins/card/ui/LinkToolbarButtonGroup.js +66 -7
- package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +166 -7
- package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +9 -6
- package/dist/cjs/plugins/card/ui/assets/card.js +1 -1
- package/dist/cjs/plugins/card/ui/assets/embed.js +1 -1
- package/dist/cjs/plugins/card/ui/assets/inline.js +1 -1
- package/dist/cjs/plugins/card/ui/assets/url.js +1 -1
- package/dist/cjs/plugins/card/ui/link-toolbar-button-group-options.js +60 -0
- package/dist/cjs/plugins/card/ui/link-toolbar-icon-dropdown-options.js +66 -0
- package/dist/cjs/plugins/card/ui/styled.js +5 -13
- package/dist/cjs/plugins/card/ui/types.js +5 -0
- package/dist/cjs/plugins/clipboard/pm-plugins/main.js +99 -3
- package/dist/cjs/plugins/code-block/styles.js +45 -38
- package/dist/cjs/plugins/extension/plugin-factory.js +4 -1
- package/dist/cjs/plugins/extension/pm-plugins/main.js +34 -11
- package/dist/cjs/plugins/extension/utils.js +57 -12
- package/dist/cjs/plugins/find-replace/ui/Find.js +12 -12
- package/dist/cjs/plugins/find-replace/ui/FindReplace.js +5 -5
- package/dist/cjs/plugins/find-replace/ui/Replace.js +5 -5
- package/dist/cjs/plugins/find-replace/ui/styles.js +12 -15
- package/dist/cjs/plugins/layout/styles.js +2 -2
- package/dist/cjs/plugins/list/actions/wrap-and-join-lists.js +180 -0
- package/dist/cjs/plugins/list/commands/index.js +35 -38
- package/dist/cjs/plugins/list/utils/replace-content.js +31 -0
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/cjs/plugins/media/styles.js +2 -2
- package/dist/cjs/plugins/media/utils/media-single.js +15 -2
- package/dist/cjs/plugins/paste/handlers.js +19 -5
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +1 -1
- package/dist/cjs/plugins/placeholder-text/index.js +45 -1
- package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +66 -22
- package/dist/cjs/plugins/placeholder-text/selection-utils.js +19 -0
- package/dist/cjs/plugins/placeholder-text/styles.js +3 -1
- package/dist/cjs/plugins/table/commands/index.js +0 -6
- package/dist/cjs/plugins/table/commands/insert.js +1 -1
- package/dist/cjs/plugins/table/commands/misc.js +5 -18
- package/dist/cjs/plugins/table/commands-with-analytics.js +1 -1
- package/dist/cjs/plugins/table/handlers.js +6 -2
- package/dist/cjs/plugins/table/index.js +7 -13
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/cjs/plugins/table/nodeviews/table.js +7 -38
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/main.js +3 -1
- package/dist/cjs/plugins/table/pm-plugins/plugin-factory.js +4 -7
- package/dist/cjs/plugins/table/pm-plugins/plugin-key.js +11 -0
- package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +3 -3
- package/dist/cjs/plugins/table/reducer.js +0 -7
- package/dist/cjs/plugins/table/toolbar.js +5 -15
- package/dist/cjs/plugins/table/transforms/metadata.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +3 -1
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +1 -2
- package/dist/cjs/plugins/table/ui/common-styles.css.js +17 -8
- package/dist/cjs/plugins/table/ui/ui-styles.css.js +39 -25
- package/dist/cjs/plugins/table/utils/nodes.js +15 -15
- package/dist/cjs/plugins/tasks-and-decisions/commands.js +15 -1
- package/dist/cjs/plugins/text-formatting/styles.js +5 -2
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +71 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
- package/dist/cjs/plugins/text-formatting/utils.js +30 -2
- package/dist/cjs/plugins/type-ahead/api.js +32 -1
- package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +20 -5
- package/dist/cjs/plugins/type-ahead/utils.js +22 -4
- package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +1 -1
- package/dist/cjs/ui/ContentStyles/index.js +32 -9
- package/dist/cjs/utils/index.js +1 -8
- package/dist/cjs/utils/insert.js +1 -9
- package/dist/cjs/utils/selection.js +2 -9
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +20 -23
- package/dist/es2019/extensibility.js +1 -1
- package/dist/es2019/labs/next/full-page.js +2 -2
- package/dist/es2019/plugins/block-type/styles.js +3 -3
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +15 -12
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +19 -14
- package/dist/es2019/plugins/card/messages.js +4 -4
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +21 -9
- package/dist/es2019/plugins/card/ui/LinkToolbarButtonGroup.js +54 -3
- package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +145 -3
- package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +10 -6
- package/dist/es2019/plugins/card/ui/assets/card.js +1 -1
- package/dist/es2019/plugins/card/ui/assets/embed.js +1 -1
- package/dist/es2019/plugins/card/ui/assets/inline.js +1 -1
- package/dist/es2019/plugins/card/ui/assets/url.js +1 -1
- package/dist/es2019/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
- package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
- package/dist/es2019/plugins/card/ui/styled.js +2 -2
- package/dist/es2019/plugins/card/ui/types.js +1 -0
- package/dist/es2019/plugins/clipboard/pm-plugins/main.js +91 -9
- package/dist/es2019/plugins/code-block/styles.js +14 -14
- package/dist/es2019/plugins/extension/plugin-factory.js +3 -1
- package/dist/es2019/plugins/extension/pm-plugins/main.js +38 -12
- package/dist/es2019/plugins/extension/utils.js +37 -2
- package/dist/es2019/plugins/find-replace/ui/Find.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/FindReplace.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/Replace.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/styles.js +14 -9
- package/dist/es2019/plugins/layout/styles.js +5 -1
- package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +163 -0
- package/dist/es2019/plugins/list/commands/index.js +29 -28
- package/dist/es2019/plugins/list/utils/replace-content.js +22 -0
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/es2019/plugins/media/styles.js +1 -1
- package/dist/es2019/plugins/media/utils/media-single.js +14 -1
- package/dist/es2019/plugins/paste/handlers.js +19 -5
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
- package/dist/es2019/plugins/placeholder-text/index.js +46 -1
- package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +66 -20
- package/dist/es2019/plugins/placeholder-text/selection-utils.js +9 -0
- package/dist/es2019/plugins/placeholder-text/styles.js +22 -0
- package/dist/es2019/plugins/table/commands/index.js +1 -1
- package/dist/es2019/plugins/table/commands/insert.js +1 -1
- package/dist/es2019/plugins/table/commands/misc.js +5 -11
- package/dist/es2019/plugins/table/commands-with-analytics.js +1 -1
- package/dist/es2019/plugins/table/handlers.js +6 -2
- package/dist/es2019/plugins/table/index.js +4 -8
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/es2019/plugins/table/nodeviews/table.js +2 -16
- package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/main.js +2 -1
- package/dist/es2019/plugins/table/pm-plugins/plugin-factory.js +1 -2
- package/dist/es2019/plugins/table/pm-plugins/plugin-key.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
- package/dist/es2019/plugins/table/reducer.js +0 -9
- package/dist/es2019/plugins/table/toolbar.js +1 -4
- package/dist/es2019/plugins/table/transforms/metadata.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +2 -1
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +1 -2
- package/dist/es2019/plugins/table/ui/common-styles.css.js +51 -26
- package/dist/es2019/plugins/table/ui/ui-styles.css.js +57 -56
- package/dist/es2019/plugins/table/utils/nodes.js +11 -11
- package/dist/es2019/plugins/tasks-and-decisions/commands.js +13 -1
- package/dist/es2019/plugins/text-formatting/styles.js +3 -3
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +61 -2
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
- package/dist/es2019/plugins/text-formatting/utils.js +13 -1
- package/dist/es2019/plugins/type-ahead/api.js +31 -2
- package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +17 -5
- package/dist/es2019/plugins/type-ahead/utils.js +15 -0
- package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/es2019/ui/ContentStyles/index.js +45 -23
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/utils/insert.js +2 -10
- package/dist/es2019/utils/selection.js +1 -6
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +76 -48
- package/dist/esm/extensibility.js +1 -1
- package/dist/esm/labs/next/full-page.js +2 -2
- package/dist/esm/plugins/block-type/styles.js +4 -2
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +14 -12
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +9 -5
- package/dist/esm/plugins/card/messages.js +4 -4
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +25 -9
- package/dist/esm/plugins/card/ui/LinkToolbarButtonGroup.js +57 -5
- package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +154 -5
- package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +9 -6
- package/dist/esm/plugins/card/ui/assets/card.js +1 -1
- package/dist/esm/plugins/card/ui/assets/embed.js +1 -1
- package/dist/esm/plugins/card/ui/assets/inline.js +1 -1
- package/dist/esm/plugins/card/ui/assets/url.js +1 -1
- package/dist/esm/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
- package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
- package/dist/esm/plugins/card/ui/styled.js +2 -2
- package/dist/esm/plugins/card/ui/types.js +1 -0
- package/dist/esm/plugins/clipboard/pm-plugins/main.js +91 -2
- package/dist/esm/plugins/code-block/styles.js +42 -38
- package/dist/esm/plugins/extension/plugin-factory.js +3 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +34 -11
- package/dist/esm/plugins/extension/utils.js +51 -9
- package/dist/esm/plugins/find-replace/ui/Find.js +1 -1
- package/dist/esm/plugins/find-replace/ui/FindReplace.js +1 -1
- package/dist/esm/plugins/find-replace/ui/Replace.js +1 -1
- package/dist/esm/plugins/find-replace/ui/styles.js +6 -10
- package/dist/esm/plugins/layout/styles.js +2 -2
- package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +168 -0
- package/dist/esm/plugins/list/commands/index.js +33 -34
- package/dist/esm/plugins/list/utils/replace-content.js +21 -0
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/esm/plugins/media/styles.js +1 -1
- package/dist/esm/plugins/media/utils/media-single.js +12 -1
- package/dist/esm/plugins/paste/handlers.js +19 -5
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
- package/dist/esm/plugins/placeholder-text/index.js +44 -1
- package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +67 -20
- package/dist/esm/plugins/placeholder-text/selection-utils.js +9 -0
- package/dist/esm/plugins/placeholder-text/styles.js +2 -1
- package/dist/esm/plugins/table/commands/index.js +1 -1
- package/dist/esm/plugins/table/commands/insert.js +1 -1
- package/dist/esm/plugins/table/commands/misc.js +5 -15
- package/dist/esm/plugins/table/commands-with-analytics.js +1 -1
- package/dist/esm/plugins/table/handlers.js +6 -2
- package/dist/esm/plugins/table/index.js +6 -11
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/esm/plugins/table/nodeviews/table.js +6 -37
- package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/main.js +2 -1
- package/dist/esm/plugins/table/pm-plugins/plugin-factory.js +1 -2
- package/dist/esm/plugins/table/pm-plugins/plugin-key.js +2 -0
- package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
- package/dist/esm/plugins/table/reducer.js +0 -7
- package/dist/esm/plugins/table/toolbar.js +1 -10
- package/dist/esm/plugins/table/transforms/metadata.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +2 -1
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +1 -2
- package/dist/esm/plugins/table/ui/common-styles.css.js +10 -6
- package/dist/esm/plugins/table/ui/ui-styles.css.js +20 -11
- package/dist/esm/plugins/table/utils/nodes.js +14 -14
- package/dist/esm/plugins/tasks-and-decisions/commands.js +13 -1
- package/dist/esm/plugins/text-formatting/styles.js +4 -2
- package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +69 -2
- package/dist/esm/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
- package/dist/esm/plugins/text-formatting/utils.js +18 -0
- package/dist/esm/plugins/type-ahead/api.js +30 -2
- package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +16 -4
- package/dist/esm/plugins/type-ahead/utils.js +17 -3
- package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/esm/ui/ContentStyles/index.js +27 -9
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/insert.js +2 -10
- package/dist/esm/utils/selection.js +1 -6
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +2 -2
- package/dist/types/extensibility.d.ts +1 -1
- package/dist/types/plugins/analytics/types/list-events.d.ts +0 -1
- package/dist/types/plugins/block-type/styles.d.ts +2 -1
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -0
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/styled.d.ts +2 -7
- package/dist/types/plugins/card/messages.d.ts +2 -2
- package/dist/types/plugins/card/ui/LinkToolbarButtonGroup.d.ts +18 -2
- package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +23 -3
- package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +3 -1
- package/dist/types/plugins/card/ui/link-toolbar-button-group-options.d.ts +5 -0
- package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +5 -0
- package/dist/types/plugins/card/ui/styled.d.ts +2 -3
- package/dist/types/plugins/card/ui/types.d.ts +12 -0
- package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +10 -1
- package/dist/types/plugins/code-block/styles.d.ts +3 -2
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/extension/types.d.ts +1 -0
- package/dist/types/plugins/extension/utils.d.ts +3 -1
- package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +2 -1
- package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -5
- package/dist/types/plugins/layout/styles.d.ts +1 -1
- package/dist/types/plugins/list/actions/wrap-and-join-lists.d.ts +25 -0
- package/dist/types/plugins/list/commands/index.d.ts +0 -1
- package/dist/types/plugins/list/utils/replace-content.d.ts +8 -0
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -2
- package/dist/types/plugins/media/styles.d.ts +1 -1
- package/dist/types/plugins/media/utils/media-single.d.ts +1 -0
- package/dist/types/plugins/panel/styles.d.ts +1 -1
- package/dist/types/plugins/paste/handlers.d.ts +1 -1
- package/dist/types/plugins/placeholder-text/placeholder-text-nodeview.d.ts +3 -2
- package/dist/types/plugins/placeholder-text/selection-utils.d.ts +2 -0
- package/dist/types/plugins/rule/styles.d.ts +1 -1
- package/dist/types/plugins/table/commands/index.d.ts +1 -1
- package/dist/types/plugins/table/commands/misc.d.ts +0 -1
- package/dist/types/plugins/table/nodeviews/table.d.ts +0 -1
- package/dist/types/plugins/table/pm-plugins/plugin-factory.d.ts +1 -4
- package/dist/types/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
- package/dist/types/plugins/table/types.d.ts +1 -8
- package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +0 -1
- package/dist/types/plugins/table/ui/common-styles.css.d.ts +6 -3
- package/dist/types/plugins/table/ui/ui-styles.css.d.ts +15 -14
- package/dist/types/plugins/table/utils/nodes.d.ts +6 -6
- package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
- package/dist/types/plugins/text-formatting/styles.d.ts +2 -1
- package/dist/types/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +30 -0
- package/dist/types/plugins/text-formatting/utils.d.ts +4 -0
- package/dist/types/plugins/type-ahead/api.d.ts +11 -1
- package/dist/types/plugins/type-ahead/transforms/open-typeahead-at-cursor.d.ts +1 -0
- package/dist/types/plugins/type-ahead/utils.d.ts +4 -0
- package/dist/types/ui/ContentStyles/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/selection.d.ts +0 -1
- package/package.json +28 -26
|
@@ -32,36 +32,64 @@ var EditorActions = /*#__PURE__*/function () {
|
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
_defineProperty(this, "getResolvedEditorState", function () {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
35
|
+
_defineProperty(this, "getResolvedEditorState", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
36
|
+
var _getCollabProvider;
|
|
37
|
+
|
|
38
|
+
var featureFlags, editorValue, editorView;
|
|
39
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
40
|
+
while (1) {
|
|
41
|
+
switch (_context.prev = _context.next) {
|
|
42
|
+
case 0:
|
|
43
|
+
if (_this.editorView) {
|
|
44
|
+
_context.next = 2;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
throw new Error('Called getResolvedEditorState before editorView is ready');
|
|
49
|
+
|
|
50
|
+
case 2:
|
|
51
|
+
featureFlags = getFeatureFlags(_this.editorView.state);
|
|
52
|
+
|
|
53
|
+
if (featureFlags.useNativeCollabPlugin) {
|
|
54
|
+
_context.next = 10;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
_context.next = 6;
|
|
59
|
+
return _this.getValue();
|
|
60
|
+
|
|
61
|
+
case 6:
|
|
62
|
+
editorValue = _context.sent;
|
|
63
|
+
|
|
64
|
+
if (editorValue) {
|
|
65
|
+
_context.next = 9;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
throw new Error('editorValue is undefined');
|
|
70
|
+
|
|
71
|
+
case 9:
|
|
72
|
+
return _context.abrupt("return", {
|
|
73
|
+
content: editorValue,
|
|
74
|
+
title: null,
|
|
75
|
+
stepVersion: -1
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
case 10:
|
|
79
|
+
editorView = _this.editorView;
|
|
80
|
+
_context.next = 13;
|
|
81
|
+
return getEditorValueWithMedia(editorView);
|
|
82
|
+
|
|
83
|
+
case 13:
|
|
84
|
+
return _context.abrupt("return", (_getCollabProvider = getCollabProvider(editorView.state)) === null || _getCollabProvider === void 0 ? void 0 : _getCollabProvider.getFinalAcknowledgedState());
|
|
85
|
+
|
|
86
|
+
case 14:
|
|
87
|
+
case "end":
|
|
88
|
+
return _context.stop();
|
|
89
|
+
}
|
|
56
90
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
resolver(resolvedEditorState);
|
|
60
|
-
}).catch(function (error) {
|
|
61
|
-
reject(error);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
});
|
|
91
|
+
}, _callee);
|
|
92
|
+
})));
|
|
65
93
|
}
|
|
66
94
|
|
|
67
95
|
_createClass(EditorActions, [{
|
|
@@ -161,30 +189,30 @@ var EditorActions = /*#__PURE__*/function () {
|
|
|
161
189
|
}, {
|
|
162
190
|
key: "__temporaryFixForConfigPanel",
|
|
163
191
|
value: function () {
|
|
164
|
-
var _temporaryFixForConfigPanel2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
192
|
+
var _temporaryFixForConfigPanel2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
165
193
|
var editorView;
|
|
166
|
-
return _regeneratorRuntime.wrap(function
|
|
194
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
167
195
|
while (1) {
|
|
168
|
-
switch (
|
|
196
|
+
switch (_context2.prev = _context2.next) {
|
|
169
197
|
case 0:
|
|
170
198
|
editorView = this.editorView;
|
|
171
199
|
|
|
172
200
|
if (editorView) {
|
|
173
|
-
|
|
201
|
+
_context2.next = 3;
|
|
174
202
|
break;
|
|
175
203
|
}
|
|
176
204
|
|
|
177
|
-
return
|
|
205
|
+
return _context2.abrupt("return");
|
|
178
206
|
|
|
179
207
|
case 3:
|
|
180
208
|
_temporaryFixForConfigPanel(editorView);
|
|
181
209
|
|
|
182
210
|
case 4:
|
|
183
211
|
case "end":
|
|
184
|
-
return
|
|
212
|
+
return _context2.stop();
|
|
185
213
|
}
|
|
186
214
|
}
|
|
187
|
-
},
|
|
215
|
+
}, _callee2, this);
|
|
188
216
|
}));
|
|
189
217
|
|
|
190
218
|
function __temporaryFixForConfigPanel() {
|
|
@@ -197,46 +225,46 @@ var EditorActions = /*#__PURE__*/function () {
|
|
|
197
225
|
}, {
|
|
198
226
|
key: "getValue",
|
|
199
227
|
value: function () {
|
|
200
|
-
var _getValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
228
|
+
var _getValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
201
229
|
var editorView, doc, json, nodeSanitized;
|
|
202
|
-
return _regeneratorRuntime.wrap(function
|
|
230
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
203
231
|
while (1) {
|
|
204
|
-
switch (
|
|
232
|
+
switch (_context3.prev = _context3.next) {
|
|
205
233
|
case 0:
|
|
206
234
|
editorView = this.editorView;
|
|
207
235
|
|
|
208
236
|
if (editorView) {
|
|
209
|
-
|
|
237
|
+
_context3.next = 3;
|
|
210
238
|
break;
|
|
211
239
|
}
|
|
212
240
|
|
|
213
|
-
return
|
|
241
|
+
return _context3.abrupt("return");
|
|
214
242
|
|
|
215
243
|
case 3:
|
|
216
|
-
|
|
244
|
+
_context3.next = 5;
|
|
217
245
|
return getEditorValueWithMedia(editorView);
|
|
218
246
|
|
|
219
247
|
case 5:
|
|
220
|
-
doc =
|
|
248
|
+
doc = _context3.sent;
|
|
221
249
|
json = toJSON(doc);
|
|
222
250
|
|
|
223
251
|
if (this.contentEncode) {
|
|
224
|
-
|
|
252
|
+
_context3.next = 9;
|
|
225
253
|
break;
|
|
226
254
|
}
|
|
227
255
|
|
|
228
|
-
return
|
|
256
|
+
return _context3.abrupt("return", json);
|
|
229
257
|
|
|
230
258
|
case 9:
|
|
231
259
|
nodeSanitized = Node.fromJSON(this.editorView.state.schema, json);
|
|
232
|
-
return
|
|
260
|
+
return _context3.abrupt("return", this.contentEncode(nodeSanitized));
|
|
233
261
|
|
|
234
262
|
case 11:
|
|
235
263
|
case "end":
|
|
236
|
-
return
|
|
264
|
+
return _context3.stop();
|
|
237
265
|
}
|
|
238
266
|
}
|
|
239
|
-
},
|
|
267
|
+
}, _callee3, this);
|
|
240
268
|
}));
|
|
241
269
|
|
|
242
270
|
function getValue() {
|
|
@@ -4,7 +4,7 @@ export { toJSON } from './utils';
|
|
|
4
4
|
export { default as Extension } from './plugins/extension/ui/Extension';
|
|
5
5
|
export { default as ExtensionNodeWrapper } from './plugins/extension/ui/Extension/ExtensionNodeWrapper';
|
|
6
6
|
export { ExtensionNode } from './plugins/extension/nodeviews/extension';
|
|
7
|
-
export { pluginKey as tablePluginKey } from './plugins/table/pm-plugins/plugin-
|
|
7
|
+
export { pluginKey as tablePluginKey } from './plugins/table/pm-plugins/plugin-key';
|
|
8
8
|
export var EmitterEvents = {
|
|
9
9
|
TABLE_DELETED: 'TABLE_DELETED'
|
|
10
10
|
};
|
|
@@ -15,7 +15,7 @@ import ContentStyles from '../../ui/ContentStyles';
|
|
|
15
15
|
import WidthEmitter from '../../ui/WidthEmitter';
|
|
16
16
|
import { ClickAreaBlock } from '../../ui/Addon';
|
|
17
17
|
import { scrollbarStyles } from '../../ui/styles';
|
|
18
|
-
import {
|
|
18
|
+
import { deprecatedTableFullPageEditorStyles } from '../../plugins/table/ui/common-styles.css';
|
|
19
19
|
import AvatarsWithPluginState from '../../plugins/collab-edit/ui';
|
|
20
20
|
import { Editor, EditorContent, useEditorSharedConfig } from './Editor';
|
|
21
21
|
import { Toolbar } from './Toolbar';
|
|
@@ -35,7 +35,7 @@ ContentArea.displayName = 'ContentArea';
|
|
|
35
35
|
var EditorContentArea = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n line-height: 24px;\n height: 100%;\n width: 100%;\n max-width: ", "px;\n padding-top: 50px;\n margin: 0 auto;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n padding-bottom: 55px;\n\n & .ProseMirror {\n flex-grow: 1;\n box-sizing: border-box;\n }\n\n && .ProseMirror {\n & > * {\n clear: both;\n }\n > p,\n > ul,\n > ol,\n > h1,\n > h2,\n > h3,\n > h4,\n > h5,\n > h6 {\n clear: none;\n }\n }\n ", ";\n"])), function (_ref) {
|
|
36
36
|
var theme = _ref.theme;
|
|
37
37
|
return theme.layoutMaxWidth + GUTTER_PADDING * 2;
|
|
38
|
-
},
|
|
38
|
+
}, deprecatedTableFullPageEditorStyles);
|
|
39
39
|
EditorContentArea.displayName = 'EditorContentArea';
|
|
40
40
|
var MainToolbar = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: relative;\n align-items: center;\n box-shadow: ", ";\n transition: box-shadow 200ms;\n z-index: ", ";\n display: flex;\n height: 80px;\n flex-shrink: 0;\n background-color: white;\n\n & object {\n height: 0 !important;\n }\n"])), function (props) {
|
|
41
41
|
return props.showKeyline ? "0 ".concat(akEditorToolbarKeylineHeight, "px 0 0 ").concat(N30) : 'none';
|
|
@@ -2,6 +2,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import { css } from '
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
6
|
import { blockquoteSharedStyles, headingsSharedStyles } from '@atlaskit/editor-common/styles';
|
|
7
|
-
export var blocktypeStyles =
|
|
7
|
+
export var blocktypeStyles = function blocktypeStyles(props) {
|
|
8
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", ";\n ", ";\n }\n"])), blockquoteSharedStyles, headingsSharedStyles(props));
|
|
9
|
+
};
|
|
@@ -11,13 +11,15 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
|
|
12
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
13
|
|
|
14
|
+
/** @jsx jsx */
|
|
14
15
|
import React from 'react';
|
|
16
|
+
import { jsx } from '@emotion/react';
|
|
15
17
|
import { injectIntl } from 'react-intl-next';
|
|
16
18
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
17
19
|
import DropdownMenu from '../../../../ui/DropdownMenu';
|
|
18
20
|
import { Separator, Wrapper, MenuWrapper } from '../../../../ui/styles';
|
|
19
21
|
import { NORMAL_TEXT } from '../../types';
|
|
20
|
-
import {
|
|
22
|
+
import { blockTypeMenuItemStyle, KeyboardShortcut } from './styled';
|
|
21
23
|
import { tooltip, findKeymapByDescription } from '../../../../keymaps';
|
|
22
24
|
import { BlockTypeButton } from './blocktype-button';
|
|
23
25
|
|
|
@@ -60,16 +62,16 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
60
62
|
availableBlockTypes = _this$props$pluginSta.availableBlockTypes;
|
|
61
63
|
var items = availableBlockTypes.map(function (blockType, index) {
|
|
62
64
|
var isActive = currentBlockType === blockType;
|
|
63
|
-
var
|
|
65
|
+
var tagName = blockType.tagName || 'p';
|
|
66
|
+
var Tag = tagName;
|
|
64
67
|
return {
|
|
65
|
-
content:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}, /*#__PURE__*/React.createElement(Tag, null, formatMessage(blockType.title))),
|
|
68
|
+
content: jsx("div", {
|
|
69
|
+
css: blockTypeMenuItemStyle(tagName, isActive)
|
|
70
|
+
}, jsx(Tag, null, formatMessage(blockType.title))),
|
|
69
71
|
value: blockType,
|
|
70
72
|
label: formatMessage(blockType.title),
|
|
71
73
|
key: "".concat(blockType.name, "-").concat(index),
|
|
72
|
-
elemAfter:
|
|
74
|
+
elemAfter: jsx(KeyboardShortcut, {
|
|
73
75
|
selected: isActive
|
|
74
76
|
}, tooltip(findKeymapByDescription(blockType.title.defaultMessage))),
|
|
75
77
|
isActive: isActive
|
|
@@ -129,7 +131,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
129
131
|
|
|
130
132
|
if (!this.props.isDisabled && !blockTypesDisabled) {
|
|
131
133
|
var items = this.createItems();
|
|
132
|
-
return
|
|
134
|
+
return jsx(MenuWrapper, null, jsx(DropdownMenu, {
|
|
133
135
|
items: items,
|
|
134
136
|
onOpenChange: this.onOpenChange,
|
|
135
137
|
onItemActivated: this.handleSelectBlockType,
|
|
@@ -141,7 +143,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
141
143
|
fitHeight: 360,
|
|
142
144
|
fitWidth: 106,
|
|
143
145
|
shouldUseDefaultRole: true
|
|
144
|
-
},
|
|
146
|
+
}, jsx(BlockTypeButton, {
|
|
145
147
|
isSmall: isSmall,
|
|
146
148
|
isReducedSpacing: isReducedSpacing,
|
|
147
149
|
selected: active,
|
|
@@ -150,10 +152,10 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
150
152
|
onClick: this.handleTriggerClick,
|
|
151
153
|
formatMessage: formatMessage,
|
|
152
154
|
"aria-expanded": active
|
|
153
|
-
}, longestDropdownMenuItem)),
|
|
155
|
+
}, longestDropdownMenuItem)), jsx(Separator, null));
|
|
154
156
|
}
|
|
155
157
|
|
|
156
|
-
return
|
|
158
|
+
return jsx(Wrapper, null, jsx(BlockTypeButton, {
|
|
157
159
|
isSmall: isSmall,
|
|
158
160
|
isReducedSpacing: isReducedSpacing,
|
|
159
161
|
selected: active,
|
|
@@ -162,7 +164,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
162
164
|
onClick: this.handleTriggerClick,
|
|
163
165
|
formatMessage: formatMessage,
|
|
164
166
|
"aria-expanded": active
|
|
165
|
-
}, longestDropdownMenuItem),
|
|
167
|
+
}, longestDropdownMenuItem), jsx(Separator, null));
|
|
166
168
|
}
|
|
167
169
|
}]);
|
|
168
170
|
|
|
@@ -2,15 +2,19 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject, _templateObject2;
|
|
4
4
|
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import { css } from '@emotion/react';
|
|
5
7
|
import { N400 } from '@atlaskit/theme/colors';
|
|
6
8
|
import styled from 'styled-components';
|
|
7
9
|
import { headingsSharedStyles } from '@atlaskit/editor-common/styles';
|
|
8
10
|
import { Shortcut } from '../../../../ui/styles';
|
|
9
|
-
export var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
)
|
|
13
|
-
});
|
|
11
|
+
export var blockTypeMenuItemStyle = function blockTypeMenuItemStyle(tagName, selected) {
|
|
12
|
+
// TEMP FIX: See https://product-fabric.atlassian.net/browse/ED-13878
|
|
13
|
+
var selectedStyle = selected ? "".concat(tagName, " { color: white !important; }") : '';
|
|
14
|
+
return function (themeProps) {
|
|
15
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin-top: 0;\n }\n }\n ", ";\n "])), headingsSharedStyles(themeProps), selectedStyle);
|
|
16
|
+
};
|
|
17
|
+
};
|
|
14
18
|
export var KeyboardShortcut = styled(Shortcut)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n margin-left: 16px;\n"])), function (props) {
|
|
15
19
|
return props.selected ? "color: ".concat(N400, ";") : '';
|
|
16
20
|
});
|
|
@@ -45,8 +45,8 @@ export var messages = defineMessages({
|
|
|
45
45
|
defaultMessage: 'URL',
|
|
46
46
|
description: 'Title for option to convert the card to become a regular text-based hyperlink.'
|
|
47
47
|
},
|
|
48
|
-
|
|
49
|
-
id: 'fabric.editor.
|
|
48
|
+
blockTitle: {
|
|
49
|
+
id: 'fabric.editor.blockTitle',
|
|
50
50
|
defaultMessage: 'Card',
|
|
51
51
|
description: 'Title for option to display link in the card view.'
|
|
52
52
|
},
|
|
@@ -65,8 +65,8 @@ export var messages = defineMessages({
|
|
|
65
65
|
defaultMessage: 'Display link as URL',
|
|
66
66
|
description: 'Description for option to convert the card to become a regular text-based hyperlink.'
|
|
67
67
|
},
|
|
68
|
-
|
|
69
|
-
id: 'fabric.editor.
|
|
68
|
+
blockDescription: {
|
|
69
|
+
id: 'fabric.editor.blockDescription',
|
|
70
70
|
defaultMessage: 'Display more information about a link, including a summary and actions',
|
|
71
71
|
description: 'Description for option to display link in the card view.'
|
|
72
72
|
},
|
|
@@ -19,8 +19,10 @@ import Dropdown from '../../floating-toolbar/ui/Dropdown';
|
|
|
19
19
|
import { messages } from '../messages';
|
|
20
20
|
import nodeNames from '../../../messages';
|
|
21
21
|
import { getFeatureFlags } from '../../../plugins/feature-flags-context';
|
|
22
|
-
import LinkToolbarIconDropdown from './LinkToolbarIconDropdown';
|
|
23
|
-
import LinkToolbarButtonGroup from './LinkToolbarButtonGroup';
|
|
22
|
+
import { LinkToolbarIconDropdown } from './LinkToolbarIconDropdown';
|
|
23
|
+
import { LinkToolbarButtonGroup } from './LinkToolbarButtonGroup';
|
|
24
|
+
import { getButtonGroupOption } from './link-toolbar-button-group-options';
|
|
25
|
+
import { getIconDropdownOption } from './link-toolbar-icon-dropdown-options';
|
|
24
26
|
export var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
|
|
25
27
|
_inherits(LinkToolbarAppearance, _React$Component);
|
|
26
28
|
|
|
@@ -60,6 +62,7 @@ export var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
|
|
|
60
62
|
var isSmartLinkSupportedInParent = isSupportedInParent(editorState, Fragment.from(editorState.schema.nodes.blockCard.createChecked({})), currentAppearance);
|
|
61
63
|
var tooltip = isSmartLinkSupportedInParent ? undefined : parentNodeName(editorState, intl);
|
|
62
64
|
var embedOption = allowEmbeds && preview && {
|
|
65
|
+
appearance: 'embed',
|
|
63
66
|
title: intl.formatMessage(messages.embed),
|
|
64
67
|
onClick: setSelectedCardAppearance('embed'),
|
|
65
68
|
selected: currentAppearance === 'embed',
|
|
@@ -76,24 +79,27 @@ export var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
|
|
|
76
79
|
selected: !currentAppearance,
|
|
77
80
|
testId: 'url-appearance'
|
|
78
81
|
}, {
|
|
82
|
+
appearance: 'inline',
|
|
79
83
|
title: intl.formatMessage(messages.inline),
|
|
80
84
|
onClick: setSelectedCardAppearance('inline'),
|
|
81
85
|
selected: currentAppearance === 'inline',
|
|
82
|
-
hidden: false,
|
|
83
86
|
testId: 'inline-appearance'
|
|
84
87
|
}, {
|
|
88
|
+
appearance: 'block',
|
|
85
89
|
title: intl.formatMessage(messages.block),
|
|
86
90
|
onClick: setSelectedCardAppearance('block'),
|
|
87
91
|
selected: currentAppearance === 'block',
|
|
88
|
-
hidden: false,
|
|
89
92
|
testId: 'block-appearance',
|
|
90
93
|
disabled: !isSmartLinkSupportedInParent,
|
|
91
94
|
tooltip: tooltip
|
|
92
95
|
}];
|
|
93
|
-
var title = intl.formatMessage(currentAppearance ? messages[currentAppearance] : messages.url);
|
|
94
96
|
|
|
95
97
|
var dispatchCommand = function dispatchCommand(fn) {
|
|
96
|
-
fn && fn(editorState, view && view.dispatch);
|
|
98
|
+
fn && fn(editorState, view && view.dispatch); // Refocus the view to ensure the editor has focus
|
|
99
|
+
|
|
100
|
+
if (view && !view.hasFocus()) {
|
|
101
|
+
view.focus();
|
|
102
|
+
}
|
|
97
103
|
};
|
|
98
104
|
|
|
99
105
|
if (embedOption) {
|
|
@@ -105,18 +111,28 @@ export var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
|
|
|
105
111
|
|
|
106
112
|
if (viewChangingExperimentToolbarStyle === 'toolbarIcons') {
|
|
107
113
|
return /*#__PURE__*/React.createElement(LinkToolbarButtonGroup, {
|
|
108
|
-
key: "link-toolbar-button-group"
|
|
114
|
+
key: "link-toolbar-button-group",
|
|
115
|
+
options: options.map(function (option) {
|
|
116
|
+
return getButtonGroupOption(intl, dispatchCommand, option);
|
|
117
|
+
})
|
|
109
118
|
});
|
|
110
119
|
}
|
|
111
120
|
|
|
112
121
|
if (viewChangingExperimentToolbarStyle === 'newDropdown') {
|
|
113
122
|
return /*#__PURE__*/React.createElement(LinkToolbarIconDropdown, {
|
|
114
|
-
key: "link-toolbar-icon-dropdown"
|
|
123
|
+
key: "link-toolbar-icon-dropdown",
|
|
124
|
+
title: "Change view",
|
|
125
|
+
buttonTestId: "link-toolbar-appearance-button",
|
|
126
|
+
dispatchCommand: dispatchCommand,
|
|
127
|
+
options: options.map(function (option) {
|
|
128
|
+
return getIconDropdownOption(intl, dispatchCommand, option);
|
|
129
|
+
})
|
|
115
130
|
});
|
|
116
131
|
}
|
|
117
132
|
|
|
133
|
+
var title = intl.formatMessage(currentAppearance ? messages[currentAppearance] : messages.url);
|
|
118
134
|
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
119
|
-
key:
|
|
135
|
+
key: "link-toolbar",
|
|
120
136
|
buttonTestId: "link-toolbar-appearance-button",
|
|
121
137
|
title: title,
|
|
122
138
|
dispatchCommand: dispatchCommand,
|
|
@@ -1,10 +1,62 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
+
var _excluded = ["disabled"];
|
|
4
|
+
|
|
5
|
+
var _templateObject, _templateObject2;
|
|
6
|
+
|
|
2
7
|
import React from 'react';
|
|
8
|
+
import styled from 'styled-components';
|
|
9
|
+
import { ButtonGroup } from '@atlaskit/button';
|
|
10
|
+
import Button from '../../floating-toolbar/ui/Button';
|
|
11
|
+
/**
|
|
12
|
+
* Applying `pointer-events: none;` when disabled allows the Tooltip to be displayed
|
|
13
|
+
*/
|
|
3
14
|
|
|
4
|
-
var
|
|
5
|
-
|
|
15
|
+
export var StyledButton = styled(Button)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n pointer-events: ", ";\n"])), function (_ref) {
|
|
16
|
+
var disabled = _ref.disabled;
|
|
17
|
+
return disabled ? 'none' : 'auto';
|
|
18
|
+
});
|
|
6
19
|
|
|
7
|
-
|
|
20
|
+
var DisallowedWrapper = function DisallowedWrapper(_ref2) {
|
|
21
|
+
var disabled = _ref2.disabled,
|
|
22
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
23
|
+
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", props);
|
|
8
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* The button requires `pointer-events: none;` in order to fix the tooltip, hence
|
|
28
|
+
* leaving us without a disabled cursor, the following fixes this:
|
|
29
|
+
*/
|
|
30
|
+
|
|
9
31
|
|
|
10
|
-
|
|
32
|
+
var StyledDisallowedWrapper = styled(DisallowedWrapper)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: ", ";\n"])), function (_ref3) {
|
|
33
|
+
var disabled = _ref3.disabled;
|
|
34
|
+
return disabled ? 'not-allowed' : 'pointer';
|
|
35
|
+
});
|
|
36
|
+
export var LinkToolbarButtonGroup = function LinkToolbarButtonGroup(_ref4) {
|
|
37
|
+
var options = _ref4.options;
|
|
38
|
+
return /*#__PURE__*/React.createElement(ButtonGroup, null, options.map(function (_ref5) {
|
|
39
|
+
var onClick = _ref5.onClick,
|
|
40
|
+
selected = _ref5.selected,
|
|
41
|
+
disabled = _ref5.disabled,
|
|
42
|
+
testId = _ref5.testId,
|
|
43
|
+
tooltipContent = _ref5.tooltipContent,
|
|
44
|
+
title = _ref5.title,
|
|
45
|
+
Icon = _ref5.icon;
|
|
46
|
+
return /*#__PURE__*/React.createElement(StyledDisallowedWrapper, {
|
|
47
|
+
key: testId,
|
|
48
|
+
disabled: disabled
|
|
49
|
+
}, /*#__PURE__*/React.createElement(StyledButton, {
|
|
50
|
+
title: title,
|
|
51
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
52
|
+
size: "medium",
|
|
53
|
+
label: title
|
|
54
|
+
}),
|
|
55
|
+
selected: selected,
|
|
56
|
+
onClick: onClick,
|
|
57
|
+
testId: testId,
|
|
58
|
+
disabled: disabled,
|
|
59
|
+
tooltipContent: tooltipContent
|
|
60
|
+
}));
|
|
61
|
+
}));
|
|
62
|
+
};
|