@atlaskit/editor-core 171.0.1 → 172.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 +84 -0
- package/codemods/172.0.0-transform-smartlinks-prop.ts +8 -0
- package/codemods/__tests__/rename-smartlinks-prop.ts +204 -0
- package/codemods/migrates/rename-smartlinks-prop.ts +56 -0
- package/dist/cjs/create-editor/ReactEditorView.js +13 -4
- package/dist/cjs/create-editor/create-plugins-list.js +21 -12
- package/dist/cjs/editor.js +8 -23
- package/dist/cjs/labs/next/internal/hooks/use-editor/index.js +6 -1
- package/dist/cjs/labs/next/presets/default.js +1 -1
- package/dist/cjs/nodeviews/context-adapter.js +2 -2
- package/dist/cjs/plugins/analytics/plugin.js +24 -11
- package/dist/cjs/plugins/base/index.js +3 -3
- package/dist/cjs/plugins/base/pm-plugins/disable-spell-checking.js +84 -0
- package/dist/cjs/plugins/card/index.js +1 -1
- package/dist/cjs/plugins/card/toolbar.js +11 -5
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +5 -1
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +7 -7
- package/dist/cjs/plugins/clipboard/pm-plugins/main.js +4 -2
- package/dist/cjs/plugins/code-block/actions.js +13 -0
- package/dist/cjs/plugins/code-block/index.js +7 -0
- package/dist/cjs/plugins/code-block/nodeviews/code-block.js +2 -4
- package/dist/cjs/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +132 -0
- package/dist/cjs/plugins/code-block/pm-plugins/main.js +1 -23
- package/dist/cjs/plugins/code-block/styles.js +3 -36
- package/dist/cjs/plugins/code-block/toolbar.js +9 -0
- package/dist/cjs/plugins/code-block/ui/class-names.js +1 -2
- package/dist/cjs/plugins/copy-button/commands.js +40 -20
- package/dist/cjs/plugins/copy-button/toolbar.js +51 -0
- package/dist/cjs/plugins/copy-button/utils.js +16 -38
- package/dist/cjs/plugins/expand/toolbar.js +8 -2
- package/dist/cjs/plugins/extension/toolbar.js +5 -1
- package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +1 -1
- package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -1
- package/dist/cjs/plugins/extension/ui/Extension/styles.js +2 -4
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +29 -18
- package/dist/cjs/plugins/feedback-dialog/index.js +2 -2
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +0 -20
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +7 -32
- package/dist/cjs/plugins/hyperlink/Toolbar.js +146 -135
- package/dist/cjs/plugins/hyperlink/index.js +4 -4
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +50 -0
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +38 -0
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +50 -5
- package/dist/cjs/plugins/indentation/commands/index.js +35 -7
- package/dist/cjs/plugins/indentation/commands/utils.js +11 -7
- package/dist/cjs/plugins/indentation/pm-plugins/keymap.js +5 -3
- package/dist/cjs/plugins/layout/toolbar.js +3 -1
- package/dist/cjs/plugins/media/toolbar/index.js +13 -5
- package/dist/cjs/plugins/mentions/analytics.js +5 -5
- package/dist/cjs/plugins/panel/toolbar.js +3 -3
- package/dist/cjs/plugins/paste/edge-cases/index.js +16 -3
- package/dist/cjs/plugins/paste/handlers.js +25 -2
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +16 -3
- package/dist/cjs/plugins/paste/pm-plugins/main.js +22 -3
- package/dist/cjs/plugins/status/analytics.js +3 -3
- package/dist/cjs/plugins/table/toolbar.js +2 -2
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +43 -32
- package/dist/cjs/plugins/toolbar-lists-indentation/index.js +33 -13
- package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +122 -0
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +8 -2
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -2
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +7 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +40 -19
- package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +10 -0
- package/dist/cjs/types/browser.js +6 -0
- package/dist/cjs/ui/Addon/click-area-helper.js +40 -19
- package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/cjs/ui/ContentStyles/index.js +1 -3
- package/dist/cjs/ui/DropList/index.js +215 -0
- package/dist/cjs/ui/Dropdown/index.js +2 -5
- package/dist/cjs/ui/DropdownMenu/index.js +140 -86
- package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +25 -14
- package/dist/cjs/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +2 -2
- package/dist/cjs/ui/ElementBrowser/components/ElementList/utils.js +28 -1
- package/dist/cjs/ui/ElementBrowser/constants.js +2 -7
- package/dist/cjs/ui/Layer/index.js +245 -0
- package/dist/cjs/ui/Layer/internal/helpers.js +70 -0
- package/dist/cjs/ui/PortalProvider/index.js +7 -26
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +15 -4
- package/dist/es2019/create-editor/create-plugins-list.js +21 -11
- package/dist/es2019/editor.js +9 -23
- package/dist/es2019/labs/next/internal/hooks/use-editor/index.js +6 -1
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/nodeviews/context-adapter.js +2 -2
- package/dist/es2019/plugins/analytics/plugin.js +19 -4
- package/dist/es2019/plugins/base/index.js +3 -3
- package/dist/es2019/plugins/base/pm-plugins/disable-spell-checking.js +70 -0
- package/dist/es2019/plugins/card/index.js +1 -1
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -2
- package/dist/es2019/plugins/card/toolbar.js +10 -5
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +5 -1
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +7 -7
- package/dist/es2019/plugins/clipboard/pm-plugins/main.js +1 -2
- package/dist/es2019/plugins/code-block/actions.js +12 -0
- package/dist/es2019/plugins/code-block/index.js +4 -0
- package/dist/es2019/plugins/code-block/nodeviews/code-block.js +1 -1
- package/dist/es2019/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +112 -0
- package/dist/es2019/plugins/code-block/pm-plugins/main.js +1 -21
- package/dist/es2019/plugins/code-block/styles.js +2 -159
- package/dist/es2019/plugins/code-block/toolbar.js +8 -0
- package/dist/es2019/plugins/code-block/ui/class-names.js +1 -2
- package/dist/es2019/plugins/copy-button/commands.js +35 -15
- package/dist/es2019/plugins/copy-button/toolbar.js +29 -0
- package/dist/es2019/plugins/copy-button/utils.js +15 -27
- package/dist/es2019/plugins/expand/toolbar.js +4 -1
- package/dist/es2019/plugins/extension/toolbar.js +4 -1
- package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +1 -1
- package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -1
- package/dist/es2019/plugins/extension/ui/Extension/styles.js +1 -3
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +27 -15
- package/dist/es2019/plugins/feedback-dialog/index.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +0 -19
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +14 -29
- package/dist/es2019/plugins/hyperlink/Toolbar.js +11 -5
- package/dist/es2019/plugins/hyperlink/index.js +4 -4
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +24 -0
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +28 -0
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +50 -9
- package/dist/es2019/plugins/indentation/commands/index.js +24 -9
- package/dist/es2019/plugins/indentation/commands/utils.js +8 -3
- package/dist/es2019/plugins/indentation/pm-plugins/keymap.js +5 -4
- package/dist/es2019/plugins/layout/toolbar.js +2 -1
- package/dist/es2019/plugins/media/toolbar/index.js +10 -3
- package/dist/es2019/plugins/mentions/analytics.js +1 -1
- package/dist/es2019/plugins/panel/toolbar.js +1 -1
- package/dist/es2019/plugins/paste/edge-cases/index.js +15 -3
- package/dist/es2019/plugins/paste/handlers.js +27 -2
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +12 -3
- package/dist/es2019/plugins/paste/pm-plugins/main.js +24 -4
- package/dist/es2019/plugins/status/analytics.js +1 -1
- package/dist/es2019/plugins/table/toolbar.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +10 -10
- package/dist/es2019/plugins/toolbar-lists-indentation/index.js +23 -4
- package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +104 -0
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +8 -2
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -2
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +7 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +38 -16
- package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +9 -0
- package/dist/es2019/types/browser.js +2 -0
- package/dist/es2019/ui/Addon/click-area-helper.js +37 -18
- package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/es2019/ui/ContentStyles/index.js +5 -9
- package/dist/es2019/ui/DropList/index.js +186 -0
- package/dist/es2019/ui/Dropdown/index.js +2 -6
- package/dist/es2019/ui/DropdownMenu/index.js +124 -75
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +11 -22
- package/dist/es2019/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +3 -3
- package/dist/es2019/ui/ElementBrowser/components/ElementList/utils.js +26 -2
- package/dist/es2019/ui/ElementBrowser/constants.js +1 -4
- package/dist/es2019/ui/Layer/index.js +195 -0
- package/dist/es2019/ui/Layer/internal/helpers.js +62 -0
- package/dist/es2019/ui/PortalProvider/index.js +5 -23
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +13 -4
- package/dist/esm/create-editor/create-plugins-list.js +21 -12
- package/dist/esm/editor.js +9 -23
- package/dist/esm/labs/next/internal/hooks/use-editor/index.js +6 -1
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/nodeviews/context-adapter.js +2 -2
- package/dist/esm/plugins/analytics/plugin.js +24 -11
- package/dist/esm/plugins/base/index.js +3 -3
- package/dist/esm/plugins/base/pm-plugins/disable-spell-checking.js +72 -0
- package/dist/esm/plugins/card/index.js +1 -1
- package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -2
- package/dist/esm/plugins/card/toolbar.js +11 -5
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +5 -1
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +7 -7
- package/dist/esm/plugins/clipboard/pm-plugins/main.js +1 -2
- package/dist/esm/plugins/code-block/actions.js +12 -0
- package/dist/esm/plugins/code-block/index.js +6 -0
- package/dist/esm/plugins/code-block/nodeviews/code-block.js +2 -4
- package/dist/esm/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +112 -0
- package/dist/esm/plugins/code-block/pm-plugins/main.js +1 -20
- package/dist/esm/plugins/code-block/styles.js +4 -32
- package/dist/esm/plugins/code-block/toolbar.js +8 -0
- package/dist/esm/plugins/code-block/ui/class-names.js +1 -2
- package/dist/esm/plugins/copy-button/commands.js +35 -15
- package/dist/esm/plugins/copy-button/toolbar.js +31 -0
- package/dist/esm/plugins/copy-button/utils.js +14 -29
- package/dist/esm/plugins/expand/toolbar.js +6 -2
- package/dist/esm/plugins/extension/toolbar.js +4 -1
- package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +1 -1
- package/dist/esm/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -1
- package/dist/esm/plugins/extension/ui/Extension/styles.js +3 -4
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +28 -16
- package/dist/esm/plugins/feedback-dialog/index.js +1 -1
- package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +0 -21
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +8 -27
- package/dist/esm/plugins/hyperlink/Toolbar.js +144 -135
- package/dist/esm/plugins/hyperlink/index.js +4 -4
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +26 -0
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +28 -0
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +46 -5
- package/dist/esm/plugins/indentation/commands/index.js +30 -9
- package/dist/esm/plugins/indentation/commands/utils.js +12 -8
- package/dist/esm/plugins/indentation/pm-plugins/keymap.js +5 -4
- package/dist/esm/plugins/layout/toolbar.js +2 -1
- package/dist/esm/plugins/media/toolbar/index.js +12 -5
- package/dist/esm/plugins/mentions/analytics.js +1 -1
- package/dist/esm/plugins/panel/toolbar.js +1 -1
- package/dist/esm/plugins/paste/edge-cases/index.js +15 -3
- package/dist/esm/plugins/paste/handlers.js +23 -2
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +13 -3
- package/dist/esm/plugins/paste/pm-plugins/main.js +23 -4
- package/dist/esm/plugins/status/analytics.js +1 -1
- package/dist/esm/plugins/table/toolbar.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +37 -31
- package/dist/esm/plugins/toolbar-lists-indentation/index.js +32 -13
- package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +105 -0
- package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +8 -2
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -2
- package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +7 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +38 -20
- package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +9 -0
- package/dist/esm/types/browser.js +2 -0
- package/dist/esm/ui/Addon/click-area-helper.js +37 -18
- package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/esm/ui/ContentStyles/index.js +2 -4
- package/dist/esm/ui/DropList/index.js +203 -0
- package/dist/esm/ui/Dropdown/index.js +2 -6
- package/dist/esm/ui/DropdownMenu/index.js +134 -88
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +27 -17
- package/dist/esm/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +3 -3
- package/dist/esm/ui/ElementBrowser/components/ElementList/utils.js +26 -2
- package/dist/esm/ui/ElementBrowser/constants.js +1 -4
- package/dist/esm/ui/Layer/index.js +228 -0
- package/dist/esm/ui/Layer/internal/helpers.js +62 -0
- package/dist/esm/ui/PortalProvider/index.js +7 -26
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/labs/next/presets/default.d.ts +2 -0
- package/dist/types/plugins/analytics/plugin.d.ts +5 -1
- package/dist/types/plugins/analytics/types/cut-copy-events.d.ts +2 -0
- package/dist/types/plugins/analytics/types/general-events.d.ts +1 -0
- package/dist/types/plugins/analytics/types/paste-events.d.ts +1 -0
- package/dist/types/plugins/base/index.d.ts +1 -1
- package/dist/types/plugins/base/pm-plugins/{fix-chrome-spell-checking.d.ts → disable-spell-checking.d.ts} +0 -0
- package/dist/types/plugins/card/index.d.ts +2 -7
- package/dist/types/plugins/card/nodeviews/genericCard.d.ts +2 -1
- package/dist/types/plugins/card/toolbar.d.ts +3 -5
- package/dist/types/plugins/card/types.d.ts +2 -0
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +4 -1
- package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +2 -1
- package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +3 -0
- package/dist/types/plugins/code-block/nodeviews/code-block.d.ts +1 -1
- package/dist/types/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.d.ts +11 -0
- package/dist/types/plugins/code-block/styles.d.ts +0 -1
- package/dist/types/plugins/code-block/ui/class-names.d.ts +0 -1
- package/dist/types/plugins/copy-button/commands.d.ts +2 -2
- package/dist/types/plugins/copy-button/toolbar.d.ts +7 -0
- package/dist/types/plugins/copy-button/utils.d.ts +7 -6
- package/dist/types/plugins/floating-toolbar/types.d.ts +1 -2
- package/dist/types/plugins/hyperlink/Toolbar.d.ts +2 -1
- package/dist/types/plugins/hyperlink/index.d.ts +2 -2
- package/dist/types/plugins/hyperlink/types.d.ts +30 -0
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +7 -0
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.d.ts +2 -0
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +4 -3
- package/dist/types/plugins/indentation/commands/index.d.ts +6 -2
- package/dist/types/plugins/indentation/commands/utils.d.ts +8 -2
- package/dist/types/plugins/paste/edge-cases/index.d.ts +3 -2
- package/dist/types/plugins/paste/handlers.d.ts +1 -0
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +7 -1
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +5 -0
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +2 -1
- package/dist/types/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.d.ts +14 -0
- package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +2 -0
- package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +2 -0
- package/dist/types/types/browser.d.ts +10 -0
- package/dist/types/types/editor-props.d.ts +6 -5
- package/dist/types/types/feature-flags.d.ts +29 -24
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/ui/Addon/click-area-helper.d.ts +10 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/DropList/index.d.ts +22 -0
- package/dist/types/ui/Dropdown/index.d.ts +2 -1
- package/dist/types/ui/DropdownMenu/index.d.ts +0 -1
- package/dist/types/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/components/ElementList/utils.d.ts +1 -0
- package/dist/types/ui/ElementBrowser/constants.d.ts +1 -3
- package/dist/types/ui/Layer/index.d.ts +47 -0
- package/dist/types/ui/Layer/internal/helpers.d.ts +5 -0
- package/package.json +23 -18
- package/dist/cjs/plugins/base/pm-plugins/fix-chrome-spell-checking.js +0 -37
- package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +0 -195
- package/dist/cjs/utils/check-if-mobile-bridge.js +0 -19
- package/dist/es2019/plugins/base/pm-plugins/fix-chrome-spell-checking.js +0 -22
- package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +0 -152
- package/dist/es2019/utils/check-if-mobile-bridge.js +0 -12
- package/dist/esm/plugins/base/pm-plugins/fix-chrome-spell-checking.js +0 -24
- package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +0 -178
- package/dist/esm/utils/check-if-mobile-bridge.js +0 -12
- package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +0 -48
- package/dist/types/utils/check-if-mobile-bridge.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,89 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 172.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`c72a6787b9d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c72a6787b9d) - BREAKING: Removes optional `cardOptions` parameter for the `FloatingToolbarHandler` type.
|
|
8
|
+
|
|
9
|
+
Adds support for using `@atlaskit/link-picker` as the link picking user interface.
|
|
10
|
+
|
|
11
|
+
The link picker requires configuration via the `linking` prop in order to enable link search and suggestions capabilities.
|
|
12
|
+
|
|
13
|
+
The new link picking UI can be opted in by enabling the `lp-link-picker` feature flag.
|
|
14
|
+
|
|
15
|
+
In addition, `smartLinks` is now also configurable via the `linking` prop.
|
|
16
|
+
|
|
17
|
+
Example Usage:
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { AtlassianLinkPickerPlugin } from '@atlassian/link-picker-atlassian-plugin';
|
|
21
|
+
|
|
22
|
+
<Editor
|
|
23
|
+
linking={{
|
|
24
|
+
smartLinks: { ... },
|
|
25
|
+
linkPicker: {
|
|
26
|
+
plugins: [new AtlassianLinkPickerPlugin({ ... })]
|
|
27
|
+
}
|
|
28
|
+
}}
|
|
29
|
+
featureFlags={{
|
|
30
|
+
'lp-link-picker': true
|
|
31
|
+
}}
|
|
32
|
+
/>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
See [Link Picker docs on Atlaskit](https://atlaskit.atlassian.com/packages/linking-platform/link-picker) for more information on how to configure the link picker.
|
|
36
|
+
|
|
37
|
+
- [`080e2269f18`](https://bitbucket.org/atlassian/atlassian-frontend/commits/080e2269f18) - ED-14838: Completely remove allowDynamicTextSizing prop references and deprecation warnings from editor and renderer
|
|
38
|
+
- [`3cc03bb97e3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3cc03bb97e3) - replace @atlaskit/smart-card peer dependency with @atlaskit/link-provider
|
|
39
|
+
|
|
40
|
+
### Minor Changes
|
|
41
|
+
|
|
42
|
+
- [`83e8b89dfc0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/83e8b89dfc0) - [ux] ED-15098 added floating toolbar copy button to card
|
|
43
|
+
- [`559bc4c2996`](https://bitbucket.org/atlassian/atlassian-frontend/commits/559bc4c2996) - [ux] ED-15100 add floating toolbar copy button to extension
|
|
44
|
+
- [`6433d875811`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6433d875811) - [ux] ED-15101 add floating toolbar copy button to media file cards
|
|
45
|
+
- [`92207ab17aa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/92207ab17aa) - Added analytics to floating toolbar copy button
|
|
46
|
+
- [`2affe8adcfa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2affe8adcfa) - ED-14510: Generic feature flag to disable spellcheck via browser and version
|
|
47
|
+
- [`5020781d90a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5020781d90a) - [ux] ED-15099 added floatng toolbar copy button to Expand
|
|
48
|
+
- [`8c3844a3d0c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8c3844a3d0c) - [ux] Refactored DropDown to remove dependency to deprecated package @alaskit/droplist
|
|
49
|
+
- [`6ef6f24577e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6ef6f24577e) - [ux] ED-15010 added floating toolbar copy button to media
|
|
50
|
+
- [`995991c4b11`](https://bitbucket.org/atlassian/atlassian-frontend/commits/995991c4b11) - [ux] ED-15108 added floating toolbar copy button to Layout
|
|
51
|
+
- [`aa0ef1b96e2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/aa0ef1b96e2) - Passing theme context to editor data portals
|
|
52
|
+
- [`1847f358354`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1847f358354) - [ux] ED-15067 Enables indent and outdent buttons for allowed nodes when indentationButtonsInTheToolbar feature flag is true.
|
|
53
|
+
- [`653778721dc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/653778721dc) - ED-15099 fixed floating toolbar copy button not working for nested Expand (Expand inside a table)
|
|
54
|
+
- [`6da96104699`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6da96104699) - [ux][ed-15095] Adds visual feedback to what will be copied when using the code blocks toolbar copy button.
|
|
55
|
+
- [`9df1b8dc62e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9df1b8dc62e) - [ux] ED-15133 Update Extension component to use the editor default text size. Prior to this, text inside of extensions was 2px smaller than the rest of the document.
|
|
56
|
+
- [`ac105d01a9a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ac105d01a9a) - [ux] ED-15096 add floating toolbar copy button to hyperlink
|
|
57
|
+
- [`4c921ea986d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4c921ea986d) - [ME-2375] Fix the duplicated `@` symbol when mention is after an inline content
|
|
58
|
+
- [`6ec84e8dd3f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6ec84e8dd3f) - [ux] ED-15098 add floating toolbar copy button to Card
|
|
59
|
+
|
|
60
|
+
### Patch Changes
|
|
61
|
+
|
|
62
|
+
- [`330619e1611`](https://bitbucket.org/atlassian/atlassian-frontend/commits/330619e1611) - [ux] Fix focus when a user clicks the editor container when editor is rendered inside a modal
|
|
63
|
+
- [`89757fc6ad2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/89757fc6ad2) - ED-14959 Remove handler code that prevents the native find toolbar from appearing
|
|
64
|
+
- [`d989ae10078`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d989ae10078) - ED-15134 - Pasting unsupported markdown will result in paste as plain text action
|
|
65
|
+
- [`2eb44cace7f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2eb44cace7f) - [ED-15095] fix visual indicator of selection to be copied when hovering/focusing on the code block copy button
|
|
66
|
+
- [`2475c367647`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2475c367647) - ED-14860 remove code-block-syntax highlighting
|
|
67
|
+
- [`721bc4d7794`](https://bitbucket.org/atlassian/atlassian-frontend/commits/721bc4d7794) - ED-14377 To remove the imports of version.json which is deprecated
|
|
68
|
+
- [`575b4888124`](https://bitbucket.org/atlassian/atlassian-frontend/commits/575b4888124) - Removed internal test/demo usages of setSmartUserPickerEnv
|
|
69
|
+
- [`7389a63560c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7389a63560c) - ED-14510-test added more unit test and an error handler when parsing JSON string.
|
|
70
|
+
- [`cc39f3ee3b8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cc39f3ee3b8) - [ux] ED-15067 Enables indentation buttons for paragraphs and headings inside of layout columns. Note that the buttons are disabled by default and behind indentationButtonsInTheToolbar feature flag.
|
|
71
|
+
- [`16fa5a45e7a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/16fa5a45e7a) - [EDM-3364] Remove @atlaskit/smart-card peer dependency which was accidentally put back during a conflict resolution. It should no longer be in the peer dependencies of editor-core or renderer packages as it has been replaced by @atlaskit/link-provider
|
|
72
|
+
- [`6f23f0982e8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6f23f0982e8) - [ED-15036] Remove custom scrollbar styles from Element Browser
|
|
73
|
+
- [`46a69f32845`](https://bitbucket.org/atlassian/atlassian-frontend/commits/46a69f32845) - remove unused code from editor-core
|
|
74
|
+
- [`b09e4b69ec0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b09e4b69ec0) - [ux] ED-15212: Fix pasting single list items into actions and decisions by ensuring the list content is added to the action or decision rather than pasted after it
|
|
75
|
+
- [`05c057b6252`](https://bitbucket.org/atlassian/atlassian-frontend/commits/05c057b6252) - [ux] ED-15307 Fixes issues where the table cell options actions would not work on firefox, and visual indicators added to the table on hover of the actions would not consistently be cleared.
|
|
76
|
+
- [`f33714afb1c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f33714afb1c) - ED-15310 Prevents indentation buttons on paragraphs and headings nested in blocks in layouts.
|
|
77
|
+
- [`de16b09b138`](https://bitbucket.org/atlassian/atlassian-frontend/commits/de16b09b138) - ED-15071 Added toolbar input type to list, paragraph and heading, action list indent and outdent functions for analytics. Added a check for indentationAllowed in toolbar-lists-indentation plugin to disable the buttons for paragrpahs and headings if it is false.
|
|
78
|
+
- [`1b1af645388`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1b1af645388) - [ux] ED-15250 Disables indentation button for lists that are already at max indentation level.
|
|
79
|
+
- [`6cbd22a9318`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6cbd22a9318) - ED-15179 bumped markdown-it dependency to prevent vulnerability issue
|
|
80
|
+
- [`f44a3db7605`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f44a3db7605) - [ux] ED-15255 Fixes indentation buttons inside layout columns.
|
|
81
|
+
- [`b10472a1e57`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b10472a1e57) - ED-14471 remove codeBidiWarnings feature flag
|
|
82
|
+
- [`09df2919a7f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/09df2919a7f) - [ux][ed-15176] disabled embedCardLinks in unsupported parent nodes
|
|
83
|
+
- [`16982c2890e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/16982c2890e) - [ux] ED-15112 - Bugfix on the issue when copying text from a panel and pasting it into a list, which creates another panel underneath the list. Instead, this bugfix is now just pasting the text inside the list.
|
|
84
|
+
- [`04db970c32b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/04db970c32b) - ED-14899 add attribute to render measurements and rework analytics events to prevent measurements done in background to resulting in misleading render durations.
|
|
85
|
+
- Updated dependencies
|
|
86
|
+
|
|
3
87
|
## 171.0.1
|
|
4
88
|
|
|
5
89
|
### Patch Changes
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
jest.autoMockOff();
|
|
2
|
+
|
|
3
|
+
import { createTransformer } from '../utils';
|
|
4
|
+
import { renameSmartLinksProp } from '../migrates/rename-smartlinks-prop';
|
|
5
|
+
|
|
6
|
+
// This stays as require() since changing to import will trigger a linter error
|
|
7
|
+
const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
|
|
8
|
+
|
|
9
|
+
const transformer = createTransformer('@atlaskit/editor-core', [
|
|
10
|
+
renameSmartLinksProp,
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
describe('Rename smartLinks to inside linking prop', () => {
|
|
14
|
+
defineInlineTest(
|
|
15
|
+
{ default: transformer, parser: 'tsx' },
|
|
16
|
+
{},
|
|
17
|
+
`
|
|
18
|
+
import React from 'react';
|
|
19
|
+
import { Editor } from '@atlaskit/editor-core';
|
|
20
|
+
|
|
21
|
+
export default () => (
|
|
22
|
+
<Editor />
|
|
23
|
+
);
|
|
24
|
+
`, // -----
|
|
25
|
+
`
|
|
26
|
+
import React from 'react';
|
|
27
|
+
import { Editor } from '@atlaskit/editor-core';
|
|
28
|
+
|
|
29
|
+
export default () => (
|
|
30
|
+
<Editor />
|
|
31
|
+
);
|
|
32
|
+
`, // -----
|
|
33
|
+
'rename nothing if smartLinks prop not set',
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
defineInlineTest(
|
|
37
|
+
{ default: transformer, parser: 'tsx' },
|
|
38
|
+
{},
|
|
39
|
+
`
|
|
40
|
+
import React from 'react';
|
|
41
|
+
import { Editor } from '@atlaskit/editor-core';
|
|
42
|
+
|
|
43
|
+
export default () => (
|
|
44
|
+
<Editor linking />
|
|
45
|
+
);
|
|
46
|
+
`, // -----
|
|
47
|
+
`
|
|
48
|
+
import React from 'react';
|
|
49
|
+
import { Editor } from '@atlaskit/editor-core';
|
|
50
|
+
|
|
51
|
+
export default () => (
|
|
52
|
+
<Editor linking />
|
|
53
|
+
);
|
|
54
|
+
`, // -----
|
|
55
|
+
'rename nothing if boolean prop',
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
defineInlineTest(
|
|
59
|
+
{ default: transformer, parser: 'tsx' },
|
|
60
|
+
{},
|
|
61
|
+
`
|
|
62
|
+
import React from 'react';
|
|
63
|
+
import { Editor } from '@atlaskit/editor-core';
|
|
64
|
+
|
|
65
|
+
export default () => (
|
|
66
|
+
<Editor linking={{ smartLinks: { provider: Promise.resolve({}) } }} />
|
|
67
|
+
);
|
|
68
|
+
`, // -----
|
|
69
|
+
`
|
|
70
|
+
import React from 'react';
|
|
71
|
+
import { Editor } from '@atlaskit/editor-core';
|
|
72
|
+
|
|
73
|
+
export default () => (
|
|
74
|
+
<Editor linking={{ smartLinks: { provider: Promise.resolve({}) } }} />
|
|
75
|
+
);
|
|
76
|
+
`, // -----
|
|
77
|
+
'rename nothing if smartLinks not found',
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
defineInlineTest(
|
|
81
|
+
{ default: transformer, parser: 'tsx' },
|
|
82
|
+
{},
|
|
83
|
+
`
|
|
84
|
+
import React from 'react';
|
|
85
|
+
import { Editor } from '@atlaskit/editor-core';
|
|
86
|
+
|
|
87
|
+
export default () => (
|
|
88
|
+
<Editor smartLinks={{ provider: Promise.resolve({}), allowEmbeds: true }} linking={{ linkPicker: {} }} />
|
|
89
|
+
);
|
|
90
|
+
`, // -----
|
|
91
|
+
`
|
|
92
|
+
import React from 'react';
|
|
93
|
+
import { Editor } from '@atlaskit/editor-core';
|
|
94
|
+
|
|
95
|
+
export default () => (
|
|
96
|
+
<Editor smartLinks={{ provider: Promise.resolve({}), allowEmbeds: true }} linking={{ linkPicker: {} }} />
|
|
97
|
+
);
|
|
98
|
+
`, // -----
|
|
99
|
+
'rename nothing if linking prop already exists',
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
defineInlineTest(
|
|
103
|
+
{ default: transformer, parser: 'tsx' },
|
|
104
|
+
{},
|
|
105
|
+
`
|
|
106
|
+
import React from 'react';
|
|
107
|
+
import { Editor } from '@atlaskit/editor-core';
|
|
108
|
+
|
|
109
|
+
export default () => (
|
|
110
|
+
<Editor smartLinks={{ provider: Promise.resolve({}), allowEmbeds: true }} linking={{ smartLinks: { provider: Promise.resolve({}) } }} />
|
|
111
|
+
);
|
|
112
|
+
`, // -----
|
|
113
|
+
`
|
|
114
|
+
import React from 'react';
|
|
115
|
+
import { Editor } from '@atlaskit/editor-core';
|
|
116
|
+
|
|
117
|
+
export default () => (
|
|
118
|
+
<Editor smartLinks={{ provider: Promise.resolve({}), allowEmbeds: true }} linking={{ smartLinks: { provider: Promise.resolve({}) } }} />
|
|
119
|
+
);
|
|
120
|
+
`, // -----
|
|
121
|
+
'rename nothing if linking prop already exists with smartLinks key',
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
defineInlineTest(
|
|
125
|
+
{ default: transformer, parser: 'tsx' },
|
|
126
|
+
{},
|
|
127
|
+
`
|
|
128
|
+
import React from 'react';
|
|
129
|
+
import { Editor } from '@atlaskit/editor-core';
|
|
130
|
+
|
|
131
|
+
export default () => (
|
|
132
|
+
<Editor smartLinks={{ provider: Promise.resolve({}), allowEmbeds: true }} />
|
|
133
|
+
);
|
|
134
|
+
`, // -----
|
|
135
|
+
`
|
|
136
|
+
import React from 'react';
|
|
137
|
+
import { Editor } from '@atlaskit/editor-core';
|
|
138
|
+
|
|
139
|
+
export default () => (
|
|
140
|
+
<Editor linking={{
|
|
141
|
+
smartLinks: {
|
|
142
|
+
provider: Promise.resolve({}),
|
|
143
|
+
allowEmbeds: true
|
|
144
|
+
}
|
|
145
|
+
}} />
|
|
146
|
+
);
|
|
147
|
+
`, // -----
|
|
148
|
+
'rename smartLinks to key inside linking and do not change other options',
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
defineInlineTest(
|
|
152
|
+
{ default: transformer, parser: 'tsx' },
|
|
153
|
+
{},
|
|
154
|
+
`
|
|
155
|
+
import React from 'react';
|
|
156
|
+
import { Editor as AKEditor } from '@atlaskit/editor-core';
|
|
157
|
+
|
|
158
|
+
export default () => (
|
|
159
|
+
<AKEditor smartLinks={{ provider: Promise.resolve({}) }} />
|
|
160
|
+
);
|
|
161
|
+
`, // -----
|
|
162
|
+
`
|
|
163
|
+
import React from 'react';
|
|
164
|
+
import { Editor as AKEditor } from '@atlaskit/editor-core';
|
|
165
|
+
|
|
166
|
+
export default () => (
|
|
167
|
+
<AKEditor linking={{
|
|
168
|
+
smartLinks: {
|
|
169
|
+
provider: Promise.resolve({})
|
|
170
|
+
}
|
|
171
|
+
}} />
|
|
172
|
+
);
|
|
173
|
+
`, // -----
|
|
174
|
+
'rename smartLinks to key inside linking when Editor is renamed',
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
defineInlineTest(
|
|
178
|
+
{ default: transformer, parser: 'tsx' },
|
|
179
|
+
{},
|
|
180
|
+
`
|
|
181
|
+
import React from 'react';
|
|
182
|
+
|
|
183
|
+
const Editor = (props) => {
|
|
184
|
+
<pre contenteditable>{props.children}</pre>
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export default () => (
|
|
188
|
+
<Editor smartLinks={{ provider: Promise.resolve({}) }} />
|
|
189
|
+
);
|
|
190
|
+
`, // -----
|
|
191
|
+
`
|
|
192
|
+
import React from 'react';
|
|
193
|
+
|
|
194
|
+
const Editor = (props) => {
|
|
195
|
+
<pre contenteditable>{props.children}</pre>
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
export default () => (
|
|
199
|
+
<Editor smartLinks={{ provider: Promise.resolve({}) }} />
|
|
200
|
+
);
|
|
201
|
+
`, // -----
|
|
202
|
+
'rename nothing if smartLinks for Editor is not from @atlaskit/editor-core',
|
|
203
|
+
);
|
|
204
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import core from 'jscodeshift';
|
|
2
|
+
import { Collection } from 'jscodeshift/src/Collection';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Renames a JSX attribute with the given name to be a key
|
|
6
|
+
* within the JSX attribute toObjectName of the name toObjectKey.
|
|
7
|
+
*
|
|
8
|
+
* @param from String
|
|
9
|
+
* @param toObjectName String
|
|
10
|
+
* @param toObjectKey String
|
|
11
|
+
*/
|
|
12
|
+
export const createJSXRenameVariableToNestedKeyTransform = (
|
|
13
|
+
from: string,
|
|
14
|
+
toObjectName: string,
|
|
15
|
+
toObjectKey: string,
|
|
16
|
+
) => {
|
|
17
|
+
return (j: core.JSCodeshift, source: Collection<any>) => {
|
|
18
|
+
source
|
|
19
|
+
.find(j.JSXAttribute, { name: { type: 'JSXIdentifier', name: from } })
|
|
20
|
+
.forEach((fromAttribute) => {
|
|
21
|
+
// is there an existing destination prop
|
|
22
|
+
const isExistingAttribute =
|
|
23
|
+
source.find(j.JSXAttribute, {
|
|
24
|
+
name: { type: 'JSXIdentifier', name: toObjectName },
|
|
25
|
+
}).length !== 0;
|
|
26
|
+
|
|
27
|
+
if (
|
|
28
|
+
!isExistingAttribute &&
|
|
29
|
+
fromAttribute.node.value?.type === 'JSXExpressionContainer' &&
|
|
30
|
+
fromAttribute.node.value.expression.type === 'ObjectExpression'
|
|
31
|
+
) {
|
|
32
|
+
const existingProperties =
|
|
33
|
+
fromAttribute.node.value.expression.properties;
|
|
34
|
+
const newObject = j.objectExpression([
|
|
35
|
+
j.property(
|
|
36
|
+
'init',
|
|
37
|
+
j.identifier(toObjectKey),
|
|
38
|
+
j.objectExpression(existingProperties),
|
|
39
|
+
),
|
|
40
|
+
]);
|
|
41
|
+
fromAttribute.replace(
|
|
42
|
+
j.jsxAttribute(
|
|
43
|
+
j.jsxIdentifier(toObjectName),
|
|
44
|
+
j.jsxExpressionContainer(newObject),
|
|
45
|
+
),
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const renameSmartLinksProp = createJSXRenameVariableToNestedKeyTransform(
|
|
53
|
+
'smartLinks',
|
|
54
|
+
'linking',
|
|
55
|
+
'smartLinks',
|
|
56
|
+
);
|
|
@@ -510,15 +510,18 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
510
510
|
};
|
|
511
511
|
});
|
|
512
512
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createEditorView", function (node) {
|
|
513
|
-
(0, _utils.measureRender)(_measureEnum.default.PROSEMIRROR_RENDERED, function (
|
|
513
|
+
(0, _utils.measureRender)(_measureEnum.default.PROSEMIRROR_RENDERED, function (_ref3) {
|
|
514
514
|
var _this$props$editorPro5, _this$props$editorPro6, _proseMirrorRenderedT, _proseMirrorRenderedT2;
|
|
515
515
|
|
|
516
|
+
var duration = _ref3.duration,
|
|
517
|
+
startTime = _ref3.startTime,
|
|
518
|
+
distortedDuration = _ref3.distortedDuration;
|
|
516
519
|
var proseMirrorRenderedTracking = (_this$props$editorPro5 = _this.props.editorProps) === null || _this$props$editorPro5 === void 0 ? void 0 : (_this$props$editorPro6 = _this$props$editorPro5.performanceTracking) === null || _this$props$editorPro6 === void 0 ? void 0 : _this$props$editorPro6.proseMirrorRenderedTracking;
|
|
517
520
|
var forceSeverityTracking = typeof proseMirrorRenderedTracking === 'undefined' && (0, _utils.shouldForceTracking)();
|
|
518
521
|
_this.proseMirrorRenderedSeverity = !!forceSeverityTracking || proseMirrorRenderedTracking !== null && proseMirrorRenderedTracking !== void 0 && proseMirrorRenderedTracking.trackSeverity ? (0, _utils.getAnalyticsEventSeverity)(duration, (_proseMirrorRenderedT = proseMirrorRenderedTracking === null || proseMirrorRenderedTracking === void 0 ? void 0 : proseMirrorRenderedTracking.severityNormalThreshold) !== null && _proseMirrorRenderedT !== void 0 ? _proseMirrorRenderedT : _consts.PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD, (_proseMirrorRenderedT2 = proseMirrorRenderedTracking === null || proseMirrorRenderedTracking === void 0 ? void 0 : proseMirrorRenderedTracking.severityDegradedThreshold) !== null && _proseMirrorRenderedT2 !== void 0 ? _proseMirrorRenderedT2 : _consts.PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD) : undefined;
|
|
519
522
|
|
|
520
523
|
if (_this.view) {
|
|
521
|
-
var _getContextIdentifier, _this$
|
|
524
|
+
var _getContextIdentifier, _this$experienceStore10;
|
|
522
525
|
|
|
523
526
|
var nodes = (0, _document.getNodesCount)(_this.view.state.doc);
|
|
524
527
|
var ttfb = (0, _utils.getResponseEndTime)();
|
|
@@ -532,12 +535,18 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
532
535
|
nodes: nodes,
|
|
533
536
|
ttfb: ttfb,
|
|
534
537
|
severity: _this.proseMirrorRenderedSeverity,
|
|
535
|
-
objectId: (_getContextIdentifier = (0, _contextIdentifier.getContextIdentifier)(_this.editorState)) === null || _getContextIdentifier === void 0 ? void 0 : _getContextIdentifier.objectId
|
|
538
|
+
objectId: (_getContextIdentifier = (0, _contextIdentifier.getContextIdentifier)(_this.editorState)) === null || _getContextIdentifier === void 0 ? void 0 : _getContextIdentifier.objectId,
|
|
539
|
+
distortedDuration: distortedDuration
|
|
536
540
|
},
|
|
537
541
|
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
538
542
|
});
|
|
539
543
|
|
|
540
|
-
(
|
|
544
|
+
if (!distortedDuration) {
|
|
545
|
+
var _this$experienceStore9;
|
|
546
|
+
|
|
547
|
+
(_this$experienceStore9 = _this.experienceStore) === null || _this$experienceStore9 === void 0 ? void 0 : _this$experienceStore9.mark(_ufo.EditorExperience.loadEditor, _analytics.ACTION.PROSEMIRROR_RENDERED, startTime + duration);
|
|
548
|
+
}
|
|
549
|
+
|
|
541
550
|
(_this$experienceStore10 = _this.experienceStore) === null || _this$experienceStore10 === void 0 ? void 0 : _this$experienceStore10.addMetadata(_ufo.EditorExperience.loadEditor, {
|
|
542
551
|
nodes: nodes,
|
|
543
552
|
ttfb: ttfb
|
|
@@ -65,11 +65,12 @@ function getScrollGutterOptions(props) {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
|
|
68
|
-
var _props$performanceTra, _props$featureFlags, _props$performanceTra2, _props$textFormatting;
|
|
68
|
+
var _props$performanceTra, _props$linking, _props$featureFlags, _props$performanceTra2, _props$textFormatting, _props$linking2;
|
|
69
69
|
|
|
70
70
|
var appearance = props.appearance;
|
|
71
71
|
var isMobile = appearance === 'mobile';
|
|
72
72
|
var inputTracking = (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : _props$performanceTra.inputTracking;
|
|
73
|
+
var cardOptions = ((_props$linking = props.linking) === null || _props$linking === void 0 ? void 0 : _props$linking.smartLinks) || props.smartLinks || props.UNSAFE_cards;
|
|
73
74
|
return {
|
|
74
75
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
75
76
|
typeAhead: {
|
|
@@ -78,7 +79,7 @@ function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
|
|
|
78
79
|
},
|
|
79
80
|
featureFlags: (0, _featureFlagsFromProps.createFeatureFlagsFromProps)(props),
|
|
80
81
|
paste: {
|
|
81
|
-
cardOptions:
|
|
82
|
+
cardOptions: cardOptions,
|
|
82
83
|
sanitizePrivateContent: props.sanitizePrivateContent,
|
|
83
84
|
plainTextPasteLinkification: ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.plainTextPasteLinkification) === true
|
|
84
85
|
},
|
|
@@ -114,7 +115,11 @@ function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
|
|
|
114
115
|
selection: {
|
|
115
116
|
useLongPressSelection: false
|
|
116
117
|
},
|
|
117
|
-
cardOptions:
|
|
118
|
+
cardOptions: cardOptions,
|
|
119
|
+
hyperlinkOptions: {
|
|
120
|
+
linkPicker: (_props$linking2 = props.linking) === null || _props$linking2 === void 0 ? void 0 : _props$linking2.linkPicker,
|
|
121
|
+
cardOptions: cardOptions
|
|
122
|
+
},
|
|
118
123
|
codeBlock: _objectSpread(_objectSpread({}, props.codeBlock), {}, {
|
|
119
124
|
useLongPressSelection: false,
|
|
120
125
|
appearance: props.appearance,
|
|
@@ -131,6 +136,8 @@ function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
|
|
|
131
136
|
|
|
132
137
|
|
|
133
138
|
function createPluginsList(props, prevProps, createAnalyticsEvent) {
|
|
139
|
+
var _props$linking3;
|
|
140
|
+
|
|
134
141
|
var appearance = props.appearance;
|
|
135
142
|
var isMobile = appearance === 'mobile';
|
|
136
143
|
var isComment = appearance === 'comment';
|
|
@@ -338,12 +345,15 @@ function createPluginsList(props, prevProps, createAnalyticsEvent) {
|
|
|
338
345
|
})]);
|
|
339
346
|
}
|
|
340
347
|
|
|
341
|
-
if (props.smartLinks || props.UNSAFE_cards) {
|
|
348
|
+
if ((_props$linking3 = props.linking) !== null && _props$linking3 !== void 0 && _props$linking3.smartLinks || props.smartLinks || props.UNSAFE_cards) {
|
|
349
|
+
var _props$linking4, _props$linking5;
|
|
350
|
+
|
|
342
351
|
var fullWidthMode = props.appearance === 'full-width';
|
|
343
|
-
preset.add([_plugins.cardPlugin, _objectSpread(_objectSpread(_objectSpread({}, props.UNSAFE_cards), props.smartLinks), {}, {
|
|
352
|
+
preset.add([_plugins.cardPlugin, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, props.UNSAFE_cards), props.smartLinks), (_props$linking4 = props.linking) === null || _props$linking4 === void 0 ? void 0 : _props$linking4.smartLinks), {}, {
|
|
344
353
|
platform: isMobile ? 'mobile' : 'web',
|
|
345
354
|
fullWidthMode: fullWidthMode,
|
|
346
|
-
createAnalyticsEvent: createAnalyticsEvent
|
|
355
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
356
|
+
linkPicker: (_props$linking5 = props.linking) === null || _props$linking5 === void 0 ? void 0 : _props$linking5.linkPicker
|
|
347
357
|
})]);
|
|
348
358
|
}
|
|
349
359
|
|
|
@@ -384,7 +394,8 @@ function createPluginsList(props, prevProps, createAnalyticsEvent) {
|
|
|
384
394
|
|
|
385
395
|
|
|
386
396
|
preset.add([_plugins.toolbarListsIndentationPlugin, {
|
|
387
|
-
showIndentationButtons: !!featureFlags.indentationButtonsInTheToolbar
|
|
397
|
+
showIndentationButtons: !!featureFlags.indentationButtonsInTheToolbar,
|
|
398
|
+
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
388
399
|
}]);
|
|
389
400
|
preset.add([_plugins.insertBlockPlugin, {
|
|
390
401
|
allowTables: !!props.allowTables,
|
|
@@ -432,11 +443,9 @@ function createPluginsList(props, prevProps, createAnalyticsEvent) {
|
|
|
432
443
|
preset.add([_plugins.viewUpdateSubscriptionPlugin]);
|
|
433
444
|
}
|
|
434
445
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
}]);
|
|
439
|
-
}
|
|
446
|
+
preset.add([_plugins.codeBidiWarningPlugin, {
|
|
447
|
+
appearance: props.appearance
|
|
448
|
+
}]);
|
|
440
449
|
|
|
441
450
|
if (featureFlags.floatingToolbarCopyButton) {
|
|
442
451
|
preset.add(_plugins.copyButtonPlugin);
|
package/dist/cjs/editor.js
CHANGED
|
@@ -77,8 +77,6 @@ var _featureFlagsFromProps = require("./plugins/feature-flags-context/feature-fl
|
|
|
77
77
|
|
|
78
78
|
var _RenderTracking = require("./utils/performance/components/RenderTracking");
|
|
79
79
|
|
|
80
|
-
var _checkIfMobileBridge = require("./utils/check-if-mobile-bridge");
|
|
81
|
-
|
|
82
80
|
var _templateObject;
|
|
83
81
|
|
|
84
82
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -451,8 +449,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
451
449
|
message: 'To integrate inline comments use experimental annotationProvider – <Editor annotationProviders={{ provider }} />',
|
|
452
450
|
type: 'removed'
|
|
453
451
|
},
|
|
454
|
-
|
|
455
|
-
message: '
|
|
452
|
+
smartLinks: {
|
|
453
|
+
message: 'To use smartLinks, pass the same object into the smartlinks key of linking - <Editor linking={{ smartLinks: {existing object} }}.',
|
|
456
454
|
type: 'removed'
|
|
457
455
|
}
|
|
458
456
|
};
|
|
@@ -494,6 +492,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
494
492
|
}, {
|
|
495
493
|
key: "handleProviders",
|
|
496
494
|
value: function handleProviders(props) {
|
|
495
|
+
var _linking$smartLinks;
|
|
496
|
+
|
|
497
497
|
var emojiProvider = props.emojiProvider,
|
|
498
498
|
mentionProvider = props.mentionProvider,
|
|
499
499
|
taskDecisionProvider = props.taskDecisionProvider,
|
|
@@ -508,7 +508,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
508
508
|
autoformattingProvider = props.autoformattingProvider,
|
|
509
509
|
searchProvider = props.searchProvider,
|
|
510
510
|
UNSAFE_cards = props.UNSAFE_cards,
|
|
511
|
-
smartLinks = props.smartLinks
|
|
511
|
+
smartLinks = props.smartLinks,
|
|
512
|
+
linking = props.linking;
|
|
512
513
|
var _this$state = this.state,
|
|
513
514
|
extensionProvider = _this$state.extensionProvider,
|
|
514
515
|
quickInsertProvider = _this$state.quickInsertProvider;
|
|
@@ -523,7 +524,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
523
524
|
this.providerFactory.setProvider('searchProvider', searchProvider);
|
|
524
525
|
this.providerFactory.setProvider('presenceProvider', presenceProvider);
|
|
525
526
|
this.providerFactory.setProvider('macroProvider', macroProvider);
|
|
526
|
-
var cardProvider = smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider;
|
|
527
|
+
var cardProvider = (linking === null || linking === void 0 ? void 0 : (_linking$smartLinks = linking.smartLinks) === null || _linking$smartLinks === void 0 ? void 0 : _linking$smartLinks.provider) || smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider;
|
|
527
528
|
|
|
528
529
|
if (cardProvider) {
|
|
529
530
|
this.providerFactory.setProvider('cardProvider', cardProvider);
|
|
@@ -563,22 +564,6 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
563
564
|
var renderTracking = (_this$props$performan = this.props.performanceTracking) === null || _this$props$performan === void 0 ? void 0 : (_this$props$performan2 = _this$props$performan.renderTracking) === null || _this$props$performan2 === void 0 ? void 0 : _this$props$performan2.editor;
|
|
564
565
|
var renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
|
|
565
566
|
var useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
|
|
566
|
-
/**
|
|
567
|
-
* The PortalProviderWithThemeProviders renders portals with atlaskit
|
|
568
|
-
* and the deprecated styled components theme providers.
|
|
569
|
-
*
|
|
570
|
-
* Without this the node views react trees;
|
|
571
|
-
* - do not have access to the atlaskit theme via the `useGlobalTheme` hook
|
|
572
|
-
* - do not have access to the theme when using the `styled`${({theme}) => theme.}` api.
|
|
573
|
-
*
|
|
574
|
-
* Added for a mobile regression, which needed to be fixed on master.
|
|
575
|
-
* Once this makes it's way to develop, we should consider making it the default
|
|
576
|
-
* behaviour.
|
|
577
|
-
*
|
|
578
|
-
* https://product-fabric.atlassian.net/browse/ED-14204
|
|
579
|
-
*/
|
|
580
|
-
|
|
581
|
-
var EnvironmentDrivenPortalProvider = (0, _checkIfMobileBridge.checkIfMobileBridge)() ? _PortalProvider.PortalProviderWithThemeProviders : _PortalProvider.PortalProvider;
|
|
582
567
|
return (0, _react2.jsx)(_analyticsNamespacedContext.FabricEditorAnalyticsContext, {
|
|
583
568
|
data: {
|
|
584
569
|
packageName: _versionWrapper.name,
|
|
@@ -603,7 +588,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
603
588
|
css: fullHeight
|
|
604
589
|
}, (0, _react2.jsx)(_EditorContext.default, {
|
|
605
590
|
editorActions: _this5.editorActions
|
|
606
|
-
}, (0, _react2.jsx)(_contextAdapter.ContextAdapter, null, (0, _react2.jsx)(
|
|
591
|
+
}, (0, _react2.jsx)(_contextAdapter.ContextAdapter, null, (0, _react2.jsx)(_PortalProvider.PortalProviderWithThemeProviders, {
|
|
607
592
|
onAnalyticsEvent: _this5.handleAnalyticsEvent,
|
|
608
593
|
useAnalyticsContext: _this5.props.UNSAFE_useAnalyticsContext,
|
|
609
594
|
render: function render(portalProviderAPI) {
|
|
@@ -79,7 +79,11 @@ function useCreateEditor(config) {
|
|
|
79
79
|
|
|
80
80
|
setEditorSharedConfig(function (editorSharedConfig) {
|
|
81
81
|
if (!editorSharedConfig) {
|
|
82
|
-
(0, _utils.measureRender)(_measureEnum.default.PROSEMIRROR_RENDERED, function (
|
|
82
|
+
(0, _utils.measureRender)(_measureEnum.default.PROSEMIRROR_RENDERED, function (_ref) {
|
|
83
|
+
var duration = _ref.duration,
|
|
84
|
+
startTime = _ref.startTime,
|
|
85
|
+
distortedDuration = _ref.distortedDuration;
|
|
86
|
+
|
|
83
87
|
if (sharedConfig && sharedConfig.dispatch) {
|
|
84
88
|
sharedConfig.dispatch(_consts.analyticsEventKey, {
|
|
85
89
|
payload: {
|
|
@@ -87,6 +91,7 @@ function useCreateEditor(config) {
|
|
|
87
91
|
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
88
92
|
attributes: {
|
|
89
93
|
duration: duration,
|
|
94
|
+
distortedDuration: distortedDuration,
|
|
90
95
|
startTime: startTime,
|
|
91
96
|
nodes: (0, _utils2.getNodesCount)(sharedConfig.editorView.state.doc),
|
|
92
97
|
ttfb: (0, _utils.getResponseEndTime)()
|
|
@@ -85,7 +85,7 @@ function createDefaultPreset(options) {
|
|
|
85
85
|
preset.add([_annotation.default, options.annotationProviders]);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
preset.add([_hyperlink.default, options.
|
|
88
|
+
preset.add([_hyperlink.default, options.hyperlinkOptions]);
|
|
89
89
|
preset.add([_textFormatting.default, options.textFormatting]);
|
|
90
90
|
preset.add(_width.default);
|
|
91
91
|
preset.add([_quickInsert.default, options.quickInsert]);
|
|
@@ -25,7 +25,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
25
25
|
|
|
26
26
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _linkProvider = require("@atlaskit/link-provider");
|
|
29
29
|
|
|
30
30
|
var _analyticsNextStableReactContext = _interopRequireDefault(require("@atlaskit/analytics-next-stable-react-context"));
|
|
31
31
|
|
|
@@ -52,7 +52,7 @@ function useContextMemoized(reactContext) {
|
|
|
52
52
|
|
|
53
53
|
var ContextAdapter = function ContextAdapter(_ref) {
|
|
54
54
|
var children = _ref.children;
|
|
55
|
-
var card = useContextMemoized(
|
|
55
|
+
var card = useContextMemoized(_linkProvider.SmartCardContext);
|
|
56
56
|
var analytics = useContextMemoized(_analyticsNextStableReactContext.default);
|
|
57
57
|
return /*#__PURE__*/_react.default.createElement(LegacyContextAdapter, {
|
|
58
58
|
card: card,
|