@atlaskit/editor-plugin-panel 2.5.1 → 2.5.3

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/editor-plugin-panel
2
2
 
3
+ ## 2.5.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 2.5.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#143310](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/143310)
14
+ [`f55df006dcd59`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f55df006dcd59) -
15
+ ED-24822 - Add padding to panels with no icon and unhide drag handle in first bodied node
16
+ - Updated dependencies
17
+
3
18
  ## 2.5.1
4
19
 
5
20
  ### Patch Changes
package/dist/cjs/utils.js CHANGED
@@ -11,6 +11,7 @@ var _panel = require("@atlaskit/editor-common/panel");
11
11
  var _editorPalette = require("@atlaskit/editor-palette");
12
12
  var _state = require("@atlaskit/editor-prosemirror/state");
13
13
  var _utils = require("@atlaskit/editor-prosemirror/utils");
14
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
14
15
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
15
16
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
17
  var findPanel = exports.findPanel = function findPanel(state, selection) {
@@ -27,9 +28,9 @@ var panelAttrsToDom = exports.panelAttrsToDom = function panelAttrsToDom(attrs,
27
28
  var hasIcon = !isCustomPanel || !!panelIcon || !!panelIconId;
28
29
  var tokenColor = panelColor && (0, _editorPalette.hexToEditorBackgroundPaletteColor)(panelColor);
29
30
  var panelBackgroundColor = tokenColor || panelColor;
30
- var style = ["".concat(panelColor && isCustomPanel ? "background-color: ".concat(panelBackgroundColor, ";") : ''), "".concat(hasIcon ? '' : 'padding-left: 12px;padding-right: 12px;')].join('');
31
+ var style = ["".concat(panelColor && isCustomPanel ? "background-color: ".concat(panelBackgroundColor, ";") : ''), "".concat(!hasIcon && (0, _experiments.editorExperiment)('nested-dnd', false) ? "padding-left: 12px;padding-right: 12px;" : '')].join('');
31
32
  var panelAttrs = {
32
- class: _panel.PanelSharedCssClassName.prefix,
33
+ class: "".concat(_panel.PanelSharedCssClassName.prefix).concat(!hasIcon && (0, _experiments.editorExperiment)('nested-dnd', true) ? " ".concat(_panel.PanelSharedCssClassName.noIcon) : ''),
33
34
  'data-panel-type': panelType || _adfSchema.PanelType.INFO,
34
35
  'data-testid': 'panel-node-view',
35
36
  style: style
@@ -3,6 +3,7 @@ import { PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
3
3
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
4
4
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { findParentNode, findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
6
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
6
7
  export const findPanel = (state, selection) => {
7
8
  const {
8
9
  panel
@@ -21,9 +22,9 @@ export const panelAttrsToDom = (attrs, allowCustomPanel) => {
21
22
  const hasIcon = !isCustomPanel || !!panelIcon || !!panelIconId;
22
23
  const tokenColor = panelColor && hexToEditorBackgroundPaletteColor(panelColor);
23
24
  const panelBackgroundColor = tokenColor || panelColor;
24
- const style = [`${panelColor && isCustomPanel ? `background-color: ${panelBackgroundColor};` : ''}`, `${hasIcon ? '' : 'padding-left: 12px;padding-right: 12px;'}`].join('');
25
+ const style = [`${panelColor && isCustomPanel ? `background-color: ${panelBackgroundColor};` : ''}`, `${!hasIcon && editorExperiment('nested-dnd', false) ? `padding-left: 12px;padding-right: 12px;` : ''}`].join('');
25
26
  let panelAttrs = {
26
- class: PanelSharedCssClassName.prefix,
27
+ class: `${PanelSharedCssClassName.prefix}${!hasIcon && editorExperiment('nested-dnd', true) ? ` ${PanelSharedCssClassName.noIcon}` : ''}`,
27
28
  'data-panel-type': panelType || PanelType.INFO,
28
29
  'data-testid': 'panel-node-view',
29
30
  style
package/dist/esm/utils.js CHANGED
@@ -6,6 +6,7 @@ import { PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
6
6
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
7
7
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
8
8
  import { findParentNode, findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
9
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
9
10
  export var findPanel = function findPanel(state, selection) {
10
11
  var panel = state.schema.nodes.panel;
11
12
  return findSelectedNodeOfType(panel)(selection || state.selection) || findParentNodeOfType(panel)(selection || state.selection);
@@ -20,9 +21,9 @@ export var panelAttrsToDom = function panelAttrsToDom(attrs, allowCustomPanel) {
20
21
  var hasIcon = !isCustomPanel || !!panelIcon || !!panelIconId;
21
22
  var tokenColor = panelColor && hexToEditorBackgroundPaletteColor(panelColor);
22
23
  var panelBackgroundColor = tokenColor || panelColor;
23
- var style = ["".concat(panelColor && isCustomPanel ? "background-color: ".concat(panelBackgroundColor, ";") : ''), "".concat(hasIcon ? '' : 'padding-left: 12px;padding-right: 12px;')].join('');
24
+ var style = ["".concat(panelColor && isCustomPanel ? "background-color: ".concat(panelBackgroundColor, ";") : ''), "".concat(!hasIcon && editorExperiment('nested-dnd', false) ? "padding-left: 12px;padding-right: 12px;" : '')].join('');
24
25
  var panelAttrs = {
25
- class: PanelSharedCssClassName.prefix,
26
+ class: "".concat(PanelSharedCssClassName.prefix).concat(!hasIcon && editorExperiment('nested-dnd', true) ? " ".concat(PanelSharedCssClassName.noIcon) : ''),
26
27
  'data-panel-type': panelType || PanelType.INFO,
27
28
  'data-testid': 'panel-node-view',
28
29
  style: style
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-panel",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "description": "Panel plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^40.9.0",
35
- "@atlaskit/editor-common": "^90.0.0",
35
+ "@atlaskit/editor-common": "^91.0.0",
36
36
  "@atlaskit/editor-palette": "1.6.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.8.0",
38
38
  "@atlaskit/editor-plugin-decorations": "^1.3.0",
@@ -42,6 +42,7 @@
42
42
  "@atlaskit/emoji": "^67.7.0",
43
43
  "@atlaskit/icon": "^22.18.0",
44
44
  "@atlaskit/theme": "^13.0.0",
45
+ "@atlaskit/tmp-editor-statsig": "*",
45
46
  "@babel/runtime": "^7.0.0"
46
47
  },
47
48
  "peerDependencies": {
package/.eslintrc.js DELETED
@@ -1,18 +0,0 @@
1
- module.exports = {
2
- rules: {
3
- '@typescript-eslint/no-duplicate-imports': 'error',
4
- '@typescript-eslint/no-explicit-any': 'error',
5
- '@typescript-eslint/ban-types': [
6
- 'error',
7
- {
8
- types: {
9
- 'React.FC':
10
- 'Please use types directly on props instead, and explicitly define children if required',
11
- 'React.FunctionalComponent':
12
- 'Please use types directly on props instead, and explicitly define children if required',
13
- },
14
- extendDefaults: false,
15
- },
16
- ],
17
- },
18
- };