@react-fabric/lexical 1.0.0-beta.61 → 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 (359) 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/{editor → packages/lexical/src/editor}/LexicalEditor.js +32 -9
  160. package/dist/cjs/{i18n/ar.json.js → packages/lexical/src/i18n/ar/lexical.json.js} +10 -4
  161. package/dist/cjs/{i18n/en.json.js → packages/lexical/src/i18n/en/lexical.json.js} +7 -1
  162. package/dist/cjs/{i18n → packages/lexical/src/i18n}/index.js +4 -4
  163. package/dist/cjs/packages/lexical/src/plugins/CommentPlugin.js +477 -0
  164. package/dist/cjs/{plugins → packages/lexical/src/plugins}/DraggableBlockPlugin.js +8 -11
  165. package/dist/esm/node_modules/date-fns/_lib/addLeadingZeros.js +9 -0
  166. package/dist/esm/node_modules/date-fns/_lib/defaultOptions.js +9 -0
  167. package/dist/esm/node_modules/date-fns/_lib/format/formatters.js +779 -0
  168. package/dist/esm/node_modules/date-fns/_lib/format/lightFormatters.js +96 -0
  169. package/dist/esm/node_modules/date-fns/_lib/format/longFormatters.js +68 -0
  170. package/dist/esm/node_modules/date-fns/_lib/getRoundingMethod.js +12 -0
  171. package/dist/esm/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +33 -0
  172. package/dist/esm/node_modules/date-fns/_lib/normalizeDates.js +13 -0
  173. package/dist/esm/node_modules/date-fns/_lib/normalizeInterval.js +10 -0
  174. package/dist/esm/node_modules/date-fns/_lib/protectedTokens.js +27 -0
  175. package/dist/esm/node_modules/date-fns/add.js +70 -0
  176. package/dist/esm/node_modules/date-fns/addDays.js +43 -0
  177. package/dist/esm/node_modules/date-fns/addHours.js +36 -0
  178. package/dist/esm/node_modules/date-fns/addMilliseconds.js +36 -0
  179. package/dist/esm/node_modules/date-fns/addMinutes.js +38 -0
  180. package/dist/esm/node_modules/date-fns/addMonths.js +77 -0
  181. package/dist/esm/node_modules/date-fns/addQuarters.js +35 -0
  182. package/dist/esm/node_modules/date-fns/addWeeks.js +35 -0
  183. package/dist/esm/node_modules/date-fns/addYears.js +35 -0
  184. package/dist/esm/node_modules/date-fns/compareAsc.js +47 -0
  185. package/dist/esm/node_modules/date-fns/constants.js +62 -0
  186. package/dist/esm/node_modules/date-fns/constructFrom.js +51 -0
  187. package/dist/esm/node_modules/date-fns/differenceInCalendarDays.js +64 -0
  188. package/dist/esm/node_modules/date-fns/differenceInCalendarMonths.js +44 -0
  189. package/dist/esm/node_modules/date-fns/differenceInCalendarYears.js +40 -0
  190. package/dist/esm/node_modules/date-fns/differenceInDays.js +109 -0
  191. package/dist/esm/node_modules/date-fns/differenceInHours.js +43 -0
  192. package/dist/esm/node_modules/date-fns/differenceInMilliseconds.js +31 -0
  193. package/dist/esm/node_modules/date-fns/differenceInMinutes.js +47 -0
  194. package/dist/esm/node_modules/date-fns/differenceInMonths.js +62 -0
  195. package/dist/esm/node_modules/date-fns/differenceInSeconds.js +38 -0
  196. package/dist/esm/node_modules/date-fns/differenceInYears.js +64 -0
  197. package/dist/esm/node_modules/date-fns/endOfDay.js +37 -0
  198. package/dist/esm/node_modules/date-fns/endOfDecade.js +42 -0
  199. package/dist/esm/node_modules/date-fns/endOfHour.js +37 -0
  200. package/dist/esm/node_modules/date-fns/endOfMinute.js +37 -0
  201. package/dist/esm/node_modules/date-fns/endOfMonth.js +39 -0
  202. package/dist/esm/node_modules/date-fns/endOfQuarter.js +40 -0
  203. package/dist/esm/node_modules/date-fns/endOfWeek.js +55 -0
  204. package/dist/esm/node_modules/date-fns/endOfYear.js +39 -0
  205. package/dist/esm/node_modules/date-fns/format.js +425 -0
  206. package/dist/esm/node_modules/date-fns/getDayOfYear.js +36 -0
  207. package/dist/esm/node_modules/date-fns/getISOWeek.js +42 -0
  208. package/dist/esm/node_modules/date-fns/getISOWeekYear.js +54 -0
  209. package/dist/esm/node_modules/date-fns/getWeek.js +56 -0
  210. package/dist/esm/node_modules/date-fns/getWeekYear.js +77 -0
  211. package/dist/esm/node_modules/date-fns/intervalToDuration.js +67 -0
  212. package/dist/esm/node_modules/date-fns/isAfter.js +27 -0
  213. package/dist/esm/node_modules/date-fns/isBefore.js +27 -0
  214. package/dist/esm/node_modules/date-fns/isDate.js +43 -0
  215. package/dist/esm/node_modules/date-fns/isLastDayOfMonth.js +30 -0
  216. package/dist/esm/node_modules/date-fns/isSameMonth.js +45 -0
  217. package/dist/esm/node_modules/date-fns/isSameWeek.js +53 -0
  218. package/dist/esm/node_modules/date-fns/isSameYear.js +37 -0
  219. package/dist/esm/node_modules/date-fns/isValid.js +41 -0
  220. package/dist/esm/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +12 -0
  221. package/dist/esm/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +66 -0
  222. package/dist/esm/node_modules/date-fns/locale/_lib/buildMatchFn.js +61 -0
  223. package/dist/esm/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +24 -0
  224. package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/formatDistance.js +139 -0
  225. package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/formatLong.js +43 -0
  226. package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/formatRelative.js +15 -0
  227. package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/localize.js +166 -0
  228. package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/match.js +146 -0
  229. package/dist/esm/node_modules/date-fns/locale/ar-SA.js +29 -0
  230. package/dist/esm/node_modules/date-fns/locale/de/_lib/formatDistance.js +200 -0
  231. package/dist/esm/node_modules/date-fns/locale/de/_lib/formatLong.js +44 -0
  232. package/dist/esm/node_modules/date-fns/locale/de/_lib/formatRelative.js +15 -0
  233. package/dist/esm/node_modules/date-fns/locale/de/_lib/localize.js +195 -0
  234. package/dist/esm/node_modules/date-fns/locale/de/_lib/match.js +138 -0
  235. package/dist/esm/node_modules/date-fns/locale/de.js +33 -0
  236. package/dist/esm/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +105 -0
  237. package/dist/esm/node_modules/date-fns/locale/en-US/_lib/formatLong.js +43 -0
  238. package/dist/esm/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +15 -0
  239. package/dist/esm/node_modules/date-fns/locale/en-US/_lib/localize.js +191 -0
  240. package/dist/esm/node_modules/date-fns/locale/en-US/_lib/match.js +136 -0
  241. package/dist/esm/node_modules/date-fns/locale/en-US.js +30 -0
  242. package/dist/esm/node_modules/date-fns/locale/es/_lib/formatDistance.js +105 -0
  243. package/dist/esm/node_modules/date-fns/locale/es/_lib/formatLong.js +43 -0
  244. package/dist/esm/node_modules/date-fns/locale/es/_lib/formatRelative.js +29 -0
  245. package/dist/esm/node_modules/date-fns/locale/es/_lib/localize.js +168 -0
  246. package/dist/esm/node_modules/date-fns/locale/es/_lib/match.js +142 -0
  247. package/dist/esm/node_modules/date-fns/locale/es.js +33 -0
  248. package/dist/esm/node_modules/date-fns/locale/fr/_lib/formatDistance.js +104 -0
  249. package/dist/esm/node_modules/date-fns/locale/fr/_lib/formatLong.js +43 -0
  250. package/dist/esm/node_modules/date-fns/locale/fr/_lib/formatRelative.js +15 -0
  251. package/dist/esm/node_modules/date-fns/locale/fr/_lib/localize.js +169 -0
  252. package/dist/esm/node_modules/date-fns/locale/fr/_lib/match.js +137 -0
  253. package/dist/esm/node_modules/date-fns/locale/fr.js +30 -0
  254. package/dist/esm/node_modules/date-fns/locale/hi/_lib/formatDistance.js +109 -0
  255. package/dist/esm/node_modules/date-fns/locale/hi/_lib/formatLong.js +43 -0
  256. package/dist/esm/node_modules/date-fns/locale/hi/_lib/formatRelative.js +15 -0
  257. package/dist/esm/node_modules/date-fns/locale/hi/_lib/localize.js +231 -0
  258. package/dist/esm/node_modules/date-fns/locale/hi/_lib/match.js +141 -0
  259. package/dist/esm/node_modules/date-fns/locale/hi.js +29 -0
  260. package/dist/esm/node_modules/date-fns/locale/it/_lib/formatDistance.js +105 -0
  261. package/dist/esm/node_modules/date-fns/locale/it/_lib/formatLong.js +43 -0
  262. package/dist/esm/node_modules/date-fns/locale/it/_lib/formatRelative.js +70 -0
  263. package/dist/esm/node_modules/date-fns/locale/it/_lib/localize.js +168 -0
  264. package/dist/esm/node_modules/date-fns/locale/it/_lib/match.js +137 -0
  265. package/dist/esm/node_modules/date-fns/locale/it.js +31 -0
  266. package/dist/esm/node_modules/date-fns/locale/ja/_lib/formatDistance.js +119 -0
  267. package/dist/esm/node_modules/date-fns/locale/ja/_lib/formatLong.js +43 -0
  268. package/dist/esm/node_modules/date-fns/locale/ja/_lib/formatRelative.js +16 -0
  269. package/dist/esm/node_modules/date-fns/locale/ja/_lib/localize.js +181 -0
  270. package/dist/esm/node_modules/date-fns/locale/ja/_lib/match.js +122 -0
  271. package/dist/esm/node_modules/date-fns/locale/ja.js +33 -0
  272. package/dist/esm/node_modules/date-fns/locale/ko/_lib/formatDistance.js +105 -0
  273. package/dist/esm/node_modules/date-fns/locale/ko/_lib/formatLong.js +43 -0
  274. package/dist/esm/node_modules/date-fns/locale/ko/_lib/formatRelative.js +15 -0
  275. package/dist/esm/node_modules/date-fns/locale/ko/_lib/localize.js +171 -0
  276. package/dist/esm/node_modules/date-fns/locale/ko/_lib/match.js +119 -0
  277. package/dist/esm/node_modules/date-fns/locale/ko.js +31 -0
  278. package/dist/esm/node_modules/date-fns/locale/pt/_lib/formatDistance.js +105 -0
  279. package/dist/esm/node_modules/date-fns/locale/pt/_lib/formatLong.js +43 -0
  280. package/dist/esm/node_modules/date-fns/locale/pt/_lib/formatRelative.js +26 -0
  281. package/dist/esm/node_modules/date-fns/locale/pt/_lib/localize.js +168 -0
  282. package/dist/esm/node_modules/date-fns/locale/pt/_lib/match.js +141 -0
  283. package/dist/esm/node_modules/date-fns/locale/pt.js +30 -0
  284. package/dist/esm/node_modules/date-fns/locale/ru/_lib/formatDistance.js +250 -0
  285. package/dist/esm/node_modules/date-fns/locale/ru/_lib/formatLong.js +40 -0
  286. package/dist/esm/node_modules/date-fns/locale/ru/_lib/formatRelative.js +92 -0
  287. package/dist/esm/node_modules/date-fns/locale/ru/_lib/localize.js +214 -0
  288. package/dist/esm/node_modules/date-fns/locale/ru/_lib/match.js +142 -0
  289. package/dist/esm/node_modules/date-fns/locale/ru.js +30 -0
  290. package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/formatDistance.js +105 -0
  291. package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/formatLong.js +43 -0
  292. package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/formatRelative.js +35 -0
  293. package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/localize.js +187 -0
  294. package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/match.js +134 -0
  295. package/dist/esm/node_modules/date-fns/locale/zh-CN.js +33 -0
  296. package/dist/esm/node_modules/date-fns/startOfDay.js +37 -0
  297. package/dist/esm/node_modules/date-fns/startOfDecade.js +42 -0
  298. package/dist/esm/node_modules/date-fns/startOfHour.js +37 -0
  299. package/dist/esm/node_modules/date-fns/startOfISOWeek.js +37 -0
  300. package/dist/esm/node_modules/date-fns/startOfISOWeekYear.js +44 -0
  301. package/dist/esm/node_modules/date-fns/startOfMinute.js +37 -0
  302. package/dist/esm/node_modules/date-fns/startOfMonth.js +39 -0
  303. package/dist/esm/node_modules/date-fns/startOfQuarter.js +40 -0
  304. package/dist/esm/node_modules/date-fns/startOfWeek.js +55 -0
  305. package/dist/esm/node_modules/date-fns/startOfWeekYear.js +66 -0
  306. package/dist/esm/node_modules/date-fns/startOfYear.js +38 -0
  307. package/dist/esm/node_modules/date-fns/toDate.js +48 -0
  308. package/dist/esm/packages/date/dist/esm/display/DateDuration.js +178 -0
  309. package/dist/esm/packages/date/dist/esm/hijri/DateConverter.js +152 -0
  310. package/dist/esm/packages/date/dist/esm/hijri/FormatDate.js +113 -0
  311. package/dist/esm/packages/date/dist/esm/hijri/HijriDate.js +528 -0
  312. package/dist/esm/packages/date/dist/esm/hijri/StringDateParser.js +74 -0
  313. package/dist/esm/packages/date/dist/esm/hijri/index.js +21 -0
  314. package/dist/esm/packages/date/dist/esm/hijri/initializer.js +113 -0
  315. package/dist/esm/packages/date/dist/esm/hijri/locales.js +18 -0
  316. package/dist/esm/packages/date/dist/esm/hijri/safe.js +14 -0
  317. package/dist/esm/packages/date/dist/esm/i18n/ar/date.json.js +209 -0
  318. package/dist/esm/packages/date/dist/esm/i18n/en/date.json.js +79 -0
  319. package/dist/esm/packages/date/dist/esm/i18n/index.js +33 -0
  320. package/dist/esm/packages/date/dist/esm/types/index.js +45 -0
  321. package/dist/esm/packages/date/dist/esm/utils/dateUtil.js +474 -0
  322. package/dist/esm/{editor → packages/lexical/src/editor}/LexicalEditor.js +33 -10
  323. package/dist/esm/{i18n/ar.json.js → packages/lexical/src/i18n/ar/lexical.json.js} +9 -5
  324. package/dist/esm/{i18n/en.json.js → packages/lexical/src/i18n/en/lexical.json.js} +6 -2
  325. package/dist/esm/{i18n → packages/lexical/src/i18n}/index.js +2 -2
  326. package/dist/esm/packages/lexical/src/plugins/CommentPlugin.js +477 -0
  327. package/dist/esm/{plugins → packages/lexical/src/plugins}/DraggableBlockPlugin.js +9 -12
  328. package/dist/types/editor/LexicalEditor.d.ts +12 -3
  329. package/dist/types/hooks/useFormatWatcher.d.ts +1 -1
  330. package/dist/types/plugins/CommentPlugin.d.ts +5 -0
  331. package/dist/types/plugins/DraggableBlockPlugin.d.ts +2 -1
  332. package/package.json +5 -5
  333. package/src/editor/LexicalEditor.tsx +65 -18
  334. package/src/i18n/{ar.json → ar/lexical.json} +6 -4
  335. package/src/i18n/{en.json → en/lexical.json} +3 -1
  336. package/src/i18n/index.ts +2 -2
  337. package/src/plugins/CommentPlugin.tsx +554 -0
  338. package/src/plugins/DraggableBlockPlugin.tsx +5 -10
  339. package/dist/cjs/components/StickyComponent.js +0 -220
  340. package/dist/cjs/nodes/StickyNode.js +0 -218
  341. package/dist/cjs/plugins/StickyPlugin.js +0 -20
  342. package/dist/esm/components/StickyComponent.js +0 -220
  343. package/dist/esm/nodes/StickyNode.js +0 -216
  344. package/dist/esm/plugins/StickyPlugin.js +0 -20
  345. package/dist/types/components/StickyComponent.d.ts +0 -9
  346. package/dist/types/nodes/StickyNode.d.ts +0 -34
  347. package/dist/types/plugins/StickyPlugin.d.ts +0 -1
  348. package/src/components/StickyComponent.tsx +0 -270
  349. package/src/nodes/StickyNode.tsx +0 -249
  350. /package/dist/cjs/{editor → packages/lexical/src/editor}/theme.js +0 -0
  351. /package/dist/cjs/{hooks → packages/lexical/src/hooks}/useFormatWatcher.js +0 -0
  352. /package/dist/cjs/{index.js → packages/lexical/src/index.js} +0 -0
  353. /package/dist/cjs/{plugins → packages/lexical/src/plugins}/ToolbarPlugin.js +0 -0
  354. /package/dist/cjs/{utils → packages/lexical/src/utils}/index.js +0 -0
  355. /package/dist/esm/{editor → packages/lexical/src/editor}/theme.js +0 -0
  356. /package/dist/esm/{hooks → packages/lexical/src/hooks}/useFormatWatcher.js +0 -0
  357. /package/dist/esm/{index.js → packages/lexical/src/index.js} +0 -0
  358. /package/dist/esm/{plugins → packages/lexical/src/plugins}/ToolbarPlugin.js +0 -0
  359. /package/dist/esm/{utils → packages/lexical/src/utils}/index.js +0 -0
@@ -0,0 +1,55 @@
1
+ 'use client';
2
+
3
+ import { getDefaultOptions } from './_lib/defaultOptions.js';
4
+ import { toDate } from './toDate.js';
5
+
6
+ /**
7
+ * The {@link startOfWeek} function options.
8
+ */
9
+
10
+ /**
11
+ * @name startOfWeek
12
+ * @category Week Helpers
13
+ * @summary Return the start of a week for the given date.
14
+ *
15
+ * @description
16
+ * Return the start of a week for the given date.
17
+ * The result will be in the local timezone.
18
+ *
19
+ * @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).
20
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
21
+ *
22
+ * @param date - The original date
23
+ * @param options - An object with options
24
+ *
25
+ * @returns The start of a week
26
+ *
27
+ * @example
28
+ * // The start of a week for 2 September 2014 11:55:00:
29
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
30
+ * //=> Sun Aug 31 2014 00:00:00
31
+ *
32
+ * @example
33
+ * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
34
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
35
+ * //=> Mon Sep 01 2014 00:00:00
36
+ */
37
+ function startOfWeek(date, options) {
38
+ const defaultOptions = getDefaultOptions();
39
+ const weekStartsOn =
40
+ options?.weekStartsOn ??
41
+ options?.locale?.options?.weekStartsOn ??
42
+ defaultOptions.weekStartsOn ??
43
+ defaultOptions.locale?.options?.weekStartsOn ??
44
+ 0;
45
+
46
+ const _date = toDate(date, options?.in);
47
+ const day = _date.getDay();
48
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
49
+
50
+ _date.setDate(_date.getDate() - diff);
51
+ _date.setHours(0, 0, 0, 0);
52
+ return _date;
53
+ }
54
+
55
+ export { startOfWeek as default, startOfWeek };
@@ -0,0 +1,66 @@
1
+ 'use client';
2
+
3
+ import { getDefaultOptions } from './_lib/defaultOptions.js';
4
+ import { constructFrom } from './constructFrom.js';
5
+ import { getWeekYear } from './getWeekYear.js';
6
+ import { startOfWeek } from './startOfWeek.js';
7
+
8
+ /**
9
+ * The {@link startOfWeekYear} function options.
10
+ */
11
+
12
+ /**
13
+ * @name startOfWeekYear
14
+ * @category Week-Numbering Year Helpers
15
+ * @summary Return the start of a local week-numbering year for the given date.
16
+ *
17
+ * @description
18
+ * Return the start of a local week-numbering year.
19
+ * The exact calculation depends on the values of
20
+ * `options.weekStartsOn` (which is the index of the first day of the week)
21
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
22
+ * the first week of the week-numbering year)
23
+ *
24
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
25
+ *
26
+ * @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).
27
+ * @typeParam ResultDate - The result `Date` type.
28
+ *
29
+ * @param date - The original date
30
+ * @param options - An object with options
31
+ *
32
+ * @returns The start of a week-numbering year
33
+ *
34
+ * @example
35
+ * // The start of an a week-numbering year for 2 July 2005 with default settings:
36
+ * const result = startOfWeekYear(new Date(2005, 6, 2))
37
+ * //=> Sun Dec 26 2004 00:00:00
38
+ *
39
+ * @example
40
+ * // The start of a week-numbering year for 2 July 2005
41
+ * // if Monday is the first day of week
42
+ * // and 4 January is always in the first week of the year:
43
+ * const result = startOfWeekYear(new Date(2005, 6, 2), {
44
+ * weekStartsOn: 1,
45
+ * firstWeekContainsDate: 4
46
+ * })
47
+ * //=> Mon Jan 03 2005 00:00:00
48
+ */
49
+ function startOfWeekYear(date, options) {
50
+ const defaultOptions = getDefaultOptions();
51
+ const firstWeekContainsDate =
52
+ options?.firstWeekContainsDate ??
53
+ options?.locale?.options?.firstWeekContainsDate ??
54
+ defaultOptions.firstWeekContainsDate ??
55
+ defaultOptions.locale?.options?.firstWeekContainsDate ??
56
+ 1;
57
+
58
+ const year = getWeekYear(date, options);
59
+ const firstWeek = constructFrom(options?.in || date, 0);
60
+ firstWeek.setFullYear(year, 0, firstWeekContainsDate);
61
+ firstWeek.setHours(0, 0, 0, 0);
62
+ const _date = startOfWeek(firstWeek, options);
63
+ return _date;
64
+ }
65
+
66
+ export { startOfWeekYear as default, startOfWeekYear };
@@ -0,0 +1,38 @@
1
+ 'use client';
2
+
3
+ import { toDate } from './toDate.js';
4
+
5
+ /**
6
+ * The {@link startOfYear} function options.
7
+ */
8
+
9
+ /**
10
+ * @name startOfYear
11
+ * @category Year Helpers
12
+ * @summary Return the start of a year for the given date.
13
+ *
14
+ * @description
15
+ * Return the start of a year for the given date.
16
+ * The result will be in the local timezone.
17
+ *
18
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
19
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
20
+ *
21
+ * @param date - The original date
22
+ * @param options - The options
23
+ *
24
+ * @returns The start of a year
25
+ *
26
+ * @example
27
+ * // The start of a year for 2 September 2014 11:55:00:
28
+ * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
29
+ * //=> Wed Jan 01 2014 00:00:00
30
+ */
31
+ function startOfYear(date, options) {
32
+ const date_ = toDate(date, options?.in);
33
+ date_.setFullYear(date_.getFullYear(), 0, 1);
34
+ date_.setHours(0, 0, 0, 0);
35
+ return date_;
36
+ }
37
+
38
+ export { startOfYear as default, startOfYear };
@@ -0,0 +1,48 @@
1
+ 'use client';
2
+
3
+ import { constructFrom } from './constructFrom.js';
4
+
5
+ /**
6
+ * @name toDate
7
+ * @category Common Helpers
8
+ * @summary Convert the given argument to an instance of Date.
9
+ *
10
+ * @description
11
+ * Convert the given argument to an instance of Date.
12
+ *
13
+ * If the argument is an instance of Date, the function returns its clone.
14
+ *
15
+ * If the argument is a number, it is treated as a timestamp.
16
+ *
17
+ * If the argument is none of the above, the function returns Invalid Date.
18
+ *
19
+ * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
20
+ * enabling to transfer extra properties from the reference date to the new date.
21
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
22
+ * that accept a time zone as a constructor argument.
23
+ *
24
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
25
+ *
26
+ * @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).
27
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
28
+ *
29
+ * @param argument - The value to convert
30
+ *
31
+ * @returns The parsed date in the local time zone
32
+ *
33
+ * @example
34
+ * // Clone the date:
35
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
36
+ * //=> Tue Feb 11 2014 11:30:30
37
+ *
38
+ * @example
39
+ * // Convert the timestamp to date:
40
+ * const result = toDate(1392098430000)
41
+ * //=> Tue Feb 11 2014 11:30:30
42
+ */
43
+ function toDate(argument, context) {
44
+ // [TODO] Get rid of `toDate` or `constructFrom`?
45
+ return constructFrom(context || argument, argument);
46
+ }
47
+
48
+ export { toDate as default, toDate };
@@ -0,0 +1,178 @@
1
+ 'use client';
2
+
3
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
5
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
6
+ import { Tooltip, Dropdown } from '@react-fabric/core';
7
+ import { Format } from '@react-fabric/utilities';
8
+ import classNames from 'classnames';
9
+ import { useState, useEffect, useMemo } from 'react';
10
+ import { useTranslation } from 'react-i18next';
11
+ import { DateUtil } from '../utils/dateUtil.js';
12
+ import { jsx, jsxs } from 'react/jsx-runtime';
13
+ import { intervalToDuration } from '../../../../../node_modules/date-fns/intervalToDuration.js';
14
+ import { isBefore } from '../../../../../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 = useTranslation("date"),
62
+ t = _useTranslation.t;
63
+ var _useState = useState({}),
64
+ _useState2 = _slicedToArray(_useState, 2),
65
+ interval = _useState2[0],
66
+ setDateInterval = _useState2[1];
67
+ useEffect(function () {
68
+ setDateInterval(intervalToDuration({
69
+ start: new Date(date),
70
+ end: new Date()
71
+ }));
72
+ // update interval every minute
73
+ var tmr = setInterval(function () {
74
+ setDateInterval(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 = useMemo(function () {
84
+ var before = isBefore(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__*/jsx(Tooltip, {
164
+ content: Format.date(date, format),
165
+ children: /*#__PURE__*/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__*/jsxs(Dropdown, {
172
+ showArrow: true,
173
+ closeOnClick: true,
174
+ children: [dtLabel, children]
175
+ }) : dtLabel;
176
+ };
177
+
178
+ export { DateDuration };
@@ -0,0 +1,152 @@
1
+ 'use client';
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
+ export { GregToHijri, HijriToGreg, weekDay };
@@ -0,0 +1,113 @@
1
+ 'use client';
2
+
3
+ import HijriDate from './HijriDate.js';
4
+
5
+ var dateFormat = function () {
6
+ 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,
7
+ pad = function pad(val, len) {
8
+ val = String(val);
9
+ len = len || 2;
10
+ while (val.length < len) val = "0" + val;
11
+ return val;
12
+ };
13
+
14
+ // Regexes and supporting functions are cached through closure
15
+ return function (date, mask) {
16
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
17
+ utc: false
18
+ };
19
+ var locales = HijriDate.locales,
20
+ defaultLocale = HijriDate.defaultLocale;
21
+ options.locale = options.locale || defaultLocale;
22
+ if (!locales[options.locale]) {
23
+ 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 "));
24
+ }
25
+ // You can't provide utc if you skip other args (use the "UTC:" mask prefix)
26
+ if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
27
+ mask = date;
28
+ date = undefined;
29
+ }
30
+ mask = String(masks[mask] || mask || masks["default"]);
31
+
32
+ // Allow setting the utc argument via the mask
33
+ if (mask.slice(0, 4) == "UTC:") {
34
+ mask = mask.slice(4);
35
+ options.utc = true;
36
+ }
37
+ var _ = options.utc ? "getUTC" : "get",
38
+ d = date[_ + "Date"](),
39
+ D = date[_ + "Day"](),
40
+ M = date[_ + "Month"](),
41
+ mIndex = date[_ + "MonthIndex"](),
42
+ y = date[_ + "FullYear"](),
43
+ H = date[_ + "Hours"](),
44
+ m = date[_ + "Minutes"](),
45
+ s = date[_ + "Seconds"](),
46
+ L = date[_ + "Milliseconds"](),
47
+ o = options.utc ? 0 : date.getTimezoneOffset(),
48
+ flags = {
49
+ d: d,
50
+ dd: pad(d),
51
+ ddd: locales[options.locale].dayNames[D === 7 ? 0 : D + 1],
52
+ dddd: locales[options.locale].dayNames[(D === 7 ? 0 : D + 1) + 7],
53
+ ee: locales[options.locale].dayNames[D],
54
+ eee: locales[options.locale].dayNames[D + 7],
55
+ eeee: locales[options.locale].dayNames[D + 14],
56
+ eeeeee: locales[options.locale].dayNames[D],
57
+ M: M,
58
+ MM: pad(M),
59
+ MMM: locales[options.locale].monthNames[mIndex],
60
+ MMMM: locales[options.locale].monthNames[mIndex + 12],
61
+ yy: String(y).slice(2),
62
+ yyyy: y,
63
+ h: H % 12 || 12,
64
+ hh: pad(H % 12 || 12),
65
+ H: H,
66
+ HH: pad(H),
67
+ m: m,
68
+ mm: pad(m),
69
+ s: s,
70
+ ss: pad(s),
71
+ l: pad(L, 3),
72
+ L: pad(L > 99 ? Math.round(L / 10) : L),
73
+ a: H < 12 ? locales[options.locale].am : locales[options.locale].pm,
74
+ aa: H < 12 ? locales[options.locale].am : locales[options.locale].pm,
75
+ aaa: H < 12 ? locales[options.locale].am : locales[options.locale].pm,
76
+ aaaa: H < 12 ? locales[options.locale].am : locales[options.locale].pm,
77
+ aaaaa: H < 12 ? locales[options.locale].am : locales[options.locale].pm,
78
+ "'at'": locales[options.locale].separator,
79
+ t: H < 12 ? "a" : "p",
80
+ tt: H < 12 ? "am" : "pm",
81
+ T: H < 12 ? "A" : "P",
82
+ TT: H < 12 ? "AM" : "PM",
83
+ // Z: options.utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
84
+ o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
85
+ S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
86
+ };
87
+ return mask.replace(token, function ($0) {
88
+ if ($0 === "P") return "".concat(flags.d, "/").concat(flags.M, "/").concat(flags.yyyy, " ");
89
+ if ($0.startsWith("PP")) return "".concat(flags.MMM, " ").concat(flags.dd, ", ").concat(flags.yyyy, " ");
90
+ if ($0 === "p") return "".concat(flags.h, ":").concat(flags.m, " ").concat(flags.a);
91
+ if ($0.startsWith("pp")) return "".concat(flags.hh, ":").concat(flags.mm, ":").concat(flags.ss, " ").concat(flags.a);
92
+ return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
93
+ });
94
+ };
95
+ }();
96
+
97
+ // Some common format strings
98
+ var masks = {
99
+ "default": "ddd MMM dd yyyy HH:mm:ss",
100
+ shortDate: "M/d/yy",
101
+ mediumDate: "MMM d, yyyy",
102
+ longDate: "MMMM d, yyyy",
103
+ fullDate: "dddd, MMMM d, yyyy",
104
+ shortTime: "h:mm TT",
105
+ mediumTime: "h:mm:ss TT",
106
+ longTime: "h:mm:ss TT Z",
107
+ isoDate: "yyyy-MM-dd",
108
+ isoTime: "HH:mm:ss",
109
+ isoDateTime: "yyyy-MM-dd'T'HH:mm:ss",
110
+ isoUtcDateTime: "UTC:yyyy-MM-dd'T'HH:mm:ss'Z'"
111
+ };
112
+
113
+ export { dateFormat as default, masks };