@atlaskit/editor-core 189.3.14 → 189.3.16
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 +17 -0
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/cjs/plugins/analytics/index.js +0 -6
- package/dist/cjs/plugins/analytics/utils.js +0 -29
- package/dist/cjs/plugins/breakout/index.js +3 -3
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +4 -4
- package/dist/cjs/plugins/extension/extension-api.js +3 -3
- package/dist/cjs/plugins/extension/index.js +14 -3
- package/dist/cjs/plugins/{macro → extension/pm-plugins/macro}/actions.js +3 -4
- package/dist/cjs/plugins/{macro → extension/pm-plugins/macro}/index.js +2 -18
- package/dist/cjs/plugins/extension/toolbar.js +1 -1
- package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
- package/dist/cjs/plugins/find-replace/commands-with-analytics.js +85 -71
- package/dist/cjs/plugins/find-replace/index.js +5 -2
- package/dist/cjs/plugins/find-replace/keymap.js +4 -4
- package/dist/cjs/plugins/index.js +1 -24
- package/dist/cjs/plugins/insert-block/index.js +36 -53
- package/dist/cjs/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.js +3 -9
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +3 -3
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +4 -5
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/item.js +7 -8
- package/dist/cjs/plugins/paste/handlers.js +3 -3
- package/dist/cjs/plugins/paste/pm-plugins/main.js +4 -4
- package/dist/cjs/presets/context.js +5 -3
- package/dist/cjs/presets/universal.js +12 -8
- package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
- package/dist/cjs/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +11 -8
- package/dist/cjs/ui/ContentStyles/index.js +4 -4
- package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
- package/dist/cjs/use-preset.js +0 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/es2019/plugins/analytics/index.js +1 -1
- package/dist/es2019/plugins/analytics/utils.js +0 -24
- package/dist/es2019/plugins/breakout/index.js +1 -1
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +1 -1
- package/dist/es2019/plugins/extension/extension-api.js +2 -2
- package/dist/es2019/plugins/extension/index.js +13 -3
- package/dist/es2019/plugins/{macro → extension/pm-plugins/macro}/actions.js +2 -2
- package/dist/es2019/plugins/{macro → extension/pm-plugins/macro}/index.js +1 -14
- package/dist/es2019/plugins/extension/toolbar.js +1 -1
- package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +20 -19
- package/dist/es2019/plugins/find-replace/commands-with-analytics.js +15 -15
- package/dist/es2019/plugins/find-replace/index.js +7 -2
- package/dist/es2019/plugins/find-replace/keymap.js +4 -4
- package/dist/es2019/plugins/index.js +0 -2
- package/dist/es2019/plugins/insert-block/index.js +19 -36
- package/dist/es2019/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.js +4 -8
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -2
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -3
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/item.js +2 -2
- package/dist/es2019/plugins/paste/handlers.js +4 -3
- package/dist/es2019/plugins/paste/pm-plugins/main.js +4 -4
- package/dist/es2019/presets/context.js +2 -2
- package/dist/es2019/presets/universal.js +10 -6
- package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
- package/dist/es2019/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
- package/dist/es2019/ui/ContentStyles/index.js +1 -1
- package/dist/es2019/ui/ToolbarFeedback/index.js +2 -2
- package/dist/es2019/use-preset.js +0 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/esm/plugins/analytics/index.js +1 -1
- package/dist/esm/plugins/analytics/utils.js +0 -28
- package/dist/esm/plugins/breakout/index.js +1 -1
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +1 -1
- package/dist/esm/plugins/extension/extension-api.js +2 -2
- package/dist/esm/plugins/extension/index.js +14 -3
- package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/actions.js +2 -2
- package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/index.js +1 -17
- package/dist/esm/plugins/extension/toolbar.js +1 -1
- package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
- package/dist/esm/plugins/find-replace/commands-with-analytics.js +84 -70
- package/dist/esm/plugins/find-replace/index.js +5 -2
- package/dist/esm/plugins/find-replace/keymap.js +4 -4
- package/dist/esm/plugins/index.js +0 -2
- package/dist/esm/plugins/insert-block/index.js +36 -53
- package/dist/esm/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.js +4 -10
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -2
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -3
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/item.js +2 -2
- package/dist/esm/plugins/paste/handlers.js +4 -3
- package/dist/esm/plugins/paste/pm-plugins/main.js +4 -4
- package/dist/esm/presets/context.js +2 -2
- package/dist/esm/presets/universal.js +9 -6
- package/dist/esm/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
- package/dist/esm/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
- package/dist/esm/use-preset.js +0 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/analytics/index.d.ts +1 -1
- package/dist/types/plugins/analytics/utils.d.ts +0 -11
- package/dist/types/plugins/extension/extension-api.d.ts +1 -1
- package/dist/{types-ts4.5/plugins → types/plugins/extension/pm-plugins}/macro/index.d.ts +1 -4
- package/dist/types/plugins/extension/pm-plugins/macro/types.d.ts +4 -0
- package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
- package/dist/types/plugins/find-replace/commands-with-analytics.d.ts +9 -9
- package/dist/types/plugins/find-replace/index.d.ts +5 -3
- package/dist/types/plugins/find-replace/keymap.d.ts +2 -1
- package/dist/types/plugins/index.d.ts +0 -2
- package/dist/types/plugins/insert-block/types.d.ts +4 -2
- package/dist/{types-ts4.5 → types/plugins/insert-block}/ui/ElementBrowser/types.d.ts +2 -2
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -2
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -1
- package/dist/types/plugins/mobile-dimensions/index.d.ts +2 -1
- package/dist/types/plugins/paste/handlers.d.ts +2 -1
- package/dist/types/presets/context.d.ts +2 -2
- package/dist/types/presets/default.d.ts +8 -0
- package/dist/types/presets/universal.d.ts +5 -0
- package/dist/types/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
- package/dist/types-ts4.5/plugins/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/analytics/utils.d.ts +0 -11
- package/dist/types-ts4.5/plugins/extension/extension-api.d.ts +1 -1
- package/dist/{types/plugins → types-ts4.5/plugins/extension/pm-plugins}/macro/index.d.ts +1 -4
- package/dist/types-ts4.5/plugins/extension/pm-plugins/macro/types.d.ts +4 -0
- package/dist/types-ts4.5/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
- package/dist/types-ts4.5/plugins/find-replace/commands-with-analytics.d.ts +9 -9
- package/dist/types-ts4.5/plugins/find-replace/index.d.ts +6 -3
- package/dist/types-ts4.5/plugins/find-replace/keymap.d.ts +2 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -2
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +4 -2
- package/dist/{types → types-ts4.5/plugins/insert-block}/ui/ElementBrowser/types.d.ts +2 -2
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -2
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -1
- package/dist/types-ts4.5/plugins/mobile-dimensions/index.d.ts +2 -1
- package/dist/types-ts4.5/plugins/paste/handlers.d.ts +2 -1
- package/dist/types-ts4.5/presets/context.d.ts +2 -2
- package/dist/types-ts4.5/presets/default.d.ts +8 -0
- package/dist/types-ts4.5/presets/universal.d.ts +5 -0
- package/dist/types-ts4.5/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
- package/package.json +5 -9
- package/dist/cjs/plugins/breakout/constants.js +0 -10
- package/dist/cjs/plugins/expand/commands.js +0 -184
- package/dist/cjs/plugins/expand/index.js +0 -111
- package/dist/cjs/plugins/expand/nodeviews/index.js +0 -485
- package/dist/cjs/plugins/expand/pm-plugins/keymap.js +0 -171
- package/dist/cjs/plugins/expand/pm-plugins/main.js +0 -85
- package/dist/cjs/plugins/expand/pm-plugins/plugin-factory.js +0 -15
- package/dist/cjs/plugins/expand/reducer.js +0 -20
- package/dist/cjs/plugins/expand/toolbar.js +0 -59
- package/dist/cjs/plugins/expand/ui/ExpandIconButton.js +0 -104
- package/dist/cjs/plugins/expand/ui/class-names.js +0 -20
- package/dist/cjs/plugins/expand/utils.js +0 -24
- package/dist/cjs/ui/ElementBrowser/types.js +0 -5
- package/dist/es2019/plugins/breakout/constants.js +0 -4
- package/dist/es2019/plugins/expand/commands.js +0 -161
- package/dist/es2019/plugins/expand/index.js +0 -95
- package/dist/es2019/plugins/expand/nodeviews/index.js +0 -475
- package/dist/es2019/plugins/expand/pm-plugins/keymap.js +0 -197
- package/dist/es2019/plugins/expand/pm-plugins/main.js +0 -73
- package/dist/es2019/plugins/expand/pm-plugins/plugin-factory.js +0 -9
- package/dist/es2019/plugins/expand/reducer.js +0 -11
- package/dist/es2019/plugins/expand/toolbar.js +0 -52
- package/dist/es2019/plugins/expand/ui/ExpandIconButton.js +0 -85
- package/dist/es2019/plugins/expand/ui/class-names.js +0 -12
- package/dist/es2019/plugins/expand/utils.js +0 -1
- package/dist/esm/plugins/breakout/constants.js +0 -4
- package/dist/esm/plugins/expand/commands.js +0 -177
- package/dist/esm/plugins/expand/index.js +0 -97
- package/dist/esm/plugins/expand/nodeviews/index.js +0 -477
- package/dist/esm/plugins/expand/pm-plugins/keymap.js +0 -165
- package/dist/esm/plugins/expand/pm-plugins/main.js +0 -77
- package/dist/esm/plugins/expand/pm-plugins/plugin-factory.js +0 -9
- package/dist/esm/plugins/expand/reducer.js +0 -13
- package/dist/esm/plugins/expand/toolbar.js +0 -52
- package/dist/esm/plugins/expand/ui/ExpandIconButton.js +0 -95
- package/dist/esm/plugins/expand/ui/class-names.js +0 -14
- package/dist/esm/plugins/expand/utils.js +0 -1
- package/dist/esm/plugins/macro/types.js +0 -1
- package/dist/esm/ui/ElementBrowser/types.js +0 -1
- package/dist/types/plugins/breakout/constants.d.ts +0 -4
- package/dist/types/plugins/expand/commands.d.ts +0 -13
- package/dist/types/plugins/expand/index.d.ts +0 -31
- package/dist/types/plugins/expand/nodeviews/index.d.ts +0 -55
- package/dist/types/plugins/expand/pm-plugins/keymap.d.ts +0 -4
- package/dist/types/plugins/expand/pm-plugins/main.d.ts +0 -8
- package/dist/types/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
- package/dist/types/plugins/expand/reducer.d.ts +0 -3
- package/dist/types/plugins/expand/toolbar.d.ts +0 -3
- package/dist/types/plugins/expand/types.d.ts +0 -9
- package/dist/types/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
- package/dist/types/plugins/expand/ui/class-names.d.ts +0 -11
- package/dist/types/plugins/expand/utils.d.ts +0 -1
- package/dist/types/plugins/macro/types.d.ts +0 -4
- package/dist/types-ts4.5/plugins/breakout/constants.d.ts +0 -4
- package/dist/types-ts4.5/plugins/expand/commands.d.ts +0 -13
- package/dist/types-ts4.5/plugins/expand/index.d.ts +0 -31
- package/dist/types-ts4.5/plugins/expand/nodeviews/index.d.ts +0 -55
- package/dist/types-ts4.5/plugins/expand/pm-plugins/keymap.d.ts +0 -4
- package/dist/types-ts4.5/plugins/expand/pm-plugins/main.d.ts +0 -8
- package/dist/types-ts4.5/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
- package/dist/types-ts4.5/plugins/expand/reducer.d.ts +0 -3
- package/dist/types-ts4.5/plugins/expand/toolbar.d.ts +0 -3
- package/dist/types-ts4.5/plugins/expand/types.d.ts +0 -9
- package/dist/types-ts4.5/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
- package/dist/types-ts4.5/plugins/expand/ui/class-names.d.ts +0 -11
- package/dist/types-ts4.5/plugins/expand/utils.d.ts +0 -1
- package/dist/types-ts4.5/plugins/macro/types.d.ts +0 -4
- /package/dist/cjs/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
- /package/dist/cjs/plugins/{expand → extension/pm-plugins/macro}/types.js +0 -0
- /package/dist/cjs/plugins/{macro → insert-block/ui/ElementBrowser}/types.js +0 -0
- /package/dist/es2019/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
- /package/dist/es2019/plugins/{expand → extension/pm-plugins/macro}/types.js +0 -0
- /package/dist/es2019/plugins/{macro → insert-block/ui/ElementBrowser}/types.js +0 -0
- /package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
- /package/dist/{es2019/ui/ElementBrowser → esm/plugins/extension/pm-plugins/macro}/types.js +0 -0
- /package/dist/esm/plugins/{expand → insert-block/ui/ElementBrowser}/types.js +0 -0
- /package/dist/types/plugins/{macro → extension/pm-plugins/macro}/actions.d.ts +0 -0
- /package/dist/types/plugins/{macro → extension/pm-plugins/macro}/plugin-key.d.ts +0 -0
- /package/dist/types/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.d.ts +0 -0
- /package/dist/types-ts4.5/plugins/{macro → extension/pm-plugins/macro}/actions.d.ts +0 -0
- /package/dist/types-ts4.5/plugins/{macro → extension/pm-plugins/macro}/plugin-key.d.ts +0 -0
- /package/dist/types-ts4.5/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 189.3.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#43042](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43042) [`fd547efa4e5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fd547efa4e5) - Remove `macro` editor plugin and migrate functionality into extension plugin.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 189.3.15
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#42925](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42925) [`8ea16423505`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8ea16423505) - Removes FF platform.editor.update-table-cell-width-via-step
|
|
15
|
+
- [#42859](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42859) [`16cc82bf2e3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/16cc82bf2e3) - ED-20721 Extract Expand Plugin
|
|
16
|
+
- [#42937](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42937) [`c9a523f6662`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c9a523f6662) - Remove internal withAnalytics function.
|
|
17
|
+
- [#42451](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42451) [`36764ad64a9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/36764ad64a9) - [ECA11Y-87] Mentioned name is not communicated to the users of screen reader
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 189.3.14
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -13,4 +13,4 @@ var _templateObject;
|
|
|
13
13
|
// For reasoning behind styles, see comments in:
|
|
14
14
|
// ./getInlineNodeViewProducer -> portalChildren()
|
|
15
15
|
|
|
16
|
-
var InlineNodeViewSharedStyles = exports.InlineNodeViewSharedStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n display: inline;\n user-select: all;\n /* Collapses zero width spaces inside the inline node view\n to prevent the node from line breaking too early.\n */\n white-space: nowrap;\n /* Then reset to the Editor default so we don't interfere\n with any component styling. */\n & > *:not(
|
|
16
|
+
var InlineNodeViewSharedStyles = exports.InlineNodeViewSharedStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n display: inline;\n user-select: all;\n /* Collapses zero width spaces inside the inline node view\n to prevent the node from line breaking too early.\n */\n white-space: nowrap;\n /* Then reset to the Editor default so we don't interfere\n with any component styling. */\n & > *:not(.zeroWidthSpaceContainer) {\n white-space: pre-wrap;\n }\n // Prevent visually hidden assistive text from being selected.\n & > .assistive {\n user-select: none;\n }\n }\n /** Remove browser deafult selections style. This prevents\n unexpected visual artefacts in Safari when navigating\n with the keyboard or making range selections. */\n &.ua-safari {\n .", " {\n ::selection,\n *::selection {\n background: transparent;\n }\n }\n }\n\n &.ua-chrome .", " > span {\n user-select: none;\n }\n\n .", "AddZeroWidthSpace {\n ::after {\n content: '", "';\n }\n }\n"])), _reactNodeView.inlineNodeViewClassname, _reactNodeView.inlineNodeViewClassname, _reactNodeView.inlineNodeViewClassname, _reactNodeView.inlineNodeViewClassname, _utils.ZERO_WIDTH_SPACE);
|
|
@@ -11,12 +11,6 @@ Object.defineProperty(exports, "addAnalytics", {
|
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
exports.default = void 0;
|
|
14
|
-
Object.defineProperty(exports, "withAnalytics", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function get() {
|
|
17
|
-
return _utils.withAnalytics;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
14
|
var _plugin = _interopRequireDefault(require("./plugin"));
|
|
21
15
|
var _utils = require("./utils");
|
|
22
16
|
var _default = exports.default = _plugin.default;
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.addAnalytics = addAnalytics;
|
|
7
|
-
exports.withAnalytics = withAnalytics;
|
|
8
7
|
var _consts = require("./consts");
|
|
9
8
|
var _pluginKey = require("./plugin-key");
|
|
10
9
|
function getCreateUIAnalyticsEvent(editorState) {
|
|
@@ -33,32 +32,4 @@ function addAnalytics(state, tr, payload) {
|
|
|
33
32
|
}
|
|
34
33
|
editorAnalyticsApi === null || editorAnalyticsApi === void 0 || editorAnalyticsApi.attachAnalyticsEvent(payload, channel)(tr);
|
|
35
34
|
return tr;
|
|
36
|
-
}
|
|
37
|
-
// Below function has been copied to packages/editor/editor-plugin-ai/src/utils/analytics.ts
|
|
38
|
-
// If changes are made to this function, please make the same update in the linked file.
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
* @private
|
|
42
|
-
* @deprecated
|
|
43
|
-
*
|
|
44
|
-
* Do not use this anymore. Please use @atlaskit/editor-plugin-analytics
|
|
45
|
-
*
|
|
46
|
-
*/
|
|
47
|
-
function withAnalytics(payload, channel) {
|
|
48
|
-
return function (command) {
|
|
49
|
-
return function (state, dispatch, view) {
|
|
50
|
-
return command(state, function (tr) {
|
|
51
|
-
if (dispatch) {
|
|
52
|
-
if (payload instanceof Function) {
|
|
53
|
-
var dynamicPayload = payload(state);
|
|
54
|
-
if (dynamicPayload) {
|
|
55
|
-
dispatch(addAnalytics(state, tr, dynamicPayload, channel));
|
|
56
|
-
}
|
|
57
|
-
} else {
|
|
58
|
-
dispatch(addAnalytics(state, tr, payload, channel));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}, view);
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
35
|
}
|
|
@@ -13,10 +13,10 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
13
13
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
14
14
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
15
15
|
var _LayoutButton = _interopRequireDefault(require("./ui/LayoutButton"));
|
|
16
|
-
var _constants = require("./constants");
|
|
17
16
|
var _pluginKey = require("./plugin-key");
|
|
18
17
|
var _findBreakoutNode = require("./utils/find-breakout-node");
|
|
19
18
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
19
|
+
var _styles = require("@atlaskit/editor-common/styles");
|
|
20
20
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
21
21
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
22
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -77,9 +77,9 @@ var BreakoutView = /*#__PURE__*/function () {
|
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
var contentDOM = document.createElement('div');
|
|
80
|
-
contentDOM.className =
|
|
80
|
+
contentDOM.className = _styles.BreakoutCssClassName.BREAKOUT_MARK_DOM;
|
|
81
81
|
var dom = document.createElement('div');
|
|
82
|
-
dom.className =
|
|
82
|
+
dom.className = _styles.BreakoutCssClassName.BREAKOUT_MARK;
|
|
83
83
|
dom.setAttribute('data-layout', mark.attrs.mode);
|
|
84
84
|
dom.appendChild(contentDOM);
|
|
85
85
|
this.dom = dom;
|
|
@@ -25,12 +25,12 @@ var _ToolbarButton = _interopRequireDefault(require("../../../ui/ToolbarButton")
|
|
|
25
25
|
var _getBreakoutMode = require("../utils/get-breakout-mode");
|
|
26
26
|
var _setBreakoutMode = require("../commands/set-breakout-mode");
|
|
27
27
|
var _removeBreakout = require("../commands/remove-breakout");
|
|
28
|
-
var
|
|
28
|
+
var _styles = require("@atlaskit/editor-common/styles");
|
|
29
29
|
var _isBreakoutMarkAllowed = require("../utils/is-breakout-mark-allowed");
|
|
30
30
|
var _pluginKey = require("../plugin-key");
|
|
31
31
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
32
32
|
var _isSupportedNode = require("../utils/is-supported-node");
|
|
33
|
-
var
|
|
33
|
+
var _constants = require("@atlaskit/theme/constants");
|
|
34
34
|
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
35
35
|
var _templateObject;
|
|
36
36
|
/** @jsx jsx */
|
|
@@ -88,7 +88,7 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
|
88
88
|
var titleMessage = (0, _utils2.getTitle)(breakoutMode);
|
|
89
89
|
var title = formatMessage(titleMessage);
|
|
90
90
|
var nextBreakoutMode = (0, _utils2.getNextBreakoutMode)(breakoutMode);
|
|
91
|
-
var belowOtherPopupsZIndex =
|
|
91
|
+
var belowOtherPopupsZIndex = _constants.layers.layer() - 1;
|
|
92
92
|
var pluginState = (0, _pluginKey.getPluginState)(state);
|
|
93
93
|
if (!pluginState) {
|
|
94
94
|
return null;
|
|
@@ -97,7 +97,7 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
|
97
97
|
if (!element) {
|
|
98
98
|
return null;
|
|
99
99
|
}
|
|
100
|
-
var closestEl = element.querySelector(".".concat(
|
|
100
|
+
var closestEl = element.querySelector(".".concat(_styles.BreakoutCssClassName.BREAKOUT_MARK_DOM));
|
|
101
101
|
if (closestEl && closestEl.firstChild) {
|
|
102
102
|
element = closestEl.firstChild;
|
|
103
103
|
}
|
|
@@ -10,8 +10,8 @@ var _validator = require("@atlaskit/adf-utils/validator");
|
|
|
10
10
|
var _editorJsonTransformer = require("@atlaskit/editor-json-transformer");
|
|
11
11
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
12
12
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
13
|
-
var
|
|
14
|
-
var _pluginKey = require("
|
|
13
|
+
var _actions = require("./pm-plugins/macro/actions");
|
|
14
|
+
var _pluginKey = require("./pm-plugins/macro/plugin-key");
|
|
15
15
|
var _utils = require("../../utils");
|
|
16
16
|
var _commands = require("./commands");
|
|
17
17
|
var _utils2 = require("./utils");
|
|
@@ -32,7 +32,7 @@ var getEditInLegacyMacroBrowser = exports.getEditInLegacyMacroBrowser = function
|
|
|
32
32
|
if (!nodeWithPos) {
|
|
33
33
|
throw new Error("Missing nodeWithPos. Can't determine position of node");
|
|
34
34
|
}
|
|
35
|
-
(0,
|
|
35
|
+
(0, _actions.insertMacroFromMacroBrowser)(editorAnalyticsAPI)(macroProvider, nodeWithPos.node, true)(view);
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
var extensionAPICallPayload = function extensionAPICallPayload(functionName) {
|
|
@@ -8,13 +8,15 @@ exports.default = void 0;
|
|
|
8
8
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
9
9
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
10
10
|
var _main = require("./pm-plugins/main");
|
|
11
|
+
var _macro = require("./pm-plugins/macro");
|
|
12
|
+
var _actions = require("./pm-plugins/macro/actions");
|
|
11
13
|
var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
|
|
12
14
|
var _uniqueId = require("./pm-plugins/unique-id");
|
|
13
15
|
var _toolbar = require("./toolbar");
|
|
14
16
|
var _contextPanel = require("./context-panel");
|
|
15
17
|
var _extensionApi = require("./extension-api");
|
|
16
18
|
var extensionPlugin = function extensionPlugin(_ref) {
|
|
17
|
-
var _api$featureFlags, _api$contextPanel3, _api$
|
|
19
|
+
var _api$featureFlags, _api$analytics2, _api$contextPanel3, _api$analytics3, _api$contextPanel4;
|
|
18
20
|
var _ref$config = _ref.config,
|
|
19
21
|
options = _ref$config === void 0 ? {} : _ref$config,
|
|
20
22
|
_api = _ref.api;
|
|
@@ -76,6 +78,13 @@ var extensionPlugin = function extensionPlugin(_ref) {
|
|
|
76
78
|
}
|
|
77
79
|
});
|
|
78
80
|
}
|
|
81
|
+
}, {
|
|
82
|
+
name: 'macro',
|
|
83
|
+
plugin: function plugin(_ref3) {
|
|
84
|
+
var dispatch = _ref3.dispatch,
|
|
85
|
+
providerFactory = _ref3.providerFactory;
|
|
86
|
+
return (0, _macro.createPlugin)(dispatch, providerFactory);
|
|
87
|
+
}
|
|
79
88
|
}];
|
|
80
89
|
},
|
|
81
90
|
actions: {
|
|
@@ -86,14 +95,16 @@ var extensionPlugin = function extensionPlugin(_ref) {
|
|
|
86
95
|
applyChange: _api === null || _api === void 0 || (_api$contextPanel2 = _api.contextPanel) === null || _api$contextPanel2 === void 0 ? void 0 : _api$contextPanel2.actions.applyChange,
|
|
87
96
|
editorAnalyticsAPI: _api === null || _api === void 0 || (_api$analytics = _api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions
|
|
88
97
|
});
|
|
89
|
-
}
|
|
98
|
+
},
|
|
99
|
+
insertMacroFromMacroBrowser: (0, _actions.insertMacroFromMacroBrowser)(_api === null || _api === void 0 || (_api$analytics2 = _api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions),
|
|
100
|
+
runMacroAutoConvert: _actions.runMacroAutoConvert
|
|
90
101
|
},
|
|
91
102
|
pluginsOptions: {
|
|
92
103
|
floatingToolbar: (0, _toolbar.getToolbarConfig)({
|
|
93
104
|
breakoutEnabled: options.breakoutEnabled,
|
|
94
105
|
hoverDecoration: _api === null || _api === void 0 ? void 0 : _api.decorations.actions.hoverDecoration,
|
|
95
106
|
applyChangeToContextPanel: _api === null || _api === void 0 || (_api$contextPanel3 = _api.contextPanel) === null || _api$contextPanel3 === void 0 ? void 0 : _api$contextPanel3.actions.applyChange,
|
|
96
|
-
editorAnalyticsAPI: _api === null || _api === void 0 || (_api$
|
|
107
|
+
editorAnalyticsAPI: _api === null || _api === void 0 || (_api$analytics3 = _api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions
|
|
97
108
|
}),
|
|
98
109
|
contextPanel: (0, _contextPanel.getContextPanel)(options.allowAutoSave, featureFlags, _api === null || _api === void 0 || (_api$contextPanel4 = _api.contextPanel) === null || _api$contextPanel4 === void 0 ? void 0 : _api$contextPanel4.actions.applyChange)
|
|
99
110
|
}
|
|
@@ -13,9 +13,8 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
13
13
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
14
14
|
var _validator = require("@atlaskit/editor-common/validator");
|
|
15
15
|
var _insert = require("@atlaskit/editor-common/insert");
|
|
16
|
-
var _pluginFactory = require("
|
|
16
|
+
var _pluginFactory = require("../../plugin-factory");
|
|
17
17
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
18
|
-
var _extensionEvents = require("../analytics/types/extension-events");
|
|
19
18
|
var _pluginKey = require("./plugin-key");
|
|
20
19
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21
20
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -55,7 +54,7 @@ var insertMacroFromMacroBrowser = exports.insertMacroFromMacroBrowser = function
|
|
|
55
54
|
selection = state.selection, schema = state.schema;
|
|
56
55
|
_schema$nodes = schema.nodes, extension = _schema$nodes.extension, inlineExtension = _schema$nodes.inlineExtension, bodiedExtension = _schema$nodes.bodiedExtension;
|
|
57
56
|
extensionState = (0, _pluginFactory.getPluginState)(state);
|
|
58
|
-
targetSelectionSource =
|
|
57
|
+
targetSelectionSource = _analytics.TARGET_SELECTION_SOURCE.CURRENT_SELECTION;
|
|
59
58
|
tr = state.tr;
|
|
60
59
|
isBodiedExtensionSelected = !!(0, _utils.findSelectedNodeOfType)([bodiedExtension])(selection); // When it's a bodiedExtension but not selected
|
|
61
60
|
if (macroNode.type === bodiedExtension && !isBodiedExtensionSelected) {
|
|
@@ -77,7 +76,7 @@ var insertMacroFromMacroBrowser = exports.insertMacroFromMacroBrowser = function
|
|
|
77
76
|
if (pos > -1) {
|
|
78
77
|
tr = tr.replaceWith(pos, pos + macroNode.nodeSize, node);
|
|
79
78
|
tr.setSelection(_state.Selection.near(tr.doc.resolve(pos)));
|
|
80
|
-
targetSelectionSource =
|
|
79
|
+
targetSelectionSource = _analytics.TARGET_SELECTION_SOURCE.HTML_ELEMENT;
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.createPlugin = void 0;
|
|
8
8
|
Object.defineProperty(exports, "insertMacroFromMacroBrowser", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function get() {
|
|
@@ -69,20 +69,4 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
};
|
|
73
|
-
var macroPlugin = function macroPlugin() {
|
|
74
|
-
return {
|
|
75
|
-
name: 'macro',
|
|
76
|
-
pmPlugins: function pmPlugins() {
|
|
77
|
-
return [{
|
|
78
|
-
name: 'macro',
|
|
79
|
-
plugin: function plugin(_ref) {
|
|
80
|
-
var dispatch = _ref.dispatch,
|
|
81
|
-
providerFactory = _ref.providerFactory;
|
|
82
|
-
return createPlugin(dispatch, providerFactory);
|
|
83
|
-
}
|
|
84
|
-
}];
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
var _default = exports.default = macroPlugin;
|
|
72
|
+
};
|
|
@@ -18,7 +18,7 @@ var _actions = require("./actions");
|
|
|
18
18
|
var _main = require("./pm-plugins/main");
|
|
19
19
|
var _utils2 = require("./utils");
|
|
20
20
|
var _commands = require("./commands");
|
|
21
|
-
var _pluginKey = require("
|
|
21
|
+
var _pluginKey = require("./pm-plugins/macro/plugin-key");
|
|
22
22
|
var _utils3 = require("@atlaskit/editor-common/utils");
|
|
23
23
|
var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
24
24
|
edit: {
|
|
@@ -12,15 +12,17 @@ var _commandsWithAnalytics = require("./commands-with-analytics");
|
|
|
12
12
|
var _commands = require("./commands");
|
|
13
13
|
var _FindReplaceToolbarButton = _interopRequireDefault(require("./ui/FindReplaceToolbarButton"));
|
|
14
14
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
15
|
-
var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithState(
|
|
16
|
-
var popupsBoundariesElement =
|
|
17
|
-
popupsMountPoint =
|
|
18
|
-
popupsScrollableElement =
|
|
19
|
-
isToolbarReducedSpacing =
|
|
20
|
-
editorView =
|
|
21
|
-
containerElement =
|
|
22
|
-
dispatchAnalyticsEvent =
|
|
23
|
-
featureFlags =
|
|
15
|
+
var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithState(_ref) {
|
|
16
|
+
var popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
17
|
+
popupsMountPoint = _ref.popupsMountPoint,
|
|
18
|
+
popupsScrollableElement = _ref.popupsScrollableElement,
|
|
19
|
+
isToolbarReducedSpacing = _ref.isToolbarReducedSpacing,
|
|
20
|
+
editorView = _ref.editorView,
|
|
21
|
+
containerElement = _ref.containerElement,
|
|
22
|
+
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
|
|
23
|
+
featureFlags = _ref.featureFlags,
|
|
24
|
+
editorAnalyticsAPI = _ref.editorAnalyticsAPI,
|
|
25
|
+
takeFullWidth = _ref.takeFullWidth;
|
|
24
26
|
if (!editorView) {
|
|
25
27
|
return null;
|
|
26
28
|
}
|
|
@@ -41,50 +43,50 @@ var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithSta
|
|
|
41
43
|
};
|
|
42
44
|
var handleActivate = function handleActivate() {
|
|
43
45
|
runWithEditorFocused(function () {
|
|
44
|
-
return dispatchCommand((0, _commandsWithAnalytics.activateWithAnalytics)({
|
|
46
|
+
return dispatchCommand((0, _commandsWithAnalytics.activateWithAnalytics)(editorAnalyticsAPI)({
|
|
45
47
|
triggerMethod: _analytics.TRIGGER_METHOD.TOOLBAR
|
|
46
48
|
}));
|
|
47
49
|
});
|
|
48
50
|
};
|
|
49
51
|
var handleFind = function handleFind(keyword) {
|
|
50
52
|
runWithEditorFocused(function () {
|
|
51
|
-
return dispatchCommand((0, _commandsWithAnalytics.findWithAnalytics)({
|
|
53
|
+
return dispatchCommand((0, _commandsWithAnalytics.findWithAnalytics)(editorAnalyticsAPI)({
|
|
52
54
|
editorView: editorView,
|
|
53
55
|
containerElement: containerElement,
|
|
54
56
|
keyword: keyword
|
|
55
57
|
}));
|
|
56
58
|
});
|
|
57
59
|
};
|
|
58
|
-
var handleFindNext = function handleFindNext(
|
|
59
|
-
var triggerMethod =
|
|
60
|
+
var handleFindNext = function handleFindNext(_ref2) {
|
|
61
|
+
var triggerMethod = _ref2.triggerMethod;
|
|
60
62
|
runWithEditorFocused(function () {
|
|
61
|
-
return dispatchCommand((0, _commandsWithAnalytics.findNextWithAnalytics)({
|
|
63
|
+
return dispatchCommand((0, _commandsWithAnalytics.findNextWithAnalytics)(editorAnalyticsAPI)({
|
|
62
64
|
triggerMethod: triggerMethod
|
|
63
65
|
}));
|
|
64
66
|
});
|
|
65
67
|
};
|
|
66
|
-
var handleFindPrev = function handleFindPrev(
|
|
67
|
-
var triggerMethod =
|
|
68
|
+
var handleFindPrev = function handleFindPrev(_ref3) {
|
|
69
|
+
var triggerMethod = _ref3.triggerMethod;
|
|
68
70
|
runWithEditorFocused(function () {
|
|
69
|
-
return dispatchCommand((0, _commandsWithAnalytics.findPrevWithAnalytics)({
|
|
71
|
+
return dispatchCommand((0, _commandsWithAnalytics.findPrevWithAnalytics)(editorAnalyticsAPI)({
|
|
70
72
|
triggerMethod: triggerMethod
|
|
71
73
|
}));
|
|
72
74
|
});
|
|
73
75
|
};
|
|
74
|
-
var handleReplace = function handleReplace(
|
|
75
|
-
var triggerMethod =
|
|
76
|
-
replaceText =
|
|
76
|
+
var handleReplace = function handleReplace(_ref4) {
|
|
77
|
+
var triggerMethod = _ref4.triggerMethod,
|
|
78
|
+
replaceText = _ref4.replaceText;
|
|
77
79
|
runWithEditorFocused(function () {
|
|
78
|
-
return dispatchCommand((0, _commandsWithAnalytics.replaceWithAnalytics)({
|
|
80
|
+
return dispatchCommand((0, _commandsWithAnalytics.replaceWithAnalytics)(editorAnalyticsAPI)({
|
|
79
81
|
triggerMethod: triggerMethod,
|
|
80
82
|
replaceText: replaceText
|
|
81
83
|
}));
|
|
82
84
|
});
|
|
83
85
|
};
|
|
84
|
-
var handleReplaceAll = function handleReplaceAll(
|
|
85
|
-
var replaceText =
|
|
86
|
+
var handleReplaceAll = function handleReplaceAll(_ref5) {
|
|
87
|
+
var replaceText = _ref5.replaceText;
|
|
86
88
|
runWithEditorFocused(function () {
|
|
87
|
-
return dispatchCommand((0, _commandsWithAnalytics.replaceAllWithAnalytics)({
|
|
89
|
+
return dispatchCommand((0, _commandsWithAnalytics.replaceAllWithAnalytics)(editorAnalyticsAPI)({
|
|
88
90
|
replaceText: replaceText
|
|
89
91
|
}));
|
|
90
92
|
});
|
|
@@ -92,9 +94,9 @@ var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithSta
|
|
|
92
94
|
var handleFindBlur = function handleFindBlur() {
|
|
93
95
|
dispatchCommand((0, _commands.blur)());
|
|
94
96
|
};
|
|
95
|
-
var handleCancel = function handleCancel(
|
|
96
|
-
var triggerMethod =
|
|
97
|
-
dispatchCommand((0, _commandsWithAnalytics.cancelSearchWithAnalytics)({
|
|
97
|
+
var handleCancel = function handleCancel(_ref6) {
|
|
98
|
+
var triggerMethod = _ref6.triggerMethod;
|
|
99
|
+
dispatchCommand((0, _commandsWithAnalytics.cancelSearchWithAnalytics)(editorAnalyticsAPI)({
|
|
98
100
|
triggerMethod: triggerMethod
|
|
99
101
|
}));
|
|
100
102
|
editorView.focus();
|
|
@@ -108,8 +110,8 @@ var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithSta
|
|
|
108
110
|
plugins: {
|
|
109
111
|
findReplaceState: _types.findReplacePluginKey
|
|
110
112
|
},
|
|
111
|
-
render: function render(
|
|
112
|
-
var findReplaceState =
|
|
113
|
+
render: function render(_ref7) {
|
|
114
|
+
var findReplaceState = _ref7.findReplaceState;
|
|
113
115
|
if (!findReplaceState) {
|
|
114
116
|
return null;
|
|
115
117
|
}
|
|
@@ -136,7 +138,7 @@ var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithSta
|
|
|
136
138
|
onFindPrev: handleFindPrev,
|
|
137
139
|
onReplace: handleReplace,
|
|
138
140
|
onReplaceAll: handleReplaceAll,
|
|
139
|
-
takeFullWidth: !!
|
|
141
|
+
takeFullWidth: !!takeFullWidth
|
|
140
142
|
});
|
|
141
143
|
}
|
|
142
144
|
});
|
|
@@ -5,83 +5,97 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.replaceWithAnalytics = exports.replaceAllWithAnalytics = exports.findWithAnalytics = exports.findPrevWithAnalytics = exports.findNextWithAnalytics = exports.cancelSearchWithAnalytics = exports.activateWithAnalytics = void 0;
|
|
7
7
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
-
var _analytics = require("
|
|
9
|
-
var
|
|
8
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
9
|
+
var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
|
|
10
10
|
var _commands = require("./commands");
|
|
11
|
-
var activateWithAnalytics = exports.activateWithAnalytics = function activateWithAnalytics(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
var activateWithAnalytics = exports.activateWithAnalytics = function activateWithAnalytics(editorAnalyticsAPI) {
|
|
12
|
+
return function (_ref) {
|
|
13
|
+
var triggerMethod = _ref.triggerMethod;
|
|
14
|
+
return (0, _editorAnalytics.withAnalytics)(editorAnalyticsAPI, function (state) {
|
|
15
|
+
return {
|
|
16
|
+
eventType: _analytics.EVENT_TYPE.UI,
|
|
17
|
+
action: _analytics.ACTION.ACTIVATED,
|
|
18
|
+
actionSubject: _analytics.ACTION_SUBJECT.FIND_REPLACE_DIALOG,
|
|
19
|
+
attributes: {
|
|
20
|
+
inputMethod: state.selection instanceof _state.TextSelection && !state.selection.empty ? _analytics.INPUT_METHOD.PREFILL : _analytics.INPUT_METHOD.KEYBOARD,
|
|
21
|
+
triggerMethod: triggerMethod
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
})((0, _commands.activate)());
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
var findWithAnalytics = exports.findWithAnalytics = function findWithAnalytics(editorAnalyticsAPI) {
|
|
28
|
+
return function (_ref2) {
|
|
29
|
+
var editorView = _ref2.editorView,
|
|
30
|
+
containerElement = _ref2.containerElement,
|
|
31
|
+
keyword = _ref2.keyword;
|
|
32
|
+
return (0, _editorAnalytics.withAnalytics)(editorAnalyticsAPI, {
|
|
33
|
+
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
34
|
+
action: _analytics.ACTION.FIND_PERFORMED,
|
|
35
|
+
actionSubject: _analytics.ACTION_SUBJECT.TEXT
|
|
36
|
+
})((0, _commands.find)(editorView, containerElement, keyword));
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
var findNextWithAnalytics = exports.findNextWithAnalytics = function findNextWithAnalytics(editorAnalyticsAPI) {
|
|
40
|
+
return function (_ref3) {
|
|
41
|
+
var triggerMethod = _ref3.triggerMethod;
|
|
42
|
+
return (0, _editorAnalytics.withAnalytics)(editorAnalyticsAPI, {
|
|
43
|
+
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
44
|
+
action: _analytics.ACTION.FIND_NEXT_PERFORMED,
|
|
45
|
+
actionSubject: _analytics.ACTION_SUBJECT.TEXT,
|
|
18
46
|
attributes: {
|
|
19
|
-
inputMethod: state.selection instanceof _state.TextSelection && !state.selection.empty ? _analytics2.INPUT_METHOD.PREFILL : _analytics2.INPUT_METHOD.KEYBOARD,
|
|
20
47
|
triggerMethod: triggerMethod
|
|
21
48
|
}
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
var findWithAnalytics = exports.findWithAnalytics = function findWithAnalytics(_ref2) {
|
|
26
|
-
var editorView = _ref2.editorView,
|
|
27
|
-
containerElement = _ref2.containerElement,
|
|
28
|
-
keyword = _ref2.keyword;
|
|
29
|
-
return (0, _analytics.withAnalytics)({
|
|
30
|
-
eventType: _analytics2.EVENT_TYPE.TRACK,
|
|
31
|
-
action: _analytics2.ACTION.FIND_PERFORMED,
|
|
32
|
-
actionSubject: _analytics2.ACTION_SUBJECT.TEXT
|
|
33
|
-
})((0, _commands.find)(editorView, containerElement, keyword));
|
|
34
|
-
};
|
|
35
|
-
var findNextWithAnalytics = exports.findNextWithAnalytics = function findNextWithAnalytics(_ref3) {
|
|
36
|
-
var triggerMethod = _ref3.triggerMethod;
|
|
37
|
-
return (0, _analytics.withAnalytics)({
|
|
38
|
-
eventType: _analytics2.EVENT_TYPE.TRACK,
|
|
39
|
-
action: _analytics2.ACTION.FIND_NEXT_PERFORMED,
|
|
40
|
-
actionSubject: _analytics2.ACTION_SUBJECT.TEXT,
|
|
41
|
-
attributes: {
|
|
42
|
-
triggerMethod: triggerMethod
|
|
43
|
-
}
|
|
44
|
-
})((0, _commands.findNext)());
|
|
49
|
+
})((0, _commands.findNext)());
|
|
50
|
+
};
|
|
45
51
|
};
|
|
46
|
-
var findPrevWithAnalytics = exports.findPrevWithAnalytics = function findPrevWithAnalytics(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
var findPrevWithAnalytics = exports.findPrevWithAnalytics = function findPrevWithAnalytics(editorAnalyticsAPI) {
|
|
53
|
+
return function (_ref4) {
|
|
54
|
+
var triggerMethod = _ref4.triggerMethod;
|
|
55
|
+
return (0, _editorAnalytics.withAnalytics)(editorAnalyticsAPI, {
|
|
56
|
+
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
57
|
+
action: _analytics.ACTION.FIND_PREV_PERFORMED,
|
|
58
|
+
actionSubject: _analytics.ACTION_SUBJECT.TEXT,
|
|
59
|
+
attributes: {
|
|
60
|
+
triggerMethod: triggerMethod
|
|
61
|
+
}
|
|
62
|
+
})((0, _commands.findPrevious)());
|
|
63
|
+
};
|
|
56
64
|
};
|
|
57
|
-
var replaceWithAnalytics = exports.replaceWithAnalytics = function replaceWithAnalytics(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
var replaceWithAnalytics = exports.replaceWithAnalytics = function replaceWithAnalytics(editorAnalyticsAPI) {
|
|
66
|
+
return function (_ref5) {
|
|
67
|
+
var triggerMethod = _ref5.triggerMethod,
|
|
68
|
+
replaceText = _ref5.replaceText;
|
|
69
|
+
return (0, _editorAnalytics.withAnalytics)(editorAnalyticsAPI, {
|
|
70
|
+
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
71
|
+
action: _analytics.ACTION.REPLACED_ONE,
|
|
72
|
+
actionSubject: _analytics.ACTION_SUBJECT.TEXT,
|
|
73
|
+
attributes: {
|
|
74
|
+
triggerMethod: triggerMethod
|
|
75
|
+
}
|
|
76
|
+
})((0, _commands.replace)(replaceText));
|
|
77
|
+
};
|
|
68
78
|
};
|
|
69
|
-
var replaceAllWithAnalytics = exports.replaceAllWithAnalytics = function replaceAllWithAnalytics(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
var replaceAllWithAnalytics = exports.replaceAllWithAnalytics = function replaceAllWithAnalytics(editorAnalyticsAPI) {
|
|
80
|
+
return function (_ref6) {
|
|
81
|
+
var replaceText = _ref6.replaceText;
|
|
82
|
+
return (0, _editorAnalytics.withAnalytics)(editorAnalyticsAPI, {
|
|
83
|
+
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
84
|
+
action: _analytics.ACTION.REPLACED_ALL,
|
|
85
|
+
actionSubject: _analytics.ACTION_SUBJECT.TEXT
|
|
86
|
+
})((0, _commands.replaceAll)(replaceText));
|
|
87
|
+
};
|
|
76
88
|
};
|
|
77
|
-
var cancelSearchWithAnalytics = exports.cancelSearchWithAnalytics = function cancelSearchWithAnalytics(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
var cancelSearchWithAnalytics = exports.cancelSearchWithAnalytics = function cancelSearchWithAnalytics(editorAnalyticsAPI) {
|
|
90
|
+
return function (_ref7) {
|
|
91
|
+
var triggerMethod = _ref7.triggerMethod;
|
|
92
|
+
return (0, _editorAnalytics.withAnalytics)(editorAnalyticsAPI, {
|
|
93
|
+
eventType: _analytics.EVENT_TYPE.UI,
|
|
94
|
+
action: _analytics.ACTION.DEACTIVATED,
|
|
95
|
+
actionSubject: _analytics.ACTION_SUBJECT.FIND_REPLACE_DIALOG,
|
|
96
|
+
attributes: {
|
|
97
|
+
triggerMethod: triggerMethod
|
|
98
|
+
}
|
|
99
|
+
})((0, _commands.cancelSearch)());
|
|
100
|
+
};
|
|
87
101
|
};
|
|
@@ -26,7 +26,8 @@ var findReplacePlugin = exports.findReplacePlugin = function findReplacePlugin(_
|
|
|
26
26
|
}, {
|
|
27
27
|
name: 'findReplaceKeymap',
|
|
28
28
|
plugin: function plugin() {
|
|
29
|
-
|
|
29
|
+
var _api$analytics;
|
|
30
|
+
return (0, _keymap.default)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
30
31
|
}
|
|
31
32
|
}];
|
|
32
33
|
},
|
|
@@ -41,6 +42,7 @@ var findReplacePlugin = exports.findReplacePlugin = function findReplacePlugin(_
|
|
|
41
42
|
if (props !== null && props !== void 0 && props.twoLineEditorToolbar) {
|
|
42
43
|
return null;
|
|
43
44
|
} else {
|
|
45
|
+
var _api$analytics2;
|
|
44
46
|
return /*#__PURE__*/_react.default.createElement(_FindReplaceToolbarButtonWithState.default, {
|
|
45
47
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
46
48
|
popupsMountPoint: popupsMountPoint,
|
|
@@ -50,7 +52,8 @@ var findReplacePlugin = exports.findReplacePlugin = function findReplacePlugin(_
|
|
|
50
52
|
containerElement: containerElement,
|
|
51
53
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
52
54
|
takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
|
|
53
|
-
featureFlags: featureFlags
|
|
55
|
+
featureFlags: featureFlags,
|
|
56
|
+
editorAnalyticsAPI: api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions
|
|
54
57
|
});
|
|
55
58
|
}
|
|
56
59
|
}
|
|
@@ -8,17 +8,17 @@ var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
|
8
8
|
var _keymaps = require("../../keymaps");
|
|
9
9
|
var _commandsWithAnalytics = require("./commands-with-analytics");
|
|
10
10
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
|
-
var activateFindReplace = function activateFindReplace() {
|
|
11
|
+
var activateFindReplace = function activateFindReplace(editorAnalyticsAPI) {
|
|
12
12
|
return function (state, dispatch) {
|
|
13
|
-
(0, _commandsWithAnalytics.activateWithAnalytics)({
|
|
13
|
+
(0, _commandsWithAnalytics.activateWithAnalytics)(editorAnalyticsAPI)({
|
|
14
14
|
triggerMethod: _analytics.TRIGGER_METHOD.SHORTCUT
|
|
15
15
|
})(state, dispatch);
|
|
16
16
|
return true;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
var keymapPlugin = function keymapPlugin() {
|
|
19
|
+
var keymapPlugin = function keymapPlugin(editorAnalyticsAPI) {
|
|
20
20
|
var list = {};
|
|
21
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.find.common, activateFindReplace(), list);
|
|
21
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.find.common, activateFindReplace(editorAnalyticsAPI), list);
|
|
22
22
|
return (0, _keymap.keymap)(list);
|
|
23
23
|
};
|
|
24
24
|
var _default = exports.default = keymapPlugin;
|