@atlaskit/editor-plugin-show-diff 9.0.3 → 9.0.5

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,19 @@
1
1
  # @atlaskit/editor-plugin-show-diff
2
2
 
3
+ ## 9.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4c2645b77929d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4c2645b77929d) -
8
+ [ux] EDITOR-7346 add ai and diff plugin support for panel_c1
9
+ - Updated dependencies
10
+
11
+ ## 9.0.4
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 9.0.3
4
18
 
5
19
  ### Patch Changes
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.wrapBlockNodeView = void 0;
7
7
  var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
8
8
  var _messages = require("@atlaskit/editor-common/messages");
9
+ var _nodeTypeUtils = require("@atlaskit/editor-common/utils/node-type-utils");
9
10
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
10
11
  var _standard = require("../colorSchemes/standard");
11
12
  var _traditional = require("../colorSchemes/traditional");
@@ -230,7 +231,8 @@ var applyStylesToElement = function applyStylesToElement(_ref3) {
230
231
  isInserted = _ref3.isInserted;
231
232
  var currentStyle = element.getAttribute('style') || '';
232
233
  var contentStyle = getChangedContentStyle(colorScheme, isActive, isInserted);
233
- var nodeSpecificStyle = getChangedNodeStyle(targetNode.type.name, colorScheme, isInserted, isActive) || '';
234
+ var targetNodeName = (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? (0, _nodeTypeUtils.getBaseNodeTypeName)(targetNode.type) : targetNode.type.name;
235
+ var nodeSpecificStyle = getChangedNodeStyle(targetNodeName, colorScheme, isInserted, isActive) || '';
234
236
  element.setAttribute('style', "".concat(currentStyle).concat(contentStyle).concat(nodeSpecificStyle));
235
237
  };
236
238
  var applyMultiContainerLikeStyles = function applyMultiContainerLikeStyles(_ref4) {
@@ -240,7 +242,8 @@ var applyMultiContainerLikeStyles = function applyMultiContainerLikeStyles(_ref4
240
242
  isActive = _ref4.isActive,
241
243
  isInserted = _ref4.isInserted;
242
244
  var currentStyle = element.getAttribute('style') || '';
243
- var nodeSpecificStyle = getChangedNodeStyle(targetNode.type.name, colorScheme, isInserted, isActive) || '';
245
+ var targetNodeName = (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? (0, _nodeTypeUtils.getBaseNodeTypeName)(targetNode.type) : targetNode.type.name;
246
+ var nodeSpecificStyle = getChangedNodeStyle(targetNodeName, colorScheme, isInserted, isActive) || '';
244
247
  if (targetNode.type.name === 'decisionList') {
245
248
  element.querySelectorAll('li').forEach(function (listItem) {
246
249
  var currentListItemStyle = listItem.getAttribute('style') || '';
@@ -294,7 +297,8 @@ var createBlockNodeContentWrapper = function createBlockNodeContentWrapper(_ref6
294
297
  isActive = _ref6.isActive,
295
298
  isInserted = _ref6.isInserted;
296
299
  var contentWrapper = document.createElement('div');
297
- var nodeStyle = getChangedNodeStyle(targetNode.type.name, colorScheme, isInserted, isActive);
300
+ var targetNodeName = (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? (0, _nodeTypeUtils.getBaseNodeTypeName)(targetNode.type) : targetNode.type.name;
301
+ var nodeStyle = getChangedNodeStyle(targetNodeName, colorScheme, isInserted, isActive);
298
302
  contentWrapper.setAttribute('style', "".concat(getChangedContentStyle(colorScheme, isActive, isInserted)).concat(nodeStyle || ''));
299
303
  contentWrapper.append(nodeView);
300
304
  return contentWrapper;
@@ -410,7 +414,8 @@ var wrapBlockNode = function wrapBlockNode(_ref9) {
410
414
  _ref9$isInserted = _ref9.isInserted,
411
415
  isInserted = _ref9$isInserted === void 0 ? false : _ref9$isInserted;
412
416
  var blockWrapper = createBlockNodeWrapper();
413
- if (shouldShowRemovedLozenge(targetNode.type.name) && (!(0, _expValEquals.expValEquals)('platform_editor_diff_plugin_extended', 'isEnabled', true) || !isInserted)) {
417
+ var targetNodeName = (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? (0, _nodeTypeUtils.getBaseNodeTypeName)(targetNode.type) : targetNode.type.name;
418
+ if (shouldShowRemovedLozenge(targetNodeName) && (!(0, _expValEquals.expValEquals)('platform_editor_diff_plugin_extended', 'isEnabled', true) || !isInserted)) {
414
419
  var lozenge = createRemovedLozenge(intl, isActive, colorScheme);
415
420
  if (handleEmbedCardWithLozenge({
416
421
  dom: dom,
@@ -1,5 +1,6 @@
1
1
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
2
2
  import { trackChangesMessages } from '@atlaskit/editor-common/messages';
3
+ import { getBaseNodeTypeName } from '@atlaskit/editor-common/utils/node-type-utils';
3
4
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  import { deletedBlockOutline, deletedBlockOutlineActive, deletedBlockOutlineRounded, deletedBlockOutlineRoundedActive, deletedContentStyle, deletedContentStyleActive, deletedContentStyleNew, deletedStyleQuoteNodeWithLozenge, deletedStyleQuoteNodeWithLozengeActive, editingContentStyleInBlock, editingStyle, editingStyleActive, editingStyleNode, addedCellOverlayStyle, deletedCellOverlayStyle } from '../colorSchemes/standard';
5
6
  import { deletedTraditionalBlockOutlineActive, deletedTraditionalBlockOutlineNew, deletedTraditionalBlockOutlineRoundedActive, deletedTraditionalBlockOutlineRoundedNew, getDeletedTraditionalInlineStyle, deletedTraditionalStyleQuoteNode, deletedTraditionalStyleQuoteNodeActive, traditionalInsertStyle, traditionalInsertStyleActive, traditionalStyleNodeActive, traditionalStyleNodeNew, traditionalAddedCellOverlayStyleNew, deletedTraditionalCellOverlayStyle } from '../colorSchemes/traditional';
@@ -220,7 +221,8 @@ const applyStylesToElement = ({
220
221
  }) => {
221
222
  const currentStyle = element.getAttribute('style') || '';
222
223
  const contentStyle = getChangedContentStyle(colorScheme, isActive, isInserted);
223
- const nodeSpecificStyle = getChangedNodeStyle(targetNode.type.name, colorScheme, isInserted, isActive) || '';
224
+ const targetNodeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName(targetNode.type) : targetNode.type.name;
225
+ const nodeSpecificStyle = getChangedNodeStyle(targetNodeName, colorScheme, isInserted, isActive) || '';
224
226
  element.setAttribute('style', `${currentStyle}${contentStyle}${nodeSpecificStyle}`);
225
227
  };
226
228
  const applyMultiContainerLikeStyles = ({
@@ -231,7 +233,8 @@ const applyMultiContainerLikeStyles = ({
231
233
  isInserted
232
234
  }) => {
233
235
  const currentStyle = element.getAttribute('style') || '';
234
- const nodeSpecificStyle = getChangedNodeStyle(targetNode.type.name, colorScheme, isInserted, isActive) || '';
236
+ const targetNodeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName(targetNode.type) : targetNode.type.name;
237
+ const nodeSpecificStyle = getChangedNodeStyle(targetNodeName, colorScheme, isInserted, isActive) || '';
235
238
  if (targetNode.type.name === 'decisionList') {
236
239
  element.querySelectorAll('li').forEach(listItem => {
237
240
  const currentListItemStyle = listItem.getAttribute('style') || '';
@@ -287,7 +290,8 @@ const createBlockNodeContentWrapper = ({
287
290
  isInserted
288
291
  }) => {
289
292
  const contentWrapper = document.createElement('div');
290
- const nodeStyle = getChangedNodeStyle(targetNode.type.name, colorScheme, isInserted, isActive);
293
+ const targetNodeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName(targetNode.type) : targetNode.type.name;
294
+ const nodeStyle = getChangedNodeStyle(targetNodeName, colorScheme, isInserted, isActive);
291
295
  contentWrapper.setAttribute('style', `${getChangedContentStyle(colorScheme, isActive, isInserted)}${nodeStyle || ''}`);
292
296
  contentWrapper.append(nodeView);
293
297
  return contentWrapper;
@@ -402,7 +406,8 @@ const wrapBlockNode = ({
402
406
  isInserted = false
403
407
  }) => {
404
408
  const blockWrapper = createBlockNodeWrapper();
405
- if (shouldShowRemovedLozenge(targetNode.type.name) && (!expValEquals('platform_editor_diff_plugin_extended', 'isEnabled', true) || !isInserted)) {
409
+ const targetNodeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName(targetNode.type) : targetNode.type.name;
410
+ if (shouldShowRemovedLozenge(targetNodeName) && (!expValEquals('platform_editor_diff_plugin_extended', 'isEnabled', true) || !isInserted)) {
406
411
  const lozenge = createRemovedLozenge(intl, isActive, colorScheme);
407
412
  if (handleEmbedCardWithLozenge({
408
413
  dom,
@@ -1,5 +1,6 @@
1
1
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
2
2
  import { trackChangesMessages } from '@atlaskit/editor-common/messages';
3
+ import { getBaseNodeTypeName } from '@atlaskit/editor-common/utils/node-type-utils';
3
4
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  import { deletedBlockOutline, deletedBlockOutlineActive, deletedBlockOutlineRounded, deletedBlockOutlineRoundedActive, deletedContentStyle, deletedContentStyleActive, deletedContentStyleNew, deletedStyleQuoteNodeWithLozenge, deletedStyleQuoteNodeWithLozengeActive, editingContentStyleInBlock, editingStyle, editingStyleActive, editingStyleNode, addedCellOverlayStyle, deletedCellOverlayStyle } from '../colorSchemes/standard';
5
6
  import { deletedTraditionalBlockOutlineActive, deletedTraditionalBlockOutlineNew, deletedTraditionalBlockOutlineRoundedActive, deletedTraditionalBlockOutlineRoundedNew, getDeletedTraditionalInlineStyle, deletedTraditionalStyleQuoteNode, deletedTraditionalStyleQuoteNodeActive, traditionalInsertStyle, traditionalInsertStyleActive, traditionalStyleNodeActive, traditionalStyleNodeNew, traditionalAddedCellOverlayStyleNew, deletedTraditionalCellOverlayStyle } from '../colorSchemes/traditional';
@@ -224,7 +225,8 @@ var applyStylesToElement = function applyStylesToElement(_ref3) {
224
225
  isInserted = _ref3.isInserted;
225
226
  var currentStyle = element.getAttribute('style') || '';
226
227
  var contentStyle = getChangedContentStyle(colorScheme, isActive, isInserted);
227
- var nodeSpecificStyle = getChangedNodeStyle(targetNode.type.name, colorScheme, isInserted, isActive) || '';
228
+ var targetNodeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName(targetNode.type) : targetNode.type.name;
229
+ var nodeSpecificStyle = getChangedNodeStyle(targetNodeName, colorScheme, isInserted, isActive) || '';
228
230
  element.setAttribute('style', "".concat(currentStyle).concat(contentStyle).concat(nodeSpecificStyle));
229
231
  };
230
232
  var applyMultiContainerLikeStyles = function applyMultiContainerLikeStyles(_ref4) {
@@ -234,7 +236,8 @@ var applyMultiContainerLikeStyles = function applyMultiContainerLikeStyles(_ref4
234
236
  isActive = _ref4.isActive,
235
237
  isInserted = _ref4.isInserted;
236
238
  var currentStyle = element.getAttribute('style') || '';
237
- var nodeSpecificStyle = getChangedNodeStyle(targetNode.type.name, colorScheme, isInserted, isActive) || '';
239
+ var targetNodeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName(targetNode.type) : targetNode.type.name;
240
+ var nodeSpecificStyle = getChangedNodeStyle(targetNodeName, colorScheme, isInserted, isActive) || '';
238
241
  if (targetNode.type.name === 'decisionList') {
239
242
  element.querySelectorAll('li').forEach(function (listItem) {
240
243
  var currentListItemStyle = listItem.getAttribute('style') || '';
@@ -288,7 +291,8 @@ var createBlockNodeContentWrapper = function createBlockNodeContentWrapper(_ref6
288
291
  isActive = _ref6.isActive,
289
292
  isInserted = _ref6.isInserted;
290
293
  var contentWrapper = document.createElement('div');
291
- var nodeStyle = getChangedNodeStyle(targetNode.type.name, colorScheme, isInserted, isActive);
294
+ var targetNodeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName(targetNode.type) : targetNode.type.name;
295
+ var nodeStyle = getChangedNodeStyle(targetNodeName, colorScheme, isInserted, isActive);
292
296
  contentWrapper.setAttribute('style', "".concat(getChangedContentStyle(colorScheme, isActive, isInserted)).concat(nodeStyle || ''));
293
297
  contentWrapper.append(nodeView);
294
298
  return contentWrapper;
@@ -404,7 +408,8 @@ var wrapBlockNode = function wrapBlockNode(_ref9) {
404
408
  _ref9$isInserted = _ref9.isInserted,
405
409
  isInserted = _ref9$isInserted === void 0 ? false : _ref9$isInserted;
406
410
  var blockWrapper = createBlockNodeWrapper();
407
- if (shouldShowRemovedLozenge(targetNode.type.name) && (!expValEquals('platform_editor_diff_plugin_extended', 'isEnabled', true) || !isInserted)) {
411
+ var targetNodeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName(targetNode.type) : targetNode.type.name;
412
+ if (shouldShowRemovedLozenge(targetNodeName) && (!expValEquals('platform_editor_diff_plugin_extended', 'isEnabled', true) || !isInserted)) {
408
413
  var lozenge = createRemovedLozenge(intl, isActive, colorScheme);
409
414
  if (handleEmbedCardWithLozenge({
410
415
  dom: dom,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-show-diff",
3
- "version": "9.0.3",
3
+ "version": "9.0.5",
4
4
  "description": "ShowDiff plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,8 +35,8 @@
35
35
  "@atlaskit/editor-prosemirror": "^7.3.0",
36
36
  "@atlaskit/editor-tables": "^2.10.0",
37
37
  "@atlaskit/platform-feature-flags": "^1.1.0",
38
- "@atlaskit/tmp-editor-statsig": "^89.1.0",
39
- "@atlaskit/tokens": "^13.1.0",
38
+ "@atlaskit/tmp-editor-statsig": "^90.2.0",
39
+ "@atlaskit/tokens": "^13.3.0",
40
40
  "@babel/runtime": "^7.0.0",
41
41
  "lodash": "^4.17.21",
42
42
  "memoize-one": "^6.0.0",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/adf-utils": "^19.32.0",
47
47
  "@atlaskit/button": "^23.11.0",
48
48
  "@atlaskit/css": "^0.19.0",
49
- "@atlaskit/editor-core": "^220.1.0",
49
+ "@atlaskit/editor-core": "^220.2.0",
50
50
  "@atlaskit/editor-json-transformer": "^8.33.0",
51
51
  "@atlaskit/form": "^15.5.0",
52
52
  "@atlaskit/primitives": "^19.0.0",
@@ -59,7 +59,7 @@
59
59
  "react-intl": "^6.6.2"
60
60
  },
61
61
  "peerDependencies": {
62
- "@atlaskit/editor-common": "^115.6.0",
62
+ "@atlaskit/editor-common": "^115.7.0",
63
63
  "react": "^18.2.0"
64
64
  },
65
65
  "techstack": {