@atlaskit/editor-palette 0.1.0 → 1.0.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 +1,7 @@
1
1
  # @atlaskit/editor-palette
2
+
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`0ea58bc9901`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0ea58bc9901) - Remove undocumented palette object entrypoints
package/dist/cjs/index.js CHANGED
@@ -3,18 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "editorBackgroundPalette", {
7
- enumerable: true,
8
- get: function get() {
9
- return _background.editorBackgroundPalette;
10
- }
11
- });
12
- Object.defineProperty(exports, "editorTextPalette", {
13
- enumerable: true,
14
- get: function get() {
15
- return _text.editorTextPalette;
16
- }
17
- });
18
6
  Object.defineProperty(exports, "hexToEditorBackgroundPaletteColor", {
19
7
  enumerable: true,
20
8
  get: function get() {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-palette",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,2 +1,2 @@
1
- export { hexToEditorBackgroundPaletteColor, editorBackgroundPalette } from './background';
2
- export { hexToEditorTextPaletteColor, editorTextPalette } from './text';
1
+ export { hexToEditorBackgroundPaletteColor } from './background';
2
+ export { hexToEditorTextPaletteColor } from './text';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-palette",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "sideEffects": false
5
5
  }
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { hexToEditorBackgroundPaletteColor, editorBackgroundPalette } from './background';
2
- export { hexToEditorTextPaletteColor, editorTextPalette } from './text';
1
+ export { hexToEditorBackgroundPaletteColor } from './background';
2
+ export { hexToEditorTextPaletteColor } from './text';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-palette",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,2 +1,2 @@
1
- export { hexToEditorBackgroundPaletteColor, editorBackgroundPalette, } from './background';
2
- export { hexToEditorTextPaletteColor, editorTextPalette } from './text';
1
+ export { hexToEditorBackgroundPaletteColor } from './background';
2
+ export { hexToEditorTextPaletteColor } from './text';
@@ -0,0 +1,95 @@
1
+ import React from 'react';
2
+
3
+ import { AtlassianInternalWarning, code, md } from '@atlaskit/docs';
4
+ import SectionMessage from '@atlaskit/section-message';
5
+
6
+ export default md`
7
+ ${(<AtlassianInternalWarning />)}
8
+
9
+ # Editor Palettes:
10
+
11
+ In Editor, colors are stored in ADF for certain user-generated content, such as:
12
+ - **Text colors**: \`mark.textColor\`
13
+ - **Custom table backgrounds**: \`tableCell.attrs.background\`, \`tableHeader.attrs.background\`
14
+ - **Custom panel backgrounds**: \`panel.attrs.panelColor\`
15
+
16
+ Although stored in hexadecimal format, these colors need to be displayed differently depending on the current product theme, such as light and dark mode.
17
+
18
+ To support this, this package provides utilities to map hexadecimal colors stored in ADF, to an appropriate design token from the Atlassian Design System.
19
+
20
+ Theming is only supported on web.
21
+
22
+ Documentation for design tokens can be found in the [@atlaskit/token package docs](https://atlassian.design/components/tokens/all-tokens)
23
+ and [@atlaskit/token package examples](https://atlassian.design/components/tokens/examples) on the Atlassian Design System website.
24
+
25
+ For ecosystem apps, learn more about tokens and theming in the announcement post in our [developer forums](https://community.developer.atlassian.com/t/start-using-design-tokens-in-your-apps-and-try-dark-theme-in-jira-cloud/64147).
26
+ Currently, the top-level theme configuration is only documented for internal use.
27
+
28
+ ## Note on usage
29
+
30
+ **This package is only intended for displaying ADF documents.**
31
+
32
+ If you are looking for resources to create a new color palette experience for your product or app,
33
+ you can learn more about the available accent color tokens in the [Design Token guidelines](https://atlassian.design/foundations/color-new/#color-roles),
34
+ or reach out to the Design System Team via the [Atlassian Developer Community forums](https://community.developer.atlassian.com/tag/editor).
35
+
36
+ ## API documentation
37
+
38
+ ${(
39
+ <div style={{ marginTop: '0.5rem' }}>
40
+ <SectionMessage
41
+ title="Design token names and values are an implementation detail."
42
+ appearance="warning"
43
+ >
44
+ <p>
45
+ The names of tokens can change over time, and the values of tokens will
46
+ differ between themes.
47
+ </p>
48
+ <p>
49
+ The exact output of this function is an implementation detail only and
50
+ should only be used when rendering content to the user, on a client with
51
+ a matching major version of <code>@atlaskit/tokens</code>.
52
+ </p>
53
+ <ul>
54
+ <li>
55
+ <strong>DO NOT</strong>: store the output of these functions in any
56
+ user-generated content or back-end.
57
+ </li>
58
+ <li>
59
+ <strong>DO</strong>: store the ADF hex color, and use these utilities
60
+ at render time to display the themed version of the color
61
+ </li>
62
+ </ul>
63
+ </SectionMessage>
64
+ </div>
65
+ )}
66
+
67
+ ### \`hexToTextPaletteColor\`
68
+
69
+ This takes an adf hex color and returns a matching text palette color.
70
+
71
+ By providing a design token, this enables ADF content to be rendered in new themes such as dark mode.
72
+
73
+ #### Example usage
74
+
75
+ ${code`
76
+ const cssValue = hexToTextPaletteColor('#FFFFFF');
77
+ // ^? const cssValue: string
78
+ <div style={{color: cssValue}} />
79
+ `}
80
+
81
+ ### \`hexToBackgroundPaletteColor\`
82
+
83
+ This takes an adf hex color and returns a matching background palette color
84
+
85
+ By providing a design token, this enables ADF content to be rendered in new themes such as dark mode.
86
+
87
+ #### Example usage
88
+
89
+ ${code`
90
+ const cssValue = hexToBackgroundPaletteColor('#FFFFFF');
91
+ // ^? const cssValue: string
92
+ <div style={{backgroundColor: cssValue}} />
93
+ `}
94
+
95
+ `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-palette",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "description": "The editor palette",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,12 +29,14 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@atlaskit/docs": "*",
32
+ "@atlaskit/section-message": "^6.3.7",
32
33
  "@atlaskit/ssr": "*",
33
- "@atlaskit/tokens": "^0.11.1",
34
+ "@atlaskit/tokens": "^0.13.0",
34
35
  "@atlaskit/visual-regression": "*",
35
36
  "@atlaskit/webdriver-runner": "*",
36
37
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
37
38
  "@testing-library/react": "^12.1.5",
39
+ "react": "^16.8.0",
38
40
  "react-dom": "^16.8.0",
39
41
  "typescript": "4.5.5",
40
42
  "wait-for-expect": "^1.2.0"
package/report.api.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- API Report Version: 2.2 -->
1
+ <!-- API Report Version: 2.3 -->
2
2
 
3
3
  ## API Report File for "@atlaskit/editor-palette"
4
4
 
@@ -8,6 +8,7 @@
8
8
  ### Table of contents
9
9
 
10
10
  - [Main Entry Types](#main-entry-types)
11
+ - [Peer Dependencies](#peer-dependencies)
11
12
 
12
13
  ### Main Entry Types
13
14
 
@@ -18,7 +19,7 @@
18
19
  type EditorBackgroundPalette = typeof editorBackgroundPalette;
19
20
 
20
21
  // @public (undocumented)
21
- export const editorBackgroundPalette: {
22
+ const editorBackgroundPalette: {
22
23
  '#DEEBFF': 'var(--ds-background-accent-blue-subtlest, #DEEBFF)';
23
24
  '#B3D4FF': 'var(--ds-background-accent-blue-subtler, #B3D4FF)';
24
25
  '#4C9AFF': 'var(--ds-background-accent-blue-subtle, #4C9AFF)';
@@ -49,7 +50,7 @@ type EditorBackgroundPaletteKey = keyof EditorBackgroundPalette;
49
50
  type EditorTextPalette = typeof editorTextPalette;
50
51
 
51
52
  // @public (undocumented)
52
- export const editorTextPalette: {
53
+ const editorTextPalette: {
53
54
  '#B3D4FF': 'var(--ds-background-accent-blue-subtler, #B3D4FF)';
54
55
  '#4C9AFF': 'var(--ds-icon-accent-blue, #4C9AFF)';
55
56
  '#0747A6': 'var(--ds-text-accent-blue, #0747A6)';
@@ -94,3 +95,13 @@ export function hexToEditorTextPaletteColor<HexColor extends string>(
94
95
  ```
95
96
 
96
97
  <!--SECTION END: Main Entry Types-->
98
+
99
+ ### Peer Dependencies
100
+
101
+ <!--SECTION START: Peer Dependencies-->
102
+
103
+ ```json
104
+ {}
105
+ ```
106
+
107
+ <!--SECTION END: Peer Dependencies-->