@react-fabric/lexical 1.0.0-beta.60 → 1.0.0-beta.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/_lexical.css +61 -0
- package/dist/cjs/node_modules/date-fns/_lib/addLeadingZeros.js +9 -0
- package/dist/cjs/node_modules/date-fns/_lib/defaultOptions.js +9 -0
- package/dist/cjs/node_modules/date-fns/_lib/format/formatters.js +779 -0
- package/dist/cjs/node_modules/date-fns/_lib/format/lightFormatters.js +96 -0
- package/dist/cjs/node_modules/date-fns/_lib/format/longFormatters.js +68 -0
- package/dist/cjs/node_modules/date-fns/_lib/getRoundingMethod.js +12 -0
- package/dist/cjs/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +33 -0
- package/dist/cjs/node_modules/date-fns/_lib/normalizeDates.js +13 -0
- package/dist/cjs/node_modules/date-fns/_lib/normalizeInterval.js +10 -0
- package/dist/cjs/node_modules/date-fns/_lib/protectedTokens.js +29 -0
- package/dist/cjs/node_modules/date-fns/add.js +73 -0
- package/dist/cjs/node_modules/date-fns/addDays.js +46 -0
- package/dist/cjs/node_modules/date-fns/addHours.js +39 -0
- package/dist/cjs/node_modules/date-fns/addMilliseconds.js +39 -0
- package/dist/cjs/node_modules/date-fns/addMinutes.js +41 -0
- package/dist/cjs/node_modules/date-fns/addMonths.js +80 -0
- package/dist/cjs/node_modules/date-fns/addQuarters.js +38 -0
- package/dist/cjs/node_modules/date-fns/addWeeks.js +38 -0
- package/dist/cjs/node_modules/date-fns/addYears.js +38 -0
- package/dist/cjs/node_modules/date-fns/compareAsc.js +50 -0
- package/dist/cjs/node_modules/date-fns/constants.js +66 -0
- package/dist/cjs/node_modules/date-fns/constructFrom.js +54 -0
- package/dist/cjs/node_modules/date-fns/differenceInCalendarDays.js +67 -0
- package/dist/cjs/node_modules/date-fns/differenceInCalendarMonths.js +47 -0
- package/dist/cjs/node_modules/date-fns/differenceInCalendarYears.js +43 -0
- package/dist/cjs/node_modules/date-fns/differenceInDays.js +112 -0
- package/dist/cjs/node_modules/date-fns/differenceInHours.js +46 -0
- package/dist/cjs/node_modules/date-fns/differenceInMilliseconds.js +34 -0
- package/dist/cjs/node_modules/date-fns/differenceInMinutes.js +50 -0
- package/dist/cjs/node_modules/date-fns/differenceInMonths.js +65 -0
- package/dist/cjs/node_modules/date-fns/differenceInSeconds.js +41 -0
- package/dist/cjs/node_modules/date-fns/differenceInYears.js +67 -0
- package/dist/cjs/node_modules/date-fns/endOfDay.js +40 -0
- package/dist/cjs/node_modules/date-fns/endOfDecade.js +45 -0
- package/dist/cjs/node_modules/date-fns/endOfHour.js +40 -0
- package/dist/cjs/node_modules/date-fns/endOfMinute.js +40 -0
- package/dist/cjs/node_modules/date-fns/endOfMonth.js +42 -0
- package/dist/cjs/node_modules/date-fns/endOfQuarter.js +43 -0
- package/dist/cjs/node_modules/date-fns/endOfWeek.js +58 -0
- package/dist/cjs/node_modules/date-fns/endOfYear.js +42 -0
- package/dist/cjs/node_modules/date-fns/format.js +431 -0
- package/dist/cjs/node_modules/date-fns/getDayOfYear.js +39 -0
- package/dist/cjs/node_modules/date-fns/getISOWeek.js +45 -0
- package/dist/cjs/node_modules/date-fns/getISOWeekYear.js +57 -0
- package/dist/cjs/node_modules/date-fns/getWeek.js +59 -0
- package/dist/cjs/node_modules/date-fns/getWeekYear.js +80 -0
- package/dist/cjs/node_modules/date-fns/intervalToDuration.js +70 -0
- package/dist/cjs/node_modules/date-fns/isAfter.js +30 -0
- package/dist/cjs/node_modules/date-fns/isBefore.js +30 -0
- package/dist/cjs/node_modules/date-fns/isDate.js +46 -0
- package/dist/cjs/node_modules/date-fns/isLastDayOfMonth.js +33 -0
- package/dist/cjs/node_modules/date-fns/isSameMonth.js +48 -0
- package/dist/cjs/node_modules/date-fns/isSameWeek.js +56 -0
- package/dist/cjs/node_modules/date-fns/isSameYear.js +40 -0
- package/dist/cjs/node_modules/date-fns/isValid.js +44 -0
- package/dist/cjs/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +12 -0
- package/dist/cjs/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +66 -0
- package/dist/cjs/node_modules/date-fns/locale/_lib/buildMatchFn.js +61 -0
- package/dist/cjs/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +24 -0
- package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/formatDistance.js +139 -0
- package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/formatLong.js +43 -0
- package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/formatRelative.js +15 -0
- package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/localize.js +166 -0
- package/dist/cjs/node_modules/date-fns/locale/ar-SA/_lib/match.js +146 -0
- package/dist/cjs/node_modules/date-fns/locale/ar-SA.js +32 -0
- package/dist/cjs/node_modules/date-fns/locale/de/_lib/formatDistance.js +200 -0
- package/dist/cjs/node_modules/date-fns/locale/de/_lib/formatLong.js +44 -0
- package/dist/cjs/node_modules/date-fns/locale/de/_lib/formatRelative.js +15 -0
- package/dist/cjs/node_modules/date-fns/locale/de/_lib/localize.js +195 -0
- package/dist/cjs/node_modules/date-fns/locale/de/_lib/match.js +138 -0
- package/dist/cjs/node_modules/date-fns/locale/de.js +36 -0
- package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +105 -0
- package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/formatLong.js +43 -0
- package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +15 -0
- package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/localize.js +191 -0
- package/dist/cjs/node_modules/date-fns/locale/en-US/_lib/match.js +136 -0
- package/dist/cjs/node_modules/date-fns/locale/en-US.js +33 -0
- package/dist/cjs/node_modules/date-fns/locale/es/_lib/formatDistance.js +105 -0
- package/dist/cjs/node_modules/date-fns/locale/es/_lib/formatLong.js +43 -0
- package/dist/cjs/node_modules/date-fns/locale/es/_lib/formatRelative.js +29 -0
- package/dist/cjs/node_modules/date-fns/locale/es/_lib/localize.js +168 -0
- package/dist/cjs/node_modules/date-fns/locale/es/_lib/match.js +142 -0
- package/dist/cjs/node_modules/date-fns/locale/es.js +36 -0
- package/dist/cjs/node_modules/date-fns/locale/fr/_lib/formatDistance.js +104 -0
- package/dist/cjs/node_modules/date-fns/locale/fr/_lib/formatLong.js +43 -0
- package/dist/cjs/node_modules/date-fns/locale/fr/_lib/formatRelative.js +15 -0
- package/dist/cjs/node_modules/date-fns/locale/fr/_lib/localize.js +169 -0
- package/dist/cjs/node_modules/date-fns/locale/fr/_lib/match.js +137 -0
- package/dist/cjs/node_modules/date-fns/locale/fr.js +33 -0
- package/dist/cjs/node_modules/date-fns/locale/hi/_lib/formatDistance.js +109 -0
- package/dist/cjs/node_modules/date-fns/locale/hi/_lib/formatLong.js +43 -0
- package/dist/cjs/node_modules/date-fns/locale/hi/_lib/formatRelative.js +15 -0
- package/dist/cjs/node_modules/date-fns/locale/hi/_lib/localize.js +233 -0
- package/dist/cjs/node_modules/date-fns/locale/hi/_lib/match.js +141 -0
- package/dist/cjs/node_modules/date-fns/locale/hi.js +32 -0
- package/dist/cjs/node_modules/date-fns/locale/it/_lib/formatDistance.js +105 -0
- package/dist/cjs/node_modules/date-fns/locale/it/_lib/formatLong.js +43 -0
- package/dist/cjs/node_modules/date-fns/locale/it/_lib/formatRelative.js +70 -0
- package/dist/cjs/node_modules/date-fns/locale/it/_lib/localize.js +168 -0
- package/dist/cjs/node_modules/date-fns/locale/it/_lib/match.js +137 -0
- package/dist/cjs/node_modules/date-fns/locale/it.js +34 -0
- package/dist/cjs/node_modules/date-fns/locale/ja/_lib/formatDistance.js +119 -0
- package/dist/cjs/node_modules/date-fns/locale/ja/_lib/formatLong.js +43 -0
- package/dist/cjs/node_modules/date-fns/locale/ja/_lib/formatRelative.js +16 -0
- package/dist/cjs/node_modules/date-fns/locale/ja/_lib/localize.js +181 -0
- package/dist/cjs/node_modules/date-fns/locale/ja/_lib/match.js +122 -0
- package/dist/cjs/node_modules/date-fns/locale/ja.js +36 -0
- package/dist/cjs/node_modules/date-fns/locale/ko/_lib/formatDistance.js +105 -0
- package/dist/cjs/node_modules/date-fns/locale/ko/_lib/formatLong.js +43 -0
- package/dist/cjs/node_modules/date-fns/locale/ko/_lib/formatRelative.js +15 -0
- package/dist/cjs/node_modules/date-fns/locale/ko/_lib/localize.js +171 -0
- package/dist/cjs/node_modules/date-fns/locale/ko/_lib/match.js +119 -0
- package/dist/cjs/node_modules/date-fns/locale/ko.js +34 -0
- package/dist/cjs/node_modules/date-fns/locale/pt/_lib/formatDistance.js +105 -0
- package/dist/cjs/node_modules/date-fns/locale/pt/_lib/formatLong.js +43 -0
- package/dist/cjs/node_modules/date-fns/locale/pt/_lib/formatRelative.js +26 -0
- package/dist/cjs/node_modules/date-fns/locale/pt/_lib/localize.js +168 -0
- package/dist/cjs/node_modules/date-fns/locale/pt/_lib/match.js +141 -0
- package/dist/cjs/node_modules/date-fns/locale/pt.js +33 -0
- package/dist/cjs/node_modules/date-fns/locale/ru/_lib/formatDistance.js +250 -0
- package/dist/cjs/node_modules/date-fns/locale/ru/_lib/formatLong.js +40 -0
- package/dist/cjs/node_modules/date-fns/locale/ru/_lib/formatRelative.js +92 -0
- package/dist/cjs/node_modules/date-fns/locale/ru/_lib/localize.js +214 -0
- package/dist/cjs/node_modules/date-fns/locale/ru/_lib/match.js +142 -0
- package/dist/cjs/node_modules/date-fns/locale/ru.js +33 -0
- package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/formatDistance.js +105 -0
- package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/formatLong.js +43 -0
- package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/formatRelative.js +35 -0
- package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/localize.js +187 -0
- package/dist/cjs/node_modules/date-fns/locale/zh-CN/_lib/match.js +134 -0
- package/dist/cjs/node_modules/date-fns/locale/zh-CN.js +36 -0
- package/dist/cjs/node_modules/date-fns/startOfDay.js +40 -0
- package/dist/cjs/node_modules/date-fns/startOfDecade.js +45 -0
- package/dist/cjs/node_modules/date-fns/startOfHour.js +40 -0
- package/dist/cjs/node_modules/date-fns/startOfISOWeek.js +40 -0
- package/dist/cjs/node_modules/date-fns/startOfISOWeekYear.js +47 -0
- package/dist/cjs/node_modules/date-fns/startOfMinute.js +40 -0
- package/dist/cjs/node_modules/date-fns/startOfMonth.js +42 -0
- package/dist/cjs/node_modules/date-fns/startOfQuarter.js +43 -0
- package/dist/cjs/node_modules/date-fns/startOfWeek.js +58 -0
- package/dist/cjs/node_modules/date-fns/startOfWeekYear.js +69 -0
- package/dist/cjs/node_modules/date-fns/startOfYear.js +41 -0
- package/dist/cjs/node_modules/date-fns/toDate.js +51 -0
- package/dist/cjs/packages/date/dist/esm/display/DateDuration.js +178 -0
- package/dist/cjs/packages/date/dist/esm/hijri/DateConverter.js +154 -0
- package/dist/cjs/packages/date/dist/esm/hijri/FormatDate.js +116 -0
- package/dist/cjs/packages/date/dist/esm/hijri/HijriDate.js +531 -0
- package/dist/cjs/packages/date/dist/esm/hijri/StringDateParser.js +74 -0
- package/dist/cjs/packages/date/dist/esm/hijri/index.js +21 -0
- package/dist/cjs/packages/date/dist/esm/hijri/initializer.js +113 -0
- package/dist/cjs/packages/date/dist/esm/hijri/locales.js +19 -0
- package/dist/cjs/packages/date/dist/esm/hijri/safe.js +17 -0
- package/dist/cjs/packages/date/dist/esm/i18n/ar/date.json.js +213 -0
- package/dist/cjs/packages/date/dist/esm/i18n/en/date.json.js +83 -0
- package/{src/plugins/StickyPlugin.ts → dist/cjs/packages/date/dist/esm/i18n/index.js} +10 -15
- package/dist/cjs/packages/date/dist/esm/types/index.js +46 -0
- package/dist/cjs/packages/date/dist/esm/utils/dateUtil.js +472 -0
- package/dist/cjs/packages/lexical/src/editor/LexicalEditor.js +36 -13
- package/dist/cjs/packages/lexical/src/hooks/useFormatWatcher.js +101 -95
- package/dist/cjs/packages/lexical/src/i18n/ar/lexical.json.js +30 -0
- package/dist/cjs/packages/lexical/src/i18n/en/lexical.json.js +30 -0
- package/dist/cjs/packages/lexical/src/i18n/index.js +33 -0
- package/dist/cjs/packages/lexical/src/index.js +1 -0
- package/dist/cjs/packages/lexical/src/plugins/CommentPlugin.js +477 -0
- package/dist/cjs/packages/lexical/src/plugins/DraggableBlockPlugin.js +13 -16
- package/dist/cjs/packages/lexical/src/plugins/ToolbarPlugin.js +35 -22
- package/dist/esm/node_modules/date-fns/_lib/addLeadingZeros.js +9 -0
- package/dist/esm/node_modules/date-fns/_lib/defaultOptions.js +9 -0
- package/dist/esm/node_modules/date-fns/_lib/format/formatters.js +779 -0
- package/dist/esm/node_modules/date-fns/_lib/format/lightFormatters.js +96 -0
- package/dist/esm/node_modules/date-fns/_lib/format/longFormatters.js +68 -0
- package/dist/esm/node_modules/date-fns/_lib/getRoundingMethod.js +12 -0
- package/dist/esm/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +33 -0
- package/dist/esm/node_modules/date-fns/_lib/normalizeDates.js +13 -0
- package/dist/esm/node_modules/date-fns/_lib/normalizeInterval.js +10 -0
- package/dist/esm/node_modules/date-fns/_lib/protectedTokens.js +27 -0
- package/dist/esm/node_modules/date-fns/add.js +70 -0
- package/dist/esm/node_modules/date-fns/addDays.js +43 -0
- package/dist/esm/node_modules/date-fns/addHours.js +36 -0
- package/dist/esm/node_modules/date-fns/addMilliseconds.js +36 -0
- package/dist/esm/node_modules/date-fns/addMinutes.js +38 -0
- package/dist/esm/node_modules/date-fns/addMonths.js +77 -0
- package/dist/esm/node_modules/date-fns/addQuarters.js +35 -0
- package/dist/esm/node_modules/date-fns/addWeeks.js +35 -0
- package/dist/esm/node_modules/date-fns/addYears.js +35 -0
- package/dist/esm/node_modules/date-fns/compareAsc.js +47 -0
- package/dist/esm/node_modules/date-fns/constants.js +62 -0
- package/dist/esm/node_modules/date-fns/constructFrom.js +51 -0
- package/dist/esm/node_modules/date-fns/differenceInCalendarDays.js +64 -0
- package/dist/esm/node_modules/date-fns/differenceInCalendarMonths.js +44 -0
- package/dist/esm/node_modules/date-fns/differenceInCalendarYears.js +40 -0
- package/dist/esm/node_modules/date-fns/differenceInDays.js +109 -0
- package/dist/esm/node_modules/date-fns/differenceInHours.js +43 -0
- package/dist/esm/node_modules/date-fns/differenceInMilliseconds.js +31 -0
- package/dist/esm/node_modules/date-fns/differenceInMinutes.js +47 -0
- package/dist/esm/node_modules/date-fns/differenceInMonths.js +62 -0
- package/dist/esm/node_modules/date-fns/differenceInSeconds.js +38 -0
- package/dist/esm/node_modules/date-fns/differenceInYears.js +64 -0
- package/dist/esm/node_modules/date-fns/endOfDay.js +37 -0
- package/dist/esm/node_modules/date-fns/endOfDecade.js +42 -0
- package/dist/esm/node_modules/date-fns/endOfHour.js +37 -0
- package/dist/esm/node_modules/date-fns/endOfMinute.js +37 -0
- package/dist/esm/node_modules/date-fns/endOfMonth.js +39 -0
- package/dist/esm/node_modules/date-fns/endOfQuarter.js +40 -0
- package/dist/esm/node_modules/date-fns/endOfWeek.js +55 -0
- package/dist/esm/node_modules/date-fns/endOfYear.js +39 -0
- package/dist/esm/node_modules/date-fns/format.js +425 -0
- package/dist/esm/node_modules/date-fns/getDayOfYear.js +36 -0
- package/dist/esm/node_modules/date-fns/getISOWeek.js +42 -0
- package/dist/esm/node_modules/date-fns/getISOWeekYear.js +54 -0
- package/dist/esm/node_modules/date-fns/getWeek.js +56 -0
- package/dist/esm/node_modules/date-fns/getWeekYear.js +77 -0
- package/dist/esm/node_modules/date-fns/intervalToDuration.js +67 -0
- package/dist/esm/node_modules/date-fns/isAfter.js +27 -0
- package/dist/esm/node_modules/date-fns/isBefore.js +27 -0
- package/dist/esm/node_modules/date-fns/isDate.js +43 -0
- package/dist/esm/node_modules/date-fns/isLastDayOfMonth.js +30 -0
- package/dist/esm/node_modules/date-fns/isSameMonth.js +45 -0
- package/dist/esm/node_modules/date-fns/isSameWeek.js +53 -0
- package/dist/esm/node_modules/date-fns/isSameYear.js +37 -0
- package/dist/esm/node_modules/date-fns/isValid.js +41 -0
- package/dist/esm/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +12 -0
- package/dist/esm/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +66 -0
- package/dist/esm/node_modules/date-fns/locale/_lib/buildMatchFn.js +61 -0
- package/dist/esm/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +24 -0
- package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/formatDistance.js +139 -0
- package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/formatLong.js +43 -0
- package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/formatRelative.js +15 -0
- package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/localize.js +166 -0
- package/dist/esm/node_modules/date-fns/locale/ar-SA/_lib/match.js +146 -0
- package/dist/esm/node_modules/date-fns/locale/ar-SA.js +29 -0
- package/dist/esm/node_modules/date-fns/locale/de/_lib/formatDistance.js +200 -0
- package/dist/esm/node_modules/date-fns/locale/de/_lib/formatLong.js +44 -0
- package/dist/esm/node_modules/date-fns/locale/de/_lib/formatRelative.js +15 -0
- package/dist/esm/node_modules/date-fns/locale/de/_lib/localize.js +195 -0
- package/dist/esm/node_modules/date-fns/locale/de/_lib/match.js +138 -0
- package/dist/esm/node_modules/date-fns/locale/de.js +33 -0
- package/dist/esm/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +105 -0
- package/dist/esm/node_modules/date-fns/locale/en-US/_lib/formatLong.js +43 -0
- package/dist/esm/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +15 -0
- package/dist/esm/node_modules/date-fns/locale/en-US/_lib/localize.js +191 -0
- package/dist/esm/node_modules/date-fns/locale/en-US/_lib/match.js +136 -0
- package/dist/esm/node_modules/date-fns/locale/en-US.js +30 -0
- package/dist/esm/node_modules/date-fns/locale/es/_lib/formatDistance.js +105 -0
- package/dist/esm/node_modules/date-fns/locale/es/_lib/formatLong.js +43 -0
- package/dist/esm/node_modules/date-fns/locale/es/_lib/formatRelative.js +29 -0
- package/dist/esm/node_modules/date-fns/locale/es/_lib/localize.js +168 -0
- package/dist/esm/node_modules/date-fns/locale/es/_lib/match.js +142 -0
- package/dist/esm/node_modules/date-fns/locale/es.js +33 -0
- package/dist/esm/node_modules/date-fns/locale/fr/_lib/formatDistance.js +104 -0
- package/dist/esm/node_modules/date-fns/locale/fr/_lib/formatLong.js +43 -0
- package/dist/esm/node_modules/date-fns/locale/fr/_lib/formatRelative.js +15 -0
- package/dist/esm/node_modules/date-fns/locale/fr/_lib/localize.js +169 -0
- package/dist/esm/node_modules/date-fns/locale/fr/_lib/match.js +137 -0
- package/dist/esm/node_modules/date-fns/locale/fr.js +30 -0
- package/dist/esm/node_modules/date-fns/locale/hi/_lib/formatDistance.js +109 -0
- package/dist/esm/node_modules/date-fns/locale/hi/_lib/formatLong.js +43 -0
- package/dist/esm/node_modules/date-fns/locale/hi/_lib/formatRelative.js +15 -0
- package/dist/esm/node_modules/date-fns/locale/hi/_lib/localize.js +231 -0
- package/dist/esm/node_modules/date-fns/locale/hi/_lib/match.js +141 -0
- package/dist/esm/node_modules/date-fns/locale/hi.js +29 -0
- package/dist/esm/node_modules/date-fns/locale/it/_lib/formatDistance.js +105 -0
- package/dist/esm/node_modules/date-fns/locale/it/_lib/formatLong.js +43 -0
- package/dist/esm/node_modules/date-fns/locale/it/_lib/formatRelative.js +70 -0
- package/dist/esm/node_modules/date-fns/locale/it/_lib/localize.js +168 -0
- package/dist/esm/node_modules/date-fns/locale/it/_lib/match.js +137 -0
- package/dist/esm/node_modules/date-fns/locale/it.js +31 -0
- package/dist/esm/node_modules/date-fns/locale/ja/_lib/formatDistance.js +119 -0
- package/dist/esm/node_modules/date-fns/locale/ja/_lib/formatLong.js +43 -0
- package/dist/esm/node_modules/date-fns/locale/ja/_lib/formatRelative.js +16 -0
- package/dist/esm/node_modules/date-fns/locale/ja/_lib/localize.js +181 -0
- package/dist/esm/node_modules/date-fns/locale/ja/_lib/match.js +122 -0
- package/dist/esm/node_modules/date-fns/locale/ja.js +33 -0
- package/dist/esm/node_modules/date-fns/locale/ko/_lib/formatDistance.js +105 -0
- package/dist/esm/node_modules/date-fns/locale/ko/_lib/formatLong.js +43 -0
- package/dist/esm/node_modules/date-fns/locale/ko/_lib/formatRelative.js +15 -0
- package/dist/esm/node_modules/date-fns/locale/ko/_lib/localize.js +171 -0
- package/dist/esm/node_modules/date-fns/locale/ko/_lib/match.js +119 -0
- package/dist/esm/node_modules/date-fns/locale/ko.js +31 -0
- package/dist/esm/node_modules/date-fns/locale/pt/_lib/formatDistance.js +105 -0
- package/dist/esm/node_modules/date-fns/locale/pt/_lib/formatLong.js +43 -0
- package/dist/esm/node_modules/date-fns/locale/pt/_lib/formatRelative.js +26 -0
- package/dist/esm/node_modules/date-fns/locale/pt/_lib/localize.js +168 -0
- package/dist/esm/node_modules/date-fns/locale/pt/_lib/match.js +141 -0
- package/dist/esm/node_modules/date-fns/locale/pt.js +30 -0
- package/dist/esm/node_modules/date-fns/locale/ru/_lib/formatDistance.js +250 -0
- package/dist/esm/node_modules/date-fns/locale/ru/_lib/formatLong.js +40 -0
- package/dist/esm/node_modules/date-fns/locale/ru/_lib/formatRelative.js +92 -0
- package/dist/esm/node_modules/date-fns/locale/ru/_lib/localize.js +214 -0
- package/dist/esm/node_modules/date-fns/locale/ru/_lib/match.js +142 -0
- package/dist/esm/node_modules/date-fns/locale/ru.js +30 -0
- package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/formatDistance.js +105 -0
- package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/formatLong.js +43 -0
- package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/formatRelative.js +35 -0
- package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/localize.js +187 -0
- package/dist/esm/node_modules/date-fns/locale/zh-CN/_lib/match.js +134 -0
- package/dist/esm/node_modules/date-fns/locale/zh-CN.js +33 -0
- package/dist/esm/node_modules/date-fns/startOfDay.js +37 -0
- package/dist/esm/node_modules/date-fns/startOfDecade.js +42 -0
- package/dist/esm/node_modules/date-fns/startOfHour.js +37 -0
- package/dist/esm/node_modules/date-fns/startOfISOWeek.js +37 -0
- package/dist/esm/node_modules/date-fns/startOfISOWeekYear.js +44 -0
- package/dist/esm/node_modules/date-fns/startOfMinute.js +37 -0
- package/dist/esm/node_modules/date-fns/startOfMonth.js +39 -0
- package/dist/esm/node_modules/date-fns/startOfQuarter.js +40 -0
- package/dist/esm/node_modules/date-fns/startOfWeek.js +55 -0
- package/dist/esm/node_modules/date-fns/startOfWeekYear.js +66 -0
- package/dist/esm/node_modules/date-fns/startOfYear.js +38 -0
- package/dist/esm/node_modules/date-fns/toDate.js +48 -0
- package/dist/esm/packages/date/dist/esm/display/DateDuration.js +178 -0
- package/dist/esm/packages/date/dist/esm/hijri/DateConverter.js +152 -0
- package/dist/esm/packages/date/dist/esm/hijri/FormatDate.js +113 -0
- package/dist/esm/packages/date/dist/esm/hijri/HijriDate.js +528 -0
- package/dist/esm/packages/date/dist/esm/hijri/StringDateParser.js +74 -0
- package/dist/esm/packages/date/dist/esm/hijri/index.js +21 -0
- package/dist/esm/packages/date/dist/esm/hijri/initializer.js +113 -0
- package/dist/esm/packages/date/dist/esm/hijri/locales.js +18 -0
- package/dist/esm/packages/date/dist/esm/hijri/safe.js +14 -0
- package/dist/esm/packages/date/dist/esm/i18n/ar/date.json.js +209 -0
- package/dist/esm/packages/date/dist/esm/i18n/en/date.json.js +79 -0
- package/dist/esm/packages/date/dist/esm/i18n/index.js +33 -0
- package/dist/esm/packages/date/dist/esm/types/index.js +45 -0
- package/dist/esm/packages/date/dist/esm/utils/dateUtil.js +474 -0
- package/dist/esm/packages/lexical/src/editor/LexicalEditor.js +37 -14
- package/dist/esm/packages/lexical/src/hooks/useFormatWatcher.js +43 -37
- package/dist/esm/packages/lexical/src/i18n/ar/lexical.json.js +25 -0
- package/dist/esm/packages/lexical/src/i18n/en/lexical.json.js +25 -0
- package/dist/esm/packages/lexical/src/i18n/index.js +33 -0
- package/dist/esm/packages/lexical/src/index.js +1 -0
- package/dist/esm/packages/lexical/src/plugins/CommentPlugin.js +477 -0
- package/dist/esm/packages/lexical/src/plugins/DraggableBlockPlugin.js +11 -14
- package/dist/esm/packages/lexical/src/plugins/ToolbarPlugin.js +36 -23
- package/dist/types/editor/LexicalEditor.d.ts +12 -3
- package/dist/types/hooks/useFormatWatcher.d.ts +2 -1
- package/dist/types/i18n/index.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/plugins/CommentPlugin.d.ts +5 -0
- package/dist/types/plugins/DraggableBlockPlugin.d.ts +2 -1
- package/package.json +5 -5
- package/src/editor/LexicalEditor.tsx +65 -18
- package/src/hooks/useFormatWatcher.ts +3 -0
- package/src/i18n/ar/lexical.json +18 -0
- package/src/i18n/en/lexical.json +18 -0
- package/src/i18n/index.ts +28 -0
- package/src/index.ts +2 -0
- package/src/plugins/CommentPlugin.tsx +554 -0
- package/src/plugins/DraggableBlockPlugin.tsx +5 -10
- package/src/plugins/ToolbarPlugin.tsx +34 -23
- package/dist/cjs/_virtual/prism.js +0 -5
- package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.dev.js +0 -474
- package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.js +0 -21
- package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +0 -27
- package/dist/cjs/node_modules/@lexical/code/LexicalCode.dev.js +0 -1537
- package/dist/cjs/node_modules/@lexical/code/LexicalCode.js +0 -25
- package/dist/cjs/node_modules/@lexical/code/LexicalCode.prod.js +0 -57
- package/dist/cjs/node_modules/@lexical/html/LexicalHtml.dev.js +0 -252
- package/dist/cjs/node_modules/@lexical/html/LexicalHtml.js +0 -19
- package/dist/cjs/node_modules/@lexical/html/LexicalHtml.prod.js +0 -18
- package/dist/cjs/node_modules/@lexical/link/LexicalLink.dev.js +0 -572
- package/dist/cjs/node_modules/@lexical/link/LexicalLink.js +0 -17
- package/dist/cjs/node_modules/@lexical/link/LexicalLink.prod.js +0 -25
- package/dist/cjs/node_modules/@lexical/list/LexicalList.dev.js +0 -1614
- package/dist/cjs/node_modules/@lexical/list/LexicalList.js +0 -29
- package/dist/cjs/node_modules/@lexical/list/LexicalList.prod.js +0 -36
- package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.dev.js +0 -838
- package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.js +0 -29
- package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.prod.js +0 -26
- package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.dev.js +0 -1057
- package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.js +0 -39
- package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.prod.js +0 -45
- package/dist/cjs/node_modules/@lexical/table/LexicalTable.dev.js +0 -4207
- package/dist/cjs/node_modules/@lexical/table/LexicalTable.js +0 -23
- package/dist/cjs/node_modules/@lexical/table/LexicalTable.prod.js +0 -68
- package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.dev.js +0 -1166
- package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.js +0 -47
- package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.prod.js +0 -81
- package/dist/cjs/node_modules/@mdi/js/mdi.js +0 -8
- package/dist/cjs/node_modules/prismjs/components/prism-c.js +0 -82
- package/dist/cjs/node_modules/prismjs/components/prism-clike.js +0 -33
- package/dist/cjs/node_modules/prismjs/components/prism-cpp.js +0 -101
- package/dist/cjs/node_modules/prismjs/components/prism-css.js +0 -66
- package/dist/cjs/node_modules/prismjs/components/prism-java.js +0 -126
- package/dist/cjs/node_modules/prismjs/components/prism-javascript.js +0 -174
- package/dist/cjs/node_modules/prismjs/components/prism-markdown.js +0 -417
- package/dist/cjs/node_modules/prismjs/components/prism-markup.js +0 -188
- package/dist/cjs/node_modules/prismjs/components/prism-objectivec.js +0 -14
- package/dist/cjs/node_modules/prismjs/components/prism-powershell.js +0 -60
- package/dist/cjs/node_modules/prismjs/components/prism-python.js +0 -67
- package/dist/cjs/node_modules/prismjs/components/prism-rust.js +0 -130
- package/dist/cjs/node_modules/prismjs/components/prism-sql.js +0 -34
- package/dist/cjs/node_modules/prismjs/components/prism-swift.js +0 -150
- package/dist/cjs/node_modules/prismjs/components/prism-typescript.js +0 -62
- package/dist/cjs/node_modules/prismjs/prism.js +0 -1951
- package/dist/cjs/packages/lexical/src/components/StickyComponent.js +0 -221
- package/dist/cjs/packages/lexical/src/nodes/StickyNode.js +0 -218
- package/dist/cjs/packages/lexical/src/plugins/StickyPlugin.js +0 -20
- package/dist/esm/_virtual/prism.js +0 -5
- package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.dev.js +0 -465
- package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.js +0 -19
- package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +0 -18
- package/dist/esm/node_modules/@lexical/code/LexicalCode.dev.js +0 -1512
- package/dist/esm/node_modules/@lexical/code/LexicalCode.js +0 -21
- package/dist/esm/node_modules/@lexical/code/LexicalCode.prod.js +0 -32
- package/dist/esm/node_modules/@lexical/html/LexicalHtml.dev.js +0 -251
- package/dist/esm/node_modules/@lexical/html/LexicalHtml.js +0 -18
- package/dist/esm/node_modules/@lexical/html/LexicalHtml.prod.js +0 -17
- package/dist/esm/node_modules/@lexical/link/LexicalLink.dev.js +0 -563
- package/dist/esm/node_modules/@lexical/link/LexicalLink.js +0 -17
- package/dist/esm/node_modules/@lexical/link/LexicalLink.prod.js +0 -16
- package/dist/esm/node_modules/@lexical/list/LexicalList.dev.js +0 -1595
- package/dist/esm/node_modules/@lexical/list/LexicalList.js +0 -23
- package/dist/esm/node_modules/@lexical/list/LexicalList.prod.js +0 -17
- package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.dev.js +0 -830
- package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.js +0 -23
- package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.prod.js +0 -18
- package/dist/esm/node_modules/@lexical/selection/LexicalSelection.dev.js +0 -1028
- package/dist/esm/node_modules/@lexical/selection/LexicalSelection.js +0 -28
- package/dist/esm/node_modules/@lexical/selection/LexicalSelection.prod.js +0 -16
- package/dist/esm/node_modules/@lexical/table/LexicalTable.dev.js +0 -4156
- package/dist/esm/node_modules/@lexical/table/LexicalTable.js +0 -20
- package/dist/esm/node_modules/@lexical/table/LexicalTable.prod.js +0 -17
- package/dist/esm/node_modules/@lexical/utils/LexicalUtils.dev.js +0 -1102
- package/dist/esm/node_modules/@lexical/utils/LexicalUtils.js +0 -32
- package/dist/esm/node_modules/@lexical/utils/LexicalUtils.prod.js +0 -17
- package/dist/esm/node_modules/@mdi/js/mdi.js +0 -7
- package/dist/esm/node_modules/prismjs/components/prism-c.js +0 -82
- package/dist/esm/node_modules/prismjs/components/prism-clike.js +0 -33
- package/dist/esm/node_modules/prismjs/components/prism-cpp.js +0 -101
- package/dist/esm/node_modules/prismjs/components/prism-css.js +0 -66
- package/dist/esm/node_modules/prismjs/components/prism-java.js +0 -126
- package/dist/esm/node_modules/prismjs/components/prism-javascript.js +0 -174
- package/dist/esm/node_modules/prismjs/components/prism-markdown.js +0 -417
- package/dist/esm/node_modules/prismjs/components/prism-markup.js +0 -188
- package/dist/esm/node_modules/prismjs/components/prism-objectivec.js +0 -14
- package/dist/esm/node_modules/prismjs/components/prism-powershell.js +0 -60
- package/dist/esm/node_modules/prismjs/components/prism-python.js +0 -67
- package/dist/esm/node_modules/prismjs/components/prism-rust.js +0 -130
- package/dist/esm/node_modules/prismjs/components/prism-sql.js +0 -34
- package/dist/esm/node_modules/prismjs/components/prism-swift.js +0 -150
- package/dist/esm/node_modules/prismjs/components/prism-typescript.js +0 -62
- package/dist/esm/node_modules/prismjs/prism.js +0 -1951
- package/dist/esm/packages/lexical/src/components/StickyComponent.js +0 -221
- package/dist/esm/packages/lexical/src/nodes/StickyNode.js +0 -216
- package/dist/esm/packages/lexical/src/plugins/StickyPlugin.js +0 -20
- package/dist/types/components/StickyComponent.d.ts +0 -9
- package/dist/types/nodes/StickyNode.d.ts +0 -34
- package/dist/types/plugins/StickyPlugin.d.ts +0 -1
- package/src/components/StickyComponent.tsx +0 -271
- package/src/nodes/StickyNode.tsx +0 -249
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
|
-
import {
|
|
5
|
+
import { Dropdown, Button, Menu, MenuItem, Divider, ButtonGroup, ToggleButtonGroup, Icon, Tooltip } from '@react-fabric/core';
|
|
6
6
|
import { ColorInput } from '@react-fabric/form';
|
|
7
7
|
import { getValue } from '@react-fabric/utilities';
|
|
8
8
|
import { FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND } from 'lexical';
|
|
@@ -25,14 +25,14 @@ var blockTypeToBlockName = {
|
|
|
25
25
|
quote: "Quote"
|
|
26
26
|
};
|
|
27
27
|
var blockTypeToBlockIcon = {
|
|
28
|
-
bullet:
|
|
29
|
-
code:
|
|
28
|
+
bullet: "icon-[mdi--format-list-bulleted]",
|
|
29
|
+
code: "icon-[mdi--code-block-tags]",
|
|
30
30
|
h1: " ",
|
|
31
31
|
h2: " ",
|
|
32
32
|
paragraph: "",
|
|
33
|
-
h6:
|
|
34
|
-
number:
|
|
35
|
-
quote:
|
|
33
|
+
h6: "icon-[mdi--comment-text-outline]",
|
|
34
|
+
number: "icon-[mdi--format-list-numbered]",
|
|
35
|
+
quote: "icon-[mdi--format-quote-open]"
|
|
36
36
|
};
|
|
37
37
|
var SIZES = Object.freeze(["8", "9", "10", "11", "12", "13", "14", "16", "18", "20", "24", "28", "32", "36", "48", "64", "72"]);
|
|
38
38
|
var ButtonWrapper = function ButtonWrapper(_ref) {
|
|
@@ -64,7 +64,7 @@ var ToolbarPlugin = function ToolbarPlugin() {
|
|
|
64
64
|
children: [/*#__PURE__*/jsx(Button, {
|
|
65
65
|
variant: "link",
|
|
66
66
|
tabIndex: -1,
|
|
67
|
-
altIcon:
|
|
67
|
+
altIcon: "icon-[mdi--menu-down]",
|
|
68
68
|
icon: blockTypeToBlockIcon[watch.blockType],
|
|
69
69
|
children: blockTypeToBlockName[watch.blockType]
|
|
70
70
|
}), /*#__PURE__*/jsxs(Menu, {
|
|
@@ -114,7 +114,8 @@ var ToolbarPlugin = function ToolbarPlugin() {
|
|
|
114
114
|
children: /*#__PURE__*/jsxs(Dropdown, {
|
|
115
115
|
children: [/*#__PURE__*/jsx(Button, {
|
|
116
116
|
variant: "link",
|
|
117
|
-
altIcon:
|
|
117
|
+
altIcon: "icon-[mdi--menu-down]",
|
|
118
|
+
tabIndex: -1,
|
|
118
119
|
children: getValue(watch.fontSize + "", "16")
|
|
119
120
|
}), /*#__PURE__*/jsx(Menu, {
|
|
120
121
|
className: "hide-icons",
|
|
@@ -136,8 +137,10 @@ var ToolbarPlugin = function ToolbarPlugin() {
|
|
|
136
137
|
children: [/*#__PURE__*/jsx(ButtonWrapper, {
|
|
137
138
|
value: "start",
|
|
138
139
|
label: t("tool.alignStart"),
|
|
140
|
+
variant: watch.align === "start" ? "soft" : "link",
|
|
141
|
+
color: watch.align === "start" ? "primary" : "default",
|
|
139
142
|
icon: {
|
|
140
|
-
icon:
|
|
143
|
+
icon: "icon-[mdi--format-align-left]",
|
|
141
144
|
rtlFlip: true
|
|
142
145
|
},
|
|
143
146
|
onClick: function onClick() {
|
|
@@ -146,15 +149,19 @@ var ToolbarPlugin = function ToolbarPlugin() {
|
|
|
146
149
|
}), /*#__PURE__*/jsx(ButtonWrapper, {
|
|
147
150
|
value: "center",
|
|
148
151
|
label: t("tool.alignCenter"),
|
|
149
|
-
|
|
152
|
+
variant: watch.align === "center" ? "soft" : "link",
|
|
153
|
+
color: watch.align === "center" ? "primary" : "default",
|
|
154
|
+
icon: "icon-[mdi--format-align-center]",
|
|
150
155
|
onClick: function onClick() {
|
|
151
156
|
return watch.activeEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "center");
|
|
152
157
|
}
|
|
153
158
|
}), /*#__PURE__*/jsx(ButtonWrapper, {
|
|
154
159
|
value: "end",
|
|
155
160
|
label: t("tool.alignEnd"),
|
|
161
|
+
variant: watch.align === "end" ? "soft" : "link",
|
|
162
|
+
color: watch.align === "end" ? "primary" : "default",
|
|
156
163
|
icon: {
|
|
157
|
-
icon:
|
|
164
|
+
icon: "icon-[mdi--format-align-right]",
|
|
158
165
|
rtlFlip: true
|
|
159
166
|
},
|
|
160
167
|
onClick: function onClick() {
|
|
@@ -163,8 +170,10 @@ var ToolbarPlugin = function ToolbarPlugin() {
|
|
|
163
170
|
}), /*#__PURE__*/jsx(ButtonWrapper, {
|
|
164
171
|
value: "justify",
|
|
165
172
|
label: t("tool.alignJustify"),
|
|
173
|
+
variant: watch.align === "justify" ? "soft" : "link",
|
|
174
|
+
color: watch.align === "justify" ? "primary" : "default",
|
|
166
175
|
icon: {
|
|
167
|
-
icon:
|
|
176
|
+
icon: "icon-[mdi--format-align-justify]",
|
|
168
177
|
rtlFlip: true
|
|
169
178
|
},
|
|
170
179
|
onClick: function onClick() {
|
|
@@ -174,7 +183,7 @@ var ToolbarPlugin = function ToolbarPlugin() {
|
|
|
174
183
|
value: "justify",
|
|
175
184
|
label: t("tool.indentOut"),
|
|
176
185
|
icon: {
|
|
177
|
-
icon:
|
|
186
|
+
icon: "icon-[mdi--format-indent-decrease]",
|
|
178
187
|
rtlFlip: true
|
|
179
188
|
},
|
|
180
189
|
onClick: function onClick() {
|
|
@@ -182,9 +191,9 @@ var ToolbarPlugin = function ToolbarPlugin() {
|
|
|
182
191
|
}
|
|
183
192
|
}), /*#__PURE__*/jsx(ButtonWrapper, {
|
|
184
193
|
value: "justify",
|
|
185
|
-
label: t("tool.
|
|
194
|
+
label: t("tool.indentIn"),
|
|
186
195
|
icon: {
|
|
187
|
-
icon:
|
|
196
|
+
icon: "icon-[mdi--format-indent-increase]",
|
|
188
197
|
rtlFlip: true
|
|
189
198
|
},
|
|
190
199
|
onClick: function onClick() {
|
|
@@ -199,28 +208,32 @@ var ToolbarPlugin = function ToolbarPlugin() {
|
|
|
199
208
|
children: [/*#__PURE__*/jsx(ButtonWrapper, {
|
|
200
209
|
value: "bold",
|
|
201
210
|
label: t("tool.bold"),
|
|
202
|
-
icon:
|
|
211
|
+
icon: "icon-[mdi--format-bold]",
|
|
212
|
+
color: textFormat.includes("bold") ? "primary" : "default",
|
|
203
213
|
onClick: function onClick() {
|
|
204
214
|
return watch.activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "bold");
|
|
205
215
|
}
|
|
206
216
|
}), /*#__PURE__*/jsx(ButtonWrapper, {
|
|
207
217
|
value: "italic",
|
|
208
218
|
label: t("tool.italic"),
|
|
209
|
-
icon:
|
|
219
|
+
icon: "icon-[mdi--format-italic]",
|
|
220
|
+
color: textFormat.includes("italic") ? "primary" : "default",
|
|
210
221
|
onClick: function onClick() {
|
|
211
222
|
return watch.activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "italic");
|
|
212
223
|
}
|
|
213
224
|
}), /*#__PURE__*/jsx(ButtonWrapper, {
|
|
214
225
|
value: "underline",
|
|
215
226
|
label: t("tool.underline"),
|
|
216
|
-
icon:
|
|
227
|
+
icon: "icon-[mdi--format-underline]",
|
|
228
|
+
color: textFormat.includes("underline") ? "primary" : "default",
|
|
217
229
|
onClick: function onClick() {
|
|
218
230
|
return watch.activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "underline");
|
|
219
231
|
}
|
|
220
232
|
}), /*#__PURE__*/jsx(ButtonWrapper, {
|
|
221
233
|
value: "strikethrough",
|
|
222
234
|
label: t("tool.strikethrough"),
|
|
223
|
-
icon:
|
|
235
|
+
icon: "icon-[mdi--format-strikethrough-variant]",
|
|
236
|
+
color: textFormat.includes("strikethrough") ? "primary" : "default",
|
|
224
237
|
onClick: function onClick() {
|
|
225
238
|
return watch.activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "strikethrough");
|
|
226
239
|
}
|
|
@@ -234,7 +247,7 @@ var ToolbarPlugin = function ToolbarPlugin() {
|
|
|
234
247
|
return watch.onFontColorSelect(v !== null && v !== void 0 ? v : undefined);
|
|
235
248
|
},
|
|
236
249
|
decorateStart: /*#__PURE__*/jsx(Icon, {
|
|
237
|
-
icon:
|
|
250
|
+
icon: "icon-[mdi--format-text]"
|
|
238
251
|
})
|
|
239
252
|
}), /*#__PURE__*/jsx(ColorInput, {
|
|
240
253
|
noOutline: true,
|
|
@@ -243,19 +256,19 @@ var ToolbarPlugin = function ToolbarPlugin() {
|
|
|
243
256
|
return watch.onBgColorSelect(v !== null && v !== void 0 ? v : undefined);
|
|
244
257
|
},
|
|
245
258
|
decorateStart: /*#__PURE__*/jsx(Icon, {
|
|
246
|
-
icon:
|
|
259
|
+
icon: "icon-[mdi--format-color-fill]"
|
|
247
260
|
})
|
|
248
261
|
}), /*#__PURE__*/jsx(ButtonWrapper, {
|
|
249
262
|
value: "hilight",
|
|
250
263
|
label: t("tool.hilight"),
|
|
251
|
-
icon:
|
|
264
|
+
icon: "icon-[mdi--format-color-highlight]",
|
|
252
265
|
onClick: function onClick() {
|
|
253
266
|
return watch.onBgColorSelect("#fde68a");
|
|
254
267
|
}
|
|
255
268
|
}), /*#__PURE__*/jsx(ButtonWrapper, {
|
|
256
269
|
value: "hilight",
|
|
257
270
|
label: t("tool.clear"),
|
|
258
|
-
icon:
|
|
271
|
+
icon: "icon-[mdi--format-clear]",
|
|
259
272
|
onClick: function onClick() {
|
|
260
273
|
return watch.clearFormatting();
|
|
261
274
|
}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
import { type ReactElement } from "@react-fabric/core/dist/types/types";
|
|
2
|
+
import { type Klass, type LexicalNode, type LexicalNodeReplacement } from "lexical";
|
|
1
3
|
export interface EditorProps {
|
|
2
4
|
value?: string | AnyObject;
|
|
5
|
+
isRtl?: boolean;
|
|
3
6
|
readOnly?: boolean;
|
|
4
7
|
/**
|
|
5
8
|
* publish mode removes all wrapping and renders plain lexical view for exporting to pdf using puppeteer
|
|
6
9
|
*/
|
|
7
10
|
publishMode?: boolean;
|
|
8
|
-
header?:
|
|
9
|
-
footer?:
|
|
11
|
+
header?: ReactElement;
|
|
12
|
+
footer?: ReactElement;
|
|
13
|
+
coverPage?: ReactElement;
|
|
14
|
+
/**
|
|
15
|
+
* Username is used for comment plugin to identify the comment author. It can be used to conditionally render delete option for comments.
|
|
16
|
+
*/
|
|
17
|
+
username?: string;
|
|
18
|
+
nodes?: ReadonlyArray<Klass<LexicalNode> | LexicalNodeReplacement>;
|
|
10
19
|
onChange?: (value: KeyValue) => void;
|
|
11
20
|
onDirty?: (isDirty: boolean) => void;
|
|
12
21
|
}
|
|
@@ -35,4 +44,4 @@ export interface EditorProps {
|
|
|
35
44
|
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/lexical-playground--playground}
|
|
36
45
|
* @see {@link https://lexical.dev/docs/}
|
|
37
46
|
*/
|
|
38
|
-
export declare const LexicalEditor: ({ value, readOnly, publishMode, onChange, onDirty, }: EditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare const LexicalEditor: ({ value, readOnly, publishMode, header, footer, coverPage, isRtl, username, nodes, onChange, onDirty, }: EditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { type ElementNode, type RangeSelection, type TextNode } from "lexical";
|
|
|
3
3
|
export declare function getSelectedNode(selection: RangeSelection): TextNode | ElementNode;
|
|
4
4
|
export declare const useFormatWatcher: () => {
|
|
5
5
|
editor: import("lexical").LexicalEditor;
|
|
6
|
-
blockType: "number" | "
|
|
6
|
+
blockType: "number" | "code" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "bullet" | "check" | "paragraph" | "quote";
|
|
7
7
|
rootType: "table" | "root";
|
|
8
8
|
selectedElementKey: string | null;
|
|
9
9
|
fontSize: string;
|
|
@@ -21,6 +21,7 @@ export declare const useFormatWatcher: () => {
|
|
|
21
21
|
canUndo: boolean;
|
|
22
22
|
canRedo: boolean;
|
|
23
23
|
isRTL: boolean;
|
|
24
|
+
align: string;
|
|
24
25
|
isEditable: boolean;
|
|
25
26
|
codeLanguage: string;
|
|
26
27
|
activeEditor: import("lexical").LexicalEditor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/lexical",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.62",
|
|
4
4
|
"description": "RUF: Lexical editor",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@lexical/react": "~0.35.0",
|
|
39
|
-
"@react-fabric/core": "^1.0.0-beta.
|
|
40
|
-
"@react-fabric/form": "^1.0.0-beta.
|
|
41
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
39
|
+
"@react-fabric/core": "^1.0.0-beta.62",
|
|
40
|
+
"@react-fabric/form": "^1.0.0-beta.62",
|
|
41
|
+
"@react-fabric/utilities": "^1.0.0-beta.62",
|
|
42
42
|
"classnames": "~2.5.1",
|
|
43
43
|
"lexical": "~0.35.0"
|
|
44
44
|
},
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"node": ">=18.12.0",
|
|
53
53
|
"npm": ">=8.19.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "9dce2fd9bb753d67e3f8adbf50be257b4bc64242"
|
|
56
56
|
}
|
|
@@ -38,27 +38,42 @@ import { TablePlugin } from "@lexical/react/LexicalTablePlugin";
|
|
|
38
38
|
import { HeadingNode, QuoteNode } from "@lexical/rich-text";
|
|
39
39
|
import { TableCellNode, TableNode, TableRowNode } from "@lexical/table";
|
|
40
40
|
import { ErrorBoundary, Header, ThemeProvider } from "@react-fabric/core";
|
|
41
|
-
import {
|
|
41
|
+
import { type ReactElement } from "@react-fabric/core/dist/types/types";
|
|
42
|
+
import { debounce, EMPTY_ARRAY } from "@react-fabric/utilities";
|
|
42
43
|
import classNames from "classnames";
|
|
43
|
-
import {
|
|
44
|
+
import {
|
|
45
|
+
type Klass,
|
|
46
|
+
type LexicalNode,
|
|
47
|
+
type LexicalNodeReplacement,
|
|
48
|
+
type LexicalEditor as LXE,
|
|
49
|
+
} from "lexical";
|
|
44
50
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
45
|
-
import {
|
|
51
|
+
import { CommentPlugin } from "../plugins/CommentPlugin";
|
|
46
52
|
import { DraggableBlockPlugin } from "../plugins/DraggableBlockPlugin";
|
|
47
|
-
import { StickyPlugin } from "../plugins/StickyPlugin";
|
|
48
53
|
import { ToolbarPlugin } from "../plugins/ToolbarPlugin";
|
|
49
54
|
import { LexicalTheme } from "./theme";
|
|
50
55
|
|
|
51
56
|
export interface EditorProps {
|
|
52
57
|
value?: string | AnyObject;
|
|
53
58
|
|
|
59
|
+
isRtl?: boolean;
|
|
60
|
+
|
|
54
61
|
readOnly?: boolean;
|
|
55
62
|
/**
|
|
56
63
|
* publish mode removes all wrapping and renders plain lexical view for exporting to pdf using puppeteer
|
|
57
64
|
*/
|
|
58
65
|
publishMode?: boolean;
|
|
59
66
|
|
|
60
|
-
header?:
|
|
61
|
-
footer?:
|
|
67
|
+
header?: ReactElement;
|
|
68
|
+
footer?: ReactElement;
|
|
69
|
+
coverPage?: ReactElement;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Username is used for comment plugin to identify the comment author. It can be used to conditionally render delete option for comments.
|
|
73
|
+
*/
|
|
74
|
+
username?: string;
|
|
75
|
+
|
|
76
|
+
nodes?: ReadonlyArray<Klass<LexicalNode> | LexicalNodeReplacement>;
|
|
62
77
|
|
|
63
78
|
onChange?: (value: KeyValue) => void;
|
|
64
79
|
onDirty?: (isDirty: boolean) => void;
|
|
@@ -93,6 +108,12 @@ export const LexicalEditor = ({
|
|
|
93
108
|
value,
|
|
94
109
|
readOnly,
|
|
95
110
|
publishMode,
|
|
111
|
+
header,
|
|
112
|
+
footer,
|
|
113
|
+
coverPage,
|
|
114
|
+
isRtl,
|
|
115
|
+
username = "Guest",
|
|
116
|
+
nodes = EMPTY_ARRAY,
|
|
96
117
|
onChange,
|
|
97
118
|
onDirty,
|
|
98
119
|
}: EditorProps) => {
|
|
@@ -178,7 +199,7 @@ export const LexicalEditor = ({
|
|
|
178
199
|
TableCellNode,
|
|
179
200
|
TableNode,
|
|
180
201
|
TableRowNode,
|
|
181
|
-
|
|
202
|
+
...nodes,
|
|
182
203
|
],
|
|
183
204
|
onError,
|
|
184
205
|
}) as InitialConfigType,
|
|
@@ -189,20 +210,25 @@ export const LexicalEditor = ({
|
|
|
189
210
|
({ children }: KeyValue) => {
|
|
190
211
|
return !publishMode ? (
|
|
191
212
|
<div className="lexical-scroller area-content overflow-auto">
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
213
|
+
{!readOnly && (
|
|
214
|
+
<div
|
|
215
|
+
className={classNames(
|
|
216
|
+
"fabric-lexicalToolbar",
|
|
217
|
+
"sticky top-0 z-1",
|
|
218
|
+
)}
|
|
219
|
+
>
|
|
220
|
+
<Header className="bg-base">
|
|
221
|
+
<ToolbarPlugin />
|
|
222
|
+
</Header>
|
|
223
|
+
</div>
|
|
224
|
+
)}
|
|
199
225
|
{children}
|
|
200
226
|
</div>
|
|
201
227
|
) : (
|
|
202
228
|
children
|
|
203
229
|
);
|
|
204
230
|
},
|
|
205
|
-
[publishMode],
|
|
231
|
+
[publishMode, readOnly],
|
|
206
232
|
);
|
|
207
233
|
|
|
208
234
|
return (
|
|
@@ -216,15 +242,24 @@ export const LexicalEditor = ({
|
|
|
216
242
|
"fabric-lexicalEditor",
|
|
217
243
|
"lexical-container relative bg-white min-h-full mx-auto shadow-md print:shadow-none",
|
|
218
244
|
)}
|
|
245
|
+
dir={isRtl ? "rtl" : "ltr"}
|
|
219
246
|
onDragOver={(e) => e.stopPropagation()}
|
|
220
247
|
onKeyDown={(e) => e.stopPropagation()}
|
|
221
248
|
ref={setEditorContainer}
|
|
222
249
|
>
|
|
250
|
+
{!publishMode && header && (
|
|
251
|
+
<div className="editor-header">{header}</div>
|
|
252
|
+
)}
|
|
253
|
+
{coverPage && (
|
|
254
|
+
<div className="editor-cover px-[2cm] py-[1cm]">
|
|
255
|
+
{coverPage}
|
|
256
|
+
</div>
|
|
257
|
+
)}
|
|
223
258
|
<RichTextPlugin
|
|
224
259
|
contentEditable={
|
|
225
260
|
<ContentEditable
|
|
226
261
|
readOnly={!!readOnly || publishMode}
|
|
227
|
-
className="lexical-editor px-[2cm] py-[1cm]
|
|
262
|
+
className="lexical-editor min-h-screen px-[2cm] py-[1cm]"
|
|
228
263
|
/>
|
|
229
264
|
}
|
|
230
265
|
placeholder={
|
|
@@ -238,11 +273,23 @@ export const LexicalEditor = ({
|
|
|
238
273
|
<CheckListPlugin />
|
|
239
274
|
<TablePlugin />
|
|
240
275
|
<HistoryPlugin />
|
|
241
|
-
<StickyPlugin />
|
|
242
276
|
<AutoFocusPlugin defaultSelection="rootStart" />
|
|
243
277
|
{/** Custom plugins **/}
|
|
244
278
|
{editorContainer && (
|
|
245
|
-
<DraggableBlockPlugin
|
|
279
|
+
<DraggableBlockPlugin
|
|
280
|
+
anchorElem={editorContainer}
|
|
281
|
+
isEditable={!readOnly && !publishMode}
|
|
282
|
+
/>
|
|
283
|
+
)}
|
|
284
|
+
{editorContainer && (
|
|
285
|
+
<CommentPlugin
|
|
286
|
+
username={username}
|
|
287
|
+
anchorElem={editorContainer}
|
|
288
|
+
isPublishMode={!!publishMode}
|
|
289
|
+
/>
|
|
290
|
+
)}
|
|
291
|
+
{!publishMode && footer && (
|
|
292
|
+
<div className="editor-footer">{footer}</div>
|
|
246
293
|
)}
|
|
247
294
|
</div>
|
|
248
295
|
</ThemeProvider>
|
|
@@ -126,6 +126,7 @@ export const useFormatWatcher = () => {
|
|
|
126
126
|
const [fontColor, setFontColor] = useState<string>("#000");
|
|
127
127
|
const [bgColor, setBgColor] = useState<string>("#fff");
|
|
128
128
|
const [fontFamily, setFontFamily] = useState<string>("Arial");
|
|
129
|
+
const [align, setAlign] = useState("");
|
|
129
130
|
const [isLink, setIsLink] = useState(false);
|
|
130
131
|
const [isBold, setIsBold] = useState(false);
|
|
131
132
|
const [isItalic, setIsItalic] = useState(false);
|
|
@@ -189,6 +190,7 @@ export const useFormatWatcher = () => {
|
|
|
189
190
|
|
|
190
191
|
if (elementDOM !== null) {
|
|
191
192
|
setSelectedElementKey(elementKey);
|
|
193
|
+
elementDOM && setAlign(getComputedStyle(elementDOM).textAlign);
|
|
192
194
|
if ($isListNode(element)) {
|
|
193
195
|
const parentList = $getNearestNodeOfType<ListNode>(
|
|
194
196
|
anchorNode,
|
|
@@ -488,6 +490,7 @@ export const useFormatWatcher = () => {
|
|
|
488
490
|
canUndo,
|
|
489
491
|
canRedo,
|
|
490
492
|
isRTL,
|
|
493
|
+
align,
|
|
491
494
|
isEditable,
|
|
492
495
|
codeLanguage,
|
|
493
496
|
activeEditor,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"addComment": "أضف تعليقا",
|
|
3
|
+
"reply": "رد",
|
|
4
|
+
"tool": {
|
|
5
|
+
"alignCenter": "محاذاة المركز",
|
|
6
|
+
"alignEnd": "محاذاة النهاية",
|
|
7
|
+
"alignJustify": "محاذاة وضبط",
|
|
8
|
+
"alignStart": "محاذاة البداية",
|
|
9
|
+
"bold": "عريض",
|
|
10
|
+
"clear": "مسح التنسيق",
|
|
11
|
+
"hilight": "تسليط الضوء",
|
|
12
|
+
"indentIn": "المسافة البادئة في",
|
|
13
|
+
"indentOut": "مسافة بادئة للخارج",
|
|
14
|
+
"italic": "مائل",
|
|
15
|
+
"strikethrough": "يتوسطه خط",
|
|
16
|
+
"underline": "تسطير"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tool": {
|
|
3
|
+
"alignStart": "Align Start",
|
|
4
|
+
"alignCenter": "Align Center",
|
|
5
|
+
"alignEnd": "Align End",
|
|
6
|
+
"alignJustify": "Align Justify",
|
|
7
|
+
"bold": "Bold",
|
|
8
|
+
"italic": "Italic",
|
|
9
|
+
"underline": "Underline",
|
|
10
|
+
"strikethrough": "Strikethrough",
|
|
11
|
+
"indentOut": "Indent Out",
|
|
12
|
+
"indentIn": "Indent In",
|
|
13
|
+
"hilight": "Highlight",
|
|
14
|
+
"clear": "Clear Formatting"
|
|
15
|
+
},
|
|
16
|
+
"addComment": "Add comment",
|
|
17
|
+
"reply": "Reply"
|
|
18
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* React Fabric
|
|
3
|
+
* @version: 1.0.0
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* The MIT License (MIT)
|
|
7
|
+
* Copyright (c) 2024 Adarsh Pastakia
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
10
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
11
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
12
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
13
|
+
* subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
16
|
+
* portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
19
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
20
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { addTranslationBundle } from "@react-fabric/core";
|
|
25
|
+
import ar from "./ar/lexical.json";
|
|
26
|
+
import en from "./en/lexical.json";
|
|
27
|
+
|
|
28
|
+
addTranslationBundle("lexical", { en, ar });
|