@atlaskit/editor-common 107.14.0 → 107.16.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,29 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 107.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`15e6a5bb98ed5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/15e6a5bb98ed5) -
8
+ ED-28780 fix pref url in isolated cloud
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 107.15.0
15
+
16
+ ### Minor Changes
17
+
18
+ - [#193468](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/193468)
19
+ [`e626b68cc9c4c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e626b68cc9c4c) -
20
+ [ux] [CONFCLOUD-82368] Hide layout resize handles until interaction instead of unrendering to
21
+ prevent rerenders of content inside layouts
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+
3
27
  ## 107.14.0
4
28
 
5
29
  ### Minor Changes
@@ -7,8 +7,12 @@ exports.getLinkPreferencesURLFromENV = exports.getActiveLinkMark = void 0;
7
7
  exports.isLinkAtPos = isLinkAtPos;
8
8
  exports.isTextAtPos = isTextAtPos;
9
9
  var _atlassianContext = require("@atlaskit/atlassian-context");
10
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
11
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
11
12
  var _constants = require("./constants");
13
+ var STAGING = 'staging';
14
+ var PRODUCTION = 'prod';
15
+ var DEV = 'dev';
12
16
  function isTextAtPos(pos) {
13
17
  return function (_ref) {
14
18
  var tr = _ref.tr;
@@ -23,6 +27,10 @@ function isLinkAtPos(pos) {
23
27
  };
24
28
  }
25
29
  var getLinkPreferencesURLFromENV = exports.getLinkPreferencesURLFromENV = function getLinkPreferencesURLFromENV() {
30
+ if ((0, _platformFeatureFlags.fg)('platform_fix_preferences_url_in_isolated_cloud')) {
31
+ var envType = process.env.CLOUD_ENV === 'staging' ? STAGING : PRODUCTION;
32
+ return (0, _atlassianContext.getDomainInContext)('id', envType) + _constants.linkPreferencesPath;
33
+ }
26
34
  return (0, _atlassianContext.getATLContextUrl)('id') + _constants.linkPreferencesPath;
27
35
  };
28
36
  var isSelectionInsideLink = function isSelectionInsideLink(state) {
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
16
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
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 = "107.13.1";
19
+ var packageVersion = "107.15.0";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // Ignored via go/ees007
@@ -21,8 +21,18 @@ var _ResizerBreakoutModeLabel = require("./ResizerBreakoutModeLabel");
21
21
  var _useBreakoutGuidelines = require("./useBreakoutGuidelines");
22
22
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
23
23
  var breakoutSupportedNodes = ['layoutSection', 'expand', 'codeBlock'];
24
- var getHandleStyle = function getHandleStyle(node) {
24
+ var getHandleStyle = function getHandleStyle(node, hidden) {
25
25
  var layoutMarginOffset = 12;
26
+ if (hidden) {
27
+ return {
28
+ left: {
29
+ display: 'none'
30
+ },
31
+ right: {
32
+ display: 'none'
33
+ }
34
+ };
35
+ }
26
36
  switch (node) {
27
37
  case 'codeBlock':
28
38
  return {
@@ -94,6 +104,7 @@ var RESIZE_STEP_VALUE = 10;
94
104
  * @param root0.displayGapCursor
95
105
  * @param root0.onResizeStart
96
106
  * @param root0.dynamicFullWidthGuidelineOffset
107
+ * @param root0.hidden Hide the resizer handles without outright unrendering them
97
108
  * @returns BreakoutResizer component
98
109
  * @example
99
110
  */
@@ -109,7 +120,9 @@ var BreakoutResizer = exports.BreakoutResizer = function BreakoutResizer(_ref) {
109
120
  editorAnalyticsApi = _ref.editorAnalyticsApi,
110
121
  displayGapCursor = _ref.displayGapCursor,
111
122
  onResizeStart = _ref.onResizeStart,
112
- dynamicFullWidthGuidelineOffset = _ref.dynamicFullWidthGuidelineOffset;
123
+ dynamicFullWidthGuidelineOffset = _ref.dynamicFullWidthGuidelineOffset,
124
+ _ref$hidden = _ref.hidden,
125
+ hidden = _ref$hidden === void 0 ? false : _ref$hidden;
113
126
  var _useState = (0, _react.useState)({
114
127
  minWidth: undefined,
115
128
  maxWidth: undefined,
@@ -329,7 +342,7 @@ var BreakoutResizer = exports.BreakoutResizer = function BreakoutResizer(_ref) {
329
342
  },
330
343
  snap: snaps || undefined,
331
344
  snapGap: _useBreakoutGuidelines.SNAP_GAP,
332
- handleStyles: getHandleStyle(nodeType),
345
+ handleStyles: getHandleStyle(nodeType, hidden),
333
346
  minWidth: minWidth,
334
347
  maxWidth: maxWidth
335
348
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
@@ -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 = "107.13.1";
26
+ var packageVersion = "107.15.0";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -1,6 +1,10 @@
1
- import { getATLContextUrl } from '@atlaskit/atlassian-context';
1
+ import { getATLContextUrl, getDomainInContext } from '@atlaskit/atlassian-context';
2
+ import { fg } from '@atlaskit/platform-feature-flags';
2
3
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
4
  import { linkPreferencesPath } from './constants';
5
+ const STAGING = 'staging';
6
+ const PRODUCTION = 'prod';
7
+ const DEV = 'dev';
4
8
  export function isTextAtPos(pos) {
5
9
  return ({
6
10
  tr
@@ -16,6 +20,10 @@ export function isLinkAtPos(pos) {
16
20
  };
17
21
  }
18
22
  export const getLinkPreferencesURLFromENV = () => {
23
+ if (fg('platform_fix_preferences_url_in_isolated_cloud')) {
24
+ const envType = process.env.CLOUD_ENV === 'staging' ? STAGING : PRODUCTION;
25
+ return getDomainInContext('id', envType) + linkPreferencesPath;
26
+ }
19
27
  return getATLContextUrl('id') + linkPreferencesPath;
20
28
  };
21
29
  const isSelectionInsideLink = state => !!state.doc.type.schema.marks.link.isInSet(state.selection.$from.marks());
@@ -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 = "107.13.1";
4
+ const packageVersion = "107.15.0";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -11,8 +11,18 @@ import Resizer from './Resizer';
11
11
  import { ResizerBreakoutModeLabel } from './ResizerBreakoutModeLabel';
12
12
  import { SNAP_GAP, useBreakoutGuidelines } from './useBreakoutGuidelines';
13
13
  const breakoutSupportedNodes = ['layoutSection', 'expand', 'codeBlock'];
14
- const getHandleStyle = node => {
14
+ const getHandleStyle = (node, hidden) => {
15
15
  const layoutMarginOffset = 12;
16
+ if (hidden) {
17
+ return {
18
+ left: {
19
+ display: 'none'
20
+ },
21
+ right: {
22
+ display: 'none'
23
+ }
24
+ };
25
+ }
16
26
  switch (node) {
17
27
  case 'codeBlock':
18
28
  return {
@@ -84,6 +94,7 @@ const RESIZE_STEP_VALUE = 10;
84
94
  * @param root0.displayGapCursor
85
95
  * @param root0.onResizeStart
86
96
  * @param root0.dynamicFullWidthGuidelineOffset
97
+ * @param root0.hidden Hide the resizer handles without outright unrendering them
87
98
  * @returns BreakoutResizer component
88
99
  * @example
89
100
  */
@@ -99,7 +110,8 @@ const BreakoutResizer = ({
99
110
  editorAnalyticsApi,
100
111
  displayGapCursor,
101
112
  onResizeStart,
102
- dynamicFullWidthGuidelineOffset
113
+ dynamicFullWidthGuidelineOffset,
114
+ hidden = false
103
115
  }) => {
104
116
  const [{
105
117
  minWidth,
@@ -324,7 +336,7 @@ const BreakoutResizer = ({
324
336
  },
325
337
  snap: snaps || undefined,
326
338
  snapGap: SNAP_GAP,
327
- handleStyles: getHandleStyle(nodeType),
339
+ handleStyles: getHandleStyle(nodeType, hidden),
328
340
  minWidth: minWidth,
329
341
  maxWidth: maxWidth
330
342
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
@@ -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 = "107.13.1";
16
+ const packageVersion = "107.15.0";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -1,6 +1,10 @@
1
- import { getATLContextUrl } from '@atlaskit/atlassian-context';
1
+ import { getATLContextUrl, getDomainInContext } from '@atlaskit/atlassian-context';
2
+ import { fg } from '@atlaskit/platform-feature-flags';
2
3
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
4
  import { linkPreferencesPath } from './constants';
5
+ var STAGING = 'staging';
6
+ var PRODUCTION = 'prod';
7
+ var DEV = 'dev';
4
8
  export function isTextAtPos(pos) {
5
9
  return function (_ref) {
6
10
  var tr = _ref.tr;
@@ -15,6 +19,10 @@ export function isLinkAtPos(pos) {
15
19
  };
16
20
  }
17
21
  export var getLinkPreferencesURLFromENV = function getLinkPreferencesURLFromENV() {
22
+ if (fg('platform_fix_preferences_url_in_isolated_cloud')) {
23
+ var envType = process.env.CLOUD_ENV === 'staging' ? STAGING : PRODUCTION;
24
+ return getDomainInContext('id', envType) + linkPreferencesPath;
25
+ }
18
26
  return getATLContextUrl('id') + linkPreferencesPath;
19
27
  };
20
28
  var isSelectionInsideLink = function isSelectionInsideLink(state) {
@@ -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 = "107.13.1";
10
+ var packageVersion = "107.15.0";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -12,8 +12,18 @@ import Resizer from './Resizer';
12
12
  import { ResizerBreakoutModeLabel } from './ResizerBreakoutModeLabel';
13
13
  import { SNAP_GAP, useBreakoutGuidelines } from './useBreakoutGuidelines';
14
14
  var breakoutSupportedNodes = ['layoutSection', 'expand', 'codeBlock'];
15
- var getHandleStyle = function getHandleStyle(node) {
15
+ var getHandleStyle = function getHandleStyle(node, hidden) {
16
16
  var layoutMarginOffset = 12;
17
+ if (hidden) {
18
+ return {
19
+ left: {
20
+ display: 'none'
21
+ },
22
+ right: {
23
+ display: 'none'
24
+ }
25
+ };
26
+ }
17
27
  switch (node) {
18
28
  case 'codeBlock':
19
29
  return {
@@ -85,6 +95,7 @@ var RESIZE_STEP_VALUE = 10;
85
95
  * @param root0.displayGapCursor
86
96
  * @param root0.onResizeStart
87
97
  * @param root0.dynamicFullWidthGuidelineOffset
98
+ * @param root0.hidden Hide the resizer handles without outright unrendering them
88
99
  * @returns BreakoutResizer component
89
100
  * @example
90
101
  */
@@ -100,7 +111,9 @@ var BreakoutResizer = function BreakoutResizer(_ref) {
100
111
  editorAnalyticsApi = _ref.editorAnalyticsApi,
101
112
  displayGapCursor = _ref.displayGapCursor,
102
113
  onResizeStart = _ref.onResizeStart,
103
- dynamicFullWidthGuidelineOffset = _ref.dynamicFullWidthGuidelineOffset;
114
+ dynamicFullWidthGuidelineOffset = _ref.dynamicFullWidthGuidelineOffset,
115
+ _ref$hidden = _ref.hidden,
116
+ hidden = _ref$hidden === void 0 ? false : _ref$hidden;
104
117
  var _useState = useState({
105
118
  minWidth: undefined,
106
119
  maxWidth: undefined,
@@ -320,7 +333,7 @@ var BreakoutResizer = function BreakoutResizer(_ref) {
320
333
  },
321
334
  snap: snaps || undefined,
322
335
  snapGap: SNAP_GAP,
323
- handleStyles: getHandleStyle(nodeType),
336
+ handleStyles: getHandleStyle(nodeType, hidden),
324
337
  minWidth: minWidth,
325
338
  maxWidth: maxWidth
326
339
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
@@ -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 = "107.13.1";
23
+ var packageVersion = "107.15.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -21,6 +21,7 @@ type BreakoutResizerProps = {
21
21
  displayGapCursor: (toggle: boolean) => boolean;
22
22
  onResizeStart?: () => void;
23
23
  dynamicFullWidthGuidelineOffset?: number;
24
+ hidden?: boolean;
24
25
  };
25
26
  /**
26
27
  * BreakoutResizer is a common component used to resize nodes that support the 'Breakout' mark, so it requires
@@ -40,8 +41,9 @@ type BreakoutResizerProps = {
40
41
  * @param root0.displayGapCursor
41
42
  * @param root0.onResizeStart
42
43
  * @param root0.dynamicFullWidthGuidelineOffset
44
+ * @param root0.hidden Hide the resizer handles without outright unrendering them
43
45
  * @returns BreakoutResizer component
44
46
  * @example
45
47
  */
46
- declare const BreakoutResizer: ({ editorView, nodeType, getPos, getRef, disabled, getEditorWidth, parentRef, displayGuidelines, editorAnalyticsApi, displayGapCursor, onResizeStart, dynamicFullWidthGuidelineOffset, }: BreakoutResizerProps) => React.JSX.Element;
48
+ declare const BreakoutResizer: ({ editorView, nodeType, getPos, getRef, disabled, getEditorWidth, parentRef, displayGuidelines, editorAnalyticsApi, displayGapCursor, onResizeStart, dynamicFullWidthGuidelineOffset, hidden, }: BreakoutResizerProps) => React.JSX.Element;
47
49
  export { BreakoutResizer };
@@ -21,6 +21,7 @@ type BreakoutResizerProps = {
21
21
  displayGapCursor: (toggle: boolean) => boolean;
22
22
  onResizeStart?: () => void;
23
23
  dynamicFullWidthGuidelineOffset?: number;
24
+ hidden?: boolean;
24
25
  };
25
26
  /**
26
27
  * BreakoutResizer is a common component used to resize nodes that support the 'Breakout' mark, so it requires
@@ -40,8 +41,9 @@ type BreakoutResizerProps = {
40
41
  * @param root0.displayGapCursor
41
42
  * @param root0.onResizeStart
42
43
  * @param root0.dynamicFullWidthGuidelineOffset
44
+ * @param root0.hidden Hide the resizer handles without outright unrendering them
43
45
  * @returns BreakoutResizer component
44
46
  * @example
45
47
  */
46
- declare const BreakoutResizer: ({ editorView, nodeType, getPos, getRef, disabled, getEditorWidth, parentRef, displayGuidelines, editorAnalyticsApi, displayGapCursor, onResizeStart, dynamicFullWidthGuidelineOffset, }: BreakoutResizerProps) => React.JSX.Element;
48
+ declare const BreakoutResizer: ({ editorView, nodeType, getPos, getRef, disabled, getEditorWidth, parentRef, displayGuidelines, editorAnalyticsApi, displayGapCursor, onResizeStart, dynamicFullWidthGuidelineOffset, hidden, }: BreakoutResizerProps) => React.JSX.Element;
47
49
  export { BreakoutResizer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "107.14.0",
3
+ "version": "107.16.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/"
@@ -161,7 +161,7 @@
161
161
  "@atlaskit/platform-feature-flags-react": "^0.2.0",
162
162
  "@atlaskit/popper": "^7.1.0",
163
163
  "@atlaskit/primitives": "^14.11.0",
164
- "@atlaskit/profilecard": "^23.21.0",
164
+ "@atlaskit/profilecard": "^24.0.0",
165
165
  "@atlaskit/react-ufo": "^4.1.0",
166
166
  "@atlaskit/section-message": "^8.5.0",
167
167
  "@atlaskit/smart-card": "^40.6.0",
@@ -171,7 +171,7 @@
171
171
  "@atlaskit/task-decision": "^19.2.0",
172
172
  "@atlaskit/textfield": "^8.0.0",
173
173
  "@atlaskit/theme": "^19.0.0",
174
- "@atlaskit/tmp-editor-statsig": "^9.18.0",
174
+ "@atlaskit/tmp-editor-statsig": "^9.20.0",
175
175
  "@atlaskit/tokens": "^5.6.0",
176
176
  "@atlaskit/tooltip": "^20.4.0",
177
177
  "@atlaskit/width-detector": "^5.0.0",
@@ -354,6 +354,9 @@
354
354
  "platform_editor_legacy_content_macro_visual_update": {
355
355
  "type": "boolean"
356
356
  },
357
+ "platform_fix_preferences_url_in_isolated_cloud": {
358
+ "type": "boolean"
359
+ },
357
360
  "platform_editor_find_and_replace_improvements_1": {
358
361
  "type": "boolean"
359
362
  },