@atlaskit/editor-plugin-table 16.0.3 → 16.1.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,18 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 16.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`00e69e0b7c839`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/00e69e0b7c839) -
8
+ Clean up and removal of the `platform-visual-refresh-icons` feature flag.
9
+
10
+ ### Patch Changes
11
+
12
+ - [`a3bc4ac27ae8e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a3bc4ac27ae8e) -
13
+ [ux] EDITOR-4134 Fix firefox nightly for anchor fallback solution
14
+ - Updated dependencies
15
+
3
16
  ## 16.0.3
4
17
 
5
18
  ### Patch Changes
@@ -10,8 +10,10 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
  var _uuid = _interopRequireDefault(require("uuid"));
12
12
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
13
+ var _styles = require("@atlaskit/editor-common/styles");
13
14
  var _state = require("@atlaskit/editor-prosemirror/state");
14
15
  var _view = require("@atlaskit/editor-prosemirror/view");
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
17
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid
16
18
  var ObjHash = /*#__PURE__*/function () {
17
19
  function ObjHash() {
@@ -45,7 +47,12 @@ var createTableAnchorDecorations = function createTableAnchorDecorations(state)
45
47
  // only apply to header cells and the first row of a table, for performance reasons
46
48
  if (isTableRow && index === 0 || isTableHeader) {
47
49
  var anchorName = getNodeAnchor(node);
48
- decs.push(_view.Decoration.node(pos, pos + node.nodeSize, {
50
+ var shouldAddAnchorNameInDecoration = !(0, _styles.isCSSAttrAnchorSupported)() && (0, _styles.isCSSAnchorSupported)() && (0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_8');
51
+ var attributes = {
52
+ 'data-node-anchor': anchorName,
53
+ 'style': "anchor-name: ".concat(anchorName, ";")
54
+ };
55
+ decs.push(_view.Decoration.node(pos, pos + node.nodeSize, shouldAddAnchorNameInDecoration ? attributes : {
49
56
  'data-node-anchor': anchorName
50
57
  }));
51
58
  }
@@ -113,8 +113,7 @@ var getToolbarMenuConfig = exports.getToolbarMenuConfig = function getToolbarMen
113
113
  id: 'editor.table.tableOptions',
114
114
  type: 'dropdown',
115
115
  testId: 'table_options',
116
- icon: (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ? undefined : _customize.default,
117
- iconBefore: (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ? _customize.default : undefined,
116
+ iconBefore: _customize.default,
118
117
  title: formatMessage(_messages.tableMessages.tableOptions),
119
118
  hidden: options.every(function (option) {
120
119
  return option.hidden;
@@ -2,8 +2,10 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid
3
3
  import uuid from 'uuid';
4
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
+ import { isCSSAnchorSupported, isCSSAttrAnchorSupported } from '@atlaskit/editor-common/styles';
5
6
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
6
7
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
7
9
  class ObjHash {
8
10
  static getForNode(node) {
9
11
  if (this.cache.has(node)) {
@@ -30,7 +32,12 @@ const createTableAnchorDecorations = state => {
30
32
  // only apply to header cells and the first row of a table, for performance reasons
31
33
  if (isTableRow && index === 0 || isTableHeader) {
32
34
  const anchorName = getNodeAnchor(node);
33
- decs.push(Decoration.node(pos, pos + node.nodeSize, {
35
+ const shouldAddAnchorNameInDecoration = !isCSSAttrAnchorSupported() && isCSSAnchorSupported() && fg('platform_editor_table_sticky_header_patch_8');
36
+ const attributes = {
37
+ 'data-node-anchor': anchorName,
38
+ 'style': `anchor-name: ${anchorName};`
39
+ };
40
+ decs.push(Decoration.node(pos, pos + node.nodeSize, shouldAddAnchorNameInDecoration ? attributes : {
34
41
  'data-node-anchor': anchorName
35
42
  }));
36
43
  }
@@ -101,8 +101,7 @@ export const getToolbarMenuConfig = (config, state, {
101
101
  id: 'editor.table.tableOptions',
102
102
  type: 'dropdown',
103
103
  testId: 'table_options',
104
- icon: fg('platform-visual-refresh-icons') ? undefined : CustomizeIcon,
105
- iconBefore: fg('platform-visual-refresh-icons') ? CustomizeIcon : undefined,
104
+ iconBefore: CustomizeIcon,
106
105
  title: formatMessage(messages.tableOptions),
107
106
  hidden: options.every(option => option.hidden),
108
107
  options,
@@ -4,8 +4,10 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid
5
5
  import uuid from 'uuid';
6
6
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
7
+ import { isCSSAnchorSupported, isCSSAttrAnchorSupported } from '@atlaskit/editor-common/styles';
7
8
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
8
9
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
9
11
  var ObjHash = /*#__PURE__*/function () {
10
12
  function ObjHash() {
11
13
  _classCallCheck(this, ObjHash);
@@ -38,7 +40,12 @@ var createTableAnchorDecorations = function createTableAnchorDecorations(state)
38
40
  // only apply to header cells and the first row of a table, for performance reasons
39
41
  if (isTableRow && index === 0 || isTableHeader) {
40
42
  var anchorName = getNodeAnchor(node);
41
- decs.push(Decoration.node(pos, pos + node.nodeSize, {
43
+ var shouldAddAnchorNameInDecoration = !isCSSAttrAnchorSupported() && isCSSAnchorSupported() && fg('platform_editor_table_sticky_header_patch_8');
44
+ var attributes = {
45
+ 'data-node-anchor': anchorName,
46
+ 'style': "anchor-name: ".concat(anchorName, ";")
47
+ };
48
+ decs.push(Decoration.node(pos, pos + node.nodeSize, shouldAddAnchorNameInDecoration ? attributes : {
42
49
  'data-node-anchor': anchorName
43
50
  }));
44
51
  }
@@ -106,8 +106,7 @@ export var getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _
106
106
  id: 'editor.table.tableOptions',
107
107
  type: 'dropdown',
108
108
  testId: 'table_options',
109
- icon: fg('platform-visual-refresh-icons') ? undefined : CustomizeIcon,
110
- iconBefore: fg('platform-visual-refresh-icons') ? CustomizeIcon : undefined,
109
+ iconBefore: CustomizeIcon,
111
110
  title: formatMessage(messages.tableOptions),
112
111
  hidden: options.every(function (option) {
113
112
  return option.hidden;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "16.0.3",
3
+ "version": "16.1.0",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -70,7 +70,7 @@
70
70
  "uuid": "^3.1.0"
71
71
  },
72
72
  "peerDependencies": {
73
- "@atlaskit/editor-common": "^111.0.0",
73
+ "@atlaskit/editor-common": "^111.1.0",
74
74
  "react": "^18.2.0",
75
75
  "react-dom": "^18.2.0",
76
76
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -172,6 +172,9 @@
172
172
  },
173
173
  "platform_editor_table_sticky_header_patch_7": {
174
174
  "type": "boolean"
175
+ },
176
+ "platform_editor_table_sticky_header_patch_8": {
177
+ "type": "boolean"
175
178
  }
176
179
  }
177
180
  }