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

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 (450) hide show
  1. package/css/_lexical.css +61 -0
  2. package/dist/cjs/node_modules/date-fns/_lib/addLeadingZeros.js +9 -0
  3. package/dist/cjs/node_modules/date-fns/_lib/defaultOptions.js +9 -0
  4. package/dist/cjs/node_modules/date-fns/_lib/format/formatters.js +779 -0
  5. package/dist/cjs/node_modules/date-fns/_lib/format/lightFormatters.js +96 -0
  6. package/dist/cjs/node_modules/date-fns/_lib/format/longFormatters.js +68 -0
  7. package/dist/cjs/node_modules/date-fns/_lib/getRoundingMethod.js +12 -0
  8. package/dist/cjs/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +33 -0
  9. package/dist/cjs/node_modules/date-fns/_lib/normalizeDates.js +13 -0
  10. package/dist/cjs/node_modules/date-fns/_lib/normalizeInterval.js +10 -0
  11. package/dist/cjs/node_modules/date-fns/_lib/protectedTokens.js +29 -0
  12. package/dist/cjs/node_modules/date-fns/add.js +73 -0
  13. package/dist/cjs/node_modules/date-fns/addDays.js +46 -0
  14. package/dist/cjs/node_modules/date-fns/addHours.js +39 -0
  15. package/dist/cjs/node_modules/date-fns/addMilliseconds.js +39 -0
  16. package/dist/cjs/node_modules/date-fns/addMinutes.js +41 -0
  17. package/dist/cjs/node_modules/date-fns/addMonths.js +80 -0
  18. package/dist/cjs/node_modules/date-fns/addQuarters.js +38 -0
  19. package/dist/cjs/node_modules/date-fns/addWeeks.js +38 -0
  20. package/dist/cjs/node_modules/date-fns/addYears.js +38 -0
  21. package/dist/cjs/node_modules/date-fns/compareAsc.js +50 -0
  22. package/dist/cjs/node_modules/date-fns/constants.js +66 -0
  23. package/dist/cjs/node_modules/date-fns/constructFrom.js +54 -0
  24. package/dist/cjs/node_modules/date-fns/differenceInCalendarDays.js +67 -0
  25. package/dist/cjs/node_modules/date-fns/differenceInCalendarMonths.js +47 -0
  26. package/dist/cjs/node_modules/date-fns/differenceInCalendarYears.js +43 -0
  27. package/dist/cjs/node_modules/date-fns/differenceInDays.js +112 -0
  28. package/dist/cjs/node_modules/date-fns/differenceInHours.js +46 -0
  29. package/dist/cjs/node_modules/date-fns/differenceInMilliseconds.js +34 -0
  30. package/dist/cjs/node_modules/date-fns/differenceInMinutes.js +50 -0
  31. package/dist/cjs/node_modules/date-fns/differenceInMonths.js +65 -0
  32. package/dist/cjs/node_modules/date-fns/differenceInSeconds.js +41 -0
  33. package/dist/cjs/node_modules/date-fns/differenceInYears.js +67 -0
  34. package/dist/cjs/node_modules/date-fns/endOfDay.js +40 -0
  35. package/dist/cjs/node_modules/date-fns/endOfDecade.js +45 -0
  36. package/dist/cjs/node_modules/date-fns/endOfHour.js +40 -0
  37. package/dist/cjs/node_modules/date-fns/endOfMinute.js +40 -0
  38. package/dist/cjs/node_modules/date-fns/endOfMonth.js +42 -0
  39. package/dist/cjs/node_modules/date-fns/endOfQuarter.js +43 -0
  40. package/dist/cjs/node_modules/date-fns/endOfWeek.js +58 -0
  41. package/dist/cjs/node_modules/date-fns/endOfYear.js +42 -0
  42. package/dist/cjs/node_modules/date-fns/format.js +431 -0
  43. package/dist/cjs/node_modules/date-fns/getDayOfYear.js +39 -0
  44. package/dist/cjs/node_modules/date-fns/getISOWeek.js +45 -0
  45. package/dist/cjs/node_modules/date-fns/getISOWeekYear.js +57 -0
  46. package/dist/cjs/node_modules/date-fns/getWeek.js +59 -0
  47. package/dist/cjs/node_modules/date-fns/getWeekYear.js +80 -0
  48. package/dist/cjs/node_modules/date-fns/intervalToDuration.js +70 -0
  49. package/dist/cjs/node_modules/date-fns/isAfter.js +30 -0
  50. package/dist/cjs/node_modules/date-fns/isBefore.js +30 -0
  51. package/dist/cjs/node_modules/date-fns/isDate.js +46 -0
  52. package/dist/cjs/node_modules/date-fns/isLastDayOfMonth.js +33 -0
  53. package/dist/cjs/node_modules/date-fns/isSameMonth.js +48 -0
  54. package/dist/cjs/node_modules/date-fns/isSameWeek.js +56 -0
  55. package/dist/cjs/node_modules/date-fns/isSameYear.js +40 -0
  56. package/dist/cjs/node_modules/date-fns/isValid.js +44 -0
  57. package/dist/cjs/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +12 -0
  58. package/dist/cjs/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +66 -0
  59. package/dist/cjs/node_modules/date-fns/locale/_lib/buildMatchFn.js +61 -0
  60. package/dist/cjs/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +24 -0
  61. package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/formatDistance.js +139 -0
  62. package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/formatLong.js +43 -0
  63. package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/formatRelative.js +15 -0
  64. package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/localize.js +166 -0
  65. package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/match.js +146 -0
  66. package/dist/cjs/node_modules/date-fns/locale/ar-SA.js +32 -0
  67. package/dist/cjs/node_modules/date-fns/locale/de/_lib/formatDistance.js +200 -0
  68. package/dist/cjs/node_modules/date-fns/locale/de/_lib/formatLong.js +44 -0
  69. package/dist/cjs/node_modules/date-fns/locale/de/_lib/formatRelative.js +15 -0
  70. package/dist/cjs/node_modules/date-fns/locale/de/_lib/localize.js +195 -0
  71. package/dist/cjs/node_modules/date-fns/locale/de/_lib/match.js +138 -0
  72. package/dist/cjs/node_modules/date-fns/locale/de.js +36 -0
  73. package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +105 -0
  74. package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/formatLong.js +43 -0
  75. package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +15 -0
  76. package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/localize.js +191 -0
  77. package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/match.js +136 -0
  78. package/dist/cjs/node_modules/date-fns/locale/en-US.js +33 -0
  79. package/dist/cjs/node_modules/date-fns/locale/es/_lib/formatDistance.js +105 -0
  80. package/dist/cjs/node_modules/date-fns/locale/es/_lib/formatLong.js +43 -0
  81. package/dist/cjs/node_modules/date-fns/locale/es/_lib/formatRelative.js +29 -0
  82. package/dist/cjs/node_modules/date-fns/locale/es/_lib/localize.js +168 -0
  83. package/dist/cjs/node_modules/date-fns/locale/es/_lib/match.js +142 -0
  84. package/dist/cjs/node_modules/date-fns/locale/es.js +36 -0
  85. package/dist/cjs/node_modules/date-fns/locale/fr/_lib/formatDistance.js +104 -0
  86. package/dist/cjs/node_modules/date-fns/locale/fr/_lib/formatLong.js +43 -0
  87. package/dist/cjs/node_modules/date-fns/locale/fr/_lib/formatRelative.js +15 -0
  88. package/dist/cjs/node_modules/date-fns/locale/fr/_lib/localize.js +169 -0
  89. package/dist/cjs/node_modules/date-fns/locale/fr/_lib/match.js +137 -0
  90. package/dist/cjs/node_modules/date-fns/locale/fr.js +33 -0
  91. package/dist/cjs/node_modules/date-fns/locale/hi/_lib/formatDistance.js +109 -0
  92. package/dist/cjs/node_modules/date-fns/locale/hi/_lib/formatLong.js +43 -0
  93. package/dist/cjs/node_modules/date-fns/locale/hi/_lib/formatRelative.js +15 -0
  94. package/dist/cjs/node_modules/date-fns/locale/hi/_lib/localize.js +233 -0
  95. package/dist/cjs/node_modules/date-fns/locale/hi/_lib/match.js +141 -0
  96. package/dist/cjs/node_modules/date-fns/locale/hi.js +32 -0
  97. package/dist/cjs/node_modules/date-fns/locale/it/_lib/formatDistance.js +105 -0
  98. package/dist/cjs/node_modules/date-fns/locale/it/_lib/formatLong.js +43 -0
  99. package/dist/cjs/node_modules/date-fns/locale/it/_lib/formatRelative.js +70 -0
  100. package/dist/cjs/node_modules/date-fns/locale/it/_lib/localize.js +168 -0
  101. package/dist/cjs/node_modules/date-fns/locale/it/_lib/match.js +137 -0
  102. package/dist/cjs/node_modules/date-fns/locale/it.js +34 -0
  103. package/dist/cjs/node_modules/date-fns/locale/ja/_lib/formatDistance.js +119 -0
  104. package/dist/cjs/node_modules/date-fns/locale/ja/_lib/formatLong.js +43 -0
  105. package/dist/cjs/node_modules/date-fns/locale/ja/_lib/formatRelative.js +16 -0
  106. package/dist/cjs/node_modules/date-fns/locale/ja/_lib/localize.js +181 -0
  107. package/dist/cjs/node_modules/date-fns/locale/ja/_lib/match.js +122 -0
  108. package/dist/cjs/node_modules/date-fns/locale/ja.js +36 -0
  109. package/dist/cjs/node_modules/date-fns/locale/ko/_lib/formatDistance.js +105 -0
  110. package/dist/cjs/node_modules/date-fns/locale/ko/_lib/formatLong.js +43 -0
  111. package/dist/cjs/node_modules/date-fns/locale/ko/_lib/formatRelative.js +15 -0
  112. package/dist/cjs/node_modules/date-fns/locale/ko/_lib/localize.js +171 -0
  113. package/dist/cjs/node_modules/date-fns/locale/ko/_lib/match.js +119 -0
  114. package/dist/cjs/node_modules/date-fns/locale/ko.js +34 -0
  115. package/dist/cjs/node_modules/date-fns/locale/pt/_lib/formatDistance.js +105 -0
  116. package/dist/cjs/node_modules/date-fns/locale/pt/_lib/formatLong.js +43 -0
  117. package/dist/cjs/node_modules/date-fns/locale/pt/_lib/formatRelative.js +26 -0
  118. package/dist/cjs/node_modules/date-fns/locale/pt/_lib/localize.js +168 -0
  119. package/dist/cjs/node_modules/date-fns/locale/pt/_lib/match.js +141 -0
  120. package/dist/cjs/node_modules/date-fns/locale/pt.js +33 -0
  121. package/dist/cjs/node_modules/date-fns/locale/ru/_lib/formatDistance.js +250 -0
  122. package/dist/cjs/node_modules/date-fns/locale/ru/_lib/formatLong.js +40 -0
  123. package/dist/cjs/node_modules/date-fns/locale/ru/_lib/formatRelative.js +92 -0
  124. package/dist/cjs/node_modules/date-fns/locale/ru/_lib/localize.js +214 -0
  125. package/dist/cjs/node_modules/date-fns/locale/ru/_lib/match.js +142 -0
  126. package/dist/cjs/node_modules/date-fns/locale/ru.js +33 -0
  127. package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/formatDistance.js +105 -0
  128. package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/formatLong.js +43 -0
  129. package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/formatRelative.js +35 -0
  130. package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/localize.js +187 -0
  131. package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/match.js +134 -0
  132. package/dist/cjs/node_modules/date-fns/locale/zh-CN.js +36 -0
  133. package/dist/cjs/node_modules/date-fns/startOfDay.js +40 -0
  134. package/dist/cjs/node_modules/date-fns/startOfDecade.js +45 -0
  135. package/dist/cjs/node_modules/date-fns/startOfHour.js +40 -0
  136. package/dist/cjs/node_modules/date-fns/startOfISOWeek.js +40 -0
  137. package/dist/cjs/node_modules/date-fns/startOfISOWeekYear.js +47 -0
  138. package/dist/cjs/node_modules/date-fns/startOfMinute.js +40 -0
  139. package/dist/cjs/node_modules/date-fns/startOfMonth.js +42 -0
  140. package/dist/cjs/node_modules/date-fns/startOfQuarter.js +43 -0
  141. package/dist/cjs/node_modules/date-fns/startOfWeek.js +58 -0
  142. package/dist/cjs/node_modules/date-fns/startOfWeekYear.js +69 -0
  143. package/dist/cjs/node_modules/date-fns/startOfYear.js +41 -0
  144. package/dist/cjs/node_modules/date-fns/toDate.js +51 -0
  145. package/dist/cjs/packages/date/dist/esm/display/DateDuration.js +178 -0
  146. package/dist/cjs/packages/date/dist/esm/hijri/DateConverter.js +154 -0
  147. package/dist/cjs/packages/date/dist/esm/hijri/FormatDate.js +116 -0
  148. package/dist/cjs/packages/date/dist/esm/hijri/HijriDate.js +531 -0
  149. package/dist/cjs/packages/date/dist/esm/hijri/StringDateParser.js +74 -0
  150. package/dist/cjs/packages/date/dist/esm/hijri/index.js +21 -0
  151. package/dist/cjs/packages/date/dist/esm/hijri/initializer.js +113 -0
  152. package/dist/cjs/packages/date/dist/esm/hijri/locales.js +19 -0
  153. package/dist/cjs/packages/date/dist/esm/hijri/safe.js +17 -0
  154. package/dist/cjs/packages/date/dist/esm/i18n/ar/date.json.js +213 -0
  155. package/dist/cjs/packages/date/dist/esm/i18n/en/date.json.js +83 -0
  156. package/{src/plugins/StickyPlugin.ts → dist/cjs/packages/date/dist/esm/i18n/index.js} +10 -15
  157. package/dist/cjs/packages/date/dist/esm/types/index.js +46 -0
  158. package/dist/cjs/packages/date/dist/esm/utils/dateUtil.js +472 -0
  159. package/dist/cjs/packages/lexical/src/editor/LexicalEditor.js +36 -13
  160. package/dist/cjs/packages/lexical/src/hooks/useFormatWatcher.js +101 -95
  161. package/dist/cjs/packages/lexical/src/i18n/ar/lexical.json.js +30 -0
  162. package/dist/cjs/packages/lexical/src/i18n/en/lexical.json.js +30 -0
  163. package/dist/cjs/packages/lexical/src/i18n/index.js +33 -0
  164. package/dist/cjs/packages/lexical/src/index.js +1 -0
  165. package/dist/cjs/packages/lexical/src/plugins/CommentPlugin.js +477 -0
  166. package/dist/cjs/packages/lexical/src/plugins/DraggableBlockPlugin.js +13 -16
  167. package/dist/cjs/packages/lexical/src/plugins/ToolbarPlugin.js +35 -22
  168. package/dist/esm/node_modules/date-fns/_lib/addLeadingZeros.js +9 -0
  169. package/dist/esm/node_modules/date-fns/_lib/defaultOptions.js +9 -0
  170. package/dist/esm/node_modules/date-fns/_lib/format/formatters.js +779 -0
  171. package/dist/esm/node_modules/date-fns/_lib/format/lightFormatters.js +96 -0
  172. package/dist/esm/node_modules/date-fns/_lib/format/longFormatters.js +68 -0
  173. package/dist/esm/node_modules/date-fns/_lib/getRoundingMethod.js +12 -0
  174. package/dist/esm/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +33 -0
  175. package/dist/esm/node_modules/date-fns/_lib/normalizeDates.js +13 -0
  176. package/dist/esm/node_modules/date-fns/_lib/normalizeInterval.js +10 -0
  177. package/dist/esm/node_modules/date-fns/_lib/protectedTokens.js +27 -0
  178. package/dist/esm/node_modules/date-fns/add.js +70 -0
  179. package/dist/esm/node_modules/date-fns/addDays.js +43 -0
  180. package/dist/esm/node_modules/date-fns/addHours.js +36 -0
  181. package/dist/esm/node_modules/date-fns/addMilliseconds.js +36 -0
  182. package/dist/esm/node_modules/date-fns/addMinutes.js +38 -0
  183. package/dist/esm/node_modules/date-fns/addMonths.js +77 -0
  184. package/dist/esm/node_modules/date-fns/addQuarters.js +35 -0
  185. package/dist/esm/node_modules/date-fns/addWeeks.js +35 -0
  186. package/dist/esm/node_modules/date-fns/addYears.js +35 -0
  187. package/dist/esm/node_modules/date-fns/compareAsc.js +47 -0
  188. package/dist/esm/node_modules/date-fns/constants.js +62 -0
  189. package/dist/esm/node_modules/date-fns/constructFrom.js +51 -0
  190. package/dist/esm/node_modules/date-fns/differenceInCalendarDays.js +64 -0
  191. package/dist/esm/node_modules/date-fns/differenceInCalendarMonths.js +44 -0
  192. package/dist/esm/node_modules/date-fns/differenceInCalendarYears.js +40 -0
  193. package/dist/esm/node_modules/date-fns/differenceInDays.js +109 -0
  194. package/dist/esm/node_modules/date-fns/differenceInHours.js +43 -0
  195. package/dist/esm/node_modules/date-fns/differenceInMilliseconds.js +31 -0
  196. package/dist/esm/node_modules/date-fns/differenceInMinutes.js +47 -0
  197. package/dist/esm/node_modules/date-fns/differenceInMonths.js +62 -0
  198. package/dist/esm/node_modules/date-fns/differenceInSeconds.js +38 -0
  199. package/dist/esm/node_modules/date-fns/differenceInYears.js +64 -0
  200. package/dist/esm/node_modules/date-fns/endOfDay.js +37 -0
  201. package/dist/esm/node_modules/date-fns/endOfDecade.js +42 -0
  202. package/dist/esm/node_modules/date-fns/endOfHour.js +37 -0
  203. package/dist/esm/node_modules/date-fns/endOfMinute.js +37 -0
  204. package/dist/esm/node_modules/date-fns/endOfMonth.js +39 -0
  205. package/dist/esm/node_modules/date-fns/endOfQuarter.js +40 -0
  206. package/dist/esm/node_modules/date-fns/endOfWeek.js +55 -0
  207. package/dist/esm/node_modules/date-fns/endOfYear.js +39 -0
  208. package/dist/esm/node_modules/date-fns/format.js +425 -0
  209. package/dist/esm/node_modules/date-fns/getDayOfYear.js +36 -0
  210. package/dist/esm/node_modules/date-fns/getISOWeek.js +42 -0
  211. package/dist/esm/node_modules/date-fns/getISOWeekYear.js +54 -0
  212. package/dist/esm/node_modules/date-fns/getWeek.js +56 -0
  213. package/dist/esm/node_modules/date-fns/getWeekYear.js +77 -0
  214. package/dist/esm/node_modules/date-fns/intervalToDuration.js +67 -0
  215. package/dist/esm/node_modules/date-fns/isAfter.js +27 -0
  216. package/dist/esm/node_modules/date-fns/isBefore.js +27 -0
  217. package/dist/esm/node_modules/date-fns/isDate.js +43 -0
  218. package/dist/esm/node_modules/date-fns/isLastDayOfMonth.js +30 -0
  219. package/dist/esm/node_modules/date-fns/isSameMonth.js +45 -0
  220. package/dist/esm/node_modules/date-fns/isSameWeek.js +53 -0
  221. package/dist/esm/node_modules/date-fns/isSameYear.js +37 -0
  222. package/dist/esm/node_modules/date-fns/isValid.js +41 -0
  223. package/dist/esm/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +12 -0
  224. package/dist/esm/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +66 -0
  225. package/dist/esm/node_modules/date-fns/locale/_lib/buildMatchFn.js +61 -0
  226. package/dist/esm/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +24 -0
  227. package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/formatDistance.js +139 -0
  228. package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/formatLong.js +43 -0
  229. package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/formatRelative.js +15 -0
  230. package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/localize.js +166 -0
  231. package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/match.js +146 -0
  232. package/dist/esm/node_modules/date-fns/locale/ar-SA.js +29 -0
  233. package/dist/esm/node_modules/date-fns/locale/de/_lib/formatDistance.js +200 -0
  234. package/dist/esm/node_modules/date-fns/locale/de/_lib/formatLong.js +44 -0
  235. package/dist/esm/node_modules/date-fns/locale/de/_lib/formatRelative.js +15 -0
  236. package/dist/esm/node_modules/date-fns/locale/de/_lib/localize.js +195 -0
  237. package/dist/esm/node_modules/date-fns/locale/de/_lib/match.js +138 -0
  238. package/dist/esm/node_modules/date-fns/locale/de.js +33 -0
  239. package/dist/esm/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +105 -0
  240. package/dist/esm/node_modules/date-fns/locale/en-US/_lib/formatLong.js +43 -0
  241. package/dist/esm/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +15 -0
  242. package/dist/esm/node_modules/date-fns/locale/en-US/_lib/localize.js +191 -0
  243. package/dist/esm/node_modules/date-fns/locale/en-US/_lib/match.js +136 -0
  244. package/dist/esm/node_modules/date-fns/locale/en-US.js +30 -0
  245. package/dist/esm/node_modules/date-fns/locale/es/_lib/formatDistance.js +105 -0
  246. package/dist/esm/node_modules/date-fns/locale/es/_lib/formatLong.js +43 -0
  247. package/dist/esm/node_modules/date-fns/locale/es/_lib/formatRelative.js +29 -0
  248. package/dist/esm/node_modules/date-fns/locale/es/_lib/localize.js +168 -0
  249. package/dist/esm/node_modules/date-fns/locale/es/_lib/match.js +142 -0
  250. package/dist/esm/node_modules/date-fns/locale/es.js +33 -0
  251. package/dist/esm/node_modules/date-fns/locale/fr/_lib/formatDistance.js +104 -0
  252. package/dist/esm/node_modules/date-fns/locale/fr/_lib/formatLong.js +43 -0
  253. package/dist/esm/node_modules/date-fns/locale/fr/_lib/formatRelative.js +15 -0
  254. package/dist/esm/node_modules/date-fns/locale/fr/_lib/localize.js +169 -0
  255. package/dist/esm/node_modules/date-fns/locale/fr/_lib/match.js +137 -0
  256. package/dist/esm/node_modules/date-fns/locale/fr.js +30 -0
  257. package/dist/esm/node_modules/date-fns/locale/hi/_lib/formatDistance.js +109 -0
  258. package/dist/esm/node_modules/date-fns/locale/hi/_lib/formatLong.js +43 -0
  259. package/dist/esm/node_modules/date-fns/locale/hi/_lib/formatRelative.js +15 -0
  260. package/dist/esm/node_modules/date-fns/locale/hi/_lib/localize.js +231 -0
  261. package/dist/esm/node_modules/date-fns/locale/hi/_lib/match.js +141 -0
  262. package/dist/esm/node_modules/date-fns/locale/hi.js +29 -0
  263. package/dist/esm/node_modules/date-fns/locale/it/_lib/formatDistance.js +105 -0
  264. package/dist/esm/node_modules/date-fns/locale/it/_lib/formatLong.js +43 -0
  265. package/dist/esm/node_modules/date-fns/locale/it/_lib/formatRelative.js +70 -0
  266. package/dist/esm/node_modules/date-fns/locale/it/_lib/localize.js +168 -0
  267. package/dist/esm/node_modules/date-fns/locale/it/_lib/match.js +137 -0
  268. package/dist/esm/node_modules/date-fns/locale/it.js +31 -0
  269. package/dist/esm/node_modules/date-fns/locale/ja/_lib/formatDistance.js +119 -0
  270. package/dist/esm/node_modules/date-fns/locale/ja/_lib/formatLong.js +43 -0
  271. package/dist/esm/node_modules/date-fns/locale/ja/_lib/formatRelative.js +16 -0
  272. package/dist/esm/node_modules/date-fns/locale/ja/_lib/localize.js +181 -0
  273. package/dist/esm/node_modules/date-fns/locale/ja/_lib/match.js +122 -0
  274. package/dist/esm/node_modules/date-fns/locale/ja.js +33 -0
  275. package/dist/esm/node_modules/date-fns/locale/ko/_lib/formatDistance.js +105 -0
  276. package/dist/esm/node_modules/date-fns/locale/ko/_lib/formatLong.js +43 -0
  277. package/dist/esm/node_modules/date-fns/locale/ko/_lib/formatRelative.js +15 -0
  278. package/dist/esm/node_modules/date-fns/locale/ko/_lib/localize.js +171 -0
  279. package/dist/esm/node_modules/date-fns/locale/ko/_lib/match.js +119 -0
  280. package/dist/esm/node_modules/date-fns/locale/ko.js +31 -0
  281. package/dist/esm/node_modules/date-fns/locale/pt/_lib/formatDistance.js +105 -0
  282. package/dist/esm/node_modules/date-fns/locale/pt/_lib/formatLong.js +43 -0
  283. package/dist/esm/node_modules/date-fns/locale/pt/_lib/formatRelative.js +26 -0
  284. package/dist/esm/node_modules/date-fns/locale/pt/_lib/localize.js +168 -0
  285. package/dist/esm/node_modules/date-fns/locale/pt/_lib/match.js +141 -0
  286. package/dist/esm/node_modules/date-fns/locale/pt.js +30 -0
  287. package/dist/esm/node_modules/date-fns/locale/ru/_lib/formatDistance.js +250 -0
  288. package/dist/esm/node_modules/date-fns/locale/ru/_lib/formatLong.js +40 -0
  289. package/dist/esm/node_modules/date-fns/locale/ru/_lib/formatRelative.js +92 -0
  290. package/dist/esm/node_modules/date-fns/locale/ru/_lib/localize.js +214 -0
  291. package/dist/esm/node_modules/date-fns/locale/ru/_lib/match.js +142 -0
  292. package/dist/esm/node_modules/date-fns/locale/ru.js +30 -0
  293. package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/formatDistance.js +105 -0
  294. package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/formatLong.js +43 -0
  295. package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/formatRelative.js +35 -0
  296. package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/localize.js +187 -0
  297. package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/match.js +134 -0
  298. package/dist/esm/node_modules/date-fns/locale/zh-CN.js +33 -0
  299. package/dist/esm/node_modules/date-fns/startOfDay.js +37 -0
  300. package/dist/esm/node_modules/date-fns/startOfDecade.js +42 -0
  301. package/dist/esm/node_modules/date-fns/startOfHour.js +37 -0
  302. package/dist/esm/node_modules/date-fns/startOfISOWeek.js +37 -0
  303. package/dist/esm/node_modules/date-fns/startOfISOWeekYear.js +44 -0
  304. package/dist/esm/node_modules/date-fns/startOfMinute.js +37 -0
  305. package/dist/esm/node_modules/date-fns/startOfMonth.js +39 -0
  306. package/dist/esm/node_modules/date-fns/startOfQuarter.js +40 -0
  307. package/dist/esm/node_modules/date-fns/startOfWeek.js +55 -0
  308. package/dist/esm/node_modules/date-fns/startOfWeekYear.js +66 -0
  309. package/dist/esm/node_modules/date-fns/startOfYear.js +38 -0
  310. package/dist/esm/node_modules/date-fns/toDate.js +48 -0
  311. package/dist/esm/packages/date/dist/esm/display/DateDuration.js +178 -0
  312. package/dist/esm/packages/date/dist/esm/hijri/DateConverter.js +152 -0
  313. package/dist/esm/packages/date/dist/esm/hijri/FormatDate.js +113 -0
  314. package/dist/esm/packages/date/dist/esm/hijri/HijriDate.js +528 -0
  315. package/dist/esm/packages/date/dist/esm/hijri/StringDateParser.js +74 -0
  316. package/dist/esm/packages/date/dist/esm/hijri/index.js +21 -0
  317. package/dist/esm/packages/date/dist/esm/hijri/initializer.js +113 -0
  318. package/dist/esm/packages/date/dist/esm/hijri/locales.js +18 -0
  319. package/dist/esm/packages/date/dist/esm/hijri/safe.js +14 -0
  320. package/dist/esm/packages/date/dist/esm/i18n/ar/date.json.js +209 -0
  321. package/dist/esm/packages/date/dist/esm/i18n/en/date.json.js +79 -0
  322. package/dist/esm/packages/date/dist/esm/i18n/index.js +33 -0
  323. package/dist/esm/packages/date/dist/esm/types/index.js +45 -0
  324. package/dist/esm/packages/date/dist/esm/utils/dateUtil.js +474 -0
  325. package/dist/esm/packages/lexical/src/editor/LexicalEditor.js +37 -14
  326. package/dist/esm/packages/lexical/src/hooks/useFormatWatcher.js +43 -37
  327. package/dist/esm/packages/lexical/src/i18n/ar/lexical.json.js +25 -0
  328. package/dist/esm/packages/lexical/src/i18n/en/lexical.json.js +25 -0
  329. package/dist/esm/packages/lexical/src/i18n/index.js +33 -0
  330. package/dist/esm/packages/lexical/src/index.js +1 -0
  331. package/dist/esm/packages/lexical/src/plugins/CommentPlugin.js +477 -0
  332. package/dist/esm/packages/lexical/src/plugins/DraggableBlockPlugin.js +11 -14
  333. package/dist/esm/packages/lexical/src/plugins/ToolbarPlugin.js +36 -23
  334. package/dist/types/editor/LexicalEditor.d.ts +12 -3
  335. package/dist/types/hooks/useFormatWatcher.d.ts +2 -1
  336. package/dist/types/i18n/index.d.ts +1 -0
  337. package/dist/types/index.d.ts +1 -0
  338. package/dist/types/plugins/CommentPlugin.d.ts +5 -0
  339. package/dist/types/plugins/DraggableBlockPlugin.d.ts +2 -1
  340. package/package.json +5 -5
  341. package/src/editor/LexicalEditor.tsx +65 -18
  342. package/src/hooks/useFormatWatcher.ts +3 -0
  343. package/src/i18n/ar/lexical.json +18 -0
  344. package/src/i18n/en/lexical.json +18 -0
  345. package/src/i18n/index.ts +28 -0
  346. package/src/index.ts +2 -0
  347. package/src/plugins/CommentPlugin.tsx +554 -0
  348. package/src/plugins/DraggableBlockPlugin.tsx +5 -10
  349. package/src/plugins/ToolbarPlugin.tsx +34 -23
  350. package/dist/cjs/_virtual/prism.js +0 -5
  351. package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.dev.js +0 -474
  352. package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.js +0 -21
  353. package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +0 -27
  354. package/dist/cjs/node_modules/@lexical/code/LexicalCode.dev.js +0 -1537
  355. package/dist/cjs/node_modules/@lexical/code/LexicalCode.js +0 -25
  356. package/dist/cjs/node_modules/@lexical/code/LexicalCode.prod.js +0 -57
  357. package/dist/cjs/node_modules/@lexical/html/LexicalHtml.dev.js +0 -252
  358. package/dist/cjs/node_modules/@lexical/html/LexicalHtml.js +0 -19
  359. package/dist/cjs/node_modules/@lexical/html/LexicalHtml.prod.js +0 -18
  360. package/dist/cjs/node_modules/@lexical/link/LexicalLink.dev.js +0 -572
  361. package/dist/cjs/node_modules/@lexical/link/LexicalLink.js +0 -17
  362. package/dist/cjs/node_modules/@lexical/link/LexicalLink.prod.js +0 -25
  363. package/dist/cjs/node_modules/@lexical/list/LexicalList.dev.js +0 -1614
  364. package/dist/cjs/node_modules/@lexical/list/LexicalList.js +0 -29
  365. package/dist/cjs/node_modules/@lexical/list/LexicalList.prod.js +0 -36
  366. package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.dev.js +0 -838
  367. package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.js +0 -29
  368. package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.prod.js +0 -26
  369. package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.dev.js +0 -1057
  370. package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.js +0 -39
  371. package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.prod.js +0 -45
  372. package/dist/cjs/node_modules/@lexical/table/LexicalTable.dev.js +0 -4207
  373. package/dist/cjs/node_modules/@lexical/table/LexicalTable.js +0 -23
  374. package/dist/cjs/node_modules/@lexical/table/LexicalTable.prod.js +0 -68
  375. package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.dev.js +0 -1166
  376. package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.js +0 -47
  377. package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.prod.js +0 -81
  378. package/dist/cjs/node_modules/@mdi/js/mdi.js +0 -8
  379. package/dist/cjs/node_modules/prismjs/components/prism-c.js +0 -82
  380. package/dist/cjs/node_modules/prismjs/components/prism-clike.js +0 -33
  381. package/dist/cjs/node_modules/prismjs/components/prism-cpp.js +0 -101
  382. package/dist/cjs/node_modules/prismjs/components/prism-css.js +0 -66
  383. package/dist/cjs/node_modules/prismjs/components/prism-java.js +0 -126
  384. package/dist/cjs/node_modules/prismjs/components/prism-javascript.js +0 -174
  385. package/dist/cjs/node_modules/prismjs/components/prism-markdown.js +0 -417
  386. package/dist/cjs/node_modules/prismjs/components/prism-markup.js +0 -188
  387. package/dist/cjs/node_modules/prismjs/components/prism-objectivec.js +0 -14
  388. package/dist/cjs/node_modules/prismjs/components/prism-powershell.js +0 -60
  389. package/dist/cjs/node_modules/prismjs/components/prism-python.js +0 -67
  390. package/dist/cjs/node_modules/prismjs/components/prism-rust.js +0 -130
  391. package/dist/cjs/node_modules/prismjs/components/prism-sql.js +0 -34
  392. package/dist/cjs/node_modules/prismjs/components/prism-swift.js +0 -150
  393. package/dist/cjs/node_modules/prismjs/components/prism-typescript.js +0 -62
  394. package/dist/cjs/node_modules/prismjs/prism.js +0 -1951
  395. package/dist/cjs/packages/lexical/src/components/StickyComponent.js +0 -221
  396. package/dist/cjs/packages/lexical/src/nodes/StickyNode.js +0 -218
  397. package/dist/cjs/packages/lexical/src/plugins/StickyPlugin.js +0 -20
  398. package/dist/esm/_virtual/prism.js +0 -5
  399. package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.dev.js +0 -465
  400. package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.js +0 -19
  401. package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +0 -18
  402. package/dist/esm/node_modules/@lexical/code/LexicalCode.dev.js +0 -1512
  403. package/dist/esm/node_modules/@lexical/code/LexicalCode.js +0 -21
  404. package/dist/esm/node_modules/@lexical/code/LexicalCode.prod.js +0 -32
  405. package/dist/esm/node_modules/@lexical/html/LexicalHtml.dev.js +0 -251
  406. package/dist/esm/node_modules/@lexical/html/LexicalHtml.js +0 -18
  407. package/dist/esm/node_modules/@lexical/html/LexicalHtml.prod.js +0 -17
  408. package/dist/esm/node_modules/@lexical/link/LexicalLink.dev.js +0 -563
  409. package/dist/esm/node_modules/@lexical/link/LexicalLink.js +0 -17
  410. package/dist/esm/node_modules/@lexical/link/LexicalLink.prod.js +0 -16
  411. package/dist/esm/node_modules/@lexical/list/LexicalList.dev.js +0 -1595
  412. package/dist/esm/node_modules/@lexical/list/LexicalList.js +0 -23
  413. package/dist/esm/node_modules/@lexical/list/LexicalList.prod.js +0 -17
  414. package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.dev.js +0 -830
  415. package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.js +0 -23
  416. package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.prod.js +0 -18
  417. package/dist/esm/node_modules/@lexical/selection/LexicalSelection.dev.js +0 -1028
  418. package/dist/esm/node_modules/@lexical/selection/LexicalSelection.js +0 -28
  419. package/dist/esm/node_modules/@lexical/selection/LexicalSelection.prod.js +0 -16
  420. package/dist/esm/node_modules/@lexical/table/LexicalTable.dev.js +0 -4156
  421. package/dist/esm/node_modules/@lexical/table/LexicalTable.js +0 -20
  422. package/dist/esm/node_modules/@lexical/table/LexicalTable.prod.js +0 -17
  423. package/dist/esm/node_modules/@lexical/utils/LexicalUtils.dev.js +0 -1102
  424. package/dist/esm/node_modules/@lexical/utils/LexicalUtils.js +0 -32
  425. package/dist/esm/node_modules/@lexical/utils/LexicalUtils.prod.js +0 -17
  426. package/dist/esm/node_modules/@mdi/js/mdi.js +0 -7
  427. package/dist/esm/node_modules/prismjs/components/prism-c.js +0 -82
  428. package/dist/esm/node_modules/prismjs/components/prism-clike.js +0 -33
  429. package/dist/esm/node_modules/prismjs/components/prism-cpp.js +0 -101
  430. package/dist/esm/node_modules/prismjs/components/prism-css.js +0 -66
  431. package/dist/esm/node_modules/prismjs/components/prism-java.js +0 -126
  432. package/dist/esm/node_modules/prismjs/components/prism-javascript.js +0 -174
  433. package/dist/esm/node_modules/prismjs/components/prism-markdown.js +0 -417
  434. package/dist/esm/node_modules/prismjs/components/prism-markup.js +0 -188
  435. package/dist/esm/node_modules/prismjs/components/prism-objectivec.js +0 -14
  436. package/dist/esm/node_modules/prismjs/components/prism-powershell.js +0 -60
  437. package/dist/esm/node_modules/prismjs/components/prism-python.js +0 -67
  438. package/dist/esm/node_modules/prismjs/components/prism-rust.js +0 -130
  439. package/dist/esm/node_modules/prismjs/components/prism-sql.js +0 -34
  440. package/dist/esm/node_modules/prismjs/components/prism-swift.js +0 -150
  441. package/dist/esm/node_modules/prismjs/components/prism-typescript.js +0 -62
  442. package/dist/esm/node_modules/prismjs/prism.js +0 -1951
  443. package/dist/esm/packages/lexical/src/components/StickyComponent.js +0 -221
  444. package/dist/esm/packages/lexical/src/nodes/StickyNode.js +0 -216
  445. package/dist/esm/packages/lexical/src/plugins/StickyPlugin.js +0 -20
  446. package/dist/types/components/StickyComponent.d.ts +0 -9
  447. package/dist/types/nodes/StickyNode.d.ts +0 -34
  448. package/dist/types/plugins/StickyPlugin.d.ts +0 -1
  449. package/src/components/StickyComponent.tsx +0 -271
  450. package/src/nodes/StickyNode.tsx +0 -249
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var defaultOptions = require('./_lib/defaultOptions.js');
6
+ var toDate = require('./toDate.js');
7
+
8
+ /**
9
+ * The {@link startOfWeek} function options.
10
+ */
11
+
12
+ /**
13
+ * @name startOfWeek
14
+ * @category Week Helpers
15
+ * @summary Return the start of a week for the given date.
16
+ *
17
+ * @description
18
+ * Return the start of a week for the given date.
19
+ * The result will be in the local timezone.
20
+ *
21
+ * @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).
22
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
23
+ *
24
+ * @param date - The original date
25
+ * @param options - An object with options
26
+ *
27
+ * @returns The start of a week
28
+ *
29
+ * @example
30
+ * // The start of a week for 2 September 2014 11:55:00:
31
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
32
+ * //=> Sun Aug 31 2014 00:00:00
33
+ *
34
+ * @example
35
+ * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
36
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
37
+ * //=> Mon Sep 01 2014 00:00:00
38
+ */
39
+ function startOfWeek(date, options) {
40
+ const defaultOptions$1 = defaultOptions.getDefaultOptions();
41
+ const weekStartsOn =
42
+ options?.weekStartsOn ??
43
+ options?.locale?.options?.weekStartsOn ??
44
+ defaultOptions$1.weekStartsOn ??
45
+ defaultOptions$1.locale?.options?.weekStartsOn ??
46
+ 0;
47
+
48
+ const _date = toDate.toDate(date, options?.in);
49
+ const day = _date.getDay();
50
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
51
+
52
+ _date.setDate(_date.getDate() - diff);
53
+ _date.setHours(0, 0, 0, 0);
54
+ return _date;
55
+ }
56
+
57
+ exports.default = startOfWeek;
58
+ exports.startOfWeek = startOfWeek;
@@ -0,0 +1,69 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var defaultOptions = require('./_lib/defaultOptions.js');
6
+ var constructFrom = require('./constructFrom.js');
7
+ var getWeekYear = require('./getWeekYear.js');
8
+ var startOfWeek = require('./startOfWeek.js');
9
+
10
+ /**
11
+ * The {@link startOfWeekYear} function options.
12
+ */
13
+
14
+ /**
15
+ * @name startOfWeekYear
16
+ * @category Week-Numbering Year Helpers
17
+ * @summary Return the start of a local week-numbering year for the given date.
18
+ *
19
+ * @description
20
+ * Return the start of a local week-numbering year.
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
+ * @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).
29
+ * @typeParam ResultDate - The result `Date` type.
30
+ *
31
+ * @param date - The original date
32
+ * @param options - An object with options
33
+ *
34
+ * @returns The start of a week-numbering year
35
+ *
36
+ * @example
37
+ * // The start of an a week-numbering year for 2 July 2005 with default settings:
38
+ * const result = startOfWeekYear(new Date(2005, 6, 2))
39
+ * //=> Sun Dec 26 2004 00:00:00
40
+ *
41
+ * @example
42
+ * // The start of a week-numbering year for 2 July 2005
43
+ * // if Monday is the first day of week
44
+ * // and 4 January is always in the first week of the year:
45
+ * const result = startOfWeekYear(new Date(2005, 6, 2), {
46
+ * weekStartsOn: 1,
47
+ * firstWeekContainsDate: 4
48
+ * })
49
+ * //=> Mon Jan 03 2005 00:00:00
50
+ */
51
+ function startOfWeekYear(date, options) {
52
+ const defaultOptions$1 = defaultOptions.getDefaultOptions();
53
+ const firstWeekContainsDate =
54
+ options?.firstWeekContainsDate ??
55
+ options?.locale?.options?.firstWeekContainsDate ??
56
+ defaultOptions$1.firstWeekContainsDate ??
57
+ defaultOptions$1.locale?.options?.firstWeekContainsDate ??
58
+ 1;
59
+
60
+ const year = getWeekYear.getWeekYear(date, options);
61
+ const firstWeek = constructFrom.constructFrom(options?.in || date, 0);
62
+ firstWeek.setFullYear(year, 0, firstWeekContainsDate);
63
+ firstWeek.setHours(0, 0, 0, 0);
64
+ const _date = startOfWeek.startOfWeek(firstWeek, options);
65
+ return _date;
66
+ }
67
+
68
+ exports.default = startOfWeekYear;
69
+ exports.startOfWeekYear = startOfWeekYear;
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var toDate = require('./toDate.js');
6
+
7
+ /**
8
+ * The {@link startOfYear} function options.
9
+ */
10
+
11
+ /**
12
+ * @name startOfYear
13
+ * @category Year Helpers
14
+ * @summary Return the start of a year for the given date.
15
+ *
16
+ * @description
17
+ * Return the start of a year for the given date.
18
+ * The result will be in the local timezone.
19
+ *
20
+ * @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).
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 original date
24
+ * @param options - The options
25
+ *
26
+ * @returns The start of a year
27
+ *
28
+ * @example
29
+ * // The start of a year for 2 September 2014 11:55:00:
30
+ * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
31
+ * //=> Wed Jan 01 2014 00:00:00
32
+ */
33
+ function startOfYear(date, options) {
34
+ const date_ = toDate.toDate(date, options?.in);
35
+ date_.setFullYear(date_.getFullYear(), 0, 1);
36
+ date_.setHours(0, 0, 0, 0);
37
+ return date_;
38
+ }
39
+
40
+ exports.default = startOfYear;
41
+ exports.startOfYear = startOfYear;
@@ -0,0 +1,51 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var constructFrom = require('./constructFrom.js');
6
+
7
+ /**
8
+ * @name toDate
9
+ * @category Common Helpers
10
+ * @summary Convert the given argument to an instance of Date.
11
+ *
12
+ * @description
13
+ * Convert the given argument to an instance of Date.
14
+ *
15
+ * If the argument is an instance of Date, the function returns its clone.
16
+ *
17
+ * If the argument is a number, it is treated as a timestamp.
18
+ *
19
+ * If the argument is none of the above, the function returns Invalid Date.
20
+ *
21
+ * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
22
+ * enabling to transfer extra properties from the reference date to the new date.
23
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
24
+ * that accept a time zone as a constructor argument.
25
+ *
26
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
27
+ *
28
+ * @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).
29
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
30
+ *
31
+ * @param argument - The value to convert
32
+ *
33
+ * @returns The parsed date in the local time zone
34
+ *
35
+ * @example
36
+ * // Clone the date:
37
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
38
+ * //=> Tue Feb 11 2014 11:30:30
39
+ *
40
+ * @example
41
+ * // Convert the timestamp to date:
42
+ * const result = toDate(1392098430000)
43
+ * //=> Tue Feb 11 2014 11:30:30
44
+ */
45
+ function toDate(argument, context) {
46
+ // [TODO] Get rid of `toDate` or `constructFrom`?
47
+ return constructFrom.constructFrom(context || argument, argument);
48
+ }
49
+
50
+ exports.default = toDate;
51
+ exports.toDate = toDate;
@@ -0,0 +1,178 @@
1
+ 'use strict';
2
+
3
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
5
+ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
6
+ var core = require('@react-fabric/core');
7
+ var utilities = require('@react-fabric/utilities');
8
+ var classNames = require('classnames');
9
+ var react = require('react');
10
+ var reactI18next = require('react-i18next');
11
+ var dateUtil = require('../utils/dateUtil.js');
12
+ var jsxRuntime = require('react/jsx-runtime');
13
+ var intervalToDuration = require('../../../../../node_modules/date-fns/intervalToDuration.js');
14
+ var isBefore = require('../../../../../node_modules/date-fns/isBefore.js');
15
+
16
+ var _excluded = ["date", "children", "className", "format"];
17
+ function ownKeys(e, r) {
18
+ var t = Object.keys(e);
19
+ if (Object.getOwnPropertySymbols) {
20
+ var o = Object.getOwnPropertySymbols(e);
21
+ r && (o = o.filter(function (r) {
22
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
23
+ })), t.push.apply(t, o);
24
+ }
25
+ return t;
26
+ }
27
+ function _objectSpread(e) {
28
+ for (var r = 1; r < arguments.length; r++) {
29
+ var t = null != arguments[r] ? arguments[r] : {};
30
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
31
+ _defineProperty(e, r, t[r]);
32
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
33
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
34
+ });
35
+ }
36
+ return e;
37
+ }
38
+ /**
39
+ * DateDuration component to display the duration from a given date to now.
40
+ * It calculates the difference in years, months, weeks, days, hours, minutes, and seconds,
41
+ * and displays it in a human-readable format.
42
+ * It uses the current locale for translations.
43
+ *
44
+ * @param {Props} props - The properties for the component.
45
+ * @returns {JSX.Element} The rendered component.
46
+ *
47
+ * @example
48
+ * ```jsx
49
+ * <DateDuration date={new Date("2020-01-01")} />
50
+ * ```
51
+ *
52
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/date-date-display--docs}
53
+ */
54
+ var DateDuration = function DateDuration(_ref) {
55
+ var date = _ref.date,
56
+ children = _ref.children,
57
+ className = _ref.className,
58
+ _ref$format = _ref.format,
59
+ format = _ref$format === void 0 ? "PPpp" : _ref$format,
60
+ props = _objectWithoutProperties(_ref, _excluded);
61
+ var _useTranslation = reactI18next.useTranslation("date"),
62
+ t = _useTranslation.t;
63
+ var _useState = react.useState({}),
64
+ _useState2 = _slicedToArray(_useState, 2),
65
+ interval = _useState2[0],
66
+ setDateInterval = _useState2[1];
67
+ react.useEffect(function () {
68
+ setDateInterval(intervalToDuration.intervalToDuration({
69
+ start: new Date(date),
70
+ end: new Date()
71
+ }));
72
+ // update interval every minute
73
+ var tmr = setInterval(function () {
74
+ setDateInterval(intervalToDuration.intervalToDuration({
75
+ start: new Date(date),
76
+ end: new Date()
77
+ }));
78
+ }, 60 * 1000);
79
+ return function () {
80
+ return clearInterval(tmr);
81
+ };
82
+ }, [date]);
83
+ var label = react.useMemo(function () {
84
+ var before = isBefore.isBefore(dateUtil.DateUtil.parseDate(date), new Date());
85
+ var tkey = before ? "relative.before" : "relative.after";
86
+ var part = "now";
87
+ var count = 0;
88
+ if (interval.years && interval.years > 0) {
89
+ var _interval$months;
90
+ part = "years";
91
+ count = interval.years;
92
+ if (((_interval$months = interval.months) !== null && _interval$months !== void 0 ? _interval$months : 0) > 10) {
93
+ part = "yearsX";
94
+ count += 1;
95
+ }
96
+ } else if (interval.months && interval.months > 0) {
97
+ var _interval$weeks;
98
+ part = "months";
99
+ count = interval.months;
100
+ if (interval.months > 10) {
101
+ part = "yearsX";
102
+ count = 1;
103
+ } else if (((_interval$weeks = interval.weeks) !== null && _interval$weeks !== void 0 ? _interval$weeks : 0) > 3) {
104
+ part = "monthsX";
105
+ count += 1;
106
+ }
107
+ } else if (interval.weeks && interval.weeks > 0) {
108
+ var _interval$days;
109
+ part = "weeks";
110
+ count = interval.weeks;
111
+ if (interval.weeks > 3) {
112
+ part = "monthsX";
113
+ count = 1;
114
+ } else if (((_interval$days = interval.days) !== null && _interval$days !== void 0 ? _interval$days : 0) > 5) {
115
+ part = "weeksX";
116
+ count += 1;
117
+ }
118
+ } else if (interval.days && interval.days > 0) {
119
+ var _interval$hours;
120
+ part = "days";
121
+ count = interval.days;
122
+ if (interval.days > 5) {
123
+ part = "weeksX";
124
+ count = 1;
125
+ } else if (((_interval$hours = interval.hours) !== null && _interval$hours !== void 0 ? _interval$hours : 0) > 20) {
126
+ part = "daysX";
127
+ count += 1;
128
+ }
129
+ } else if (interval.hours && interval.hours > 0) {
130
+ var _interval$minutes;
131
+ part = "hours";
132
+ count = interval.hours;
133
+ if (interval.hours > 20) {
134
+ part = "daysX";
135
+ count = 1;
136
+ } else if (((_interval$minutes = interval.minutes) !== null && _interval$minutes !== void 0 ? _interval$minutes : 0) > 45) {
137
+ part = "hoursX";
138
+ count += 1;
139
+ }
140
+ } else if (interval.minutes && interval.minutes > 0) {
141
+ var _interval$seconds;
142
+ part = "minutes";
143
+ count = interval.minutes;
144
+ if (interval.minutes > 45) {
145
+ part = "hoursX";
146
+ count = 1;
147
+ } else if (((_interval$seconds = interval.seconds) !== null && _interval$seconds !== void 0 ? _interval$seconds : 0) > 45) {
148
+ part = "minuteX";
149
+ count += 1;
150
+ }
151
+ } else if (interval.seconds && interval.seconds > 15) {
152
+ part = "seconds";
153
+ count = interval.seconds;
154
+ if (interval.seconds > 45) {
155
+ part = "minutesX";
156
+ count = 1;
157
+ }
158
+ }
159
+ return t("".concat(tkey, ".").concat(part), {
160
+ count: count
161
+ });
162
+ }, [interval, date]);
163
+ var dtLabel = /*#__PURE__*/jsxRuntime.jsx(core.Tooltip, {
164
+ content: utilities.Format.date(date, format),
165
+ children: /*#__PURE__*/jsxRuntime.jsx("span", _objectSpread(_objectSpread({
166
+ className: classNames(className, !!children && "underline decoration-dotted cursor-pointer")
167
+ }, props), {}, {
168
+ children: label
169
+ }))
170
+ });
171
+ return children ? /*#__PURE__*/jsxRuntime.jsxs(core.Dropdown, {
172
+ showArrow: true,
173
+ closeOnClick: true,
174
+ children: [dtLabel, children]
175
+ }) : dtLabel;
176
+ };
177
+
178
+ exports.DateDuration = DateDuration;
@@ -0,0 +1,154 @@
1
+ 'use strict';
2
+
3
+ function intPart(floatNum) {
4
+ if (floatNum < -0.0000001) {
5
+ return Math.ceil(floatNum - 0.0000001);
6
+ }
7
+ return Math.floor(floatNum + 0.0000001);
8
+ }
9
+ var delta = 1;
10
+ function GregToIsl(arg) {
11
+ var d = parseInt(arg.CDay.value);
12
+ var m = parseInt(arg.CMonth.value);
13
+ var y = parseInt(arg.CYear.value);
14
+ var jd,
15
+ l,
16
+ jd1,
17
+ n,
18
+ j,
19
+ delta = 1;
20
+ if (y > 1582 || y == 1582 && m > 10 || y == 1582 && m == 10 && d > 14) {
21
+ //added delta=1 on jd to comply isna rulling 2007
22
+ jd = intPart(1461 * (y + 4800 + intPart((m - 14) / 12)) / 4) + intPart(367 * (m - 2 - 12 * intPart((m - 14) / 12)) / 12) - intPart(3 * intPart((y + 4900 + intPart((m - 14) / 12)) / 100) / 4) + d - 32075 + delta;
23
+ } else {
24
+ //added +1 on jd to comply isna rulling
25
+ jd = 367 * y - intPart(7 * (y + 5001 + intPart((m - 9) / 7)) / 4) + intPart(275 * m / 9) + d + 1729777 + delta;
26
+ }
27
+
28
+ //added -1 on jd1 to comply isna rulling
29
+ jd1 = jd - delta;
30
+ l = jd - 1948440 + 10632;
31
+ n = intPart((l - 1) / 10631);
32
+ l = l - 10631 * n + 354;
33
+ j = intPart((10985 - l) / 5316) * intPart(50 * l / 17719) + intPart(l / 5670) * intPart(43 * l / 15238);
34
+ l = l - intPart((30 - j) / 15) * intPart(17719 * j / 50) - intPart(j / 16) * intPart(15238 * j / 43) + 29;
35
+ m = intPart(24 * l / 709);
36
+ d = l - intPart(709 * m / 24);
37
+ y = 30 * n + j - 30;
38
+ return {
39
+ d: d,
40
+ m: m,
41
+ y: y,
42
+ dateOfWeek: jd1 % 7,
43
+ dayName: weekDay(jd1 % 7)
44
+ };
45
+ }
46
+ function IslToGreg(arg) {
47
+ var d = parseInt(arg.HDay.value);
48
+ var m = parseInt(arg.HMonth.value);
49
+ var y = parseInt(arg.HYear.value);
50
+ //added - delta=1 on jd to comply isna rulling
51
+ var jd = intPart((11 * y + 3) / 30) + 354 * y + 30 * m - intPart((m - 1) / 2) + d + 1948440 - 385 - delta;
52
+ var l, n, i, j, k;
53
+ if (jd > 2299160) {
54
+ l = jd + 68569;
55
+ n = intPart(4 * l / 146097);
56
+ l = l - intPart((146097 * n + 3) / 4);
57
+ i = intPart(4000 * (l + 1) / 1461001);
58
+ l = l - intPart(1461 * i / 4) + 31;
59
+ j = intPart(80 * l / 2447);
60
+ d = l - intPart(2447 * j / 80);
61
+ l = intPart(j / 11);
62
+ m = j + 2 - 12 * l;
63
+ y = 100 * (n - 49) + i + l;
64
+ } else {
65
+ j = jd + 1402;
66
+ k = intPart((j - 1) / 1461);
67
+ l = j - 1461 * k;
68
+ n = intPart((l - 1) / 365) - intPart(l / 1461);
69
+ i = l - 365 * n + 30;
70
+ j = intPart(80 * i / 2447);
71
+ d = i - intPart(2447 * j / 80);
72
+ i = intPart(j / 11);
73
+ m = j + 2 - 12 * i;
74
+ y = 4 * k + n + i - 4716;
75
+ }
76
+
77
+ //arg.CDay.value=d
78
+ //arg.CMonth.value=m
79
+ //arg.CYear.value=y
80
+
81
+ return {
82
+ d: d,
83
+ m: m,
84
+ y: y,
85
+ dateOfWeek: jd % 7,
86
+ dayName: weekDay(jd % 7)
87
+ };
88
+ }
89
+ function weekDay(wdn) {
90
+ if (wdn == 0) {
91
+ return "Mon";
92
+ }
93
+ if (wdn == 1) {
94
+ return "Tue";
95
+ }
96
+ if (wdn == 2) {
97
+ return "Wed";
98
+ }
99
+ if (wdn == 3) {
100
+ return "Thu";
101
+ }
102
+ if (wdn == 4) {
103
+ return "Fri";
104
+ }
105
+ if (wdn == 5) {
106
+ return "Sat";
107
+ }
108
+ if (wdn == 6) {
109
+ return "Sun";
110
+ }
111
+ return "";
112
+ }
113
+ function GregToHijri(gregDate) {
114
+ var hijriDate = GregToIsl({
115
+ CDay: {
116
+ value: gregDate.getDate()
117
+ },
118
+ CYear: {
119
+ value: gregDate.getFullYear()
120
+ },
121
+ CMonth: {
122
+ value: gregDate.getMonth() + 1
123
+ }
124
+ });
125
+ return {
126
+ year: hijriDate.y,
127
+ month: hijriDate.m,
128
+ date: hijriDate.d,
129
+ hours: gregDate.getHours(),
130
+ minutes: gregDate.getMinutes(),
131
+ seconds: gregDate.getSeconds(),
132
+ milliseconds: gregDate.getMilliseconds(),
133
+ day: hijriDate.dateOfWeek,
134
+ dayName: hijriDate.dayName
135
+ };
136
+ }
137
+ function HijriToGreg(hijriDate) {
138
+ var gregDate = IslToGreg({
139
+ HDay: {
140
+ value: hijriDate._date || hijriDate.date
141
+ },
142
+ HYear: {
143
+ value: hijriDate._year || hijriDate.year
144
+ },
145
+ HMonth: {
146
+ value: hijriDate._month || hijriDate.month
147
+ }
148
+ });
149
+ return new Date(gregDate.y, gregDate.m - 1, gregDate.d, hijriDate.getHours(), hijriDate.getMinutes(), hijriDate.getSeconds(), hijriDate.getMilliseconds());
150
+ }
151
+
152
+ exports.GregToHijri = GregToHijri;
153
+ exports.HijriToGreg = HijriToGreg;
154
+ exports.weekDay = weekDay;
@@ -0,0 +1,116 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var HijriDate = require('./HijriDate.js');
6
+
7
+ var dateFormat = function () {
8
+ var token = /P{1,4}|p{1,4}|d{1,2}|e{3,6}|M{1,4}|yy(?:yy)?|([Hhms])\1?|[a]{1,4}|[LloSZ]|('at')|"[^"]*"|'[^']*'/g,
9
+ pad = function pad(val, len) {
10
+ val = String(val);
11
+ len = len || 2;
12
+ while (val.length < len) val = "0" + val;
13
+ return val;
14
+ };
15
+
16
+ // Regexes and supporting functions are cached through closure
17
+ return function (date, mask) {
18
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
19
+ utc: false
20
+ };
21
+ var locales = HijriDate.default.locales,
22
+ defaultLocale = HijriDate.default.defaultLocale;
23
+ options.locale = options.locale || defaultLocale;
24
+ if (!locales[options.locale]) {
25
+ throw new Error("Locale ".concat(options.locale, " is not supported yet .\n Please, try to extend \"HijriDate.locales\" :\n i.e: HijriDate.locales.").concat(options.locale, " = {dayNames:[..14 items..], monthNames:[..24 items..]}\n "));
26
+ }
27
+ // You can't provide utc if you skip other args (use the "UTC:" mask prefix)
28
+ if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
29
+ mask = date;
30
+ date = undefined;
31
+ }
32
+ mask = String(masks[mask] || mask || masks["default"]);
33
+
34
+ // Allow setting the utc argument via the mask
35
+ if (mask.slice(0, 4) == "UTC:") {
36
+ mask = mask.slice(4);
37
+ options.utc = true;
38
+ }
39
+ var _ = options.utc ? "getUTC" : "get",
40
+ d = date[_ + "Date"](),
41
+ D = date[_ + "Day"](),
42
+ M = date[_ + "Month"](),
43
+ mIndex = date[_ + "MonthIndex"](),
44
+ y = date[_ + "FullYear"](),
45
+ H = date[_ + "Hours"](),
46
+ m = date[_ + "Minutes"](),
47
+ s = date[_ + "Seconds"](),
48
+ L = date[_ + "Milliseconds"](),
49
+ o = options.utc ? 0 : date.getTimezoneOffset(),
50
+ flags = {
51
+ d: d,
52
+ dd: pad(d),
53
+ ddd: locales[options.locale].dayNames[D === 7 ? 0 : D + 1],
54
+ dddd: locales[options.locale].dayNames[(D === 7 ? 0 : D + 1) + 7],
55
+ ee: locales[options.locale].dayNames[D],
56
+ eee: locales[options.locale].dayNames[D + 7],
57
+ eeee: locales[options.locale].dayNames[D + 14],
58
+ eeeeee: locales[options.locale].dayNames[D],
59
+ M: M,
60
+ MM: pad(M),
61
+ MMM: locales[options.locale].monthNames[mIndex],
62
+ MMMM: locales[options.locale].monthNames[mIndex + 12],
63
+ yy: String(y).slice(2),
64
+ yyyy: y,
65
+ h: H % 12 || 12,
66
+ hh: pad(H % 12 || 12),
67
+ H: H,
68
+ HH: pad(H),
69
+ m: m,
70
+ mm: pad(m),
71
+ s: s,
72
+ ss: pad(s),
73
+ l: pad(L, 3),
74
+ L: pad(L > 99 ? Math.round(L / 10) : L),
75
+ a: H < 12 ? locales[options.locale].am : locales[options.locale].pm,
76
+ aa: H < 12 ? locales[options.locale].am : locales[options.locale].pm,
77
+ aaa: H < 12 ? locales[options.locale].am : locales[options.locale].pm,
78
+ aaaa: H < 12 ? locales[options.locale].am : locales[options.locale].pm,
79
+ aaaaa: H < 12 ? locales[options.locale].am : locales[options.locale].pm,
80
+ "'at'": locales[options.locale].separator,
81
+ t: H < 12 ? "a" : "p",
82
+ tt: H < 12 ? "am" : "pm",
83
+ T: H < 12 ? "A" : "P",
84
+ TT: H < 12 ? "AM" : "PM",
85
+ // Z: options.utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
86
+ o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
87
+ S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
88
+ };
89
+ return mask.replace(token, function ($0) {
90
+ if ($0 === "P") return "".concat(flags.d, "/").concat(flags.M, "/").concat(flags.yyyy, " ");
91
+ if ($0.startsWith("PP")) return "".concat(flags.MMM, " ").concat(flags.dd, ", ").concat(flags.yyyy, " ");
92
+ if ($0 === "p") return "".concat(flags.h, ":").concat(flags.m, " ").concat(flags.a);
93
+ if ($0.startsWith("pp")) return "".concat(flags.hh, ":").concat(flags.mm, ":").concat(flags.ss, " ").concat(flags.a);
94
+ return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
95
+ });
96
+ };
97
+ }();
98
+
99
+ // Some common format strings
100
+ var masks = {
101
+ "default": "ddd MMM dd yyyy HH:mm:ss",
102
+ shortDate: "M/d/yy",
103
+ mediumDate: "MMM d, yyyy",
104
+ longDate: "MMMM d, yyyy",
105
+ fullDate: "dddd, MMMM d, yyyy",
106
+ shortTime: "h:mm TT",
107
+ mediumTime: "h:mm:ss TT",
108
+ longTime: "h:mm:ss TT Z",
109
+ isoDate: "yyyy-MM-dd",
110
+ isoTime: "HH:mm:ss",
111
+ isoDateTime: "yyyy-MM-dd'T'HH:mm:ss",
112
+ isoUtcDateTime: "UTC:yyyy-MM-dd'T'HH:mm:ss'Z'"
113
+ };
114
+
115
+ exports.default = dateFormat;
116
+ exports.masks = masks;