@atlaskit/editor-common 74.48.0 → 74.49.1

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,22 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 74.49.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`79c0b7e6821`](https://bitbucket.org/atlassian/atlassian-frontend/commits/79c0b7e6821) - Decouple `base` plugin from `editor-core`
8
+
9
+ ## 74.49.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`9ebabeaa630`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9ebabeaa630) - added ExtractPublicEditorAPI type helper
14
+
15
+ ### Patch Changes
16
+
17
+ - [`fd6bb9c9184`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fd6bb9c9184) - Delete version.json
18
+ - Updated dependencies
19
+
3
20
  ## 74.48.0
4
21
 
5
22
  ### Minor Changes
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "74.48.0";
19
+ var packageVersion = "74.49.1";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
24
24
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
25
25
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "74.48.0";
27
+ var packageVersion = "74.49.1";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -28,6 +28,24 @@ Object.defineProperty(exports, "FILEPATH_REGEXP", {
28
28
  return _hyperlink.FILEPATH_REGEXP;
29
29
  }
30
30
  });
31
+ Object.defineProperty(exports, "GUTTER_SELECTOR", {
32
+ enumerable: true,
33
+ get: function get() {
34
+ return _scrollGutter.GUTTER_SELECTOR;
35
+ }
36
+ });
37
+ Object.defineProperty(exports, "GUTTER_SIZE_IN_PX", {
38
+ enumerable: true,
39
+ get: function get() {
40
+ return _scrollGutter.GUTTER_SIZE_IN_PX;
41
+ }
42
+ });
43
+ Object.defineProperty(exports, "GUTTER_SIZE_MOBILE_IN_PX", {
44
+ enumerable: true,
45
+ get: function get() {
46
+ return _scrollGutter.GUTTER_SIZE_MOBILE_IN_PX;
47
+ }
48
+ });
31
49
  Object.defineProperty(exports, "LinkMatcher", {
32
50
  enumerable: true,
33
51
  get: function get() {
@@ -1001,6 +1019,7 @@ var _richMediaUtils = require("./rich-media-utils");
1001
1019
  var _privacyFilter = require("./filter/privacy-filter");
1002
1020
  var _datasource = require("./datasource");
1003
1021
  var _commands = require("./commands");
1022
+ var _scrollGutter = require("./scroll-gutter");
1004
1023
  var _inputRules = require("./input-rules");
1005
1024
  // prosemirror-history does not export its plugin key
1006
1025
  var pmHistoryPluginKey = 'history$';
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.GUTTER_SIZE_MOBILE_IN_PX = exports.GUTTER_SIZE_IN_PX = exports.GUTTER_SELECTOR = void 0;
7
+ var GUTTER_SIZE_IN_PX = 120; // Default gutter size
8
+ exports.GUTTER_SIZE_IN_PX = GUTTER_SIZE_IN_PX;
9
+ var GUTTER_SIZE_MOBILE_IN_PX = 36; // Gutter size for Mobile
10
+ exports.GUTTER_SIZE_MOBILE_IN_PX = GUTTER_SIZE_MOBILE_IN_PX;
11
+ var GUTTER_SELECTOR = '#editor-scroll-gutter';
12
+ exports.GUTTER_SELECTOR = GUTTER_SELECTOR;
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "74.48.0";
3
+ const packageVersion = "74.49.1";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -0,0 +1 @@
1
+ export {};
@@ -8,7 +8,7 @@ import { themed } from '@atlaskit/theme/components';
8
8
  import { borderRadius } from '@atlaskit/theme/constants';
9
9
  import Layer from '../Layer';
10
10
  const packageName = "@atlaskit/editor-common";
11
- const packageVersion = "74.48.0";
11
+ const packageVersion = "74.49.1";
12
12
  const halfFocusRing = 1;
13
13
  const dropOffset = '0, 8';
14
14
  class DropList extends Component {
@@ -48,6 +48,7 @@ export { floatingLayouts, isRichMediaInsideOfBlockNode, calculateSnapPoints, ali
48
48
  export { sanitizeNodeForPrivacy } from './filter/privacy-filter';
49
49
  export { canRenderDatasource } from './datasource';
50
50
  export { filterCommand, isEmptySelectionAtStart, isEmptySelectionAtEnd, insertContentDeleteRange, deleteEmptyParagraphAndMoveBlockUp, insertNewLineWithAnalytics, createNewParagraphAbove, createNewParagraphBelow, createParagraphNear, walkNextNode, walkPrevNode } from './commands';
51
+ export { GUTTER_SELECTOR, GUTTER_SIZE_IN_PX, GUTTER_SIZE_MOBILE_IN_PX } from './scroll-gutter';
51
52
  export function shallowEqual(obj1 = {}, obj2 = {}) {
52
53
  const keys1 = Object.keys(obj1);
53
54
  const keys2 = Object.keys(obj2);
@@ -0,0 +1,3 @@
1
+ export const GUTTER_SIZE_IN_PX = 120; // Default gutter size
2
+ export const GUTTER_SIZE_MOBILE_IN_PX = 36; // Gutter size for Mobile
3
+ export const GUTTER_SELECTOR = '#editor-scroll-gutter';
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "74.48.0";
9
+ var packageVersion = "74.49.1";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -0,0 +1 @@
1
+ export {};
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
18
18
  import { borderRadius } from '@atlaskit/theme/constants';
19
19
  import Layer from '../Layer';
20
20
  var packageName = "@atlaskit/editor-common";
21
- var packageVersion = "74.48.0";
21
+ var packageVersion = "74.49.1";
22
22
  var halfFocusRing = 1;
23
23
  var dropOffset = '0, 8';
24
24
  var DropList = /*#__PURE__*/function (_Component) {
@@ -48,6 +48,7 @@ export { floatingLayouts, isRichMediaInsideOfBlockNode, calculateSnapPoints, ali
48
48
  export { sanitizeNodeForPrivacy } from './filter/privacy-filter';
49
49
  export { canRenderDatasource } from './datasource';
50
50
  export { filterCommand, isEmptySelectionAtStart, isEmptySelectionAtEnd, insertContentDeleteRange, deleteEmptyParagraphAndMoveBlockUp, insertNewLineWithAnalytics, createNewParagraphAbove, createNewParagraphBelow, createParagraphNear, walkNextNode, walkPrevNode } from './commands';
51
+ export { GUTTER_SELECTOR, GUTTER_SIZE_IN_PX, GUTTER_SIZE_MOBILE_IN_PX } from './scroll-gutter';
51
52
  export function shallowEqual() {
52
53
  var obj1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
53
54
  var obj2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -0,0 +1,3 @@
1
+ export var GUTTER_SIZE_IN_PX = 120; // Default gutter size
2
+ export var GUTTER_SIZE_MOBILE_IN_PX = 36; // Gutter size for Mobile
3
+ export var GUTTER_SELECTOR = '#editor-scroll-gutter';
@@ -1,4 +1,4 @@
1
- import type { ExtractPluginSharedState, NextEditorPlugin, PluginDependenciesAPI, PluginInjectionAPIWithDependencies } from '../types/next-editor-plugin';
1
+ import type { ExtractPluginSharedState, NextEditorPlugin, PluginDependenciesAPI, PluginInjectionAPIWithDependencies, PublicPluginAPI } from '../types/next-editor-plugin';
2
2
  type NamedPluginStatesFromInjectionAPI<API extends PluginInjectionAPIWithDependencies<any> | undefined, PluginList extends string[]> = Readonly<{
3
3
  [K in PluginList[number] as `${K}State`]: API extends PluginInjectionAPIWithDependencies<any> ? API['dependencies'][K] extends PluginDependenciesAPI<infer Plugin> | undefined ? ExtractPluginSharedState<Plugin> | undefined : never : never;
4
4
  }>;
@@ -35,5 +35,5 @@ type ExtractPluginNames<API extends PluginInjectionAPIWithDependencies<any>> = A
35
35
  * @returns A corresponding object, the keys are names of the plugin with `State` appended,
36
36
  * the values are the shared state exposed by that plugin.
37
37
  */
38
- export declare function useSharedPluginState<Plugins extends NextEditorPlugin<any, any>[], PluginNames extends ExtractPluginNames<PluginInjectionAPIWithDependencies<Plugins>>[]>(injectionApi: PluginInjectionAPIWithDependencies<Plugins> | undefined, plugins: PluginNames): NamedPluginStatesFromInjectionAPI<typeof injectionApi, PluginNames>;
38
+ export declare function useSharedPluginState<Plugins extends NextEditorPlugin<any, any>[], PluginNames extends ExtractPluginNames<PublicPluginAPI<Plugins>>[]>(injectionApi: PublicPluginAPI<Plugins> | undefined, plugins: PluginNames): NamedPluginStatesFromInjectionAPI<typeof injectionApi, PluginNames>;
39
39
  export {};
@@ -0,0 +1,3 @@
1
+ import type { EditorPresetBuilder } from '../preset/builder';
2
+ import type { ExtractNextEditorPlugins, PublicPluginAPI } from './next-editor-plugin';
3
+ export type ExtractPublicEditorAPI<T extends EditorPresetBuilder<any, any>> = T extends EditorPresetBuilder<any, infer Plugins> ? PublicPluginAPI<ExtractNextEditorPlugins<Plugins>> : PublicPluginAPI<[]>;
@@ -29,6 +29,7 @@ export type { PMPluginFactoryParams, PMPluginFactory, PMPlugin, } from './plugin
29
29
  export type { NodeConfig, MarkConfig, NodeViewConfig, } from './prosemirror-config';
30
30
  export type { PluginsOptions, EditorPlugin, getPosHandler, getPosHandlerNode, } from './editor-plugin';
31
31
  export type { NextEditorPlugin, AllEditorPresetPluginTypes, PluginDependenciesAPI, ExtractPluginNameFromAllBuilderPlugins, SafePresetCheck, DefaultEditorPlugin, OptionalPlugin, PluginInjectionAPI, CreatePluginDependenciesAPI, NextEditorPluginMetadata, ExtractInjectionAPI, ExtractPluginActions, PluginInjectionAPIWithDependency, PluginInjectionAPIWithDependencies, PublicPluginAPI, } from './next-editor-plugin';
32
+ export type { ExtractPublicEditorAPI } from './editor-public-api';
32
33
  export type { EditorCommand, EditorCommandWithMetadata, } from './editor-command';
33
34
  export type IconProps = {
34
35
  label?: string;
@@ -105,4 +105,10 @@ export type ExtractInjectionAPI<Plugin> = Plugin extends NextEditorPlugin<infer
105
105
  export type PublicPluginAPI<PluginList extends NextEditorPlugin<any, any>[]> = {
106
106
  dependencies: CreatePluginDependenciesAPI<[...PluginList, CorePlugin]>;
107
107
  };
108
+ export type ExtractNextEditorPlugins<Plugins extends AllEditorPresetPluginTypes[]> = {
109
+ [PluginNumber in keyof Plugins]: Plugins[PluginNumber] extends NextEditorPlugin<infer Name, infer Metadata> ? NextEditorPlugin<Name, Metadata> : Plugins[PluginNumber] extends [
110
+ NextEditorPlugin<infer Name, infer Metadata>,
111
+ any
112
+ ] ? NextEditorPlugin<Name, Metadata> : never;
113
+ };
108
114
  export {};
@@ -60,6 +60,7 @@ export { sanitizeNodeForPrivacy } from './filter/privacy-filter';
60
60
  export { canRenderDatasource } from './datasource';
61
61
  export { filterCommand, isEmptySelectionAtStart, isEmptySelectionAtEnd, insertContentDeleteRange, deleteEmptyParagraphAndMoveBlockUp, insertNewLineWithAnalytics, createNewParagraphAbove, createNewParagraphBelow, createParagraphNear, walkNextNode, walkPrevNode, } from './commands';
62
62
  export type { WalkNode } from './commands';
63
+ export { GUTTER_SELECTOR, GUTTER_SIZE_IN_PX, GUTTER_SIZE_MOBILE_IN_PX, } from './scroll-gutter';
63
64
  export declare function shallowEqual(obj1?: any, obj2?: any): boolean;
64
65
  export { inputRuleWithAnalytics, createWrappingJoinRule, createRule, } from './input-rules';
65
66
  export declare function isSelectionInsideLastNodeInDocument(selection: Selection): boolean;
@@ -0,0 +1,3 @@
1
+ export declare const GUTTER_SIZE_IN_PX = 120;
2
+ export declare const GUTTER_SIZE_MOBILE_IN_PX = 36;
3
+ export declare const GUTTER_SELECTOR = "#editor-scroll-gutter";
@@ -1,4 +1,4 @@
1
- import type { ExtractPluginSharedState, NextEditorPlugin, PluginDependenciesAPI, PluginInjectionAPIWithDependencies } from '../types/next-editor-plugin';
1
+ import type { ExtractPluginSharedState, NextEditorPlugin, PluginDependenciesAPI, PluginInjectionAPIWithDependencies, PublicPluginAPI } from '../types/next-editor-plugin';
2
2
  type NamedPluginStatesFromInjectionAPI<API extends PluginInjectionAPIWithDependencies<any> | undefined, PluginList extends string[]> = Readonly<{
3
3
  [K in PluginList[number] as `${K}State`]: API extends PluginInjectionAPIWithDependencies<any> ? API['dependencies'][K] extends PluginDependenciesAPI<infer Plugin> | undefined ? ExtractPluginSharedState<Plugin> | undefined : never : never;
4
4
  }>;
@@ -35,5 +35,5 @@ type ExtractPluginNames<API extends PluginInjectionAPIWithDependencies<any>> = A
35
35
  * @returns A corresponding object, the keys are names of the plugin with `State` appended,
36
36
  * the values are the shared state exposed by that plugin.
37
37
  */
38
- export declare function useSharedPluginState<Plugins extends NextEditorPlugin<any, any>[], PluginNames extends ExtractPluginNames<PluginInjectionAPIWithDependencies<Plugins>>[]>(injectionApi: PluginInjectionAPIWithDependencies<Plugins> | undefined, plugins: PluginNames): NamedPluginStatesFromInjectionAPI<typeof injectionApi, PluginNames>;
38
+ export declare function useSharedPluginState<Plugins extends NextEditorPlugin<any, any>[], PluginNames extends ExtractPluginNames<PublicPluginAPI<Plugins>>[]>(injectionApi: PublicPluginAPI<Plugins> | undefined, plugins: PluginNames): NamedPluginStatesFromInjectionAPI<typeof injectionApi, PluginNames>;
39
39
  export {};
@@ -0,0 +1,4 @@
1
+ import type { EditorPresetBuilder } from '../preset/builder';
2
+ import type { ExtractNextEditorPlugins, PublicPluginAPI } from './next-editor-plugin';
3
+ export type ExtractPublicEditorAPI<T extends EditorPresetBuilder<any, any>> = T extends EditorPresetBuilder<any, infer Plugins> ? PublicPluginAPI<ExtractNextEditorPlugins<Plugins>> : PublicPluginAPI<[
4
+ ]>;
@@ -29,6 +29,7 @@ export type { PMPluginFactoryParams, PMPluginFactory, PMPlugin, } from './plugin
29
29
  export type { NodeConfig, MarkConfig, NodeViewConfig, } from './prosemirror-config';
30
30
  export type { PluginsOptions, EditorPlugin, getPosHandler, getPosHandlerNode, } from './editor-plugin';
31
31
  export type { NextEditorPlugin, AllEditorPresetPluginTypes, PluginDependenciesAPI, ExtractPluginNameFromAllBuilderPlugins, SafePresetCheck, DefaultEditorPlugin, OptionalPlugin, PluginInjectionAPI, CreatePluginDependenciesAPI, NextEditorPluginMetadata, ExtractInjectionAPI, ExtractPluginActions, PluginInjectionAPIWithDependency, PluginInjectionAPIWithDependencies, PublicPluginAPI, } from './next-editor-plugin';
32
+ export type { ExtractPublicEditorAPI } from './editor-public-api';
32
33
  export type { EditorCommand, EditorCommandWithMetadata, } from './editor-command';
33
34
  export type IconProps = {
34
35
  label?: string;
@@ -128,4 +128,10 @@ export type PublicPluginAPI<PluginList extends NextEditorPlugin<any, any>[]> = {
128
128
  CorePlugin
129
129
  ]>;
130
130
  };
131
+ export type ExtractNextEditorPlugins<Plugins extends AllEditorPresetPluginTypes[]> = {
132
+ [PluginNumber in keyof Plugins]: Plugins[PluginNumber] extends NextEditorPlugin<infer Name, infer Metadata> ? NextEditorPlugin<Name, Metadata> : Plugins[PluginNumber] extends [
133
+ NextEditorPlugin<infer Name, infer Metadata>,
134
+ any
135
+ ] ? NextEditorPlugin<Name, Metadata> : never;
136
+ };
131
137
  export {};
@@ -60,6 +60,7 @@ export { sanitizeNodeForPrivacy } from './filter/privacy-filter';
60
60
  export { canRenderDatasource } from './datasource';
61
61
  export { filterCommand, isEmptySelectionAtStart, isEmptySelectionAtEnd, insertContentDeleteRange, deleteEmptyParagraphAndMoveBlockUp, insertNewLineWithAnalytics, createNewParagraphAbove, createNewParagraphBelow, createParagraphNear, walkNextNode, walkPrevNode, } from './commands';
62
62
  export type { WalkNode } from './commands';
63
+ export { GUTTER_SELECTOR, GUTTER_SIZE_IN_PX, GUTTER_SIZE_MOBILE_IN_PX, } from './scroll-gutter';
63
64
  export declare function shallowEqual(obj1?: any, obj2?: any): boolean;
64
65
  export { inputRuleWithAnalytics, createWrappingJoinRule, createRule, } from './input-rules';
65
66
  export declare function isSelectionInsideLastNodeInDocument(selection: Selection): boolean;
@@ -0,0 +1,3 @@
1
+ export declare const GUTTER_SIZE_IN_PX = 120;
2
+ export declare const GUTTER_SIZE_MOBILE_IN_PX = 36;
3
+ export declare const GUTTER_SELECTOR = "#editor-scroll-gutter";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.48.0",
3
+ "version": "74.49.1",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -112,7 +112,7 @@
112
112
  "@atlaskit/spinner": "^15.5.0",
113
113
  "@atlaskit/task-decision": "^17.7.0",
114
114
  "@atlaskit/theme": "^12.5.0",
115
- "@atlaskit/tokens": "^1.14.0",
115
+ "@atlaskit/tokens": "^1.15.0",
116
116
  "@atlaskit/tooltip": "^17.8.0",
117
117
  "@atlaskit/ufo": "^0.2.0",
118
118
  "@atlaskit/width-detector": "^4.1.0",