@atlaskit/editor-common 74.48.0 → 74.49.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,16 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 74.49.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`9ebabeaa630`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9ebabeaa630) - added ExtractPublicEditorAPI type helper
8
+
9
+ ### Patch Changes
10
+
11
+ - [`fd6bb9c9184`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fd6bb9c9184) - Delete version.json
12
+ - Updated dependencies
13
+
3
14
  ## 74.48.0
4
15
 
5
16
  ### 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.0";
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.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -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.0";
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.0";
12
12
  const halfFocusRing = 1;
13
13
  const dropOffset = '0, 8';
14
14
  class DropList extends Component {
@@ -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.0";
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.0";
22
22
  var halfFocusRing = 1;
23
23
  var dropOffset = '0, 8';
24
24
  var DropList = /*#__PURE__*/function (_Component) {
@@ -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 {};
@@ -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 {};
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.0",
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",