@atlaskit/adf-schema 56.1.5 → 56.1.7

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,20 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 56.1.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`245230d12da8d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/245230d12da8d) -
8
+ [ux] [EDITOR-8142] add red highlight color and filter out the transparent/ default highlight color
9
+ behind platform_editor_lovability_text_bg_color_patch_1
10
+
11
+ ## 56.1.6
12
+
13
+ ### Patch Changes
14
+
15
+ - [`ba8c317b7b604`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ba8c317b7b604) -
16
+ Add breakout mark width and root-only panel/rule typing
17
+
3
18
  ## 56.1.5
4
19
 
5
20
  ### Patch Changes
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.backgroundColorPaletteNew = exports.backgroundColorPalette = exports.backgroundColor = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
11
  var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
11
12
  var _markTypes = require("../../next-schema/generated/markTypes");
12
13
  var _colors = require("../../utils/colors");
@@ -45,6 +46,8 @@ var colorArrayPaletteNew = [[_colors.Neutral300, 'Gray'],
45
46
  // token: color.background.accent.yellow.subtler
46
47
  [_colors.O200, 'Orange'],
47
48
  // token: color.background.accent.orange.subtler
49
+ [_colors.R200, 'Red'],
50
+ // token: color.background.accent.red.subtler
48
51
  [_colors.M200, 'Magenta'],
49
52
  // token: color.background.accent.magenta.subtler
50
53
  [_colors.P200, 'Purple'] // token: color.background.accent.purple.subtler
@@ -72,7 +75,7 @@ var isSupportedBackgroundColor = function isSupportedBackgroundColor(hexColor) {
72
75
  if (backgroundColorPalette.has(hexColor)) {
73
76
  return true;
74
77
  }
75
- return (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_text_bg_color', 'isEnabled', true) && backgroundColorPaletteNew.has(hexColor);
78
+ return (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_text_bg_color', 'isEnabled', true) && backgroundColorPaletteNew.has(hexColor) && (hexColor !== _colors.R200.toLowerCase() || (0, _platformFeatureFlags.fg)('platform_editor_lovability_text_bg_color_patch_1'));
76
79
  };
77
80
  var backgroundColor = exports.backgroundColor = (0, _markTypes.backgroundColor)({
78
81
  parseDOM: [{
@@ -26,6 +26,9 @@ var PanelType = exports.PanelType = /*#__PURE__*/function (PanelType) {
26
26
  /**
27
27
  * @name panel_c1_node
28
28
  */
29
+ /**
30
+ * @name panel_root_only_node
31
+ */
29
32
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
33
  var getDomAttrs = function getDomAttrs(nodeAttrs) {
31
34
  var attrs = {
@@ -14,6 +14,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
14
14
  * @name rule_node
15
15
  */
16
16
 
17
+ /**
18
+ * @name rule_root_only_node
19
+ */
20
+
17
21
  var hrDOM = ['hr'];
18
22
  var rule = exports.rule = (0, _nodeTypes.rule)({
19
23
  parseDOM: [{
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.Yellow200 = exports.Y800 = exports.Y75 = exports.Y600 = exports.Y500 = exports.Y50 = exports.Y400 = exports.Y200 = exports.T75 = exports.T500 = exports.T50 = exports.T300 = exports.T200 = exports.T100 = exports.R75 = exports.R500 = exports.R50 = exports.R400 = exports.R300 = exports.R100 = exports.P75 = exports.P500 = exports.P50 = exports.P400 = exports.P300 = exports.P200 = exports.P100 = exports.Orange200 = exports.O800 = exports.O600 = exports.O200 = exports.Neutral300 = exports.N90 = exports.N800 = exports.N80 = exports.N600 = exports.N60 = exports.N500 = exports.N50 = exports.N40 = exports.N300A = exports.N300 = exports.N30 = exports.N200 = exports.N20 = exports.N1000 = exports.N0 = exports.M800 = exports.M600 = exports.M200 = exports.L800 = exports.L600 = exports.L200 = exports.G75 = exports.G500 = exports.G50 = exports.G400 = exports.G300 = exports.G200 = exports.B75 = exports.B500 = exports.B50 = exports.B400 = exports.B100 = void 0;
8
+ exports.Yellow200 = exports.Y800 = exports.Y75 = exports.Y600 = exports.Y500 = exports.Y50 = exports.Y400 = exports.Y200 = exports.T75 = exports.T500 = exports.T50 = exports.T300 = exports.T200 = exports.T100 = exports.R75 = exports.R500 = exports.R50 = exports.R400 = exports.R300 = exports.R200 = exports.R100 = exports.P75 = exports.P500 = exports.P50 = exports.P400 = exports.P300 = exports.P200 = exports.P100 = exports.Orange200 = exports.O800 = exports.O600 = exports.O200 = exports.Neutral300 = exports.N90 = exports.N800 = exports.N80 = exports.N600 = exports.N60 = exports.N500 = exports.N50 = exports.N40 = exports.N300A = exports.N300 = exports.N30 = exports.N200 = exports.N20 = exports.N1000 = exports.N0 = exports.M800 = exports.M600 = exports.M200 = exports.L800 = exports.L600 = exports.L200 = exports.G75 = exports.G500 = exports.G50 = exports.G400 = exports.G300 = exports.G200 = exports.B75 = exports.B500 = exports.B50 = exports.B400 = exports.B100 = void 0;
9
9
  exports.hexToRgb = hexToRgb;
10
10
  exports.hexToRgba = hexToRgba;
11
11
  exports.isHex = isHex;
@@ -28,6 +28,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
28
28
  var R50 = exports.R50 = '#FFEBE6';
29
29
  var R75 = exports.R75 = '#FFBDAD';
30
30
  var R100 = exports.R100 = '#FF8F73';
31
+ var R200 = exports.R200 = '#FFD5D2';
31
32
  var R300 = exports.R300 = '#FF5630';
32
33
  var R400 = exports.R400 = '#DE350B';
33
34
  var R500 = exports.R500 = '#BF2600';
@@ -169,6 +169,8 @@ var textBackgroundColorPalette = exports.textBackgroundColorPalette = {
169
169
  '#F8E6A0': 'var(--ds-background-accent-yellow-subtler, #F8E6A0)',
170
170
  /** Orange - light */
171
171
  '#FEDEC8': 'var(--ds-background-accent-orange-subtler, #FEDEC8)',
172
+ /** Red - light */
173
+ '#FFD5D2': 'var(--ds-background-accent-red-subtler, #FFD5D2)',
172
174
  /** Magenta - light */
173
175
  '#FDD0EC': 'var(--ds-background-accent-magenta-subtler, #FDD0EC)',
174
176
  /** Purple - light */
@@ -18,7 +18,7 @@ var clamp = function clamp(i, min, max) {
18
18
  return Math.round(Math.min(Math.max(i, min), max));
19
19
  };
20
20
  var expandShorthandHex = function expandShorthandHex(input) {
21
- return input.replace(SHORTHAND_HEX_REGEX, function (m, r, g, b) {
21
+ return input.replace(SHORTHAND_HEX_REGEX, function (_m, r, g, b) {
22
22
  return r + r + g + g + b + b;
23
23
  });
24
24
  };
@@ -1,6 +1,7 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
1
2
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
2
3
  import { backgroundColor as backgroundColorFactory } from '../../next-schema/generated/markTypes';
3
- import { B75, G75, L200, M200, Neutral300, O200, P200, rgbToHex, T200, Yellow200 } from '../../utils/colors';
4
+ import { B75, G75, L200, M200, Neutral300, O200, P200, R200, rgbToHex, T200, Yellow200 } from '../../utils/colors';
4
5
  import { hexToEditorTextBackgroundPaletteColor } from '../../utils/editor-palette';
5
6
  import { getDarkModeLCHColor } from '../../utils/lch-color-inversion';
6
7
  import { getGlobalTheme } from './text-color';
@@ -37,6 +38,8 @@ const colorArrayPaletteNew = [[Neutral300, 'Gray'],
37
38
  // token: color.background.accent.yellow.subtler
38
39
  [O200, 'Orange'],
39
40
  // token: color.background.accent.orange.subtler
41
+ [R200, 'Red'],
42
+ // token: color.background.accent.red.subtler
40
43
  [M200, 'Magenta'],
41
44
  // token: color.background.accent.magenta.subtler
42
45
  [P200, 'Purple'] // token: color.background.accent.purple.subtler
@@ -54,7 +57,7 @@ const isSupportedBackgroundColor = hexColor => {
54
57
  if (backgroundColorPalette.has(hexColor)) {
55
58
  return true;
56
59
  }
57
- return expValEqualsNoExposure('platform_editor_lovability_text_bg_color', 'isEnabled', true) && backgroundColorPaletteNew.has(hexColor);
60
+ return expValEqualsNoExposure('platform_editor_lovability_text_bg_color', 'isEnabled', true) && backgroundColorPaletteNew.has(hexColor) && (hexColor !== R200.toLowerCase() || fg('platform_editor_lovability_text_bg_color_patch_1'));
58
61
  };
59
62
  export const backgroundColor = backgroundColorFactory({
60
63
  parseDOM: [{
@@ -19,6 +19,10 @@ export let PanelType = /*#__PURE__*/function (PanelType) {
19
19
  * @name panel_c1_node
20
20
  */
21
21
 
22
+ /**
23
+ * @name panel_root_only_node
24
+ */
25
+
22
26
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
27
  const getDomAttrs = nodeAttrs => {
24
28
  const attrs = {
@@ -5,6 +5,10 @@ import { uuid } from '../../utils/uuid';
5
5
  * @name rule_node
6
6
  */
7
7
 
8
+ /**
9
+ * @name rule_root_only_node
10
+ */
11
+
8
12
  const hrDOM = ['hr'];
9
13
  export const rule = ruleFactory({
10
14
  parseDOM: [{
@@ -12,6 +12,7 @@ import * as namedColors from 'css-color-names';
12
12
  export const R50 = '#FFEBE6';
13
13
  export const R75 = '#FFBDAD';
14
14
  export const R100 = '#FF8F73';
15
+ export const R200 = '#FFD5D2';
15
16
  export const R300 = '#FF5630';
16
17
  export const R400 = '#DE350B';
17
18
  export const R500 = '#BF2600';
@@ -160,6 +160,8 @@ export const textBackgroundColorPalette = {
160
160
  '#F8E6A0': 'var(--ds-background-accent-yellow-subtler, #F8E6A0)',
161
161
  /** Orange - light */
162
162
  '#FEDEC8': 'var(--ds-background-accent-orange-subtler, #FEDEC8)',
163
+ /** Red - light */
164
+ '#FFD5D2': 'var(--ds-background-accent-red-subtler, #FFD5D2)',
163
165
  /** Magenta - light */
164
166
  '#FDD0EC': 'var(--ds-background-accent-magenta-subtler, #FDD0EC)',
165
167
  /** Purple - light */
@@ -9,7 +9,7 @@ const SHORTHAND_HEX_REGEX = /^#?([a-f\d])([a-f\d])([a-f\d])$/iu;
9
9
  // @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
10
10
  const FULL_HEX_REGEX = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/iu;
11
11
  const clamp = (i, min, max) => Math.round(Math.min(Math.max(i, min), max));
12
- const expandShorthandHex = input => input.replace(SHORTHAND_HEX_REGEX, (m, r, g, b) => r + r + g + g + b + b);
12
+ const expandShorthandHex = input => input.replace(SHORTHAND_HEX_REGEX, (_m, r, g, b) => r + r + g + g + b + b);
13
13
  const rgbFromHex = input => {
14
14
  const fullHex = expandShorthandHex(input);
15
15
  const result = FULL_HEX_REGEX.exec(fullHex);
@@ -1,8 +1,9 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import { fg } from '@atlaskit/platform-feature-flags';
3
4
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
4
5
  import { backgroundColor as backgroundColorFactory } from '../../next-schema/generated/markTypes';
5
- import { B75, G75, L200, M200, Neutral300, O200, P200, rgbToHex, T200, Yellow200 } from '../../utils/colors';
6
+ import { B75, G75, L200, M200, Neutral300, O200, P200, R200, rgbToHex, T200, Yellow200 } from '../../utils/colors';
6
7
  import { hexToEditorTextBackgroundPaletteColor } from '../../utils/editor-palette';
7
8
  import { getDarkModeLCHColor } from '../../utils/lch-color-inversion';
8
9
  import { getGlobalTheme } from './text-color';
@@ -39,6 +40,8 @@ var colorArrayPaletteNew = [[Neutral300, 'Gray'],
39
40
  // token: color.background.accent.yellow.subtler
40
41
  [O200, 'Orange'],
41
42
  // token: color.background.accent.orange.subtler
43
+ [R200, 'Red'],
44
+ // token: color.background.accent.red.subtler
42
45
  [M200, 'Magenta'],
43
46
  // token: color.background.accent.magenta.subtler
44
47
  [P200, 'Purple'] // token: color.background.accent.purple.subtler
@@ -66,7 +69,7 @@ var isSupportedBackgroundColor = function isSupportedBackgroundColor(hexColor) {
66
69
  if (backgroundColorPalette.has(hexColor)) {
67
70
  return true;
68
71
  }
69
- return expValEqualsNoExposure('platform_editor_lovability_text_bg_color', 'isEnabled', true) && backgroundColorPaletteNew.has(hexColor);
72
+ return expValEqualsNoExposure('platform_editor_lovability_text_bg_color', 'isEnabled', true) && backgroundColorPaletteNew.has(hexColor) && (hexColor !== R200.toLowerCase() || fg('platform_editor_lovability_text_bg_color_patch_1'));
70
73
  };
71
74
  export var backgroundColor = backgroundColorFactory({
72
75
  parseDOM: [{
@@ -22,6 +22,10 @@ export var PanelType = /*#__PURE__*/function (PanelType) {
22
22
  * @name panel_c1_node
23
23
  */
24
24
 
25
+ /**
26
+ * @name panel_root_only_node
27
+ */
28
+
25
29
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
30
  var getDomAttrs = function getDomAttrs(nodeAttrs) {
27
31
  var attrs = {
@@ -8,6 +8,10 @@ import { uuid } from '../../utils/uuid';
8
8
  * @name rule_node
9
9
  */
10
10
 
11
+ /**
12
+ * @name rule_root_only_node
13
+ */
14
+
11
15
  var hrDOM = ['hr'];
12
16
  export var rule = ruleFactory({
13
17
  parseDOM: [{
@@ -13,6 +13,7 @@ import * as namedColors from 'css-color-names';
13
13
  export var R50 = '#FFEBE6';
14
14
  export var R75 = '#FFBDAD';
15
15
  export var R100 = '#FF8F73';
16
+ export var R200 = '#FFD5D2';
16
17
  export var R300 = '#FF5630';
17
18
  export var R400 = '#DE350B';
18
19
  export var R500 = '#BF2600';
@@ -158,6 +158,8 @@ export var textBackgroundColorPalette = {
158
158
  '#F8E6A0': 'var(--ds-background-accent-yellow-subtler, #F8E6A0)',
159
159
  /** Orange - light */
160
160
  '#FEDEC8': 'var(--ds-background-accent-orange-subtler, #FEDEC8)',
161
+ /** Red - light */
162
+ '#FFD5D2': 'var(--ds-background-accent-red-subtler, #FFD5D2)',
161
163
  /** Magenta - light */
162
164
  '#FDD0EC': 'var(--ds-background-accent-magenta-subtler, #FDD0EC)',
163
165
  /** Purple - light */
@@ -12,7 +12,7 @@ var clamp = function clamp(i, min, max) {
12
12
  return Math.round(Math.min(Math.max(i, min), max));
13
13
  };
14
14
  var expandShorthandHex = function expandShorthandHex(input) {
15
- return input.replace(SHORTHAND_HEX_REGEX, function (m, r, g, b) {
15
+ return input.replace(SHORTHAND_HEX_REGEX, function (_m, r, g, b) {
16
16
  return r + r + g + g + b + b;
17
17
  });
18
18
  };
@@ -10,7 +10,7 @@ export interface BackgroundColorDefinition {
10
10
  export interface BackgroundColorMark extends Mark {
11
11
  attrs: TextColorAttributes;
12
12
  }
13
- export type BackgroundColorKey = 'Gray' | 'Teal' | 'Lime' | 'Yellow' | 'Orange' | 'Magenta' | 'Purple' | 'Blue' | 'Green';
13
+ export type BackgroundColorKey = 'Gray' | 'Teal' | 'Lime' | 'Yellow' | 'Orange' | 'Red' | 'Magenta' | 'Purple' | 'Blue' | 'Green';
14
14
  export declare const backgroundColorPalette: Map<string, BackgroundColorKey>;
15
15
  export declare const backgroundColorPaletteNew: Map<string, BackgroundColorKey>;
16
16
  export declare const backgroundColor: MarkSpec;
@@ -1,6 +1,7 @@
1
1
  import type { MarkSpec } from '@atlaskit/editor-prosemirror/model';
2
2
  export type BreakoutMarkAttrs = {
3
3
  mode: 'wide' | 'full-width';
4
+ width?: number;
4
5
  };
5
6
  /**
6
7
  * @name breakout_mark
@@ -4,6 +4,8 @@ import type { LayoutSectionDefinition as LayoutSection } from './layout-section'
4
4
  import type { ParagraphWithIndentationDefinition } from './paragraph';
5
5
  import type { BlockContent } from './types/block-content';
6
6
  import type { MultiBodiedExtensionDefinition as MultiBodiedExtension } from './multi-bodied-extension';
7
+ import type { PanelRootOnlyDefinition as PanelRootOnly } from './panel';
8
+ import type { RuleRootOnlyDefinition as RuleRootOnly } from './rule';
7
9
  import type { SyncBlockDefinition as SyncBlock } from './sync-block';
8
10
  import type { BodiedSyncBlockDefinition as BodiedSyncBlock } from './bodied-sync-block';
9
11
  import type { NodeSpec } from '@atlaskit/editor-prosemirror/model';
@@ -15,7 +17,7 @@ export interface DocNode {
15
17
  // eslint-disable-next-line eslint-plugin-jsdoc/check-tag-names
16
18
  * @allowUnsupportedBlock true
17
19
  */
18
- content: Array<BlockContent | LayoutSection | CodeBlockWithMarks | ExpandRootOnly | ParagraphWithIndentationDefinition | MultiBodiedExtension | BodiedSyncBlock | SyncBlock>;
20
+ content: Array<BlockContent | LayoutSection | CodeBlockWithMarks | ExpandRootOnly | PanelRootOnly | RuleRootOnly | ParagraphWithIndentationDefinition | MultiBodiedExtension | BodiedSyncBlock | SyncBlock>;
19
21
  type: 'doc';
20
22
  version: 1;
21
23
  }
@@ -9,6 +9,8 @@ import type { DecisionListDefinition as DecisionList } from './decision-list';
9
9
  import type { TaskListDefinition as TaskList } from './task-list';
10
10
  import type { RuleDefinition as Rule } from './rule';
11
11
  import type { TableDefinition as Table } from './tableNodes';
12
+ import type { BreakoutMarkDefinition } from '../marks';
13
+ import type { MarksObject } from './types/mark';
12
14
  import type { NodeSpec } from '@atlaskit/editor-prosemirror/model';
13
15
  export declare enum PanelType {
14
16
  INFO = "info",
@@ -55,6 +57,10 @@ export interface PanelC1Definition {
55
57
  content: Array<Paragraph | Heading | OrderedList | BulletList | BlockCard | CodeBlock | MediaGroup | MediaSingle | DecisionList | TaskList | Rule | Table>;
56
58
  type: 'panel';
57
59
  }
60
+ /**
61
+ * @name panel_root_only_node
62
+ */
63
+ export type PanelRootOnlyDefinition = PanelDefinition & MarksObject<BreakoutMarkDefinition>;
58
64
  export interface DOMAttributes {
59
65
  [propName: string]: string;
60
66
  }
@@ -1,4 +1,6 @@
1
1
  import type { NodeSpec } from '@atlaskit/editor-prosemirror/model';
2
+ import type { BreakoutMarkDefinition } from '../marks';
3
+ import type { MarksObject } from './types/mark';
2
4
  /**
3
5
  * @name rule_node
4
6
  */
@@ -8,6 +10,10 @@ export interface RuleDefinition {
8
10
  };
9
11
  type: 'rule';
10
12
  }
13
+ /**
14
+ * @name rule_root_only_node
15
+ */
16
+ export type RuleRootOnlyDefinition = RuleDefinition & MarksObject<BreakoutMarkDefinition>;
11
17
  export declare const rule: NodeSpec;
12
18
  export declare const ruleWithLocalId: NodeSpec;
13
19
  export declare const ruleRootOnlyStage0: NodeSpec;
@@ -7,6 +7,7 @@
7
7
  export declare const R50 = "#FFEBE6";
8
8
  export declare const R75 = "#FFBDAD";
9
9
  export declare const R100 = "#FF8F73";
10
+ export declare const R200 = "#FFD5D2";
10
11
  export declare const R300 = "#FF5630";
11
12
  export declare const R400 = "#DE350B";
12
13
  export declare const R500 = "#BF2600";
@@ -141,6 +141,8 @@ export declare const textBackgroundColorPalette: {
141
141
  '#F8E6A0': string;
142
142
  /** Orange - light */
143
143
  '#FEDEC8': string;
144
+ /** Red - light */
145
+ '#FFD5D2': string;
144
146
  /** Magenta - light */
145
147
  '#FDD0EC': string;
146
148
  /** Purple - light */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "56.1.5",
3
+ "version": "56.1.7",
4
4
  "description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/adf-schema-generator": "^3.1.0",
41
41
  "@atlaskit/editor-prosemirror": "^8.0.0",
42
42
  "@atlaskit/platform-feature-flags": "^2.0.0",
43
- "@atlaskit/tmp-editor-statsig": "^126.0.0",
43
+ "@atlaskit/tmp-editor-statsig": "^126.3.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "css-color-names": "0.0.4",
46
46
  "linkify-it": "^3.0.3",