@atlaskit/editor-plugin-table 7.25.18 → 7.25.19

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,14 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 7.25.19
4
+
5
+ ### Patch Changes
6
+
7
+ - [#136485](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136485)
8
+ [`96d4b8a73c2ea`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/96d4b8a73c2ea) -
9
+ Refactored table styles so that it is inside the tables plugin and not in the editors critical
10
+ path.
11
+
3
12
  ## 7.25.18
4
13
 
5
14
  ### Patch Changes
@@ -45,6 +45,7 @@ var _FloatingDeleteButton = _interopRequireDefault(require("./ui/FloatingDeleteB
45
45
  var _FloatingDragMenu = _interopRequireDefault(require("./ui/FloatingDragMenu"));
46
46
  var _FloatingInsertButton = _interopRequireDefault(require("./ui/FloatingInsertButton"));
47
47
  var _FloatingToolbarLabel = require("./ui/FloatingToolbarLabel/FloatingToolbarLabel");
48
+ var _globalStyles = require("./ui/global-styles");
48
49
  var _TableFullWidthLabel = require("./ui/TableFullWidthLabel");
49
50
  var _utils = require("./utils");
50
51
  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; }
@@ -335,6 +336,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
335
336
  return plugins;
336
337
  },
337
338
  contentComponent: function contentComponent(_ref17) {
339
+ var _api$featureFlags;
338
340
  var editorView = _ref17.editorView,
339
341
  popupsMountPoint = _ref17.popupsMountPoint,
340
342
  popupsBoundariesElement = _ref17.popupsBoundariesElement,
@@ -344,7 +346,9 @@ var tablesPlugin = function tablesPlugin(_ref) {
344
346
  component: _analytics.ACTION_SUBJECT.TABLES_PLUGIN,
345
347
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
346
348
  fallbackComponent: null
347
- }, /*#__PURE__*/_react.default.createElement(_withPluginState.WithPluginState, {
349
+ }, /*#__PURE__*/_react.default.createElement(_globalStyles.GlobalStylesWrapper, {
350
+ featureFlags: api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()
351
+ }), /*#__PURE__*/_react.default.createElement(_withPluginState.WithPluginState, {
348
352
  plugins: {
349
353
  tableAnalyticsPluginState: _pluginKey.pluginKey,
350
354
  tablePluginState: _pluginKey2.pluginKey,
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.GlobalStylesWrapper = void 0;
7
+ var _react = require("@emotion/react");
8
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
+ var _commonStyles = require("./common-styles");
10
+ /**
11
+ * @jsxRuntime classic
12
+ * @jsx jsx
13
+ */
14
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
15
+
16
+ var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWrapper(_ref) {
17
+ var featureFlags = _ref.featureFlags;
18
+ return (0, _platformFeatureFlags.fg)('platform_editor_move_table_styles_to_plugin') ? (0, _react.jsx)(_react.Global, {
19
+ styles: (0, _commonStyles.tableStyles)({
20
+ featureFlags: featureFlags
21
+ })
22
+ }) : null;
23
+ };
@@ -37,6 +37,7 @@ import FloatingDeleteButton from './ui/FloatingDeleteButton';
37
37
  import FloatingDragMenu from './ui/FloatingDragMenu';
38
38
  import FloatingInsertButton from './ui/FloatingInsertButton';
39
39
  import { FloatingToolbarLabel } from './ui/FloatingToolbarLabel/FloatingToolbarLabel';
40
+ import { GlobalStylesWrapper } from './ui/global-styles';
40
41
  import { FullWidthDisplay } from './ui/TableFullWidthLabel';
41
42
  import { createTableWithWidth } from './utils';
42
43
  const defaultGetEditorFeatureFlags = () => ({});
@@ -329,11 +330,14 @@ const tablesPlugin = ({
329
330
  popupsScrollableElement,
330
331
  dispatchAnalyticsEvent
331
332
  }) {
333
+ var _api$featureFlags;
332
334
  return /*#__PURE__*/React.createElement(ErrorBoundary, {
333
335
  component: ACTION_SUBJECT.TABLES_PLUGIN,
334
336
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
335
337
  fallbackComponent: null
336
- }, /*#__PURE__*/React.createElement(WithPluginState, {
338
+ }, /*#__PURE__*/React.createElement(GlobalStylesWrapper, {
339
+ featureFlags: api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()
340
+ }), /*#__PURE__*/React.createElement(WithPluginState, {
337
341
  plugins: {
338
342
  tableAnalyticsPluginState: tableAnalyticsPluginKey,
339
343
  tablePluginState: pluginKey,
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
+ import { Global, jsx } from '@emotion/react';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
8
+ import { tableStyles } from './common-styles';
9
+ export const GlobalStylesWrapper = ({
10
+ featureFlags
11
+ }) => {
12
+ return fg('platform_editor_move_table_styles_to_plugin') ? jsx(Global, {
13
+ styles: tableStyles({
14
+ featureFlags
15
+ })
16
+ }) : null;
17
+ };
@@ -40,6 +40,7 @@ import FloatingDeleteButton from './ui/FloatingDeleteButton';
40
40
  import FloatingDragMenu from './ui/FloatingDragMenu';
41
41
  import FloatingInsertButton from './ui/FloatingInsertButton';
42
42
  import { FloatingToolbarLabel } from './ui/FloatingToolbarLabel/FloatingToolbarLabel';
43
+ import { GlobalStylesWrapper } from './ui/global-styles';
43
44
  import { FullWidthDisplay } from './ui/TableFullWidthLabel';
44
45
  import { createTableWithWidth } from './utils';
45
46
  var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
@@ -328,6 +329,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
328
329
  return plugins;
329
330
  },
330
331
  contentComponent: function contentComponent(_ref17) {
332
+ var _api$featureFlags;
331
333
  var editorView = _ref17.editorView,
332
334
  popupsMountPoint = _ref17.popupsMountPoint,
333
335
  popupsBoundariesElement = _ref17.popupsBoundariesElement,
@@ -337,7 +339,9 @@ var tablesPlugin = function tablesPlugin(_ref) {
337
339
  component: ACTION_SUBJECT.TABLES_PLUGIN,
338
340
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
339
341
  fallbackComponent: null
340
- }, /*#__PURE__*/React.createElement(WithPluginState, {
342
+ }, /*#__PURE__*/React.createElement(GlobalStylesWrapper, {
343
+ featureFlags: api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()
344
+ }), /*#__PURE__*/React.createElement(WithPluginState, {
341
345
  plugins: {
342
346
  tableAnalyticsPluginState: tableAnalyticsPluginKey,
343
347
  tablePluginState: pluginKey,
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
+ import { Global, jsx } from '@emotion/react';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
8
+ import { tableStyles } from './common-styles';
9
+ export var GlobalStylesWrapper = function GlobalStylesWrapper(_ref) {
10
+ var featureFlags = _ref.featureFlags;
11
+ return fg('platform_editor_move_table_styles_to_plugin') ? jsx(Global, {
12
+ styles: tableStyles({
13
+ featureFlags: featureFlags
14
+ })
15
+ }) : null;
16
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { jsx } from '@emotion/react';
6
+ import type { FeatureFlags } from '@atlaskit/editor-common/types';
7
+ export declare const GlobalStylesWrapper: ({ featureFlags, }: {
8
+ featureFlags: FeatureFlags | undefined;
9
+ }) => jsx.JSX.Element | null;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { jsx } from '@emotion/react';
6
+ import type { FeatureFlags } from '@atlaskit/editor-common/types';
7
+ export declare const GlobalStylesWrapper: ({ featureFlags, }: {
8
+ featureFlags: FeatureFlags | undefined;
9
+ }) => jsx.JSX.Element | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "7.25.18",
3
+ "version": "7.25.19",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -117,6 +117,9 @@
117
117
  "platform_editor_dark_mode_cell_header_color_fix": {
118
118
  "type": "boolean"
119
119
  },
120
+ "platform_editor_move_table_styles_to_plugin": {
121
+ "type": "boolean"
122
+ },
120
123
  "platform_editor_a11y_table_context_menu": {
121
124
  "type": "boolean"
122
125
  },
package/src/plugin.tsx CHANGED
@@ -82,6 +82,7 @@ import FloatingDeleteButton from './ui/FloatingDeleteButton';
82
82
  import FloatingDragMenu from './ui/FloatingDragMenu';
83
83
  import FloatingInsertButton from './ui/FloatingInsertButton';
84
84
  import { FloatingToolbarLabel } from './ui/FloatingToolbarLabel/FloatingToolbarLabel';
85
+ import { GlobalStylesWrapper } from './ui/global-styles';
85
86
  import { FullWidthDisplay } from './ui/TableFullWidthLabel';
86
87
  import { createTableWithWidth } from './utils';
87
88
 
@@ -515,6 +516,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
515
516
  dispatchAnalyticsEvent={dispatchAnalyticsEvent}
516
517
  fallbackComponent={null}
517
518
  >
519
+ <GlobalStylesWrapper featureFlags={api?.featureFlags?.sharedState.currentState()} />
518
520
  <WithPluginState
519
521
  plugins={{
520
522
  tableAnalyticsPluginState: tableAnalyticsPluginKey,
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
+ import { Global, jsx } from '@emotion/react';
7
+
8
+ import type { FeatureFlags } from '@atlaskit/editor-common/types';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
10
+
11
+ import { tableStyles } from './common-styles';
12
+
13
+ export const GlobalStylesWrapper = ({
14
+ featureFlags,
15
+ }: {
16
+ featureFlags: FeatureFlags | undefined;
17
+ }) => {
18
+ return fg('platform_editor_move_table_styles_to_plugin') ? (
19
+ <Global styles={tableStyles({ featureFlags })} />
20
+ ) : null;
21
+ };