@react-fabric/lexical 1.0.0-beta.62 → 1.0.0-beta.63

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 (345) hide show
  1. package/css/_lexical.css +10 -13
  2. package/dist/cjs/{packages/lexical/src/editor → editor}/LexicalEditor.js +2 -2
  3. package/dist/cjs/{packages/lexical/src/hooks → hooks}/useFormatWatcher.js +54 -56
  4. package/dist/cjs/{packages/lexical/src/plugins → plugins}/CommentPlugin.js +12 -18
  5. package/dist/cjs/{packages/lexical/src/plugins → plugins}/DraggableBlockPlugin.js +2 -2
  6. package/dist/esm/{packages/lexical/src/editor → editor}/LexicalEditor.js +2 -2
  7. package/dist/esm/{packages/lexical/src/hooks → hooks}/useFormatWatcher.js +54 -56
  8. package/dist/esm/{packages/lexical/src/plugins → plugins}/CommentPlugin.js +10 -16
  9. package/dist/esm/{packages/lexical/src/plugins → plugins}/DraggableBlockPlugin.js +2 -2
  10. package/dist/types/editor/LexicalEditor.d.ts +1 -1
  11. package/dist/types/plugins/CommentPlugin.d.ts +1 -1
  12. package/dist/types/plugins/DraggableBlockPlugin.d.ts +1 -1
  13. package/package.json +14 -13
  14. package/src/editor/LexicalEditor.tsx +2 -2
  15. package/src/hooks/useFormatWatcher.ts +0 -2
  16. package/src/plugins/CommentPlugin.tsx +3 -3
  17. package/src/plugins/DraggableBlockPlugin.tsx +3 -3
  18. package/dist/cjs/node_modules/date-fns/_lib/addLeadingZeros.js +0 -9
  19. package/dist/cjs/node_modules/date-fns/_lib/defaultOptions.js +0 -9
  20. package/dist/cjs/node_modules/date-fns/_lib/format/formatters.js +0 -779
  21. package/dist/cjs/node_modules/date-fns/_lib/format/lightFormatters.js +0 -96
  22. package/dist/cjs/node_modules/date-fns/_lib/format/longFormatters.js +0 -68
  23. package/dist/cjs/node_modules/date-fns/_lib/getRoundingMethod.js +0 -12
  24. package/dist/cjs/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +0 -33
  25. package/dist/cjs/node_modules/date-fns/_lib/normalizeDates.js +0 -13
  26. package/dist/cjs/node_modules/date-fns/_lib/normalizeInterval.js +0 -10
  27. package/dist/cjs/node_modules/date-fns/_lib/protectedTokens.js +0 -29
  28. package/dist/cjs/node_modules/date-fns/add.js +0 -73
  29. package/dist/cjs/node_modules/date-fns/addDays.js +0 -46
  30. package/dist/cjs/node_modules/date-fns/addHours.js +0 -39
  31. package/dist/cjs/node_modules/date-fns/addMilliseconds.js +0 -39
  32. package/dist/cjs/node_modules/date-fns/addMinutes.js +0 -41
  33. package/dist/cjs/node_modules/date-fns/addMonths.js +0 -80
  34. package/dist/cjs/node_modules/date-fns/addQuarters.js +0 -38
  35. package/dist/cjs/node_modules/date-fns/addWeeks.js +0 -38
  36. package/dist/cjs/node_modules/date-fns/addYears.js +0 -38
  37. package/dist/cjs/node_modules/date-fns/compareAsc.js +0 -50
  38. package/dist/cjs/node_modules/date-fns/constants.js +0 -66
  39. package/dist/cjs/node_modules/date-fns/constructFrom.js +0 -54
  40. package/dist/cjs/node_modules/date-fns/differenceInCalendarDays.js +0 -67
  41. package/dist/cjs/node_modules/date-fns/differenceInCalendarMonths.js +0 -47
  42. package/dist/cjs/node_modules/date-fns/differenceInCalendarYears.js +0 -43
  43. package/dist/cjs/node_modules/date-fns/differenceInDays.js +0 -112
  44. package/dist/cjs/node_modules/date-fns/differenceInHours.js +0 -46
  45. package/dist/cjs/node_modules/date-fns/differenceInMilliseconds.js +0 -34
  46. package/dist/cjs/node_modules/date-fns/differenceInMinutes.js +0 -50
  47. package/dist/cjs/node_modules/date-fns/differenceInMonths.js +0 -65
  48. package/dist/cjs/node_modules/date-fns/differenceInSeconds.js +0 -41
  49. package/dist/cjs/node_modules/date-fns/differenceInYears.js +0 -67
  50. package/dist/cjs/node_modules/date-fns/endOfDay.js +0 -40
  51. package/dist/cjs/node_modules/date-fns/endOfDecade.js +0 -45
  52. package/dist/cjs/node_modules/date-fns/endOfHour.js +0 -40
  53. package/dist/cjs/node_modules/date-fns/endOfMinute.js +0 -40
  54. package/dist/cjs/node_modules/date-fns/endOfMonth.js +0 -42
  55. package/dist/cjs/node_modules/date-fns/endOfQuarter.js +0 -43
  56. package/dist/cjs/node_modules/date-fns/endOfWeek.js +0 -58
  57. package/dist/cjs/node_modules/date-fns/endOfYear.js +0 -42
  58. package/dist/cjs/node_modules/date-fns/format.js +0 -431
  59. package/dist/cjs/node_modules/date-fns/getDayOfYear.js +0 -39
  60. package/dist/cjs/node_modules/date-fns/getISOWeek.js +0 -45
  61. package/dist/cjs/node_modules/date-fns/getISOWeekYear.js +0 -57
  62. package/dist/cjs/node_modules/date-fns/getWeek.js +0 -59
  63. package/dist/cjs/node_modules/date-fns/getWeekYear.js +0 -80
  64. package/dist/cjs/node_modules/date-fns/intervalToDuration.js +0 -70
  65. package/dist/cjs/node_modules/date-fns/isAfter.js +0 -30
  66. package/dist/cjs/node_modules/date-fns/isBefore.js +0 -30
  67. package/dist/cjs/node_modules/date-fns/isDate.js +0 -46
  68. package/dist/cjs/node_modules/date-fns/isLastDayOfMonth.js +0 -33
  69. package/dist/cjs/node_modules/date-fns/isSameMonth.js +0 -48
  70. package/dist/cjs/node_modules/date-fns/isSameWeek.js +0 -56
  71. package/dist/cjs/node_modules/date-fns/isSameYear.js +0 -40
  72. package/dist/cjs/node_modules/date-fns/isValid.js +0 -44
  73. package/dist/cjs/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -12
  74. package/dist/cjs/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -66
  75. package/dist/cjs/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -61
  76. package/dist/cjs/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -24
  77. package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/formatDistance.js +0 -139
  78. package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/formatLong.js +0 -43
  79. package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/formatRelative.js +0 -15
  80. package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/localize.js +0 -166
  81. package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/match.js +0 -146
  82. package/dist/cjs/node_modules/date-fns/locale/ar-SA.js +0 -32
  83. package/dist/cjs/node_modules/date-fns/locale/de/_lib/formatDistance.js +0 -200
  84. package/dist/cjs/node_modules/date-fns/locale/de/_lib/formatLong.js +0 -44
  85. package/dist/cjs/node_modules/date-fns/locale/de/_lib/formatRelative.js +0 -15
  86. package/dist/cjs/node_modules/date-fns/locale/de/_lib/localize.js +0 -195
  87. package/dist/cjs/node_modules/date-fns/locale/de/_lib/match.js +0 -138
  88. package/dist/cjs/node_modules/date-fns/locale/de.js +0 -36
  89. package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +0 -105
  90. package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -43
  91. package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +0 -15
  92. package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -191
  93. package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/match.js +0 -136
  94. package/dist/cjs/node_modules/date-fns/locale/en-US.js +0 -33
  95. package/dist/cjs/node_modules/date-fns/locale/es/_lib/formatDistance.js +0 -105
  96. package/dist/cjs/node_modules/date-fns/locale/es/_lib/formatLong.js +0 -43
  97. package/dist/cjs/node_modules/date-fns/locale/es/_lib/formatRelative.js +0 -29
  98. package/dist/cjs/node_modules/date-fns/locale/es/_lib/localize.js +0 -168
  99. package/dist/cjs/node_modules/date-fns/locale/es/_lib/match.js +0 -142
  100. package/dist/cjs/node_modules/date-fns/locale/es.js +0 -36
  101. package/dist/cjs/node_modules/date-fns/locale/fr/_lib/formatDistance.js +0 -104
  102. package/dist/cjs/node_modules/date-fns/locale/fr/_lib/formatLong.js +0 -43
  103. package/dist/cjs/node_modules/date-fns/locale/fr/_lib/formatRelative.js +0 -15
  104. package/dist/cjs/node_modules/date-fns/locale/fr/_lib/localize.js +0 -169
  105. package/dist/cjs/node_modules/date-fns/locale/fr/_lib/match.js +0 -137
  106. package/dist/cjs/node_modules/date-fns/locale/fr.js +0 -33
  107. package/dist/cjs/node_modules/date-fns/locale/hi/_lib/formatDistance.js +0 -109
  108. package/dist/cjs/node_modules/date-fns/locale/hi/_lib/formatLong.js +0 -43
  109. package/dist/cjs/node_modules/date-fns/locale/hi/_lib/formatRelative.js +0 -15
  110. package/dist/cjs/node_modules/date-fns/locale/hi/_lib/localize.js +0 -233
  111. package/dist/cjs/node_modules/date-fns/locale/hi/_lib/match.js +0 -141
  112. package/dist/cjs/node_modules/date-fns/locale/hi.js +0 -32
  113. package/dist/cjs/node_modules/date-fns/locale/it/_lib/formatDistance.js +0 -105
  114. package/dist/cjs/node_modules/date-fns/locale/it/_lib/formatLong.js +0 -43
  115. package/dist/cjs/node_modules/date-fns/locale/it/_lib/formatRelative.js +0 -70
  116. package/dist/cjs/node_modules/date-fns/locale/it/_lib/localize.js +0 -168
  117. package/dist/cjs/node_modules/date-fns/locale/it/_lib/match.js +0 -137
  118. package/dist/cjs/node_modules/date-fns/locale/it.js +0 -34
  119. package/dist/cjs/node_modules/date-fns/locale/ja/_lib/formatDistance.js +0 -119
  120. package/dist/cjs/node_modules/date-fns/locale/ja/_lib/formatLong.js +0 -43
  121. package/dist/cjs/node_modules/date-fns/locale/ja/_lib/formatRelative.js +0 -16
  122. package/dist/cjs/node_modules/date-fns/locale/ja/_lib/localize.js +0 -181
  123. package/dist/cjs/node_modules/date-fns/locale/ja/_lib/match.js +0 -122
  124. package/dist/cjs/node_modules/date-fns/locale/ja.js +0 -36
  125. package/dist/cjs/node_modules/date-fns/locale/ko/_lib/formatDistance.js +0 -105
  126. package/dist/cjs/node_modules/date-fns/locale/ko/_lib/formatLong.js +0 -43
  127. package/dist/cjs/node_modules/date-fns/locale/ko/_lib/formatRelative.js +0 -15
  128. package/dist/cjs/node_modules/date-fns/locale/ko/_lib/localize.js +0 -171
  129. package/dist/cjs/node_modules/date-fns/locale/ko/_lib/match.js +0 -119
  130. package/dist/cjs/node_modules/date-fns/locale/ko.js +0 -34
  131. package/dist/cjs/node_modules/date-fns/locale/pt/_lib/formatDistance.js +0 -105
  132. package/dist/cjs/node_modules/date-fns/locale/pt/_lib/formatLong.js +0 -43
  133. package/dist/cjs/node_modules/date-fns/locale/pt/_lib/formatRelative.js +0 -26
  134. package/dist/cjs/node_modules/date-fns/locale/pt/_lib/localize.js +0 -168
  135. package/dist/cjs/node_modules/date-fns/locale/pt/_lib/match.js +0 -141
  136. package/dist/cjs/node_modules/date-fns/locale/pt.js +0 -33
  137. package/dist/cjs/node_modules/date-fns/locale/ru/_lib/formatDistance.js +0 -250
  138. package/dist/cjs/node_modules/date-fns/locale/ru/_lib/formatLong.js +0 -40
  139. package/dist/cjs/node_modules/date-fns/locale/ru/_lib/formatRelative.js +0 -92
  140. package/dist/cjs/node_modules/date-fns/locale/ru/_lib/localize.js +0 -214
  141. package/dist/cjs/node_modules/date-fns/locale/ru/_lib/match.js +0 -142
  142. package/dist/cjs/node_modules/date-fns/locale/ru.js +0 -33
  143. package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/formatDistance.js +0 -105
  144. package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/formatLong.js +0 -43
  145. package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/formatRelative.js +0 -35
  146. package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/localize.js +0 -187
  147. package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/match.js +0 -134
  148. package/dist/cjs/node_modules/date-fns/locale/zh-CN.js +0 -36
  149. package/dist/cjs/node_modules/date-fns/startOfDay.js +0 -40
  150. package/dist/cjs/node_modules/date-fns/startOfDecade.js +0 -45
  151. package/dist/cjs/node_modules/date-fns/startOfHour.js +0 -40
  152. package/dist/cjs/node_modules/date-fns/startOfISOWeek.js +0 -40
  153. package/dist/cjs/node_modules/date-fns/startOfISOWeekYear.js +0 -47
  154. package/dist/cjs/node_modules/date-fns/startOfMinute.js +0 -40
  155. package/dist/cjs/node_modules/date-fns/startOfMonth.js +0 -42
  156. package/dist/cjs/node_modules/date-fns/startOfQuarter.js +0 -43
  157. package/dist/cjs/node_modules/date-fns/startOfWeek.js +0 -58
  158. package/dist/cjs/node_modules/date-fns/startOfWeekYear.js +0 -69
  159. package/dist/cjs/node_modules/date-fns/startOfYear.js +0 -41
  160. package/dist/cjs/node_modules/date-fns/toDate.js +0 -51
  161. package/dist/cjs/packages/date/dist/esm/display/DateDuration.js +0 -178
  162. package/dist/cjs/packages/date/dist/esm/hijri/DateConverter.js +0 -154
  163. package/dist/cjs/packages/date/dist/esm/hijri/FormatDate.js +0 -116
  164. package/dist/cjs/packages/date/dist/esm/hijri/HijriDate.js +0 -531
  165. package/dist/cjs/packages/date/dist/esm/hijri/StringDateParser.js +0 -74
  166. package/dist/cjs/packages/date/dist/esm/hijri/index.js +0 -21
  167. package/dist/cjs/packages/date/dist/esm/hijri/initializer.js +0 -113
  168. package/dist/cjs/packages/date/dist/esm/hijri/locales.js +0 -19
  169. package/dist/cjs/packages/date/dist/esm/hijri/safe.js +0 -17
  170. package/dist/cjs/packages/date/dist/esm/i18n/ar/date.json.js +0 -213
  171. package/dist/cjs/packages/date/dist/esm/i18n/en/date.json.js +0 -83
  172. package/dist/cjs/packages/date/dist/esm/i18n/index.js +0 -33
  173. package/dist/cjs/packages/date/dist/esm/types/index.js +0 -46
  174. package/dist/cjs/packages/date/dist/esm/utils/dateUtil.js +0 -472
  175. package/dist/esm/node_modules/date-fns/_lib/addLeadingZeros.js +0 -9
  176. package/dist/esm/node_modules/date-fns/_lib/defaultOptions.js +0 -9
  177. package/dist/esm/node_modules/date-fns/_lib/format/formatters.js +0 -779
  178. package/dist/esm/node_modules/date-fns/_lib/format/lightFormatters.js +0 -96
  179. package/dist/esm/node_modules/date-fns/_lib/format/longFormatters.js +0 -68
  180. package/dist/esm/node_modules/date-fns/_lib/getRoundingMethod.js +0 -12
  181. package/dist/esm/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +0 -33
  182. package/dist/esm/node_modules/date-fns/_lib/normalizeDates.js +0 -13
  183. package/dist/esm/node_modules/date-fns/_lib/normalizeInterval.js +0 -10
  184. package/dist/esm/node_modules/date-fns/_lib/protectedTokens.js +0 -27
  185. package/dist/esm/node_modules/date-fns/add.js +0 -70
  186. package/dist/esm/node_modules/date-fns/addDays.js +0 -43
  187. package/dist/esm/node_modules/date-fns/addHours.js +0 -36
  188. package/dist/esm/node_modules/date-fns/addMilliseconds.js +0 -36
  189. package/dist/esm/node_modules/date-fns/addMinutes.js +0 -38
  190. package/dist/esm/node_modules/date-fns/addMonths.js +0 -77
  191. package/dist/esm/node_modules/date-fns/addQuarters.js +0 -35
  192. package/dist/esm/node_modules/date-fns/addWeeks.js +0 -35
  193. package/dist/esm/node_modules/date-fns/addYears.js +0 -35
  194. package/dist/esm/node_modules/date-fns/compareAsc.js +0 -47
  195. package/dist/esm/node_modules/date-fns/constants.js +0 -62
  196. package/dist/esm/node_modules/date-fns/constructFrom.js +0 -51
  197. package/dist/esm/node_modules/date-fns/differenceInCalendarDays.js +0 -64
  198. package/dist/esm/node_modules/date-fns/differenceInCalendarMonths.js +0 -44
  199. package/dist/esm/node_modules/date-fns/differenceInCalendarYears.js +0 -40
  200. package/dist/esm/node_modules/date-fns/differenceInDays.js +0 -109
  201. package/dist/esm/node_modules/date-fns/differenceInHours.js +0 -43
  202. package/dist/esm/node_modules/date-fns/differenceInMilliseconds.js +0 -31
  203. package/dist/esm/node_modules/date-fns/differenceInMinutes.js +0 -47
  204. package/dist/esm/node_modules/date-fns/differenceInMonths.js +0 -62
  205. package/dist/esm/node_modules/date-fns/differenceInSeconds.js +0 -38
  206. package/dist/esm/node_modules/date-fns/differenceInYears.js +0 -64
  207. package/dist/esm/node_modules/date-fns/endOfDay.js +0 -37
  208. package/dist/esm/node_modules/date-fns/endOfDecade.js +0 -42
  209. package/dist/esm/node_modules/date-fns/endOfHour.js +0 -37
  210. package/dist/esm/node_modules/date-fns/endOfMinute.js +0 -37
  211. package/dist/esm/node_modules/date-fns/endOfMonth.js +0 -39
  212. package/dist/esm/node_modules/date-fns/endOfQuarter.js +0 -40
  213. package/dist/esm/node_modules/date-fns/endOfWeek.js +0 -55
  214. package/dist/esm/node_modules/date-fns/endOfYear.js +0 -39
  215. package/dist/esm/node_modules/date-fns/format.js +0 -425
  216. package/dist/esm/node_modules/date-fns/getDayOfYear.js +0 -36
  217. package/dist/esm/node_modules/date-fns/getISOWeek.js +0 -42
  218. package/dist/esm/node_modules/date-fns/getISOWeekYear.js +0 -54
  219. package/dist/esm/node_modules/date-fns/getWeek.js +0 -56
  220. package/dist/esm/node_modules/date-fns/getWeekYear.js +0 -77
  221. package/dist/esm/node_modules/date-fns/intervalToDuration.js +0 -67
  222. package/dist/esm/node_modules/date-fns/isAfter.js +0 -27
  223. package/dist/esm/node_modules/date-fns/isBefore.js +0 -27
  224. package/dist/esm/node_modules/date-fns/isDate.js +0 -43
  225. package/dist/esm/node_modules/date-fns/isLastDayOfMonth.js +0 -30
  226. package/dist/esm/node_modules/date-fns/isSameMonth.js +0 -45
  227. package/dist/esm/node_modules/date-fns/isSameWeek.js +0 -53
  228. package/dist/esm/node_modules/date-fns/isSameYear.js +0 -37
  229. package/dist/esm/node_modules/date-fns/isValid.js +0 -41
  230. package/dist/esm/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -12
  231. package/dist/esm/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -66
  232. package/dist/esm/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -61
  233. package/dist/esm/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -24
  234. package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/formatDistance.js +0 -139
  235. package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/formatLong.js +0 -43
  236. package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/formatRelative.js +0 -15
  237. package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/localize.js +0 -166
  238. package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/match.js +0 -146
  239. package/dist/esm/node_modules/date-fns/locale/ar-SA.js +0 -29
  240. package/dist/esm/node_modules/date-fns/locale/de/_lib/formatDistance.js +0 -200
  241. package/dist/esm/node_modules/date-fns/locale/de/_lib/formatLong.js +0 -44
  242. package/dist/esm/node_modules/date-fns/locale/de/_lib/formatRelative.js +0 -15
  243. package/dist/esm/node_modules/date-fns/locale/de/_lib/localize.js +0 -195
  244. package/dist/esm/node_modules/date-fns/locale/de/_lib/match.js +0 -138
  245. package/dist/esm/node_modules/date-fns/locale/de.js +0 -33
  246. package/dist/esm/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +0 -105
  247. package/dist/esm/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -43
  248. package/dist/esm/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +0 -15
  249. package/dist/esm/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -191
  250. package/dist/esm/node_modules/date-fns/locale/en-US/_lib/match.js +0 -136
  251. package/dist/esm/node_modules/date-fns/locale/en-US.js +0 -30
  252. package/dist/esm/node_modules/date-fns/locale/es/_lib/formatDistance.js +0 -105
  253. package/dist/esm/node_modules/date-fns/locale/es/_lib/formatLong.js +0 -43
  254. package/dist/esm/node_modules/date-fns/locale/es/_lib/formatRelative.js +0 -29
  255. package/dist/esm/node_modules/date-fns/locale/es/_lib/localize.js +0 -168
  256. package/dist/esm/node_modules/date-fns/locale/es/_lib/match.js +0 -142
  257. package/dist/esm/node_modules/date-fns/locale/es.js +0 -33
  258. package/dist/esm/node_modules/date-fns/locale/fr/_lib/formatDistance.js +0 -104
  259. package/dist/esm/node_modules/date-fns/locale/fr/_lib/formatLong.js +0 -43
  260. package/dist/esm/node_modules/date-fns/locale/fr/_lib/formatRelative.js +0 -15
  261. package/dist/esm/node_modules/date-fns/locale/fr/_lib/localize.js +0 -169
  262. package/dist/esm/node_modules/date-fns/locale/fr/_lib/match.js +0 -137
  263. package/dist/esm/node_modules/date-fns/locale/fr.js +0 -30
  264. package/dist/esm/node_modules/date-fns/locale/hi/_lib/formatDistance.js +0 -109
  265. package/dist/esm/node_modules/date-fns/locale/hi/_lib/formatLong.js +0 -43
  266. package/dist/esm/node_modules/date-fns/locale/hi/_lib/formatRelative.js +0 -15
  267. package/dist/esm/node_modules/date-fns/locale/hi/_lib/localize.js +0 -231
  268. package/dist/esm/node_modules/date-fns/locale/hi/_lib/match.js +0 -141
  269. package/dist/esm/node_modules/date-fns/locale/hi.js +0 -29
  270. package/dist/esm/node_modules/date-fns/locale/it/_lib/formatDistance.js +0 -105
  271. package/dist/esm/node_modules/date-fns/locale/it/_lib/formatLong.js +0 -43
  272. package/dist/esm/node_modules/date-fns/locale/it/_lib/formatRelative.js +0 -70
  273. package/dist/esm/node_modules/date-fns/locale/it/_lib/localize.js +0 -168
  274. package/dist/esm/node_modules/date-fns/locale/it/_lib/match.js +0 -137
  275. package/dist/esm/node_modules/date-fns/locale/it.js +0 -31
  276. package/dist/esm/node_modules/date-fns/locale/ja/_lib/formatDistance.js +0 -119
  277. package/dist/esm/node_modules/date-fns/locale/ja/_lib/formatLong.js +0 -43
  278. package/dist/esm/node_modules/date-fns/locale/ja/_lib/formatRelative.js +0 -16
  279. package/dist/esm/node_modules/date-fns/locale/ja/_lib/localize.js +0 -181
  280. package/dist/esm/node_modules/date-fns/locale/ja/_lib/match.js +0 -122
  281. package/dist/esm/node_modules/date-fns/locale/ja.js +0 -33
  282. package/dist/esm/node_modules/date-fns/locale/ko/_lib/formatDistance.js +0 -105
  283. package/dist/esm/node_modules/date-fns/locale/ko/_lib/formatLong.js +0 -43
  284. package/dist/esm/node_modules/date-fns/locale/ko/_lib/formatRelative.js +0 -15
  285. package/dist/esm/node_modules/date-fns/locale/ko/_lib/localize.js +0 -171
  286. package/dist/esm/node_modules/date-fns/locale/ko/_lib/match.js +0 -119
  287. package/dist/esm/node_modules/date-fns/locale/ko.js +0 -31
  288. package/dist/esm/node_modules/date-fns/locale/pt/_lib/formatDistance.js +0 -105
  289. package/dist/esm/node_modules/date-fns/locale/pt/_lib/formatLong.js +0 -43
  290. package/dist/esm/node_modules/date-fns/locale/pt/_lib/formatRelative.js +0 -26
  291. package/dist/esm/node_modules/date-fns/locale/pt/_lib/localize.js +0 -168
  292. package/dist/esm/node_modules/date-fns/locale/pt/_lib/match.js +0 -141
  293. package/dist/esm/node_modules/date-fns/locale/pt.js +0 -30
  294. package/dist/esm/node_modules/date-fns/locale/ru/_lib/formatDistance.js +0 -250
  295. package/dist/esm/node_modules/date-fns/locale/ru/_lib/formatLong.js +0 -40
  296. package/dist/esm/node_modules/date-fns/locale/ru/_lib/formatRelative.js +0 -92
  297. package/dist/esm/node_modules/date-fns/locale/ru/_lib/localize.js +0 -214
  298. package/dist/esm/node_modules/date-fns/locale/ru/_lib/match.js +0 -142
  299. package/dist/esm/node_modules/date-fns/locale/ru.js +0 -30
  300. package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/formatDistance.js +0 -105
  301. package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/formatLong.js +0 -43
  302. package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/formatRelative.js +0 -35
  303. package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/localize.js +0 -187
  304. package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/match.js +0 -134
  305. package/dist/esm/node_modules/date-fns/locale/zh-CN.js +0 -33
  306. package/dist/esm/node_modules/date-fns/startOfDay.js +0 -37
  307. package/dist/esm/node_modules/date-fns/startOfDecade.js +0 -42
  308. package/dist/esm/node_modules/date-fns/startOfHour.js +0 -37
  309. package/dist/esm/node_modules/date-fns/startOfISOWeek.js +0 -37
  310. package/dist/esm/node_modules/date-fns/startOfISOWeekYear.js +0 -44
  311. package/dist/esm/node_modules/date-fns/startOfMinute.js +0 -37
  312. package/dist/esm/node_modules/date-fns/startOfMonth.js +0 -39
  313. package/dist/esm/node_modules/date-fns/startOfQuarter.js +0 -40
  314. package/dist/esm/node_modules/date-fns/startOfWeek.js +0 -55
  315. package/dist/esm/node_modules/date-fns/startOfWeekYear.js +0 -66
  316. package/dist/esm/node_modules/date-fns/startOfYear.js +0 -38
  317. package/dist/esm/node_modules/date-fns/toDate.js +0 -48
  318. package/dist/esm/packages/date/dist/esm/display/DateDuration.js +0 -178
  319. package/dist/esm/packages/date/dist/esm/hijri/DateConverter.js +0 -152
  320. package/dist/esm/packages/date/dist/esm/hijri/FormatDate.js +0 -113
  321. package/dist/esm/packages/date/dist/esm/hijri/HijriDate.js +0 -528
  322. package/dist/esm/packages/date/dist/esm/hijri/StringDateParser.js +0 -74
  323. package/dist/esm/packages/date/dist/esm/hijri/index.js +0 -21
  324. package/dist/esm/packages/date/dist/esm/hijri/initializer.js +0 -113
  325. package/dist/esm/packages/date/dist/esm/hijri/locales.js +0 -18
  326. package/dist/esm/packages/date/dist/esm/hijri/safe.js +0 -14
  327. package/dist/esm/packages/date/dist/esm/i18n/ar/date.json.js +0 -209
  328. package/dist/esm/packages/date/dist/esm/i18n/en/date.json.js +0 -79
  329. package/dist/esm/packages/date/dist/esm/i18n/index.js +0 -33
  330. package/dist/esm/packages/date/dist/esm/types/index.js +0 -45
  331. package/dist/esm/packages/date/dist/esm/utils/dateUtil.js +0 -474
  332. /package/dist/cjs/{packages/lexical/src/editor → editor}/theme.js +0 -0
  333. /package/dist/cjs/{packages/lexical/src/i18n → i18n}/ar/lexical.json.js +0 -0
  334. /package/dist/cjs/{packages/lexical/src/i18n → i18n}/en/lexical.json.js +0 -0
  335. /package/dist/cjs/{packages/lexical/src/i18n → i18n}/index.js +0 -0
  336. /package/dist/cjs/{packages/lexical/src/index.js → index.js} +0 -0
  337. /package/dist/cjs/{packages/lexical/src/plugins → plugins}/ToolbarPlugin.js +0 -0
  338. /package/dist/cjs/{packages/lexical/src/utils → utils}/index.js +0 -0
  339. /package/dist/esm/{packages/lexical/src/editor → editor}/theme.js +0 -0
  340. /package/dist/esm/{packages/lexical/src/i18n → i18n}/ar/lexical.json.js +0 -0
  341. /package/dist/esm/{packages/lexical/src/i18n → i18n}/en/lexical.json.js +0 -0
  342. /package/dist/esm/{packages/lexical/src/i18n → i18n}/index.js +0 -0
  343. /package/dist/esm/{packages/lexical/src/index.js → index.js} +0 -0
  344. /package/dist/esm/{packages/lexical/src/plugins → plugins}/ToolbarPlugin.js +0 -0
  345. /package/dist/esm/{packages/lexical/src/utils → utils}/index.js +0 -0
@@ -1,96 +0,0 @@
1
- 'use client';
2
-
3
- import { addLeadingZeros } from '../addLeadingZeros.js';
4
-
5
- /*
6
- * | | Unit | | Unit |
7
- * |-----|--------------------------------|-----|--------------------------------|
8
- * | a | AM, PM | A* | |
9
- * | d | Day of month | D | |
10
- * | h | Hour [1-12] | H | Hour [0-23] |
11
- * | m | Minute | M | Month |
12
- * | s | Second | S | Fraction of second |
13
- * | y | Year (abs) | Y | |
14
- *
15
- * Letters marked by * are not implemented but reserved by Unicode standard.
16
- */
17
-
18
- const lightFormatters = {
19
- // Year
20
- y(date, token) {
21
- // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
22
- // | Year | y | yy | yyy | yyyy | yyyyy |
23
- // |----------|-------|----|-------|-------|-------|
24
- // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
25
- // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
26
- // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
27
- // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
28
- // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
29
-
30
- const signedYear = date.getFullYear();
31
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
32
- const year = signedYear > 0 ? signedYear : 1 - signedYear;
33
- return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
34
- },
35
-
36
- // Month
37
- M(date, token) {
38
- const month = date.getMonth();
39
- return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
40
- },
41
-
42
- // Day of the month
43
- d(date, token) {
44
- return addLeadingZeros(date.getDate(), token.length);
45
- },
46
-
47
- // AM or PM
48
- a(date, token) {
49
- const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
50
-
51
- switch (token) {
52
- case "a":
53
- case "aa":
54
- return dayPeriodEnumValue.toUpperCase();
55
- case "aaa":
56
- return dayPeriodEnumValue;
57
- case "aaaaa":
58
- return dayPeriodEnumValue[0];
59
- case "aaaa":
60
- default:
61
- return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
62
- }
63
- },
64
-
65
- // Hour [1-12]
66
- h(date, token) {
67
- return addLeadingZeros(date.getHours() % 12 || 12, token.length);
68
- },
69
-
70
- // Hour [0-23]
71
- H(date, token) {
72
- return addLeadingZeros(date.getHours(), token.length);
73
- },
74
-
75
- // Minute
76
- m(date, token) {
77
- return addLeadingZeros(date.getMinutes(), token.length);
78
- },
79
-
80
- // Second
81
- s(date, token) {
82
- return addLeadingZeros(date.getSeconds(), token.length);
83
- },
84
-
85
- // Fraction of second
86
- S(date, token) {
87
- const numberOfDigits = token.length;
88
- const milliseconds = date.getMilliseconds();
89
- const fractionalSeconds = Math.trunc(
90
- milliseconds * Math.pow(10, numberOfDigits - 3),
91
- );
92
- return addLeadingZeros(fractionalSeconds, token.length);
93
- },
94
- };
95
-
96
- export { lightFormatters };
@@ -1,68 +0,0 @@
1
- 'use client';
2
-
3
- const dateLongFormatter = (pattern, formatLong) => {
4
- switch (pattern) {
5
- case "P":
6
- return formatLong.date({ width: "short" });
7
- case "PP":
8
- return formatLong.date({ width: "medium" });
9
- case "PPP":
10
- return formatLong.date({ width: "long" });
11
- case "PPPP":
12
- default:
13
- return formatLong.date({ width: "full" });
14
- }
15
- };
16
-
17
- const timeLongFormatter = (pattern, formatLong) => {
18
- switch (pattern) {
19
- case "p":
20
- return formatLong.time({ width: "short" });
21
- case "pp":
22
- return formatLong.time({ width: "medium" });
23
- case "ppp":
24
- return formatLong.time({ width: "long" });
25
- case "pppp":
26
- default:
27
- return formatLong.time({ width: "full" });
28
- }
29
- };
30
-
31
- const dateTimeLongFormatter = (pattern, formatLong) => {
32
- const matchResult = pattern.match(/(P+)(p+)?/) || [];
33
- const datePattern = matchResult[1];
34
- const timePattern = matchResult[2];
35
-
36
- if (!timePattern) {
37
- return dateLongFormatter(pattern, formatLong);
38
- }
39
-
40
- let dateTimeFormat;
41
-
42
- switch (datePattern) {
43
- case "P":
44
- dateTimeFormat = formatLong.dateTime({ width: "short" });
45
- break;
46
- case "PP":
47
- dateTimeFormat = formatLong.dateTime({ width: "medium" });
48
- break;
49
- case "PPP":
50
- dateTimeFormat = formatLong.dateTime({ width: "long" });
51
- break;
52
- case "PPPP":
53
- default:
54
- dateTimeFormat = formatLong.dateTime({ width: "full" });
55
- break;
56
- }
57
-
58
- return dateTimeFormat
59
- .replace("{{date}}", dateLongFormatter(datePattern, formatLong))
60
- .replace("{{time}}", timeLongFormatter(timePattern, formatLong));
61
- };
62
-
63
- const longFormatters = {
64
- p: timeLongFormatter,
65
- P: dateTimeLongFormatter,
66
- };
67
-
68
- export { longFormatters };
@@ -1,12 +0,0 @@
1
- 'use client';
2
-
3
- function getRoundingMethod(method) {
4
- return (number) => {
5
- const round = method ? Math[method] : Math.trunc;
6
- const result = round(number);
7
- // Prevent negative zero
8
- return result === 0 ? 0 : result;
9
- };
10
- }
11
-
12
- export { getRoundingMethod };
@@ -1,33 +0,0 @@
1
- 'use client';
2
-
3
- import { toDate } from '../toDate.js';
4
-
5
- /**
6
- * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
7
- * They usually appear for dates that denote time before the timezones were introduced
8
- * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
9
- * and GMT+01:00:00 after that date)
10
- *
11
- * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
12
- * which would lead to incorrect calculations.
13
- *
14
- * This function returns the timezone offset in milliseconds that takes seconds in account.
15
- */
16
- function getTimezoneOffsetInMilliseconds(date) {
17
- const _date = toDate(date);
18
- const utcDate = new Date(
19
- Date.UTC(
20
- _date.getFullYear(),
21
- _date.getMonth(),
22
- _date.getDate(),
23
- _date.getHours(),
24
- _date.getMinutes(),
25
- _date.getSeconds(),
26
- _date.getMilliseconds(),
27
- ),
28
- );
29
- utcDate.setUTCFullYear(_date.getFullYear());
30
- return +date - +utcDate;
31
- }
32
-
33
- export { getTimezoneOffsetInMilliseconds };
@@ -1,13 +0,0 @@
1
- 'use client';
2
-
3
- import { constructFrom } from '../constructFrom.js';
4
-
5
- function normalizeDates(context, ...dates) {
6
- const normalize = constructFrom.bind(
7
- null,
8
- context || dates.find((date) => typeof date === "object"),
9
- );
10
- return dates.map(normalize);
11
- }
12
-
13
- export { normalizeDates };
@@ -1,10 +0,0 @@
1
- 'use client';
2
-
3
- import { normalizeDates } from './normalizeDates.js';
4
-
5
- function normalizeInterval(context, interval) {
6
- const [start, end] = normalizeDates(context, interval.start, interval.end);
7
- return { start, end };
8
- }
9
-
10
- export { normalizeInterval };
@@ -1,27 +0,0 @@
1
- 'use client';
2
-
3
- const dayOfYearTokenRE = /^D+$/;
4
- const weekYearTokenRE = /^Y+$/;
5
-
6
- const throwTokens = ["D", "DD", "YY", "YYYY"];
7
-
8
- function isProtectedDayOfYearToken(token) {
9
- return dayOfYearTokenRE.test(token);
10
- }
11
-
12
- function isProtectedWeekYearToken(token) {
13
- return weekYearTokenRE.test(token);
14
- }
15
-
16
- function warnOrThrowProtectedError(token, format, input) {
17
- const _message = message(token, format, input);
18
- console.warn(_message);
19
- if (throwTokens.includes(token)) throw new RangeError(_message);
20
- }
21
-
22
- function message(token, format, input) {
23
- const subject = token[0] === "Y" ? "years" : "days of the month";
24
- return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
25
- }
26
-
27
- export { isProtectedDayOfYearToken, isProtectedWeekYearToken, warnOrThrowProtectedError };
@@ -1,70 +0,0 @@
1
- 'use client';
2
-
3
- import { addDays } from './addDays.js';
4
- import { addMonths } from './addMonths.js';
5
- import { constructFrom } from './constructFrom.js';
6
- import { toDate } from './toDate.js';
7
-
8
- /**
9
- * The {@link add} function options.
10
- */
11
-
12
- /**
13
- * @name add
14
- * @category Common Helpers
15
- * @summary Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.
16
- *
17
- * @description
18
- * Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.
19
- *
20
- * @typeParam DateType - The `Date` type the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).
21
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
22
- *
23
- * @param date - The date to be changed
24
- * @param duration - The object with years, months, weeks, days, hours, minutes, and seconds to be added.
25
- * @param options - An object with options
26
- *
27
- * @returns The new date with the seconds added
28
- *
29
- * @example
30
- * // Add the following duration to 1 September 2014, 10:19:50
31
- * const result = add(new Date(2014, 8, 1, 10, 19, 50), {
32
- * years: 2,
33
- * months: 9,
34
- * weeks: 1,
35
- * days: 7,
36
- * hours: 5,
37
- * minutes: 9,
38
- * seconds: 30,
39
- * })
40
- * //=> Thu Jun 15 2017 15:29:20
41
- */
42
- function add(date, duration, options) {
43
- const {
44
- years = 0,
45
- months = 0,
46
- weeks = 0,
47
- days = 0,
48
- hours = 0,
49
- minutes = 0,
50
- seconds = 0,
51
- } = duration;
52
-
53
- // Add years and months
54
- const _date = toDate(date, options?.in);
55
- const dateWithMonths =
56
- months || years ? addMonths(_date, months + years * 12) : _date;
57
-
58
- // Add weeks and days
59
- const dateWithDays =
60
- days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;
61
-
62
- // Add days, hours, minutes, and seconds
63
- const minutesToAdd = minutes + hours * 60;
64
- const secondsToAdd = seconds + minutesToAdd * 60;
65
- const msToAdd = secondsToAdd * 1000;
66
-
67
- return constructFrom(options?.in || date, +dateWithDays + msToAdd);
68
- }
69
-
70
- export { add, add as default };
@@ -1,43 +0,0 @@
1
- 'use client';
2
-
3
- import { constructFrom } from './constructFrom.js';
4
- import { toDate } from './toDate.js';
5
-
6
- /**
7
- * The {@link addDays} function options.
8
- */
9
-
10
- /**
11
- * @name addDays
12
- * @category Day Helpers
13
- * @summary Add the specified number of days to the given date.
14
- *
15
- * @description
16
- * Add the specified number of days to the given date.
17
- *
18
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
19
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
20
- *
21
- * @param date - The date to be changed
22
- * @param amount - The amount of days to be added.
23
- * @param options - An object with options
24
- *
25
- * @returns The new date with the days added
26
- *
27
- * @example
28
- * // Add 10 days to 1 September 2014:
29
- * const result = addDays(new Date(2014, 8, 1), 10)
30
- * //=> Thu Sep 11 2014 00:00:00
31
- */
32
- function addDays(date, amount, options) {
33
- const _date = toDate(date, options?.in);
34
- if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
35
-
36
- // If 0 days, no-op to avoid changing times in the hour before end of DST
37
- if (!amount) return _date;
38
-
39
- _date.setDate(_date.getDate() + amount);
40
- return _date;
41
- }
42
-
43
- export { addDays, addDays as default };
@@ -1,36 +0,0 @@
1
- 'use client';
2
-
3
- import { addMilliseconds } from './addMilliseconds.js';
4
- import { millisecondsInHour } from './constants.js';
5
-
6
- /**
7
- * The {@link addHours} function options.
8
- */
9
-
10
- /**
11
- * @name addHours
12
- * @category Hour Helpers
13
- * @summary Add the specified number of hours to the given date.
14
- *
15
- * @description
16
- * Add the specified number of hours to the given date.
17
- *
18
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
19
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
20
- *
21
- * @param date - The date to be changed
22
- * @param amount - The amount of hours to be added
23
- * @param options - An object with options
24
- *
25
- * @returns The new date with the hours added
26
- *
27
- * @example
28
- * // Add 2 hours to 10 July 2014 23:00:00:
29
- * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)
30
- * //=> Fri Jul 11 2014 01:00:00
31
- */
32
- function addHours(date, amount, options) {
33
- return addMilliseconds(date, amount * millisecondsInHour, options);
34
- }
35
-
36
- export { addHours, addHours as default };
@@ -1,36 +0,0 @@
1
- 'use client';
2
-
3
- import { constructFrom } from './constructFrom.js';
4
- import { toDate } from './toDate.js';
5
-
6
- /**
7
- * The {@link addMilliseconds} function options.
8
- */
9
-
10
- /**
11
- * @name addMilliseconds
12
- * @category Millisecond Helpers
13
- * @summary Add the specified number of milliseconds to the given date.
14
- *
15
- * @description
16
- * Add the specified number of milliseconds to the given date.
17
- *
18
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
19
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
20
- *
21
- * @param date - The date to be changed
22
- * @param amount - The amount of milliseconds to be added.
23
- * @param options - The options object
24
- *
25
- * @returns The new date with the milliseconds added
26
- *
27
- * @example
28
- * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
29
- * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
30
- * //=> Thu Jul 10 2014 12:45:30.750
31
- */
32
- function addMilliseconds(date, amount, options) {
33
- return constructFrom(options?.in || date, +toDate(date) + amount);
34
- }
35
-
36
- export { addMilliseconds, addMilliseconds as default };
@@ -1,38 +0,0 @@
1
- 'use client';
2
-
3
- import { millisecondsInMinute } from './constants.js';
4
- import { toDate } from './toDate.js';
5
-
6
- /**
7
- * The {@link addMinutes} function options.
8
- */
9
-
10
- /**
11
- * @name addMinutes
12
- * @category Minute Helpers
13
- * @summary Add the specified number of minutes to the given date.
14
- *
15
- * @description
16
- * Add the specified number of minutes to the given date.
17
- *
18
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
19
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
20
- *
21
- * @param date - The date to be changed
22
- * @param amount - The amount of minutes to be added.
23
- * @param options - An object with options
24
- *
25
- * @returns The new date with the minutes added
26
- *
27
- * @example
28
- * // Add 30 minutes to 10 July 2014 12:00:00:
29
- * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)
30
- * //=> Thu Jul 10 2014 12:30:00
31
- */
32
- function addMinutes(date, amount, options) {
33
- const _date = toDate(date, options?.in);
34
- _date.setTime(_date.getTime() + amount * millisecondsInMinute);
35
- return _date;
36
- }
37
-
38
- export { addMinutes, addMinutes as default };
@@ -1,77 +0,0 @@
1
- 'use client';
2
-
3
- import { constructFrom } from './constructFrom.js';
4
- import { toDate } from './toDate.js';
5
-
6
- /**
7
- * The {@link addMonths} function options.
8
- */
9
-
10
- /**
11
- * @name addMonths
12
- * @category Month Helpers
13
- * @summary Add the specified number of months to the given date.
14
- *
15
- * @description
16
- * Add the specified number of months to the given date.
17
- *
18
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
19
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
20
- *
21
- * @param date - The date to be changed
22
- * @param amount - The amount of months to be added.
23
- * @param options - The options object
24
- *
25
- * @returns The new date with the months added
26
- *
27
- * @example
28
- * // Add 5 months to 1 September 2014:
29
- * const result = addMonths(new Date(2014, 8, 1), 5)
30
- * //=> Sun Feb 01 2015 00:00:00
31
- *
32
- * // Add one month to 30 January 2023:
33
- * const result = addMonths(new Date(2023, 0, 30), 1)
34
- * //=> Tue Feb 28 2023 00:00:00
35
- */
36
- function addMonths(date, amount, options) {
37
- const _date = toDate(date, options?.in);
38
- if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
39
- if (!amount) {
40
- // If 0 months, no-op to avoid changing times in the hour before end of DST
41
- return _date;
42
- }
43
- const dayOfMonth = _date.getDate();
44
-
45
- // The JS Date object supports date math by accepting out-of-bounds values for
46
- // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
47
- // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
48
- // want except that dates will wrap around the end of a month, meaning that
49
- // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
50
- // we'll default to the end of the desired month by adding 1 to the desired
51
- // month and using a date of 0 to back up one day to the end of the desired
52
- // month.
53
- const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());
54
- endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
55
- const daysInMonth = endOfDesiredMonth.getDate();
56
- if (dayOfMonth >= daysInMonth) {
57
- // If we're already at the end of the month, then this is the correct date
58
- // and we're done.
59
- return endOfDesiredMonth;
60
- } else {
61
- // Otherwise, we now know that setting the original day-of-month value won't
62
- // cause an overflow, so set the desired day-of-month. Note that we can't
63
- // just set the date of `endOfDesiredMonth` because that object may have had
64
- // its time changed in the unusual case where where a DST transition was on
65
- // the last day of the month and its local time was in the hour skipped or
66
- // repeated next to a DST transition. So we use `date` instead which is
67
- // guaranteed to still have the original time.
68
- _date.setFullYear(
69
- endOfDesiredMonth.getFullYear(),
70
- endOfDesiredMonth.getMonth(),
71
- dayOfMonth,
72
- );
73
- return _date;
74
- }
75
- }
76
-
77
- export { addMonths, addMonths as default };
@@ -1,35 +0,0 @@
1
- 'use client';
2
-
3
- import { addMonths } from './addMonths.js';
4
-
5
- /**
6
- * The {@link addQuarters} function options.
7
- */
8
-
9
- /**
10
- * @name addQuarters
11
- * @category Quarter Helpers
12
- * @summary Add the specified number of year quarters to the given date.
13
- *
14
- * @description
15
- * Add the specified number of year quarters to the given date.
16
- *
17
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
18
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
19
- *
20
- * @param date - The date to be changed
21
- * @param amount - The amount of quarters to be added.
22
- * @param options - An object with options
23
- *
24
- * @returns The new date with the quarters added
25
- *
26
- * @example
27
- * // Add 1 quarter to 1 September 2014:
28
- * const result = addQuarters(new Date(2014, 8, 1), 1)
29
- * //=; Mon Dec 01 2014 00:00:00
30
- */
31
- function addQuarters(date, amount, options) {
32
- return addMonths(date, amount * 3, options);
33
- }
34
-
35
- export { addQuarters, addQuarters as default };
@@ -1,35 +0,0 @@
1
- 'use client';
2
-
3
- import { addDays } from './addDays.js';
4
-
5
- /**
6
- * The {@link addWeeks} function options.
7
- */
8
-
9
- /**
10
- * @name addWeeks
11
- * @category Week Helpers
12
- * @summary Add the specified number of weeks to the given date.
13
- *
14
- * @description
15
- * Add the specified number of weeks to the given date.
16
- *
17
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
18
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
19
- *
20
- * @param date - The date to be changed
21
- * @param amount - The amount of weeks to be added.
22
- * @param options - An object with options
23
- *
24
- * @returns The new date with the weeks added
25
- *
26
- * @example
27
- * // Add 4 weeks to 1 September 2014:
28
- * const result = addWeeks(new Date(2014, 8, 1), 4)
29
- * //=> Mon Sep 29 2014 00:00:00
30
- */
31
- function addWeeks(date, amount, options) {
32
- return addDays(date, amount * 7, options);
33
- }
34
-
35
- export { addWeeks, addWeeks as default };
@@ -1,35 +0,0 @@
1
- 'use client';
2
-
3
- import { addMonths } from './addMonths.js';
4
-
5
- /**
6
- * The {@link addYears} function options.
7
- */
8
-
9
- /**
10
- * @name addYears
11
- * @category Year Helpers
12
- * @summary Add the specified number of years to the given date.
13
- *
14
- * @description
15
- * Add the specified number of years to the given date.
16
- *
17
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
18
- * @typeParam ResultDate - The result `Date` type.
19
- *
20
- * @param date - The date to be changed
21
- * @param amount - The amount of years to be added.
22
- * @param options - The options
23
- *
24
- * @returns The new date with the years added
25
- *
26
- * @example
27
- * // Add 5 years to 1 September 2014:
28
- * const result = addYears(new Date(2014, 8, 1), 5)
29
- * //=> Sun Sep 01 2019 00:00:00
30
- */
31
- function addYears(date, amount, options) {
32
- return addMonths(date, amount * 12, options);
33
- }
34
-
35
- export { addYears, addYears as default };