@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TypeAheadAvailableNodes, SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
2
|
-
import { findHandler, isTypeAheadOpen, getTypeAheadHandler, getTypeAheadQuery } from './utils';
|
|
2
|
+
import { findHandler, findHandlerByTrigger, isTypeAheadOpen, getTypeAheadHandler, getTypeAheadQuery } from './utils';
|
|
3
3
|
import { INPUT_METHOD } from '../analytics/types/enums';
|
|
4
|
-
import { openTypeAheadAtCursor } from './transforms/open-typeahead-at-cursor';
|
|
4
|
+
import { openTypeAheadAtCursor, openTypeAhead } from './transforms/open-typeahead-at-cursor';
|
|
5
5
|
import { closeTypeAhead } from './transforms/close-type-ahead';
|
|
6
6
|
import { updateQuery } from './commands/update-query';
|
|
7
7
|
import { insertTypeAheadItem } from './commands/insert-type-ahead-item';
|
|
@@ -207,6 +207,34 @@ var currentQuery = function currentQuery(_ref8) {
|
|
|
207
207
|
};
|
|
208
208
|
};
|
|
209
209
|
|
|
210
|
+
var find = function find(_ref9) {
|
|
211
|
+
var editorView = _ref9.editorView;
|
|
212
|
+
return function (trigger) {
|
|
213
|
+
var editorState = editorView.state;
|
|
214
|
+
var handler = findHandlerByTrigger({
|
|
215
|
+
trigger: trigger,
|
|
216
|
+
editorState: editorState
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
if (!handler) {
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return handler;
|
|
224
|
+
};
|
|
225
|
+
}; // This is an internal tool to be used inside of others Editor Plugins
|
|
226
|
+
// We shouldn't public export this method.
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
export var createInternalTypeAheadTools = function createInternalTypeAheadTools(editorView) {
|
|
230
|
+
var props = {
|
|
231
|
+
editorView: editorView
|
|
232
|
+
};
|
|
233
|
+
return {
|
|
234
|
+
findTypeAheadHandler: find(props),
|
|
235
|
+
openTypeAheadHandler: openTypeAhead
|
|
236
|
+
};
|
|
237
|
+
};
|
|
210
238
|
export var createTypeAheadTools = function createTypeAheadTools(editorView) {
|
|
211
239
|
var props = {
|
|
212
240
|
editorView: editorView
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { TextSelection } from 'prosemirror-state';
|
|
2
2
|
import { pluginKey } from '../pm-plugins/key';
|
|
3
3
|
import { ACTIONS } from '../pm-plugins/actions';
|
|
4
|
-
export var
|
|
5
|
-
var triggerHandler = _ref.triggerHandler,
|
|
6
|
-
inputMethod = _ref.inputMethod,
|
|
7
|
-
query = _ref.query;
|
|
4
|
+
export var openTypeAhead = function openTypeAhead(props) {
|
|
8
5
|
return function (tr) {
|
|
6
|
+
var triggerHandler = props.triggerHandler,
|
|
7
|
+
inputMethod = props.inputMethod,
|
|
8
|
+
query = props.query;
|
|
9
9
|
tr.setMeta(pluginKey, {
|
|
10
10
|
action: ACTIONS.OPEN_TYPEAHEAD_AT_CURSOR,
|
|
11
11
|
params: {
|
|
@@ -14,6 +14,18 @@ export var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
|
|
|
14
14
|
query: query
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
|
|
20
|
+
var triggerHandler = _ref.triggerHandler,
|
|
21
|
+
inputMethod = _ref.inputMethod,
|
|
22
|
+
query = _ref.query;
|
|
23
|
+
return function (tr) {
|
|
24
|
+
openTypeAhead({
|
|
25
|
+
triggerHandler: triggerHandler,
|
|
26
|
+
inputMethod: inputMethod,
|
|
27
|
+
query: query
|
|
28
|
+
})(tr);
|
|
17
29
|
var selection = tr.selection;
|
|
18
30
|
|
|
19
31
|
if (!(selection instanceof TextSelection)) {
|
|
@@ -60,9 +60,23 @@ export var findHandler = function findHandler(id, state) {
|
|
|
60
60
|
return h.id === id;
|
|
61
61
|
}) || null;
|
|
62
62
|
};
|
|
63
|
-
export var
|
|
64
|
-
var
|
|
65
|
-
|
|
63
|
+
export var findHandlerByTrigger = function findHandlerByTrigger(_ref) {
|
|
64
|
+
var trigger = _ref.trigger,
|
|
65
|
+
editorState = _ref.editorState;
|
|
66
|
+
var pluginState = typeAheadPluginKey.getState(editorState);
|
|
67
|
+
|
|
68
|
+
if (!pluginState || !pluginState.typeAheadHandlers || pluginState.typeAheadHandlers.length === 0) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
var typeAheadHandlers = pluginState.typeAheadHandlers;
|
|
73
|
+
return typeAheadHandlers.find(function (h) {
|
|
74
|
+
return h.trigger === trigger;
|
|
75
|
+
}) || null;
|
|
76
|
+
};
|
|
77
|
+
export var moveSelectedIndex = function moveSelectedIndex(_ref2) {
|
|
78
|
+
var editorView = _ref2.editorView,
|
|
79
|
+
direction = _ref2.direction;
|
|
66
80
|
return function () {
|
|
67
81
|
var typeAheadState = getPluginState(editorView.state);
|
|
68
82
|
|
|
@@ -26,7 +26,7 @@ import ContentStyles from '../../ContentStyles';
|
|
|
26
26
|
import { pluginKey as maxContentSizePluginKey } from '../../../plugins/max-content-size';
|
|
27
27
|
import { stateKey as mediaPluginKey } from '../../../plugins/media/pm-plugins/plugin-key';
|
|
28
28
|
import { ClickAreaBlock } from '../../Addon';
|
|
29
|
-
import {
|
|
29
|
+
import { deprecatedTableCommentEditorStyles } from '../../../plugins/table/ui/common-styles.css';
|
|
30
30
|
import WithFlash from '../../WithFlash';
|
|
31
31
|
import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
32
32
|
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
@@ -42,7 +42,7 @@ var CommentEditor = styled.div(_templateObject || (_templateObject = _taggedTemp
|
|
|
42
42
|
CommentEditor.displayName = 'CommentEditor';
|
|
43
43
|
var ContentArea = styled(ContentStyles)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: auto;\n line-height: 24px;\n ", ";\n\n /** Hack for Bitbucket to ensure entire editorView gets drop event; see ED-3294 **/\n /** Hack for tables controlls. Otherwise marging collapse and controlls are misplaced. **/\n .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n .gridParent {\n margin-left: ", "px;\n margin-right: ", "px;\n width: calc(100% + ", "px);\n }\n\n padding: ", "px;\n\n ", ";\n"])), function (props) {
|
|
44
44
|
return props.maxHeight ? 'max-height: ' + props.maxHeight + 'px;' : '';
|
|
45
|
-
}, CommentEditorMargin, CommentEditorMargin, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, TableControlsPadding,
|
|
45
|
+
}, CommentEditorMargin, CommentEditorMargin, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, TableControlsPadding, deprecatedTableCommentEditorStyles);
|
|
46
46
|
ContentArea.displayName = 'ContentArea';
|
|
47
47
|
var SecondaryToolbar = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n justify-content: flex-end;\n align-items: center;\n display: flex;\n padding: 12px 1px;\n"])));
|
|
48
48
|
SecondaryToolbar.displayName = 'SecondaryToolbar';
|
|
@@ -6,7 +6,7 @@ import styled from 'styled-components';
|
|
|
6
6
|
import { akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorSwoopCubicBezier, akLayoutGutterOffset, ATLASSIAN_NAVIGATION_HEIGHT, akEditorContextPanelWidth } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { taskListSelector, decisionListSelector } from '@atlaskit/adf-schema';
|
|
8
8
|
import ContentStyles from '../../ContentStyles';
|
|
9
|
-
import {
|
|
9
|
+
import { deprecatedTableFullPageEditorStyles } from '../../../plugins/table/ui/common-styles.css';
|
|
10
10
|
import { tableMarginFullWidthMode } from '../../../plugins/table/ui/consts';
|
|
11
11
|
import { scrollbarStyles } from '../../styles';
|
|
12
12
|
var SWOOP_ANIMATION = "0.5s ".concat(akEditorSwoopCubicBezier);
|
|
@@ -27,7 +27,7 @@ export var EditorContentArea = styled.div(_templateObject5 || (_templateObject5
|
|
|
27
27
|
var theme = _ref.theme,
|
|
28
28
|
fullWidthMode = _ref.fullWidthMode;
|
|
29
29
|
return (fullWidthMode ? akEditorFullWidthLayoutWidth : theme.layoutMaxWidth) + TOTAL_PADDING;
|
|
30
|
-
}, SWOOP_ANIMATION, taskListSelector, decisionListSelector,
|
|
30
|
+
}, SWOOP_ANIMATION, taskListSelector, decisionListSelector, deprecatedTableFullPageEditorStyles, function (_ref2) {
|
|
31
31
|
var containerWidth = _ref2.containerWidth;
|
|
32
32
|
|
|
33
33
|
if (!containerWidth) {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
|
|
4
|
-
var _templateObject;
|
|
4
|
+
var _templateObject, _templateObject2;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/** @jsx jsx */
|
|
7
|
+
import React, { useMemo } from 'react';
|
|
8
|
+
import { jsx, css, useTheme } from '@emotion/react';
|
|
7
9
|
import styled from 'styled-components';
|
|
8
10
|
import { whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, shadowSharedStyle, dateSharedStyle, tasksAndDecisionsStyles, annotationSharedStyles, smartCardSharedStyles, textColorStyles } from '@atlaskit/editor-common/styles';
|
|
9
11
|
import { editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
@@ -36,17 +38,33 @@ import { smartCardStyles } from '../../plugins/card/styles';
|
|
|
36
38
|
import { dateStyles } from '../../plugins/date/styles';
|
|
37
39
|
import { embedCardStyles } from '../../plugins/card/ui/styled';
|
|
38
40
|
import { useFeatureFlags } from '../../plugins/feature-flags-context';
|
|
39
|
-
|
|
41
|
+
|
|
42
|
+
var contentStyles = function contentStyles(props) {
|
|
43
|
+
var _props$featureFlags;
|
|
44
|
+
|
|
45
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n"])), editorFontSize({
|
|
46
|
+
theme: props.theme
|
|
47
|
+
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, tableStyles(props), (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockStyles(props) : codeBlockStyles(props), blocktypeStyles(props), textFormattingStyles(props), textColorStyles, mediaStyles, layoutStyles, tasksAndDecisionsStyles, blockMarksSharedStyles, dateSharedStyle, annotationSharedStyles(props), embedCardStyles);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
var DeprecatedContentStyles = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\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 #8cf;\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 /** 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,\n .pm-table-cell-content-wrap div.fabric-editor-block-mark {\n p:first-child {\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"])), placeholderTextStyles, placeholderStyles, listsStyles, ruleStyles, telepointerStyle, gapCursorStyles, panelStyles, fakeCursorStyles, mentionsStyles, function (_ref) {
|
|
40
51
|
var featureFlags = _ref.featureFlags;
|
|
41
|
-
return featureFlags !== null && featureFlags !== void 0 && featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockStyles : codeBlockStyles;
|
|
42
|
-
}, textColorStyles, listsStyles, ruleStyles, mediaStyles, layoutStyles, telepointerStyle, gapCursorStyles, tableStyles, panelStyles, fakeCursorStyles, mentionsStyles, function (_ref2) {
|
|
43
|
-
var featureFlags = _ref2.featureFlags;
|
|
44
52
|
return featureFlags !== null && featureFlags !== void 0 && featureFlags.nextEmojiNodeView ? emojiStylesNext : emojiStyles;
|
|
45
|
-
},
|
|
53
|
+
}, gridStyles, linkStyles, extensionStyles, expandStyles, findReplaceStyles, taskDecisionStyles, statusStyles, smartCardStyles, smartCardSharedStyles, dateStyles, unsupportedStyles, ClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
46
54
|
export default /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
47
55
|
var featureFlags = useFeatureFlags();
|
|
48
|
-
|
|
56
|
+
var allowAnnotation = props.allowAnnotation;
|
|
57
|
+
var theme = useTheme();
|
|
58
|
+
var memoizedStyle = useMemo(function () {
|
|
59
|
+
return contentStyles({
|
|
60
|
+
theme: theme,
|
|
61
|
+
allowAnnotation: allowAnnotation,
|
|
62
|
+
featureFlags: featureFlags
|
|
63
|
+
});
|
|
64
|
+
}, [theme, featureFlags, allowAnnotation]);
|
|
65
|
+
return jsx(DeprecatedContentStyles, _extends({}, props, {
|
|
49
66
|
innerRef: ref,
|
|
50
|
-
featureFlags: featureFlags
|
|
67
|
+
featureFlags: featureFlags,
|
|
68
|
+
css: memoizedStyle
|
|
51
69
|
}));
|
|
52
70
|
});
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -12,7 +12,7 @@ export { isEmptyParagraph, hasVisibleContent, isNodeEmpty, isEmptyDocument, proc
|
|
|
12
12
|
export { cascadeCommands, getEditorValueWithMedia } from './action';
|
|
13
13
|
export { isMarkAllowedInRange, isMarkExcluded, removeBlockMarks, sanitiseSelectionMarksForWrapping, sanitiseMarksInSelection } from './mark';
|
|
14
14
|
export { isParagraph, isText, isLinkMark, validateNodes } from './nodes';
|
|
15
|
-
export {
|
|
15
|
+
export { normaliseNestedLayout, setNodeSelection, setAllSelection, setGapCursorSelection, setCellSelection, setTextSelection, isValidPosition } from './selection';
|
|
16
16
|
export { containsClassName } from './dom';
|
|
17
17
|
export { default as measurements } from './performance/measure-enum';
|
|
18
18
|
|
package/dist/esm/utils/insert.js
CHANGED
|
@@ -4,7 +4,7 @@ import { NodeSelection, Selection } from 'prosemirror-state';
|
|
|
4
4
|
import { ReplaceStep, ReplaceAroundStep } from 'prosemirror-transform';
|
|
5
5
|
import { isEmptyParagraph } from './document';
|
|
6
6
|
import { GapCursorSelection, Side } from '../plugins/selection/gap-cursor-selection';
|
|
7
|
-
import {
|
|
7
|
+
import { normaliseNestedLayout } from './selection';
|
|
8
8
|
export var LookDirection;
|
|
9
9
|
|
|
10
10
|
(function (LookDirection) {
|
|
@@ -167,15 +167,7 @@ export var insertSelectedItem = function insertSelectedItem(maybeNode) {
|
|
|
167
167
|
*/
|
|
168
168
|
} else if (node.isInline || isInputFragment) {
|
|
169
169
|
var fragment = isInputFragment ? node : Fragment.fromArray([node, state.schema.text(' ')]);
|
|
170
|
-
tr = tr.replaceWith(start, start, fragment);
|
|
171
|
-
|
|
172
|
-
if (isChromeWithSelectionBug) {
|
|
173
|
-
var selection = document.getSelection();
|
|
174
|
-
|
|
175
|
-
if (selection) {
|
|
176
|
-
selection.empty();
|
|
177
|
-
}
|
|
178
|
-
}
|
|
170
|
+
tr = tr.replaceWith(start, start, fragment);
|
|
179
171
|
|
|
180
172
|
if (opts.selectInlineNode) {
|
|
181
173
|
// Select inserted node
|
|
@@ -6,7 +6,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
6
6
|
|
|
7
7
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
8
8
|
import { NodeSelection, TextSelection, AllSelection } from 'prosemirror-state';
|
|
9
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
10
9
|
import { GapCursorSelection } from '../plugins/selection/gap-cursor/selection';
|
|
11
10
|
export var setNodeSelection = function setNodeSelection(view, pos) {
|
|
12
11
|
var state = view.state,
|
|
@@ -62,11 +61,7 @@ export var normaliseNestedLayout = function normaliseNestedLayout(_ref, node) {
|
|
|
62
61
|
}
|
|
63
62
|
|
|
64
63
|
return node;
|
|
65
|
-
};
|
|
66
|
-
// @see: https://bugs.chromium.org/p/chromium/issues/detail?id=740085
|
|
67
|
-
// Chrome >= 58 (desktop only)
|
|
68
|
-
|
|
69
|
-
export var isChromeWithSelectionBug = browser.chrome && !browser.android && browser.chrome_version >= 58;
|
|
64
|
+
};
|
|
70
65
|
export var isSelectionAtStartOfNode = function isSelectionAtStartOfNode($pos, parentNode) {
|
|
71
66
|
if (!parentNode) {
|
|
72
67
|
return false;
|
package/dist/esm/version.json
CHANGED
|
@@ -16,7 +16,7 @@ export interface EditorActionsOptions<T> {
|
|
|
16
16
|
replaceSelection(rawValue: Node | Object | string): boolean;
|
|
17
17
|
appendText(text: string): boolean;
|
|
18
18
|
isDocumentEmpty(): boolean;
|
|
19
|
-
getResolvedEditorState(): Promise<ResolvedEditorState>;
|
|
19
|
+
getResolvedEditorState(): Promise<ResolvedEditorState | undefined>;
|
|
20
20
|
}
|
|
21
21
|
export default class EditorActions<T = any> implements EditorActionsOptions<T> {
|
|
22
22
|
private editorView?;
|
|
@@ -50,5 +50,5 @@ export default class EditorActions<T = any> implements EditorActionsOptions<T> {
|
|
|
50
50
|
* refers to the latest state of editor with confirmed
|
|
51
51
|
* steps.
|
|
52
52
|
*/
|
|
53
|
-
getResolvedEditorState: () => Promise<ResolvedEditorState>;
|
|
53
|
+
getResolvedEditorState: () => Promise<ResolvedEditorState | undefined>;
|
|
54
54
|
}
|
|
@@ -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 declare const EmitterEvents: {
|
|
9
9
|
TABLE_DELETED: string;
|
|
10
10
|
};
|
|
@@ -36,7 +36,6 @@ declare type ListConvertedTrackAEP = TrackAEP<ACTION.CONVERTED, ACTION_SUBJECT.L
|
|
|
36
36
|
} & CommonListAnalyticsAttributes, undefined>;
|
|
37
37
|
declare type ListIndentedAEP = TrackAEP<ACTION.INDENTED, ACTION_SUBJECT.LIST, ACTION_SUBJECT_ID.FORMAT_LIST_BULLET | ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER, {
|
|
38
38
|
inputMethod: INPUT_METHOD;
|
|
39
|
-
canSink?: boolean;
|
|
40
39
|
} & CommonListAnalyticsAttributes, undefined>;
|
|
41
40
|
declare type ListOutdentedAEP = TrackAEP<ACTION.OUTDENTED, ACTION_SUBJECT.LIST, ACTION_SUBJECT_ID.FORMAT_LIST_BULLET | ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER, {
|
|
42
41
|
inputMethod: INPUT_METHOD;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { ThemeProps } from '@atlaskit/theme/types';
|
|
2
|
+
export declare const blocktypeStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
+
import { ThemeProps } from '@atlaskit/theme/types';
|
|
1
2
|
import { HTMLAttributes, ComponentClass } from 'react';
|
|
2
|
-
export declare const
|
|
3
|
-
tagName: string;
|
|
4
|
-
selected?: boolean | undefined;
|
|
5
|
-
}, any, import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & {
|
|
6
|
-
tagName: string;
|
|
7
|
-
selected?: boolean | undefined;
|
|
8
|
-
}>;
|
|
3
|
+
export declare const blockTypeMenuItemStyle: (tagName: string, selected?: boolean | undefined) => (themeProps: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
9
4
|
export declare const KeyboardShortcut: ComponentClass<HTMLAttributes<{}> & {
|
|
10
5
|
selected?: boolean;
|
|
11
6
|
}>;
|
|
@@ -44,7 +44,7 @@ export declare const messages: {
|
|
|
44
44
|
defaultMessage: string;
|
|
45
45
|
description: string;
|
|
46
46
|
};
|
|
47
|
-
|
|
47
|
+
blockTitle: {
|
|
48
48
|
id: string;
|
|
49
49
|
defaultMessage: string;
|
|
50
50
|
description: string;
|
|
@@ -64,7 +64,7 @@ export declare const messages: {
|
|
|
64
64
|
defaultMessage: string;
|
|
65
65
|
description: string;
|
|
66
66
|
};
|
|
67
|
-
|
|
67
|
+
blockDescription: {
|
|
68
68
|
id: string;
|
|
69
69
|
defaultMessage: string;
|
|
70
70
|
description: string;
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { GlyphProps } from '@atlaskit/icon/types';
|
|
3
|
+
/**
|
|
4
|
+
* Applying `pointer-events: none;` when disabled allows the Tooltip to be displayed
|
|
5
|
+
*/
|
|
6
|
+
export declare const StyledButton: import("styled-components").StyledComponentClass<import("../../floating-toolbar/ui/Button").Props, any, Pick<import("../../floating-toolbar/ui/Button").Props, "title" | "children" | "className" | "tabIndex" | "onFocus" | "onBlur" | "onClick" | "onMouseEnter" | "onMouseLeave" | "icon" | "appearance" | "disabled" | "target" | "iconAfter" | "selected" | "href" | "tooltipContent" | "testId" | "hideTooltipOnClick" | "ariaHasPopup"> & {
|
|
7
|
+
theme?: any;
|
|
8
|
+
}>;
|
|
9
|
+
export interface ButtonOptionProps {
|
|
10
|
+
title: string;
|
|
11
|
+
selected: boolean;
|
|
12
|
+
testId: string;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
tooltipContent?: string | null;
|
|
15
|
+
onClick: () => void;
|
|
16
|
+
icon: (props: GlyphProps) => JSX.Element;
|
|
17
|
+
}
|
|
2
18
|
export interface LinkToolbarButtonGroupProps {
|
|
19
|
+
options: ButtonOptionProps[];
|
|
3
20
|
}
|
|
4
|
-
declare const LinkToolbarButtonGroup: ({}: LinkToolbarButtonGroupProps) => JSX.Element;
|
|
5
|
-
export default LinkToolbarButtonGroup;
|
|
21
|
+
export declare const LinkToolbarButtonGroup: ({ options, }: LinkToolbarButtonGroupProps) => JSX.Element;
|
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import type { GlyphProps } from '@atlaskit/icon/types';
|
|
4
|
+
import { Props as DropdownProps } from '../../floating-toolbar/ui/Dropdown';
|
|
5
|
+
export declare const ICON_HEIGHT = 40;
|
|
6
|
+
export declare const ICON_WIDTH = 40;
|
|
7
|
+
interface IconSizeProps {
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
3
10
|
}
|
|
4
|
-
|
|
5
|
-
|
|
11
|
+
export interface IconDropdownOptionProps {
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
selected: boolean;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
onClick: () => void;
|
|
17
|
+
icon: (props: GlyphProps & IconSizeProps) => JSX.Element;
|
|
18
|
+
testId?: string;
|
|
19
|
+
tooltipContent?: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface LinkToolbarIconDropdownProps extends DropdownProps {
|
|
22
|
+
options: IconDropdownOptionProps[];
|
|
23
|
+
}
|
|
24
|
+
export declare const LinkToolbarIconDropdown: ({ options, ...rest }: LinkToolbarIconDropdownProps) => jsx.JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
3
5
|
import { Props as ResizerProps } from '../../../ui/Resizer/types';
|
|
4
6
|
declare type State = {
|
|
@@ -53,6 +55,6 @@ export default class ResizableEmbedCard extends React.Component<Props, State> {
|
|
|
53
55
|
* and hence we use `style` prop.
|
|
54
56
|
*/
|
|
55
57
|
private getHeightDefiningComponent;
|
|
56
|
-
render(): JSX.Element;
|
|
58
|
+
render(): jsx.JSX.Element;
|
|
57
59
|
}
|
|
58
60
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IntlShape } from 'react-intl-next';
|
|
2
|
+
import { Command } from '../../../types';
|
|
3
|
+
import { OptionConfig } from './types';
|
|
4
|
+
import { ButtonOptionProps } from './LinkToolbarButtonGroup';
|
|
5
|
+
export declare const getButtonGroupOption: (intl: IntlShape, dispatchCommand: (command: Command) => void, { disabled, onClick, selected, appearance, testId, tooltip }: OptionConfig) => ButtonOptionProps;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IntlShape } from 'react-intl-next';
|
|
2
|
+
import { Command } from '../../../types';
|
|
3
|
+
import { OptionConfig } from './types';
|
|
4
|
+
import { IconDropdownOptionProps } from './LinkToolbarIconDropdown';
|
|
5
|
+
export declare const getIconDropdownOption: (intl: IntlShape, dispatchCommand: (command: Command) => void, { disabled, onClick, selected, appearance, testId, tooltip }: OptionConfig) => IconDropdownOptionProps;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const EmbedSpacing: import("styled-components").StyledComponentClass<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
|
1
|
+
export declare const embedCardStyles: import("@emotion/react").SerializedStyles;
|
|
2
|
+
export declare const embedSpacingStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
+
import { Command } from '../../../types';
|
|
3
|
+
export interface OptionConfig {
|
|
4
|
+
appearance?: CardAppearance;
|
|
5
|
+
title: string;
|
|
6
|
+
onClick: Command;
|
|
7
|
+
selected: boolean;
|
|
8
|
+
testId: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
hidden?: boolean;
|
|
11
|
+
tooltip?: string;
|
|
12
|
+
}
|
|
@@ -3,5 +3,14 @@ import { EditorView } from 'prosemirror-view';
|
|
|
3
3
|
import { PMPluginFactoryParams } from '../../../types';
|
|
4
4
|
import { DispatchAnalyticsEvent } from '../../analytics/types/dispatch-analytics-event';
|
|
5
5
|
import { ACTION } from '../../analytics/types/enums';
|
|
6
|
-
|
|
6
|
+
import { DOMSerializer } from 'prosemirror-model';
|
|
7
|
+
import type { Schema } from 'prosemirror-model';
|
|
8
|
+
export declare const createPlugin: ({ dispatchAnalyticsEvent, schema, }: PMPluginFactoryParams) => SafePlugin<any, any>;
|
|
9
|
+
/**
|
|
10
|
+
* Overrides Prosemirror's default clipboardSerializer, in order to fix table row copy/paste bug raised in ED-13003.
|
|
11
|
+
* This allows us to store the original table’s attributes on the new table that the row is wrapped with when it is being copied.
|
|
12
|
+
* e.g. keeping the layout on a row that is copied.
|
|
13
|
+
* We store the default serializer in order to call it after we handle the table row case.
|
|
14
|
+
*/
|
|
15
|
+
export declare const createClipboardSerializer: (schema: Schema, getEditorView: () => EditorView) => DOMSerializer;
|
|
7
16
|
export declare const sendClipboardAnalytics: (view: EditorView, dispatchAnalyticsEvent: DispatchAnalyticsEvent, action: ACTION.CUT | ACTION.COPIED) => boolean;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
import { ThemeProps } from '@atlaskit/theme/types';
|
|
2
|
+
export declare const highlightingCodeBlockStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const codeBlockStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
@@ -6,6 +6,7 @@ import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider
|
|
|
6
6
|
import { EditorAppearance } from '../../../types/editor-appearance';
|
|
7
7
|
import { Dispatch, EventDispatcher } from '../../../event-dispatcher';
|
|
8
8
|
import { PortalProviderAPI } from '../../../ui/PortalProvider';
|
|
9
|
+
import type { ExtensionState } from '../types';
|
|
9
10
|
import { getPluginState, createCommand } from '../plugin-factory';
|
|
10
11
|
import { pluginKey } from '../plugin-key';
|
|
11
12
|
export declare const updateEditButton: (view: EditorView, extensionProvider: ExtensionProvider) => Promise<UpdateExtension<any> | undefined>;
|
|
@@ -13,5 +14,5 @@ export declare const createExtensionProviderHandler: (view: EditorView) => (name
|
|
|
13
14
|
export declare const createContextIdentifierProviderHandler: (view: EditorView) => (name: string, provider?: Promise<ContextIdentifierProvider> | undefined) => Promise<void>;
|
|
14
15
|
declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, useLongPressSelection?: boolean, options?: {
|
|
15
16
|
appearance?: EditorAppearance;
|
|
16
|
-
}) => SafePlugin<
|
|
17
|
+
}) => SafePlugin<ExtensionState<import("@atlaskit/editor-common/extensions").Parameters>, import("prosemirror-model").Schema<any, any>>;
|
|
17
18
|
export { pluginKey, createPlugin, createCommand, getPluginState };
|
|
@@ -3,6 +3,7 @@ import { UpdateExtension, ExtensionProvider, Parameters, TransformBefore, Transf
|
|
|
3
3
|
export declare type ExtensionState<T extends Parameters = Parameters> = {
|
|
4
4
|
localId?: string;
|
|
5
5
|
autoSaveResolve?: () => void;
|
|
6
|
+
shouldRefreshEditButton: boolean;
|
|
6
7
|
showEditButton: boolean;
|
|
7
8
|
showContextPanel: boolean;
|
|
8
9
|
updateExtension?: Promise<UpdateExtension<T> | void>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Schema, Mark } from 'prosemirror-model';
|
|
2
|
-
import { EditorState } from 'prosemirror-state';
|
|
2
|
+
import { EditorState, ReadonlyTransaction } from 'prosemirror-state';
|
|
3
3
|
import { Node as PMNode } from 'prosemirror-model';
|
|
4
4
|
import { NodeWithPos, DomAtPos } from 'prosemirror-utils';
|
|
5
|
+
import type { ExtensionState } from './types';
|
|
5
6
|
export declare const getSelectedExtension: (state: EditorState, searchParent?: boolean) => import("prosemirror-utils").ContentNodeWithPos | undefined;
|
|
6
7
|
export declare const findExtensionWithLocalId: (state: EditorState, localId?: string | undefined) => NodeWithPos | undefined;
|
|
7
8
|
export declare const getSelectedDomElement: (schema: Schema, domAtPos: DomAtPos, selectedExtensionNode: NodeWithPos) => HTMLElement;
|
|
8
9
|
export declare const getDataConsumerMark: (newNode: PMNode) => Mark | undefined;
|
|
9
10
|
export declare const getNodeTypesReferenced: (ids: string[], state: EditorState) => string[];
|
|
10
11
|
export declare const findNodePosWithLocalId: (state: EditorState, localId: string) => NodeWithPos | undefined;
|
|
12
|
+
export declare const onSelectionChanged: (tr: ReadonlyTransaction, state: ExtensionState) => ExtensionState;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
3
4
|
import { TRIGGER_METHOD, DispatchAnalyticsEvent } from '../../analytics/types';
|
|
4
5
|
import { MatchCaseProps } from '../types';
|
|
5
6
|
export declare type FindReplaceProps = {
|
|
@@ -37,6 +38,6 @@ declare class FindReplace extends React.PureComponent<FindReplaceProps> {
|
|
|
37
38
|
setReplaceTextfieldRef: (replaceTextfieldRef: React.RefObject<HTMLInputElement>) => void;
|
|
38
39
|
setFocusToFind: () => void;
|
|
39
40
|
setFocusToReplace: () => void;
|
|
40
|
-
render(): JSX.Element;
|
|
41
|
+
render(): jsx.JSX.Element;
|
|
41
42
|
}
|
|
42
43
|
export default FindReplace;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const replaceSectionButtonStyles: import("@emotion/
|
|
2
|
-
export declare const ruleStyles: import("@emotion/
|
|
3
|
-
export declare const wrapperStyles: import("@emotion/
|
|
4
|
-
export declare const sectionWrapperStyles: import("@emotion/
|
|
5
|
-
export declare const countStyles: import("@emotion/
|
|
1
|
+
export declare const replaceSectionButtonStyles: import("@emotion/react").SerializedStyles;
|
|
2
|
+
export declare const ruleStyles: import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const wrapperStyles: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const sectionWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const countStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Node, NodeType } from 'prosemirror-model';
|
|
2
|
+
import { Transaction } from 'prosemirror-state';
|
|
3
|
+
/**
|
|
4
|
+
* Wraps the selection in a list with the given type. If this results in
|
|
5
|
+
* two adjacent lists of the same type, those will be joined together.
|
|
6
|
+
*/
|
|
7
|
+
export declare function wrapInListAndJoin(nodeType: NodeType, tr: Transaction): void;
|
|
8
|
+
/**
|
|
9
|
+
* Wraps the selection in a list with the given type and attributes.
|
|
10
|
+
*
|
|
11
|
+
* Adapted from https://github.com/ProseMirror/prosemirror-schema-list/blob/master/src/schema-list.js#L64-L89
|
|
12
|
+
*/
|
|
13
|
+
export declare function wrapInList(listType: NodeType, attrs?: {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}): (tr: Transaction) => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Checks whether two adjacent nodes can be joined. If so, the document
|
|
18
|
+
* will be updated to join those nodes. If not, the original transaction
|
|
19
|
+
* remains untouched.
|
|
20
|
+
*
|
|
21
|
+
* Nodes are considered joinable if the `isJoinable` predicate returns true.
|
|
22
|
+
*
|
|
23
|
+
* Adapted from https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js#L597-L610
|
|
24
|
+
*/
|
|
25
|
+
export declare function autoJoin(tr: Transaction, isJoinable: (before: Node, after: Node) => boolean): void;
|
|
@@ -13,4 +13,3 @@ export declare const rootListDepth: (pos: ResolvedPos, nodes: Record<string, Nod
|
|
|
13
13
|
export declare function toggleList(inputMethod: InputMethod, listType: 'bulletList' | 'orderedList'): Command;
|
|
14
14
|
export declare function toggleBulletList(view: EditorView, inputMethod?: InputMethod): boolean;
|
|
15
15
|
export declare function toggleOrderedList(view: EditorView, inputMethod?: InputMethod): boolean;
|
|
16
|
-
export declare function wrapInList(nodeType: NodeType): Command;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ResolvedPos } from 'prosemirror-model';
|
|
2
|
+
import { Step } from 'prosemirror-transform';
|
|
3
|
+
declare type Params = {
|
|
4
|
+
insertPosition: number;
|
|
5
|
+
$target: ResolvedPos;
|
|
6
|
+
};
|
|
7
|
+
export declare const moveTargetIntoList: ({ insertPosition, $target, }: Params) => Step;
|
|
8
|
+
export {};
|