@atlaskit/editor-common 102.3.0 → 102.3.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,23 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 102.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#122826](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122826)
8
+ [`3408f60558726`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3408f60558726) -
9
+ [ux] Fixes issue where macro interaction is showing up in live view after editor API update
10
+ - Updated dependencies
11
+
12
+ ## 102.3.1
13
+
14
+ ### Patch Changes
15
+
16
+ - [#125193](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/125193)
17
+ [`246f1e93ab0d1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/246f1e93ab0d1) -
18
+ ED-26834 Fire exposure for experiment `platform_editor_nested_non_bodied_macros` when rendering a
19
+ non bodied macro rendered in a nested expand, blockquote, panel or listItem in editor
20
+
3
21
  ## 102.3.0
4
22
 
5
23
  ### Minor Changes
@@ -33,6 +33,16 @@ var aiMessages = exports.aiMessages = (0, _reactIntlNext.defineMessages)({
33
33
  defaultMessage: 'Tell Atlassian Intelligence to improve the writing of your selection',
34
34
  description: 'Tooltip text for an option to use Atlassian Intellgience to improve the writing of content currently selected by the user'
35
35
  },
36
+ askAIToolbarIconTitle: {
37
+ id: 'fabric.editor.ai.toolbar.askAI.title',
38
+ defaultMessage: 'Ask AI',
39
+ description: 'Title for an option to use Atlassian Intellgience'
40
+ },
41
+ askAIToolbarIconTooltip: {
42
+ id: 'fabric.editor.ai.toolbar.tryAI.tooltip',
43
+ defaultMessage: 'Open Atlassian Intelligence',
44
+ description: 'Tooltip text for an option to use Atlassian Intellgience'
45
+ },
36
46
  tryAIToolbarIconTitle: {
37
47
  id: 'fabric.editor.ai.toolbar.tryAI.title',
38
48
  defaultMessage: 'Try AI',
@@ -13,6 +13,7 @@ var _react = _interopRequireWildcard(require("react"));
13
13
  var _react2 = require("@emotion/react");
14
14
  var _classnames2 = _interopRequireDefault(require("classnames"));
15
15
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
16
17
  var _hooks = require("../../../hooks");
17
18
  var _ui = require("../../../ui");
18
19
  var _utils = require("../../../utils");
@@ -125,6 +126,30 @@ function ExtensionWithPluginState(props) {
125
126
  setIsNodeHovered(didHover);
126
127
  }
127
128
  };
129
+ var shouldFireNbmExperimentExposure = _react.default.useMemo(function () {
130
+ if (node.type.name === 'extension' && typeof getPos === 'function') {
131
+ var pos = getPos();
132
+ if (!isNaN(pos)) {
133
+ var _view$state$doc$resol;
134
+ var parentNameType = (_view$state$doc$resol = view.state.doc.resolve(pos).parent) === null || _view$state$doc$resol === void 0 || (_view$state$doc$resol = _view$state$doc$resol.type) === null || _view$state$doc$resol === void 0 ? void 0 : _view$state$doc$resol.name;
135
+ if (['listItem', 'nestedExpand', 'blockquote', 'panel'].includes(parentNameType)) {
136
+ return true;
137
+ }
138
+ }
139
+ }
140
+ return false;
141
+ }, [node, getPos, view]);
142
+ (0, _react.useEffect)(function () {
143
+ if (shouldFireNbmExperimentExposure) {
144
+ // No-op editorExperiment evaluation to track usage of nested non-bodied macros
145
+ // these can't be tracked at the point of diversion of the experience because that is a toggle of the
146
+ // ProseMirror schema nodes for listItems, nestedExpand, blockquote, and panel. At that point the customer
147
+ // has not yet been exposed
148
+ (0, _experiments.editorExperiment)('platform_editor_nested_non_bodied_macros', 'test', {
149
+ exposure: true
150
+ });
151
+ }
152
+ }, [shouldFireNbmExperimentExposure]);
128
153
  return (0, _react2.jsx)(_react.Fragment, null, showMacroInteractionDesignUpdates && !isLivePageViewMode && (0, _react2.jsx)(_Lozenge.default, {
129
154
  isNodeSelected: isNodeSelected,
130
155
  isNodeHovered: isNodeHovered,
@@ -207,6 +232,7 @@ var Extension = function Extension(props) {
207
232
  var pluginInjectionApi = props.pluginInjectionApi;
208
233
  var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['width']),
209
234
  widthState = _useSharedPluginState.widthState;
235
+
210
236
  // Ignored via go/ees005
211
237
  // eslint-disable-next-line react/jsx-props-no-spreading
212
238
  return (0, _react2.jsx)(ExtensionWithPluginState, (0, _extends2.default)({
@@ -49,8 +49,9 @@ var Extension = exports.Extension = /*#__PURE__*/function (_Component) {
49
49
  // @ts-ignore
50
50
  var currentState = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 || (_pluginInjectionApi$e = _pluginInjectionApi$e.sharedState) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.currentState();
51
51
  var _ref2 = currentState || {},
52
- contentMode = _ref2.contentMode;
53
- var isLivePageViewMode = contentMode === 'live-view';
52
+ contentMode = _ref2.contentMode,
53
+ mode = _ref2.mode;
54
+ var isLivePageViewMode = contentMode === 'live-view' || mode === 'view';
54
55
  return /*#__PURE__*/_react.default.createElement(_ExtensionComponent.ExtensionComponent, {
55
56
  editorView: editorView,
56
57
  node: node,
@@ -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.3.0";
20
+ var packageVersion = "102.3.2";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // Ignored via go/ees007
@@ -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.3.0";
26
+ var packageVersion = "102.3.2";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -27,6 +27,16 @@ export const aiMessages = defineMessages({
27
27
  defaultMessage: 'Tell Atlassian Intelligence to improve the writing of your selection',
28
28
  description: 'Tooltip text for an option to use Atlassian Intellgience to improve the writing of content currently selected by the user'
29
29
  },
30
+ askAIToolbarIconTitle: {
31
+ id: 'fabric.editor.ai.toolbar.askAI.title',
32
+ defaultMessage: 'Ask AI',
33
+ description: 'Title for an option to use Atlassian Intellgience'
34
+ },
35
+ askAIToolbarIconTooltip: {
36
+ id: 'fabric.editor.ai.toolbar.tryAI.tooltip',
37
+ defaultMessage: 'Open Atlassian Intelligence',
38
+ description: 'Tooltip text for an option to use Atlassian Intellgience'
39
+ },
30
40
  tryAIToolbarIconTitle: {
31
41
  id: 'fabric.editor.ai.toolbar.tryAI.title',
32
42
  defaultMessage: 'Try AI',
@@ -4,12 +4,13 @@ import _extends from "@babel/runtime/helpers/extends";
4
4
  * @jsx jsx
5
5
  */
6
6
 
7
- import React, { Fragment } from 'react';
7
+ import React, { Fragment, useEffect } from 'react';
8
8
 
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { jsx } from '@emotion/react';
11
11
  import classnames from 'classnames';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
13
14
  import { useSharedPluginState } from '../../../hooks';
14
15
  import { overflowShadow } from '../../../ui';
15
16
  import { calculateBreakoutStyles } from '../../../utils';
@@ -123,6 +124,30 @@ function ExtensionWithPluginState(props) {
123
124
  setIsNodeHovered(didHover);
124
125
  }
125
126
  };
127
+ const shouldFireNbmExperimentExposure = React.useMemo(() => {
128
+ if (node.type.name === 'extension' && typeof getPos === 'function') {
129
+ const pos = getPos();
130
+ if (!isNaN(pos)) {
131
+ var _view$state$doc$resol, _view$state$doc$resol2;
132
+ const parentNameType = (_view$state$doc$resol = view.state.doc.resolve(pos).parent) === null || _view$state$doc$resol === void 0 ? void 0 : (_view$state$doc$resol2 = _view$state$doc$resol.type) === null || _view$state$doc$resol2 === void 0 ? void 0 : _view$state$doc$resol2.name;
133
+ if (['listItem', 'nestedExpand', 'blockquote', 'panel'].includes(parentNameType)) {
134
+ return true;
135
+ }
136
+ }
137
+ }
138
+ return false;
139
+ }, [node, getPos, view]);
140
+ useEffect(() => {
141
+ if (shouldFireNbmExperimentExposure) {
142
+ // No-op editorExperiment evaluation to track usage of nested non-bodied macros
143
+ // these can't be tracked at the point of diversion of the experience because that is a toggle of the
144
+ // ProseMirror schema nodes for listItems, nestedExpand, blockquote, and panel. At that point the customer
145
+ // has not yet been exposed
146
+ editorExperiment('platform_editor_nested_non_bodied_macros', 'test', {
147
+ exposure: true
148
+ });
149
+ }
150
+ }, [shouldFireNbmExperimentExposure]);
126
151
  return jsx(Fragment, null, showMacroInteractionDesignUpdates && !isLivePageViewMode && jsx(ExtensionLozenge, {
127
152
  isNodeSelected: isNodeSelected,
128
153
  isNodeHovered: isNodeHovered,
@@ -204,6 +229,7 @@ const Extension = props => {
204
229
  const {
205
230
  widthState
206
231
  } = useSharedPluginState(pluginInjectionApi, ['width']);
232
+
207
233
  // Ignored via go/ees005
208
234
  // eslint-disable-next-line react/jsx-props-no-spreading
209
235
  return jsx(ExtensionWithPluginState, _extends({
@@ -32,9 +32,10 @@ export class Extension extends Component {
32
32
  // @ts-ignore
33
33
  const currentState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 ? void 0 : (_pluginInjectionApi$e2 = _pluginInjectionApi$e.sharedState) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.currentState();
34
34
  const {
35
- contentMode
35
+ contentMode,
36
+ mode
36
37
  } = currentState || {};
37
- const isLivePageViewMode = contentMode === 'live-view';
38
+ const isLivePageViewMode = contentMode === 'live-view' || mode === 'view';
38
39
  return /*#__PURE__*/React.createElement(ExtensionComponent, {
39
40
  editorView: editorView,
40
41
  node: node,
@@ -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.3.0";
4
+ const packageVersion = "102.3.2";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -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.3.0";
16
+ const packageVersion = "102.3.2";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -27,6 +27,16 @@ export var aiMessages = defineMessages({
27
27
  defaultMessage: 'Tell Atlassian Intelligence to improve the writing of your selection',
28
28
  description: 'Tooltip text for an option to use Atlassian Intellgience to improve the writing of content currently selected by the user'
29
29
  },
30
+ askAIToolbarIconTitle: {
31
+ id: 'fabric.editor.ai.toolbar.askAI.title',
32
+ defaultMessage: 'Ask AI',
33
+ description: 'Title for an option to use Atlassian Intellgience'
34
+ },
35
+ askAIToolbarIconTooltip: {
36
+ id: 'fabric.editor.ai.toolbar.tryAI.tooltip',
37
+ defaultMessage: 'Open Atlassian Intelligence',
38
+ description: 'Tooltip text for an option to use Atlassian Intellgience'
39
+ },
30
40
  tryAIToolbarIconTitle: {
31
41
  id: 'fabric.editor.ai.toolbar.tryAI.title',
32
42
  defaultMessage: 'Try AI',
@@ -9,12 +9,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
9
9
  * @jsx jsx
10
10
  */
11
11
 
12
- import React, { Fragment } from 'react';
12
+ import React, { Fragment, useEffect } from 'react';
13
13
 
14
14
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
15
15
  import { jsx } from '@emotion/react';
16
16
  import classnames from 'classnames';
17
17
  import { fg } from '@atlaskit/platform-feature-flags';
18
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
18
19
  import { useSharedPluginState } from '../../../hooks';
19
20
  import { overflowShadow } from '../../../ui';
20
21
  import { calculateBreakoutStyles } from '../../../utils';
@@ -117,6 +118,30 @@ function ExtensionWithPluginState(props) {
117
118
  setIsNodeHovered(didHover);
118
119
  }
119
120
  };
121
+ var shouldFireNbmExperimentExposure = React.useMemo(function () {
122
+ if (node.type.name === 'extension' && typeof getPos === 'function') {
123
+ var pos = getPos();
124
+ if (!isNaN(pos)) {
125
+ var _view$state$doc$resol;
126
+ var parentNameType = (_view$state$doc$resol = view.state.doc.resolve(pos).parent) === null || _view$state$doc$resol === void 0 || (_view$state$doc$resol = _view$state$doc$resol.type) === null || _view$state$doc$resol === void 0 ? void 0 : _view$state$doc$resol.name;
127
+ if (['listItem', 'nestedExpand', 'blockquote', 'panel'].includes(parentNameType)) {
128
+ return true;
129
+ }
130
+ }
131
+ }
132
+ return false;
133
+ }, [node, getPos, view]);
134
+ useEffect(function () {
135
+ if (shouldFireNbmExperimentExposure) {
136
+ // No-op editorExperiment evaluation to track usage of nested non-bodied macros
137
+ // these can't be tracked at the point of diversion of the experience because that is a toggle of the
138
+ // ProseMirror schema nodes for listItems, nestedExpand, blockquote, and panel. At that point the customer
139
+ // has not yet been exposed
140
+ editorExperiment('platform_editor_nested_non_bodied_macros', 'test', {
141
+ exposure: true
142
+ });
143
+ }
144
+ }, [shouldFireNbmExperimentExposure]);
120
145
  return jsx(Fragment, null, showMacroInteractionDesignUpdates && !isLivePageViewMode && jsx(ExtensionLozenge, {
121
146
  isNodeSelected: isNodeSelected,
122
147
  isNodeHovered: isNodeHovered,
@@ -199,6 +224,7 @@ var Extension = function Extension(props) {
199
224
  var pluginInjectionApi = props.pluginInjectionApi;
200
225
  var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['width']),
201
226
  widthState = _useSharedPluginState.widthState;
227
+
202
228
  // Ignored via go/ees005
203
229
  // eslint-disable-next-line react/jsx-props-no-spreading
204
230
  return jsx(ExtensionWithPluginState, _extends({
@@ -39,8 +39,9 @@ export var Extension = /*#__PURE__*/function (_Component) {
39
39
  // @ts-ignore
40
40
  var currentState = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 || (_pluginInjectionApi$e = _pluginInjectionApi$e.sharedState) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.currentState();
41
41
  var _ref2 = currentState || {},
42
- contentMode = _ref2.contentMode;
43
- var isLivePageViewMode = contentMode === 'live-view';
42
+ contentMode = _ref2.contentMode,
43
+ mode = _ref2.mode;
44
+ var isLivePageViewMode = contentMode === 'live-view' || mode === 'view';
44
45
  return /*#__PURE__*/React.createElement(ExtensionComponent, {
45
46
  editorView: editorView,
46
47
  node: node,
@@ -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.3.0";
10
+ var packageVersion = "102.3.2";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -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.3.0";
23
+ var packageVersion = "102.3.2";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -24,6 +24,16 @@ export declare const aiMessages: {
24
24
  defaultMessage: string;
25
25
  description: string;
26
26
  };
27
+ askAIToolbarIconTitle: {
28
+ id: string;
29
+ defaultMessage: string;
30
+ description: string;
31
+ };
32
+ askAIToolbarIconTooltip: {
33
+ id: string;
34
+ defaultMessage: string;
35
+ description: string;
36
+ };
27
37
  tryAIToolbarIconTitle: {
28
38
  id: string;
29
39
  defaultMessage: string;
@@ -24,6 +24,16 @@ export declare const aiMessages: {
24
24
  defaultMessage: string;
25
25
  description: string;
26
26
  };
27
+ askAIToolbarIconTitle: {
28
+ id: string;
29
+ defaultMessage: string;
30
+ description: string;
31
+ };
32
+ askAIToolbarIconTooltip: {
33
+ id: string;
34
+ defaultMessage: string;
35
+ description: string;
36
+ };
27
37
  tryAIToolbarIconTitle: {
28
38
  id: string;
29
39
  defaultMessage: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "102.3.0",
3
+ "version": "102.3.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/"
@@ -161,7 +161,7 @@
161
161
  "@atlaskit/task-decision": "^19.0.0",
162
162
  "@atlaskit/textfield": "^8.0.0",
163
163
  "@atlaskit/tmp-editor-statsig": "^3.5.0",
164
- "@atlaskit/tokens": "^4.3.0",
164
+ "@atlaskit/tokens": "^4.4.0",
165
165
  "@atlaskit/tooltip": "^20.0.0",
166
166
  "@atlaskit/width-detector": "^5.0.0",
167
167
  "@babel/runtime": "^7.0.0",