@atlaskit/editor-plugin-table 16.1.4 → 16.1.5

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,13 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 16.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`38de936c97015`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38de936c97015) -
8
+ EDITOR-3707 Fire UI event when native/ legacy sticky headers are enabled
9
+ - Updated dependencies
10
+
3
11
  ## 16.1.4
4
12
 
5
13
  ### Patch Changes
@@ -13,6 +13,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
13
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
14
  var _debounce = _interopRequireDefault(require("lodash/debounce"));
15
15
  var _throttle = _interopRequireDefault(require("lodash/throttle"));
16
+ var _analytics = require("@atlaskit/editor-common/analytics");
16
17
  var _nesting = require("@atlaskit/editor-common/nesting");
17
18
  var _nodeVisibility = require("@atlaskit/editor-common/node-visibility");
18
19
  var _styles = require("@atlaskit/editor-common/styles");
@@ -112,6 +113,7 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
112
113
  var _getPluginState = (0, _pluginFactory.getPluginState)(view.state),
113
114
  pluginConfig = _getPluginState.pluginConfig;
114
115
  _this.isStickyHeaderEnabled = !!pluginConfig.stickyHeaders;
116
+ _this.api = api;
115
117
  if (api !== null && api !== void 0 && (_api$limitedMode = api.limitedMode) !== null && _api$limitedMode !== void 0 && (_api$limitedMode = _api$limitedMode.sharedState.currentState()) !== null && _api$limitedMode !== void 0 && (_api$limitedMode = _api$limitedMode.limitedModePluginKey.getState(view.state)) !== null && _api$limitedMode !== void 0 && _api$limitedMode.documentSizeBreachesThreshold) {
116
118
  _this.isStickyHeaderEnabled = false;
117
119
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
@@ -403,6 +405,18 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
403
405
  _this4.isNativeSticky = false;
404
406
  }
405
407
  _this4.refreshLegacyStickyState();
408
+ if ((0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_patch_9', 'isEnabled', true)) {
409
+ var _this4$api;
410
+ (_this4$api = _this4.api) === null || _this4$api === void 0 || (_this4$api = _this4$api.analytics) === null || _this4$api === void 0 || (_this4$api = _this4$api.actions) === null || _this4$api === void 0 || _this4$api.fireAnalyticsEvent({
411
+ action: _analytics.TABLE_ACTION.STICKY_HEADER_METHOD_TOGGLED,
412
+ actionSubject: _analytics.ACTION_SUBJECT.TABLE,
413
+ actionSubjectId: _analytics.ACTION_SUBJECT_ID.TABLE_STICKY_HEADER,
414
+ eventType: _analytics.EVENT_TYPE.UI,
415
+ attributes: {
416
+ nativeStickyHeaderEnabled: entry.isIntersecting
417
+ }
418
+ });
419
+ }
406
420
  });
407
421
  }, options);
408
422
  }
@@ -1,6 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import debounce from 'lodash/debounce';
3
3
  import throttle from 'lodash/throttle';
4
+ import { ACTION_SUBJECT_ID, ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
4
5
  import { getParentOfTypeCount } from '@atlaskit/editor-common/nesting';
5
6
  import { nodeVisibilityManager } from '@atlaskit/editor-common/node-visibility';
6
7
  import { tableMarginTop } from '@atlaskit/editor-common/styles';
@@ -97,6 +98,7 @@ export default class TableRowNativeStickyWithFallback extends TableNodeView {
97
98
  pluginConfig
98
99
  } = getPluginState(view.state);
99
100
  this.isStickyHeaderEnabled = !!pluginConfig.stickyHeaders;
101
+ this.api = api;
100
102
  if (api !== null && api !== void 0 && (_api$limitedMode = api.limitedMode) !== null && _api$limitedMode !== void 0 && (_api$limitedMode$shar = _api$limitedMode.sharedState.currentState()) !== null && _api$limitedMode$shar !== void 0 && (_api$limitedMode$shar2 = _api$limitedMode$shar.limitedModePluginKey.getState(view.state)) !== null && _api$limitedMode$shar2 !== void 0 && _api$limitedMode$shar2.documentSizeBreachesThreshold) {
101
103
  this.isStickyHeaderEnabled = false;
102
104
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
@@ -372,6 +374,18 @@ export default class TableRowNativeStickyWithFallback extends TableNodeView {
372
374
  this.isNativeSticky = false;
373
375
  }
374
376
  this.refreshLegacyStickyState();
377
+ if (expValEquals('platform_editor_table_sticky_header_patch_9', 'isEnabled', true)) {
378
+ var _this$api, _this$api$analytics, _this$api$analytics$a;
379
+ (_this$api = this.api) === null || _this$api === void 0 ? void 0 : (_this$api$analytics = _this$api.analytics) === null || _this$api$analytics === void 0 ? void 0 : (_this$api$analytics$a = _this$api$analytics.actions) === null || _this$api$analytics$a === void 0 ? void 0 : _this$api$analytics$a.fireAnalyticsEvent({
380
+ action: TABLE_ACTION.STICKY_HEADER_METHOD_TOGGLED,
381
+ actionSubject: ACTION_SUBJECT.TABLE,
382
+ actionSubjectId: ACTION_SUBJECT_ID.TABLE_STICKY_HEADER,
383
+ eventType: EVENT_TYPE.UI,
384
+ attributes: {
385
+ nativeStickyHeaderEnabled: entry.isIntersecting
386
+ }
387
+ });
388
+ }
375
389
  });
376
390
  }, options);
377
391
  }
@@ -8,6 +8,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
8
8
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
9
  import debounce from 'lodash/debounce';
10
10
  import throttle from 'lodash/throttle';
11
+ import { ACTION_SUBJECT_ID, ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
11
12
  import { getParentOfTypeCount } from '@atlaskit/editor-common/nesting';
12
13
  import { nodeVisibilityManager } from '@atlaskit/editor-common/node-visibility';
13
14
  import { tableMarginTop } from '@atlaskit/editor-common/styles';
@@ -105,6 +106,7 @@ var TableRowNativeStickyWithFallback = /*#__PURE__*/function (_ref) {
105
106
  var _getPluginState = getPluginState(view.state),
106
107
  pluginConfig = _getPluginState.pluginConfig;
107
108
  _this.isStickyHeaderEnabled = !!pluginConfig.stickyHeaders;
109
+ _this.api = api;
108
110
  if (api !== null && api !== void 0 && (_api$limitedMode = api.limitedMode) !== null && _api$limitedMode !== void 0 && (_api$limitedMode = _api$limitedMode.sharedState.currentState()) !== null && _api$limitedMode !== void 0 && (_api$limitedMode = _api$limitedMode.limitedModePluginKey.getState(view.state)) !== null && _api$limitedMode !== void 0 && _api$limitedMode.documentSizeBreachesThreshold) {
109
111
  _this.isStickyHeaderEnabled = false;
110
112
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
@@ -396,6 +398,18 @@ var TableRowNativeStickyWithFallback = /*#__PURE__*/function (_ref) {
396
398
  _this4.isNativeSticky = false;
397
399
  }
398
400
  _this4.refreshLegacyStickyState();
401
+ if (expValEquals('platform_editor_table_sticky_header_patch_9', 'isEnabled', true)) {
402
+ var _this4$api;
403
+ (_this4$api = _this4.api) === null || _this4$api === void 0 || (_this4$api = _this4$api.analytics) === null || _this4$api === void 0 || (_this4$api = _this4$api.actions) === null || _this4$api === void 0 || _this4$api.fireAnalyticsEvent({
404
+ action: TABLE_ACTION.STICKY_HEADER_METHOD_TOGGLED,
405
+ actionSubject: ACTION_SUBJECT.TABLE,
406
+ actionSubjectId: ACTION_SUBJECT_ID.TABLE_STICKY_HEADER,
407
+ eventType: EVENT_TYPE.UI,
408
+ attributes: {
409
+ nativeStickyHeaderEnabled: entry.isIntersecting
410
+ }
411
+ });
412
+ }
399
413
  });
400
414
  }, options);
401
415
  }
@@ -28,6 +28,7 @@ export default class TableRowNativeStickyWithFallback extends TableNodeView<HTML
28
28
  private listening;
29
29
  private padding;
30
30
  private top;
31
+ private api?;
31
32
  /** Native sticky header variables */
32
33
  private overflowObserver?;
33
34
  private stickyStateObserver?;
@@ -28,6 +28,7 @@ export default class TableRowNativeStickyWithFallback extends TableNodeView<HTML
28
28
  private listening;
29
29
  private padding;
30
30
  private top;
31
+ private api?;
31
32
  /** Native sticky header variables */
32
33
  private overflowObserver?;
33
34
  private stickyStateObserver?;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "16.1.4",
3
+ "version": "16.1.5",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -48,7 +48,7 @@
48
48
  "@atlaskit/editor-prosemirror": "^7.2.0",
49
49
  "@atlaskit/editor-shared-styles": "^3.10.0",
50
50
  "@atlaskit/editor-tables": "^2.9.0",
51
- "@atlaskit/icon": "^29.3.0",
51
+ "@atlaskit/icon": "^29.4.0",
52
52
  "@atlaskit/insm": "^0.2.0",
53
53
  "@atlaskit/menu": "^8.4.0",
54
54
  "@atlaskit/platform-feature-flags": "^1.1.0",
@@ -57,10 +57,10 @@
57
57
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
58
58
  "@atlaskit/primitives": "^17.0.0",
59
59
  "@atlaskit/theme": "^21.0.0",
60
- "@atlaskit/tmp-editor-statsig": "^16.4.0",
60
+ "@atlaskit/tmp-editor-statsig": "^16.8.0",
61
61
  "@atlaskit/toggle": "^15.2.0",
62
62
  "@atlaskit/tokens": "^9.1.0",
63
- "@atlaskit/tooltip": "^20.11.0",
63
+ "@atlaskit/tooltip": "^20.12.0",
64
64
  "@babel/runtime": "^7.0.0",
65
65
  "@emotion/react": "^11.7.1",
66
66
  "classnames": "^2.2.5",
@@ -70,7 +70,7 @@
70
70
  "uuid": "^3.1.0"
71
71
  },
72
72
  "peerDependencies": {
73
- "@atlaskit/editor-common": "^111.2.0",
73
+ "@atlaskit/editor-common": "^111.6.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"