@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,431 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var defaultOptions = require('./_lib/defaultOptions.js');
6
- var formatters = require('./_lib/format/formatters.js');
7
- var longFormatters = require('./_lib/format/longFormatters.js');
8
- var protectedTokens = require('./_lib/protectedTokens.js');
9
- var isValid = require('./isValid.js');
10
- var toDate = require('./toDate.js');
11
- var enUS = require('./locale/en-US.js');
12
-
13
- // This RegExp consists of three parts separated by `|`:
14
- // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
15
- // (one of the certain letters followed by `o`)
16
- // - (\w)\1* matches any sequences of the same letter
17
- // - '' matches two quote characters in a row
18
- // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
19
- // except a single quote symbol, which ends the sequence.
20
- // Two quote characters do not end the sequence.
21
- // If there is no matching single quote
22
- // then the sequence will continue until the end of the string.
23
- // - . matches any single character unmatched by previous parts of the RegExps
24
- const formattingTokensRegExp =
25
- /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
26
-
27
- // This RegExp catches symbols escaped by quotes, and also
28
- // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
29
- const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
30
-
31
- const escapedStringRegExp = /^'([^]*?)'?$/;
32
- const doubleQuoteRegExp = /''/g;
33
- const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
34
-
35
- /**
36
- * The {@link format} function options.
37
- */
38
-
39
- /**
40
- * @name format
41
- * @alias formatDate
42
- * @category Common Helpers
43
- * @summary Format the date.
44
- *
45
- * @description
46
- * Return the formatted date string in the given format. The result may vary by locale.
47
- *
48
- * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
49
- * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
50
- *
51
- * The characters wrapped between two single quotes characters (') are escaped.
52
- * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
53
- * (see the last example)
54
- *
55
- * Format of the string is based on Unicode Technical Standard #35:
56
- * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
57
- * with a few additions (see note 7 below the table).
58
- *
59
- * Accepted patterns:
60
- * | Unit | Pattern | Result examples | Notes |
61
- * |---------------------------------|---------|-----------------------------------|-------|
62
- * | Era | G..GGG | AD, BC | |
63
- * | | GGGG | Anno Domini, Before Christ | 2 |
64
- * | | GGGGG | A, B | |
65
- * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
66
- * | | yo | 44th, 1st, 0th, 17th | 5,7 |
67
- * | | yy | 44, 01, 00, 17 | 5 |
68
- * | | yyy | 044, 001, 1900, 2017 | 5 |
69
- * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
70
- * | | yyyyy | ... | 3,5 |
71
- * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
72
- * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
73
- * | | YY | 44, 01, 00, 17 | 5,8 |
74
- * | | YYY | 044, 001, 1900, 2017 | 5 |
75
- * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
76
- * | | YYYYY | ... | 3,5 |
77
- * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
78
- * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
79
- * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
80
- * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
81
- * | | RRRRR | ... | 3,5,7 |
82
- * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
83
- * | | uu | -43, 01, 1900, 2017 | 5 |
84
- * | | uuu | -043, 001, 1900, 2017 | 5 |
85
- * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
86
- * | | uuuuu | ... | 3,5 |
87
- * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
88
- * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
89
- * | | QQ | 01, 02, 03, 04 | |
90
- * | | QQQ | Q1, Q2, Q3, Q4 | |
91
- * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
92
- * | | QQQQQ | 1, 2, 3, 4 | 4 |
93
- * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
94
- * | | qo | 1st, 2nd, 3rd, 4th | 7 |
95
- * | | qq | 01, 02, 03, 04 | |
96
- * | | qqq | Q1, Q2, Q3, Q4 | |
97
- * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
98
- * | | qqqqq | 1, 2, 3, 4 | 4 |
99
- * | Month (formatting) | M | 1, 2, ..., 12 | |
100
- * | | Mo | 1st, 2nd, ..., 12th | 7 |
101
- * | | MM | 01, 02, ..., 12 | |
102
- * | | MMM | Jan, Feb, ..., Dec | |
103
- * | | MMMM | January, February, ..., December | 2 |
104
- * | | MMMMM | J, F, ..., D | |
105
- * | Month (stand-alone) | L | 1, 2, ..., 12 | |
106
- * | | Lo | 1st, 2nd, ..., 12th | 7 |
107
- * | | LL | 01, 02, ..., 12 | |
108
- * | | LLL | Jan, Feb, ..., Dec | |
109
- * | | LLLL | January, February, ..., December | 2 |
110
- * | | LLLLL | J, F, ..., D | |
111
- * | Local week of year | w | 1, 2, ..., 53 | |
112
- * | | wo | 1st, 2nd, ..., 53th | 7 |
113
- * | | ww | 01, 02, ..., 53 | |
114
- * | ISO week of year | I | 1, 2, ..., 53 | 7 |
115
- * | | Io | 1st, 2nd, ..., 53th | 7 |
116
- * | | II | 01, 02, ..., 53 | 7 |
117
- * | Day of month | d | 1, 2, ..., 31 | |
118
- * | | do | 1st, 2nd, ..., 31st | 7 |
119
- * | | dd | 01, 02, ..., 31 | |
120
- * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
121
- * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
122
- * | | DD | 01, 02, ..., 365, 366 | 9 |
123
- * | | DDD | 001, 002, ..., 365, 366 | |
124
- * | | DDDD | ... | 3 |
125
- * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
126
- * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
127
- * | | EEEEE | M, T, W, T, F, S, S | |
128
- * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
129
- * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
130
- * | | io | 1st, 2nd, ..., 7th | 7 |
131
- * | | ii | 01, 02, ..., 07 | 7 |
132
- * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
133
- * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
134
- * | | iiiii | M, T, W, T, F, S, S | 7 |
135
- * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
136
- * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
137
- * | | eo | 2nd, 3rd, ..., 1st | 7 |
138
- * | | ee | 02, 03, ..., 01 | |
139
- * | | eee | Mon, Tue, Wed, ..., Sun | |
140
- * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
141
- * | | eeeee | M, T, W, T, F, S, S | |
142
- * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
143
- * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
144
- * | | co | 2nd, 3rd, ..., 1st | 7 |
145
- * | | cc | 02, 03, ..., 01 | |
146
- * | | ccc | Mon, Tue, Wed, ..., Sun | |
147
- * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
148
- * | | ccccc | M, T, W, T, F, S, S | |
149
- * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
150
- * | AM, PM | a..aa | AM, PM | |
151
- * | | aaa | am, pm | |
152
- * | | aaaa | a.m., p.m. | 2 |
153
- * | | aaaaa | a, p | |
154
- * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
155
- * | | bbb | am, pm, noon, midnight | |
156
- * | | bbbb | a.m., p.m., noon, midnight | 2 |
157
- * | | bbbbb | a, p, n, mi | |
158
- * | Flexible day period | B..BBB | at night, in the morning, ... | |
159
- * | | BBBB | at night, in the morning, ... | 2 |
160
- * | | BBBBB | at night, in the morning, ... | |
161
- * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
162
- * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
163
- * | | hh | 01, 02, ..., 11, 12 | |
164
- * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
165
- * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
166
- * | | HH | 00, 01, 02, ..., 23 | |
167
- * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
168
- * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
169
- * | | KK | 01, 02, ..., 11, 00 | |
170
- * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
171
- * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
172
- * | | kk | 24, 01, 02, ..., 23 | |
173
- * | Minute | m | 0, 1, ..., 59 | |
174
- * | | mo | 0th, 1st, ..., 59th | 7 |
175
- * | | mm | 00, 01, ..., 59 | |
176
- * | Second | s | 0, 1, ..., 59 | |
177
- * | | so | 0th, 1st, ..., 59th | 7 |
178
- * | | ss | 00, 01, ..., 59 | |
179
- * | Fraction of second | S | 0, 1, ..., 9 | |
180
- * | | SS | 00, 01, ..., 99 | |
181
- * | | SSS | 000, 001, ..., 999 | |
182
- * | | SSSS | ... | 3 |
183
- * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
184
- * | | XX | -0800, +0530, Z | |
185
- * | | XXX | -08:00, +05:30, Z | |
186
- * | | XXXX | -0800, +0530, Z, +123456 | 2 |
187
- * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
188
- * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
189
- * | | xx | -0800, +0530, +0000 | |
190
- * | | xxx | -08:00, +05:30, +00:00 | 2 |
191
- * | | xxxx | -0800, +0530, +0000, +123456 | |
192
- * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
193
- * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
194
- * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
195
- * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
196
- * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
197
- * | Seconds timestamp | t | 512969520 | 7 |
198
- * | | tt | ... | 3,7 |
199
- * | Milliseconds timestamp | T | 512969520900 | 7 |
200
- * | | TT | ... | 3,7 |
201
- * | Long localized date | P | 04/29/1453 | 7 |
202
- * | | PP | Apr 29, 1453 | 7 |
203
- * | | PPP | April 29th, 1453 | 7 |
204
- * | | PPPP | Friday, April 29th, 1453 | 2,7 |
205
- * | Long localized time | p | 12:00 AM | 7 |
206
- * | | pp | 12:00:00 AM | 7 |
207
- * | | ppp | 12:00:00 AM GMT+2 | 7 |
208
- * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
209
- * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
210
- * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
211
- * | | PPPppp | April 29th, 1453 at ... | 7 |
212
- * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
213
- * Notes:
214
- * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
215
- * are the same as "stand-alone" units, but are different in some languages.
216
- * "Formatting" units are declined according to the rules of the language
217
- * in the context of a date. "Stand-alone" units are always nominative singular:
218
- *
219
- * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
220
- *
221
- * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
222
- *
223
- * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
224
- * the single quote characters (see below).
225
- * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
226
- * the output will be the same as default pattern for this unit, usually
227
- * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
228
- * are marked with "2" in the last column of the table.
229
- *
230
- * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
231
- *
232
- * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
233
- *
234
- * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
235
- *
236
- * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
237
- *
238
- * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
239
- *
240
- * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
241
- * The output will be padded with zeros to match the length of the pattern.
242
- *
243
- * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
244
- *
245
- * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
246
- * These tokens represent the shortest form of the quarter.
247
- *
248
- * 5. The main difference between `y` and `u` patterns are B.C. years:
249
- *
250
- * | Year | `y` | `u` |
251
- * |------|-----|-----|
252
- * | AC 1 | 1 | 1 |
253
- * | BC 1 | 1 | 0 |
254
- * | BC 2 | 2 | -1 |
255
- *
256
- * Also `yy` always returns the last two digits of a year,
257
- * while `uu` pads single digit years to 2 characters and returns other years unchanged:
258
- *
259
- * | Year | `yy` | `uu` |
260
- * |------|------|------|
261
- * | 1 | 01 | 01 |
262
- * | 14 | 14 | 14 |
263
- * | 376 | 76 | 376 |
264
- * | 1453 | 53 | 1453 |
265
- *
266
- * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
267
- * except local week-numbering years are dependent on `options.weekStartsOn`
268
- * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
269
- * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
270
- *
271
- * 6. Specific non-location timezones are currently unavailable in `date-fns`,
272
- * so right now these tokens fall back to GMT timezones.
273
- *
274
- * 7. These patterns are not in the Unicode Technical Standard #35:
275
- * - `i`: ISO day of week
276
- * - `I`: ISO week of year
277
- * - `R`: ISO week-numbering year
278
- * - `t`: seconds timestamp
279
- * - `T`: milliseconds timestamp
280
- * - `o`: ordinal number modifier
281
- * - `P`: long localized date
282
- * - `p`: long localized time
283
- *
284
- * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
285
- * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
286
- *
287
- * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
288
- * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
289
- *
290
- * @param date - The original date
291
- * @param format - The string of tokens
292
- * @param options - An object with options
293
- *
294
- * @returns The formatted date string
295
- *
296
- * @throws `date` must not be Invalid Date
297
- * @throws `options.locale` must contain `localize` property
298
- * @throws `options.locale` must contain `formatLong` property
299
- * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
300
- * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
301
- * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
302
- * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
303
- * @throws format string contains an unescaped latin alphabet character
304
- *
305
- * @example
306
- * // Represent 11 February 2014 in middle-endian format:
307
- * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
308
- * //=> '02/11/2014'
309
- *
310
- * @example
311
- * // Represent 2 July 2014 in Esperanto:
312
- * import { eoLocale } from 'date-fns/locale/eo'
313
- * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
314
- * locale: eoLocale
315
- * })
316
- * //=> '2-a de julio 2014'
317
- *
318
- * @example
319
- * // Escape string by single quote characters:
320
- * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
321
- * //=> "3 o'clock"
322
- */
323
- function format(date, formatStr, options) {
324
- const defaultOptions$1 = defaultOptions.getDefaultOptions();
325
- const locale = options?.locale ?? defaultOptions$1.locale ?? enUS.enUS;
326
-
327
- const firstWeekContainsDate =
328
- options?.firstWeekContainsDate ??
329
- options?.locale?.options?.firstWeekContainsDate ??
330
- defaultOptions$1.firstWeekContainsDate ??
331
- defaultOptions$1.locale?.options?.firstWeekContainsDate ??
332
- 1;
333
-
334
- const weekStartsOn =
335
- options?.weekStartsOn ??
336
- options?.locale?.options?.weekStartsOn ??
337
- defaultOptions$1.weekStartsOn ??
338
- defaultOptions$1.locale?.options?.weekStartsOn ??
339
- 0;
340
-
341
- const originalDate = toDate.toDate(date, options?.in);
342
-
343
- if (!isValid.isValid(originalDate)) {
344
- throw new RangeError("Invalid time value");
345
- }
346
-
347
- let parts = formatStr
348
- .match(longFormattingTokensRegExp)
349
- .map((substring) => {
350
- const firstCharacter = substring[0];
351
- if (firstCharacter === "p" || firstCharacter === "P") {
352
- const longFormatter = longFormatters.longFormatters[firstCharacter];
353
- return longFormatter(substring, locale.formatLong);
354
- }
355
- return substring;
356
- })
357
- .join("")
358
- .match(formattingTokensRegExp)
359
- .map((substring) => {
360
- // Replace two single quote characters with one single quote character
361
- if (substring === "''") {
362
- return { isToken: false, value: "'" };
363
- }
364
-
365
- const firstCharacter = substring[0];
366
- if (firstCharacter === "'") {
367
- return { isToken: false, value: cleanEscapedString(substring) };
368
- }
369
-
370
- if (formatters.formatters[firstCharacter]) {
371
- return { isToken: true, value: substring };
372
- }
373
-
374
- if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
375
- throw new RangeError(
376
- "Format string contains an unescaped latin alphabet character `" +
377
- firstCharacter +
378
- "`",
379
- );
380
- }
381
-
382
- return { isToken: false, value: substring };
383
- });
384
-
385
- // invoke localize preprocessor (only for french locales at the moment)
386
- if (locale.localize.preprocessor) {
387
- parts = locale.localize.preprocessor(originalDate, parts);
388
- }
389
-
390
- const formatterOptions = {
391
- firstWeekContainsDate,
392
- weekStartsOn,
393
- locale,
394
- };
395
-
396
- return parts
397
- .map((part) => {
398
- if (!part.isToken) return part.value;
399
-
400
- const token = part.value;
401
-
402
- if (
403
- (!options?.useAdditionalWeekYearTokens &&
404
- protectedTokens.isProtectedWeekYearToken(token)) ||
405
- (!options?.useAdditionalDayOfYearTokens &&
406
- protectedTokens.isProtectedDayOfYearToken(token))
407
- ) {
408
- protectedTokens.warnOrThrowProtectedError(token, formatStr, String(date));
409
- }
410
-
411
- const formatter = formatters.formatters[token[0]];
412
- return formatter(originalDate, token, locale.localize, formatterOptions);
413
- })
414
- .join("");
415
- }
416
-
417
- function cleanEscapedString(input) {
418
- const matched = input.match(escapedStringRegExp);
419
-
420
- if (!matched) {
421
- return input;
422
- }
423
-
424
- return matched[1].replace(doubleQuoteRegExp, "'");
425
- }
426
-
427
- exports.formatters = formatters.formatters;
428
- exports.longFormatters = longFormatters.longFormatters;
429
- exports.default = format;
430
- exports.format = format;
431
- exports.formatDate = format;
@@ -1,39 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var differenceInCalendarDays = require('./differenceInCalendarDays.js');
6
- var startOfYear = require('./startOfYear.js');
7
- var toDate = require('./toDate.js');
8
-
9
- /**
10
- * The {@link getDayOfYear} function options.
11
- */
12
-
13
- /**
14
- * @name getDayOfYear
15
- * @category Day Helpers
16
- * @summary Get the day of the year of the given date.
17
- *
18
- * @description
19
- * Get the day of the year of the given date.
20
- *
21
- * @param date - The given date
22
- * @param options - The options
23
- *
24
- * @returns The day of year
25
- *
26
- * @example
27
- * // Which day of the year is 2 July 2014?
28
- * const result = getDayOfYear(new Date(2014, 6, 2))
29
- * //=> 183
30
- */
31
- function getDayOfYear(date, options) {
32
- const _date = toDate.toDate(date, options?.in);
33
- const diff = differenceInCalendarDays.differenceInCalendarDays(_date, startOfYear.startOfYear(_date));
34
- const dayOfYear = diff + 1;
35
- return dayOfYear;
36
- }
37
-
38
- exports.default = getDayOfYear;
39
- exports.getDayOfYear = getDayOfYear;
@@ -1,45 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var constants = require('./constants.js');
6
- var startOfISOWeek = require('./startOfISOWeek.js');
7
- var startOfISOWeekYear = require('./startOfISOWeekYear.js');
8
- var toDate = require('./toDate.js');
9
-
10
- /**
11
- * The {@link getISOWeek} function options.
12
- */
13
-
14
- /**
15
- * @name getISOWeek
16
- * @category ISO Week Helpers
17
- * @summary Get the ISO week of the given date.
18
- *
19
- * @description
20
- * Get the ISO week of the given date.
21
- *
22
- * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
23
- *
24
- * @param date - The given date
25
- * @param options - The options
26
- *
27
- * @returns The ISO week
28
- *
29
- * @example
30
- * // Which week of the ISO-week numbering year is 2 January 2005?
31
- * const result = getISOWeek(new Date(2005, 0, 2))
32
- * //=> 53
33
- */
34
- function getISOWeek(date, options) {
35
- const _date = toDate.toDate(date, options?.in);
36
- const diff = +startOfISOWeek.startOfISOWeek(_date) - +startOfISOWeekYear.startOfISOWeekYear(_date);
37
-
38
- // Round the number of weeks to the nearest integer because the number of
39
- // milliseconds in a week is not constant (e.g. it's different in the week of
40
- // the daylight saving time clock shift).
41
- return Math.round(diff / constants.millisecondsInWeek) + 1;
42
- }
43
-
44
- exports.default = getISOWeek;
45
- exports.getISOWeek = getISOWeek;
@@ -1,57 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var constructFrom = require('./constructFrom.js');
6
- var startOfISOWeek = require('./startOfISOWeek.js');
7
- var toDate = require('./toDate.js');
8
-
9
- /**
10
- * The {@link getISOWeekYear} function options.
11
- */
12
-
13
- /**
14
- * @name getISOWeekYear
15
- * @category ISO Week-Numbering Year Helpers
16
- * @summary Get the ISO week-numbering year of the given date.
17
- *
18
- * @description
19
- * Get the ISO week-numbering year of the given date,
20
- * which always starts 3 days before the year's first Thursday.
21
- *
22
- * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
23
- *
24
- * @param date - The given date
25
- *
26
- * @returns The ISO week-numbering year
27
- *
28
- * @example
29
- * // Which ISO-week numbering year is 2 January 2005?
30
- * const result = getISOWeekYear(new Date(2005, 0, 2))
31
- * //=> 2004
32
- */
33
- function getISOWeekYear(date, options) {
34
- const _date = toDate.toDate(date, options?.in);
35
- const year = _date.getFullYear();
36
-
37
- const fourthOfJanuaryOfNextYear = constructFrom.constructFrom(_date, 0);
38
- fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
39
- fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
40
- const startOfNextYear = startOfISOWeek.startOfISOWeek(fourthOfJanuaryOfNextYear);
41
-
42
- const fourthOfJanuaryOfThisYear = constructFrom.constructFrom(_date, 0);
43
- fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
44
- fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
45
- const startOfThisYear = startOfISOWeek.startOfISOWeek(fourthOfJanuaryOfThisYear);
46
-
47
- if (_date.getTime() >= startOfNextYear.getTime()) {
48
- return year + 1;
49
- } else if (_date.getTime() >= startOfThisYear.getTime()) {
50
- return year;
51
- } else {
52
- return year - 1;
53
- }
54
- }
55
-
56
- exports.default = getISOWeekYear;
57
- exports.getISOWeekYear = getISOWeekYear;
@@ -1,59 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var constants = require('./constants.js');
6
- var startOfWeek = require('./startOfWeek.js');
7
- var startOfWeekYear = require('./startOfWeekYear.js');
8
- var toDate = require('./toDate.js');
9
-
10
- /**
11
- * The {@link getWeek} function options.
12
- */
13
-
14
- /**
15
- * @name getWeek
16
- * @category Week Helpers
17
- * @summary Get the local week index of the given date.
18
- *
19
- * @description
20
- * Get the local week index of the given date.
21
- * The exact calculation depends on the values of
22
- * `options.weekStartsOn` (which is the index of the first day of the week)
23
- * and `options.firstWeekContainsDate` (which is the day of January, which is always in
24
- * the first week of the week-numbering year)
25
- *
26
- * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
27
- *
28
- * @param date - The given date
29
- * @param options - An object with options
30
- *
31
- * @returns The week
32
- *
33
- * @example
34
- * // Which week of the local week numbering year is 2 January 2005 with default options?
35
- * const result = getWeek(new Date(2005, 0, 2))
36
- * //=> 2
37
- *
38
- * @example
39
- * // Which week of the local week numbering year is 2 January 2005,
40
- * // if Monday is the first day of the week,
41
- * // and the first week of the year always contains 4 January?
42
- * const result = getWeek(new Date(2005, 0, 2), {
43
- * weekStartsOn: 1,
44
- * firstWeekContainsDate: 4
45
- * })
46
- * //=> 53
47
- */
48
- function getWeek(date, options) {
49
- const _date = toDate.toDate(date, options?.in);
50
- const diff = +startOfWeek.startOfWeek(_date, options) - +startOfWeekYear.startOfWeekYear(_date, options);
51
-
52
- // Round the number of weeks to the nearest integer because the number of
53
- // milliseconds in a week is not constant (e.g. it's different in the week of
54
- // the daylight saving time clock shift).
55
- return Math.round(diff / constants.millisecondsInWeek) + 1;
56
- }
57
-
58
- exports.default = getWeek;
59
- exports.getWeek = getWeek;