@atlaskit/editor-plugin-tasks-and-decisions 11.0.1 → 11.0.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,17 @@
1
1
  # @atlaskit/editor-plugin-tasks-and-decisions
2
2
 
3
+ ## 11.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 11.0.2
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 11.0.1
4
16
 
5
17
  ### Patch Changes
@@ -14,6 +14,7 @@ var _model = require("@atlaskit/editor-prosemirror/model");
14
14
  var _state = require("@atlaskit/editor-prosemirror/state");
15
15
  var _transform = require("@atlaskit/editor-prosemirror/transform");
16
16
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
17
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
18
  var _pluginKey = require("./plugin-key");
18
19
  var _types = require("./types");
19
20
  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; }
@@ -38,13 +39,14 @@ var generateAnalyticsPayload = function generateAnalyticsPayload(listType, conte
38
39
  objectId = contextData.objectId;
39
40
  userContext = contextData.userContext;
40
41
  }
42
+ var resolvedInputMethod = (0, _platformFeatureFlags.fg)('platform_editor_element_browser_analytic') ? inputMethod : _analytics.INPUT_METHOD.QUICK_INSERT;
41
43
  return {
42
44
  action: _analytics.ACTION.INSERTED,
43
45
  actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
44
46
  actionSubjectId: listType === 'taskList' ? _analytics.ACTION_SUBJECT_ID.ACTION : _analytics.ACTION_SUBJECT_ID.DECISION,
45
47
  eventType: _analytics.EVENT_TYPE.TRACK,
46
48
  attributes: {
47
- inputMethod: inputMethod,
49
+ inputMethod: resolvedInputMethod,
48
50
  containerAri: containerId,
49
51
  objectAri: objectId,
50
52
  userContext: userContext,
@@ -341,9 +341,9 @@ var tasksAndDecisionsPlugin = exports.tasksAndDecisionsPlugin = function tasksAn
341
341
  icon: function icon() {
342
342
  return /*#__PURE__*/React.createElement(_quickInsert.IconAction, null);
343
343
  },
344
- action: function action(insert, state) {
344
+ action: function action(insert, state, source) {
345
345
  var _api$analytics6;
346
- return (0, _insertCommands.insertTaskDecisionAction)(api === null || api === void 0 || (_api$analytics6 = api.analytics) === null || _api$analytics6 === void 0 ? void 0 : _api$analytics6.actions, getIdentifierProvider)(state, 'taskList', _analytics.INPUT_METHOD.QUICK_INSERT, addItem(insert, 'taskList', state.schema));
346
+ return (0, _insertCommands.insertTaskDecisionAction)(api === null || api === void 0 || (_api$analytics6 = api.analytics) === null || _api$analytics6 === void 0 ? void 0 : _api$analytics6.actions, getIdentifierProvider)(state, 'taskList', source !== null && source !== void 0 ? source : _analytics.INPUT_METHOD.QUICK_INSERT, addItem(insert, 'taskList', state.schema));
347
347
  }
348
348
  }, {
349
349
  id: 'decision',
@@ -354,9 +354,9 @@ var tasksAndDecisionsPlugin = exports.tasksAndDecisionsPlugin = function tasksAn
354
354
  icon: function icon() {
355
355
  return /*#__PURE__*/React.createElement(_quickInsert.IconDecision, null);
356
356
  },
357
- action: function action(insert, state) {
357
+ action: function action(insert, state, source) {
358
358
  var _api$analytics7;
359
- return (0, _insertCommands.insertTaskDecisionAction)(api === null || api === void 0 || (_api$analytics7 = api.analytics) === null || _api$analytics7 === void 0 ? void 0 : _api$analytics7.actions, getIdentifierProvider)(state, 'decisionList', _analytics.INPUT_METHOD.QUICK_INSERT, addItem(insert, 'decisionList', state.schema));
359
+ return (0, _insertCommands.insertTaskDecisionAction)(api === null || api === void 0 || (_api$analytics7 = api.analytics) === null || _api$analytics7 === void 0 ? void 0 : _api$analytics7.actions, getIdentifierProvider)(state, 'decisionList', source !== null && source !== void 0 ? source : _analytics.INPUT_METHOD.QUICK_INSERT, addItem(insert, 'decisionList', state.schema));
360
360
  }
361
361
  }];
362
362
  }
@@ -6,6 +6,7 @@ import { NodeRange } from '@atlaskit/editor-prosemirror/model';
6
6
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { liftTarget } from '@atlaskit/editor-prosemirror/transform';
8
8
  import { findParentNodeOfType, hasParentNodeOfType, replaceParentNodeOfType, safeInsert, setTextSelection } from '@atlaskit/editor-prosemirror/utils';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { stateKey } from './plugin-key';
10
11
  import { ACTIONS } from './types';
11
12
  const getContextData = (contextProvider = {}) => {
@@ -31,13 +32,14 @@ const generateAnalyticsPayload = (listType, contextData, inputMethod, itemLocalI
31
32
  userContext
32
33
  } = contextData);
33
34
  }
35
+ const resolvedInputMethod = fg('platform_editor_element_browser_analytic') ? inputMethod : INPUT_METHOD.QUICK_INSERT;
34
36
  return {
35
37
  action: ACTION.INSERTED,
36
38
  actionSubject: ACTION_SUBJECT.DOCUMENT,
37
39
  actionSubjectId: listType === 'taskList' ? ACTION_SUBJECT_ID.ACTION : ACTION_SUBJECT_ID.DECISION,
38
40
  eventType: EVENT_TYPE.TRACK,
39
41
  attributes: {
40
- inputMethod,
42
+ inputMethod: resolvedInputMethod,
41
43
  containerAri: containerId,
42
44
  objectAri: objectId,
43
45
  userContext,
@@ -303,9 +303,9 @@ export const tasksAndDecisionsPlugin = ({
303
303
  keywords: ['checkbox', 'task', 'todo'],
304
304
  keyshortcut: '[]',
305
305
  icon: () => /*#__PURE__*/React.createElement(IconAction, null),
306
- action(insert, state) {
306
+ action(insert, state, source) {
307
307
  var _api$analytics6;
308
- return insertTaskDecisionAction(api === null || api === void 0 ? void 0 : (_api$analytics6 = api.analytics) === null || _api$analytics6 === void 0 ? void 0 : _api$analytics6.actions, getIdentifierProvider)(state, 'taskList', INPUT_METHOD.QUICK_INSERT, addItem(insert, 'taskList', state.schema));
308
+ return insertTaskDecisionAction(api === null || api === void 0 ? void 0 : (_api$analytics6 = api.analytics) === null || _api$analytics6 === void 0 ? void 0 : _api$analytics6.actions, getIdentifierProvider)(state, 'taskList', source !== null && source !== void 0 ? source : INPUT_METHOD.QUICK_INSERT, addItem(insert, 'taskList', state.schema));
309
309
  }
310
310
  }, {
311
311
  id: 'decision',
@@ -314,9 +314,9 @@ export const tasksAndDecisionsPlugin = ({
314
314
  priority: 900,
315
315
  keyshortcut: '<>',
316
316
  icon: () => /*#__PURE__*/React.createElement(IconDecision, null),
317
- action(insert, state) {
317
+ action(insert, state, source) {
318
318
  var _api$analytics7;
319
- return insertTaskDecisionAction(api === null || api === void 0 ? void 0 : (_api$analytics7 = api.analytics) === null || _api$analytics7 === void 0 ? void 0 : _api$analytics7.actions, getIdentifierProvider)(state, 'decisionList', INPUT_METHOD.QUICK_INSERT, addItem(insert, 'decisionList', state.schema));
319
+ return insertTaskDecisionAction(api === null || api === void 0 ? void 0 : (_api$analytics7 = api.analytics) === null || _api$analytics7 === void 0 ? void 0 : _api$analytics7.actions, getIdentifierProvider)(state, 'decisionList', source !== null && source !== void 0 ? source : INPUT_METHOD.QUICK_INSERT, addItem(insert, 'decisionList', state.schema));
320
320
  }
321
321
  }]
322
322
  }
@@ -9,6 +9,7 @@ import { NodeRange } from '@atlaskit/editor-prosemirror/model';
9
9
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
10
10
  import { liftTarget } from '@atlaskit/editor-prosemirror/transform';
11
11
  import { findParentNodeOfType, hasParentNodeOfType, replaceParentNodeOfType, safeInsert, setTextSelection } from '@atlaskit/editor-prosemirror/utils';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
12
13
  import { stateKey } from './plugin-key';
13
14
  import { ACTIONS } from './types';
14
15
  var getContextData = function getContextData() {
@@ -31,13 +32,14 @@ var generateAnalyticsPayload = function generateAnalyticsPayload(listType, conte
31
32
  objectId = contextData.objectId;
32
33
  userContext = contextData.userContext;
33
34
  }
35
+ var resolvedInputMethod = fg('platform_editor_element_browser_analytic') ? inputMethod : INPUT_METHOD.QUICK_INSERT;
34
36
  return {
35
37
  action: ACTION.INSERTED,
36
38
  actionSubject: ACTION_SUBJECT.DOCUMENT,
37
39
  actionSubjectId: listType === 'taskList' ? ACTION_SUBJECT_ID.ACTION : ACTION_SUBJECT_ID.DECISION,
38
40
  eventType: EVENT_TYPE.TRACK,
39
41
  attributes: {
40
- inputMethod: inputMethod,
42
+ inputMethod: resolvedInputMethod,
41
43
  containerAri: containerId,
42
44
  objectAri: objectId,
43
45
  userContext: userContext,
@@ -332,9 +332,9 @@ export var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref3) {
332
332
  icon: function icon() {
333
333
  return /*#__PURE__*/React.createElement(IconAction, null);
334
334
  },
335
- action: function action(insert, state) {
335
+ action: function action(insert, state, source) {
336
336
  var _api$analytics6;
337
- return insertTaskDecisionAction(api === null || api === void 0 || (_api$analytics6 = api.analytics) === null || _api$analytics6 === void 0 ? void 0 : _api$analytics6.actions, getIdentifierProvider)(state, 'taskList', INPUT_METHOD.QUICK_INSERT, addItem(insert, 'taskList', state.schema));
337
+ return insertTaskDecisionAction(api === null || api === void 0 || (_api$analytics6 = api.analytics) === null || _api$analytics6 === void 0 ? void 0 : _api$analytics6.actions, getIdentifierProvider)(state, 'taskList', source !== null && source !== void 0 ? source : INPUT_METHOD.QUICK_INSERT, addItem(insert, 'taskList', state.schema));
338
338
  }
339
339
  }, {
340
340
  id: 'decision',
@@ -345,9 +345,9 @@ export var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref3) {
345
345
  icon: function icon() {
346
346
  return /*#__PURE__*/React.createElement(IconDecision, null);
347
347
  },
348
- action: function action(insert, state) {
348
+ action: function action(insert, state, source) {
349
349
  var _api$analytics7;
350
- return insertTaskDecisionAction(api === null || api === void 0 || (_api$analytics7 = api.analytics) === null || _api$analytics7 === void 0 ? void 0 : _api$analytics7.actions, getIdentifierProvider)(state, 'decisionList', INPUT_METHOD.QUICK_INSERT, addItem(insert, 'decisionList', state.schema));
350
+ return insertTaskDecisionAction(api === null || api === void 0 || (_api$analytics7 = api.analytics) === null || _api$analytics7 === void 0 ? void 0 : _api$analytics7.actions, getIdentifierProvider)(state, 'decisionList', source !== null && source !== void 0 ? source : INPUT_METHOD.QUICK_INSERT, addItem(insert, 'decisionList', state.schema));
351
351
  }
352
352
  }];
353
353
  }
@@ -9,8 +9,8 @@ export declare const getListTypes: (listType: TaskDecisionListType, schema: Sche
9
9
  item: NodeType;
10
10
  list: NodeType;
11
11
  };
12
- export declare const insertTaskDecisionAction: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (state: EditorState, listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string, itemAttrs?: AddItemAttrs) => Transaction;
13
- export declare const insertTaskDecisionCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string) => Command;
12
+ export declare const insertTaskDecisionAction: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (state: EditorState, listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.ELEMENT_BROWSER | TaskDecisionInputMethod, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string, itemAttrs?: AddItemAttrs) => Transaction;
13
+ export declare const insertTaskDecisionCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.ELEMENT_BROWSER | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string) => Command;
14
14
  export declare const insertTaskDecisionWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (state: EditorState, listType: TaskDecisionListType, inputMethod: TaskDecisionInputMethod, addAndCreateList: AddItemTransactionCreator, addToList?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string, itemAttrs?: AddItemAttrs) => Transaction | null;
15
15
  export declare const isSupportedSourceNode: (schema: Schema, selection: Selection) => boolean;
16
16
  export declare const changeInDepth: (before: ResolvedPos, after: ResolvedPos) => number;
@@ -7,7 +7,7 @@ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/stat
7
7
  import { type DecorationSet } from '@atlaskit/editor-prosemirror/view';
8
8
  import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
9
9
  export type TaskDecisionListType = 'taskList' | 'decisionList';
10
- export type TaskDecisionInputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD;
10
+ export type TaskDecisionInputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD | INPUT_METHOD.ELEMENT_BROWSER;
11
11
  export type ContextData = {
12
12
  containerId: string;
13
13
  objectId: string;
@@ -9,8 +9,8 @@ export declare const getListTypes: (listType: TaskDecisionListType, schema: Sche
9
9
  item: NodeType;
10
10
  list: NodeType;
11
11
  };
12
- export declare const insertTaskDecisionAction: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (state: EditorState, listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string, itemAttrs?: AddItemAttrs) => Transaction;
13
- export declare const insertTaskDecisionCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string) => Command;
12
+ export declare const insertTaskDecisionAction: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (state: EditorState, listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.ELEMENT_BROWSER | TaskDecisionInputMethod, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string, itemAttrs?: AddItemAttrs) => Transaction;
13
+ export declare const insertTaskDecisionCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.ELEMENT_BROWSER | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string) => Command;
14
14
  export declare const insertTaskDecisionWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (state: EditorState, listType: TaskDecisionListType, inputMethod: TaskDecisionInputMethod, addAndCreateList: AddItemTransactionCreator, addToList?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string, itemAttrs?: AddItemAttrs) => Transaction | null;
15
15
  export declare const isSupportedSourceNode: (schema: Schema, selection: Selection) => boolean;
16
16
  export declare const changeInDepth: (before: ResolvedPos, after: ResolvedPos) => number;
@@ -7,7 +7,7 @@ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/stat
7
7
  import { type DecorationSet } from '@atlaskit/editor-prosemirror/view';
8
8
  import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
9
9
  export type TaskDecisionListType = 'taskList' | 'decisionList';
10
- export type TaskDecisionInputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD;
10
+ export type TaskDecisionInputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD | INPUT_METHOD.ELEMENT_BROWSER;
11
11
  export type ContextData = {
12
12
  containerId: string;
13
13
  objectId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-tasks-and-decisions",
3
- "version": "11.0.1",
3
+ "version": "11.0.3",
4
4
  "description": "Tasks and decisions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -49,14 +49,14 @@
49
49
  "@atlaskit/primitives": "^18.0.0",
50
50
  "@atlaskit/prosemirror-input-rules": "^3.6.0",
51
51
  "@atlaskit/task-decision": "^19.3.0",
52
- "@atlaskit/tmp-editor-statsig": "^36.0.0",
52
+ "@atlaskit/tmp-editor-statsig": "^38.0.0",
53
53
  "@atlaskit/tokens": "^11.1.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@compiled/react": "^0.20.0",
56
56
  "bind-event-listener": "^3.0.0"
57
57
  },
58
58
  "peerDependencies": {
59
- "@atlaskit/editor-common": "^112.0.0",
59
+ "@atlaskit/editor-common": "^112.2.0",
60
60
  "react": "^18.2.0",
61
61
  "react-dom": "^18.2.0",
62
62
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -101,6 +101,9 @@
101
101
  }
102
102
  },
103
103
  "platform-feature-flags": {
104
+ "platform_editor_element_browser_analytic": {
105
+ "type": "boolean"
106
+ },
104
107
  "platform_editor_blocktaskitem_patch_2": {
105
108
  "type": "boolean"
106
109
  },