@atlaskit/editor-plugin-text-formatting 1.16.11 → 1.17.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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/editor-plugin-text-formatting
2
2
 
3
+ ## 1.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)
8
+ [`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -
9
+ Update `React` from v16 to v18
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 1.16.12
16
+
17
+ ### Patch Changes
18
+
19
+ - [#107473](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107473)
20
+ [`962b3297548df`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/962b3297548df) -
21
+ [ux] Implement variation 2 for editor contextual toolbar formatting experiment
22
+
3
23
  ## 1.16.11
4
24
 
5
25
  ### Patch Changes
@@ -25,9 +25,6 @@ var formatTypes = {
25
25
  function clearFormattingWithAnalytics(inputMethod, editorAnalyticsAPI) {
26
26
  return clearFormatting(inputMethod, editorAnalyticsAPI);
27
27
  }
28
-
29
- // Ignored via go/ees005
30
- // eslint-disable-next-line @typescript-eslint/max-params
31
28
  function clearNodeFormattingOnSelection(state, tr, formattedNodeType, nodeName, formattingCleared) {
32
29
  return function (node, pos) {
33
30
  if (node.type === formattedNodeType) {
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.cellSelectionNodesBetween = void 0;
7
- var cellSelectionNodesBetween = exports.cellSelectionNodesBetween = function cellSelectionNodesBetween(selection, doc, f, startPos
8
- // Ignored via go/ees005
9
- // eslint-disable-next-line @typescript-eslint/max-params
10
- ) {
7
+ var cellSelectionNodesBetween = exports.cellSelectionNodesBetween = function cellSelectionNodesBetween(selection, doc, f, startPos) {
11
8
  selection.forEachCell(function (cell, cellPos) {
12
9
  doc.nodesBetween(cellPos, cellPos + cell.nodeSize, f, startPos);
13
10
  });
@@ -72,9 +72,7 @@ var nextToggleMarkInRange = function nextToggleMarkInRange(mark, api) {
72
72
  return null;
73
73
  };
74
74
  };
75
- var nextApplyMarkOnRange = exports.nextApplyMarkOnRange = function nextApplyMarkOnRange(from, to, removeMark, mark, tr, api
76
- // eslint-disable-next-line @typescript-eslint/max-params
77
- ) {
75
+ var nextApplyMarkOnRange = exports.nextApplyMarkOnRange = function nextApplyMarkOnRange(from, to, removeMark, mark, tr, api) {
78
76
  var schema = tr.doc.type.schema;
79
77
  var code = schema.marks.code;
80
78
  if (mark.type === code) {
@@ -16,8 +16,6 @@ var plugin = exports.plugin = function plugin(dispatch) {
16
16
  formattingIsPresent: (0, _utils.checkFormattingIsPresent)(state)
17
17
  };
18
18
  },
19
- // Ignored via go/ees005
20
- // eslint-disable-next-line @typescript-eslint/max-params
21
19
  apply: function apply(_tr, pluginState, _oldState, newState) {
22
20
  var formattingIsPresent = (0, _utils.checkFormattingIsPresent)(newState);
23
21
  if (formattingIsPresent !== pluginState.formattingIsPresent) {
@@ -61,11 +61,7 @@ ValidAutoformatChars.STRIKE,
61
61
  ValidAutoformatChars.STRONG_MARKDOWN]), ValidAutoformatChars.CODE, [
62
62
  // e.g: loko (`some code`
63
63
  '( ']);
64
-
65
- // eslint-disable-next-line @typescript-eslint/max-params
66
64
  function addMark(markType, _schema, char, api) {
67
- // Ignored via go/ees005
68
- // eslint-disable-next-line @typescript-eslint/max-params
69
65
  return function (state, _match, start, end) {
70
66
  var _schema$marks;
71
67
  var doc = state.doc,
@@ -89,8 +89,6 @@ var plugin = exports.plugin = function plugin(dispatch, editorAnalyticsAPI) {
89
89
  init: function init(_config, state) {
90
90
  return getTextFormattingState(state, editorAnalyticsAPI);
91
91
  },
92
- // Ignored via go/ees005
93
- // eslint-disable-next-line @typescript-eslint/max-params
94
92
  apply: function apply(_tr, pluginState, _oldState, newState) {
95
93
  var state = getTextFormattingState(newState, editorAnalyticsAPI);
96
94
  if (!(0, _utils.shallowEqual)(pluginState, state)) {
@@ -112,8 +110,6 @@ var plugin = exports.plugin = function plugin(dispatch, editorAnalyticsAPI) {
112
110
  }
113
111
  return false;
114
112
  },
115
- // Ignored via go/ees005
116
- // eslint-disable-next-line @typescript-eslint/max-params
117
113
  handleTextInput: function handleTextInput(view, from, to, text) {
118
114
  var state = view.state,
119
115
  dispatch = view.dispatch;
@@ -21,8 +21,6 @@ var _prosemirrorInputRules = require("@atlaskit/prosemirror-input-rules");
21
21
  * @param text text to replace with
22
22
  */
23
23
  function replaceTextUsingCaptureGroup(text) {
24
- // Ignored via go/ees005
25
- // eslint-disable-next-line @typescript-eslint/max-params
26
24
  return function (state, match, start, end) {
27
25
  var _match = (0, _slicedToArray2.default)(match, 4),
28
26
  prefix = _match[1],
@@ -67,8 +65,7 @@ function createReplacementRules(replMap, replacementRuleWithAnalytics) {
67
65
  function createSingleQuotesRules() {
68
66
  return [
69
67
  // wrapped text
70
- // Ignored via go/ees005
71
- // eslint-disable-next-line require-unicode-regexp, @typescript-eslint/max-params
68
+ // eslint-disable-next-line require-unicode-regexp
72
69
  (0, _utils.createRule)(/(\s|^)'(\S+.*\S+)'$/, function (state, match, start, end) {
73
70
  var OPEN_SMART_QUOTE_CHAR = '‘';
74
71
  var CLOSED_SMART_QUOTE_CHAR = '’';
@@ -135,6 +135,8 @@ var textFormattingPlugin = exports.textFormattingPlugin = function textFormattin
135
135
  selectionToolbar: function selectionToolbar() {
136
136
  if ((0, _experiments.editorExperiment)('contextual_formatting_toolbar', true, {
137
137
  exposure: true
138
+ }) || (0, _experiments.editorExperiment)('platform_editor_contextual_formatting_toolbar_v2', 'variant1', {
139
+ exposure: true
138
140
  }) || (0, _experiments.editorExperiment)('platform_editor_contextual_formatting_toolbar_v2', 'variant2', {
139
141
  exposure: true
140
142
  })) {
@@ -17,9 +17,6 @@ const formatTypes = {
17
17
  export function clearFormattingWithAnalytics(inputMethod, editorAnalyticsAPI) {
18
18
  return clearFormatting(inputMethod, editorAnalyticsAPI);
19
19
  }
20
-
21
- // Ignored via go/ees005
22
- // eslint-disable-next-line @typescript-eslint/max-params
23
20
  function clearNodeFormattingOnSelection(state, tr, formattedNodeType, nodeName, formattingCleared) {
24
21
  return function (node, pos) {
25
22
  if (node.type === formattedNodeType) {
@@ -1,7 +1,4 @@
1
- export const cellSelectionNodesBetween = (selection, doc, f, startPos
2
- // Ignored via go/ees005
3
- // eslint-disable-next-line @typescript-eslint/max-params
4
- ) => {
1
+ export const cellSelectionNodesBetween = (selection, doc, f, startPos) => {
5
2
  selection.forEachCell((cell, cellPos) => {
6
3
  doc.nodesBetween(cellPos, cellPos + cell.nodeSize, f, startPos);
7
4
  });
@@ -65,9 +65,7 @@ const nextToggleMarkInRange = (mark, api) => ({
65
65
  }
66
66
  return null;
67
67
  };
68
- export const nextApplyMarkOnRange = (from, to, removeMark, mark, tr, api
69
- // eslint-disable-next-line @typescript-eslint/max-params
70
- ) => {
68
+ export const nextApplyMarkOnRange = (from, to, removeMark, mark, tr, api) => {
71
69
  const {
72
70
  schema
73
71
  } = tr.doc.type;
@@ -9,8 +9,6 @@ export const plugin = dispatch => new SafePlugin({
9
9
  formattingIsPresent: checkFormattingIsPresent(state)
10
10
  };
11
11
  },
12
- // Ignored via go/ees005
13
- // eslint-disable-next-line @typescript-eslint/max-params
14
12
  apply(_tr, pluginState, _oldState, newState) {
15
13
  const formattingIsPresent = checkFormattingIsPresent(newState);
16
14
  if (formattingIsPresent !== pluginState.formattingIsPresent) {
@@ -47,11 +47,7 @@ export const ValidCombinations = {
47
47
  // e.g: loko (`some code`
48
48
  '( ']
49
49
  };
50
-
51
- // eslint-disable-next-line @typescript-eslint/max-params
52
50
  function addMark(markType, _schema, char, api) {
53
- // Ignored via go/ees005
54
- // eslint-disable-next-line @typescript-eslint/max-params
55
51
  return (state, _match, start, end) => {
56
52
  var _schema$marks, _schema$marks$code;
57
53
  const {
@@ -79,8 +79,6 @@ export const plugin = (dispatch, editorAnalyticsAPI) => new SafePlugin({
79
79
  init(_config, state) {
80
80
  return getTextFormattingState(state, editorAnalyticsAPI);
81
81
  },
82
- // Ignored via go/ees005
83
- // eslint-disable-next-line @typescript-eslint/max-params
84
82
  apply(_tr, pluginState, _oldState, newState) {
85
83
  const state = getTextFormattingState(newState, editorAnalyticsAPI);
86
84
  if (!shallowEqual(pluginState, state)) {
@@ -104,8 +102,6 @@ export const plugin = (dispatch, editorAnalyticsAPI) => new SafePlugin({
104
102
  }
105
103
  return false;
106
104
  },
107
- // Ignored via go/ees005
108
- // eslint-disable-next-line @typescript-eslint/max-params
109
105
  handleTextInput(view, from, to, text) {
110
106
  const {
111
107
  state,
@@ -12,8 +12,6 @@ import { createPlugin } from '@atlaskit/prosemirror-input-rules';
12
12
  * @param text text to replace with
13
13
  */
14
14
  function replaceTextUsingCaptureGroup(text) {
15
- // Ignored via go/ees005
16
- // eslint-disable-next-line @typescript-eslint/max-params
17
15
  return (state, match, start, end) => {
18
16
  const [, prefix,, suffix] = match;
19
17
  const replacement = text + (suffix || '');
@@ -60,8 +58,7 @@ function createReplacementRules(replMap, replacementRuleWithAnalytics) {
60
58
  function createSingleQuotesRules() {
61
59
  return [
62
60
  // wrapped text
63
- // Ignored via go/ees005
64
- // eslint-disable-next-line require-unicode-regexp, @typescript-eslint/max-params
61
+ // eslint-disable-next-line require-unicode-regexp
65
62
  createRule(/(\s|^)'(\S+.*\S+)'$/, (state, match, start, end) => {
66
63
  const OPEN_SMART_QUOTE_CHAR = '‘';
67
64
  const CLOSED_SMART_QUOTE_CHAR = '’';
@@ -129,6 +129,8 @@ export const textFormattingPlugin = ({
129
129
  selectionToolbar: () => {
130
130
  if (editorExperiment('contextual_formatting_toolbar', true, {
131
131
  exposure: true
132
+ }) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant1', {
133
+ exposure: true
132
134
  }) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant2', {
133
135
  exposure: true
134
136
  })) {
@@ -17,9 +17,6 @@ var formatTypes = {
17
17
  export function clearFormattingWithAnalytics(inputMethod, editorAnalyticsAPI) {
18
18
  return clearFormatting(inputMethod, editorAnalyticsAPI);
19
19
  }
20
-
21
- // Ignored via go/ees005
22
- // eslint-disable-next-line @typescript-eslint/max-params
23
20
  function clearNodeFormattingOnSelection(state, tr, formattedNodeType, nodeName, formattingCleared) {
24
21
  return function (node, pos) {
25
22
  if (node.type === formattedNodeType) {
@@ -1,7 +1,4 @@
1
- export var cellSelectionNodesBetween = function cellSelectionNodesBetween(selection, doc, f, startPos
2
- // Ignored via go/ees005
3
- // eslint-disable-next-line @typescript-eslint/max-params
4
- ) {
1
+ export var cellSelectionNodesBetween = function cellSelectionNodesBetween(selection, doc, f, startPos) {
5
2
  selection.forEachCell(function (cell, cellPos) {
6
3
  doc.nodesBetween(cellPos, cellPos + cell.nodeSize, f, startPos);
7
4
  });
@@ -66,9 +66,7 @@ var nextToggleMarkInRange = function nextToggleMarkInRange(mark, api) {
66
66
  return null;
67
67
  };
68
68
  };
69
- export var nextApplyMarkOnRange = function nextApplyMarkOnRange(from, to, removeMark, mark, tr, api
70
- // eslint-disable-next-line @typescript-eslint/max-params
71
- ) {
69
+ export var nextApplyMarkOnRange = function nextApplyMarkOnRange(from, to, removeMark, mark, tr, api) {
72
70
  var schema = tr.doc.type.schema;
73
71
  var code = schema.marks.code;
74
72
  if (mark.type === code) {
@@ -10,8 +10,6 @@ export var plugin = function plugin(dispatch) {
10
10
  formattingIsPresent: checkFormattingIsPresent(state)
11
11
  };
12
12
  },
13
- // Ignored via go/ees005
14
- // eslint-disable-next-line @typescript-eslint/max-params
15
13
  apply: function apply(_tr, pluginState, _oldState, newState) {
16
14
  var formattingIsPresent = checkFormattingIsPresent(newState);
17
15
  if (formattingIsPresent !== pluginState.formattingIsPresent) {
@@ -52,11 +52,7 @@ ValidAutoformatChars.STRIKE,
52
52
  ValidAutoformatChars.STRONG_MARKDOWN]), ValidAutoformatChars.CODE, [
53
53
  // e.g: loko (`some code`
54
54
  '( ']);
55
-
56
- // eslint-disable-next-line @typescript-eslint/max-params
57
55
  function addMark(markType, _schema, char, api) {
58
- // Ignored via go/ees005
59
- // eslint-disable-next-line @typescript-eslint/max-params
60
56
  return function (state, _match, start, end) {
61
57
  var _schema$marks;
62
58
  var doc = state.doc,
@@ -79,8 +79,6 @@ export var plugin = function plugin(dispatch, editorAnalyticsAPI) {
79
79
  init: function init(_config, state) {
80
80
  return getTextFormattingState(state, editorAnalyticsAPI);
81
81
  },
82
- // Ignored via go/ees005
83
- // eslint-disable-next-line @typescript-eslint/max-params
84
82
  apply: function apply(_tr, pluginState, _oldState, newState) {
85
83
  var state = getTextFormattingState(newState, editorAnalyticsAPI);
86
84
  if (!shallowEqual(pluginState, state)) {
@@ -102,8 +100,6 @@ export var plugin = function plugin(dispatch, editorAnalyticsAPI) {
102
100
  }
103
101
  return false;
104
102
  },
105
- // Ignored via go/ees005
106
- // eslint-disable-next-line @typescript-eslint/max-params
107
103
  handleTextInput: function handleTextInput(view, from, to, text) {
108
104
  var state = view.state,
109
105
  dispatch = view.dispatch;
@@ -15,8 +15,6 @@ import { createPlugin } from '@atlaskit/prosemirror-input-rules';
15
15
  * @param text text to replace with
16
16
  */
17
17
  function replaceTextUsingCaptureGroup(text) {
18
- // Ignored via go/ees005
19
- // eslint-disable-next-line @typescript-eslint/max-params
20
18
  return function (state, match, start, end) {
21
19
  var _match = _slicedToArray(match, 4),
22
20
  prefix = _match[1],
@@ -61,8 +59,7 @@ function createReplacementRules(replMap, replacementRuleWithAnalytics) {
61
59
  function createSingleQuotesRules() {
62
60
  return [
63
61
  // wrapped text
64
- // Ignored via go/ees005
65
- // eslint-disable-next-line require-unicode-regexp, @typescript-eslint/max-params
62
+ // eslint-disable-next-line require-unicode-regexp
66
63
  createRule(/(\s|^)'(\S+.*\S+)'$/, function (state, match, start, end) {
67
64
  var OPEN_SMART_QUOTE_CHAR = '‘';
68
65
  var CLOSED_SMART_QUOTE_CHAR = '’';
@@ -129,6 +129,8 @@ export var textFormattingPlugin = function textFormattingPlugin(_ref) {
129
129
  selectionToolbar: function selectionToolbar() {
130
130
  if (editorExperiment('contextual_formatting_toolbar', true, {
131
131
  exposure: true
132
+ }) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant1', {
133
+ exposure: true
132
134
  }) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant2', {
133
135
  exposure: true
134
136
  })) {
@@ -4,14 +4,12 @@ import { type EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
4
  import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
6
  import type { TextFormattingPlugin } from '../textFormattingPluginType';
7
- export declare const FloatingToolbarTextFormalWithIntl: import("react").FC<import("react-intl-next").WithIntlProps<{
7
+ type FloatingToolbarComponentProps = {
8
8
  editorView: EditorView;
9
9
  api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
10
- editorAnalyticsAPI?: EditorAnalyticsAPI | undefined;
11
- } & WrappedComponentProps>> & {
12
- WrappedComponent: import("react").ComponentType<{
13
- editorView: EditorView;
14
- api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
15
- editorAnalyticsAPI?: EditorAnalyticsAPI | undefined;
16
- } & WrappedComponentProps>;
10
+ editorAnalyticsAPI?: EditorAnalyticsAPI;
11
+ } & WrappedComponentProps;
12
+ export declare const FloatingToolbarTextFormalWithIntl: import("react").FC<import("react-intl-next").WithIntlProps<FloatingToolbarComponentProps>> & {
13
+ WrappedComponent: import("react").ComponentType<FloatingToolbarComponentProps>;
17
14
  };
15
+ export {};
@@ -4,14 +4,12 @@ import { type EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
4
  import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
6
  import type { TextFormattingPlugin } from '../textFormattingPluginType';
7
- export declare const FloatingToolbarTextFormalWithIntl: import("react").FC<import("react-intl-next").WithIntlProps<{
7
+ type FloatingToolbarComponentProps = {
8
8
  editorView: EditorView;
9
9
  api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
10
- editorAnalyticsAPI?: EditorAnalyticsAPI | undefined;
11
- } & WrappedComponentProps>> & {
12
- WrappedComponent: import("react").ComponentType<{
13
- editorView: EditorView;
14
- api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
15
- editorAnalyticsAPI?: EditorAnalyticsAPI | undefined;
16
- } & WrappedComponentProps>;
10
+ editorAnalyticsAPI?: EditorAnalyticsAPI;
11
+ } & WrappedComponentProps;
12
+ export declare const FloatingToolbarTextFormalWithIntl: import("react").FC<import("react-intl-next").WithIntlProps<FloatingToolbarComponentProps>> & {
13
+ WrappedComponent: import("react").ComponentType<FloatingToolbarComponentProps>;
17
14
  };
15
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-formatting",
3
- "version": "1.16.11",
3
+ "version": "1.17.0",
4
4
  "description": "Text-formatting plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,18 +32,18 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^46.1.0",
35
- "@atlaskit/editor-common": "^99.5.0",
35
+ "@atlaskit/editor-common": "^99.6.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.11.0",
37
37
  "@atlaskit/editor-plugin-base": "^2.1.0",
38
38
  "@atlaskit/editor-plugin-primary-toolbar": "^2.1.0",
39
39
  "@atlaskit/editor-prosemirror": "6.2.1",
40
40
  "@atlaskit/editor-shared-styles": "^3.2.0",
41
41
  "@atlaskit/editor-tables": "^2.8.0",
42
- "@atlaskit/icon": "^23.4.0",
42
+ "@atlaskit/icon": "^23.5.0",
43
43
  "@atlaskit/platform-feature-flags": "^0.3.0",
44
44
  "@atlaskit/prosemirror-input-rules": "^3.2.0",
45
- "@atlaskit/tmp-editor-statsig": "^2.39.0",
46
- "@atlaskit/tokens": "^3.2.0",
45
+ "@atlaskit/tmp-editor-statsig": "^2.41.0",
46
+ "@atlaskit/tokens": "^3.3.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "@emotion/react": "^11.7.1",
49
49
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -53,9 +53,9 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@atlaskit/editor-plugin-composition": "^1.2.0",
56
- "@atlaskit/editor-plugin-decorations": "^1.3.0",
56
+ "@atlaskit/editor-plugin-decorations": "^1.4.0",
57
57
  "@atlaskit/editor-plugin-feature-flags": "^1.2.0",
58
- "@testing-library/react": "^12.1.5",
58
+ "@testing-library/react": "^13.4.0",
59
59
  "typescript": "~5.4.2"
60
60
  },
61
61
  "techstack": {