@atlaskit/editor-plugin-date 10.0.1 → 10.0.2

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-date
2
2
 
3
+ ## 10.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`5985f38f7104e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5985f38f7104e) -
8
+ Update README.md and 0-intro.tsx
9
+ - Updated dependencies
10
+
3
11
  ## 10.0.1
4
12
 
5
13
  ### Patch Changes
package/README.md CHANGED
@@ -1,9 +1,22 @@
1
- # Editor plugin date
1
+ # Editor Plugin Date
2
2
 
3
3
  Date plugin for @atlaskit/editor-core
4
+
4
5
  **Note:** This component is designed for internal Atlassian development.
5
6
  External contributors will be able to use this component but will not be able to submit issues.
6
7
 
8
+ ## Overview
9
+
10
+ The Date plugin provides date insertion and editing capabilities for the Atlassian Editor. It integrates with `@atlaskit/calendar` to enable users to select and insert dates into editor content with a visual date picker interface.
11
+
12
+ ## Key features
13
+
14
+ - **Date insertion** - Insert dates into editor content with a calendar-based date picker
15
+ - **Date editing** - Edit existing dates inline with the same date picker interface
16
+ - **Configurable week start** - Configure the first day of the week in the date picker
17
+ - **Date analytics** - Track date insertion and editing actions through the analytics plugin
18
+ - **Inline date display** - Dates are displayed inline within the document content
19
+
7
20
  ## Install
8
21
  ---
9
22
  - **Install** - *yarn add @atlaskit/editor-plugin-date*
@@ -15,9 +28,12 @@ External contributors will be able to use this component but will not be able to
15
28
  ---
16
29
 
17
30
  **Internal use only**
31
+
18
32
  @atlaskit/editor-plugin-date is intended for internal use by the @atlaskit/editor-core and as a plugin dependency of the Editor within your product.
33
+
19
34
  Direct use of this component is not supported.
20
- Please see [Atlaskit - Editor plugin Date Dialog](https://atlaskit.atlassian.com/packages/editor/editor-plugin-date) for documentation and examples for this package.
35
+
36
+ Please see [Atlaskit - Editor plugin Date](https://atlaskit.atlassian.com/packages/editor/editor-plugin-date) for documentation and examples for this package.
21
37
 
22
38
  ## Support
23
39
  ---
@@ -213,7 +213,7 @@ var datePlugin = function datePlugin(_ref3) {
213
213
  icon: function icon() {
214
214
  return /*#__PURE__*/_react.default.createElement(_quickInsert.IconDate, null);
215
215
  },
216
- action: function action(insert, state) {
216
+ action: function action(insert, state, source) {
217
217
  var _api$analytics, _api$analytics$attach;
218
218
  var tr = (0, _actions.createDate)(true)(state);
219
219
  api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || (_api$analytics$attach = _api$analytics.attachAnalyticsEvent) === null || _api$analytics$attach === void 0 || _api$analytics$attach.call(_api$analytics, {
@@ -222,7 +222,7 @@ var datePlugin = function datePlugin(_ref3) {
222
222
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.DATE,
223
223
  eventType: _analytics.EVENT_TYPE.TRACK,
224
224
  attributes: {
225
- inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
225
+ inputMethod: source !== null && source !== void 0 ? source : _analytics.INPUT_METHOD.QUICK_INSERT
226
226
  }
227
227
  })(tr);
228
228
  return tr;
@@ -9,6 +9,7 @@ var _utils = require("@atlaskit/editor-common/utils");
9
9
  var _model = require("@atlaskit/editor-prosemirror/model");
10
10
  var _state = require("@atlaskit/editor-prosemirror/state");
11
11
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _internal = require("../ui/DatePicker/utils/internal");
13
14
  var _pluginKey = require("./plugin-key");
14
15
  /** Delete the date and close the datepicker */
@@ -47,13 +48,14 @@ var insertDateCommand = exports.insertDateCommand = function insertDateCommand(p
47
48
  }
48
49
  if (inputMethod) {
49
50
  var _pluginInjectionApi$a;
51
+ var resolvedInputMethod = (0, _platformFeatureFlags.fg)('platform_editor_element_browser_analytic') ? inputMethod : _analytics.INPUT_METHOD.QUICK_INSERT;
50
52
  pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 || (_pluginInjectionApi$a = _pluginInjectionApi$a.actions) === null || _pluginInjectionApi$a === void 0 || _pluginInjectionApi$a.attachAnalyticsEvent({
51
53
  action: _analytics.ACTION.INSERTED,
52
54
  actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
53
55
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.DATE,
54
56
  eventType: _analytics.EVENT_TYPE.TRACK,
55
57
  attributes: {
56
- inputMethod: inputMethod
58
+ inputMethod: resolvedInputMethod
57
59
  }
58
60
  })(tr);
59
61
  }
@@ -200,7 +200,7 @@ const datePlugin = ({
200
200
  keywords: ['calendar', 'day', 'time', 'today', '/'],
201
201
  keyshortcut: '//',
202
202
  icon: () => /*#__PURE__*/React.createElement(IconDate, null),
203
- action(insert, state) {
203
+ action(insert, state, source) {
204
204
  var _api$analytics, _api$analytics$action, _api$analytics$action2;
205
205
  const tr = createDate(true)(state);
206
206
  api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : (_api$analytics$action2 = _api$analytics$action.attachAnalyticsEvent) === null || _api$analytics$action2 === void 0 ? void 0 : _api$analytics$action2.call(_api$analytics$action, {
@@ -209,7 +209,7 @@ const datePlugin = ({
209
209
  actionSubjectId: ACTION_SUBJECT_ID.DATE,
210
210
  eventType: EVENT_TYPE.TRACK,
211
211
  attributes: {
212
- inputMethod: INPUT_METHOD.QUICK_INSERT
212
+ inputMethod: source !== null && source !== void 0 ? source : INPUT_METHOD.QUICK_INSERT
213
213
  }
214
214
  })(tr);
215
215
  return tr;
@@ -1,8 +1,9 @@
1
- import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
1
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import { todayTimestampInUTC } from '@atlaskit/editor-common/utils';
3
3
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
4
4
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { canInsert } from '@atlaskit/editor-prosemirror/utils';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import { isToday } from '../ui/DatePicker/utils/internal';
7
8
  import { pluginKey } from './plugin-key';
8
9
  /** Delete the date and close the datepicker */
@@ -42,13 +43,14 @@ export const insertDateCommand = pluginInjectionApi => ({
42
43
  }
43
44
  if (inputMethod) {
44
45
  var _pluginInjectionApi$a, _pluginInjectionApi$a2;
46
+ const resolvedInputMethod = fg('platform_editor_element_browser_analytic') ? inputMethod : INPUT_METHOD.QUICK_INSERT;
45
47
  pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : (_pluginInjectionApi$a2 = _pluginInjectionApi$a.actions) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.attachAnalyticsEvent({
46
48
  action: ACTION.INSERTED,
47
49
  actionSubject: ACTION_SUBJECT.DOCUMENT,
48
50
  actionSubjectId: ACTION_SUBJECT_ID.DATE,
49
51
  eventType: EVENT_TYPE.TRACK,
50
52
  attributes: {
51
- inputMethod
53
+ inputMethod: resolvedInputMethod
52
54
  }
53
55
  })(tr);
54
56
  }
@@ -202,7 +202,7 @@ var datePlugin = function datePlugin(_ref3) {
202
202
  icon: function icon() {
203
203
  return /*#__PURE__*/React.createElement(IconDate, null);
204
204
  },
205
- action: function action(insert, state) {
205
+ action: function action(insert, state, source) {
206
206
  var _api$analytics, _api$analytics$attach;
207
207
  var tr = createDate(true)(state);
208
208
  api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || (_api$analytics$attach = _api$analytics.attachAnalyticsEvent) === null || _api$analytics$attach === void 0 || _api$analytics$attach.call(_api$analytics, {
@@ -211,7 +211,7 @@ var datePlugin = function datePlugin(_ref3) {
211
211
  actionSubjectId: ACTION_SUBJECT_ID.DATE,
212
212
  eventType: EVENT_TYPE.TRACK,
213
213
  attributes: {
214
- inputMethod: INPUT_METHOD.QUICK_INSERT
214
+ inputMethod: source !== null && source !== void 0 ? source : INPUT_METHOD.QUICK_INSERT
215
215
  }
216
216
  })(tr);
217
217
  return tr;
@@ -1,8 +1,9 @@
1
- import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
1
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import { todayTimestampInUTC } from '@atlaskit/editor-common/utils';
3
3
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
4
4
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { canInsert } from '@atlaskit/editor-prosemirror/utils';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import { isToday } from '../ui/DatePicker/utils/internal';
7
8
  import { pluginKey } from './plugin-key';
8
9
  /** Delete the date and close the datepicker */
@@ -41,13 +42,14 @@ export var insertDateCommand = function insertDateCommand(pluginInjectionApi) {
41
42
  }
42
43
  if (inputMethod) {
43
44
  var _pluginInjectionApi$a;
45
+ var resolvedInputMethod = fg('platform_editor_element_browser_analytic') ? inputMethod : INPUT_METHOD.QUICK_INSERT;
44
46
  pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 || (_pluginInjectionApi$a = _pluginInjectionApi$a.actions) === null || _pluginInjectionApi$a === void 0 || _pluginInjectionApi$a.attachAnalyticsEvent({
45
47
  action: ACTION.INSERTED,
46
48
  actionSubject: ACTION_SUBJECT.DOCUMENT,
47
49
  actionSubjectId: ACTION_SUBJECT_ID.DATE,
48
50
  eventType: EVENT_TYPE.TRACK,
49
51
  attributes: {
50
- inputMethod: inputMethod
52
+ inputMethod: resolvedInputMethod
51
53
  }
52
54
  })(tr);
53
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-date",
3
- "version": "10.0.1",
3
+ "version": "10.0.2",
4
4
  "description": "Date plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
45
  "@atlaskit/textfield": "^8.2.0",
46
46
  "@atlaskit/theme": "^22.0.0",
47
- "@atlaskit/tmp-editor-statsig": "^36.0.0",
47
+ "@atlaskit/tmp-editor-statsig": "^36.3.0",
48
48
  "@atlaskit/tokens": "^11.1.0",
49
49
  "@atlaskit/visually-hidden": "^3.0.0",
50
50
  "@babel/runtime": "^7.0.0",
@@ -57,7 +57,7 @@
57
57
  "@testing-library/react": "^16.3.0"
58
58
  },
59
59
  "peerDependencies": {
60
- "@atlaskit/editor-common": "^112.0.0",
60
+ "@atlaskit/editor-common": "^112.2.0",
61
61
  "react": "^18.2.0",
62
62
  "react-dom": "^18.2.0"
63
63
  },
@@ -97,6 +97,9 @@
97
97
  }
98
98
  },
99
99
  "platform-feature-flags": {
100
+ "platform_editor_element_browser_analytic": {
101
+ "type": "boolean"
102
+ },
100
103
  "platform_editor_adf_with_localid": {
101
104
  "type": "boolean"
102
105
  }