@rh-support/components 2.4.10-beta.6 → 2.5.1
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/README.md +2 -0
- package/lib/esm/AlertMessage/AlertMessage.d.ts +2 -2
- package/lib/esm/AlertMessage/AlertMessage.d.ts.map +1 -1
- package/lib/esm/AlertMessage/AlertMessage.js +1 -1
- package/lib/esm/ConfirmationModal/ConfirmationContext.d.ts +2 -1
- package/lib/esm/ConfirmationModal/ConfirmationContext.d.ts.map +1 -1
- package/lib/esm/ConfirmationModal/ConfirmationDialog.d.ts +2 -1
- package/lib/esm/ConfirmationModal/ConfirmationDialog.d.ts.map +1 -1
- package/lib/esm/CoverSpinner/CoverSpinner.d.ts +2 -1
- package/lib/esm/CoverSpinner/CoverSpinner.d.ts.map +1 -1
- package/lib/esm/CustomContentLoader/CustomContentLoader.d.ts +2 -2
- package/lib/esm/CustomContentLoader/CustomContentLoader.d.ts.map +1 -1
- package/lib/esm/CustomTextInput/CustomTextInput.d.ts +3 -1
- package/lib/esm/CustomTextInput/CustomTextInput.d.ts.map +1 -1
- package/lib/esm/CustomTextInput/CustomTextInput.js +4 -2
- package/lib/esm/DropDownList/AsyncDropDownList.d.ts +1 -1
- package/lib/esm/DropDownList/AsyncDropDownList.d.ts.map +1 -1
- package/lib/esm/DropDownList/DropDownList.d.ts +2 -1
- package/lib/esm/DropDownList/DropDownList.d.ts.map +1 -1
- package/lib/esm/DropDownList/DropDownList.js +10 -10
- package/lib/esm/DropDownList/DropdownWrapper.d.ts +1 -1
- package/lib/esm/DropDownList/DropdownWrapper.d.ts.map +1 -1
- package/lib/esm/DropDownList/DropdownWrapper.js +2 -2
- package/lib/esm/DropDownList/MultiSelectDropdownList.d.ts.map +1 -1
- package/lib/esm/DropDownList/SearchableList.d.ts +1 -1
- package/lib/esm/DropDownList/SearchableList.d.ts.map +1 -1
- package/lib/esm/DropDownList/SearchableList.js +6 -6
- package/lib/esm/DropDownList/SelectList.d.ts +1 -1
- package/lib/esm/DropDownList/SelectList.d.ts.map +1 -1
- package/lib/esm/DropDownList/SelectList.js +6 -6
- package/lib/esm/DropDownList/async.d.ts +1 -1
- package/lib/esm/DropDownList/async.d.ts.map +1 -1
- package/lib/esm/DropDownList/dropdownList.css +10 -5
- package/lib/esm/DropDownList/types.d.ts +6 -7
- package/lib/esm/DropDownList/types.d.ts.map +1 -1
- package/lib/esm/DropDownList/withMulti.d.ts +1 -1
- package/lib/esm/DropDownList/withMulti.d.ts.map +1 -1
- package/lib/esm/DropDownList/withMulti.js +1 -0
- package/lib/esm/ErrorBoundary/ErrorBoundary.d.ts +2 -1
- package/lib/esm/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/lib/esm/ErrorBoundary/ErrorBoundary.js +1 -1
- package/lib/esm/ErrorBoundary/ErrorBoundaryFallbackComponent.d.ts +2 -1
- package/lib/esm/ErrorBoundary/ErrorBoundaryFallbackComponent.d.ts.map +1 -1
- package/lib/esm/ErrorBoundary/ErrorBoundaryFallbackComponent.js +3 -4
- package/lib/esm/ErrorPages/Generic403.d.ts +2 -1
- package/lib/esm/ErrorPages/Generic403.d.ts.map +1 -1
- package/lib/esm/FeedbackForm/FeedbackForm.d.ts +2 -1
- package/lib/esm/FeedbackForm/FeedbackForm.d.ts.map +1 -1
- package/lib/esm/FeedbackForm/FeedbackForm.js +2 -2
- package/lib/esm/Functional/CaseContactsSelectorExternal.d.ts +5 -4
- package/lib/esm/Functional/CaseContactsSelectorExternal.d.ts.map +1 -1
- package/lib/esm/Functional/CaseContactsSelectorExternal.js +9 -8
- package/lib/esm/InlineEdit/InlineEdit.d.ts +2 -2
- package/lib/esm/InlineEdit/InlineEdit.d.ts.map +1 -1
- package/lib/esm/InlineEdit/InlineEdit.js +1 -1
- package/lib/esm/InlineEdit/NewInlineEdit.d.ts +2 -2
- package/lib/esm/InlineEdit/NewInlineEdit.d.ts.map +1 -1
- package/lib/esm/InlineEdit/NewInlineEdit.js +2 -2
- package/lib/esm/InlineEdit/inlineEdit.css +24 -1
- package/lib/esm/InlineEdit/newInlineEdit.css +5 -4
- package/lib/esm/LanguageSelector/LanguageSelector.d.ts +2 -1
- package/lib/esm/LanguageSelector/LanguageSelector.d.ts.map +1 -1
- package/lib/esm/LanguageSelector/LanguageSelector.js +13 -3
- package/lib/esm/LanguageSelector/languageSelector.css +1 -1
- package/lib/esm/LoadingDots/LoadingDots.d.ts +3 -1
- package/lib/esm/LoadingDots/LoadingDots.d.ts.map +1 -1
- package/lib/esm/LoadingDots/LoadingDots.js +2 -2
- package/lib/esm/LoadingIndicator/LoadingIndicator.d.ts +2 -1
- package/lib/esm/LoadingIndicator/LoadingIndicator.d.ts.map +1 -1
- package/lib/esm/LoginModal/LoginModal.d.ts +2 -1
- package/lib/esm/LoginModal/LoginModal.d.ts.map +1 -1
- package/lib/esm/LoginModal/LoginModal.js +1 -1
- package/lib/esm/MarkdownEditor/MarkdownEditor.d.ts +5 -1
- package/lib/esm/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
- package/lib/esm/MarkdownEditor/MarkdownEditor.js +272 -86
- package/lib/esm/MarkdownEditor/markdownEditor.css +113 -5
- package/lib/esm/MoreOrLess/MoreOrLess.d.ts +1 -1
- package/lib/esm/MoreOrLess/MoreOrLess.d.ts.map +1 -1
- package/lib/esm/PaginatedList/PaginatedList.d.ts +2 -1
- package/lib/esm/PaginatedList/PaginatedList.d.ts.map +1 -1
- package/lib/esm/PaginatedList/PaginatedList.js +9 -0
- package/lib/esm/PaginationCompact/PaginationCompact.d.ts +2 -1
- package/lib/esm/PaginationCompact/PaginationCompact.d.ts.map +1 -1
- package/lib/esm/PaginationCompact/PaginationCompact.js +4 -4
- package/lib/esm/PaginationCompact/paginationCompact.css +1 -1
- package/lib/esm/PhoneInput/CountryData.d.ts.map +1 -1
- package/lib/esm/PhoneInput/CountryData.js +3 -2
- package/lib/esm/PhoneInput/FlagSvgs.d.ts +3 -0
- package/lib/esm/PhoneInput/FlagSvgs.d.ts.map +1 -0
- package/lib/esm/PhoneInput/FlagSvgs.js +2018 -0
- package/lib/esm/PhoneInput/PhoneInput.d.ts +14 -1
- package/lib/esm/PhoneInput/PhoneInput.d.ts.map +1 -1
- package/lib/esm/PhoneInput/PhoneInput.js +121 -120
- package/lib/esm/PhoneInput/PhoneInput.scss +15 -732
- package/lib/esm/ProgressBar/CircularProgressBar/CircularProgressBar.d.ts +2 -1
- package/lib/esm/ProgressBar/CircularProgressBar/CircularProgressBar.d.ts.map +1 -1
- package/lib/esm/ProgressBar/CircularProgressBar/Path.d.ts +1 -1
- package/lib/esm/ProgressBar/CircularProgressBar/Path.d.ts.map +1 -1
- package/lib/esm/ProgressBar/CircularProgressBar/types.d.ts +3 -4
- package/lib/esm/ProgressBar/CircularProgressBar/types.d.ts.map +1 -1
- package/lib/esm/ProgressBar/ProgressBar.d.ts +1 -1
- package/lib/esm/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/lib/esm/PromisifyModal/PromisifyModal.d.ts +6 -9
- package/lib/esm/PromisifyModal/PromisifyModal.d.ts.map +1 -1
- package/lib/esm/PromisifyModal/PromisifyModal.js +21 -18
- package/lib/esm/SubscriptionAbuse/SubscriptionAbuseModal.d.ts +2 -1
- package/lib/esm/SubscriptionAbuse/SubscriptionAbuseModal.d.ts.map +1 -1
- package/lib/esm/SubscriptionAbuse/const.d.ts +2 -1
- package/lib/esm/SubscriptionAbuse/const.d.ts.map +1 -1
- package/lib/esm/SupportFeedbackForm/SupportFeedbackForm.d.ts +2 -1
- package/lib/esm/SupportFeedbackForm/SupportFeedbackForm.d.ts.map +1 -1
- package/lib/esm/SupportFeedbackForm/SupportFeedbackModal.d.ts +2 -1
- package/lib/esm/SupportFeedbackForm/SupportFeedbackModal.d.ts.map +1 -1
- package/lib/esm/SupportFeedbackForm/SupportFeedbackModal.js +14 -14
- package/lib/esm/Table/PFTable.d.ts +4 -3
- package/lib/esm/Table/PFTable.d.ts.map +1 -1
- package/lib/esm/Table/PFTable.js +6 -6
- package/lib/{cjs/Table/Table.d.ts → esm/Table/TableComponent.d.ts} +2 -2
- package/lib/esm/Table/TableComponent.d.ts.map +1 -0
- package/lib/esm/Table/{Table.js → TableComponent.js} +1 -1
- package/lib/esm/Table/TablePagination.d.ts +2 -1
- package/lib/esm/Table/TablePagination.d.ts.map +1 -1
- package/lib/esm/Table/TablePagination.js +4 -2
- package/lib/esm/Table/index.d.ts +1 -2
- package/lib/esm/Table/index.d.ts.map +1 -1
- package/lib/esm/Table/index.js +1 -2
- package/lib/esm/TagsSelector/TagsSelector.d.ts +14 -0
- package/lib/esm/TagsSelector/TagsSelector.d.ts.map +1 -0
- package/lib/esm/TagsSelector/TagsSelector.js +74 -0
- package/lib/esm/TagsSelector/index.d.ts +2 -0
- package/lib/esm/TagsSelector/index.d.ts.map +1 -0
- package/lib/esm/TagsSelector/index.js +1 -0
- package/lib/esm/TagsSelector/tagSelector.css +15 -0
- package/lib/esm/TermsAndConditions/AcceptTermsModal.d.ts +2 -1
- package/lib/esm/TermsAndConditions/AcceptTermsModal.d.ts.map +1 -1
- package/lib/esm/TermsAndConditions/AcceptTermsModal.js +7 -6
- package/lib/esm/TextAreaAutosize/TextAreaAutosize.d.ts +1 -1
- package/lib/esm/TextAreaAutosize/TextAreaAutosize.d.ts.map +1 -1
- package/lib/esm/TextAreaResizable/TextAreaResizable.d.ts +1 -1
- package/lib/esm/TextAreaResizable/TextAreaResizable.d.ts.map +1 -1
- package/lib/esm/TextAreaResizable/TextAreaResizable.js +1 -1
- package/lib/esm/ToastNotification/ToastNotification.d.ts +1 -1
- package/lib/esm/ToastNotification/ToastNotification.d.ts.map +1 -1
- package/lib/esm/ToastNotification/ToastNotification.js +13 -5
- package/lib/esm/ToastNotification/toastNotification.css +1 -1
- package/lib/esm/TopContentSearch/TopContentSearch.d.ts +5 -1
- package/lib/esm/TopContentSearch/TopContentSearch.d.ts.map +1 -1
- package/lib/esm/TopContentSearch/TopContentSearch.js +20 -23
- package/lib/esm/ValueChangedIcon/ValueChangedIcon.d.ts +1 -1
- package/lib/esm/ValueChangedIcon/ValueChangedIcon.d.ts.map +1 -1
- package/lib/esm/helperFunctions/errorMessage.js +2 -2
- package/lib/esm/helperFunctions/errorMessage.scss +1 -1
- package/lib/esm/hooks/index.d.ts +4 -0
- package/lib/esm/hooks/index.d.ts.map +1 -1
- package/lib/esm/hooks/index.js +4 -0
- package/lib/esm/hooks/useBreakpoint.d.ts +2 -2
- package/lib/esm/hooks/useBreakpoint.d.ts.map +1 -1
- package/lib/esm/hooks/useBreakpoint.js +2 -0
- package/lib/esm/hooks/useCopyToClipboard.d.ts.map +1 -1
- package/lib/esm/hooks/useCopyToClipboard.js +1 -0
- package/lib/esm/hooks/useFetch.js +1 -2
- package/lib/esm/hooks/useLocalStorage.d.ts +2 -2
- package/lib/esm/hooks/useLocalStorage.d.ts.map +1 -1
- package/lib/esm/hooks/useSearchDocument.d.ts +7 -0
- package/lib/esm/hooks/useSearchDocument.d.ts.map +1 -0
- package/lib/esm/hooks/useSearchDocument.js +42 -0
- package/lib/esm/hooks/useSelectKeyboardNavigator.d.ts +13 -0
- package/lib/esm/hooks/useSelectKeyboardNavigator.d.ts.map +1 -0
- package/lib/esm/hooks/useSelectKeyboardNavigator.js +54 -0
- package/lib/esm/hooks/useSessionStorage.d.ts +5 -0
- package/lib/esm/hooks/useSessionStorage.d.ts.map +1 -0
- package/lib/esm/hooks/useSessionStorage.js +30 -0
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +1 -0
- package/package.json +40 -46
- package/lib/cjs/AlertMessage/AlertMessage.css +0 -9
- package/lib/cjs/AlertMessage/AlertMessage.d.ts +0 -24
- package/lib/cjs/AlertMessage/AlertMessage.d.ts.map +0 -1
- package/lib/cjs/AlertMessage/AlertMessage.js +0 -30
- package/lib/cjs/AlertMessage/index.d.ts +0 -2
- package/lib/cjs/AlertMessage/index.d.ts.map +0 -1
- package/lib/cjs/AlertMessage/index.js +0 -14
- package/lib/cjs/ConfirmationModal/ConfirmationContext.d.ts +0 -6
- package/lib/cjs/ConfirmationModal/ConfirmationContext.d.ts.map +0 -1
- package/lib/cjs/ConfirmationModal/ConfirmationContext.js +0 -53
- package/lib/cjs/ConfirmationModal/ConfirmationDialog.d.ts +0 -29
- package/lib/cjs/ConfirmationModal/ConfirmationDialog.d.ts.map +0 -1
- package/lib/cjs/ConfirmationModal/ConfirmationDialog.js +0 -28
- package/lib/cjs/ConfirmationModal/ConfirmationModal.stories.d.ts +0 -1
- package/lib/cjs/ConfirmationModal/ConfirmationModal.stories.d.ts.map +0 -1
- package/lib/cjs/ConfirmationModal/ConfirmationModal.stories.js +0 -36
- package/lib/cjs/ConfirmationModal/index.d.ts +0 -3
- package/lib/cjs/ConfirmationModal/index.d.ts.map +0 -1
- package/lib/cjs/ConfirmationModal/index.js +0 -14
- package/lib/cjs/CoverSpinner/CoverSpinner.css +0 -16
- package/lib/cjs/CoverSpinner/CoverSpinner.d.ts +0 -3
- package/lib/cjs/CoverSpinner/CoverSpinner.d.ts.map +0 -1
- package/lib/cjs/CoverSpinner/CoverSpinner.js +0 -13
- package/lib/cjs/CoverSpinner/index.d.ts +0 -2
- package/lib/cjs/CoverSpinner/index.d.ts.map +0 -1
- package/lib/cjs/CoverSpinner/index.js +0 -13
- package/lib/cjs/CustomContentLoader/CustomContentLoader.d.ts +0 -15
- package/lib/cjs/CustomContentLoader/CustomContentLoader.d.ts.map +0 -1
- package/lib/cjs/CustomContentLoader/CustomContentLoader.js +0 -62
- package/lib/cjs/CustomContentLoader/index.d.ts +0 -2
- package/lib/cjs/CustomContentLoader/index.d.ts.map +0 -1
- package/lib/cjs/CustomContentLoader/index.js +0 -13
- package/lib/cjs/CustomTextInput/CustomTextInput.d.ts +0 -12
- package/lib/cjs/CustomTextInput/CustomTextInput.d.ts.map +0 -1
- package/lib/cjs/CustomTextInput/CustomTextInput.js +0 -48
- package/lib/cjs/CustomTextInput/index.d.ts +0 -2
- package/lib/cjs/CustomTextInput/index.d.ts.map +0 -1
- package/lib/cjs/CustomTextInput/index.js +0 -13
- package/lib/cjs/DropDownList/AsyncDropDownList.d.ts +0 -6
- package/lib/cjs/DropDownList/AsyncDropDownList.d.ts.map +0 -1
- package/lib/cjs/DropDownList/AsyncDropDownList.js +0 -10
- package/lib/cjs/DropDownList/DropDownList.d.ts +0 -8
- package/lib/cjs/DropDownList/DropDownList.d.ts.map +0 -1
- package/lib/cjs/DropDownList/DropDownList.js +0 -141
- package/lib/cjs/DropDownList/DropdownWrapper.d.ts +0 -16
- package/lib/cjs/DropDownList/DropdownWrapper.d.ts.map +0 -1
- package/lib/cjs/DropDownList/DropdownWrapper.js +0 -25
- package/lib/cjs/DropDownList/MultiSelectDropdownList.d.ts +0 -4
- package/lib/cjs/DropDownList/MultiSelectDropdownList.d.ts.map +0 -1
- package/lib/cjs/DropDownList/MultiSelectDropdownList.js +0 -7
- package/lib/cjs/DropDownList/Readme.md +0 -114
- package/lib/cjs/DropDownList/SearchableList.d.ts +0 -14
- package/lib/cjs/DropDownList/SearchableList.d.ts.map +0 -1
- package/lib/cjs/DropDownList/SearchableList.js +0 -104
- package/lib/cjs/DropDownList/SelectList.d.ts +0 -11
- package/lib/cjs/DropDownList/SelectList.d.ts.map +0 -1
- package/lib/cjs/DropDownList/SelectList.js +0 -41
- package/lib/cjs/DropDownList/async.d.ts +0 -9
- package/lib/cjs/DropDownList/async.d.ts.map +0 -1
- package/lib/cjs/DropDownList/async.js +0 -138
- package/lib/cjs/DropDownList/dropdownList.css +0 -54
- package/lib/cjs/DropDownList/dropdownUtils.d.ts +0 -5
- package/lib/cjs/DropDownList/dropdownUtils.d.ts.map +0 -1
- package/lib/cjs/DropDownList/dropdownUtils.js +0 -29
- package/lib/cjs/DropDownList/index.d.ts +0 -4
- package/lib/cjs/DropDownList/index.d.ts.map +0 -1
- package/lib/cjs/DropDownList/index.js +0 -15
- package/lib/cjs/DropDownList/types.d.ts +0 -54
- package/lib/cjs/DropDownList/types.d.ts.map +0 -1
- package/lib/cjs/DropDownList/types.js +0 -2
- package/lib/cjs/DropDownList/withMulti.d.ts +0 -5
- package/lib/cjs/DropDownList/withMulti.d.ts.map +0 -1
- package/lib/cjs/DropDownList/withMulti.js +0 -69
- package/lib/cjs/ErrorBoundary/ErrorBoundary.d.ts +0 -36
- package/lib/cjs/ErrorBoundary/ErrorBoundary.d.ts.map +0 -1
- package/lib/cjs/ErrorBoundary/ErrorBoundary.js +0 -62
- package/lib/cjs/ErrorBoundary/ErrorBoundaryFallbackComponent.d.ts +0 -14
- package/lib/cjs/ErrorBoundary/ErrorBoundaryFallbackComponent.d.ts.map +0 -1
- package/lib/cjs/ErrorBoundary/ErrorBoundaryFallbackComponent.js +0 -40
- package/lib/cjs/ErrorBoundary/index.d.ts +0 -2
- package/lib/cjs/ErrorBoundary/index.d.ts.map +0 -1
- package/lib/cjs/ErrorBoundary/index.js +0 -13
- package/lib/cjs/ErrorPages/Generic403.d.ts +0 -2
- package/lib/cjs/ErrorPages/Generic403.d.ts.map +0 -1
- package/lib/cjs/ErrorPages/Generic403.js +0 -14
- package/lib/cjs/ErrorPages/index.d.ts +0 -2
- package/lib/cjs/ErrorPages/index.d.ts.map +0 -1
- package/lib/cjs/ErrorPages/index.js +0 -13
- package/lib/cjs/FeedbackForm/FeedbackForm.d.ts +0 -11
- package/lib/cjs/FeedbackForm/FeedbackForm.d.ts.map +0 -1
- package/lib/cjs/FeedbackForm/FeedbackForm.js +0 -140
- package/lib/cjs/FeedbackForm/index.d.ts +0 -2
- package/lib/cjs/FeedbackForm/index.d.ts.map +0 -1
- package/lib/cjs/FeedbackForm/index.js +0 -13
- package/lib/cjs/Functional/CaseContactsSelectorExternal.d.ts +0 -30
- package/lib/cjs/Functional/CaseContactsSelectorExternal.d.ts.map +0 -1
- package/lib/cjs/Functional/CaseContactsSelectorExternal.js +0 -223
- package/lib/cjs/Functional/index.d.ts +0 -2
- package/lib/cjs/Functional/index.d.ts.map +0 -1
- package/lib/cjs/Functional/index.js +0 -13
- package/lib/cjs/InlineEdit/InlineEdit.d.ts +0 -37
- package/lib/cjs/InlineEdit/InlineEdit.d.ts.map +0 -1
- package/lib/cjs/InlineEdit/InlineEdit.js +0 -169
- package/lib/cjs/InlineEdit/NewInlineEdit.d.ts +0 -41
- package/lib/cjs/InlineEdit/NewInlineEdit.d.ts.map +0 -1
- package/lib/cjs/InlineEdit/NewInlineEdit.js +0 -178
- package/lib/cjs/InlineEdit/index.d.ts +0 -3
- package/lib/cjs/InlineEdit/index.d.ts.map +0 -1
- package/lib/cjs/InlineEdit/index.js +0 -14
- package/lib/cjs/InlineEdit/inlineEdit.css +0 -29
- package/lib/cjs/InlineEdit/newInlineEdit.css +0 -44
- package/lib/cjs/LanguageSelector/LanguageSelector.d.ts +0 -25
- package/lib/cjs/LanguageSelector/LanguageSelector.d.ts.map +0 -1
- package/lib/cjs/LanguageSelector/LanguageSelector.js +0 -61
- package/lib/cjs/LanguageSelector/index.d.ts +0 -2
- package/lib/cjs/LanguageSelector/index.d.ts.map +0 -1
- package/lib/cjs/LanguageSelector/index.js +0 -13
- package/lib/cjs/LanguageSelector/languageSelector.css +0 -5
- package/lib/cjs/LoadingDots/LoadingDots.css +0 -33
- package/lib/cjs/LoadingDots/LoadingDots.d.ts +0 -11
- package/lib/cjs/LoadingDots/LoadingDots.d.ts.map +0 -1
- package/lib/cjs/LoadingDots/LoadingDots.js +0 -25
- package/lib/cjs/LoadingDots/index.d.ts +0 -2
- package/lib/cjs/LoadingDots/index.d.ts.map +0 -1
- package/lib/cjs/LoadingDots/index.js +0 -14
- package/lib/cjs/LoadingIndicator/LoadingIndicator.d.ts +0 -14
- package/lib/cjs/LoadingIndicator/LoadingIndicator.d.ts.map +0 -1
- package/lib/cjs/LoadingIndicator/LoadingIndicator.js +0 -25
- package/lib/cjs/LoadingIndicator/index.d.ts +0 -2
- package/lib/cjs/LoadingIndicator/index.d.ts.map +0 -1
- package/lib/cjs/LoadingIndicator/index.js +0 -13
- package/lib/cjs/LoadingIndicator/loadingIndicator.css +0 -79
- package/lib/cjs/LoginModal/LoginModal.d.ts +0 -14
- package/lib/cjs/LoginModal/LoginModal.d.ts.map +0 -1
- package/lib/cjs/LoginModal/LoginModal.js +0 -21
- package/lib/cjs/LoginModal/index.d.ts +0 -2
- package/lib/cjs/LoginModal/index.d.ts.map +0 -1
- package/lib/cjs/LoginModal/index.js +0 -13
- package/lib/cjs/MarkdownEditor/MarkdownEditor.d.ts +0 -45
- package/lib/cjs/MarkdownEditor/MarkdownEditor.d.ts.map +0 -1
- package/lib/cjs/MarkdownEditor/MarkdownEditor.js +0 -437
- package/lib/cjs/MarkdownEditor/index.d.ts +0 -2
- package/lib/cjs/MarkdownEditor/index.d.ts.map +0 -1
- package/lib/cjs/MarkdownEditor/index.js +0 -13
- package/lib/cjs/MarkdownEditor/markdownEditor.css +0 -111
- package/lib/cjs/MoreOrLess/MoreOrLess.d.ts +0 -13
- package/lib/cjs/MoreOrLess/MoreOrLess.d.ts.map +0 -1
- package/lib/cjs/MoreOrLess/MoreOrLess.js +0 -71
- package/lib/cjs/MoreOrLess/index.d.ts +0 -2
- package/lib/cjs/MoreOrLess/index.d.ts.map +0 -1
- package/lib/cjs/MoreOrLess/index.js +0 -13
- package/lib/cjs/PaginatedList/PaginatedList.d.ts +0 -18
- package/lib/cjs/PaginatedList/PaginatedList.d.ts.map +0 -1
- package/lib/cjs/PaginatedList/PaginatedList.js +0 -63
- package/lib/cjs/PaginatedList/index.d.ts +0 -2
- package/lib/cjs/PaginatedList/index.d.ts.map +0 -1
- package/lib/cjs/PaginatedList/index.js +0 -13
- package/lib/cjs/PaginationCompact/PaginationCompact.d.ts +0 -9
- package/lib/cjs/PaginationCompact/PaginationCompact.d.ts.map +0 -1
- package/lib/cjs/PaginationCompact/PaginationCompact.js +0 -63
- package/lib/cjs/PaginationCompact/index.d.ts +0 -2
- package/lib/cjs/PaginationCompact/index.d.ts.map +0 -1
- package/lib/cjs/PaginationCompact/index.js +0 -13
- package/lib/cjs/PaginationCompact/paginationCompact.css +0 -5
- package/lib/cjs/PhoneInput/CountryData.d.ts +0 -3
- package/lib/cjs/PhoneInput/CountryData.d.ts.map +0 -1
- package/lib/cjs/PhoneInput/CountryData.js +0 -583
- package/lib/cjs/PhoneInput/PhoneInput.d.ts +0 -19
- package/lib/cjs/PhoneInput/PhoneInput.d.ts.map +0 -1
- package/lib/cjs/PhoneInput/PhoneInput.js +0 -286
- package/lib/cjs/PhoneInput/PhoneInput.scss +0 -753
- package/lib/cjs/PhoneInput/flags.png +0 -0
- package/lib/cjs/PhoneInput/index.d.ts +0 -2
- package/lib/cjs/PhoneInput/index.d.ts.map +0 -1
- package/lib/cjs/PhoneInput/index.js +0 -13
- package/lib/cjs/ProgressBar/CircularProgressBar/CircularProgressBar.d.ts +0 -8
- package/lib/cjs/ProgressBar/CircularProgressBar/CircularProgressBar.d.ts.map +0 -1
- package/lib/cjs/ProgressBar/CircularProgressBar/CircularProgressBar.js +0 -68
- package/lib/cjs/ProgressBar/CircularProgressBar/Path.d.ts +0 -12
- package/lib/cjs/ProgressBar/CircularProgressBar/Path.d.ts.map +0 -1
- package/lib/cjs/ProgressBar/CircularProgressBar/Path.js +0 -39
- package/lib/cjs/ProgressBar/CircularProgressBar/constants.d.ts +0 -6
- package/lib/cjs/ProgressBar/CircularProgressBar/constants.d.ts.map +0 -1
- package/lib/cjs/ProgressBar/CircularProgressBar/constants.js +0 -8
- package/lib/cjs/ProgressBar/CircularProgressBar/index.d.ts +0 -2
- package/lib/cjs/ProgressBar/CircularProgressBar/index.d.ts.map +0 -1
- package/lib/cjs/ProgressBar/CircularProgressBar/index.js +0 -13
- package/lib/cjs/ProgressBar/CircularProgressBar/styles.css +0 -60
- package/lib/cjs/ProgressBar/CircularProgressBar/types.d.ts +0 -32
- package/lib/cjs/ProgressBar/CircularProgressBar/types.d.ts.map +0 -1
- package/lib/cjs/ProgressBar/CircularProgressBar/types.js +0 -2
- package/lib/cjs/ProgressBar/ProgressBar.d.ts +0 -15
- package/lib/cjs/ProgressBar/ProgressBar.d.ts.map +0 -1
- package/lib/cjs/ProgressBar/ProgressBar.js +0 -36
- package/lib/cjs/ProgressBar/index.d.ts +0 -3
- package/lib/cjs/ProgressBar/index.d.ts.map +0 -1
- package/lib/cjs/ProgressBar/index.js +0 -14
- package/lib/cjs/PromisifyModal/PromisifyModal.d.ts +0 -18
- package/lib/cjs/PromisifyModal/PromisifyModal.d.ts.map +0 -1
- package/lib/cjs/PromisifyModal/PromisifyModal.js +0 -40
- package/lib/cjs/PromisifyModal/index.d.ts +0 -2
- package/lib/cjs/PromisifyModal/index.d.ts.map +0 -1
- package/lib/cjs/PromisifyModal/index.js +0 -13
- package/lib/cjs/SubscriptionAbuse/SubscriptionAbuseModal.d.ts +0 -7
- package/lib/cjs/SubscriptionAbuse/SubscriptionAbuseModal.d.ts.map +0 -1
- package/lib/cjs/SubscriptionAbuse/SubscriptionAbuseModal.js +0 -20
- package/lib/cjs/SubscriptionAbuse/const.d.ts +0 -4
- package/lib/cjs/SubscriptionAbuse/const.d.ts.map +0 -1
- package/lib/cjs/SubscriptionAbuse/const.js +0 -15
- package/lib/cjs/SubscriptionAbuse/index.d.ts +0 -3
- package/lib/cjs/SubscriptionAbuse/index.d.ts.map +0 -1
- package/lib/cjs/SubscriptionAbuse/index.js +0 -14
- package/lib/cjs/SupportFeedbackForm/SupportFeedbackForm.d.ts +0 -11
- package/lib/cjs/SupportFeedbackForm/SupportFeedbackForm.d.ts.map +0 -1
- package/lib/cjs/SupportFeedbackForm/SupportFeedbackForm.js +0 -44
- package/lib/cjs/SupportFeedbackForm/SupportFeedbackModal.d.ts +0 -10
- package/lib/cjs/SupportFeedbackForm/SupportFeedbackModal.d.ts.map +0 -1
- package/lib/cjs/SupportFeedbackForm/SupportFeedbackModal.js +0 -178
- package/lib/cjs/SupportFeedbackForm/index.d.ts +0 -3
- package/lib/cjs/SupportFeedbackForm/index.d.ts.map +0 -1
- package/lib/cjs/SupportFeedbackForm/index.js +0 -14
- package/lib/cjs/Table/PFTable.d.ts +0 -39
- package/lib/cjs/Table/PFTable.d.ts.map +0 -1
- package/lib/cjs/Table/PFTable.js +0 -204
- package/lib/cjs/Table/README.md +0 -65
- package/lib/cjs/Table/Table.d.ts.map +0 -1
- package/lib/cjs/Table/Table.js +0 -38
- package/lib/cjs/Table/TableColumnSelector.d.ts +0 -7
- package/lib/cjs/Table/TableColumnSelector.d.ts.map +0 -1
- package/lib/cjs/Table/TableColumnSelector.js +0 -34
- package/lib/cjs/Table/TablePagination.d.ts +0 -18
- package/lib/cjs/Table/TablePagination.d.ts.map +0 -1
- package/lib/cjs/Table/TablePagination.js +0 -44
- package/lib/cjs/Table/TableProvider.d.ts +0 -15
- package/lib/cjs/Table/TableProvider.d.ts.map +0 -1
- package/lib/cjs/Table/TableProvider.js +0 -25
- package/lib/cjs/Table/columnSelector.css +0 -37
- package/lib/cjs/Table/index.d.ts +0 -5
- package/lib/cjs/Table/index.d.ts.map +0 -1
- package/lib/cjs/Table/index.js +0 -16
- package/lib/cjs/TermsAndConditions/AcceptTermsModal.d.ts +0 -14
- package/lib/cjs/TermsAndConditions/AcceptTermsModal.d.ts.map +0 -1
- package/lib/cjs/TermsAndConditions/AcceptTermsModal.js +0 -116
- package/lib/cjs/TermsAndConditions/index.d.ts +0 -2
- package/lib/cjs/TermsAndConditions/index.d.ts.map +0 -1
- package/lib/cjs/TermsAndConditions/index.js +0 -13
- package/lib/cjs/TextAreaAutosize/TextAreaAutosize.d.ts +0 -8
- package/lib/cjs/TextAreaAutosize/TextAreaAutosize.d.ts.map +0 -1
- package/lib/cjs/TextAreaAutosize/TextAreaAutosize.js +0 -136
- package/lib/cjs/TextAreaAutosize/index.d.ts +0 -2
- package/lib/cjs/TextAreaAutosize/index.d.ts.map +0 -1
- package/lib/cjs/TextAreaAutosize/index.js +0 -13
- package/lib/cjs/TextAreaResizable/TextAreaResizable.d.ts +0 -20
- package/lib/cjs/TextAreaResizable/TextAreaResizable.d.ts.map +0 -1
- package/lib/cjs/TextAreaResizable/TextAreaResizable.js +0 -56
- package/lib/cjs/TextAreaResizable/index.d.ts +0 -2
- package/lib/cjs/TextAreaResizable/index.d.ts.map +0 -1
- package/lib/cjs/TextAreaResizable/index.js +0 -13
- package/lib/cjs/ToastNotification/ToastNotification.d.ts +0 -28
- package/lib/cjs/ToastNotification/ToastNotification.d.ts.map +0 -1
- package/lib/cjs/ToastNotification/ToastNotification.js +0 -63
- package/lib/cjs/ToastNotification/index.d.ts +0 -2
- package/lib/cjs/ToastNotification/index.d.ts.map +0 -1
- package/lib/cjs/ToastNotification/index.js +0 -13
- package/lib/cjs/ToastNotification/toastNotification.css +0 -22
- package/lib/cjs/TopContentSearch/TopContentSearch.d.ts +0 -14
- package/lib/cjs/TopContentSearch/TopContentSearch.d.ts.map +0 -1
- package/lib/cjs/TopContentSearch/TopContentSearch.js +0 -138
- package/lib/cjs/TopContentSearch/index.d.ts +0 -2
- package/lib/cjs/TopContentSearch/index.d.ts.map +0 -1
- package/lib/cjs/TopContentSearch/index.js +0 -13
- package/lib/cjs/TopContentSearch/topContentSearch.scss +0 -22
- package/lib/cjs/ValueChangedIcon/ValueChangedIcon.d.ts +0 -14
- package/lib/cjs/ValueChangedIcon/ValueChangedIcon.d.ts.map +0 -1
- package/lib/cjs/ValueChangedIcon/ValueChangedIcon.js +0 -76
- package/lib/cjs/ValueChangedIcon/index.d.ts +0 -2
- package/lib/cjs/ValueChangedIcon/index.d.ts.map +0 -1
- package/lib/cjs/ValueChangedIcon/index.js +0 -13
- package/lib/cjs/helperFunctions/errorMessage.d.ts +0 -12
- package/lib/cjs/helperFunctions/errorMessage.d.ts.map +0 -1
- package/lib/cjs/helperFunctions/errorMessage.js +0 -95
- package/lib/cjs/helperFunctions/errorMessage.scss +0 -3
- package/lib/cjs/helperFunctions/index.d.ts +0 -2
- package/lib/cjs/helperFunctions/index.d.ts.map +0 -1
- package/lib/cjs/helperFunctions/index.js +0 -13
- package/lib/cjs/hooks/index.d.ts +0 -14
- package/lib/cjs/hooks/index.d.ts.map +0 -1
- package/lib/cjs/hooks/index.js +0 -25
- package/lib/cjs/hooks/useBreakpoint.d.ts +0 -12
- package/lib/cjs/hooks/useBreakpoint.d.ts.map +0 -1
- package/lib/cjs/hooks/useBreakpoint.js +0 -86
- package/lib/cjs/hooks/useCopyToClipboard.d.ts +0 -6
- package/lib/cjs/hooks/useCopyToClipboard.d.ts.map +0 -1
- package/lib/cjs/hooks/useCopyToClipboard.js +0 -39
- package/lib/cjs/hooks/useDebounce.d.ts +0 -9
- package/lib/cjs/hooks/useDebounce.d.ts.map +0 -1
- package/lib/cjs/hooks/useDebounce.js +0 -40
- package/lib/cjs/hooks/useFetch.d.ts +0 -20
- package/lib/cjs/hooks/useFetch.d.ts.map +0 -1
- package/lib/cjs/hooks/useFetch.js +0 -71
- package/lib/cjs/hooks/useForceUpdate.d.ts +0 -18
- package/lib/cjs/hooks/useForceUpdate.d.ts.map +0 -1
- package/lib/cjs/hooks/useForceUpdate.js +0 -28
- package/lib/cjs/hooks/useForkRef.d.ts +0 -2
- package/lib/cjs/hooks/useForkRef.d.ts.map +0 -1
- package/lib/cjs/hooks/useForkRef.js +0 -29
- package/lib/cjs/hooks/useIsMounted.d.ts +0 -3
- package/lib/cjs/hooks/useIsMounted.d.ts.map +0 -1
- package/lib/cjs/hooks/useIsMounted.js +0 -18
- package/lib/cjs/hooks/useLRUCache.d.ts +0 -8
- package/lib/cjs/hooks/useLRUCache.d.ts.map +0 -1
- package/lib/cjs/hooks/useLRUCache.js +0 -28
- package/lib/cjs/hooks/useLocalStorage.d.ts +0 -5
- package/lib/cjs/hooks/useLocalStorage.d.ts.map +0 -1
- package/lib/cjs/hooks/useLocalStorage.js +0 -39
- package/lib/cjs/hooks/useOnScreen.d.ts +0 -2
- package/lib/cjs/hooks/useOnScreen.d.ts.map +0 -1
- package/lib/cjs/hooks/useOnScreen.js +0 -18
- package/lib/cjs/hooks/usePolling.d.ts +0 -2
- package/lib/cjs/hooks/usePolling.d.ts.map +0 -1
- package/lib/cjs/hooks/usePolling.js +0 -19
- package/lib/cjs/hooks/usePrevious.d.ts +0 -2
- package/lib/cjs/hooks/usePrevious.d.ts.map +0 -1
- package/lib/cjs/hooks/usePrevious.js +0 -12
- package/lib/cjs/hooks/useTitle.d.ts +0 -2
- package/lib/cjs/hooks/useTitle.d.ts.map +0 -1
- package/lib/cjs/hooks/useTitle.js +0 -14
- package/lib/cjs/hooks/useUndo.d.ts +0 -22
- package/lib/cjs/hooks/useUndo.d.ts.map +0 -1
- package/lib/cjs/hooks/useUndo.js +0 -76
- package/lib/cjs/index.d.ts +0 -34
- package/lib/cjs/index.d.ts.map +0 -1
- package/lib/cjs/index.js +0 -45
- package/lib/esm/PhoneInput/flags.png +0 -0
- package/lib/esm/Table/Table.d.ts +0 -11
- package/lib/esm/Table/Table.d.ts.map +0 -1
- package/lib/esm/Table/TableColumnSelector.d.ts +0 -7
- package/lib/esm/Table/TableColumnSelector.d.ts.map +0 -1
- package/lib/esm/Table/TableColumnSelector.js +0 -27
- package/lib/esm/Table/columnSelector.css +0 -37
|
@@ -11,8 +11,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import './markdownEditor.css';
|
|
13
13
|
import { parseCommentMarkdown } from '@cee-eng/ui-toolkit';
|
|
14
|
-
import { Button, ButtonVariant,
|
|
14
|
+
import { Button, ButtonVariant, DrilldownMenu, Flex, FlexItem, Menu, MenuContainer, MenuContent, MenuItem, MenuList, MenuToggle, Spinner, Text, TextVariants, Toolbar, ToolbarGroup, ToolbarItem, } from '@patternfly/react-core';
|
|
15
|
+
import { Dropdown, DropdownItem, DropdownSeparator, DropdownToggle } from '@patternfly/react-core/deprecated';
|
|
15
16
|
import CodeIcon from '@patternfly/react-icons/dist/js/icons/code-icon';
|
|
17
|
+
import EllipsisVIcon from '@patternfly/react-icons/dist/js/icons/ellipsis-v-icon';
|
|
16
18
|
import ImageIcon from '@patternfly/react-icons/dist/js/icons/image-icon';
|
|
17
19
|
import LinkIcon from '@patternfly/react-icons/dist/js/icons/link-icon';
|
|
18
20
|
import ListUlIcon from '@patternfly/react-icons/dist/js/icons/list-ul-icon';
|
|
@@ -25,6 +27,7 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
25
27
|
import React, { useEffect, useRef, useState } from 'react';
|
|
26
28
|
import { Trans, useTranslation } from 'react-i18next';
|
|
27
29
|
import { useDebounce, usePrevious, useUndo } from '../hooks';
|
|
30
|
+
import { ToastNotification } from '../index';
|
|
28
31
|
export var EditorMode;
|
|
29
32
|
(function (EditorMode) {
|
|
30
33
|
EditorMode["PLAIN"] = "plaintext";
|
|
@@ -50,11 +53,26 @@ const defaultProps = {
|
|
|
50
53
|
showFileSelectorInToolbar: false,
|
|
51
54
|
},
|
|
52
55
|
};
|
|
56
|
+
const MAX_FILE_SIZE = 2 * 1024; // 2MB in KB
|
|
57
|
+
const ALLOWED_FILE_TYPES = ['image/jpeg', 'image/png', 'image/gif'];
|
|
58
|
+
export const validateFile = (file) => {
|
|
59
|
+
// Check file type
|
|
60
|
+
if (!ALLOWED_FILE_TYPES.includes(file.fileType)) {
|
|
61
|
+
// ToastNotification.addDangerMessage(t('Invalid file type, Only JPEG, PNG, GIF files are allowed.'));
|
|
62
|
+
return { isValid: false, errorMsg: 'Invalid file type, Only JPEG, PNG, GIF files are allowed.' };
|
|
63
|
+
}
|
|
64
|
+
// Check file size
|
|
65
|
+
if (file.sizeKB > MAX_FILE_SIZE) {
|
|
66
|
+
// ToastNotification.addDangerMessage(t('File too large, File size must be less than 2MB'));
|
|
67
|
+
return { isValid: false, errorMsg: 'File too large, File size must be less than 2MB' };
|
|
68
|
+
}
|
|
69
|
+
return { isValid: true, errorMsg: '' };
|
|
70
|
+
};
|
|
53
71
|
function MarkdownEditor(props) {
|
|
54
72
|
const { t } = useTranslation();
|
|
55
|
-
const { hidePreviewText, showPreviewText, mdPlaceholder, plainTextPlaceholder, textAreaClassName, bindTextArea, markedownOptions, allowEmoji, hideHeadingOptions, rows, showMarkdownPlainTextToggle, editorMode, className, charLimit, minCharsForCounter, id, onCommentExceedCharsLimit, fileSelectorProps: { onClipboardPaste, onFileDelete, onFileSelect, isSupportedFile, showFileSelectorInToolbar = false, isUploadingFile = false, filesList = [], attachFileBtn, } } = props, textAreaProps = __rest(props, ["hidePreviewText", "showPreviewText", "mdPlaceholder", "plainTextPlaceholder", "textAreaClassName", "bindTextArea", "markedownOptions", "allowEmoji", "hideHeadingOptions", "rows", "showMarkdownPlainTextToggle", "editorMode", "className", "charLimit", "minCharsForCounter", "id", "onCommentExceedCharsLimit", "fileSelectorProps"]);
|
|
73
|
+
const { hidePreviewText, showPreviewText, mdPlaceholder, plainTextPlaceholder, textAreaClassName, bindTextArea, markedownOptions, allowEmoji, hideHeadingOptions, rows, showMarkdownPlainTextToggle, editorMode, className, charLimit, minCharsForCounter, id, value, onCommentExceedCharsLimit, fileSelectorProps: { onClipboardPaste, onFileDelete, onFileSelect, isSupportedFile, showFileSelectorInToolbar = false, isUploadingFile = false, filesList = [], attachFileBtn, } } = props, textAreaProps = __rest(props, ["hidePreviewText", "showPreviewText", "mdPlaceholder", "plainTextPlaceholder", "textAreaClassName", "bindTextArea", "markedownOptions", "allowEmoji", "hideHeadingOptions", "rows", "showMarkdownPlainTextToggle", "editorMode", "className", "charLimit", "minCharsForCounter", "id", "value", "onCommentExceedCharsLimit", "fileSelectorProps"]);
|
|
56
74
|
const [isPreview, setIsPreview] = useState(false);
|
|
57
|
-
const [mdValue, setMdValue] = useState(props.value);
|
|
75
|
+
const [mdValue, setMdValue] = useState(props.value || '');
|
|
58
76
|
const previousFileList = usePrevious(filesList);
|
|
59
77
|
const [isPlainModeEnabled, setIsPlainModeEnabled] = useState(showMarkdownPlainTextToggle && props.editorMode === EditorMode.PLAIN ? true : false);
|
|
60
78
|
const textareaRef = useRef(null);
|
|
@@ -75,6 +93,12 @@ function MarkdownEditor(props) {
|
|
|
75
93
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
76
94
|
}, [filesList]);
|
|
77
95
|
const onFileInsert = (file) => {
|
|
96
|
+
const { isValid, errorMsg } = validateFile(file);
|
|
97
|
+
if (!isValid) {
|
|
98
|
+
ToastNotification.addDangerMessage(t(errorMsg));
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
// Create markdown image syntax
|
|
78
102
|
const template = isImageFile(file.fileType)
|
|
79
103
|
? ``
|
|
80
104
|
: `[${file.fileName}](${file.link})`;
|
|
@@ -114,27 +138,34 @@ function MarkdownEditor(props) {
|
|
|
114
138
|
event.preventDefault();
|
|
115
139
|
onClipboardPaste(files);
|
|
116
140
|
};
|
|
117
|
-
const getFileSelectorList = () => {
|
|
141
|
+
const getFileSelectorList = (isMobile = false) => {
|
|
118
142
|
const filesAsDropdownItems = filesList.map((file) => {
|
|
119
|
-
return (React.createElement(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
React.createElement(
|
|
124
|
-
React.createElement(
|
|
125
|
-
|
|
126
|
-
React.createElement(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
143
|
+
return (React.createElement(React.Fragment, null,
|
|
144
|
+
React.createElement(DropdownItem, { key: file.id, onClick: () => {
|
|
145
|
+
onFileInsert(file);
|
|
146
|
+
} },
|
|
147
|
+
React.createElement(Flex, { flexWrap: { default: 'nowrap' } },
|
|
148
|
+
React.createElement(FlexItem, null,
|
|
149
|
+
React.createElement(Text, { component: TextVariants.small }, file.fileName)),
|
|
150
|
+
onFileDelete && (React.createElement(FlexItem, { className: "pf-v5-u-ml-auto" },
|
|
151
|
+
React.createElement(Button, { variant: ButtonVariant.plain, onClick: (event) => {
|
|
152
|
+
onFileSelectToggle(false);
|
|
153
|
+
onFileDelete(file);
|
|
154
|
+
event.stopPropagation();
|
|
155
|
+
} },
|
|
156
|
+
React.createElement(TrashIcon, { color: "#c9190b" }))))))));
|
|
132
157
|
});
|
|
133
|
-
return
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
158
|
+
return isMobile
|
|
159
|
+
? [
|
|
160
|
+
React.createElement(DropdownItem, { key: "separated link", component: attachFileBtn }),
|
|
161
|
+
...(filesAsDropdownItems.length > 0 ? [React.createElement(DropdownSeparator, { key: "separator" })] : []),
|
|
162
|
+
...filesAsDropdownItems,
|
|
163
|
+
]
|
|
164
|
+
: [
|
|
165
|
+
...filesAsDropdownItems,
|
|
166
|
+
...(filesAsDropdownItems.length > 0 ? [React.createElement(DropdownSeparator, { key: "separator" })] : []),
|
|
167
|
+
React.createElement(DropdownItem, { key: "separated link", component: attachFileBtn }),
|
|
168
|
+
];
|
|
138
169
|
};
|
|
139
170
|
const bindTextAreaRef = (ref) => {
|
|
140
171
|
textareaRef.current = ref;
|
|
@@ -148,16 +179,26 @@ function MarkdownEditor(props) {
|
|
|
148
179
|
const mode = isPlainMode ? EditorMode.PLAIN : EditorMode.MARKDOWN;
|
|
149
180
|
props.onChange(mdValue, mode);
|
|
150
181
|
};
|
|
182
|
+
// Add this useEffect to properly initialize the mdValue when component mounts
|
|
183
|
+
useEffect(() => {
|
|
184
|
+
setMdValue(props.value || '');
|
|
185
|
+
}, [props.value]);
|
|
186
|
+
// Update the existing useEffect to handle both value and editorMode changes
|
|
151
187
|
useEffect(() => {
|
|
152
|
-
if (
|
|
153
|
-
setMdValue(
|
|
188
|
+
if (value !== mdValue) {
|
|
189
|
+
setMdValue(value);
|
|
154
190
|
}
|
|
155
|
-
|
|
191
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
192
|
+
}, [value]);
|
|
156
193
|
useEffect(() => {
|
|
157
|
-
const isPlainMode = props.editorMode === EditorMode.PLAIN
|
|
158
|
-
if (isPlainMode
|
|
159
|
-
|
|
160
|
-
|
|
194
|
+
const isPlainMode = props.editorMode === EditorMode.PLAIN;
|
|
195
|
+
if (isPlainMode !== isPlainModeEnabled) {
|
|
196
|
+
setIsPlainModeEnabled(isPlainMode);
|
|
197
|
+
isPlainModeEnabledRef.current = isPlainMode;
|
|
198
|
+
if (isPlainMode && isPreview) {
|
|
199
|
+
setIsPreview(false);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
161
202
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
162
203
|
}, [props.editorMode]);
|
|
163
204
|
useEffect(() => {
|
|
@@ -174,8 +215,8 @@ function MarkdownEditor(props) {
|
|
|
174
215
|
}, [mdValue], 500);
|
|
175
216
|
const onValueChangeLocal = (text) => {
|
|
176
217
|
const mode = showMarkdownPlainTextToggle && isPlainModeEnabled ? EditorMode.PLAIN : EditorMode.MARKDOWN;
|
|
177
|
-
props.onChange(text, mode);
|
|
178
218
|
setMdValue(text);
|
|
219
|
+
props.onChange(text, mode);
|
|
179
220
|
};
|
|
180
221
|
const textChanged = (event) => {
|
|
181
222
|
let value = event.target.value;
|
|
@@ -183,7 +224,12 @@ function MarkdownEditor(props) {
|
|
|
183
224
|
value = value.replace(emojiPattern, '').trim();
|
|
184
225
|
}
|
|
185
226
|
onValueChangeLocal(value);
|
|
186
|
-
|
|
227
|
+
// Add a null check before calling onCommentExceedCharsLimit
|
|
228
|
+
if (props.onCommentExceedCharsLimit) {
|
|
229
|
+
charLimit - value.length < 0
|
|
230
|
+
? props.onCommentExceedCharsLimit(true)
|
|
231
|
+
: props.onCommentExceedCharsLimit(false);
|
|
232
|
+
}
|
|
187
233
|
};
|
|
188
234
|
const hasSelection = () => {
|
|
189
235
|
return textareaRef.current.selectionStart !== textareaRef.current.selectionEnd;
|
|
@@ -196,18 +242,95 @@ function MarkdownEditor(props) {
|
|
|
196
242
|
const whitespaceEdges = selectedText.match(/^\s*|\s*$/g) || [];
|
|
197
243
|
const leadingWhitespace = whitespaceEdges[0] || '';
|
|
198
244
|
const trailingWhitespace = whitespaceEdges[1] || '';
|
|
245
|
+
const trimmedText = selectedText.trim();
|
|
246
|
+
let coreText = trimmedText;
|
|
247
|
+
// Check existing formatting
|
|
248
|
+
const existingFormats = {
|
|
249
|
+
h1: coreText.startsWith('# '),
|
|
250
|
+
h2: coreText.startsWith('## '),
|
|
251
|
+
h3: coreText.startsWith('### '),
|
|
252
|
+
bold: coreText.startsWith('**') && coreText.endsWith('**'),
|
|
253
|
+
italic: coreText.startsWith('_') && coreText.endsWith('_'),
|
|
254
|
+
quote: coreText.startsWith('> '),
|
|
255
|
+
link: coreText.match(/^\[.*\]\(.*\)$/),
|
|
256
|
+
};
|
|
257
|
+
// Remove existing formatting to get core text
|
|
258
|
+
if (existingFormats.h1)
|
|
259
|
+
coreText = coreText.substring(2);
|
|
260
|
+
else if (existingFormats.h2)
|
|
261
|
+
coreText = coreText.substring(3);
|
|
262
|
+
else if (existingFormats.h3)
|
|
263
|
+
coreText = coreText.substring(4);
|
|
264
|
+
if (existingFormats.bold)
|
|
265
|
+
coreText = coreText.substring(2, coreText.length - 2);
|
|
266
|
+
if (existingFormats.italic)
|
|
267
|
+
coreText = coreText.substring(1, coreText.length - 1);
|
|
268
|
+
if (existingFormats.quote)
|
|
269
|
+
coreText = coreText.substring(2);
|
|
270
|
+
if (existingFormats.link) {
|
|
271
|
+
const match = coreText.match(/^\[(.*)\]\((.*)\)$/);
|
|
272
|
+
if (match)
|
|
273
|
+
coreText = match[1];
|
|
274
|
+
}
|
|
275
|
+
// Determine what formatting we're adding
|
|
276
|
+
const newFormat = {
|
|
277
|
+
h1: templateStart === '# ' && templateEnd === '',
|
|
278
|
+
h2: templateStart === '## ' && templateEnd === '',
|
|
279
|
+
h3: templateStart === '### ' && templateEnd === '',
|
|
280
|
+
bold: templateStart === '**' && templateEnd === '**',
|
|
281
|
+
italic: templateStart === '_' && templateEnd === '_',
|
|
282
|
+
quote: templateStart === '> ' && (templateEnd === '' || templateEnd === '\n'),
|
|
283
|
+
link: templateEnd.includes(']('),
|
|
284
|
+
};
|
|
285
|
+
// Apply formatting
|
|
286
|
+
let formattedText = coreText;
|
|
287
|
+
// First apply inline formatting (bold, italic)
|
|
288
|
+
if (newFormat.italic && !existingFormats.italic) {
|
|
289
|
+
formattedText = `_${formattedText}_`;
|
|
290
|
+
}
|
|
291
|
+
if (existingFormats.italic && !newFormat.italic) {
|
|
292
|
+
formattedText = `_${formattedText}_`;
|
|
293
|
+
}
|
|
294
|
+
if (newFormat.bold && !existingFormats.bold) {
|
|
295
|
+
formattedText = `**${formattedText}**`;
|
|
296
|
+
}
|
|
297
|
+
if (existingFormats.bold && !newFormat.bold) {
|
|
298
|
+
formattedText = `**${formattedText}**`;
|
|
299
|
+
}
|
|
300
|
+
// Then apply block-level formatting (headings, quotes)
|
|
301
|
+
if (newFormat.h1 || existingFormats.h1) {
|
|
302
|
+
formattedText = `# ${formattedText}`;
|
|
303
|
+
}
|
|
304
|
+
else if (newFormat.h2 || existingFormats.h2) {
|
|
305
|
+
formattedText = `## ${formattedText}`;
|
|
306
|
+
}
|
|
307
|
+
else if (newFormat.h3 || existingFormats.h3) {
|
|
308
|
+
formattedText = `### ${formattedText}`;
|
|
309
|
+
}
|
|
310
|
+
// Handle quotes - keep them at the start of the line
|
|
311
|
+
if (newFormat.quote || existingFormats.quote) {
|
|
312
|
+
formattedText = `> ${formattedText}`;
|
|
313
|
+
}
|
|
314
|
+
// Special handling for links
|
|
315
|
+
if (newFormat.link) {
|
|
316
|
+
formattedText = `[${formattedText}](URL "TITLE")`;
|
|
317
|
+
}
|
|
318
|
+
if (existingFormats.link && !newFormat.link) {
|
|
319
|
+
const match = trimmedText.match(/^\[(.*)\]\((.*)\)$/);
|
|
320
|
+
if (match)
|
|
321
|
+
formattedText = `[${formattedText}](${match[2]})`;
|
|
322
|
+
}
|
|
199
323
|
const newText = currentText.substring(0, posStart) +
|
|
200
324
|
leadingWhitespace +
|
|
201
|
-
|
|
202
|
-
selectedText.trim() +
|
|
203
|
-
templateEnd +
|
|
325
|
+
formattedText +
|
|
204
326
|
trailingWhitespace +
|
|
205
327
|
currentText.substring(posEnd);
|
|
206
|
-
|
|
328
|
+
// Set the value in the textarea
|
|
207
329
|
textareaRef.current.value = newText;
|
|
208
|
-
textareaRef.current.selectionStart =
|
|
209
|
-
textareaRef.current.selectionEnd =
|
|
330
|
+
textareaRef.current.selectionStart = posStart + leadingWhitespace.length;
|
|
331
|
+
textareaRef.current.selectionEnd = posStart + leadingWhitespace.length + formattedText.length;
|
|
210
332
|
textareaRef.current.focus();
|
|
333
|
+
// Call onValueChangeLocal only once
|
|
211
334
|
onValueChangeLocal(newText);
|
|
212
335
|
};
|
|
213
336
|
const wrapBasedOnNewLines = () => {
|
|
@@ -290,7 +413,7 @@ function MarkdownEditor(props) {
|
|
|
290
413
|
};
|
|
291
414
|
const quote = () => {
|
|
292
415
|
if (hasSelection()) {
|
|
293
|
-
wrapSelection('> ', '
|
|
416
|
+
wrapSelection('> ', '');
|
|
294
417
|
}
|
|
295
418
|
else {
|
|
296
419
|
insert('> QUOTE', 2, 7);
|
|
@@ -359,54 +482,117 @@ function MarkdownEditor(props) {
|
|
|
359
482
|
// editor is disabled and preview is true -> set preview to false
|
|
360
483
|
props.disabled && isPreview && setIsPreview(false);
|
|
361
484
|
const disablePreviewButton = mdValue === '';
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
485
|
+
const [isHeadingDropdownOpen, setIsHeadingDropdownOpen] = React.useState(false);
|
|
486
|
+
const onToggle = (_event, isOpen) => {
|
|
487
|
+
setIsHeadingDropdownOpen(isOpen);
|
|
488
|
+
};
|
|
489
|
+
const onHeadingSelect = () => {
|
|
490
|
+
setIsHeadingDropdownOpen(false);
|
|
491
|
+
};
|
|
492
|
+
const [isDrillMenuOpen, setIsDrillMenuOpen] = React.useState(false);
|
|
493
|
+
const [activeMenu, setActiveMenu] = useState('toolsKebabMenu');
|
|
494
|
+
const [menuDrilledIn, setMenuDrilledIn] = useState([]);
|
|
495
|
+
const [drilldownPath, setDrilldownPath] = useState([]);
|
|
496
|
+
const [menuHeights, setMenuHeights] = useState({});
|
|
497
|
+
const toggleRef = useRef(null);
|
|
498
|
+
const drillMenuRef = useRef(null);
|
|
499
|
+
const onToggleClick = (e) => {
|
|
500
|
+
e.stopPropagation();
|
|
501
|
+
setIsDrillMenuOpen(!isDrillMenuOpen);
|
|
502
|
+
setMenuDrilledIn([]);
|
|
503
|
+
setDrilldownPath([]);
|
|
504
|
+
setActiveMenu('toolsKebabMenu');
|
|
505
|
+
};
|
|
506
|
+
const drillIn = (_event, fromMenuId, toMenuId, pathId) => {
|
|
507
|
+
setMenuDrilledIn([...menuDrilledIn, fromMenuId]);
|
|
508
|
+
setDrilldownPath([...drilldownPath, pathId]);
|
|
509
|
+
setActiveMenu(toMenuId);
|
|
510
|
+
};
|
|
511
|
+
const drillOut = (_event, toMenuId) => {
|
|
512
|
+
setMenuDrilledIn(menuDrilledIn.slice(0, menuDrilledIn.length - 1));
|
|
513
|
+
setDrilldownPath(drilldownPath.slice(0, drilldownPath.length - 1));
|
|
514
|
+
setActiveMenu(toMenuId);
|
|
515
|
+
};
|
|
516
|
+
const setHeight = (menuId, height) => {
|
|
517
|
+
if (!menuHeights[menuId] || (menuId !== 'toolsKebabMenu' && menuHeights[menuId] !== height)) {
|
|
518
|
+
setMenuHeights(Object.assign(Object.assign({}, menuHeights), { [menuId]: height }));
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
const markdownGuidanceBtn = (React.createElement("a", { className: "pf-v5-c-button pf-m-link pf-m-inline markdown-guidance", rel: "noopener noreferrer", target: "_blank", href: "/articles/4729621", "data-tracking-id": "md-guidance" },
|
|
522
|
+
React.createElement(Trans, null, "Markdown guidance")));
|
|
523
|
+
return (React.createElement("div", { id: "markdown-editor" },
|
|
524
|
+
!isPlainModeEnabled && React.createElement("div", { className: "markdown-guidance-container" }, markdownGuidanceBtn),
|
|
525
|
+
React.createElement("div", { className: `markdown-editor-container ${props.className}`, id: props.id, "data-tracking-id": "md-editor-container", onDrop: onDrop, onPaste: onPaste },
|
|
526
|
+
React.createElement("div", { className: "toolbar-container border-bottom" }, !isPlainModeEnabled && (React.createElement(React.Fragment, null,
|
|
527
|
+
React.createElement(Toolbar, { className: "desktop-markdown-toolbar pf-v5-l-flex" },
|
|
528
|
+
React.createElement(ToolbarGroup, { "data-tracking-id": "md-editor-toolbar", className: "markdown-toolbar-left-section pf-m-wrap" },
|
|
529
|
+
React.createElement(Button, { variant: ButtonVariant.plain, tabIndex: -1, isDisabled: props.disabled || isPreview, onClick: bold, "data-tracking-id": "md-editor-toolbar-b", title: "Bold" }, "B"),
|
|
530
|
+
React.createElement(Button, { variant: ButtonVariant.plain, tabIndex: -1, isDisabled: props.disabled || isPreview, onClick: italic, "data-tracking-id": "md-editor-toolbar-i", title: "Italic" }, "I"),
|
|
531
|
+
React.createElement("div", { className: "btn-group-separator" }),
|
|
532
|
+
!props.hideHeadingOptions && (React.createElement(React.Fragment, null,
|
|
533
|
+
React.createElement(Button, { tabIndex: -1, variant: ButtonVariant.plain, isDisabled: props.disabled || isPreview, onClick: h1, title: "Heading 1", "data-tracking-id": "md-editor-toolbar-h1" }, "H1"),
|
|
534
|
+
React.createElement(Button, { tabIndex: -1, variant: ButtonVariant.plain, isDisabled: props.disabled || isPreview, onClick: h2, title: "Heading 2", "data-tracking-id": "md-editor-toolbar-h2" }, "H2"),
|
|
535
|
+
React.createElement(Button, { tabIndex: -1, variant: ButtonVariant.plain, isDisabled: props.disabled || isPreview, onClick: h3, title: "Heading 3", "data-tracking-id": "md-editor-toolbar-h3" }, "H3"),
|
|
536
|
+
React.createElement("div", { className: "btn-group-separator" }))),
|
|
537
|
+
React.createElement(Button, { tabIndex: -1, isDisabled: props.disabled || isPreview, variant: ButtonVariant.plain, onClick: list, title: "Bullet List", "data-tracking-id": "md-editor-toolbar-bul-list" },
|
|
538
|
+
React.createElement(ListUlIcon, null)),
|
|
539
|
+
React.createElement("div", { className: "btn-group-separator" }),
|
|
540
|
+
React.createElement(Button, { tabIndex: -1, variant: ButtonVariant.plain, isDisabled: props.disabled || isPreview, onClick: link, title: "Link", "data-tracking-id": "md-editor-toolbar-link" },
|
|
541
|
+
React.createElement(LinkIcon, null)),
|
|
542
|
+
React.createElement(Button, { tabIndex: -1, variant: ButtonVariant.plain, isDisabled: props.disabled || isPreview, onClick: quote, title: "Quote", "data-tracking-id": "md-editor-toolbar-quote" },
|
|
543
|
+
React.createElement(QuoteRightIcon, null)),
|
|
544
|
+
React.createElement(Button, { tabIndex: -1, variant: ButtonVariant.plain, isDisabled: props.disabled || isPreview, onClick: code, title: "Code", "data-tracking-id": "md-editor-toolbar-code" },
|
|
545
|
+
React.createElement(CodeIcon, null)),
|
|
546
|
+
showFileSelectorInToolbar && (React.createElement(Dropdown, { onSelect: onFileSelectLocal, id: "md-editor-toolbar-file-selector", toggle: React.createElement(DropdownToggle, { "aria-label": "file selector", onToggle: (_event, isOpen) => onFileSelectToggle(isOpen), isDisabled: props.disabled || isPreview },
|
|
547
|
+
React.createElement(ImageIcon, null)), dropdownItems: getFileSelectorList(), tabIndex: -1, isPlain: true, menuAppendTo: document.body, isOpen: isFileSelectorOpen, "data-tracking-id": "md-editor-toolbar-file-selector" }))),
|
|
548
|
+
React.createElement(ToolbarItem, null, markdownGuidanceBtn)),
|
|
549
|
+
React.createElement(Toolbar, { className: "mobile-markdown-toolbar" },
|
|
550
|
+
React.createElement("div", { className: "mobile-markdown-toolbar" },
|
|
551
|
+
React.createElement(ToolbarGroup, { spaceItems: { default: 'spaceItemsNone' }, "data-tracking-id": "mobile-md-editor-toolbar", className: "markdown-toolbar-left-section" },
|
|
552
|
+
!props.hideHeadingOptions && (React.createElement(Dropdown, { isText: true, isPlain: true, onSelect: onHeadingSelect, toggle: React.createElement(DropdownToggle, { id: "heading-selector", onToggle: onToggle }, "Heading"), isOpen: isHeadingDropdownOpen, dropdownItems: [
|
|
553
|
+
React.createElement(DropdownItem, { key: "heading-1", tabIndex: -1, isDisabled: props.disabled || isPreview, onClick: h1, title: "Heading 1", "data-tracking-id": "mobile-md-editor-toolbar-h1" }, "Heading 1"),
|
|
554
|
+
React.createElement(DropdownItem, { tabIndex: -1, isDisabled: props.disabled || isPreview, onClick: h2, title: "Heading 2", "data-tracking-id": "mobile-md-editor-toolbar-h2" }, "Heading 2"),
|
|
555
|
+
React.createElement(DropdownItem, { tabIndex: -1, isDisabled: props.disabled || isPreview, onClick: h3, title: "Heading 3", "data-tracking-id": "mobile-md-editor-toolbar-h3" }, "Heading 3"),
|
|
556
|
+
] })),
|
|
557
|
+
React.createElement(Button, { variant: ButtonVariant.plain, tabIndex: -1, isDisabled: props.disabled || isPreview, onClick: bold, "data-tracking-id": "mobile-md-editor-toolbar-b", title: "Bold", className: "mobile-markdown-tool-item" }, "B"),
|
|
558
|
+
React.createElement(Button, { variant: ButtonVariant.plain, tabIndex: -1, isDisabled: props.disabled || isPreview, onClick: italic, "data-tracking-id": "mobile-md-editor-toolbar-i", title: "Italic", className: "mobile-markdown-tool-item" }, "I"),
|
|
559
|
+
React.createElement(Button, { tabIndex: -1, isDisabled: props.disabled || isPreview, variant: ButtonVariant.plain, onClick: list, title: "Bullet List", "data-tracking-id": "mobile-md-editor-toolbar-bul-list", className: "mobile-markdown-tool-item" },
|
|
560
|
+
React.createElement(ListUlIcon, null)),
|
|
561
|
+
React.createElement(Button, { tabIndex: -1, variant: ButtonVariant.plain, isDisabled: props.disabled || isPreview, onClick: code, title: "Code", "data-tracking-id": "mobile-md-editor-toolbar-code", className: "mobile-markdown-tool-item" },
|
|
562
|
+
React.createElement(CodeIcon, null))),
|
|
563
|
+
React.createElement(ToolbarItem, { id: "tools-kebab-menu-container", className: "mobile-markdown-tool-item", spacer: { default: 'spacerSm' } },
|
|
564
|
+
React.createElement(MenuContainer, { isOpen: isDrillMenuOpen, onOpenChange: (isOpen) => setIsDrillMenuOpen(isOpen), popperProps: { position: 'left' }, menu: React.createElement(Menu, { id: "toolsKebabMenu", containsDrilldown: true, drilldownItemPath: drilldownPath, drilledInMenus: menuDrilledIn, activeMenu: activeMenu, onDrillIn: drillIn, onDrillOut: drillOut, onGetMenuHeight: setHeight, ref: drillMenuRef },
|
|
565
|
+
React.createElement(MenuContent, { menuHeight: `${menuHeights[activeMenu]}px` },
|
|
566
|
+
React.createElement(MenuList, null,
|
|
567
|
+
React.createElement(MenuItem, { itemId: "link-btn-menu-item", isDisabled: props.disabled || isPreview, onClick: link, "data-tracking-id": "mobile-md-editor-toolbar-link", icon: React.createElement(LinkIcon, { "aria-hidden": true }) }, "Link"),
|
|
568
|
+
React.createElement(MenuItem, { itemId: "code-btn-menu-item", isDisabled: props.disabled || isPreview, onClick: quote, "data-tracking-id": "mobile-md-editor-toolbar-quote", icon: React.createElement(QuoteRightIcon, { "aria-hidden": true }) }, "Quote"),
|
|
569
|
+
React.createElement(MenuItem, { itemId: "group:manage_attachments", direction: "down", icon: React.createElement(ImageIcon, { "aria-hidden": true }), drilldownMenu: React.createElement(DrilldownMenu, { id: "drilldownMenuStart" },
|
|
570
|
+
React.createElement(MenuItem, { itemId: "group:manage_attachments_breadcrumb", direction: "up" }, "Manage attachments"),
|
|
571
|
+
React.createElement("div", { className: "attachments-items" }, getFileSelectorList(true))) }, "Manage Attachments")))), menuRef: drillMenuRef, toggle: React.createElement(MenuToggle, { variant: "plain", ref: toggleRef, onClick: onToggleClick, isExpanded: isDrillMenuOpen },
|
|
572
|
+
React.createElement(EllipsisVIcon, null)), toggleRef: toggleRef }))))))),
|
|
573
|
+
React.createElement("div", { className: "markdown-content" }, !isPreview ? (React.createElement("textarea", Object.assign({}, textAreaProps, { onKeyDown: keydown, placeholder: isPlainModeEnabled ? t(props.plainTextPlaceholder) : t(props.mdPlaceholder), ref: bindTextAreaRef, className: cx('form-control', 'markdown-text-area', props.textAreaClassName, 'textArea'), value: mdValue, onChange: textChanged, rows: props.rows || contentRows, style: { height: '313px' } }))) : (React.createElement("div", { className: "markdown-preview-placeholder", style: { height: '313px' } },
|
|
574
|
+
React.createElement("div", { className: "markdown-preview", style: { maxHeight: '313px' } },
|
|
575
|
+
React.createElement("div", { dangerouslySetInnerHTML: {
|
|
576
|
+
__html: DOMPurify.sanitize(previewMDText(mdValue)),
|
|
577
|
+
} }))))),
|
|
578
|
+
React.createElement("div", null, props.showMarkdownPlainTextToggle && (React.createElement("div", { className: `markdown-toggle-toolbar pf-v5-l-flex` },
|
|
579
|
+
React.createElement("span", { className: "markdown-toolbar-left-section pf-m-wrap" },
|
|
580
|
+
!isPlainModeEnabled && (React.createElement(Button, { className: "markdown-preview-btn", tabIndex: -1, variant: ButtonVariant.link, onClick: preview, title: "Show preview", "data-tracking-id": `md-preview-${isPreview ? 'hide' : 'show'}`, isDisabled: disablePreviewButton }, isPreview ? (React.createElement("span", null,
|
|
581
|
+
" ",
|
|
582
|
+
t(hidePreviewText))) : (React.createElement("span", null,
|
|
583
|
+
" ",
|
|
584
|
+
t(showPreviewText))))),
|
|
585
|
+
isUploadingFile && (React.createElement(React.Fragment, null,
|
|
586
|
+
React.createElement(Trans, null,
|
|
587
|
+
React.createElement("small", { className: "pf-v5-u-pl-md uploading-spinner-text" },
|
|
588
|
+
React.createElement(Trans, null, "Uploading File"))),
|
|
589
|
+
React.createElement(Spinner, { className: "pf-v5-u-ml-sm", size: "sm" }))),
|
|
590
|
+
mdValue.length > props.minCharsForCounter && getCharCountText(mdValue)),
|
|
591
|
+
React.createElement("span", null,
|
|
592
|
+
React.createElement(Button, { variant: "plain", className: `${isPlainModeEnabled ? 'markdown-active-mode' : ''} plain-mode-btn`, onClick: () => onModeChange(true), isDisabled: isPlainModeEnabled || isUploadingFile, "data-tracking-id": "md-editor-plaintext" },
|
|
593
|
+
React.createElement(Trans, null, "Plain text")),
|
|
594
|
+
React.createElement(Button, { variant: "plain", className: `${!isPlainModeEnabled ? 'markdown-active-mode' : ''} markdown-mode-btn`, onClick: () => onModeChange(false), isDisabled: !isPlainModeEnabled, "data-tracking-id": "md-editor-md" },
|
|
595
|
+
React.createElement(Trans, null, "Markdown")))))))));
|
|
410
596
|
}
|
|
411
597
|
MarkdownEditor.defaultProps = defaultProps;
|
|
412
598
|
export { MarkdownEditor };
|
|
@@ -22,10 +22,9 @@
|
|
|
22
22
|
border: 1px solid #d2d2d2;
|
|
23
23
|
display: block;
|
|
24
24
|
min-height: 100px;
|
|
25
|
-
overflow: hidden;
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
.markdown-editor-container .pf-c-toolbar {
|
|
27
|
+
.markdown-editor-container .pf-v5-c-toolbar {
|
|
29
28
|
padding: 0.5rem;
|
|
30
29
|
}
|
|
31
30
|
|
|
@@ -35,6 +34,7 @@
|
|
|
35
34
|
margin-left: 10px;
|
|
36
35
|
margin-right: 5px;
|
|
37
36
|
width: 1px;
|
|
37
|
+
margin-top: 10px;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.markdown-content .markdown-text-area {
|
|
@@ -65,8 +65,12 @@
|
|
|
65
65
|
color: #06c;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
.markdown-editor-container .markdown-guidance {
|
|
69
|
-
padding-
|
|
68
|
+
.markdown-editor-container .pf-v5-c-button.pf-m-link.pf-m-inline.markdown-guidance {
|
|
69
|
+
padding-block-start: 0.375rem;
|
|
70
|
+
padding-block-end: 0.375rem;
|
|
71
|
+
padding-inline-start: 0.375rem;
|
|
72
|
+
padding-inline-end: 0.375rem;
|
|
73
|
+
box-sizing: border-box;
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
.markdown-editor-container .character-count-wrapper {
|
|
@@ -91,7 +95,6 @@ a[href*='/attachments/']::before,
|
|
|
91
95
|
button[data-link*='/attachments/']::before {
|
|
92
96
|
margin-right: 4px;
|
|
93
97
|
font-style: normal;
|
|
94
|
-
font-size: inherit;
|
|
95
98
|
text-rendering: auto;
|
|
96
99
|
-webkit-font-smoothing: antialiased;
|
|
97
100
|
content: '📎';
|
|
@@ -109,3 +112,108 @@ button[data-link*='/attachments/']::before {
|
|
|
109
112
|
.markdown-preview {
|
|
110
113
|
border-bottom: none !important;
|
|
111
114
|
}
|
|
115
|
+
|
|
116
|
+
.desktop-markdown-toolbar {
|
|
117
|
+
display: flex;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.markdown-toolbar-left-section {
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.btn-group-separator {
|
|
126
|
+
display: inline-block;
|
|
127
|
+
width: 1px;
|
|
128
|
+
height: 24px;
|
|
129
|
+
margin: 0 8px;
|
|
130
|
+
background-color: #ccc;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.markdown-guidance-container {
|
|
134
|
+
display: none;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.mobile-markdown-toolbar {
|
|
138
|
+
display: none;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
#toolsKebabMenu {
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
inset: 0px auto auto -12rem !important;
|
|
144
|
+
|
|
145
|
+
.pf-v5-c-menu__list {
|
|
146
|
+
padding-left: 0px !important;
|
|
147
|
+
padding-right: 0px !important;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.attachments-items li {
|
|
151
|
+
padding: 0px 10px !important;
|
|
152
|
+
|
|
153
|
+
.pf-v5-c-divider {
|
|
154
|
+
width: 15rem;
|
|
155
|
+
margin-left: -1rem;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* Mobile toolbar styles */
|
|
161
|
+
@media (max-width: 880px) {
|
|
162
|
+
.desktop-markdown-toolbar {
|
|
163
|
+
display: none;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.markdown-guidance-container {
|
|
167
|
+
display: flex;
|
|
168
|
+
justify-content: flex-end;
|
|
169
|
+
padding: 9px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.mobile-markdown-toolbar {
|
|
173
|
+
display: flex;
|
|
174
|
+
flex-direction: row;
|
|
175
|
+
justify-content: space-between;
|
|
176
|
+
align-items: center;
|
|
177
|
+
|
|
178
|
+
.mobile-markdown-tool-item {
|
|
179
|
+
width: 2.5rem !important;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.markdown-toolbar-left-section {
|
|
184
|
+
margin-inline-end: 0px !important;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.markdown-preview-btn,
|
|
188
|
+
.plain-mode-btn,
|
|
189
|
+
.markdown-mode-btn {
|
|
190
|
+
padding-left: 4px;
|
|
191
|
+
padding-right: 4px;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.markdown-editor-container .markdown-toggle-toolbar button {
|
|
195
|
+
font-size: 14px;
|
|
196
|
+
padding: 10px 0.25rem;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
@media (max-width: 475px) {
|
|
201
|
+
.markdown-editor-container .pf-v5-c-toolbar {
|
|
202
|
+
padding: 0.5rem 0rem;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.mobile-markdown-toolbar {
|
|
206
|
+
.mobile-markdown-tool-item {
|
|
207
|
+
width: 0.1rem !important;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
#tools-kebab-menu-container {
|
|
211
|
+
position: relative;
|
|
212
|
+
right: 2rem;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.uploading-spinner-text {
|
|
217
|
+
display: none;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
@@ -5,7 +5,7 @@ interface IProps {
|
|
|
5
5
|
className?: string;
|
|
6
6
|
appStickyHeaderRef?: React.MutableRefObject<HTMLElement>;
|
|
7
7
|
}
|
|
8
|
-
declare function MoreOrLess(props: IProps): JSX.Element;
|
|
8
|
+
declare function MoreOrLess(props: IProps): React.JSX.Element;
|
|
9
9
|
declare namespace MoreOrLess {
|
|
10
10
|
var defaultProps: Partial<IProps>;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoreOrLess.d.ts","sourceRoot":"","sources":["../../../src/MoreOrLess/MoreOrLess.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAIxE,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,GAAG,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;CAC5D;AAOD,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"MoreOrLess.d.ts","sourceRoot":"","sources":["../../../src/MoreOrLess/MoreOrLess.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAIxE,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,GAAG,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;CAC5D;AAOD,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,qBAgEhC;kBAhEQ,UAAU;;;AAoEnB,OAAO,EAAE,UAAU,EAAE,CAAC"}
|