@atlaskit/editor-common 102.11.0 → 102.11.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,24 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 102.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#128123](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/128123)
8
+ [`ab71af4c9be90`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ab71af4c9be90) -
9
+ [ux] [ED-26947] Implement media pixel resizing editor
10
+ - Updated dependencies
11
+
12
+ ## 102.11.1
13
+
14
+ ### Patch Changes
15
+
16
+ - [#128991](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/128991)
17
+ [`c24ae5545b4ba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c24ae5545b4ba) -
18
+ Fix bug where requestDocument was throttling at a module level rather than per editor - this was
19
+ causing issues in products that use multiple editors at the same time.
20
+ - Updated dependencies
21
+
3
22
  ## 102.11.0
4
23
 
5
24
  ### Minor Changes
@@ -21,6 +21,11 @@ var pixelEntryMessages = exports.pixelEntryMessages = (0, _reactIntlNext.defineM
21
21
  defaultMessage: 'Max width {maxWidth}px',
22
22
  description: 'The width input aria label'
23
23
  },
24
+ inputWidthLabel: {
25
+ id: 'fabric.editor.media.pixelEntry.inputWidthLabel',
26
+ defaultMessage: 'Width',
27
+ description: 'The label displayed next to the width input'
28
+ },
24
29
  inputHeightTooltip: {
25
30
  id: 'fabric.editor.media.pixelEntry.inputHeightTooltip',
26
31
  defaultMessage: 'Height',
@@ -50,5 +55,10 @@ var pixelEntryMessages = exports.pixelEntryMessages = (0, _reactIntlNext.defineM
50
55
  id: 'fabric.editor.media.pixelEntry.migrationButtonTooltip',
51
56
  defaultMessage: 'Migrate from percentage to fixed pixel sizing',
52
57
  description: 'The tooltip displayed on the migration button'
58
+ },
59
+ closePixelEntry: {
60
+ id: 'fabric.editor.media.pixelEntry.closePixelEntry',
61
+ defaultMessage: 'Close',
62
+ description: 'The text give to the close button used to close the pixel inputs and go back to main toolbar'
53
63
  }
54
64
  });
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "102.11.0";
20
+ var packageVersion = "102.11.2";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // Ignored via go/ees007
@@ -13,6 +13,8 @@ var _requestDocument = require("./requestDocument");
13
13
  */
14
14
  var corePlugin = exports.corePlugin = function corePlugin(_ref) {
15
15
  var config = _ref.config;
16
+ // Create the document request throttler per editor (rather than at a module level)
17
+ var scheduleDocumentRequest = (0, _requestDocument.createThrottleSchedule)(_requestDocument.returnDocumentRequest);
16
18
  return {
17
19
  name: 'core',
18
20
  actions: {
@@ -75,7 +77,7 @@ var corePlugin = exports.corePlugin = function corePlugin(_ref) {
75
77
  requestDocument: function requestDocument(onReceive, options) {
76
78
  var _config$getEditorView;
77
79
  var view = (_config$getEditorView = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView !== void 0 ? _config$getEditorView : null;
78
- (0, _requestDocument.scheduleDocumentRequest)(view, onReceive, options === null || options === void 0 ? void 0 : options.transformer, config === null || config === void 0 ? void 0 : config.fireAnalyticsEvent);
80
+ scheduleDocumentRequest(view, onReceive, options === null || options === void 0 ? void 0 : options.transformer, config === null || config === void 0 ? void 0 : config.fireAnalyticsEvent);
79
81
  },
80
82
  createTransformer: function createTransformer(cb) {
81
83
  var _config$getEditorView2;
@@ -4,7 +4,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.scheduleDocumentRequest = void 0;
7
+ exports.createThrottleSchedule = createThrottleSchedule;
8
+ exports.returnDocumentRequest = returnDocumentRequest;
8
9
  exports.toJSON = toJSON;
9
10
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
11
  var _editorJsonTransformer = require("@atlaskit/editor-json-transformer");
@@ -44,7 +45,6 @@ function createThrottleSchedule(callback) {
44
45
  };
45
46
  return wrapperFn;
46
47
  }
47
- var scheduleDocumentRequest = exports.scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
48
48
 
49
49
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
50
  function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent) {
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "102.11.0";
26
+ var packageVersion = "102.11.2";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -15,6 +15,11 @@ export const pixelEntryMessages = defineMessages({
15
15
  defaultMessage: 'Max width {maxWidth}px',
16
16
  description: 'The width input aria label'
17
17
  },
18
+ inputWidthLabel: {
19
+ id: 'fabric.editor.media.pixelEntry.inputWidthLabel',
20
+ defaultMessage: 'Width',
21
+ description: 'The label displayed next to the width input'
22
+ },
18
23
  inputHeightTooltip: {
19
24
  id: 'fabric.editor.media.pixelEntry.inputHeightTooltip',
20
25
  defaultMessage: 'Height',
@@ -44,5 +49,10 @@ export const pixelEntryMessages = defineMessages({
44
49
  id: 'fabric.editor.media.pixelEntry.migrationButtonTooltip',
45
50
  defaultMessage: 'Migrate from percentage to fixed pixel sizing',
46
51
  description: 'The tooltip displayed on the migration button'
52
+ },
53
+ closePixelEntry: {
54
+ id: 'fabric.editor.media.pixelEntry.closePixelEntry',
55
+ defaultMessage: 'Close',
56
+ description: 'The text give to the close button used to close the pixel inputs and go back to main toolbar'
47
57
  }
48
58
  });
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "102.11.0";
4
+ const packageVersion = "102.11.2";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -1,6 +1,6 @@
1
1
  import { processRawFragmentValue, processRawValue, processRawValueWithoutValidation } from '../../utils/processRawValue';
2
2
  import { editorCommandToPMCommand } from '../editor-commands';
3
- import { scheduleDocumentRequest } from './requestDocument';
3
+ import { createThrottleSchedule, returnDocumentRequest } from './requestDocument';
4
4
 
5
5
  /**
6
6
  * Core plugin that is always included in the preset.
@@ -9,6 +9,8 @@ import { scheduleDocumentRequest } from './requestDocument';
9
9
  export const corePlugin = ({
10
10
  config
11
11
  }) => {
12
+ // Create the document request throttler per editor (rather than at a module level)
13
+ const scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
12
14
  return {
13
15
  name: 'core',
14
16
  actions: {
@@ -9,7 +9,7 @@ export function toJSON(node) {
9
9
  /**
10
10
  * This throttles the callback with requestIdleCallback.
11
11
  */
12
- function createThrottleSchedule(callback) {
12
+ export function createThrottleSchedule(callback) {
13
13
  let frameId;
14
14
  let lastArgs;
15
15
  const wrapperFn = (...args) => {
@@ -32,10 +32,9 @@ function createThrottleSchedule(callback) {
32
32
  };
33
33
  return wrapperFn;
34
34
  }
35
- export const scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
36
35
 
37
36
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
- function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent) {
37
+ export function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent) {
39
38
  var _editorView$state;
40
39
  const {
41
40
  doc,
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "102.11.0";
16
+ const packageVersion = "102.11.2";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -15,6 +15,11 @@ export var pixelEntryMessages = defineMessages({
15
15
  defaultMessage: 'Max width {maxWidth}px',
16
16
  description: 'The width input aria label'
17
17
  },
18
+ inputWidthLabel: {
19
+ id: 'fabric.editor.media.pixelEntry.inputWidthLabel',
20
+ defaultMessage: 'Width',
21
+ description: 'The label displayed next to the width input'
22
+ },
18
23
  inputHeightTooltip: {
19
24
  id: 'fabric.editor.media.pixelEntry.inputHeightTooltip',
20
25
  defaultMessage: 'Height',
@@ -44,5 +49,10 @@ export var pixelEntryMessages = defineMessages({
44
49
  id: 'fabric.editor.media.pixelEntry.migrationButtonTooltip',
45
50
  defaultMessage: 'Migrate from percentage to fixed pixel sizing',
46
51
  description: 'The tooltip displayed on the migration button'
52
+ },
53
+ closePixelEntry: {
54
+ id: 'fabric.editor.media.pixelEntry.closePixelEntry',
55
+ defaultMessage: 'Close',
56
+ description: 'The text give to the close button used to close the pixel inputs and go back to main toolbar'
47
57
  }
48
58
  });
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "102.11.0";
10
+ var packageVersion = "102.11.2";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -1,6 +1,6 @@
1
1
  import { processRawFragmentValue, processRawValue, processRawValueWithoutValidation } from '../../utils/processRawValue';
2
2
  import { editorCommandToPMCommand } from '../editor-commands';
3
- import { scheduleDocumentRequest } from './requestDocument';
3
+ import { createThrottleSchedule, returnDocumentRequest } from './requestDocument';
4
4
 
5
5
  /**
6
6
  * Core plugin that is always included in the preset.
@@ -8,6 +8,8 @@ import { scheduleDocumentRequest } from './requestDocument';
8
8
  */
9
9
  export var corePlugin = function corePlugin(_ref) {
10
10
  var config = _ref.config;
11
+ // Create the document request throttler per editor (rather than at a module level)
12
+ var scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
11
13
  return {
12
14
  name: 'core',
13
15
  actions: {
@@ -10,7 +10,7 @@ export function toJSON(node) {
10
10
  /**
11
11
  * This throttles the callback with requestIdleCallback.
12
12
  */
13
- function createThrottleSchedule(callback) {
13
+ export function createThrottleSchedule(callback) {
14
14
  var frameId;
15
15
  var lastArgs;
16
16
  var wrapperFn = function wrapperFn() {
@@ -36,10 +36,9 @@ function createThrottleSchedule(callback) {
36
36
  };
37
37
  return wrapperFn;
38
38
  }
39
- export var scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
40
39
 
41
40
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
- function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent) {
41
+ export function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent) {
43
42
  var _editorView$state;
44
43
  var _ref = (_editorView$state = editorView === null || editorView === void 0 ? void 0 : editorView.state) !== null && _editorView$state !== void 0 ? _editorView$state : {},
45
44
  doc = _ref.doc,
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "102.11.0";
23
+ var packageVersion = "102.11.2";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -14,6 +14,11 @@ export declare const pixelEntryMessages: {
14
14
  defaultMessage: string;
15
15
  description: string;
16
16
  };
17
+ inputWidthLabel: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
17
22
  inputHeightTooltip: {
18
23
  id: string;
19
24
  defaultMessage: string;
@@ -44,4 +49,9 @@ export declare const pixelEntryMessages: {
44
49
  defaultMessage: string;
45
50
  description: string;
46
51
  };
52
+ closePixelEntry: {
53
+ id: string;
54
+ defaultMessage: string;
55
+ description: string;
56
+ };
47
57
  };
@@ -2,6 +2,10 @@ import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
2
2
  import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import { type FireAnalyticsCallback } from '../../analytics';
5
- import type { InferTransformerResultCallback, Transformer } from '../../types';
5
+ import type { DefaultTransformerResultCallback, InferTransformerResultCallback, Transformer } from '../../types';
6
6
  export declare function toJSON(node: PMNode): JSONDocNode;
7
- export declare const scheduleDocumentRequest: <GenericTransformer extends Transformer<any> | undefined>(editorView: EditorView | null, callback: InferTransformerResultCallback<Transformer<any>>, transformer?: Transformer<any> | undefined, fireAnalyticsEvent?: FireAnalyticsCallback | undefined) => void;
7
+ /**
8
+ * This throttles the callback with requestIdleCallback.
9
+ */
10
+ export declare function createThrottleSchedule<GenericTransformer extends Transformer<any> = Transformer<JSONDocNode>>(callback: typeof returnDocumentRequest<GenericTransformer>): (editorView: EditorView | null, callback: GenericTransformer extends undefined ? DefaultTransformerResultCallback : InferTransformerResultCallback<GenericTransformer>, transformer?: GenericTransformer | undefined, fireAnalyticsEvent?: FireAnalyticsCallback | undefined) => void;
11
+ export declare function returnDocumentRequest<GenericTransformer extends Transformer<any> | undefined>(editorView: EditorView | null, callback: GenericTransformer extends undefined ? DefaultTransformerResultCallback : InferTransformerResultCallback<GenericTransformer>, transformer?: GenericTransformer, fireAnalyticsEvent?: FireAnalyticsCallback): undefined;
@@ -14,6 +14,11 @@ export declare const pixelEntryMessages: {
14
14
  defaultMessage: string;
15
15
  description: string;
16
16
  };
17
+ inputWidthLabel: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
17
22
  inputHeightTooltip: {
18
23
  id: string;
19
24
  defaultMessage: string;
@@ -44,4 +49,9 @@ export declare const pixelEntryMessages: {
44
49
  defaultMessage: string;
45
50
  description: string;
46
51
  };
52
+ closePixelEntry: {
53
+ id: string;
54
+ defaultMessage: string;
55
+ description: string;
56
+ };
47
57
  };
@@ -2,6 +2,10 @@ import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
2
2
  import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import { type FireAnalyticsCallback } from '../../analytics';
5
- import type { InferTransformerResultCallback, Transformer } from '../../types';
5
+ import type { DefaultTransformerResultCallback, InferTransformerResultCallback, Transformer } from '../../types';
6
6
  export declare function toJSON(node: PMNode): JSONDocNode;
7
- export declare const scheduleDocumentRequest: <GenericTransformer extends Transformer<any> | undefined>(editorView: EditorView | null, callback: InferTransformerResultCallback<Transformer<any>>, transformer?: Transformer<any> | undefined, fireAnalyticsEvent?: FireAnalyticsCallback | undefined) => void;
7
+ /**
8
+ * This throttles the callback with requestIdleCallback.
9
+ */
10
+ export declare function createThrottleSchedule<GenericTransformer extends Transformer<any> = Transformer<JSONDocNode>>(callback: typeof returnDocumentRequest<GenericTransformer>): (editorView: EditorView | null, callback: GenericTransformer extends undefined ? DefaultTransformerResultCallback : InferTransformerResultCallback<GenericTransformer>, transformer?: GenericTransformer | undefined, fireAnalyticsEvent?: FireAnalyticsCallback | undefined) => void;
11
+ export declare function returnDocumentRequest<GenericTransformer extends Transformer<any> | undefined>(editorView: EditorView | null, callback: GenericTransformer extends undefined ? DefaultTransformerResultCallback : InferTransformerResultCallback<GenericTransformer>, transformer?: GenericTransformer, fireAnalyticsEvent?: FireAnalyticsCallback): undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "102.11.0",
3
+ "version": "102.11.2",
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/"
@@ -152,7 +152,7 @@
152
152
  "@atlaskit/onboarding": "^13.0.0",
153
153
  "@atlaskit/platform-feature-flags": "^1.1.0",
154
154
  "@atlaskit/popper": "^7.0.0",
155
- "@atlaskit/primitives": "^14.1.0",
155
+ "@atlaskit/primitives": "^14.2.0",
156
156
  "@atlaskit/profilecard": "^23.4.0",
157
157
  "@atlaskit/section-message": "^8.2.0",
158
158
  "@atlaskit/smart-card": "^36.0.0",