@atlaskit/adf-utils 19.32.9 → 19.33.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,24 @@
1
1
  # @atlaskit/adf-utils
2
2
 
3
+ ## 19.33.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`38d753a24e9ad`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38d753a24e9ad) -
8
+ Promote code block wrap and line number attrs to the full ADF schema
9
+
10
+ ### Patch Changes
11
+
12
+ - [`8f894bdeea3a0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8f894bdeea3a0) -
13
+ Add analytics event for panel_c1 transformation
14
+ - Updated dependencies
15
+
16
+ ## 19.32.10
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
3
22
  ## 19.32.9
4
23
 
5
24
  ### Patch Changes
@@ -35,6 +35,7 @@ var getPanelC1AllowedParentTypes = function getPanelC1AllowedParentTypes(schema)
35
35
  */
36
36
  var transformContainerNodes = exports.transformContainerNodes = function transformContainerNodes(adf, schema) {
37
37
  var isTransformed = false;
38
+ var transformedNodeTypes = new Set();
38
39
  var panelC1AllowedParents = getPanelC1AllowedParentTypes(schema);
39
40
  var transformedAdf = (0, _traverse.traverse)(adf, {
40
41
  panel: function panel(node, parent) {
@@ -42,6 +43,7 @@ var transformContainerNodes = exports.transformContainerNodes = function transfo
42
43
  var parentType = (_parent$node = parent.node) === null || _parent$node === void 0 ? void 0 : _parent$node.type;
43
44
  if (parentType && panelC1AllowedParents.has(parentType)) {
44
45
  isTransformed = true;
46
+ transformedNodeTypes.add('panel_c1');
45
47
  return _objectSpread(_objectSpread({}, node), {}, {
46
48
  type: 'panel_c1'
47
49
  });
@@ -51,6 +53,7 @@ var transformContainerNodes = exports.transformContainerNodes = function transfo
51
53
  });
52
54
  return {
53
55
  transformedAdf: transformedAdf,
54
- isTransformed: isTransformed
56
+ isTransformed: isTransformed,
57
+ transformedNodeTypes: Array.from(transformedNodeTypes)
55
58
  };
56
59
  };
@@ -111,18 +111,6 @@ Object.defineProperty(exports, "codeBlock_root_only", {
111
111
  return _schemaValidator.codeBlock_root_only;
112
112
  }
113
113
  });
114
- Object.defineProperty(exports, "codeBlock_root_only_with_extended_attributes", {
115
- enumerable: true,
116
- get: function get() {
117
- return _schemaValidator.codeBlock_root_only_with_extended_attributes;
118
- }
119
- });
120
- Object.defineProperty(exports, "codeBlock_with_extended_attributes", {
121
- enumerable: true,
122
- get: function get() {
123
- return _schemaValidator.codeBlock_with_extended_attributes;
124
- }
125
- });
126
114
  Object.defineProperty(exports, "confluenceInlineComment", {
127
115
  enumerable: true,
128
116
  get: function get() {
@@ -16,7 +16,6 @@ var specs = _interopRequireWildcard(require("./specs"));
16
16
  var _utils = require("./utils");
17
17
  var _extractAllowedContent = require("./extractAllowedContent");
18
18
  var _rules = require("./rules");
19
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
20
19
  var _excluded = ["items"]; // Ignored via go/ees005
21
20
  // eslint-disable-next-line import/no-namespace
22
21
  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" != _typeof3(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); }
@@ -356,11 +355,7 @@ var unsupportedNodeAttributesContent = function unsupportedNodeAttributesContent
356
355
  * under the base spec must also be valid under the variant.
357
356
  */
358
357
  var getVariantSpecOverrides = function getVariantSpecOverrides() {
359
- var overrides = {};
360
- if ((0, _expValEquals.expValEquals)('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
361
- overrides.codeBlock = 'codeBlock_with_extended_attributes';
362
- }
363
- return overrides;
358
+ return {};
364
359
  };
365
360
 
366
361
  /**
@@ -25,6 +25,7 @@ const getPanelC1AllowedParentTypes = schema => {
25
25
  */
26
26
  export const transformContainerNodes = (adf, schema) => {
27
27
  let isTransformed = false;
28
+ const transformedNodeTypes = new Set();
28
29
  const panelC1AllowedParents = getPanelC1AllowedParentTypes(schema);
29
30
  const transformedAdf = traverse(adf, {
30
31
  panel: (node, parent) => {
@@ -32,6 +33,7 @@ export const transformContainerNodes = (adf, schema) => {
32
33
  const parentType = (_parent$node = parent.node) === null || _parent$node === void 0 ? void 0 : _parent$node.type;
33
34
  if (parentType && panelC1AllowedParents.has(parentType)) {
34
35
  isTransformed = true;
36
+ transformedNodeTypes.add('panel_c1');
35
37
  return {
36
38
  ...node,
37
39
  type: 'panel_c1'
@@ -42,6 +44,7 @@ export const transformContainerNodes = (adf, schema) => {
42
44
  });
43
45
  return {
44
46
  transformedAdf,
45
- isTransformed
47
+ isTransformed,
48
+ transformedNodeTypes: Array.from(transformedNodeTypes)
46
49
  };
47
50
  };
@@ -1,2 +1,2 @@
1
1
  /* eslint-disable @atlaskit/editor/no-re-export */
2
- export { alignment, annotation, backgroundColor, blockCard, block_content, blockRootOnly, blockquote, blockTaskItem, bodiedExtension, bodiedExtension_with_marks, border, breakout, bulletList, caption, code, codeBlock, codeBlock_root_only, codeBlock_with_extended_attributes, codeBlock_root_only_with_extended_attributes, text_with_no_marks, confluenceInlineComment, dataConsumer, date, decisionItem, decisionList, doc, em, embedCard, emoji, expand, expand_root_only, extension, extensionFrame, extension_with_marks, fontSize, fragment, hardBreak, heading, heading_with_alignment, heading_with_indentation, heading_with_no_marks, indentation, inlineCard, inlineExtension, inlineExtension_with_marks, inline_content, layoutColumn, layoutSection, layoutSection_full, layoutSection_with_single_column, link, listItem, media, mediaGroup, mediaInline, mediaSingle, mediaSingle_caption, mediaSingle_full, mention, multiBodiedExtension, nestedExpand, nestedExpand_content, nestedExpand_with_no_marks, non_nestable_block_content, orderedList, panel, paragraph, paragraph_with_alignment, paragraph_with_font_size, paragraph_with_indentation, paragraph_with_no_marks, placeholder, rule, status, strike, strong, subsup, table, tableCell, tableHeader, tableRow, taskItem, taskList, text, textColor, text_code_inline, text_formatted, text_link_inline, underline, syncBlock, bodiedSyncBlock } from '@atlaskit/adf-schema/schema-validator';
2
+ export { alignment, annotation, backgroundColor, blockCard, block_content, blockRootOnly, blockquote, blockTaskItem, bodiedExtension, bodiedExtension_with_marks, border, breakout, bulletList, caption, code, codeBlock, codeBlock_root_only, text_with_no_marks, confluenceInlineComment, dataConsumer, date, decisionItem, decisionList, doc, em, embedCard, emoji, expand, expand_root_only, extension, extensionFrame, extension_with_marks, fontSize, fragment, hardBreak, heading, heading_with_alignment, heading_with_indentation, heading_with_no_marks, indentation, inlineCard, inlineExtension, inlineExtension_with_marks, inline_content, layoutColumn, layoutSection, layoutSection_full, layoutSection_with_single_column, link, listItem, media, mediaGroup, mediaInline, mediaSingle, mediaSingle_caption, mediaSingle_full, mention, multiBodiedExtension, nestedExpand, nestedExpand_content, nestedExpand_with_no_marks, non_nestable_block_content, orderedList, panel, paragraph, paragraph_with_alignment, paragraph_with_font_size, paragraph_with_indentation, paragraph_with_no_marks, placeholder, rule, status, strike, strong, subsup, table, tableCell, tableHeader, tableRow, taskItem, taskList, text, textColor, text_code_inline, text_formatted, text_link_inline, underline, syncBlock, bodiedSyncBlock } from '@atlaskit/adf-schema/schema-validator';
@@ -4,7 +4,6 @@ import * as specs from './specs';
4
4
  import { copy, isBoolean, isDefined, isInteger, isNumber, isPlainObject, isString, makeArray } from './utils';
5
5
  import { extractAllowedContent } from './extractAllowedContent';
6
6
  import { validatorFnMap } from './rules';
7
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
7
 
9
8
  // Ignored via go/ees005
10
9
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -317,11 +316,7 @@ const unsupportedNodeAttributesContent = (entity, errorCode, invalidAttributes,
317
316
  * under the base spec must also be valid under the variant.
318
317
  */
319
318
  const getVariantSpecOverrides = () => {
320
- const overrides = {};
321
- if (expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
322
- overrides.codeBlock = 'codeBlock_with_extended_attributes';
323
- }
324
- return overrides;
319
+ return {};
325
320
  };
326
321
 
327
322
  /**
@@ -29,6 +29,7 @@ var getPanelC1AllowedParentTypes = function getPanelC1AllowedParentTypes(schema)
29
29
  */
30
30
  export var transformContainerNodes = function transformContainerNodes(adf, schema) {
31
31
  var isTransformed = false;
32
+ var transformedNodeTypes = new Set();
32
33
  var panelC1AllowedParents = getPanelC1AllowedParentTypes(schema);
33
34
  var transformedAdf = traverse(adf, {
34
35
  panel: function panel(node, parent) {
@@ -36,6 +37,7 @@ export var transformContainerNodes = function transformContainerNodes(adf, schem
36
37
  var parentType = (_parent$node = parent.node) === null || _parent$node === void 0 ? void 0 : _parent$node.type;
37
38
  if (parentType && panelC1AllowedParents.has(parentType)) {
38
39
  isTransformed = true;
40
+ transformedNodeTypes.add('panel_c1');
39
41
  return _objectSpread(_objectSpread({}, node), {}, {
40
42
  type: 'panel_c1'
41
43
  });
@@ -45,6 +47,7 @@ export var transformContainerNodes = function transformContainerNodes(adf, schem
45
47
  });
46
48
  return {
47
49
  transformedAdf: transformedAdf,
48
- isTransformed: isTransformed
50
+ isTransformed: isTransformed,
51
+ transformedNodeTypes: Array.from(transformedNodeTypes)
49
52
  };
50
53
  };
@@ -1,2 +1,2 @@
1
1
  /* eslint-disable @atlaskit/editor/no-re-export */
2
- export { alignment, annotation, backgroundColor, blockCard, block_content, blockRootOnly, blockquote, blockTaskItem, bodiedExtension, bodiedExtension_with_marks, border, breakout, bulletList, caption, code, codeBlock, codeBlock_root_only, codeBlock_with_extended_attributes, codeBlock_root_only_with_extended_attributes, text_with_no_marks, confluenceInlineComment, dataConsumer, date, decisionItem, decisionList, doc, em, embedCard, emoji, expand, expand_root_only, extension, extensionFrame, extension_with_marks, fontSize, fragment, hardBreak, heading, heading_with_alignment, heading_with_indentation, heading_with_no_marks, indentation, inlineCard, inlineExtension, inlineExtension_with_marks, inline_content, layoutColumn, layoutSection, layoutSection_full, layoutSection_with_single_column, link, listItem, media, mediaGroup, mediaInline, mediaSingle, mediaSingle_caption, mediaSingle_full, mention, multiBodiedExtension, nestedExpand, nestedExpand_content, nestedExpand_with_no_marks, non_nestable_block_content, orderedList, panel, paragraph, paragraph_with_alignment, paragraph_with_font_size, paragraph_with_indentation, paragraph_with_no_marks, placeholder, rule, status, strike, strong, subsup, table, tableCell, tableHeader, tableRow, taskItem, taskList, text, textColor, text_code_inline, text_formatted, text_link_inline, underline, syncBlock, bodiedSyncBlock } from '@atlaskit/adf-schema/schema-validator';
2
+ export { alignment, annotation, backgroundColor, blockCard, block_content, blockRootOnly, blockquote, blockTaskItem, bodiedExtension, bodiedExtension_with_marks, border, breakout, bulletList, caption, code, codeBlock, codeBlock_root_only, text_with_no_marks, confluenceInlineComment, dataConsumer, date, decisionItem, decisionList, doc, em, embedCard, emoji, expand, expand_root_only, extension, extensionFrame, extension_with_marks, fontSize, fragment, hardBreak, heading, heading_with_alignment, heading_with_indentation, heading_with_no_marks, indentation, inlineCard, inlineExtension, inlineExtension_with_marks, inline_content, layoutColumn, layoutSection, layoutSection_full, layoutSection_with_single_column, link, listItem, media, mediaGroup, mediaInline, mediaSingle, mediaSingle_caption, mediaSingle_full, mention, multiBodiedExtension, nestedExpand, nestedExpand_content, nestedExpand_with_no_marks, non_nestable_block_content, orderedList, panel, paragraph, paragraph_with_alignment, paragraph_with_font_size, paragraph_with_indentation, paragraph_with_no_marks, placeholder, rule, status, strike, strong, subsup, table, tableCell, tableHeader, tableRow, taskItem, taskList, text, textColor, text_code_inline, text_formatted, text_link_inline, underline, syncBlock, bodiedSyncBlock } from '@atlaskit/adf-schema/schema-validator';
@@ -14,7 +14,6 @@ import * as specs from './specs';
14
14
  import { copy, isBoolean, isDefined, isInteger, isNumber, isPlainObject, isString, makeArray } from './utils';
15
15
  import { extractAllowedContent } from './extractAllowedContent';
16
16
  import { validatorFnMap } from './rules';
17
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
18
17
 
19
18
  // Ignored via go/ees005
20
19
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -347,11 +346,7 @@ var unsupportedNodeAttributesContent = function unsupportedNodeAttributesContent
347
346
  * under the base spec must also be valid under the variant.
348
347
  */
349
348
  var getVariantSpecOverrides = function getVariantSpecOverrides() {
350
- var overrides = {};
351
- if (expValEquals('platform_editor_code_block_q4_lovability', 'isEnabled', true)) {
352
- overrides.codeBlock = 'codeBlock_with_extended_attributes';
353
- }
354
- return overrides;
349
+ return {};
355
350
  };
356
351
 
357
352
  /**
@@ -6,4 +6,5 @@ import type { ADFEntity } from '../types';
6
6
  export declare const transformContainerNodes: (adf: ADFEntity, schema: Schema) => {
7
7
  isTransformed: boolean;
8
8
  transformedAdf: ADFEntity | false;
9
+ transformedNodeTypes: string[];
9
10
  };
@@ -1 +1 @@
1
- export { alignment, annotation, backgroundColor, blockCard, block_content, blockRootOnly, blockquote, blockTaskItem, bodiedExtension, bodiedExtension_with_marks, border, breakout, bulletList, caption, code, codeBlock, codeBlock_root_only, codeBlock_with_extended_attributes, codeBlock_root_only_with_extended_attributes, text_with_no_marks, confluenceInlineComment, dataConsumer, date, decisionItem, decisionList, doc, em, embedCard, emoji, expand, expand_root_only, extension, extensionFrame, extension_with_marks, fontSize, fragment, hardBreak, heading, heading_with_alignment, heading_with_indentation, heading_with_no_marks, indentation, inlineCard, inlineExtension, inlineExtension_with_marks, inline_content, layoutColumn, layoutSection, layoutSection_full, layoutSection_with_single_column, link, listItem, media, mediaGroup, mediaInline, mediaSingle, mediaSingle_caption, mediaSingle_full, mention, multiBodiedExtension, nestedExpand, nestedExpand_content, nestedExpand_with_no_marks, non_nestable_block_content, orderedList, panel, paragraph, paragraph_with_alignment, paragraph_with_font_size, paragraph_with_indentation, paragraph_with_no_marks, placeholder, rule, status, strike, strong, subsup, table, tableCell, tableHeader, tableRow, taskItem, taskList, text, textColor, text_code_inline, text_formatted, text_link_inline, underline, syncBlock, bodiedSyncBlock, } from '@atlaskit/adf-schema/schema-validator';
1
+ export { alignment, annotation, backgroundColor, blockCard, block_content, blockRootOnly, blockquote, blockTaskItem, bodiedExtension, bodiedExtension_with_marks, border, breakout, bulletList, caption, code, codeBlock, codeBlock_root_only, text_with_no_marks, confluenceInlineComment, dataConsumer, date, decisionItem, decisionList, doc, em, embedCard, emoji, expand, expand_root_only, extension, extensionFrame, extension_with_marks, fontSize, fragment, hardBreak, heading, heading_with_alignment, heading_with_indentation, heading_with_no_marks, indentation, inlineCard, inlineExtension, inlineExtension_with_marks, inline_content, layoutColumn, layoutSection, layoutSection_full, layoutSection_with_single_column, link, listItem, media, mediaGroup, mediaInline, mediaSingle, mediaSingle_caption, mediaSingle_full, mention, multiBodiedExtension, nestedExpand, nestedExpand_content, nestedExpand_with_no_marks, non_nestable_block_content, orderedList, panel, paragraph, paragraph_with_alignment, paragraph_with_font_size, paragraph_with_indentation, paragraph_with_no_marks, placeholder, rule, status, strike, strong, subsup, table, tableCell, tableHeader, tableRow, taskItem, taskList, text, textColor, text_code_inline, text_formatted, text_link_inline, underline, syncBlock, bodiedSyncBlock, } from '@atlaskit/adf-schema/schema-validator';
@@ -6,4 +6,5 @@ import type { ADFEntity } from '../types';
6
6
  export declare const transformContainerNodes: (adf: ADFEntity, schema: Schema) => {
7
7
  isTransformed: boolean;
8
8
  transformedAdf: ADFEntity | false;
9
+ transformedNodeTypes: string[];
9
10
  };
@@ -1 +1 @@
1
- export { alignment, annotation, backgroundColor, blockCard, block_content, blockRootOnly, blockquote, blockTaskItem, bodiedExtension, bodiedExtension_with_marks, border, breakout, bulletList, caption, code, codeBlock, codeBlock_root_only, codeBlock_with_extended_attributes, codeBlock_root_only_with_extended_attributes, text_with_no_marks, confluenceInlineComment, dataConsumer, date, decisionItem, decisionList, doc, em, embedCard, emoji, expand, expand_root_only, extension, extensionFrame, extension_with_marks, fontSize, fragment, hardBreak, heading, heading_with_alignment, heading_with_indentation, heading_with_no_marks, indentation, inlineCard, inlineExtension, inlineExtension_with_marks, inline_content, layoutColumn, layoutSection, layoutSection_full, layoutSection_with_single_column, link, listItem, media, mediaGroup, mediaInline, mediaSingle, mediaSingle_caption, mediaSingle_full, mention, multiBodiedExtension, nestedExpand, nestedExpand_content, nestedExpand_with_no_marks, non_nestable_block_content, orderedList, panel, paragraph, paragraph_with_alignment, paragraph_with_font_size, paragraph_with_indentation, paragraph_with_no_marks, placeholder, rule, status, strike, strong, subsup, table, tableCell, tableHeader, tableRow, taskItem, taskList, text, textColor, text_code_inline, text_formatted, text_link_inline, underline, syncBlock, bodiedSyncBlock, } from '@atlaskit/adf-schema/schema-validator';
1
+ export { alignment, annotation, backgroundColor, blockCard, block_content, blockRootOnly, blockquote, blockTaskItem, bodiedExtension, bodiedExtension_with_marks, border, breakout, bulletList, caption, code, codeBlock, codeBlock_root_only, text_with_no_marks, confluenceInlineComment, dataConsumer, date, decisionItem, decisionList, doc, em, embedCard, emoji, expand, expand_root_only, extension, extensionFrame, extension_with_marks, fontSize, fragment, hardBreak, heading, heading_with_alignment, heading_with_indentation, heading_with_no_marks, indentation, inlineCard, inlineExtension, inlineExtension_with_marks, inline_content, layoutColumn, layoutSection, layoutSection_full, layoutSection_with_single_column, link, listItem, media, mediaGroup, mediaInline, mediaSingle, mediaSingle_caption, mediaSingle_full, mention, multiBodiedExtension, nestedExpand, nestedExpand_content, nestedExpand_with_no_marks, non_nestable_block_content, orderedList, panel, paragraph, paragraph_with_alignment, paragraph_with_font_size, paragraph_with_indentation, paragraph_with_no_marks, placeholder, rule, status, strike, strong, subsup, table, tableCell, tableHeader, tableRow, taskItem, taskList, text, textColor, text_code_inline, text_formatted, text_link_inline, underline, syncBlock, bodiedSyncBlock, } from '@atlaskit/adf-schema/schema-validator';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-utils",
3
- "version": "19.32.9",
3
+ "version": "19.33.0",
4
4
  "description": "Set of utilities to traverse, modify and create ADF documents.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -26,9 +26,9 @@
26
26
  "team": "Editor: Collaboration"
27
27
  },
28
28
  "dependencies": {
29
- "@atlaskit/adf-schema": "^52.16.0",
29
+ "@atlaskit/adf-schema": "^53.0.0",
30
30
  "@atlaskit/platform-feature-flags": "^1.1.0",
31
- "@atlaskit/tmp-editor-statsig": "^93.0.0",
31
+ "@atlaskit/tmp-editor-statsig": "^94.0.0",
32
32
  "@babel/runtime": "^7.0.0"
33
33
  },
34
34
  "devDependencies": {