@atlaskit/editor-core 188.10.7 → 188.11.1

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.
Files changed (236) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/architecture/0003-explicit-plugin-dependencies.md +1 -1
  3. package/dist/cjs/i18n/cs.js +0 -60
  4. package/dist/cjs/i18n/da.js +0 -60
  5. package/dist/cjs/i18n/de.js +0 -60
  6. package/dist/cjs/i18n/en.js +0 -60
  7. package/dist/cjs/i18n/en_GB.js +0 -60
  8. package/dist/cjs/i18n/en_ZZ.js +0 -60
  9. package/dist/cjs/i18n/es.js +0 -60
  10. package/dist/cjs/i18n/fi.js +0 -60
  11. package/dist/cjs/i18n/fr.js +0 -60
  12. package/dist/cjs/i18n/hu.js +0 -60
  13. package/dist/cjs/i18n/it.js +0 -60
  14. package/dist/cjs/i18n/ja.js +0 -60
  15. package/dist/cjs/i18n/ko.js +0 -60
  16. package/dist/cjs/i18n/nb.js +0 -60
  17. package/dist/cjs/i18n/nl.js +0 -60
  18. package/dist/cjs/i18n/pl.js +0 -60
  19. package/dist/cjs/i18n/pt_BR.js +0 -60
  20. package/dist/cjs/i18n/ru.js +0 -60
  21. package/dist/cjs/i18n/sv.js +0 -60
  22. package/dist/cjs/i18n/th.js +0 -60
  23. package/dist/cjs/i18n/tr.js +0 -60
  24. package/dist/cjs/i18n/uk.js +0 -60
  25. package/dist/cjs/i18n/vi.js +0 -60
  26. package/dist/cjs/i18n/zh.js +0 -60
  27. package/dist/cjs/i18n/zh_TW.js +0 -60
  28. package/dist/cjs/labs/next/presets/universal.js +2 -2
  29. package/dist/cjs/messages.js +1 -2
  30. package/dist/cjs/plugins/index.js +0 -7
  31. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  32. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  33. package/dist/cjs/version-wrapper.js +1 -1
  34. package/dist/es2019/i18n/cs.js +0 -60
  35. package/dist/es2019/i18n/da.js +0 -60
  36. package/dist/es2019/i18n/de.js +0 -60
  37. package/dist/es2019/i18n/en.js +0 -60
  38. package/dist/es2019/i18n/en_GB.js +0 -60
  39. package/dist/es2019/i18n/en_ZZ.js +0 -60
  40. package/dist/es2019/i18n/es.js +0 -60
  41. package/dist/es2019/i18n/fi.js +0 -60
  42. package/dist/es2019/i18n/fr.js +0 -60
  43. package/dist/es2019/i18n/hu.js +0 -60
  44. package/dist/es2019/i18n/it.js +0 -60
  45. package/dist/es2019/i18n/ja.js +0 -60
  46. package/dist/es2019/i18n/ko.js +0 -60
  47. package/dist/es2019/i18n/nb.js +0 -60
  48. package/dist/es2019/i18n/nl.js +0 -60
  49. package/dist/es2019/i18n/pl.js +0 -60
  50. package/dist/es2019/i18n/pt_BR.js +0 -60
  51. package/dist/es2019/i18n/ru.js +0 -60
  52. package/dist/es2019/i18n/sv.js +0 -60
  53. package/dist/es2019/i18n/th.js +0 -60
  54. package/dist/es2019/i18n/tr.js +0 -60
  55. package/dist/es2019/i18n/uk.js +0 -60
  56. package/dist/es2019/i18n/vi.js +0 -60
  57. package/dist/es2019/i18n/zh.js +0 -60
  58. package/dist/es2019/i18n/zh_TW.js +0 -60
  59. package/dist/es2019/labs/next/presets/universal.js +1 -1
  60. package/dist/es2019/messages.js +1 -2
  61. package/dist/es2019/plugins/index.js +0 -1
  62. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  63. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  64. package/dist/es2019/version-wrapper.js +1 -1
  65. package/dist/esm/i18n/cs.js +0 -60
  66. package/dist/esm/i18n/da.js +0 -60
  67. package/dist/esm/i18n/de.js +0 -60
  68. package/dist/esm/i18n/en.js +0 -60
  69. package/dist/esm/i18n/en_GB.js +0 -60
  70. package/dist/esm/i18n/en_ZZ.js +0 -60
  71. package/dist/esm/i18n/es.js +0 -60
  72. package/dist/esm/i18n/fi.js +0 -60
  73. package/dist/esm/i18n/fr.js +0 -60
  74. package/dist/esm/i18n/hu.js +0 -60
  75. package/dist/esm/i18n/it.js +0 -60
  76. package/dist/esm/i18n/ja.js +0 -60
  77. package/dist/esm/i18n/ko.js +0 -60
  78. package/dist/esm/i18n/nb.js +0 -60
  79. package/dist/esm/i18n/nl.js +0 -60
  80. package/dist/esm/i18n/pl.js +0 -60
  81. package/dist/esm/i18n/pt_BR.js +0 -60
  82. package/dist/esm/i18n/ru.js +0 -60
  83. package/dist/esm/i18n/sv.js +0 -60
  84. package/dist/esm/i18n/th.js +0 -60
  85. package/dist/esm/i18n/tr.js +0 -60
  86. package/dist/esm/i18n/uk.js +0 -60
  87. package/dist/esm/i18n/vi.js +0 -60
  88. package/dist/esm/i18n/zh.js +0 -60
  89. package/dist/esm/i18n/zh_TW.js +0 -60
  90. package/dist/esm/labs/next/presets/universal.js +1 -1
  91. package/dist/esm/messages.js +1 -2
  92. package/dist/esm/plugins/index.js +0 -1
  93. package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  94. package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  95. package/dist/esm/version-wrapper.js +1 -1
  96. package/dist/types/i18n/cs.d.ts +0 -60
  97. package/dist/types/i18n/da.d.ts +0 -60
  98. package/dist/types/i18n/de.d.ts +0 -60
  99. package/dist/types/i18n/en.d.ts +0 -60
  100. package/dist/types/i18n/en_GB.d.ts +0 -60
  101. package/dist/types/i18n/en_ZZ.d.ts +0 -60
  102. package/dist/types/i18n/es.d.ts +0 -60
  103. package/dist/types/i18n/fi.d.ts +0 -60
  104. package/dist/types/i18n/fr.d.ts +0 -60
  105. package/dist/types/i18n/hu.d.ts +0 -60
  106. package/dist/types/i18n/it.d.ts +0 -60
  107. package/dist/types/i18n/ja.d.ts +0 -60
  108. package/dist/types/i18n/ko.d.ts +0 -60
  109. package/dist/types/i18n/nb.d.ts +0 -60
  110. package/dist/types/i18n/nl.d.ts +0 -60
  111. package/dist/types/i18n/pl.d.ts +0 -60
  112. package/dist/types/i18n/pt_BR.d.ts +0 -60
  113. package/dist/types/i18n/ru.d.ts +0 -60
  114. package/dist/types/i18n/sv.d.ts +0 -60
  115. package/dist/types/i18n/th.d.ts +0 -60
  116. package/dist/types/i18n/tr.d.ts +0 -60
  117. package/dist/types/i18n/uk.d.ts +0 -60
  118. package/dist/types/i18n/vi.d.ts +0 -60
  119. package/dist/types/i18n/zh.d.ts +0 -60
  120. package/dist/types/i18n/zh_TW.d.ts +0 -60
  121. package/dist/types/messages.d.ts +1 -2
  122. package/dist/types/plugins/index.d.ts +0 -1
  123. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
  124. package/dist/types/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
  125. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  126. package/dist/types-ts4.5/i18n/cs.d.ts +0 -60
  127. package/dist/types-ts4.5/i18n/da.d.ts +0 -60
  128. package/dist/types-ts4.5/i18n/de.d.ts +0 -60
  129. package/dist/types-ts4.5/i18n/en.d.ts +0 -60
  130. package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -60
  131. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -60
  132. package/dist/types-ts4.5/i18n/es.d.ts +0 -60
  133. package/dist/types-ts4.5/i18n/fi.d.ts +0 -60
  134. package/dist/types-ts4.5/i18n/fr.d.ts +0 -60
  135. package/dist/types-ts4.5/i18n/hu.d.ts +0 -60
  136. package/dist/types-ts4.5/i18n/it.d.ts +0 -60
  137. package/dist/types-ts4.5/i18n/ja.d.ts +0 -60
  138. package/dist/types-ts4.5/i18n/ko.d.ts +0 -60
  139. package/dist/types-ts4.5/i18n/nb.d.ts +0 -60
  140. package/dist/types-ts4.5/i18n/nl.d.ts +0 -60
  141. package/dist/types-ts4.5/i18n/pl.d.ts +0 -60
  142. package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -60
  143. package/dist/types-ts4.5/i18n/ru.d.ts +0 -60
  144. package/dist/types-ts4.5/i18n/sv.d.ts +0 -60
  145. package/dist/types-ts4.5/i18n/th.d.ts +0 -60
  146. package/dist/types-ts4.5/i18n/tr.d.ts +0 -60
  147. package/dist/types-ts4.5/i18n/uk.d.ts +0 -60
  148. package/dist/types-ts4.5/i18n/vi.d.ts +0 -60
  149. package/dist/types-ts4.5/i18n/zh.d.ts +0 -60
  150. package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -60
  151. package/dist/types-ts4.5/messages.d.ts +1 -2
  152. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  153. package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
  154. package/dist/types-ts4.5/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
  155. package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
  156. package/package.json +6 -9
  157. package/dist/cjs/plugins/date/actions.js +0 -105
  158. package/dist/cjs/plugins/date/commands.js +0 -118
  159. package/dist/cjs/plugins/date/index.js +0 -13
  160. package/dist/cjs/plugins/date/nodeviews/date.js +0 -44
  161. package/dist/cjs/plugins/date/nodeviews/messages.js +0 -14
  162. package/dist/cjs/plugins/date/plugin.js +0 -197
  163. package/dist/cjs/plugins/date/pm-plugins/keymap.js +0 -41
  164. package/dist/cjs/plugins/date/pm-plugins/main.js +0 -39
  165. package/dist/cjs/plugins/date/pm-plugins/plugin-key.js +0 -8
  166. package/dist/cjs/plugins/date/pm-plugins/types.js +0 -5
  167. package/dist/cjs/plugins/date/pm-plugins/utils.js +0 -70
  168. package/dist/cjs/plugins/date/types.js +0 -5
  169. package/dist/cjs/plugins/date/ui/DatePicker/date-picker-input.js +0 -244
  170. package/dist/cjs/plugins/date/ui/DatePicker/index.js +0 -168
  171. package/dist/cjs/plugins/date/utils/formatParse.js +0 -88
  172. package/dist/cjs/plugins/date/utils/internal.js +0 -176
  173. package/dist/es2019/plugins/date/actions.js +0 -93
  174. package/dist/es2019/plugins/date/commands.js +0 -113
  175. package/dist/es2019/plugins/date/index.js +0 -1
  176. package/dist/es2019/plugins/date/nodeviews/date.js +0 -47
  177. package/dist/es2019/plugins/date/nodeviews/messages.js +0 -8
  178. package/dist/es2019/plugins/date/plugin.js +0 -183
  179. package/dist/es2019/plugins/date/pm-plugins/keymap.js +0 -34
  180. package/dist/es2019/plugins/date/pm-plugins/main.js +0 -35
  181. package/dist/es2019/plugins/date/pm-plugins/plugin-key.js +0 -2
  182. package/dist/es2019/plugins/date/pm-plugins/types.js +0 -1
  183. package/dist/es2019/plugins/date/pm-plugins/utils.js +0 -70
  184. package/dist/es2019/plugins/date/types.js +0 -1
  185. package/dist/es2019/plugins/date/ui/DatePicker/date-picker-input.js +0 -233
  186. package/dist/es2019/plugins/date/ui/DatePicker/index.js +0 -152
  187. package/dist/es2019/plugins/date/utils/formatParse.js +0 -83
  188. package/dist/es2019/plugins/date/utils/internal.js +0 -151
  189. package/dist/esm/plugins/date/actions.js +0 -99
  190. package/dist/esm/plugins/date/commands.js +0 -112
  191. package/dist/esm/plugins/date/index.js +0 -1
  192. package/dist/esm/plugins/date/nodeviews/date.js +0 -37
  193. package/dist/esm/plugins/date/nodeviews/messages.js +0 -8
  194. package/dist/esm/plugins/date/plugin.js +0 -185
  195. package/dist/esm/plugins/date/pm-plugins/keymap.js +0 -34
  196. package/dist/esm/plugins/date/pm-plugins/main.js +0 -34
  197. package/dist/esm/plugins/date/pm-plugins/plugin-key.js +0 -2
  198. package/dist/esm/plugins/date/pm-plugins/types.js +0 -1
  199. package/dist/esm/plugins/date/pm-plugins/utils.js +0 -61
  200. package/dist/esm/plugins/date/types.js +0 -1
  201. package/dist/esm/plugins/date/ui/DatePicker/date-picker-input.js +0 -238
  202. package/dist/esm/plugins/date/ui/DatePicker/index.js +0 -162
  203. package/dist/esm/plugins/date/utils/formatParse.js +0 -79
  204. package/dist/esm/plugins/date/utils/internal.js +0 -165
  205. package/dist/types/plugins/date/actions.d.ts +0 -47
  206. package/dist/types/plugins/date/commands.d.ts +0 -12
  207. package/dist/types/plugins/date/index.d.ts +0 -1
  208. package/dist/types/plugins/date/nodeviews/date.d.ts +0 -3
  209. package/dist/types/plugins/date/nodeviews/messages.d.ts +0 -7
  210. package/dist/types/plugins/date/plugin.d.ts +0 -3
  211. package/dist/types/plugins/date/pm-plugins/keymap.d.ts +0 -3
  212. package/dist/types/plugins/date/pm-plugins/main.d.ts +0 -6
  213. package/dist/types/plugins/date/pm-plugins/plugin-key.d.ts +0 -3
  214. package/dist/types/plugins/date/pm-plugins/types.d.ts +0 -12
  215. package/dist/types/plugins/date/pm-plugins/utils.d.ts +0 -5
  216. package/dist/types/plugins/date/types.d.ts +0 -1
  217. package/dist/types/plugins/date/ui/DatePicker/date-picker-input.d.ts +0 -24
  218. package/dist/types/plugins/date/ui/DatePicker/index.d.ts +0 -36
  219. package/dist/types/plugins/date/utils/formatParse.d.ts +0 -27
  220. package/dist/types/plugins/date/utils/internal.d.ts +0 -33
  221. package/dist/types-ts4.5/plugins/date/actions.d.ts +0 -58
  222. package/dist/types-ts4.5/plugins/date/commands.d.ts +0 -14
  223. package/dist/types-ts4.5/plugins/date/index.d.ts +0 -1
  224. package/dist/types-ts4.5/plugins/date/nodeviews/date.d.ts +0 -3
  225. package/dist/types-ts4.5/plugins/date/nodeviews/messages.d.ts +0 -7
  226. package/dist/types-ts4.5/plugins/date/plugin.d.ts +0 -3
  227. package/dist/types-ts4.5/plugins/date/pm-plugins/keymap.d.ts +0 -3
  228. package/dist/types-ts4.5/plugins/date/pm-plugins/main.d.ts +0 -6
  229. package/dist/types-ts4.5/plugins/date/pm-plugins/plugin-key.d.ts +0 -3
  230. package/dist/types-ts4.5/plugins/date/pm-plugins/types.d.ts +0 -12
  231. package/dist/types-ts4.5/plugins/date/pm-plugins/utils.d.ts +0 -5
  232. package/dist/types-ts4.5/plugins/date/types.d.ts +0 -1
  233. package/dist/types-ts4.5/plugins/date/ui/DatePicker/date-picker-input.d.ts +0 -24
  234. package/dist/types-ts4.5/plugins/date/ui/DatePicker/index.d.ts +0 -36
  235. package/dist/types-ts4.5/plugins/date/utils/formatParse.d.ts +0 -27
  236. package/dist/types-ts4.5/plugins/date/utils/internal.d.ts +0 -33
@@ -1,162 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
9
- var _templateObject;
10
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
- /** @jsx jsx */
13
- import React from 'react';
14
- import { css, jsx } from '@emotion/react';
15
- import ReactDOM from 'react-dom';
16
- import { Popup } from '@atlaskit/editor-common/ui';
17
- import { timestampToUTCDate, timestampToIsoFormat } from '@atlaskit/editor-common/utils';
18
- import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
19
- import Calendar from '@atlaskit/calendar';
20
- import { borderRadius } from '@atlaskit/theme/constants';
21
- import { N60A, N0 } from '@atlaskit/theme/colors';
22
- import { withOuterListeners } from '@atlaskit/editor-common/ui';
23
- var PopupWithListeners = withOuterListeners(Popup);
24
- import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
25
- import { injectIntl } from 'react-intl-next';
26
- import DatePickerInput from './date-picker-input';
27
- var popupContentWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n background-color: ", ";\n"])), "var(--ds-space-025, 2px)", borderRadius(), "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A), ")"), "var(--ds-surface-overlay, ".concat(N0, ")"));
28
- var DatePicker = /*#__PURE__*/function (_React$Component) {
29
- _inherits(DatePicker, _React$Component);
30
- var _super = _createSuper(DatePicker);
31
- function DatePicker(props) {
32
- var _this;
33
- _classCallCheck(this, DatePicker);
34
- _this = _super.call(this, props);
35
- _defineProperty(_assertThisInitialized(_this), "handleNewDate", function (date) {
36
- _this.props.onTextChanged(date);
37
- _this.setState({
38
- latestValidDate: date
39
- });
40
- });
41
- _defineProperty(_assertThisInitialized(_this), "handleKeyboardSubmitDate", function (date) {
42
- _this.props.onSelect(date, INPUT_METHOD.KEYBOARD);
43
- });
44
- _defineProperty(_assertThisInitialized(_this), "handleEmptySubmitDate", function () {
45
- _this.props.onDelete();
46
- });
47
- _defineProperty(_assertThisInitialized(_this), "handleOnChange", function (_ref) {
48
- var day = _ref.day,
49
- month = _ref.month,
50
- year = _ref.year;
51
- var date = {
52
- day: day,
53
- month: month,
54
- year: year
55
- };
56
- _this.setState({
57
- latestValidDate: date
58
- });
59
- });
60
- _defineProperty(_assertThisInitialized(_this), "closeDatePickerWithAnalytics", function () {
61
- _this.props.closeDatePickerWithAnalytics({
62
- date: _this.state.latestValidDate
63
- });
64
- });
65
- _defineProperty(_assertThisInitialized(_this), "handleRef", function (ref) {
66
- var elm = ref && ReactDOM.findDOMNode(ref);
67
- if (elm) {
68
- elm.focus();
69
- }
70
- });
71
- var timestamp = props.element.getAttribute('timestamp');
72
- if (timestamp) {
73
- // Warning: The 'Date' return type of timestampToUTCDate() is not a JS date, it's more similar
74
- // to the DateType type
75
- var _timestampToUTCDate = timestampToUTCDate(timestamp),
76
- day = _timestampToUTCDate.day,
77
- month = _timestampToUTCDate.month,
78
- year = _timestampToUTCDate.year;
79
- var _date = {
80
- day: day,
81
- month: month,
82
- year: year
83
- };
84
- _this.state = {
85
- selected: [timestampToIsoFormat(timestamp)],
86
- date: _date,
87
- latestValidDate: _date
88
- };
89
- }
90
- return _this;
91
- }
92
- _createClass(DatePicker, [{
93
- key: "render",
94
- value: function render() {
95
- var _this$props = this.props,
96
- element = _this$props.element,
97
- _onSelect = _this$props.onSelect,
98
- mountTo = _this$props.mountTo,
99
- boundariesElement = _this$props.boundariesElement,
100
- scrollableElement = _this$props.scrollableElement,
101
- intl = _this$props.intl,
102
- dispatchAnalyticsEvent = _this$props.dispatchAnalyticsEvent,
103
- isNew = _this$props.isNew,
104
- autoFocus = _this$props.autoFocus,
105
- weekStartDay = _this$props.weekStartDay;
106
- var timestamp = element.getAttribute('timestamp');
107
- if (this.state === null) {
108
- // Without this, you can blow up the page by slowing down cpu, opening date, typing after date
109
- // then clicking on date lozenge and typing quickly before it opens
110
- return null;
111
- }
112
- var _this$state = this.state,
113
- date = _this$state.date,
114
- selected = _this$state.selected,
115
- latestValidDate = _this$state.latestValidDate;
116
- var day = latestValidDate.day,
117
- month = latestValidDate.month,
118
- year = latestValidDate.year;
119
- if (!timestamp) {
120
- return null;
121
- }
122
- return jsx(PopupWithListeners, {
123
- target: element,
124
- offset: [0, 8],
125
- fitHeight: 327,
126
- fitWidth: 340,
127
- handleClickOutside: this.closeDatePickerWithAnalytics,
128
- handleEscapeKeydown: this.closeDatePickerWithAnalytics,
129
- zIndex: akEditorFloatingDialogZIndex,
130
- mountTo: mountTo,
131
- boundariesElement: boundariesElement,
132
- scrollableElement: scrollableElement,
133
- ariaLabel: null
134
- }, jsx("div", {
135
- css: popupContentWrapper
136
- }, jsx(DatePickerInput, {
137
- date: date,
138
- onNewDate: this.handleNewDate,
139
- onSubmitDate: this.handleKeyboardSubmitDate,
140
- onEmptySubmit: this.handleEmptySubmitDate,
141
- locale: intl.locale,
142
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
143
- autoFocus: autoFocus,
144
- autoSelectAll: isNew
145
- }), jsx(Calendar, {
146
- onChange: this.handleOnChange,
147
- onSelect: function onSelect(date) {
148
- return _onSelect(date, INPUT_METHOD.PICKER);
149
- },
150
- day: day,
151
- month: month,
152
- year: year,
153
- selected: selected,
154
- ref: this.handleRef,
155
- weekStartDay: weekStartDay,
156
- testId: 'datepicker'
157
- })));
158
- }
159
- }]);
160
- return DatePicker;
161
- }(React.Component);
162
- export default injectIntl(DatePicker);
@@ -1,79 +0,0 @@
1
- import { createLocalizationProvider } from '@atlaskit/locale';
2
- /**
3
- * Attempt to parse a string representing a date in a particular locale to a date object
4
- * @param dateString The string representing the date in the given locale, eg '02/12/2000'
5
- * @param l10n The localisation provider created by createLocalizationProvider
6
- * @returns Editor DateType when can parse, null when can't parse or invalid
7
- */
8
- export function parseDateType(dateString, locale) {
9
- try {
10
- var l10n = createLocalizationProvider(locale);
11
- var date = l10n.parseDate(dateString);
12
-
13
- // If date is invalid
14
- if (isNaN(date.getTime())) {
15
- return null;
16
- }
17
- var year = date.getFullYear();
18
- if (year < 1000 || year > 9999) {
19
- return null;
20
- }
21
- var dateObj = {
22
- day: date.getDate(),
23
- month: date.getMonth() + 1,
24
- year: year
25
- };
26
- return dateObj;
27
- } catch (e) {
28
- return null;
29
- }
30
- }
31
-
32
- /**
33
- * Convert an EditorDateType to a date string string formatted for a particular locale
34
- * @param date The date object
35
- * @param locale The locale code string (eg. "en-AU")
36
- * @returns Date string, eg "25/5/20"
37
- */
38
- export function formatDateType(date, locale) {
39
- var day = date.day,
40
- month = date.month,
41
- year = date.year;
42
- var l10n = createLocalizationProvider(locale);
43
-
44
- // The JS Date api represents month as a number between 0-11 :)
45
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
46
- var dateObj = new Date(year, month - 1, day);
47
- return l10n.formatDate(dateObj);
48
- }
49
-
50
- /**
51
- * Convert an Editor DateType to a JavaScript Date object
52
- * @param date Editor DateType
53
- * @returns JavaScript Date object
54
- */
55
- export function dateTypeToDate(date) {
56
- var day = date.day,
57
- month = date.month,
58
- year = date.year;
59
- // The JS Date api represents month as a number between 0-11 :)
60
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
61
- var dateObj = new Date(year, month - 1, day);
62
- return dateObj;
63
- }
64
-
65
- /**
66
- * Convert a JavaScript Date to an editor DateType
67
- * @param date JavaScript Date object
68
- * @returns Editor DateType
69
- */
70
- export function dateToDateType(date) {
71
- var dateObj = {
72
- day: date.getDate(),
73
- // The JS Date api represents month as a number between 0-11 :)
74
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
75
- month: date.getMonth() + 1,
76
- year: date.getFullYear()
77
- };
78
- return dateObj;
79
- }
@@ -1,165 +0,0 @@
1
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
3
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
4
- import { formatDateType, dateTypeToDate, dateToDateType } from './formatParse';
5
- import addDays from 'date-fns/addDays';
6
- import addMonths from 'date-fns/addMonths';
7
- import addYears from 'date-fns/addYears';
8
- function isDigit(c) {
9
- if (c === undefined) {
10
- return false;
11
- }
12
- return c >= '0' && c <= '9';
13
- }
14
-
15
- /**
16
- * Check if cursor is in first segment of a date.
17
- * @param cursorPos Cursor pos, with 0 referring to the left of first char
18
- * @param date Date string in any locale
19
- */
20
- function isCursorInFirstDateSegment(cursorPos, date) {
21
- var posCounter = cursorPos - 1;
22
- var isAdjacent = true;
23
- // The date without any non-digit characters on the end
24
- var strippedDate = date.replace(/[^0-9]+$/g, '');
25
- while (posCounter >= 0 && isAdjacent) {
26
- var c = strippedDate[posCounter];
27
- if (!isDigit(c)) {
28
- isAdjacent = false;
29
- }
30
- posCounter -= 1;
31
- }
32
- return isAdjacent;
33
- }
34
-
35
- /**
36
- * Check if cursor is in last segment of a date.
37
- * @param cursorPos Cursor pos, with 0 referring to the left of first char
38
- * @param date Date string in any locale
39
- */
40
- function isCursorInLastDateSegment(cursorPos, date) {
41
- var posCounter = cursorPos;
42
- var isAdjacent = true;
43
- // The date without any non-digit characters on the end
44
- var strippedDate = date.replace(/[^0-9]+$/g, '');
45
- while (posCounter < strippedDate.length && isAdjacent) {
46
- var c = strippedDate[posCounter];
47
- if (!isDigit(c)) {
48
- isAdjacent = false;
49
- }
50
- posCounter += 1;
51
- }
52
- return isAdjacent;
53
- }
54
-
55
- /**
56
- * Inconclusively check if a date string is valid - a value of false means it is definitely
57
- * invalid, a value of true means it might be valid.
58
- * @param date Date string to be parsed
59
- */
60
- export function isDatePossiblyValid(date) {
61
- var _iterator = _createForOfIteratorHelper(date),
62
- _step;
63
- try {
64
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
65
- var c = _step.value;
66
- var isNumber = c >= '0' && c <= '9';
67
- var isValidPunctuation = '. ,/'.indexOf(c) !== -1;
68
- if (!(isNumber || isValidPunctuation)) {
69
- return false;
70
- }
71
- }
72
- } catch (err) {
73
- _iterator.e(err);
74
- } finally {
75
- _iterator.f();
76
- }
77
- return true;
78
- }
79
-
80
- /**
81
- * Find the segment of a date a position refers to. Eg: pos 2 in 29/03/2020 is in
82
- * the day segment.
83
- * @param position Cursor position, with 0 referring to the left of the first char
84
- * @param date The localised date string
85
- * @param locale The language to interpret the date string in
86
- */
87
- export function findDateSegmentByPosition(position, date, locale) {
88
- if (position > date.length) {
89
- return undefined;
90
- }
91
- var placeholder = getLocaleDatePlaceholder(locale);
92
- if (!placeholder) {
93
- return undefined;
94
- }
95
-
96
- // The placeholder without any non-digit characters on the end
97
- var strippedPlaceholder = placeholder.replace(/[^ymd]+$/g, '');
98
- var keyToSegment = {
99
- d: 'day',
100
- m: 'month',
101
- y: 'year'
102
- };
103
- var firstSegment = keyToSegment[strippedPlaceholder[0]];
104
- var lastSegment = keyToSegment[strippedPlaceholder[strippedPlaceholder.length - 1]];
105
- var allPossibleSegments = ['day', 'month', 'year'];
106
- var middleSegment = allPossibleSegments.filter(function (s) {
107
- return s !== firstSegment && s !== lastSegment;
108
- })[0];
109
- if (isCursorInFirstDateSegment(position, date)) {
110
- return firstSegment;
111
- }
112
- if (isCursorInLastDateSegment(position, date)) {
113
- return lastSegment;
114
- }
115
- return middleSegment;
116
- }
117
-
118
- /**
119
- * Generate a placeholder date string for a given locale
120
- * eg: locale 'hu-HU' -> 'yyyy. mm. dd.'
121
- * @param locale A locale string supported by Intl.DateTimeFormat
122
- * @returns A placeholder string. d=1 or 2 digit day, dd=zero padded
123
- * day, same for month but letter m, yyyy=year
124
- */
125
- export function getLocaleDatePlaceholder(locale) {
126
- var uniqueDateType = {
127
- day: 7,
128
- month: 1,
129
- year: 1992
130
- };
131
- var localisedDateString = formatDateType(uniqueDateType, locale);
132
- var shortDateFormat = localisedDateString.replace(/\d+/g, function (str) {
133
- if (!str) {
134
- return '';
135
- }
136
- var num = parseInt(str);
137
- switch (num % 100) {
138
- case 92:
139
- return str.replace(/.{1}/g, 'y');
140
- case 1:
141
- return str.length === 1 ? 'm' : 'mm';
142
- case 7:
143
- return str.length === 1 ? 'd' : 'dd';
144
- }
145
- return '';
146
- });
147
- return shortDateFormat;
148
- }
149
-
150
- /**
151
- * Adjust date segment up or down. Eg. If day is the active segment and adjustment is -1,
152
- * reduce the day by one.
153
- * @param date Valid datetype
154
- * @param activeSegment which part of the date is selected/being adjusted
155
- * @param adjustment how many units the segment is being adjusted (can be pos or neg, usually 1 or -1)
156
- */
157
- export function adjustDate(date, activeSegment, adjustment) {
158
- var originalDate = dateTypeToDate(date);
159
- var newDate = activeSegment === 'day' ? addDays(originalDate, adjustment) : activeSegment === 'month' ? addMonths(originalDate, adjustment) : addYears(originalDate, adjustment);
160
- return dateToDateType(newDate);
161
- }
162
- export function isToday(date) {
163
- var today = new Date();
164
- return date !== undefined && today.getDate() === date.day && date.month === today.getMonth() + 1 && date.year === today.getFullYear();
165
- }
@@ -1,47 +0,0 @@
1
- import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
2
- import type { DatePlugin, DateType } from '@atlaskit/editor-plugin-date';
3
- import type { Command, CommandDispatch, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
- export declare const createDate: (isQuickInsertAction?: boolean) => (insert: (node: Node | Object | string, opts?: any) => Transaction, state: EditorState) => Transaction;
5
- /** Focus input */
6
- export declare const focusDateInput: () => (state: EditorState, dispatch: CommandDispatch | undefined) => boolean;
7
- export declare const setDatePickerAt: (showDatePickerAt: number | null) => (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
8
- export declare const closeDatePicker: () => Command;
9
- export declare const closeDatePickerWithAnalytics: ({ date, pluginInjectionApi, }: {
10
- date?: DateType | undefined;
11
- pluginInjectionApi?: import("@atlaskit/editor-common/types").PublicPluginAPI<[import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"date", {
12
- pluginConfiguration: import("@atlaskit/editor-plugin-date").DatePluginConfig | undefined;
13
- dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
14
- pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
15
- sharedState: {
16
- createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
17
- attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
18
- };
19
- dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
20
- pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
21
- sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
22
- }, import("@atlaskit/editor-common/types").FeatureFlags>];
23
- actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
24
- }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
25
- sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
26
- }, undefined>];
27
- sharedState: import("@atlaskit/editor-plugin-date").DatePluginSharedState;
28
- commands: {
29
- insertDate: import("@atlaskit/editor-plugin-date").InsertDate;
30
- deleteDate: import("@atlaskit/editor-common/types").EditorCommand;
31
- };
32
- }, import("@atlaskit/editor-plugin-date").DatePluginConfig | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
33
- pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
34
- sharedState: {
35
- createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
36
- attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
37
- };
38
- dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
39
- pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
40
- sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
41
- }, import("@atlaskit/editor-common/types").FeatureFlags>];
42
- actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
43
- }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
44
- sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
45
- }, undefined>]> | undefined;
46
- }) => Command;
47
- export declare const openDatePicker: () => Command;
@@ -1,12 +0,0 @@
1
- import type { PluginInjectionAPIWithDependencies, OptionalPlugin } from '@atlaskit/editor-common/types';
2
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
- import type { DeleteDate, InsertDate, DatePlugin } from '@atlaskit/editor-plugin-date';
4
- type DeleteDateCommand = (pluginInjectionApi: PluginInjectionAPIWithDependencies<[DatePlugin]> | undefined) => DeleteDate;
5
- /** Delete the date and close the datepicker */
6
- export declare const deleteDateCommand: DeleteDateCommand;
7
- type InsertDateCommand = (pluginInjectionApi: PluginInjectionAPIWithDependencies<[
8
- OptionalPlugin<AnalyticsPlugin>,
9
- DatePlugin
10
- ]> | undefined) => InsertDate;
11
- export declare const insertDateCommand: InsertDateCommand;
12
- export {};
@@ -1 +0,0 @@
1
- export { default as datePlugin } from './plugin';
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import type { InlineNodeViewComponentProps } from '@atlaskit/editor-common/react-node-view';
3
- export declare function DateNodeView(props: InlineNodeViewComponentProps): JSX.Element;
@@ -1,7 +0,0 @@
1
- export declare const messages: {
2
- editText: {
3
- id: string;
4
- defaultMessage: string;
5
- description: string;
6
- };
7
- };
@@ -1,3 +0,0 @@
1
- import type { DatePlugin } from '@atlaskit/editor-plugin-date';
2
- declare const datePlugin: DatePlugin;
3
- export default datePlugin;
@@ -1,3 +0,0 @@
1
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- export declare function keymapPlugin(): SafePlugin;
3
- export default keymapPlugin;
@@ -1,6 +0,0 @@
1
- import type { PMPluginFactory } from '@atlaskit/editor-common/types';
2
- import type { DatePluginState } from './types';
3
- declare const getPluginState: (state: import("prosemirror-state").EditorState) => DatePluginState;
4
- declare const createPlugin: PMPluginFactory;
5
- export { getPluginState };
6
- export default createPlugin;
@@ -1,3 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- import type { DatePluginState } from './types';
3
- export declare const pluginKey: PluginKey<DatePluginState>;
@@ -1,12 +0,0 @@
1
- export type DatePluginState = {
2
- isQuickInsertAction?: boolean;
3
- isNew: boolean;
4
- showDatePickerAt: number | null;
5
- isDateEmpty: boolean;
6
- focusDateInput: boolean;
7
- };
8
- export type DatePluginMeta = {
9
- isNew?: boolean;
10
- showDatePickerAt?: number | null;
11
- isDateEmpty?: boolean;
12
- };
@@ -1,5 +0,0 @@
1
- import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
2
- import type { DatePluginState, DatePluginMeta } from './types';
3
- export declare function reducer(pluginState: DatePluginState, meta: DatePluginMeta): DatePluginState;
4
- export declare function mapping(tr: ReadonlyTransaction, pluginState: DatePluginState): DatePluginState;
5
- export declare function onSelectionChanged(tr: ReadonlyTransaction, pluginState: DatePluginState): DatePluginState;
@@ -1 +0,0 @@
1
- export type DateSegment = 'day' | 'month' | 'year';
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- import type { WrappedComponentProps } from 'react-intl-next';
3
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
4
- import type { DateType } from '@atlaskit/editor-plugin-date';
5
- export interface InputProps {
6
- /** Locale code string (eg. "en-AU") */
7
- locale: string;
8
- date: DateType;
9
- dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
10
- onNewDate: (date: DateType) => void;
11
- onSubmitDate: (date: DateType | null) => void;
12
- onEmptySubmit: () => void;
13
- /** Automatically focus the text field */
14
- autoFocus?: boolean;
15
- /** Automatically select all text in the field. Requires autoFocus to be true. */
16
- autoSelectAll?: boolean;
17
- }
18
- export interface InputState {
19
- inputText: string;
20
- }
21
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<InputProps & WrappedComponentProps<"intl">>> & {
22
- WrappedComponent: React.ComponentType<InputProps & WrappedComponentProps<"intl">>;
23
- };
24
- export default _default;
@@ -1,36 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import type { WeekDay } from '@atlaskit/calendar/types';
4
- import type { DateType } from '@atlaskit/editor-plugin-date';
5
- import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
6
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
7
- import type { WrappedComponentProps } from 'react-intl-next';
8
- export interface Props {
9
- element: HTMLElement | null;
10
- closeDatePicker: () => void;
11
- /** Whether the date is newly created, selcting and focusing the input */
12
- isNew: boolean;
13
- /** Whether to automatically focus the input */
14
- autoFocus?: boolean;
15
- onSelect: (date: DateType | null, commitMethod: INPUT_METHOD.PICKER | INPUT_METHOD.KEYBOARD) => void;
16
- onDelete: () => void;
17
- mountTo?: HTMLElement;
18
- boundariesElement?: HTMLElement;
19
- scrollableElement?: HTMLElement;
20
- closeDatePickerWithAnalytics: ({ date }: {
21
- date?: DateType;
22
- }) => void;
23
- onTextChanged: (date: DateType) => void;
24
- dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
25
- weekStartDay?: WeekDay;
26
- }
27
- export interface State {
28
- date: DateType;
29
- selected: Array<string>;
30
- setInputSelectionPos?: number;
31
- latestValidDate: DateType;
32
- }
33
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
34
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
35
- };
36
- export default _default;
@@ -1,27 +0,0 @@
1
- import type { DateType } from '@atlaskit/editor-plugin-date';
2
- /**
3
- * Attempt to parse a string representing a date in a particular locale to a date object
4
- * @param dateString The string representing the date in the given locale, eg '02/12/2000'
5
- * @param l10n The localisation provider created by createLocalizationProvider
6
- * @returns Editor DateType when can parse, null when can't parse or invalid
7
- */
8
- export declare function parseDateType(dateString: string, locale: string): DateType | null;
9
- /**
10
- * Convert an EditorDateType to a date string string formatted for a particular locale
11
- * @param date The date object
12
- * @param locale The locale code string (eg. "en-AU")
13
- * @returns Date string, eg "25/5/20"
14
- */
15
- export declare function formatDateType(date: DateType, locale: string): string;
16
- /**
17
- * Convert an Editor DateType to a JavaScript Date object
18
- * @param date Editor DateType
19
- * @returns JavaScript Date object
20
- */
21
- export declare function dateTypeToDate(date: DateType): Date;
22
- /**
23
- * Convert a JavaScript Date to an editor DateType
24
- * @param date JavaScript Date object
25
- * @returns Editor DateType
26
- */
27
- export declare function dateToDateType(date: Date): DateType;
@@ -1,33 +0,0 @@
1
- import type { DateSegment } from '../types';
2
- import type { DateType } from '@atlaskit/editor-plugin-date';
3
- /**
4
- * Inconclusively check if a date string is valid - a value of false means it is definitely
5
- * invalid, a value of true means it might be valid.
6
- * @param date Date string to be parsed
7
- */
8
- export declare function isDatePossiblyValid(date: string): boolean;
9
- /**
10
- * Find the segment of a date a position refers to. Eg: pos 2 in 29/03/2020 is in
11
- * the day segment.
12
- * @param position Cursor position, with 0 referring to the left of the first char
13
- * @param date The localised date string
14
- * @param locale The language to interpret the date string in
15
- */
16
- export declare function findDateSegmentByPosition(position: number, date: string, locale: string): DateSegment | undefined;
17
- /**
18
- * Generate a placeholder date string for a given locale
19
- * eg: locale 'hu-HU' -> 'yyyy. mm. dd.'
20
- * @param locale A locale string supported by Intl.DateTimeFormat
21
- * @returns A placeholder string. d=1 or 2 digit day, dd=zero padded
22
- * day, same for month but letter m, yyyy=year
23
- */
24
- export declare function getLocaleDatePlaceholder(locale: string): string | undefined;
25
- /**
26
- * Adjust date segment up or down. Eg. If day is the active segment and adjustment is -1,
27
- * reduce the day by one.
28
- * @param date Valid datetype
29
- * @param activeSegment which part of the date is selected/being adjusted
30
- * @param adjustment how many units the segment is being adjusted (can be pos or neg, usually 1 or -1)
31
- */
32
- export declare function adjustDate(date: DateType, activeSegment: DateSegment, adjustment: number): DateType;
33
- export declare function isToday(date: DateType | undefined): boolean;