@atlaskit/editor-plugin-tasks-and-decisions 29.0.6 → 30.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,5 +1,31 @@
1
1
  # @atlaskit/editor-plugin-tasks-and-decisions
2
2
 
3
+ ## 30.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 29.0.9
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 29.0.8
16
+
17
+ ### Patch Changes
18
+
19
+ - [`de7a00d09c978`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/de7a00d09c978) -
20
+ Clean up experiment `platform_editor_blocktaskitem_node_tenantid`
21
+ - Updated dependencies
22
+
23
+ ## 29.0.7
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+
3
29
  ## 29.0.6
4
30
 
5
31
  ### Patch Changes
@@ -12,7 +12,6 @@ var _bindEventListener = require("bind-event-listener");
12
12
  var _setAttrs = require("@atlaskit/adf-schema/steps/set-attrs");
13
13
  var _tasksAndDecisions = require("@atlaskit/editor-common/messages/tasks-and-decisions");
14
14
  var _model = require("@atlaskit/editor-prosemirror/model");
15
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
16
15
  var _helpers = require("../pm-plugins/helpers");
17
16
  var _taskItemNodeSpec = require("./taskItemNodeSpec");
18
17
  var _utils = require("./utils");
@@ -112,20 +111,12 @@ var TaskItemNodeView = exports.TaskItemNodeView = /*#__PURE__*/function () {
112
111
  }
113
112
  return undefined;
114
113
  }
115
- }, {
116
- key: "isContentEmpty",
117
- value: function isContentEmpty(node) {
118
- return node.content.childCount === 0;
119
- }
120
-
121
- // Update the placeholder visibility based on content
122
114
  }, {
123
115
  key: "updatePlaceholder",
124
- value: function updatePlaceholder(node) {
125
- var currentIsContentEmpty = this.isContentEmpty(node);
126
- if ((0, _expValEquals.expValEquals)('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true)) {
127
- currentIsContentEmpty = (0, _utils.isContentEmpty)(node);
128
- }
116
+ value:
117
+ // Update the placeholder visibility based on content
118
+ function updatePlaceholder(node) {
119
+ var currentIsContentEmpty = (0, _utils.isContentEmpty)(node);
129
120
  if (currentIsContentEmpty !== this.emptyContent) {
130
121
  var _this$contentDOM;
131
122
  this.emptyContent = currentIsContentEmpty;
@@ -8,7 +8,6 @@ exports.taskItemToDom = taskItemToDom;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _tasksAndDecisions = require("@atlaskit/editor-common/messages/tasks-and-decisions");
10
10
  var _taskDecision = require("@atlaskit/editor-common/styles/task-decision");
11
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
12
11
  var _utils = require("./utils");
13
12
  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; }
14
13
  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; }
@@ -44,14 +43,9 @@ function taskItemToDom(node, placeholder, intl) {
44
43
  }, node.type.name === 'blockTaskItem' ? {
45
44
  'data-task-is-block': 'true'
46
45
  } : {});
47
- var contentDomDataAttrs = node.content.childCount > 0 ? {} : {
46
+ var contentDomDataAttrs = (0, _utils.isContentEmpty)(node) ? {
48
47
  'data-empty': 'true'
49
- };
50
- if ((0, _expValEquals.expValEquals)('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true)) {
51
- contentDomDataAttrs = (0, _utils.isContentEmpty)(node) ? {
52
- 'data-empty': 'true'
53
- } : {};
54
- }
48
+ } : {};
55
49
  var checkboxIcons = ['http://www.w3.org/2000/svg svg', {
56
50
  width: '20',
57
51
  height: '20',
@@ -15,7 +15,6 @@ var _selection2 = require("@atlaskit/editor-common/selection/gap-cursor/selectio
15
15
  var _utils = require("@atlaskit/editor-common/utils");
16
16
  var _state = require("@atlaskit/editor-prosemirror/state");
17
17
  var _view = require("@atlaskit/editor-prosemirror/view");
18
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
19
18
  var _DecisionItemNodeView = require("../nodeviews/DecisionItemNodeView");
20
19
  var _taskNodeView = require("../nodeviews/task-node-view");
21
20
  var _actions = require("./actions");
@@ -44,14 +43,13 @@ function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api, getIntl
44
43
  var taskPlaceholder = arguments.length > 9 ? arguments[9] : undefined;
45
44
  return new _safePlugin.SafePlugin({
46
45
  props: {
47
- nodeViews: _objectSpread({
46
+ nodeViews: {
48
47
  taskItem: (0, _taskNodeView.taskView)(api, getIntl(), taskPlaceholder),
49
48
  decisionItem: function (node) {
50
49
  return new _DecisionItemNodeView.DecisionItemNodeView(node, getIntl());
51
- }
52
- }, (0, _expValEquals.expValEquals)('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true) ? {
50
+ },
53
51
  blockTaskItem: (0, _taskNodeView.taskView)(api, getIntl(), taskPlaceholder)
54
- } : {}),
52
+ },
55
53
  decorations: function decorations(state) {
56
54
  var pluginState = _pluginKey.stateKey.getState(state);
57
55
  if (pluginState !== null && pluginState !== void 0 && pluginState.decorations) {
@@ -27,7 +27,6 @@ var _insertBlock = require("@atlaskit/editor-common/messages/insert-block");
27
27
  var _useSharedPluginStateSelector = require("@atlaskit/editor-common/useSharedPluginStateSelector");
28
28
  var _utils = require("@atlaskit/editor-prosemirror/utils");
29
29
  var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
30
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
31
30
  var _helpers = require("./pm-plugins/helpers");
32
31
  var _inputRules = _interopRequireDefault(require("./pm-plugins/input-rules"));
33
32
  var _insertCommands = require("./pm-plugins/insert-commands");
@@ -193,7 +192,7 @@ var tasksAndDecisionsPlugin = exports.tasksAndDecisionsPlugin = function tasksAn
193
192
  }, {
194
193
  name: 'taskItem',
195
194
  node: _taskItem.taskItem
196
- }].concat((0, _toConsumableArray2.default)((0, _expValEquals.expValEquals)('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true) && allowBlockTaskItem ? [{
195
+ }].concat((0, _toConsumableArray2.default)(allowBlockTaskItem ? [{
197
196
  name: 'blockTaskItem',
198
197
  node: _taskItem.blockTaskItem
199
198
  }] : []));
@@ -3,7 +3,6 @@ import { bindAll } from 'bind-event-listener';
3
3
  import { SetAttrsStep } from '@atlaskit/adf-schema/steps/set-attrs';
4
4
  import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages/tasks-and-decisions';
5
5
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
6
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
6
  import { openRequestEditPopupAt } from '../pm-plugins/helpers';
8
7
  import { taskItemToDom } from './taskItemNodeSpec';
9
8
  import { isContentEmpty } from './utils';
@@ -102,16 +101,9 @@ export class TaskItemNodeView {
102
101
  }
103
102
  return undefined;
104
103
  }
105
- isContentEmpty(node) {
106
- return node.content.childCount === 0;
107
- }
108
-
109
104
  // Update the placeholder visibility based on content
110
105
  updatePlaceholder(node) {
111
- let currentIsContentEmpty = this.isContentEmpty(node);
112
- if (expValEquals('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true)) {
113
- currentIsContentEmpty = isContentEmpty(node);
114
- }
106
+ const currentIsContentEmpty = isContentEmpty(node);
115
107
  if (currentIsContentEmpty !== this.emptyContent) {
116
108
  var _this$contentDOM;
117
109
  this.emptyContent = currentIsContentEmpty;
@@ -1,6 +1,5 @@
1
1
  import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages/tasks-and-decisions';
2
2
  import { TaskDecisionSharedCssClassName } from '@atlaskit/editor-common/styles/task-decision';
3
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
3
  import { isContentEmpty } from './utils';
5
4
  const getCheckBoxId = localId => `task-checkbox-${localId}`;
6
5
 
@@ -33,14 +32,9 @@ export function taskItemToDom(node, placeholder, intl) {
33
32
  'data-task-is-block': 'true'
34
33
  } : {})
35
34
  };
36
- let contentDomDataAttrs = node.content.childCount > 0 ? {} : {
35
+ const contentDomDataAttrs = isContentEmpty(node) ? {
37
36
  'data-empty': 'true'
38
- };
39
- if (expValEquals('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true)) {
40
- contentDomDataAttrs = isContentEmpty(node) ? {
41
- 'data-empty': 'true'
42
- } : {};
43
- }
37
+ } : {};
44
38
  const checkboxIcons = ['http://www.w3.org/2000/svg svg', {
45
39
  width: '20',
46
40
  height: '20',
@@ -6,7 +6,6 @@ import { GapCursorSelection } from '@atlaskit/editor-common/selection/gap-cursor
6
6
  import { getStepRange } from '@atlaskit/editor-common/utils';
7
7
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
8
8
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
9
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
9
  import { DecisionItemNodeView } from '../nodeviews/DecisionItemNodeView';
11
10
  import { taskView } from '../nodeviews/task-node-view';
12
11
  import { focusTaskDecision, openRequestEditPopup, setProvider } from './actions';
@@ -32,9 +31,7 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
32
31
  decisionItem: node => {
33
32
  return new DecisionItemNodeView(node, getIntl());
34
33
  },
35
- ...(expValEquals('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true) ? {
36
- blockTaskItem: taskView(api, getIntl(), taskPlaceholder)
37
- } : {})
34
+ blockTaskItem: taskView(api, getIntl(), taskPlaceholder)
38
35
  },
39
36
  decorations(state) {
40
37
  const pluginState = stateKey.getState(state);
@@ -15,7 +15,6 @@ import { toolbarInsertBlockMessages as insertBlockMessages } from '@atlaskit/edi
15
15
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/useSharedPluginStateSelector';
16
16
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
17
17
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
18
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
19
18
  import { closeRequestEditPopupAt, getCurrentIndentLevel, isInsideTask } from './pm-plugins/helpers';
20
19
  // Ignored via go/ees005
21
20
  // eslint-disable-next-line import/no-named-as-default
@@ -179,7 +178,7 @@ export const tasksAndDecisionsPlugin = ({
179
178
  }, {
180
179
  name: 'taskItem',
181
180
  node: taskItem
182
- }, ...(expValEquals('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true) && allowBlockTaskItem ? [{
181
+ }, ...(allowBlockTaskItem ? [{
183
182
  name: 'blockTaskItem',
184
183
  node: blockTaskItem
185
184
  }] : [])];
@@ -5,7 +5,6 @@ import { bindAll } from 'bind-event-listener';
5
5
  import { SetAttrsStep } from '@atlaskit/adf-schema/steps/set-attrs';
6
6
  import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages/tasks-and-decisions';
7
7
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
8
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
8
  import { openRequestEditPopupAt } from '../pm-plugins/helpers';
10
9
  import { taskItemToDom } from './taskItemNodeSpec';
11
10
  import { isContentEmpty } from './utils';
@@ -105,20 +104,12 @@ export var TaskItemNodeView = /*#__PURE__*/function () {
105
104
  }
106
105
  return undefined;
107
106
  }
108
- }, {
109
- key: "isContentEmpty",
110
- value: function isContentEmpty(node) {
111
- return node.content.childCount === 0;
112
- }
113
-
114
- // Update the placeholder visibility based on content
115
107
  }, {
116
108
  key: "updatePlaceholder",
117
- value: function updatePlaceholder(node) {
118
- var currentIsContentEmpty = this.isContentEmpty(node);
119
- if (expValEquals('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true)) {
120
- currentIsContentEmpty = isContentEmpty(node);
121
- }
109
+ value:
110
+ // Update the placeholder visibility based on content
111
+ function updatePlaceholder(node) {
112
+ var currentIsContentEmpty = isContentEmpty(node);
122
113
  if (currentIsContentEmpty !== this.emptyContent) {
123
114
  var _this$contentDOM;
124
115
  this.emptyContent = currentIsContentEmpty;
@@ -3,7 +3,6 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  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) { _defineProperty(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; }
4
4
  import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages/tasks-and-decisions';
5
5
  import { TaskDecisionSharedCssClassName } from '@atlaskit/editor-common/styles/task-decision';
6
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
6
  import { isContentEmpty } from './utils';
8
7
  var getCheckBoxId = function getCheckBoxId(localId) {
9
8
  return "task-checkbox-".concat(localId);
@@ -37,14 +36,9 @@ export function taskItemToDom(node, placeholder, intl) {
37
36
  }, node.type.name === 'blockTaskItem' ? {
38
37
  'data-task-is-block': 'true'
39
38
  } : {});
40
- var contentDomDataAttrs = node.content.childCount > 0 ? {} : {
39
+ var contentDomDataAttrs = isContentEmpty(node) ? {
41
40
  'data-empty': 'true'
42
- };
43
- if (expValEquals('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true)) {
44
- contentDomDataAttrs = isContentEmpty(node) ? {
45
- 'data-empty': 'true'
46
- } : {};
47
- }
41
+ } : {};
48
42
  var checkboxIcons = ['http://www.w3.org/2000/svg svg', {
49
43
  width: '20',
50
44
  height: '20',
@@ -11,7 +11,6 @@ import { GapCursorSelection } from '@atlaskit/editor-common/selection/gap-cursor
11
11
  import { getStepRange } from '@atlaskit/editor-common/utils';
12
12
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
13
13
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
14
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
14
  import { DecisionItemNodeView } from '../nodeviews/DecisionItemNodeView';
16
15
  import { taskView } from '../nodeviews/task-node-view';
17
16
  import { focusTaskDecision, openRequestEditPopup, setProvider } from './actions';
@@ -37,14 +36,13 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
37
36
  var taskPlaceholder = arguments.length > 9 ? arguments[9] : undefined;
38
37
  return new SafePlugin({
39
38
  props: {
40
- nodeViews: _objectSpread({
39
+ nodeViews: {
41
40
  taskItem: taskView(api, getIntl(), taskPlaceholder),
42
41
  decisionItem: function (node) {
43
42
  return new DecisionItemNodeView(node, getIntl());
44
- }
45
- }, expValEquals('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true) ? {
43
+ },
46
44
  blockTaskItem: taskView(api, getIntl(), taskPlaceholder)
47
- } : {}),
45
+ },
48
46
  decorations: function decorations(state) {
49
47
  var pluginState = stateKey.getState(state);
50
48
  if (pluginState !== null && pluginState !== void 0 && pluginState.decorations) {
@@ -21,7 +21,6 @@ import { toolbarInsertBlockMessages as insertBlockMessages } from '@atlaskit/edi
21
21
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/useSharedPluginStateSelector';
22
22
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
23
23
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
24
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
25
24
  import { closeRequestEditPopupAt, getCurrentIndentLevel, isInsideTask } from './pm-plugins/helpers';
26
25
  // Ignored via go/ees005
27
26
  // eslint-disable-next-line import/no-named-as-default
@@ -185,7 +184,7 @@ export var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref3) {
185
184
  }, {
186
185
  name: 'taskItem',
187
186
  node: taskItem
188
- }].concat(_toConsumableArray(expValEquals('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true) && allowBlockTaskItem ? [{
187
+ }].concat(_toConsumableArray(allowBlockTaskItem ? [{
189
188
  name: 'blockTaskItem',
190
189
  node: blockTaskItem
191
190
  }] : []));
@@ -26,7 +26,6 @@ export declare class TaskItemNodeView implements NodeView {
26
26
  private getObjectAri;
27
27
  private handleOnClick;
28
28
  private handleOnChange;
29
- private isContentEmpty;
30
29
  private updatePlaceholder;
31
30
  update(node: PMNode): boolean;
32
31
  ignoreMutation(mutation: MutationRecord | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-tasks-and-decisions",
3
- "version": "29.0.6",
3
+ "version": "30.0.0",
4
4
  "description": "Tasks and decisions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,13 +29,13 @@
29
29
  "@atlaskit/adf-schema": "^57.7.0",
30
30
  "@atlaskit/analytics-namespaced-context": "^8.2.0",
31
31
  "@atlaskit/css": "^1.1.0",
32
- "@atlaskit/editor-plugin-analytics": "^26.0.0",
33
- "@atlaskit/editor-plugin-block-menu": "^25.1.0",
34
- "@atlaskit/editor-plugin-context-identifier": "^26.0.0",
35
- "@atlaskit/editor-plugin-editor-viewmode": "^28.0.0",
36
- "@atlaskit/editor-plugin-selection": "^26.0.0",
37
- "@atlaskit/editor-plugin-toolbar": "^23.0.0",
38
- "@atlaskit/editor-plugin-type-ahead": "^27.0.0",
32
+ "@atlaskit/editor-plugin-analytics": "^27.0.0",
33
+ "@atlaskit/editor-plugin-block-menu": "^26.0.0",
34
+ "@atlaskit/editor-plugin-context-identifier": "^27.0.0",
35
+ "@atlaskit/editor-plugin-editor-viewmode": "^29.0.0",
36
+ "@atlaskit/editor-plugin-selection": "^27.0.0",
37
+ "@atlaskit/editor-plugin-toolbar": "^24.0.0",
38
+ "@atlaskit/editor-plugin-type-ahead": "^28.0.0",
39
39
  "@atlaskit/editor-prosemirror": "^9.0.0",
40
40
  "@atlaskit/editor-shared-styles": "^4.4.0",
41
41
  "@atlaskit/editor-toolbar": "^2.8.0",
@@ -47,14 +47,14 @@
47
47
  "@atlaskit/primitives": "^22.5.0",
48
48
  "@atlaskit/prosemirror-input-rules": "^4.1.0",
49
49
  "@atlaskit/task-decision": "^21.12.0",
50
- "@atlaskit/tmp-editor-statsig": "^232.0.0",
51
- "@atlaskit/tokens": "^20.4.0",
50
+ "@atlaskit/tmp-editor-statsig": "^235.0.0",
51
+ "@atlaskit/tokens": "^20.5.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "@compiled/react": "^1.0.2",
54
54
  "bind-event-listener": "^3.0.0"
55
55
  },
56
56
  "peerDependencies": {
57
- "@atlaskit/editor-common": "^130.3.0",
57
+ "@atlaskit/editor-common": "^131.0.0",
58
58
  "react": "^18.2.0 || ^19.2.0",
59
59
  "react-dom": "^18.2.0 || ^19.2.0",
60
60
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"