@react-fabric/lexical 1.0.0-beta.62 → 1.0.0-beta.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/_lexical.css +10 -13
- package/dist/cjs/{packages/lexical/src/editor → editor}/LexicalEditor.js +2 -2
- package/dist/cjs/{packages/lexical/src/hooks → hooks}/useFormatWatcher.js +54 -56
- package/dist/cjs/{packages/lexical/src/plugins → plugins}/CommentPlugin.js +12 -18
- package/dist/cjs/{packages/lexical/src/plugins → plugins}/DraggableBlockPlugin.js +2 -2
- package/dist/esm/{packages/lexical/src/editor → editor}/LexicalEditor.js +2 -2
- package/dist/esm/{packages/lexical/src/hooks → hooks}/useFormatWatcher.js +54 -56
- package/dist/esm/{packages/lexical/src/plugins → plugins}/CommentPlugin.js +10 -16
- package/dist/esm/{packages/lexical/src/plugins → plugins}/DraggableBlockPlugin.js +2 -2
- package/dist/types/editor/LexicalEditor.d.ts +1 -1
- package/dist/types/plugins/CommentPlugin.d.ts +1 -1
- package/dist/types/plugins/DraggableBlockPlugin.d.ts +1 -1
- package/package.json +14 -13
- package/src/editor/LexicalEditor.tsx +2 -2
- package/src/hooks/useFormatWatcher.ts +0 -2
- package/src/plugins/CommentPlugin.tsx +3 -3
- package/src/plugins/DraggableBlockPlugin.tsx +3 -3
- package/dist/cjs/node_modules/date-fns/_lib/addLeadingZeros.js +0 -9
- package/dist/cjs/node_modules/date-fns/_lib/defaultOptions.js +0 -9
- package/dist/cjs/node_modules/date-fns/_lib/format/formatters.js +0 -779
- package/dist/cjs/node_modules/date-fns/_lib/format/lightFormatters.js +0 -96
- package/dist/cjs/node_modules/date-fns/_lib/format/longFormatters.js +0 -68
- package/dist/cjs/node_modules/date-fns/_lib/getRoundingMethod.js +0 -12
- package/dist/cjs/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +0 -33
- package/dist/cjs/node_modules/date-fns/_lib/normalizeDates.js +0 -13
- package/dist/cjs/node_modules/date-fns/_lib/normalizeInterval.js +0 -10
- package/dist/cjs/node_modules/date-fns/_lib/protectedTokens.js +0 -29
- package/dist/cjs/node_modules/date-fns/add.js +0 -73
- package/dist/cjs/node_modules/date-fns/addDays.js +0 -46
- package/dist/cjs/node_modules/date-fns/addHours.js +0 -39
- package/dist/cjs/node_modules/date-fns/addMilliseconds.js +0 -39
- package/dist/cjs/node_modules/date-fns/addMinutes.js +0 -41
- package/dist/cjs/node_modules/date-fns/addMonths.js +0 -80
- package/dist/cjs/node_modules/date-fns/addQuarters.js +0 -38
- package/dist/cjs/node_modules/date-fns/addWeeks.js +0 -38
- package/dist/cjs/node_modules/date-fns/addYears.js +0 -38
- package/dist/cjs/node_modules/date-fns/compareAsc.js +0 -50
- package/dist/cjs/node_modules/date-fns/constants.js +0 -66
- package/dist/cjs/node_modules/date-fns/constructFrom.js +0 -54
- package/dist/cjs/node_modules/date-fns/differenceInCalendarDays.js +0 -67
- package/dist/cjs/node_modules/date-fns/differenceInCalendarMonths.js +0 -47
- package/dist/cjs/node_modules/date-fns/differenceInCalendarYears.js +0 -43
- package/dist/cjs/node_modules/date-fns/differenceInDays.js +0 -112
- package/dist/cjs/node_modules/date-fns/differenceInHours.js +0 -46
- package/dist/cjs/node_modules/date-fns/differenceInMilliseconds.js +0 -34
- package/dist/cjs/node_modules/date-fns/differenceInMinutes.js +0 -50
- package/dist/cjs/node_modules/date-fns/differenceInMonths.js +0 -65
- package/dist/cjs/node_modules/date-fns/differenceInSeconds.js +0 -41
- package/dist/cjs/node_modules/date-fns/differenceInYears.js +0 -67
- package/dist/cjs/node_modules/date-fns/endOfDay.js +0 -40
- package/dist/cjs/node_modules/date-fns/endOfDecade.js +0 -45
- package/dist/cjs/node_modules/date-fns/endOfHour.js +0 -40
- package/dist/cjs/node_modules/date-fns/endOfMinute.js +0 -40
- package/dist/cjs/node_modules/date-fns/endOfMonth.js +0 -42
- package/dist/cjs/node_modules/date-fns/endOfQuarter.js +0 -43
- package/dist/cjs/node_modules/date-fns/endOfWeek.js +0 -58
- package/dist/cjs/node_modules/date-fns/endOfYear.js +0 -42
- package/dist/cjs/node_modules/date-fns/format.js +0 -431
- package/dist/cjs/node_modules/date-fns/getDayOfYear.js +0 -39
- package/dist/cjs/node_modules/date-fns/getISOWeek.js +0 -45
- package/dist/cjs/node_modules/date-fns/getISOWeekYear.js +0 -57
- package/dist/cjs/node_modules/date-fns/getWeek.js +0 -59
- package/dist/cjs/node_modules/date-fns/getWeekYear.js +0 -80
- package/dist/cjs/node_modules/date-fns/intervalToDuration.js +0 -70
- package/dist/cjs/node_modules/date-fns/isAfter.js +0 -30
- package/dist/cjs/node_modules/date-fns/isBefore.js +0 -30
- package/dist/cjs/node_modules/date-fns/isDate.js +0 -46
- package/dist/cjs/node_modules/date-fns/isLastDayOfMonth.js +0 -33
- package/dist/cjs/node_modules/date-fns/isSameMonth.js +0 -48
- package/dist/cjs/node_modules/date-fns/isSameWeek.js +0 -56
- package/dist/cjs/node_modules/date-fns/isSameYear.js +0 -40
- package/dist/cjs/node_modules/date-fns/isValid.js +0 -44
- package/dist/cjs/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -12
- package/dist/cjs/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -66
- package/dist/cjs/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -61
- package/dist/cjs/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -24
- package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/formatDistance.js +0 -139
- package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/formatLong.js +0 -43
- package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/formatRelative.js +0 -15
- package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/localize.js +0 -166
- package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/match.js +0 -146
- package/dist/cjs/node_modules/date-fns/locale/ar-SA.js +0 -32
- package/dist/cjs/node_modules/date-fns/locale/de/_lib/formatDistance.js +0 -200
- package/dist/cjs/node_modules/date-fns/locale/de/_lib/formatLong.js +0 -44
- package/dist/cjs/node_modules/date-fns/locale/de/_lib/formatRelative.js +0 -15
- package/dist/cjs/node_modules/date-fns/locale/de/_lib/localize.js +0 -195
- package/dist/cjs/node_modules/date-fns/locale/de/_lib/match.js +0 -138
- package/dist/cjs/node_modules/date-fns/locale/de.js +0 -36
- package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +0 -105
- package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -43
- package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +0 -15
- package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -191
- package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/match.js +0 -136
- package/dist/cjs/node_modules/date-fns/locale/en-US.js +0 -33
- package/dist/cjs/node_modules/date-fns/locale/es/_lib/formatDistance.js +0 -105
- package/dist/cjs/node_modules/date-fns/locale/es/_lib/formatLong.js +0 -43
- package/dist/cjs/node_modules/date-fns/locale/es/_lib/formatRelative.js +0 -29
- package/dist/cjs/node_modules/date-fns/locale/es/_lib/localize.js +0 -168
- package/dist/cjs/node_modules/date-fns/locale/es/_lib/match.js +0 -142
- package/dist/cjs/node_modules/date-fns/locale/es.js +0 -36
- package/dist/cjs/node_modules/date-fns/locale/fr/_lib/formatDistance.js +0 -104
- package/dist/cjs/node_modules/date-fns/locale/fr/_lib/formatLong.js +0 -43
- package/dist/cjs/node_modules/date-fns/locale/fr/_lib/formatRelative.js +0 -15
- package/dist/cjs/node_modules/date-fns/locale/fr/_lib/localize.js +0 -169
- package/dist/cjs/node_modules/date-fns/locale/fr/_lib/match.js +0 -137
- package/dist/cjs/node_modules/date-fns/locale/fr.js +0 -33
- package/dist/cjs/node_modules/date-fns/locale/hi/_lib/formatDistance.js +0 -109
- package/dist/cjs/node_modules/date-fns/locale/hi/_lib/formatLong.js +0 -43
- package/dist/cjs/node_modules/date-fns/locale/hi/_lib/formatRelative.js +0 -15
- package/dist/cjs/node_modules/date-fns/locale/hi/_lib/localize.js +0 -233
- package/dist/cjs/node_modules/date-fns/locale/hi/_lib/match.js +0 -141
- package/dist/cjs/node_modules/date-fns/locale/hi.js +0 -32
- package/dist/cjs/node_modules/date-fns/locale/it/_lib/formatDistance.js +0 -105
- package/dist/cjs/node_modules/date-fns/locale/it/_lib/formatLong.js +0 -43
- package/dist/cjs/node_modules/date-fns/locale/it/_lib/formatRelative.js +0 -70
- package/dist/cjs/node_modules/date-fns/locale/it/_lib/localize.js +0 -168
- package/dist/cjs/node_modules/date-fns/locale/it/_lib/match.js +0 -137
- package/dist/cjs/node_modules/date-fns/locale/it.js +0 -34
- package/dist/cjs/node_modules/date-fns/locale/ja/_lib/formatDistance.js +0 -119
- package/dist/cjs/node_modules/date-fns/locale/ja/_lib/formatLong.js +0 -43
- package/dist/cjs/node_modules/date-fns/locale/ja/_lib/formatRelative.js +0 -16
- package/dist/cjs/node_modules/date-fns/locale/ja/_lib/localize.js +0 -181
- package/dist/cjs/node_modules/date-fns/locale/ja/_lib/match.js +0 -122
- package/dist/cjs/node_modules/date-fns/locale/ja.js +0 -36
- package/dist/cjs/node_modules/date-fns/locale/ko/_lib/formatDistance.js +0 -105
- package/dist/cjs/node_modules/date-fns/locale/ko/_lib/formatLong.js +0 -43
- package/dist/cjs/node_modules/date-fns/locale/ko/_lib/formatRelative.js +0 -15
- package/dist/cjs/node_modules/date-fns/locale/ko/_lib/localize.js +0 -171
- package/dist/cjs/node_modules/date-fns/locale/ko/_lib/match.js +0 -119
- package/dist/cjs/node_modules/date-fns/locale/ko.js +0 -34
- package/dist/cjs/node_modules/date-fns/locale/pt/_lib/formatDistance.js +0 -105
- package/dist/cjs/node_modules/date-fns/locale/pt/_lib/formatLong.js +0 -43
- package/dist/cjs/node_modules/date-fns/locale/pt/_lib/formatRelative.js +0 -26
- package/dist/cjs/node_modules/date-fns/locale/pt/_lib/localize.js +0 -168
- package/dist/cjs/node_modules/date-fns/locale/pt/_lib/match.js +0 -141
- package/dist/cjs/node_modules/date-fns/locale/pt.js +0 -33
- package/dist/cjs/node_modules/date-fns/locale/ru/_lib/formatDistance.js +0 -250
- package/dist/cjs/node_modules/date-fns/locale/ru/_lib/formatLong.js +0 -40
- package/dist/cjs/node_modules/date-fns/locale/ru/_lib/formatRelative.js +0 -92
- package/dist/cjs/node_modules/date-fns/locale/ru/_lib/localize.js +0 -214
- package/dist/cjs/node_modules/date-fns/locale/ru/_lib/match.js +0 -142
- package/dist/cjs/node_modules/date-fns/locale/ru.js +0 -33
- package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/formatDistance.js +0 -105
- package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/formatLong.js +0 -43
- package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/formatRelative.js +0 -35
- package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/localize.js +0 -187
- package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/match.js +0 -134
- package/dist/cjs/node_modules/date-fns/locale/zh-CN.js +0 -36
- package/dist/cjs/node_modules/date-fns/startOfDay.js +0 -40
- package/dist/cjs/node_modules/date-fns/startOfDecade.js +0 -45
- package/dist/cjs/node_modules/date-fns/startOfHour.js +0 -40
- package/dist/cjs/node_modules/date-fns/startOfISOWeek.js +0 -40
- package/dist/cjs/node_modules/date-fns/startOfISOWeekYear.js +0 -47
- package/dist/cjs/node_modules/date-fns/startOfMinute.js +0 -40
- package/dist/cjs/node_modules/date-fns/startOfMonth.js +0 -42
- package/dist/cjs/node_modules/date-fns/startOfQuarter.js +0 -43
- package/dist/cjs/node_modules/date-fns/startOfWeek.js +0 -58
- package/dist/cjs/node_modules/date-fns/startOfWeekYear.js +0 -69
- package/dist/cjs/node_modules/date-fns/startOfYear.js +0 -41
- package/dist/cjs/node_modules/date-fns/toDate.js +0 -51
- package/dist/cjs/packages/date/dist/esm/display/DateDuration.js +0 -178
- package/dist/cjs/packages/date/dist/esm/hijri/DateConverter.js +0 -154
- package/dist/cjs/packages/date/dist/esm/hijri/FormatDate.js +0 -116
- package/dist/cjs/packages/date/dist/esm/hijri/HijriDate.js +0 -531
- package/dist/cjs/packages/date/dist/esm/hijri/StringDateParser.js +0 -74
- package/dist/cjs/packages/date/dist/esm/hijri/index.js +0 -21
- package/dist/cjs/packages/date/dist/esm/hijri/initializer.js +0 -113
- package/dist/cjs/packages/date/dist/esm/hijri/locales.js +0 -19
- package/dist/cjs/packages/date/dist/esm/hijri/safe.js +0 -17
- package/dist/cjs/packages/date/dist/esm/i18n/ar/date.json.js +0 -213
- package/dist/cjs/packages/date/dist/esm/i18n/en/date.json.js +0 -83
- package/dist/cjs/packages/date/dist/esm/i18n/index.js +0 -33
- package/dist/cjs/packages/date/dist/esm/types/index.js +0 -46
- package/dist/cjs/packages/date/dist/esm/utils/dateUtil.js +0 -472
- package/dist/esm/node_modules/date-fns/_lib/addLeadingZeros.js +0 -9
- package/dist/esm/node_modules/date-fns/_lib/defaultOptions.js +0 -9
- package/dist/esm/node_modules/date-fns/_lib/format/formatters.js +0 -779
- package/dist/esm/node_modules/date-fns/_lib/format/lightFormatters.js +0 -96
- package/dist/esm/node_modules/date-fns/_lib/format/longFormatters.js +0 -68
- package/dist/esm/node_modules/date-fns/_lib/getRoundingMethod.js +0 -12
- package/dist/esm/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +0 -33
- package/dist/esm/node_modules/date-fns/_lib/normalizeDates.js +0 -13
- package/dist/esm/node_modules/date-fns/_lib/normalizeInterval.js +0 -10
- package/dist/esm/node_modules/date-fns/_lib/protectedTokens.js +0 -27
- package/dist/esm/node_modules/date-fns/add.js +0 -70
- package/dist/esm/node_modules/date-fns/addDays.js +0 -43
- package/dist/esm/node_modules/date-fns/addHours.js +0 -36
- package/dist/esm/node_modules/date-fns/addMilliseconds.js +0 -36
- package/dist/esm/node_modules/date-fns/addMinutes.js +0 -38
- package/dist/esm/node_modules/date-fns/addMonths.js +0 -77
- package/dist/esm/node_modules/date-fns/addQuarters.js +0 -35
- package/dist/esm/node_modules/date-fns/addWeeks.js +0 -35
- package/dist/esm/node_modules/date-fns/addYears.js +0 -35
- package/dist/esm/node_modules/date-fns/compareAsc.js +0 -47
- package/dist/esm/node_modules/date-fns/constants.js +0 -62
- package/dist/esm/node_modules/date-fns/constructFrom.js +0 -51
- package/dist/esm/node_modules/date-fns/differenceInCalendarDays.js +0 -64
- package/dist/esm/node_modules/date-fns/differenceInCalendarMonths.js +0 -44
- package/dist/esm/node_modules/date-fns/differenceInCalendarYears.js +0 -40
- package/dist/esm/node_modules/date-fns/differenceInDays.js +0 -109
- package/dist/esm/node_modules/date-fns/differenceInHours.js +0 -43
- package/dist/esm/node_modules/date-fns/differenceInMilliseconds.js +0 -31
- package/dist/esm/node_modules/date-fns/differenceInMinutes.js +0 -47
- package/dist/esm/node_modules/date-fns/differenceInMonths.js +0 -62
- package/dist/esm/node_modules/date-fns/differenceInSeconds.js +0 -38
- package/dist/esm/node_modules/date-fns/differenceInYears.js +0 -64
- package/dist/esm/node_modules/date-fns/endOfDay.js +0 -37
- package/dist/esm/node_modules/date-fns/endOfDecade.js +0 -42
- package/dist/esm/node_modules/date-fns/endOfHour.js +0 -37
- package/dist/esm/node_modules/date-fns/endOfMinute.js +0 -37
- package/dist/esm/node_modules/date-fns/endOfMonth.js +0 -39
- package/dist/esm/node_modules/date-fns/endOfQuarter.js +0 -40
- package/dist/esm/node_modules/date-fns/endOfWeek.js +0 -55
- package/dist/esm/node_modules/date-fns/endOfYear.js +0 -39
- package/dist/esm/node_modules/date-fns/format.js +0 -425
- package/dist/esm/node_modules/date-fns/getDayOfYear.js +0 -36
- package/dist/esm/node_modules/date-fns/getISOWeek.js +0 -42
- package/dist/esm/node_modules/date-fns/getISOWeekYear.js +0 -54
- package/dist/esm/node_modules/date-fns/getWeek.js +0 -56
- package/dist/esm/node_modules/date-fns/getWeekYear.js +0 -77
- package/dist/esm/node_modules/date-fns/intervalToDuration.js +0 -67
- package/dist/esm/node_modules/date-fns/isAfter.js +0 -27
- package/dist/esm/node_modules/date-fns/isBefore.js +0 -27
- package/dist/esm/node_modules/date-fns/isDate.js +0 -43
- package/dist/esm/node_modules/date-fns/isLastDayOfMonth.js +0 -30
- package/dist/esm/node_modules/date-fns/isSameMonth.js +0 -45
- package/dist/esm/node_modules/date-fns/isSameWeek.js +0 -53
- package/dist/esm/node_modules/date-fns/isSameYear.js +0 -37
- package/dist/esm/node_modules/date-fns/isValid.js +0 -41
- package/dist/esm/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -12
- package/dist/esm/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -66
- package/dist/esm/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -61
- package/dist/esm/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -24
- package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/formatDistance.js +0 -139
- package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/formatLong.js +0 -43
- package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/formatRelative.js +0 -15
- package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/localize.js +0 -166
- package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/match.js +0 -146
- package/dist/esm/node_modules/date-fns/locale/ar-SA.js +0 -29
- package/dist/esm/node_modules/date-fns/locale/de/_lib/formatDistance.js +0 -200
- package/dist/esm/node_modules/date-fns/locale/de/_lib/formatLong.js +0 -44
- package/dist/esm/node_modules/date-fns/locale/de/_lib/formatRelative.js +0 -15
- package/dist/esm/node_modules/date-fns/locale/de/_lib/localize.js +0 -195
- package/dist/esm/node_modules/date-fns/locale/de/_lib/match.js +0 -138
- package/dist/esm/node_modules/date-fns/locale/de.js +0 -33
- package/dist/esm/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +0 -105
- package/dist/esm/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -43
- package/dist/esm/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +0 -15
- package/dist/esm/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -191
- package/dist/esm/node_modules/date-fns/locale/en-US/_lib/match.js +0 -136
- package/dist/esm/node_modules/date-fns/locale/en-US.js +0 -30
- package/dist/esm/node_modules/date-fns/locale/es/_lib/formatDistance.js +0 -105
- package/dist/esm/node_modules/date-fns/locale/es/_lib/formatLong.js +0 -43
- package/dist/esm/node_modules/date-fns/locale/es/_lib/formatRelative.js +0 -29
- package/dist/esm/node_modules/date-fns/locale/es/_lib/localize.js +0 -168
- package/dist/esm/node_modules/date-fns/locale/es/_lib/match.js +0 -142
- package/dist/esm/node_modules/date-fns/locale/es.js +0 -33
- package/dist/esm/node_modules/date-fns/locale/fr/_lib/formatDistance.js +0 -104
- package/dist/esm/node_modules/date-fns/locale/fr/_lib/formatLong.js +0 -43
- package/dist/esm/node_modules/date-fns/locale/fr/_lib/formatRelative.js +0 -15
- package/dist/esm/node_modules/date-fns/locale/fr/_lib/localize.js +0 -169
- package/dist/esm/node_modules/date-fns/locale/fr/_lib/match.js +0 -137
- package/dist/esm/node_modules/date-fns/locale/fr.js +0 -30
- package/dist/esm/node_modules/date-fns/locale/hi/_lib/formatDistance.js +0 -109
- package/dist/esm/node_modules/date-fns/locale/hi/_lib/formatLong.js +0 -43
- package/dist/esm/node_modules/date-fns/locale/hi/_lib/formatRelative.js +0 -15
- package/dist/esm/node_modules/date-fns/locale/hi/_lib/localize.js +0 -231
- package/dist/esm/node_modules/date-fns/locale/hi/_lib/match.js +0 -141
- package/dist/esm/node_modules/date-fns/locale/hi.js +0 -29
- package/dist/esm/node_modules/date-fns/locale/it/_lib/formatDistance.js +0 -105
- package/dist/esm/node_modules/date-fns/locale/it/_lib/formatLong.js +0 -43
- package/dist/esm/node_modules/date-fns/locale/it/_lib/formatRelative.js +0 -70
- package/dist/esm/node_modules/date-fns/locale/it/_lib/localize.js +0 -168
- package/dist/esm/node_modules/date-fns/locale/it/_lib/match.js +0 -137
- package/dist/esm/node_modules/date-fns/locale/it.js +0 -31
- package/dist/esm/node_modules/date-fns/locale/ja/_lib/formatDistance.js +0 -119
- package/dist/esm/node_modules/date-fns/locale/ja/_lib/formatLong.js +0 -43
- package/dist/esm/node_modules/date-fns/locale/ja/_lib/formatRelative.js +0 -16
- package/dist/esm/node_modules/date-fns/locale/ja/_lib/localize.js +0 -181
- package/dist/esm/node_modules/date-fns/locale/ja/_lib/match.js +0 -122
- package/dist/esm/node_modules/date-fns/locale/ja.js +0 -33
- package/dist/esm/node_modules/date-fns/locale/ko/_lib/formatDistance.js +0 -105
- package/dist/esm/node_modules/date-fns/locale/ko/_lib/formatLong.js +0 -43
- package/dist/esm/node_modules/date-fns/locale/ko/_lib/formatRelative.js +0 -15
- package/dist/esm/node_modules/date-fns/locale/ko/_lib/localize.js +0 -171
- package/dist/esm/node_modules/date-fns/locale/ko/_lib/match.js +0 -119
- package/dist/esm/node_modules/date-fns/locale/ko.js +0 -31
- package/dist/esm/node_modules/date-fns/locale/pt/_lib/formatDistance.js +0 -105
- package/dist/esm/node_modules/date-fns/locale/pt/_lib/formatLong.js +0 -43
- package/dist/esm/node_modules/date-fns/locale/pt/_lib/formatRelative.js +0 -26
- package/dist/esm/node_modules/date-fns/locale/pt/_lib/localize.js +0 -168
- package/dist/esm/node_modules/date-fns/locale/pt/_lib/match.js +0 -141
- package/dist/esm/node_modules/date-fns/locale/pt.js +0 -30
- package/dist/esm/node_modules/date-fns/locale/ru/_lib/formatDistance.js +0 -250
- package/dist/esm/node_modules/date-fns/locale/ru/_lib/formatLong.js +0 -40
- package/dist/esm/node_modules/date-fns/locale/ru/_lib/formatRelative.js +0 -92
- package/dist/esm/node_modules/date-fns/locale/ru/_lib/localize.js +0 -214
- package/dist/esm/node_modules/date-fns/locale/ru/_lib/match.js +0 -142
- package/dist/esm/node_modules/date-fns/locale/ru.js +0 -30
- package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/formatDistance.js +0 -105
- package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/formatLong.js +0 -43
- package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/formatRelative.js +0 -35
- package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/localize.js +0 -187
- package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/match.js +0 -134
- package/dist/esm/node_modules/date-fns/locale/zh-CN.js +0 -33
- package/dist/esm/node_modules/date-fns/startOfDay.js +0 -37
- package/dist/esm/node_modules/date-fns/startOfDecade.js +0 -42
- package/dist/esm/node_modules/date-fns/startOfHour.js +0 -37
- package/dist/esm/node_modules/date-fns/startOfISOWeek.js +0 -37
- package/dist/esm/node_modules/date-fns/startOfISOWeekYear.js +0 -44
- package/dist/esm/node_modules/date-fns/startOfMinute.js +0 -37
- package/dist/esm/node_modules/date-fns/startOfMonth.js +0 -39
- package/dist/esm/node_modules/date-fns/startOfQuarter.js +0 -40
- package/dist/esm/node_modules/date-fns/startOfWeek.js +0 -55
- package/dist/esm/node_modules/date-fns/startOfWeekYear.js +0 -66
- package/dist/esm/node_modules/date-fns/startOfYear.js +0 -38
- package/dist/esm/node_modules/date-fns/toDate.js +0 -48
- package/dist/esm/packages/date/dist/esm/display/DateDuration.js +0 -178
- package/dist/esm/packages/date/dist/esm/hijri/DateConverter.js +0 -152
- package/dist/esm/packages/date/dist/esm/hijri/FormatDate.js +0 -113
- package/dist/esm/packages/date/dist/esm/hijri/HijriDate.js +0 -528
- package/dist/esm/packages/date/dist/esm/hijri/StringDateParser.js +0 -74
- package/dist/esm/packages/date/dist/esm/hijri/index.js +0 -21
- package/dist/esm/packages/date/dist/esm/hijri/initializer.js +0 -113
- package/dist/esm/packages/date/dist/esm/hijri/locales.js +0 -18
- package/dist/esm/packages/date/dist/esm/hijri/safe.js +0 -14
- package/dist/esm/packages/date/dist/esm/i18n/ar/date.json.js +0 -209
- package/dist/esm/packages/date/dist/esm/i18n/en/date.json.js +0 -79
- package/dist/esm/packages/date/dist/esm/i18n/index.js +0 -33
- package/dist/esm/packages/date/dist/esm/types/index.js +0 -45
- package/dist/esm/packages/date/dist/esm/utils/dateUtil.js +0 -474
- /package/dist/cjs/{packages/lexical/src/editor → editor}/theme.js +0 -0
- /package/dist/cjs/{packages/lexical/src/i18n → i18n}/ar/lexical.json.js +0 -0
- /package/dist/cjs/{packages/lexical/src/i18n → i18n}/en/lexical.json.js +0 -0
- /package/dist/cjs/{packages/lexical/src/i18n → i18n}/index.js +0 -0
- /package/dist/cjs/{packages/lexical/src/index.js → index.js} +0 -0
- /package/dist/cjs/{packages/lexical/src/plugins → plugins}/ToolbarPlugin.js +0 -0
- /package/dist/cjs/{packages/lexical/src/utils → utils}/index.js +0 -0
- /package/dist/esm/{packages/lexical/src/editor → editor}/theme.js +0 -0
- /package/dist/esm/{packages/lexical/src/i18n → i18n}/ar/lexical.json.js +0 -0
- /package/dist/esm/{packages/lexical/src/i18n → i18n}/en/lexical.json.js +0 -0
- /package/dist/esm/{packages/lexical/src/i18n → i18n}/index.js +0 -0
- /package/dist/esm/{packages/lexical/src/index.js → index.js} +0 -0
- /package/dist/esm/{packages/lexical/src/plugins → plugins}/ToolbarPlugin.js +0 -0
- /package/dist/esm/{packages/lexical/src/utils → utils}/index.js +0 -0
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { buildLocalizeFn } from '../../_lib/buildLocalizeFn.js';
|
|
4
|
-
|
|
5
|
-
const eraValues = {
|
|
6
|
-
narrow: ["前", "公元"],
|
|
7
|
-
abbreviated: ["前", "公元"],
|
|
8
|
-
wide: ["公元前", "公元"],
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const quarterValues = {
|
|
12
|
-
narrow: ["1", "2", "3", "4"],
|
|
13
|
-
abbreviated: ["第一季", "第二季", "第三季", "第四季"],
|
|
14
|
-
wide: ["第一季度", "第二季度", "第三季度", "第四季度"],
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const monthValues = {
|
|
18
|
-
narrow: [
|
|
19
|
-
"一",
|
|
20
|
-
"二",
|
|
21
|
-
"三",
|
|
22
|
-
"四",
|
|
23
|
-
"五",
|
|
24
|
-
"六",
|
|
25
|
-
"七",
|
|
26
|
-
"八",
|
|
27
|
-
"九",
|
|
28
|
-
"十",
|
|
29
|
-
"十一",
|
|
30
|
-
"十二",
|
|
31
|
-
],
|
|
32
|
-
|
|
33
|
-
abbreviated: [
|
|
34
|
-
"1月",
|
|
35
|
-
"2月",
|
|
36
|
-
"3月",
|
|
37
|
-
"4月",
|
|
38
|
-
"5月",
|
|
39
|
-
"6月",
|
|
40
|
-
"7月",
|
|
41
|
-
"8月",
|
|
42
|
-
"9月",
|
|
43
|
-
"10月",
|
|
44
|
-
"11月",
|
|
45
|
-
"12月",
|
|
46
|
-
],
|
|
47
|
-
|
|
48
|
-
wide: [
|
|
49
|
-
"一月",
|
|
50
|
-
"二月",
|
|
51
|
-
"三月",
|
|
52
|
-
"四月",
|
|
53
|
-
"五月",
|
|
54
|
-
"六月",
|
|
55
|
-
"七月",
|
|
56
|
-
"八月",
|
|
57
|
-
"九月",
|
|
58
|
-
"十月",
|
|
59
|
-
"十一月",
|
|
60
|
-
"十二月",
|
|
61
|
-
],
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const dayValues = {
|
|
65
|
-
narrow: ["日", "一", "二", "三", "四", "五", "六"],
|
|
66
|
-
short: ["日", "一", "二", "三", "四", "五", "六"],
|
|
67
|
-
abbreviated: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
|
|
68
|
-
|
|
69
|
-
wide: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const dayPeriodValues = {
|
|
73
|
-
narrow: {
|
|
74
|
-
am: "上",
|
|
75
|
-
pm: "下",
|
|
76
|
-
midnight: "凌晨",
|
|
77
|
-
noon: "午",
|
|
78
|
-
morning: "早",
|
|
79
|
-
afternoon: "下午",
|
|
80
|
-
evening: "晚",
|
|
81
|
-
night: "夜",
|
|
82
|
-
},
|
|
83
|
-
abbreviated: {
|
|
84
|
-
am: "上午",
|
|
85
|
-
pm: "下午",
|
|
86
|
-
midnight: "凌晨",
|
|
87
|
-
noon: "中午",
|
|
88
|
-
morning: "早晨",
|
|
89
|
-
afternoon: "中午",
|
|
90
|
-
evening: "晚上",
|
|
91
|
-
night: "夜间",
|
|
92
|
-
},
|
|
93
|
-
wide: {
|
|
94
|
-
am: "上午",
|
|
95
|
-
pm: "下午",
|
|
96
|
-
midnight: "凌晨",
|
|
97
|
-
noon: "中午",
|
|
98
|
-
morning: "早晨",
|
|
99
|
-
afternoon: "中午",
|
|
100
|
-
evening: "晚上",
|
|
101
|
-
night: "夜间",
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const formattingDayPeriodValues = {
|
|
106
|
-
narrow: {
|
|
107
|
-
am: "上",
|
|
108
|
-
pm: "下",
|
|
109
|
-
midnight: "凌晨",
|
|
110
|
-
noon: "午",
|
|
111
|
-
morning: "早",
|
|
112
|
-
afternoon: "下午",
|
|
113
|
-
evening: "晚",
|
|
114
|
-
night: "夜",
|
|
115
|
-
},
|
|
116
|
-
abbreviated: {
|
|
117
|
-
am: "上午",
|
|
118
|
-
pm: "下午",
|
|
119
|
-
midnight: "凌晨",
|
|
120
|
-
noon: "中午",
|
|
121
|
-
morning: "早晨",
|
|
122
|
-
afternoon: "中午",
|
|
123
|
-
evening: "晚上",
|
|
124
|
-
night: "夜间",
|
|
125
|
-
},
|
|
126
|
-
wide: {
|
|
127
|
-
am: "上午",
|
|
128
|
-
pm: "下午",
|
|
129
|
-
midnight: "凌晨",
|
|
130
|
-
noon: "中午",
|
|
131
|
-
morning: "早晨",
|
|
132
|
-
afternoon: "中午",
|
|
133
|
-
evening: "晚上",
|
|
134
|
-
night: "夜间",
|
|
135
|
-
},
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
const ordinalNumber = (dirtyNumber, options) => {
|
|
139
|
-
const number = Number(dirtyNumber);
|
|
140
|
-
|
|
141
|
-
switch (options?.unit) {
|
|
142
|
-
case "date":
|
|
143
|
-
return number.toString() + "日";
|
|
144
|
-
case "hour":
|
|
145
|
-
return number.toString() + "时";
|
|
146
|
-
case "minute":
|
|
147
|
-
return number.toString() + "分";
|
|
148
|
-
case "second":
|
|
149
|
-
return number.toString() + "秒";
|
|
150
|
-
default:
|
|
151
|
-
return "第 " + number.toString();
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
const localize = {
|
|
156
|
-
ordinalNumber,
|
|
157
|
-
|
|
158
|
-
era: buildLocalizeFn({
|
|
159
|
-
values: eraValues,
|
|
160
|
-
defaultWidth: "wide",
|
|
161
|
-
}),
|
|
162
|
-
|
|
163
|
-
quarter: buildLocalizeFn({
|
|
164
|
-
values: quarterValues,
|
|
165
|
-
defaultWidth: "wide",
|
|
166
|
-
argumentCallback: (quarter) => quarter - 1,
|
|
167
|
-
}),
|
|
168
|
-
|
|
169
|
-
month: buildLocalizeFn({
|
|
170
|
-
values: monthValues,
|
|
171
|
-
defaultWidth: "wide",
|
|
172
|
-
}),
|
|
173
|
-
|
|
174
|
-
day: buildLocalizeFn({
|
|
175
|
-
values: dayValues,
|
|
176
|
-
defaultWidth: "wide",
|
|
177
|
-
}),
|
|
178
|
-
|
|
179
|
-
dayPeriod: buildLocalizeFn({
|
|
180
|
-
values: dayPeriodValues,
|
|
181
|
-
defaultWidth: "wide",
|
|
182
|
-
formattingValues: formattingDayPeriodValues,
|
|
183
|
-
defaultFormattingWidth: "wide",
|
|
184
|
-
}),
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
export { localize };
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { buildMatchFn } from '../../_lib/buildMatchFn.js';
|
|
4
|
-
import { buildMatchPatternFn } from '../../_lib/buildMatchPatternFn.js';
|
|
5
|
-
|
|
6
|
-
const matchOrdinalNumberPattern = /^(第\s*)?\d+(日|时|分|秒)?/i;
|
|
7
|
-
const parseOrdinalNumberPattern = /\d+/i;
|
|
8
|
-
|
|
9
|
-
const matchEraPatterns = {
|
|
10
|
-
narrow: /^(前)/i,
|
|
11
|
-
abbreviated: /^(前)/i,
|
|
12
|
-
wide: /^(公元前|公元)/i,
|
|
13
|
-
};
|
|
14
|
-
const parseEraPatterns = {
|
|
15
|
-
any: [/^(前)/i, /^(公元)/i],
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const matchQuarterPatterns = {
|
|
19
|
-
narrow: /^[1234]/i,
|
|
20
|
-
abbreviated: /^第[一二三四]刻/i,
|
|
21
|
-
wide: /^第[一二三四]刻钟/i,
|
|
22
|
-
};
|
|
23
|
-
const parseQuarterPatterns = {
|
|
24
|
-
any: [/(1|一)/i, /(2|二)/i, /(3|三)/i, /(4|四)/i],
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const matchMonthPatterns = {
|
|
28
|
-
narrow: /^(一|二|三|四|五|六|七|八|九|十[二一])/i,
|
|
29
|
-
abbreviated: /^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,
|
|
30
|
-
wide: /^(一|二|三|四|五|六|七|八|九|十[二一])月/i,
|
|
31
|
-
};
|
|
32
|
-
const parseMonthPatterns = {
|
|
33
|
-
narrow: [
|
|
34
|
-
/^一/i,
|
|
35
|
-
/^二/i,
|
|
36
|
-
/^三/i,
|
|
37
|
-
/^四/i,
|
|
38
|
-
/^五/i,
|
|
39
|
-
/^六/i,
|
|
40
|
-
/^七/i,
|
|
41
|
-
/^八/i,
|
|
42
|
-
/^九/i,
|
|
43
|
-
/^十(?!(一|二))/i,
|
|
44
|
-
/^十一/i,
|
|
45
|
-
/^十二/i,
|
|
46
|
-
],
|
|
47
|
-
|
|
48
|
-
any: [
|
|
49
|
-
/^一|1/i,
|
|
50
|
-
/^二|2/i,
|
|
51
|
-
/^三|3/i,
|
|
52
|
-
/^四|4/i,
|
|
53
|
-
/^五|5/i,
|
|
54
|
-
/^六|6/i,
|
|
55
|
-
/^七|7/i,
|
|
56
|
-
/^八|8/i,
|
|
57
|
-
/^九|9/i,
|
|
58
|
-
/^十(?!(一|二))|10/i,
|
|
59
|
-
/^十一|11/i,
|
|
60
|
-
/^十二|12/i,
|
|
61
|
-
],
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const matchDayPatterns = {
|
|
65
|
-
narrow: /^[一二三四五六日]/i,
|
|
66
|
-
short: /^[一二三四五六日]/i,
|
|
67
|
-
abbreviated: /^周[一二三四五六日]/i,
|
|
68
|
-
wide: /^星期[一二三四五六日]/i,
|
|
69
|
-
};
|
|
70
|
-
const parseDayPatterns = {
|
|
71
|
-
any: [/日/i, /一/i, /二/i, /三/i, /四/i, /五/i, /六/i],
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const matchDayPeriodPatterns = {
|
|
75
|
-
any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i,
|
|
76
|
-
};
|
|
77
|
-
const parseDayPeriodPatterns = {
|
|
78
|
-
any: {
|
|
79
|
-
am: /^上午?/i,
|
|
80
|
-
pm: /^下午?/i,
|
|
81
|
-
midnight: /^午夜/i,
|
|
82
|
-
noon: /^[中正]午/i,
|
|
83
|
-
morning: /^早上/i,
|
|
84
|
-
afternoon: /^下午/i,
|
|
85
|
-
evening: /^晚上?/i,
|
|
86
|
-
night: /^凌晨/i,
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const match = {
|
|
91
|
-
ordinalNumber: buildMatchPatternFn({
|
|
92
|
-
matchPattern: matchOrdinalNumberPattern,
|
|
93
|
-
parsePattern: parseOrdinalNumberPattern,
|
|
94
|
-
valueCallback: (value) => parseInt(value, 10),
|
|
95
|
-
}),
|
|
96
|
-
|
|
97
|
-
era: buildMatchFn({
|
|
98
|
-
matchPatterns: matchEraPatterns,
|
|
99
|
-
defaultMatchWidth: "wide",
|
|
100
|
-
parsePatterns: parseEraPatterns,
|
|
101
|
-
defaultParseWidth: "any",
|
|
102
|
-
}),
|
|
103
|
-
|
|
104
|
-
quarter: buildMatchFn({
|
|
105
|
-
matchPatterns: matchQuarterPatterns,
|
|
106
|
-
defaultMatchWidth: "wide",
|
|
107
|
-
parsePatterns: parseQuarterPatterns,
|
|
108
|
-
defaultParseWidth: "any",
|
|
109
|
-
valueCallback: (index) => index + 1,
|
|
110
|
-
}),
|
|
111
|
-
|
|
112
|
-
month: buildMatchFn({
|
|
113
|
-
matchPatterns: matchMonthPatterns,
|
|
114
|
-
defaultMatchWidth: "wide",
|
|
115
|
-
parsePatterns: parseMonthPatterns,
|
|
116
|
-
defaultParseWidth: "any",
|
|
117
|
-
}),
|
|
118
|
-
|
|
119
|
-
day: buildMatchFn({
|
|
120
|
-
matchPatterns: matchDayPatterns,
|
|
121
|
-
defaultMatchWidth: "wide",
|
|
122
|
-
parsePatterns: parseDayPatterns,
|
|
123
|
-
defaultParseWidth: "any",
|
|
124
|
-
}),
|
|
125
|
-
|
|
126
|
-
dayPeriod: buildMatchFn({
|
|
127
|
-
matchPatterns: matchDayPeriodPatterns,
|
|
128
|
-
defaultMatchWidth: "any",
|
|
129
|
-
parsePatterns: parseDayPeriodPatterns,
|
|
130
|
-
defaultParseWidth: "any",
|
|
131
|
-
}),
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
export { match };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { formatDistance } from './zh-CN/_lib/formatDistance.js';
|
|
4
|
-
import { formatLong } from './zh-CN/_lib/formatLong.js';
|
|
5
|
-
import { formatRelative } from './zh-CN/_lib/formatRelative.js';
|
|
6
|
-
import { localize } from './zh-CN/_lib/localize.js';
|
|
7
|
-
import { match } from './zh-CN/_lib/match.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @category Locales
|
|
11
|
-
* @summary Chinese Simplified locale.
|
|
12
|
-
* @language Chinese Simplified
|
|
13
|
-
* @iso-639-2 zho
|
|
14
|
-
* @author Changyu Geng [@KingMario](https://github.com/KingMario)
|
|
15
|
-
* @author Song Shuoyun [@fnlctrl](https://github.com/fnlctrl)
|
|
16
|
-
* @author sabrinaM [@sabrinamiao](https://github.com/sabrinamiao)
|
|
17
|
-
* @author Carney Wu [@cubicwork](https://github.com/cubicwork)
|
|
18
|
-
* @author Terrence Lam [@skyuplam](https://github.com/skyuplam)
|
|
19
|
-
*/
|
|
20
|
-
const zhCN = {
|
|
21
|
-
code: "zh-CN",
|
|
22
|
-
formatDistance: formatDistance,
|
|
23
|
-
formatLong: formatLong,
|
|
24
|
-
formatRelative: formatRelative,
|
|
25
|
-
localize: localize,
|
|
26
|
-
match: match,
|
|
27
|
-
options: {
|
|
28
|
-
weekStartsOn: 1 /* Monday */,
|
|
29
|
-
firstWeekContainsDate: 4,
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { zhCN as default, zhCN };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { toDate } from './toDate.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The {@link startOfDay} function options.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @name startOfDay
|
|
11
|
-
* @category Day Helpers
|
|
12
|
-
* @summary Return the start of a day for the given date.
|
|
13
|
-
*
|
|
14
|
-
* @description
|
|
15
|
-
* Return the start of a day 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 day
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* // The start of a day for 2 September 2014 11:55:00:
|
|
28
|
-
* const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
|
|
29
|
-
* //=> Tue Sep 02 2014 00:00:00
|
|
30
|
-
*/
|
|
31
|
-
function startOfDay(date, options) {
|
|
32
|
-
const _date = toDate(date, options?.in);
|
|
33
|
-
_date.setHours(0, 0, 0, 0);
|
|
34
|
-
return _date;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { startOfDay as default, startOfDay };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { toDate } from './toDate.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The {@link startOfDecade} options.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @name startOfDecade
|
|
11
|
-
* @category Decade Helpers
|
|
12
|
-
* @summary Return the start of a decade for the given date.
|
|
13
|
-
*
|
|
14
|
-
* @description
|
|
15
|
-
* Return the start of a decade for the given date.
|
|
16
|
-
*
|
|
17
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
18
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
19
|
-
*
|
|
20
|
-
* @param date - The original date
|
|
21
|
-
* @param options - An object with options
|
|
22
|
-
*
|
|
23
|
-
* @returns The start of a decade
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* // The start of a decade for 21 October 2015 00:00:00:
|
|
27
|
-
* const result = startOfDecade(new Date(2015, 9, 21, 00, 00, 00))
|
|
28
|
-
* //=> Jan 01 2010 00:00:00
|
|
29
|
-
*/
|
|
30
|
-
function startOfDecade(date, options) {
|
|
31
|
-
// TODO: Switch to more technical definition in of decades that start with 1
|
|
32
|
-
// end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking
|
|
33
|
-
// change, so it can only be done in 4.0.
|
|
34
|
-
const _date = toDate(date, options?.in);
|
|
35
|
-
const year = _date.getFullYear();
|
|
36
|
-
const decade = Math.floor(year / 10) * 10;
|
|
37
|
-
_date.setFullYear(decade, 0, 1);
|
|
38
|
-
_date.setHours(0, 0, 0, 0);
|
|
39
|
-
return _date;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { startOfDecade as default, startOfDecade };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { toDate } from './toDate.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The {@link startOfHour} function options.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @name startOfHour
|
|
11
|
-
* @category Hour Helpers
|
|
12
|
-
* @summary Return the start of an hour for the given date.
|
|
13
|
-
*
|
|
14
|
-
* @description
|
|
15
|
-
* Return the start of an hour 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 - An object with options
|
|
23
|
-
*
|
|
24
|
-
* @returns The start of an hour
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* // The start of an hour for 2 September 2014 11:55:00:
|
|
28
|
-
* const result = startOfHour(new Date(2014, 8, 2, 11, 55))
|
|
29
|
-
* //=> Tue Sep 02 2014 11:00:00
|
|
30
|
-
*/
|
|
31
|
-
function startOfHour(date, options) {
|
|
32
|
-
const _date = toDate(date, options?.in);
|
|
33
|
-
_date.setMinutes(0, 0, 0);
|
|
34
|
-
return _date;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { startOfHour as default, startOfHour };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { startOfWeek } from './startOfWeek.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The {@link startOfISOWeek} function options.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @name startOfISOWeek
|
|
11
|
-
* @category ISO Week Helpers
|
|
12
|
-
* @summary Return the start of an ISO week for the given date.
|
|
13
|
-
*
|
|
14
|
-
* @description
|
|
15
|
-
* Return the start of an ISO week for the given date.
|
|
16
|
-
* The result will be in the local timezone.
|
|
17
|
-
*
|
|
18
|
-
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
|
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 - An object with options
|
|
25
|
-
*
|
|
26
|
-
* @returns The start of an ISO week
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* // The start of an ISO week for 2 September 2014 11:55:00:
|
|
30
|
-
* const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
|
|
31
|
-
* //=> Mon Sep 01 2014 00:00:00
|
|
32
|
-
*/
|
|
33
|
-
function startOfISOWeek(date, options) {
|
|
34
|
-
return startOfWeek(date, { ...options, weekStartsOn: 1 });
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { startOfISOWeek as default, startOfISOWeek };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { constructFrom } from './constructFrom.js';
|
|
4
|
-
import { getISOWeekYear } from './getISOWeekYear.js';
|
|
5
|
-
import { startOfISOWeek } from './startOfISOWeek.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* The {@link startOfISOWeekYear} function options.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @name startOfISOWeekYear
|
|
13
|
-
* @category ISO Week-Numbering Year Helpers
|
|
14
|
-
* @summary Return the start of an ISO week-numbering year for the given date.
|
|
15
|
-
*
|
|
16
|
-
* @description
|
|
17
|
-
* Return the start of an ISO week-numbering year,
|
|
18
|
-
* which always starts 3 days before the year's first Thursday.
|
|
19
|
-
* The result will be in the local timezone.
|
|
20
|
-
*
|
|
21
|
-
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
|
22
|
-
*
|
|
23
|
-
* @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).
|
|
24
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
25
|
-
*
|
|
26
|
-
* @param date - The original date
|
|
27
|
-
* @param options - An object with options
|
|
28
|
-
*
|
|
29
|
-
* @returns The start of an ISO week-numbering year
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* // The start of an ISO week-numbering year for 2 July 2005:
|
|
33
|
-
* const result = startOfISOWeekYear(new Date(2005, 6, 2))
|
|
34
|
-
* //=> Mon Jan 03 2005 00:00:00
|
|
35
|
-
*/
|
|
36
|
-
function startOfISOWeekYear(date, options) {
|
|
37
|
-
const year = getISOWeekYear(date, options);
|
|
38
|
-
const fourthOfJanuary = constructFrom(options?.in || date, 0);
|
|
39
|
-
fourthOfJanuary.setFullYear(year, 0, 4);
|
|
40
|
-
fourthOfJanuary.setHours(0, 0, 0, 0);
|
|
41
|
-
return startOfISOWeek(fourthOfJanuary);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { startOfISOWeekYear as default, startOfISOWeekYear };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { toDate } from './toDate.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The {@link startOfMinute} function options.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @name startOfMinute
|
|
11
|
-
* @category Minute Helpers
|
|
12
|
-
* @summary Return the start of a minute for the given date.
|
|
13
|
-
*
|
|
14
|
-
* @description
|
|
15
|
-
* Return the start of a minute 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 - An object with options
|
|
23
|
-
*
|
|
24
|
-
* @returns The start of a minute
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* // The start of a minute for 1 December 2014 22:15:45.400:
|
|
28
|
-
* const result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))
|
|
29
|
-
* //=> Mon Dec 01 2014 22:15:00
|
|
30
|
-
*/
|
|
31
|
-
function startOfMinute(date, options) {
|
|
32
|
-
const date_ = toDate(date, options?.in);
|
|
33
|
-
date_.setSeconds(0, 0);
|
|
34
|
-
return date_;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { startOfMinute as default, startOfMinute };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { toDate } from './toDate.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The {@link startOfMonth} function options.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @name startOfMonth
|
|
11
|
-
* @category Month Helpers
|
|
12
|
-
* @summary Return the start of a month for the given date.
|
|
13
|
-
*
|
|
14
|
-
* @description
|
|
15
|
-
* Return the start of a month for the given date. The result will be in the local timezone.
|
|
16
|
-
*
|
|
17
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments.
|
|
18
|
-
* 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,
|
|
20
|
-
* 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 month
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* // The start of a month for 2 September 2014 11:55:00:
|
|
29
|
-
* const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
|
|
30
|
-
* //=> Mon Sep 01 2014 00:00:00
|
|
31
|
-
*/
|
|
32
|
-
function startOfMonth(date, options) {
|
|
33
|
-
const _date = toDate(date, options?.in);
|
|
34
|
-
_date.setDate(1);
|
|
35
|
-
_date.setHours(0, 0, 0, 0);
|
|
36
|
-
return _date;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export { startOfMonth as default, startOfMonth };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { toDate } from './toDate.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The {@link startOfQuarter} function options.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @name startOfQuarter
|
|
11
|
-
* @category Quarter Helpers
|
|
12
|
-
* @summary Return the start of a year quarter for the given date.
|
|
13
|
-
*
|
|
14
|
-
* @description
|
|
15
|
-
* Return the start of a year quarter 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 quarter
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* // The start of a quarter for 2 September 2014 11:55:00:
|
|
28
|
-
* const result = startOfQuarter(new Date(2014, 8, 2, 11, 55, 0))
|
|
29
|
-
* //=> Tue Jul 01 2014 00:00:00
|
|
30
|
-
*/
|
|
31
|
-
function startOfQuarter(date, options) {
|
|
32
|
-
const _date = toDate(date, options?.in);
|
|
33
|
-
const currentMonth = _date.getMonth();
|
|
34
|
-
const month = currentMonth - (currentMonth % 3);
|
|
35
|
-
_date.setMonth(month, 1);
|
|
36
|
-
_date.setHours(0, 0, 0, 0);
|
|
37
|
-
return _date;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { startOfQuarter as default, startOfQuarter };
|