@atlaskit/editor-plugin-block-type 3.0.14 → 3.0.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-plugin-block-type
2
2
 
3
+ ## 3.0.16
4
+
5
+ ### Patch Changes
6
+
7
+ - [#67238](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67238) [`40533849b2ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/40533849b2ec) - [ED-21835] Change EditorAPI type to always union with undefined
8
+
9
+ ## 3.0.15
10
+
11
+ ### Patch Changes
12
+
13
+ - [#65802](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65802) [`438ead060875`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/438ead060875) - Ensure all editor plugins are marked as singletons
14
+
3
15
  ## 3.0.14
4
16
 
5
17
  ### Patch Changes
@@ -184,8 +184,8 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
184
184
  eventDispatcher = _ref7.eventDispatcher;
185
185
  var isSmall = options && options.isUndoRedoButtonsEnabled ? toolbarSize < _types.ToolbarSize.XXL : toolbarSize < _types.ToolbarSize.XL;
186
186
  var boundSetBlockType = function boundSetBlockType(name) {
187
- var _api$analytics5;
188
- api === null || api === void 0 || api.core.actions.execute((0, _commands.setBlockTypeWithAnalytics)(name, _analytics.INPUT_METHOD.TOOLBAR, api === null || api === void 0 || (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions));
187
+ var _api$core, _api$analytics5;
188
+ api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute((0, _commands.setBlockTypeWithAnalytics)(name, _analytics.INPUT_METHOD.TOOLBAR, api === null || api === void 0 || (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions));
189
189
  };
190
190
  return /*#__PURE__*/_react.default.createElement(_withPluginState.WithPluginState, {
191
191
  editorView: editorView,
@@ -130,11 +130,11 @@ var createPlugin = exports.createPlugin = function createPlugin(editorAPI, dispa
130
130
  var headingLevel = _consts.HEADING_KEYS.indexOf(event.keyCode);
131
131
  if (headingLevel > -1 && event.altKey) {
132
132
  if (_utils.browser.mac && event.metaKey) {
133
- var _editorAPI$core$actio;
134
- return (_editorAPI$core$actio = editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.core.actions.execute(autoformatHeading(headingLevel, editorAnalyticsApi))) !== null && _editorAPI$core$actio !== void 0 ? _editorAPI$core$actio : false;
133
+ var _editorAPI$core$actio, _editorAPI$core;
134
+ return (_editorAPI$core$actio = editorAPI === null || editorAPI === void 0 || (_editorAPI$core = editorAPI.core) === null || _editorAPI$core === void 0 ? void 0 : _editorAPI$core.actions.execute(autoformatHeading(headingLevel, editorAnalyticsApi))) !== null && _editorAPI$core$actio !== void 0 ? _editorAPI$core$actio : false;
135
135
  } else if (!_utils.browser.mac && event.ctrlKey && altKeyLocation !== event.DOM_KEY_LOCATION_RIGHT) {
136
- var _editorAPI$core$actio2;
137
- return (_editorAPI$core$actio2 = editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.core.actions.execute(autoformatHeading(headingLevel, editorAnalyticsApi))) !== null && _editorAPI$core$actio2 !== void 0 ? _editorAPI$core$actio2 : false;
136
+ var _editorAPI$core$actio2, _editorAPI$core2;
137
+ return (_editorAPI$core$actio2 = editorAPI === null || editorAPI === void 0 || (_editorAPI$core2 = editorAPI.core) === null || _editorAPI$core2 === void 0 ? void 0 : _editorAPI$core2.actions.execute(autoformatHeading(headingLevel, editorAnalyticsApi))) !== null && _editorAPI$core$actio2 !== void 0 ? _editorAPI$core$actio2 : false;
138
138
  }
139
139
  } else if (event.key === 'Alt') {
140
140
  // event.location is for the current key only; when a user hits Ctrl-Alt-1 the
@@ -168,8 +168,8 @@ const blockTypePlugin = ({
168
168
  }) {
169
169
  const isSmall = options && options.isUndoRedoButtonsEnabled ? toolbarSize < ToolbarSize.XXL : toolbarSize < ToolbarSize.XL;
170
170
  const boundSetBlockType = name => {
171
- var _api$analytics5;
172
- api === null || api === void 0 ? void 0 : api.core.actions.execute(setBlockTypeWithAnalytics(name, INPUT_METHOD.TOOLBAR, api === null || api === void 0 ? void 0 : (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions));
171
+ var _api$core, _api$analytics5;
172
+ api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(setBlockTypeWithAnalytics(name, INPUT_METHOD.TOOLBAR, api === null || api === void 0 ? void 0 : (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions));
173
173
  };
174
174
  return /*#__PURE__*/React.createElement(WithPluginState, {
175
175
  editorView: editorView,
@@ -118,11 +118,11 @@ export const createPlugin = (editorAPI, dispatch, lastNodeMustBeParagraph) => {
118
118
  const headingLevel = HEADING_KEYS.indexOf(event.keyCode);
119
119
  if (headingLevel > -1 && event.altKey) {
120
120
  if (browser.mac && event.metaKey) {
121
- var _editorAPI$core$actio;
122
- return (_editorAPI$core$actio = editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.core.actions.execute(autoformatHeading(headingLevel, editorAnalyticsApi))) !== null && _editorAPI$core$actio !== void 0 ? _editorAPI$core$actio : false;
121
+ var _editorAPI$core$actio, _editorAPI$core;
122
+ return (_editorAPI$core$actio = editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$core = editorAPI.core) === null || _editorAPI$core === void 0 ? void 0 : _editorAPI$core.actions.execute(autoformatHeading(headingLevel, editorAnalyticsApi))) !== null && _editorAPI$core$actio !== void 0 ? _editorAPI$core$actio : false;
123
123
  } else if (!browser.mac && event.ctrlKey && altKeyLocation !== event.DOM_KEY_LOCATION_RIGHT) {
124
- var _editorAPI$core$actio2;
125
- return (_editorAPI$core$actio2 = editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.core.actions.execute(autoformatHeading(headingLevel, editorAnalyticsApi))) !== null && _editorAPI$core$actio2 !== void 0 ? _editorAPI$core$actio2 : false;
124
+ var _editorAPI$core$actio2, _editorAPI$core2;
125
+ return (_editorAPI$core$actio2 = editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$core2 = editorAPI.core) === null || _editorAPI$core2 === void 0 ? void 0 : _editorAPI$core2.actions.execute(autoformatHeading(headingLevel, editorAnalyticsApi))) !== null && _editorAPI$core$actio2 !== void 0 ? _editorAPI$core$actio2 : false;
126
126
  }
127
127
  } else if (event.key === 'Alt') {
128
128
  // event.location is for the current key only; when a user hits Ctrl-Alt-1 the
@@ -171,8 +171,8 @@ var blockTypePlugin = function blockTypePlugin(_ref3) {
171
171
  eventDispatcher = _ref7.eventDispatcher;
172
172
  var isSmall = options && options.isUndoRedoButtonsEnabled ? toolbarSize < ToolbarSize.XXL : toolbarSize < ToolbarSize.XL;
173
173
  var boundSetBlockType = function boundSetBlockType(name) {
174
- var _api$analytics5;
175
- api === null || api === void 0 || api.core.actions.execute(setBlockTypeWithAnalytics(name, INPUT_METHOD.TOOLBAR, api === null || api === void 0 || (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions));
174
+ var _api$core, _api$analytics5;
175
+ api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(setBlockTypeWithAnalytics(name, INPUT_METHOD.TOOLBAR, api === null || api === void 0 || (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions));
176
176
  };
177
177
  return /*#__PURE__*/React.createElement(WithPluginState, {
178
178
  editorView: editorView,
@@ -123,11 +123,11 @@ export var createPlugin = function createPlugin(editorAPI, dispatch, lastNodeMus
123
123
  var headingLevel = HEADING_KEYS.indexOf(event.keyCode);
124
124
  if (headingLevel > -1 && event.altKey) {
125
125
  if (browser.mac && event.metaKey) {
126
- var _editorAPI$core$actio;
127
- return (_editorAPI$core$actio = editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.core.actions.execute(autoformatHeading(headingLevel, editorAnalyticsApi))) !== null && _editorAPI$core$actio !== void 0 ? _editorAPI$core$actio : false;
126
+ var _editorAPI$core$actio, _editorAPI$core;
127
+ return (_editorAPI$core$actio = editorAPI === null || editorAPI === void 0 || (_editorAPI$core = editorAPI.core) === null || _editorAPI$core === void 0 ? void 0 : _editorAPI$core.actions.execute(autoformatHeading(headingLevel, editorAnalyticsApi))) !== null && _editorAPI$core$actio !== void 0 ? _editorAPI$core$actio : false;
128
128
  } else if (!browser.mac && event.ctrlKey && altKeyLocation !== event.DOM_KEY_LOCATION_RIGHT) {
129
- var _editorAPI$core$actio2;
130
- return (_editorAPI$core$actio2 = editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.core.actions.execute(autoformatHeading(headingLevel, editorAnalyticsApi))) !== null && _editorAPI$core$actio2 !== void 0 ? _editorAPI$core$actio2 : false;
129
+ var _editorAPI$core$actio2, _editorAPI$core2;
130
+ return (_editorAPI$core$actio2 = editorAPI === null || editorAPI === void 0 || (_editorAPI$core2 = editorAPI.core) === null || _editorAPI$core2 === void 0 ? void 0 : _editorAPI$core2.actions.execute(autoformatHeading(headingLevel, editorAnalyticsApi))) !== null && _editorAPI$core$actio2 !== void 0 ? _editorAPI$core$actio2 : false;
131
131
  }
132
132
  } else if (event.key === 'Alt') {
133
133
  // event.location is for the current key only; when a user hits Ctrl-Alt-1 the
@@ -12,4 +12,4 @@ export interface BlockTypeButtonProps {
12
12
  onKeyDown(e: React.KeyboardEvent): void;
13
13
  formatMessage: WrappedComponentProps['intl']['formatMessage'];
14
14
  }
15
- export declare const BlockTypeButton: React.StatelessComponent<BlockTypeButtonProps>;
15
+ export declare const BlockTypeButton: React.FunctionComponent<BlockTypeButtonProps>;
@@ -12,4 +12,4 @@ export interface BlockTypeButtonProps {
12
12
  onKeyDown(e: React.KeyboardEvent): void;
13
13
  formatMessage: WrappedComponentProps['intl']['formatMessage'];
14
14
  }
15
- export declare const BlockTypeButton: React.StatelessComponent<BlockTypeButtonProps>;
15
+ export declare const BlockTypeButton: React.FunctionComponent<BlockTypeButtonProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-type",
3
- "version": "3.0.14",
3
+ "version": "3.0.16",
4
4
  "description": "BlockType plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -9,15 +9,12 @@
9
9
  },
10
10
  "atlassian": {
11
11
  "team": "Editor: Lego",
12
+ "singleton": true,
12
13
  "inPublicMirror": false,
13
14
  "releaseModel": "continuous",
14
- "website": {
15
- "name": "EditorPluginBlockType",
16
- "category": "Components"
17
- },
18
15
  "runReact18": false
19
16
  },
20
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
17
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
21
18
  "main": "dist/cjs/index.js",
22
19
  "module": "dist/esm/index.js",
23
20
  "module:es2019": "dist/es2019/index.js",
@@ -39,7 +36,7 @@
39
36
  },
40
37
  "dependencies": {
41
38
  "@atlaskit/adf-schema": "^35.3.0",
42
- "@atlaskit/editor-common": "^76.35.0",
39
+ "@atlaskit/editor-common": "^76.39.0",
43
40
  "@atlaskit/editor-plugin-analytics": "^0.4.0",
44
41
  "@atlaskit/editor-prosemirror": "1.1.0",
45
42
  "@atlaskit/editor-shared-styles": "^2.9.0",
@@ -64,7 +61,6 @@
64
61
  "@atlaskit/editor-plugin-type-ahead": "^0.9.0",
65
62
  "@atlaskit/ssr": "*",
66
63
  "@atlaskit/visual-regression": "*",
67
- "@atlaskit/webdriver-runner": "*",
68
64
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
69
65
  "@testing-library/react": "^12.1.5",
70
66
  "@testing-library/user-event": "^14.4.3",