@atlaskit/editor-core 187.37.0 → 187.37.2

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,18 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 187.37.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`39fcb436aba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/39fcb436aba) - ED-19617 Create editor-plugin-extension scaffold
8
+ - Updated dependencies
9
+
10
+ ## 187.37.1
11
+
12
+ ### Patch Changes
13
+
14
+ - [`9c066a01776`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9c066a01776) - ED-19445: Copied HTML is being reformatted when pasted into the editor
15
+
3
16
  ## 187.37.0
4
17
 
5
18
  ### Minor Changes
@@ -11,6 +11,7 @@ var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
11
11
  var _uniqueId = require("./pm-plugins/unique-id");
12
12
  var _toolbar = require("./toolbar");
13
13
  var _contextPanel = require("./context-panel");
14
+ var _extensionApi = require("./extension-api");
14
15
  var extensionPlugin = function extensionPlugin(_ref) {
15
16
  var _api$featureFlags, _api$contextPanel2, _api$contextPanel3;
16
17
  var _ref$config = _ref.config,
@@ -57,6 +58,9 @@ var extensionPlugin = function extensionPlugin(_ref) {
57
58
  }
58
59
  }];
59
60
  },
61
+ actions: {
62
+ createExtensionAPI: _extensionApi.createExtensionAPI
63
+ },
60
64
  pluginsOptions: {
61
65
  floatingToolbar: (0, _toolbar.getToolbarConfig)({
62
66
  breakoutEnabled: options.breakoutEnabled,
@@ -228,13 +228,13 @@ var handleUpdate = function handleUpdate(_ref4) {
228
228
  };
229
229
  exports.handleUpdate = handleUpdate;
230
230
  var createPlugin = function createPlugin(dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, pluginInjectionApi) {
231
- var _pluginInjectionApi$c;
231
+ var _pluginInjectionApi$c, _pluginInjectionApi$c2;
232
232
  var useLongPressSelection = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
233
233
  var options = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {};
234
234
  var state = (0, _pluginFactory.createPluginState)(dispatch, {
235
235
  showEditButton: false,
236
236
  showContextPanel: false,
237
- applyChangeToContextPanel: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.applyChange
237
+ applyChangeToContextPanel: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c === void 0 ? void 0 : (_pluginInjectionApi$c2 = _pluginInjectionApi$c.actions) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.applyChange
238
238
  });
239
239
  var extensionNodeViewOptions = {
240
240
  appearance: options.appearance
@@ -249,13 +249,13 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
249
249
  providerFactory.subscribe('contextIdentificationProvider', contextIdentificationProviderHandler);
250
250
  return {
251
251
  update: function update(view, prevState) {
252
- var _pluginInjectionApi$c2;
252
+ var _pluginInjectionApi$c3;
253
253
  handleUpdate({
254
254
  view: view,
255
255
  prevState: prevState,
256
256
  domAtPos: domAtPos,
257
257
  extensionHandlers: extensionHandlers,
258
- applyChange: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c2 = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.actions.applyChange
258
+ applyChange: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c3 = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : _pluginInjectionApi$c3.actions.applyChange
259
259
  });
260
260
  },
261
261
  destroy: function destroy() {
@@ -78,8 +78,8 @@ function getPasteSource(event) {
78
78
  // @see https://product-fabric.atlassian.net/browse/ED-3159
79
79
  // @see https://github.com/markdown-it/markdown-it/issues/38
80
80
  function escapeLinks(text) {
81
- return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s]+)/g, function (str) {
82
- return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s]+$/) ? "<".concat(str, ">") : str;
81
+ return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s"'>]+)/g, function (str) {
82
+ return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s"'>]+$/) ? "<".concat(str, ">") : str;
83
83
  });
84
84
  }
85
85
  function hasOnlyNodesOfType() {
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "187.37.0";
9
+ var version = "187.37.2";
10
10
  exports.version = version;
11
11
  var nextMajorVersion = function nextMajorVersion() {
12
12
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
@@ -4,6 +4,7 @@ import keymapPlugin from './pm-plugins/keymap';
4
4
  import { createPlugin as createUniqueIdPlugin } from './pm-plugins/unique-id';
5
5
  import { getToolbarConfig } from './toolbar';
6
6
  import { getContextPanel } from './context-panel';
7
+ import { createExtensionAPI } from './extension-api';
7
8
  const extensionPlugin = ({
8
9
  config: options = {},
9
10
  api
@@ -49,6 +50,9 @@ const extensionPlugin = ({
49
50
  plugin: () => createUniqueIdPlugin()
50
51
  }];
51
52
  },
53
+ actions: {
54
+ createExtensionAPI
55
+ },
52
56
  pluginsOptions: {
53
57
  floatingToolbar: getToolbarConfig({
54
58
  breakoutEnabled: options.breakoutEnabled,
@@ -130,11 +130,11 @@ export const handleUpdate = ({
130
130
  return true;
131
131
  };
132
132
  const createPlugin = (dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, pluginInjectionApi, useLongPressSelection = false, options = {}) => {
133
- var _pluginInjectionApi$c;
133
+ var _pluginInjectionApi$c, _pluginInjectionApi$c2;
134
134
  const state = createPluginState(dispatch, {
135
135
  showEditButton: false,
136
136
  showContextPanel: false,
137
- applyChangeToContextPanel: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.applyChange
137
+ applyChangeToContextPanel: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c === void 0 ? void 0 : (_pluginInjectionApi$c2 = _pluginInjectionApi$c.actions) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.applyChange
138
138
  });
139
139
  const extensionNodeViewOptions = {
140
140
  appearance: options.appearance
@@ -149,13 +149,13 @@ const createPlugin = (dispatch, providerFactory, extensionHandlers, portalProvid
149
149
  providerFactory.subscribe('contextIdentificationProvider', contextIdentificationProviderHandler);
150
150
  return {
151
151
  update: (view, prevState) => {
152
- var _pluginInjectionApi$c2;
152
+ var _pluginInjectionApi$c3;
153
153
  handleUpdate({
154
154
  view,
155
155
  prevState,
156
156
  domAtPos,
157
157
  extensionHandlers,
158
- applyChange: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c2 = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.actions.applyChange
158
+ applyChange: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c3 = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : _pluginInjectionApi$c3.actions.applyChange
159
159
  });
160
160
  },
161
161
  destroy: () => {
@@ -56,8 +56,8 @@ export function getPasteSource(event) {
56
56
  // @see https://product-fabric.atlassian.net/browse/ED-3159
57
57
  // @see https://github.com/markdown-it/markdown-it/issues/38
58
58
  export function escapeLinks(text) {
59
- return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s]+)/g, str => {
60
- return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s]+$/) ? `<${str}>` : str;
59
+ return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s"'>]+)/g, str => {
60
+ return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s"'>]+$/) ? `<${str}>` : str;
61
61
  });
62
62
  }
63
63
  export function hasOnlyNodesOfType(...nodeTypes) {
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "187.37.0";
2
+ export const version = "187.37.2";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -4,6 +4,7 @@ import keymapPlugin from './pm-plugins/keymap';
4
4
  import { createPlugin as createUniqueIdPlugin } from './pm-plugins/unique-id';
5
5
  import { getToolbarConfig } from './toolbar';
6
6
  import { getContextPanel } from './context-panel';
7
+ import { createExtensionAPI } from './extension-api';
7
8
  var extensionPlugin = function extensionPlugin(_ref) {
8
9
  var _api$featureFlags, _api$contextPanel2, _api$contextPanel3;
9
10
  var _ref$config = _ref.config,
@@ -50,6 +51,9 @@ var extensionPlugin = function extensionPlugin(_ref) {
50
51
  }
51
52
  }];
52
53
  },
54
+ actions: {
55
+ createExtensionAPI: createExtensionAPI
56
+ },
53
57
  pluginsOptions: {
54
58
  floatingToolbar: getToolbarConfig({
55
59
  breakoutEnabled: options.breakoutEnabled,
@@ -199,13 +199,13 @@ export var handleUpdate = function handleUpdate(_ref4) {
199
199
  return true;
200
200
  };
201
201
  var createPlugin = function createPlugin(dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, pluginInjectionApi) {
202
- var _pluginInjectionApi$c;
202
+ var _pluginInjectionApi$c, _pluginInjectionApi$c2;
203
203
  var useLongPressSelection = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
204
204
  var options = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {};
205
205
  var state = createPluginState(dispatch, {
206
206
  showEditButton: false,
207
207
  showContextPanel: false,
208
- applyChangeToContextPanel: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.applyChange
208
+ applyChangeToContextPanel: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c === void 0 ? void 0 : (_pluginInjectionApi$c2 = _pluginInjectionApi$c.actions) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.applyChange
209
209
  });
210
210
  var extensionNodeViewOptions = {
211
211
  appearance: options.appearance
@@ -220,13 +220,13 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
220
220
  providerFactory.subscribe('contextIdentificationProvider', contextIdentificationProviderHandler);
221
221
  return {
222
222
  update: function update(view, prevState) {
223
- var _pluginInjectionApi$c2;
223
+ var _pluginInjectionApi$c3;
224
224
  handleUpdate({
225
225
  view: view,
226
226
  prevState: prevState,
227
227
  domAtPos: domAtPos,
228
228
  extensionHandlers: extensionHandlers,
229
- applyChange: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c2 = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.actions.applyChange
229
+ applyChange: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c3 = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : _pluginInjectionApi$c3.actions.applyChange
230
230
  });
231
231
  },
232
232
  destroy: function destroy() {
@@ -57,8 +57,8 @@ export function getPasteSource(event) {
57
57
  // @see https://product-fabric.atlassian.net/browse/ED-3159
58
58
  // @see https://github.com/markdown-it/markdown-it/issues/38
59
59
  export function escapeLinks(text) {
60
- return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s]+)/g, function (str) {
61
- return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s]+$/) ? "<".concat(str, ">") : str;
60
+ return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s"'>]+)/g, function (str) {
61
+ return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s"'>]+$/) ? "<".concat(str, ">") : str;
62
62
  });
63
63
  }
64
64
  export function hasOnlyNodesOfType() {
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "187.37.0";
2
+ export var version = "187.37.2";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,16 +1,10 @@
1
- import type { ExtensionAPI } from '@atlaskit/editor-common/extensions';
2
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
2
  import type { MacroProvider } from '../macro';
4
- import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
3
+ import type { CreateExtensionAPI } from '@atlaskit/editor-plugin-extension';
5
4
  interface EditInLegacyMacroBrowserArgs {
6
5
  view: EditorView;
7
6
  macroProvider?: MacroProvider;
8
7
  }
9
8
  export declare const getEditInLegacyMacroBrowser: ({ view, macroProvider, }: EditInLegacyMacroBrowserArgs) => () => void;
10
- interface CreateExtensionAPIOptions {
11
- editorView: EditorView;
12
- applyChange: ApplyChangeHandler | undefined;
13
- editInLegacyMacroBrowser?: () => void;
14
- }
15
- export declare const createExtensionAPI: (options: CreateExtensionAPIOptions) => ExtensionAPI;
9
+ export declare const createExtensionAPI: CreateExtensionAPI;
16
10
  export {};
@@ -1,23 +1,3 @@
1
- import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
2
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
3
- import type { NextEditorPlugin, EditorAppearance, OptionalPlugin } from '@atlaskit/editor-common/types';
4
- import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
5
- import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
6
- import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
7
- import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
8
- interface ExtensionPluginOptions extends LongPressSelectionPluginOptions {
9
- allowAutoSave?: boolean;
10
- breakoutEnabled?: boolean;
11
- extensionHandlers?: ExtensionHandlers;
12
- appearance?: EditorAppearance;
13
- }
14
- declare const extensionPlugin: NextEditorPlugin<'extension', {
15
- pluginConfiguration: ExtensionPluginOptions | undefined;
16
- dependencies: [
17
- FeatureFlagsPlugin,
18
- WidthPlugin,
19
- DecorationsPlugin,
20
- OptionalPlugin<ContextPanelPlugin>
21
- ];
22
- }>;
1
+ import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
2
+ declare const extensionPlugin: ExtensionPlugin;
23
3
  export default extensionPlugin;
@@ -1,16 +1,10 @@
1
- import type { ExtensionAPI } from '@atlaskit/editor-common/extensions';
2
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
2
  import type { MacroProvider } from '../macro';
4
- import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
3
+ import type { CreateExtensionAPI } from '@atlaskit/editor-plugin-extension';
5
4
  interface EditInLegacyMacroBrowserArgs {
6
5
  view: EditorView;
7
6
  macroProvider?: MacroProvider;
8
7
  }
9
8
  export declare const getEditInLegacyMacroBrowser: ({ view, macroProvider, }: EditInLegacyMacroBrowserArgs) => () => void;
10
- interface CreateExtensionAPIOptions {
11
- editorView: EditorView;
12
- applyChange: ApplyChangeHandler | undefined;
13
- editInLegacyMacroBrowser?: () => void;
14
- }
15
- export declare const createExtensionAPI: (options: CreateExtensionAPIOptions) => ExtensionAPI;
9
+ export declare const createExtensionAPI: CreateExtensionAPI;
16
10
  export {};
@@ -1,23 +1,3 @@
1
- import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
2
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
3
- import type { NextEditorPlugin, EditorAppearance, OptionalPlugin } from '@atlaskit/editor-common/types';
4
- import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
5
- import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
6
- import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
7
- import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
8
- interface ExtensionPluginOptions extends LongPressSelectionPluginOptions {
9
- allowAutoSave?: boolean;
10
- breakoutEnabled?: boolean;
11
- extensionHandlers?: ExtensionHandlers;
12
- appearance?: EditorAppearance;
13
- }
14
- declare const extensionPlugin: NextEditorPlugin<'extension', {
15
- pluginConfiguration: ExtensionPluginOptions | undefined;
16
- dependencies: [
17
- FeatureFlagsPlugin,
18
- WidthPlugin,
19
- DecorationsPlugin,
20
- OptionalPlugin<ContextPanelPlugin>
21
- ];
22
- }>;
1
+ import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
2
+ declare const extensionPlugin: ExtensionPlugin;
23
3
  export default extensionPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.37.0",
3
+ "version": "187.37.2",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -67,6 +67,7 @@
67
67
  "@atlaskit/editor-plugin-decorations": "^0.2.0",
68
68
  "@atlaskit/editor-plugin-editor-disabled": "^0.2.0",
69
69
  "@atlaskit/editor-plugin-emoji": "^0.3.0",
70
+ "@atlaskit/editor-plugin-extension": "^0.1.0",
70
71
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
71
72
  "@atlaskit/editor-plugin-floating-toolbar": "^0.4.0",
72
73
  "@atlaskit/editor-plugin-focus": "^0.2.0",
@@ -115,7 +116,7 @@
115
116
  "@atlaskit/textfield": "^5.6.0",
116
117
  "@atlaskit/theme": "^12.6.0",
117
118
  "@atlaskit/toggle": "^12.6.0",
118
- "@atlaskit/tokens": "^1.18.0",
119
+ "@atlaskit/tokens": "^1.19.0",
119
120
  "@atlaskit/tooltip": "^17.8.0",
120
121
  "@atlaskit/width-detector": "^4.1.0",
121
122
  "@babel/runtime": "^7.0.0",