@churchapps/apphelper 0.4.11 → 0.4.17
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/dist/components/DisplayBox.js +12 -18
- package/dist/components/DisplayBox.js.map +1 -1
- package/dist/components/ErrorMessages.js +9 -46
- package/dist/components/ErrorMessages.js.map +1 -1
- package/dist/components/ExportLink.d.ts.map +1 -1
- package/dist/components/ExportLink.js +8 -10
- package/dist/components/ExportLink.js.map +1 -1
- package/dist/components/FloatingSupport.js +7 -14
- package/dist/components/FloatingSupport.js.map +1 -1
- package/dist/components/FormCardPayment.d.ts.map +1 -1
- package/dist/components/FormCardPayment.js +28 -64
- package/dist/components/FormCardPayment.js.map +1 -1
- package/dist/components/FormSubmissionEdit.js +28 -65
- package/dist/components/FormSubmissionEdit.js.map +1 -1
- package/dist/components/HelpIcon.js +3 -7
- package/dist/components/HelpIcon.js.map +1 -1
- package/dist/components/ImageEditor.d.ts.map +1 -1
- package/dist/components/ImageEditor.js +13 -19
- package/dist/components/ImageEditor.js.map +1 -1
- package/dist/components/InputBox.d.ts.map +1 -1
- package/dist/components/InputBox.js +13 -15
- package/dist/components/InputBox.js.map +1 -1
- package/dist/components/Loading.d.ts +0 -1
- package/dist/components/Loading.d.ts.map +1 -1
- package/dist/components/Loading.js +52 -12
- package/dist/components/Loading.js.map +1 -1
- package/dist/components/QuestionEdit.js +20 -26
- package/dist/components/QuestionEdit.js.map +1 -1
- package/dist/components/SmallButton.js +9 -15
- package/dist/components/SmallButton.js.map +1 -1
- package/dist/components/SupportModal.d.ts.map +1 -1
- package/dist/components/SupportModal.js +5 -9
- package/dist/components/SupportModal.js.map +1 -1
- package/dist/components/TabPanel.js +5 -9
- package/dist/components/TabPanel.js.map +1 -1
- package/dist/components/header/Banner.js +3 -7
- package/dist/components/header/Banner.js.map +1 -1
- package/dist/components/header/PrimaryMenu.d.ts.map +1 -1
- package/dist/components/header/PrimaryMenu.js +30 -30
- package/dist/components/header/PrimaryMenu.js.map +1 -1
- package/dist/components/header/SecondaryMenu.js +6 -10
- package/dist/components/header/SecondaryMenu.js.map +1 -1
- package/dist/components/header/SecondaryMenuAlt.js +8 -15
- package/dist/components/header/SecondaryMenuAlt.js.map +1 -1
- package/dist/components/header/SiteHeader.js +12 -16
- package/dist/components/header/SiteHeader.js.map +1 -1
- package/dist/components/header/SupportDrawer.js +14 -18
- package/dist/components/header/SupportDrawer.js.map +1 -1
- package/dist/components/header/index.js +2 -7
- package/dist/components/header/index.js.map +1 -1
- package/dist/components/index.d.ts +0 -4
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +16 -52
- package/dist/components/index.js.map +1 -1
- package/dist/components/notes/AddNote.js +17 -53
- package/dist/components/notes/AddNote.js.map +1 -1
- package/dist/components/notes/Note.js +11 -15
- package/dist/components/notes/Note.js.map +1 -1
- package/dist/components/notes/Notes.js +21 -27
- package/dist/components/notes/Notes.js.map +1 -1
- package/dist/components/notes/index.js +3 -9
- package/dist/components/notes/index.js.map +1 -1
- package/dist/components/wrapper/AppList.d.ts.map +1 -1
- package/dist/components/wrapper/AppList.js +7 -13
- package/dist/components/wrapper/AppList.js.map +1 -1
- package/dist/components/wrapper/ChurchList.js +16 -20
- package/dist/components/wrapper/ChurchList.js.map +1 -1
- package/dist/components/wrapper/Drawers.js +5 -10
- package/dist/components/wrapper/Drawers.js.map +1 -1
- package/dist/components/wrapper/NavItem.js +11 -15
- package/dist/components/wrapper/NavItem.js.map +1 -1
- package/dist/components/wrapper/NewPrivateMessage.js +19 -56
- package/dist/components/wrapper/NewPrivateMessage.js.map +1 -1
- package/dist/components/wrapper/Notifications.js +19 -50
- package/dist/components/wrapper/Notifications.js.map +1 -1
- package/dist/components/wrapper/PrivateMessageDetails.js +5 -9
- package/dist/components/wrapper/PrivateMessageDetails.js.map +1 -1
- package/dist/components/wrapper/PrivateMessages.d.ts.map +1 -1
- package/dist/components/wrapper/PrivateMessages.js +26 -60
- package/dist/components/wrapper/PrivateMessages.js.map +1 -1
- package/dist/components/wrapper/SiteWrapper.d.ts.map +1 -1
- package/dist/components/wrapper/SiteWrapper.js +42 -42
- package/dist/components/wrapper/SiteWrapper.js.map +1 -1
- package/dist/components/wrapper/TabPanel.js +5 -8
- package/dist/components/wrapper/TabPanel.js.map +1 -1
- package/dist/components/wrapper/UserMenu.d.ts.map +1 -1
- package/dist/components/wrapper/UserMenu.js +35 -44
- package/dist/components/wrapper/UserMenu.js.map +1 -1
- package/dist/components/wrapper/index.js +7 -17
- package/dist/components/wrapper/index.js.map +1 -1
- package/dist/helpers/AnalyticsHelper.d.ts.map +1 -1
- package/dist/helpers/AnalyticsHelper.js +11 -19
- package/dist/helpers/AnalyticsHelper.js.map +1 -1
- package/dist/helpers/ApiHelper.js +3 -7
- package/dist/helpers/ApiHelper.js.map +1 -1
- package/dist/helpers/AppearanceHelper.js +1 -5
- package/dist/helpers/AppearanceHelper.js.map +1 -1
- package/dist/helpers/ArrayHelper.js +3 -7
- package/dist/helpers/ArrayHelper.js.map +1 -1
- package/dist/helpers/CurrencyHelper.js +1 -5
- package/dist/helpers/CurrencyHelper.js.map +1 -1
- package/dist/helpers/DateHelper.js +3 -7
- package/dist/helpers/DateHelper.js.map +1 -1
- package/dist/helpers/ErrorHelper.js +3 -7
- package/dist/helpers/ErrorHelper.js.map +1 -1
- package/dist/helpers/EventHelper.js +5 -9
- package/dist/helpers/EventHelper.js.map +1 -1
- package/dist/helpers/FileHelper.js +3 -10
- package/dist/helpers/FileHelper.js.map +1 -1
- package/dist/helpers/Locale.js +11 -18
- package/dist/helpers/Locale.js.map +1 -1
- package/dist/helpers/PersonHelper.d.ts.map +1 -1
- package/dist/helpers/PersonHelper.js +5 -9
- package/dist/helpers/PersonHelper.js.map +1 -1
- package/dist/helpers/SlugHelper.js +4 -11
- package/dist/helpers/SlugHelper.js.map +1 -1
- package/dist/helpers/SocketHelper.d.ts +12 -0
- package/dist/helpers/SocketHelper.d.ts.map +1 -1
- package/dist/helpers/SocketHelper.js +157 -43
- package/dist/helpers/SocketHelper.js.map +1 -1
- package/dist/helpers/UniqueIdHelper.js +1 -5
- package/dist/helpers/UniqueIdHelper.js.map +1 -1
- package/dist/helpers/UserHelper.js +7 -11
- package/dist/helpers/UserHelper.js.map +1 -1
- package/dist/helpers/createEmotionCache.js +3 -9
- package/dist/helpers/createEmotionCache.js.map +1 -1
- package/dist/helpers/index.d.ts +5 -16
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +9 -54
- package/dist/helpers/index.js.map +1 -1
- package/dist/hooks/index.js +1 -5
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useMountedState.js +5 -9
- package/dist/hooks/useMountedState.js.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -22
- package/dist/index.js.map +1 -1
- package/package.json +6 -28
- package/src/components/ExportLink.tsx +12 -3
- package/src/components/FormCardPayment.tsx +2 -1
- package/src/components/ImageEditor.tsx +15 -12
- package/src/components/InputBox.tsx +2 -1
- package/src/components/Loading.tsx +47 -1
- package/src/components/SupportModal.tsx +8 -3
- package/src/components/header/PrimaryMenu.tsx +85 -42
- package/src/components/index.tsx +0 -5
- package/src/components/wrapper/AppList.tsx +1 -4
- package/src/components/wrapper/Notifications.tsx +2 -2
- package/src/components/wrapper/PrivateMessages.tsx +10 -1
- package/src/components/wrapper/SiteWrapper.tsx +24 -13
- package/src/components/wrapper/UserMenu.tsx +1 -4
- package/src/helpers/AnalyticsHelper.ts +1 -2
- package/src/helpers/Locale.ts +1 -1
- package/src/helpers/PersonHelper.ts +1 -2
- package/src/helpers/SocketHelper.ts +176 -37
- package/src/helpers/index.ts +44 -16
- package/src/index.ts +1 -4
- package/tsconfig.json +2 -2
- package/.eslintignore +0 -4
- package/.github/FUNDING.yml +0 -1
- package/.vscode/settings.json +0 -6
- package/CHUMS_COMPONENT_EXTRACTION_CANDIDATES.md +0 -210
- package/CLAUDE.md +0 -111
- package/COMPONENT_USAGE_REPORT.md +0 -322
- package/LICENSE +0 -21
- package/README.md +0 -24
- package/b1app-specific-components.md +0 -146
- package/component-usage-analysis.md +0 -169
- package/dist/components/markdownEditor/Editor.d.ts +0 -13
- package/dist/components/markdownEditor/Editor.d.ts.map +0 -1
- package/dist/components/markdownEditor/Editor.js +0 -92
- package/dist/components/markdownEditor/Editor.js.map +0 -1
- package/dist/components/markdownEditor/IconNamesList.d.ts +0 -3
- package/dist/components/markdownEditor/IconNamesList.d.ts.map +0 -1
- package/dist/components/markdownEditor/IconNamesList.js +0 -16
- package/dist/components/markdownEditor/IconNamesList.js.map +0 -1
- package/dist/components/markdownEditor/MarkdownEditor.d.ts +0 -10
- package/dist/components/markdownEditor/MarkdownEditor.d.ts.map +0 -1
- package/dist/components/markdownEditor/MarkdownEditor.js +0 -45
- package/dist/components/markdownEditor/MarkdownEditor.js.map +0 -1
- package/dist/components/markdownEditor/MarkdownModal.d.ts +0 -9
- package/dist/components/markdownEditor/MarkdownModal.d.ts.map +0 -1
- package/dist/components/markdownEditor/MarkdownModal.js +0 -24
- package/dist/components/markdownEditor/MarkdownModal.js.map +0 -1
- package/dist/components/markdownEditor/MarkdownPreview.d.ts +0 -9
- package/dist/components/markdownEditor/MarkdownPreview.d.ts.map +0 -1
- package/dist/components/markdownEditor/MarkdownPreview.js +0 -45
- package/dist/components/markdownEditor/MarkdownPreview.js.map +0 -1
- package/dist/components/markdownEditor/MarkdownPreviewLight.d.ts +0 -7
- package/dist/components/markdownEditor/MarkdownPreviewLight.d.ts.map +0 -1
- package/dist/components/markdownEditor/MarkdownPreviewLight.js +0 -53
- package/dist/components/markdownEditor/MarkdownPreviewLight.js.map +0 -1
- package/dist/components/markdownEditor/editor.css +0 -787
- package/dist/components/markdownEditor/images/emoji/1F600.png +0 -0
- package/dist/components/markdownEditor/images/emoji/1F641.png +0 -0
- package/dist/components/markdownEditor/images/emoji/1F642.png +0 -0
- package/dist/components/markdownEditor/images/emoji/2764.png +0 -0
- package/dist/components/markdownEditor/images/icons/arrow-clockwise.svg +0 -4
- package/dist/components/markdownEditor/images/icons/arrow-counterclockwise.svg +0 -4
- package/dist/components/markdownEditor/images/icons/chat-square-quote.svg +0 -4
- package/dist/components/markdownEditor/images/icons/chevron-down.svg +0 -3
- package/dist/components/markdownEditor/images/icons/code.svg +0 -3
- package/dist/components/markdownEditor/images/icons/journal-code.svg +0 -5
- package/dist/components/markdownEditor/images/icons/journal-text.svg +0 -5
- package/dist/components/markdownEditor/images/icons/justify.svg +0 -3
- package/dist/components/markdownEditor/images/icons/link.svg +0 -4
- package/dist/components/markdownEditor/images/icons/list-ol.svg +0 -4
- package/dist/components/markdownEditor/images/icons/list-ul.svg +0 -3
- package/dist/components/markdownEditor/images/icons/pencil-fill.svg +0 -3
- package/dist/components/markdownEditor/images/icons/text-center.svg +0 -3
- package/dist/components/markdownEditor/images/icons/text-left.svg +0 -3
- package/dist/components/markdownEditor/images/icons/text-paragraph.svg +0 -3
- package/dist/components/markdownEditor/images/icons/text-right.svg +0 -3
- package/dist/components/markdownEditor/images/icons/type-bold.svg +0 -3
- package/dist/components/markdownEditor/images/icons/type-h1.svg +0 -3
- package/dist/components/markdownEditor/images/icons/type-h2.svg +0 -3
- package/dist/components/markdownEditor/images/icons/type-h3.svg +0 -3
- package/dist/components/markdownEditor/images/icons/type-h4.svg +0 -13
- package/dist/components/markdownEditor/images/icons/type-italic.svg +0 -3
- package/dist/components/markdownEditor/images/icons/type-strikethrough.svg +0 -3
- package/dist/components/markdownEditor/images/icons/type-underline.svg +0 -3
- package/dist/components/markdownEditor/index.d.ts +0 -4
- package/dist/components/markdownEditor/index.d.ts.map +0 -1
- package/dist/components/markdownEditor/index.js +0 -10
- package/dist/components/markdownEditor/index.js.map +0 -1
- package/dist/components/markdownEditor/plugins/AutoLinkPlugin.d.ts +0 -2
- package/dist/components/markdownEditor/plugins/AutoLinkPlugin.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/AutoLinkPlugin.js +0 -31
- package/dist/components/markdownEditor/plugins/AutoLinkPlugin.js.map +0 -1
- package/dist/components/markdownEditor/plugins/ControlledEditorPlugin.d.ts +0 -8
- package/dist/components/markdownEditor/plugins/ControlledEditorPlugin.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/ControlledEditorPlugin.js +0 -19
- package/dist/components/markdownEditor/plugins/ControlledEditorPlugin.js.map +0 -1
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/FloatingTextFormatToolbarPlugin.d.ts +0 -6
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/FloatingTextFormatToolbarPlugin.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/FloatingTextFormatToolbarPlugin.js +0 -310
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/FloatingTextFormatToolbarPlugin.js.map +0 -1
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/getDOMRangeRect.d.ts +0 -2
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/getDOMRangeRect.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/getDOMRangeRect.js +0 -19
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/getDOMRangeRect.js.map +0 -1
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/getSelectNode.d.ts +0 -2
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/getSelectNode.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/getSelectNode.js +0 -21
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/getSelectNode.js.map +0 -1
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/setFloatingElemPosition.d.ts +0 -2
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/setFloatingElemPosition.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/setFloatingElemPosition.js +0 -29
- package/dist/components/markdownEditor/plugins/FloatingTextMenu/setFloatingElemPosition.js.map +0 -1
- package/dist/components/markdownEditor/plugins/ListMaxIndentLevelPlugin.d.ts +0 -2
- package/dist/components/markdownEditor/plugins/ListMaxIndentLevelPlugin.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/ListMaxIndentLevelPlugin.js +0 -45
- package/dist/components/markdownEditor/plugins/ListMaxIndentLevelPlugin.js.map +0 -1
- package/dist/components/markdownEditor/plugins/MarkdownTransformers.d.ts +0 -12
- package/dist/components/markdownEditor/plugins/MarkdownTransformers.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/MarkdownTransformers.js +0 -85
- package/dist/components/markdownEditor/plugins/MarkdownTransformers.js.map +0 -1
- package/dist/components/markdownEditor/plugins/ReadOnlyPlugin.d.ts +0 -6
- package/dist/components/markdownEditor/plugins/ReadOnlyPlugin.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/ReadOnlyPlugin.js +0 -12
- package/dist/components/markdownEditor/plugins/ReadOnlyPlugin.js.map +0 -1
- package/dist/components/markdownEditor/plugins/ToolbarPlugin.d.ts +0 -7
- package/dist/components/markdownEditor/plugins/ToolbarPlugin.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/ToolbarPlugin.js +0 -282
- package/dist/components/markdownEditor/plugins/ToolbarPlugin.js.map +0 -1
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNode.d.ts +0 -27
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNode.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNode.js +0 -158
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNode.js.map +0 -1
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodePlugin.d.ts +0 -4
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodePlugin.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodePlugin.js +0 -21
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodePlugin.js.map +0 -1
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodeTransformer.d.ts +0 -3
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodeTransformer.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodeTransformer.js +0 -71
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodeTransformer.js.map +0 -1
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.d.ts +0 -5
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.js +0 -190
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.js.map +0 -1
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.types.d.ts +0 -11
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.types.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.types.js +0 -3
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.types.js.map +0 -1
- package/dist/components/markdownEditor/plugins/emoji/EmojiNode.d.ts +0 -24
- package/dist/components/markdownEditor/plugins/emoji/EmojiNode.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/emoji/EmojiNode.js +0 -66
- package/dist/components/markdownEditor/plugins/emoji/EmojiNode.js.map +0 -1
- package/dist/components/markdownEditor/plugins/emoji/EmojiNodeTransform.d.ts +0 -4
- package/dist/components/markdownEditor/plugins/emoji/EmojiNodeTransform.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/emoji/EmojiNodeTransform.js +0 -35
- package/dist/components/markdownEditor/plugins/emoji/EmojiNodeTransform.js.map +0 -1
- package/dist/components/markdownEditor/plugins/emoji/EmojiPickerPlugin.d.ts +0 -9
- package/dist/components/markdownEditor/plugins/emoji/EmojiPickerPlugin.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/emoji/EmojiPickerPlugin.js +0 -103
- package/dist/components/markdownEditor/plugins/emoji/EmojiPickerPlugin.js.map +0 -1
- package/dist/components/markdownEditor/plugins/emoji/EmojisPlugin.d.ts +0 -10
- package/dist/components/markdownEditor/plugins/emoji/EmojisPlugin.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/emoji/EmojisPlugin.js +0 -59
- package/dist/components/markdownEditor/plugins/emoji/EmojisPlugin.js.map +0 -1
- package/dist/components/markdownEditor/plugins/index.d.ts +0 -7
- package/dist/components/markdownEditor/plugins/index.d.ts.map +0 -1
- package/dist/components/markdownEditor/plugins/index.js +0 -16
- package/dist/components/markdownEditor/plugins/index.js.map +0 -1
- package/dist/components/markdownEditor/theme.d.ts +0 -66
- package/dist/components/markdownEditor/theme.d.ts.map +0 -1
- package/dist/components/markdownEditor/theme.js +0 -69
- package/dist/components/markdownEditor/theme.js.map +0 -1
- package/dist/components/reporting/ChartReport.d.ts +0 -8
- package/dist/components/reporting/ChartReport.d.ts.map +0 -1
- package/dist/components/reporting/ChartReport.js +0 -81
- package/dist/components/reporting/ChartReport.js.map +0 -1
- package/dist/components/reporting/ReportFilter.d.ts +0 -9
- package/dist/components/reporting/ReportFilter.d.ts.map +0 -1
- package/dist/components/reporting/ReportFilter.js +0 -52
- package/dist/components/reporting/ReportFilter.js.map +0 -1
- package/dist/components/reporting/ReportFilterField.d.ts +0 -9
- package/dist/components/reporting/ReportFilterField.d.ts.map +0 -1
- package/dist/components/reporting/ReportFilterField.js +0 -156
- package/dist/components/reporting/ReportFilterField.js.map +0 -1
- package/dist/components/reporting/ReportOutput.d.ts +0 -8
- package/dist/components/reporting/ReportOutput.d.ts.map +0 -1
- package/dist/components/reporting/ReportOutput.js +0 -177
- package/dist/components/reporting/ReportOutput.js.map +0 -1
- package/dist/components/reporting/ReportWithFilter.d.ts +0 -7
- package/dist/components/reporting/ReportWithFilter.d.ts.map +0 -1
- package/dist/components/reporting/ReportWithFilter.js +0 -65
- package/dist/components/reporting/ReportWithFilter.js.map +0 -1
- package/dist/components/reporting/TableReport.d.ts +0 -8
- package/dist/components/reporting/TableReport.d.ts.map +0 -1
- package/dist/components/reporting/TableReport.js +0 -30
- package/dist/components/reporting/TableReport.js.map +0 -1
- package/dist/components/reporting/TreeReport.d.ts +0 -8
- package/dist/components/reporting/TreeReport.d.ts.map +0 -1
- package/dist/components/reporting/TreeReport.js +0 -89
- package/dist/components/reporting/TreeReport.js.map +0 -1
- package/dist/components/reporting/index.d.ts +0 -5
- package/dist/components/reporting/index.d.ts.map +0 -1
- package/dist/components/reporting/index.js +0 -12
- package/dist/components/reporting/index.js.map +0 -1
- package/dist/donationComponents/components/BankForm.d.ts +0 -14
- package/dist/donationComponents/components/BankForm.d.ts.map +0 -1
- package/dist/donationComponents/components/BankForm.js +0 -126
- package/dist/donationComponents/components/BankForm.js.map +0 -1
- package/dist/donationComponents/components/CardForm.d.ts +0 -13
- package/dist/donationComponents/components/CardForm.d.ts.map +0 -1
- package/dist/donationComponents/components/CardForm.js +0 -122
- package/dist/donationComponents/components/CardForm.js.map +0 -1
- package/dist/donationComponents/components/DonationForm.d.ts +0 -15
- package/dist/donationComponents/components/DonationForm.d.ts.map +0 -1
- package/dist/donationComponents/components/DonationForm.js +0 -199
- package/dist/donationComponents/components/DonationForm.js.map +0 -1
- package/dist/donationComponents/components/FundDonation.d.ts +0 -12
- package/dist/donationComponents/components/FundDonation.d.ts.map +0 -1
- package/dist/donationComponents/components/FundDonation.js +0 -32
- package/dist/donationComponents/components/FundDonation.js.map +0 -1
- package/dist/donationComponents/components/FundDonations.d.ts +0 -11
- package/dist/donationComponents/components/FundDonations.d.ts.map +0 -1
- package/dist/donationComponents/components/FundDonations.js +0 -33
- package/dist/donationComponents/components/FundDonations.js.map +0 -1
- package/dist/donationComponents/components/PaymentMethods.d.ts +0 -14
- package/dist/donationComponents/components/PaymentMethods.d.ts.map +0 -1
- package/dist/donationComponents/components/PaymentMethods.js +0 -84
- package/dist/donationComponents/components/PaymentMethods.js.map +0 -1
- package/dist/donationComponents/components/RecurringDonations.d.ts +0 -10
- package/dist/donationComponents/components/RecurringDonations.d.ts.map +0 -1
- package/dist/donationComponents/components/RecurringDonations.js +0 -93
- package/dist/donationComponents/components/RecurringDonations.js.map +0 -1
- package/dist/donationComponents/components/RecurringDonationsEdit.d.ts +0 -11
- package/dist/donationComponents/components/RecurringDonationsEdit.d.ts.map +0 -1
- package/dist/donationComponents/components/RecurringDonationsEdit.js +0 -66
- package/dist/donationComponents/components/RecurringDonationsEdit.js.map +0 -1
- package/dist/donationComponents/components/index.d.ts +0 -9
- package/dist/donationComponents/components/index.d.ts.map +0 -1
- package/dist/donationComponents/components/index.js +0 -20
- package/dist/donationComponents/components/index.js.map +0 -1
- package/dist/donationComponents/index.d.ts +0 -3
- package/dist/donationComponents/index.d.ts.map +0 -1
- package/dist/donationComponents/index.js +0 -21
- package/dist/donationComponents/index.js.map +0 -1
- package/dist/donationComponents/modals/DonationPreviewModal.d.ts +0 -15
- package/dist/donationComponents/modals/DonationPreviewModal.d.ts.map +0 -1
- package/dist/donationComponents/modals/DonationPreviewModal.js +0 -33
- package/dist/donationComponents/modals/DonationPreviewModal.js.map +0 -1
- package/dist/helpers/CommonEnvironmentHelper.d.ts +0 -21
- package/dist/helpers/CommonEnvironmentHelper.d.ts.map +0 -1
- package/dist/helpers/CommonEnvironmentHelper.js +0 -100
- package/dist/helpers/CommonEnvironmentHelper.js.map +0 -1
- package/dist/helpers/DonationHelper.d.ts +0 -8
- package/dist/helpers/DonationHelper.d.ts.map +0 -1
- package/dist/helpers/DonationHelper.js +0 -33
- package/dist/helpers/DonationHelper.js.map +0 -1
- package/dist/helpers/ReportHelper.d.ts +0 -5
- package/dist/helpers/ReportHelper.d.ts.map +0 -1
- package/dist/helpers/ReportHelper.js +0 -37
- package/dist/helpers/ReportHelper.js.map +0 -1
- package/dist/pageComponents/LoginPage.d.ts +0 -25
- package/dist/pageComponents/LoginPage.d.ts.map +0 -1
- package/dist/pageComponents/LoginPage.js +0 -288
- package/dist/pageComponents/LoginPage.js.map +0 -1
- package/dist/pageComponents/LogoutPage.d.ts +0 -9
- package/dist/pageComponents/LogoutPage.d.ts.map +0 -1
- package/dist/pageComponents/LogoutPage.js +0 -37
- package/dist/pageComponents/LogoutPage.js.map +0 -1
- package/dist/pageComponents/components/Forgot.d.ts +0 -8
- package/dist/pageComponents/components/Forgot.d.ts.map +0 -1
- package/dist/pageComponents/components/Forgot.js +0 -53
- package/dist/pageComponents/components/Forgot.js.map +0 -1
- package/dist/pageComponents/components/Login.d.ts +0 -15
- package/dist/pageComponents/components/Login.d.ts.map +0 -1
- package/dist/pageComponents/components/Login.js +0 -73
- package/dist/pageComponents/components/Login.js.map +0 -1
- package/dist/pageComponents/components/LoginSetPassword.d.ts +0 -13
- package/dist/pageComponents/components/LoginSetPassword.d.ts.map +0 -1
- package/dist/pageComponents/components/LoginSetPassword.js +0 -112
- package/dist/pageComponents/components/LoginSetPassword.js.map +0 -1
- package/dist/pageComponents/components/Register.d.ts +0 -12
- package/dist/pageComponents/components/Register.d.ts.map +0 -1
- package/dist/pageComponents/components/Register.js +0 -95
- package/dist/pageComponents/components/Register.js.map +0 -1
- package/dist/pageComponents/components/SelectChurchModal.d.ts +0 -14
- package/dist/pageComponents/components/SelectChurchModal.d.ts.map +0 -1
- package/dist/pageComponents/components/SelectChurchModal.js +0 -37
- package/dist/pageComponents/components/SelectChurchModal.js.map +0 -1
- package/dist/pageComponents/components/SelectChurchRegister.d.ts +0 -11
- package/dist/pageComponents/components/SelectChurchRegister.d.ts.map +0 -1
- package/dist/pageComponents/components/SelectChurchRegister.js +0 -89
- package/dist/pageComponents/components/SelectChurchRegister.js.map +0 -1
- package/dist/pageComponents/components/SelectChurchSearch.d.ts +0 -10
- package/dist/pageComponents/components/SelectChurchSearch.d.ts.map +0 -1
- package/dist/pageComponents/components/SelectChurchSearch.js +0 -58
- package/dist/pageComponents/components/SelectChurchSearch.js.map +0 -1
- package/dist/pageComponents/components/SelectableChurch.d.ts +0 -9
- package/dist/pageComponents/components/SelectableChurch.d.ts.map +0 -1
- package/dist/pageComponents/components/SelectableChurch.js +0 -18
- package/dist/pageComponents/components/SelectableChurch.js.map +0 -1
- package/dist/pageComponents/index.d.ts +0 -4
- package/dist/pageComponents/index.d.ts.map +0 -1
- package/dist/pageComponents/index.js +0 -10
- package/dist/pageComponents/index.js.map +0 -1
- package/src/components/markdownEditor/Editor.tsx +0 -150
- package/src/components/markdownEditor/IconNamesList.ts +0 -14
- package/src/components/markdownEditor/MarkdownEditor.tsx +0 -18
- package/src/components/markdownEditor/MarkdownModal.tsx +0 -49
- package/src/components/markdownEditor/MarkdownPreview.tsx +0 -18
- package/src/components/markdownEditor/MarkdownPreviewLight.tsx +0 -53
- package/src/components/markdownEditor/editor.css +0 -787
- package/src/components/markdownEditor/images/emoji/1F600.png +0 -0
- package/src/components/markdownEditor/images/emoji/1F641.png +0 -0
- package/src/components/markdownEditor/images/emoji/1F642.png +0 -0
- package/src/components/markdownEditor/images/emoji/2764.png +0 -0
- package/src/components/markdownEditor/images/icons/arrow-clockwise.svg +0 -4
- package/src/components/markdownEditor/images/icons/arrow-counterclockwise.svg +0 -4
- package/src/components/markdownEditor/images/icons/chat-square-quote.svg +0 -4
- package/src/components/markdownEditor/images/icons/chevron-down.svg +0 -3
- package/src/components/markdownEditor/images/icons/code.svg +0 -3
- package/src/components/markdownEditor/images/icons/journal-code.svg +0 -5
- package/src/components/markdownEditor/images/icons/journal-text.svg +0 -5
- package/src/components/markdownEditor/images/icons/justify.svg +0 -3
- package/src/components/markdownEditor/images/icons/link.svg +0 -4
- package/src/components/markdownEditor/images/icons/list-ol.svg +0 -4
- package/src/components/markdownEditor/images/icons/list-ul.svg +0 -3
- package/src/components/markdownEditor/images/icons/pencil-fill.svg +0 -3
- package/src/components/markdownEditor/images/icons/text-center.svg +0 -3
- package/src/components/markdownEditor/images/icons/text-left.svg +0 -3
- package/src/components/markdownEditor/images/icons/text-paragraph.svg +0 -3
- package/src/components/markdownEditor/images/icons/text-right.svg +0 -3
- package/src/components/markdownEditor/images/icons/type-bold.svg +0 -3
- package/src/components/markdownEditor/images/icons/type-h1.svg +0 -3
- package/src/components/markdownEditor/images/icons/type-h2.svg +0 -3
- package/src/components/markdownEditor/images/icons/type-h3.svg +0 -3
- package/src/components/markdownEditor/images/icons/type-h4.svg +0 -13
- package/src/components/markdownEditor/images/icons/type-italic.svg +0 -3
- package/src/components/markdownEditor/images/icons/type-strikethrough.svg +0 -3
- package/src/components/markdownEditor/images/icons/type-underline.svg +0 -3
- package/src/components/markdownEditor/index.ts +0 -3
- package/src/components/markdownEditor/plugins/AutoLinkPlugin.tsx +0 -35
- package/src/components/markdownEditor/plugins/ControlledEditorPlugin.tsx +0 -24
- package/src/components/markdownEditor/plugins/FloatingTextMenu/FloatingTextFormatToolbarPlugin.tsx +0 -445
- package/src/components/markdownEditor/plugins/FloatingTextMenu/getDOMRangeRect.tsx +0 -17
- package/src/components/markdownEditor/plugins/FloatingTextMenu/getSelectNode.tsx +0 -17
- package/src/components/markdownEditor/plugins/FloatingTextMenu/setFloatingElemPosition.tsx +0 -33
- package/src/components/markdownEditor/plugins/ListMaxIndentLevelPlugin.tsx +0 -68
- package/src/components/markdownEditor/plugins/MarkdownTransformers.ts +0 -106
- package/src/components/markdownEditor/plugins/ReadOnlyPlugin.tsx +0 -15
- package/src/components/markdownEditor/plugins/ToolbarPlugin.tsx +0 -424
- package/src/components/markdownEditor/plugins/customLink/CustomLinkNode.tsx +0 -224
- package/src/components/markdownEditor/plugins/customLink/CustomLinkNodePlugin.tsx +0 -32
- package/src/components/markdownEditor/plugins/customLink/CustomLinkNodeTransformer.tsx +0 -102
- package/src/components/markdownEditor/plugins/customLink/FloatingLinkEditor.tsx +0 -270
- package/src/components/markdownEditor/plugins/customLink/FloatingLinkEditor.types.ts +0 -11
- package/src/components/markdownEditor/plugins/emoji/EmojiNode.tsx +0 -95
- package/src/components/markdownEditor/plugins/emoji/EmojiNodeTransform.ts +0 -41
- package/src/components/markdownEditor/plugins/emoji/EmojiPickerPlugin.tsx +0 -152
- package/src/components/markdownEditor/plugins/emoji/EmojisPlugin.tsx +0 -70
- package/src/components/markdownEditor/plugins/index.ts +0 -6
- package/src/components/markdownEditor/theme.ts +0 -65
- package/src/components/reporting/ChartReport.tsx +0 -89
- package/src/components/reporting/ReportFilter.tsx +0 -56
- package/src/components/reporting/ReportFilterField.tsx +0 -163
- package/src/components/reporting/ReportOutput.tsx +0 -168
- package/src/components/reporting/ReportWithFilter.tsx +0 -72
- package/src/components/reporting/TableReport.tsx +0 -44
- package/src/components/reporting/TreeReport.tsx +0 -103
- package/src/components/reporting/index.ts +0 -4
- package/src/donationComponents/components/BankForm.tsx +0 -163
- package/src/donationComponents/components/CardForm.tsx +0 -104
- package/src/donationComponents/components/DonationForm.tsx +0 -260
- package/src/donationComponents/components/FundDonation.tsx +0 -59
- package/src/donationComponents/components/FundDonations.tsx +0 -44
- package/src/donationComponents/components/PaymentMethods.tsx +0 -133
- package/src/donationComponents/components/RecurringDonations.tsx +0 -117
- package/src/donationComponents/components/RecurringDonationsEdit.tsx +0 -96
- package/src/donationComponents/components/index.tsx +0 -8
- package/src/donationComponents/index.ts +0 -2
- package/src/donationComponents/modals/DonationPreviewModal.tsx +0 -70
- package/src/helpers/CommonEnvironmentHelper.ts +0 -98
- package/src/helpers/DonationHelper.ts +0 -26
- package/src/helpers/ReportHelper.ts +0 -34
- package/src/pageComponents/LoginPage.tsx +0 -284
- package/src/pageComponents/LogoutPage.tsx +0 -43
- package/src/pageComponents/components/Forgot.tsx +0 -81
- package/src/pageComponents/components/Login.tsx +0 -62
- package/src/pageComponents/components/LoginSetPassword.tsx +0 -98
- package/src/pageComponents/components/Register.tsx +0 -103
- package/src/pageComponents/components/SelectChurchModal.tsx +0 -58
- package/src/pageComponents/components/SelectChurchRegister.tsx +0 -87
- package/src/pageComponents/components/SelectChurchSearch.tsx +0 -71
- package/src/pageComponents/components/SelectableChurch.tsx +0 -40
- package/src/pageComponents/index.ts +0 -3
|
@@ -1,55 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.NewPrivateMessage = void 0;
|
|
38
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
-
const material_1 = require("@mui/material");
|
|
40
|
-
const react_1 = __importStar(require("react"));
|
|
41
|
-
const helpers_1 = require("../../helpers");
|
|
42
|
-
const AddNote_1 = require("../notes/AddNote");
|
|
43
|
-
const SmallButton_1 = require("../SmallButton");
|
|
44
|
-
const NewPrivateMessage = (props) => {
|
|
45
|
-
const [searchText, setSearchText] = react_1.default.useState("");
|
|
46
|
-
const [searchResults, setSearchResults] = react_1.default.useState([]);
|
|
47
|
-
const [selectedPerson, setSelectedPerson] = react_1.default.useState(null);
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button, TextField, TableRow, TableCell, Table, TableBody } from "@mui/material";
|
|
4
|
+
import React, { useEffect } from "react";
|
|
5
|
+
import { ApiHelper, Locale, PersonHelper } from "../../helpers";
|
|
6
|
+
import { AddNote } from "../notes/AddNote";
|
|
7
|
+
import { SmallButton } from "../SmallButton";
|
|
8
|
+
export const NewPrivateMessage = (props) => {
|
|
9
|
+
const [searchText, setSearchText] = React.useState("");
|
|
10
|
+
const [searchResults, setSearchResults] = React.useState([]);
|
|
11
|
+
const [selectedPerson, setSelectedPerson] = React.useState(null);
|
|
48
12
|
const handleSubmit = (e) => {
|
|
49
13
|
if (e !== null)
|
|
50
14
|
e.preventDefault();
|
|
51
15
|
let term = escape(searchText.trim());
|
|
52
|
-
|
|
16
|
+
ApiHelper.get("/people/search?term=" + term, "MembershipApi").then(data => setSearchResults(data));
|
|
53
17
|
};
|
|
54
18
|
const handleChange = (e) => {
|
|
55
19
|
setSearchText(e.currentTarget.value);
|
|
@@ -61,7 +25,7 @@ const NewPrivateMessage = (props) => {
|
|
|
61
25
|
*/
|
|
62
26
|
const handlePersonSelected = async (person) => {
|
|
63
27
|
try {
|
|
64
|
-
const existing = await
|
|
28
|
+
const existing = await ApiHelper.get("/privateMessages/existing/" + person.id, "MessagingApi");
|
|
65
29
|
if (existing?.id) {
|
|
66
30
|
existing.person = person;
|
|
67
31
|
props.onSelectMessage(existing);
|
|
@@ -78,7 +42,7 @@ const NewPrivateMessage = (props) => {
|
|
|
78
42
|
let result = [];
|
|
79
43
|
for (let i = 0; i < searchResults.length; i++) {
|
|
80
44
|
const p = searchResults[i];
|
|
81
|
-
result.push((
|
|
45
|
+
result.push(_jsxs(TableRow, { children: [_jsx(TableCell, { children: _jsx("img", { src: PersonHelper.getPhotoUrl(p), alt: "avatar" }) }), _jsx(TableCell, { children: _jsx("a", { href: "about:blank", onClick: (e) => { e.preventDefault(); handlePersonSelected(p); }, children: p.name.display }) })] }, p.id));
|
|
82
46
|
}
|
|
83
47
|
return result;
|
|
84
48
|
};
|
|
@@ -86,25 +50,24 @@ const NewPrivateMessage = (props) => {
|
|
|
86
50
|
handlePersonSelected(selectedPerson);
|
|
87
51
|
};
|
|
88
52
|
const createConversation = async () => {
|
|
89
|
-
const conv = { allowAnonymousPosts: false, contentType: "privateMessage", contentId: props.context.person.id, title: props.context.person.name.display + " " +
|
|
90
|
-
const result = await
|
|
53
|
+
const conv = { allowAnonymousPosts: false, contentType: "privateMessage", contentId: props.context.person.id, title: props.context.person.name.display + " " + Locale.label("wrapper.privateMessage"), visibility: "hidden" };
|
|
54
|
+
const result = await ApiHelper.post("/conversations", [conv], "MessagingApi");
|
|
91
55
|
const pm = {
|
|
92
56
|
fromPersonId: props.context.person.id,
|
|
93
57
|
toPersonId: selectedPerson.id,
|
|
94
58
|
conversationId: result[0].id
|
|
95
59
|
};
|
|
96
|
-
const privateMessages = await
|
|
60
|
+
const privateMessages = await ApiHelper.post("/privateMessages", [pm], "MessagingApi");
|
|
97
61
|
return privateMessages[0].conversationId;
|
|
98
62
|
};
|
|
99
|
-
|
|
63
|
+
useEffect(() => {
|
|
100
64
|
if (props.selectedPerson)
|
|
101
65
|
handlePersonSelected(props.selectedPerson);
|
|
102
66
|
}, [props.selectedPerson]);
|
|
103
67
|
if (!selectedPerson)
|
|
104
|
-
return ((
|
|
68
|
+
return (_jsxs("div", { style: { paddingLeft: 10, paddingRight: 10 }, children: [_jsx("span", { style: { float: "right" }, children: _jsx(SmallButton, { icon: "chevron_left", text: "Back", onClick: props.onBack }) }), _jsx("b", { children: Locale.label("wrapper.newPrivateMessage") }), _jsx("div", { children: Locale.label("wrapper.searchForPerson") }), _jsx(TextField, { fullWidth: true, label: "Name", id: "searchText", "data-testid": "search-input", name: "searchText", type: "text", placeholder: "Name", value: searchText, onChange: handleChange, onKeyDown: (e) => { e.stopPropagation(); }, InputProps: { endAdornment: _jsx(Button, { variant: "contained", id: "searchButton", "data-testid": "search-button", onClick: handleSubmit, children: Locale.label("common.search") }) } }), _jsx("br", {}), _jsx(Table, { id: "smallPeopleTable", size: "small", children: _jsx(TableBody, { children: getPeople() }) })] }));
|
|
105
69
|
else {
|
|
106
|
-
return ((
|
|
70
|
+
return (_jsxs("div", { style: { paddingLeft: 10, paddingRight: 10 }, children: [_jsx("span", { style: { float: "right" }, children: _jsx(SmallButton, { icon: "chevron_left", text: "Back", onClick: props.onBack }) }), _jsx("b", { children: Locale.label("wrapper.newPrivateMessage") }), _jsxs("div", { children: ["To: ", selectedPerson.name.display] }), _jsx(AddNote, { context: props.context, conversationId: null, onUpdate: handleNoteAdded, createConversation: createConversation })] }));
|
|
107
71
|
}
|
|
108
72
|
};
|
|
109
|
-
exports.NewPrivateMessage = NewPrivateMessage;
|
|
110
73
|
//# sourceMappingURL=NewPrivateMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewPrivateMessage.js","sourceRoot":"","sources":["../../../src/components/wrapper/NewPrivateMessage.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"NewPrivateMessage.js","sourceRoot":"","sources":["../../../src/components/wrapper/NewPrivateMessage.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAS7C,MAAM,CAAC,MAAM,iBAAiB,GAAoB,CAAC,KAAK,EA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-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.Notifications = void 0;
|
|
38
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
-
const react_1 = __importStar(require("react"));
|
|
40
|
-
const ApiHelper_1 = require("../../helpers/ApiHelper");
|
|
41
|
-
const material_1 = require("@mui/material");
|
|
42
|
-
const helpers_1 = require("../../helpers");
|
|
43
|
-
const Notifications = (props) => {
|
|
44
|
-
const [notifications, setNotifications] = (0, react_1.useState)([]);
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
import { ApiHelper } from "../../helpers/ApiHelper";
|
|
5
|
+
import { Box, Icon, Stack } from "@mui/material";
|
|
6
|
+
import { DateHelper } from "../../helpers";
|
|
7
|
+
export const Notifications = (props) => {
|
|
8
|
+
const [notifications, setNotifications] = useState([]);
|
|
45
9
|
const loadData = async () => {
|
|
46
|
-
const n = await
|
|
10
|
+
const n = await ApiHelper.get("/notifications/my", "MessagingApi");
|
|
47
11
|
setNotifications(n);
|
|
48
12
|
props.onUpdate();
|
|
49
13
|
};
|
|
50
|
-
|
|
14
|
+
React.useEffect(() => { loadData(); }, []); //eslint-disable-line
|
|
51
15
|
const getAppUrl = (appName) => {
|
|
52
16
|
switch (appName) {
|
|
53
17
|
case props.appName.toLowerCase(): return "";
|
|
@@ -82,13 +46,18 @@ const Notifications = (props) => {
|
|
|
82
46
|
let result = [];
|
|
83
47
|
notifications.forEach(notification => {
|
|
84
48
|
let datePosted = new Date(notification.timeSent);
|
|
85
|
-
const displayDuration =
|
|
86
|
-
result.push((
|
|
49
|
+
const displayDuration = DateHelper.getDisplayDuration(datePosted);
|
|
50
|
+
result.push(_jsx("div", { className: "note", style: { cursor: "pointer" }, onClick: (e) => { e.preventDefault(); }, role: "button", tabIndex: 0, onKeyDown: (e) => { if (e.key === 'Enter' || e.key === ' ') {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
handleClick(notification);
|
|
53
|
+
} }, children: _jsx(Box, { sx: { width: "100%" }, className: "note-contents", children: _jsx(Stack, { direction: "row", justifyContent: "space-between", children: _jsxs("div", { style: { width: "100%" }, onClick: (e) => { e.preventDefault(); handleClick(notification); }, role: "button", tabIndex: 0, onKeyDown: (e) => { if (e.key === 'Enter' || e.key === ' ') {
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
handleClick(notification);
|
|
56
|
+
} }, "aria-label": `View notification: ${notification.message}`, children: [_jsx("span", { className: "text-grey", style: { float: "right" }, children: displayDuration }), _jsxs("p", { children: [_jsx(Icon, { children: "notifications" }), notification.message, _jsx("span", { children: notification?.link ? _jsx("a", { href: notification.link, onClick: (e) => { e.stopPropagation(); }, target: "_blank", children: "View Details" }) : null })] })] }) }) }) }));
|
|
87
57
|
});
|
|
88
58
|
return result;
|
|
89
59
|
};
|
|
90
|
-
|
|
91
|
-
return ((
|
|
60
|
+
React.useEffect(() => { console.log("RELOADED NOTIFICATIONS"); }, []);
|
|
61
|
+
return (_jsx(_Fragment, { children: getMainLinks() }));
|
|
92
62
|
};
|
|
93
|
-
exports.Notifications = Notifications;
|
|
94
63
|
//# sourceMappingURL=Notifications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notifications.js","sourceRoot":"","sources":["../../../src/components/wrapper/Notifications.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"Notifications.js","sourceRoot":"","sources":["../../../src/components/wrapper/Notifications.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C,MAAM,CAAC,MAAM,aAAa,GAAoB,CAAC,KAAK,EAAE,EAAE;IACtD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAA0B,EAAE,CAAC,CAAC;IAEhF,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;QAC1B,MAAM,CAAC,GAA4B,MAAM,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;QAC5F,gBAAgB,CAAC,CAAC,CAAC,CAAC;QACpB,KAAK,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAA;IAED,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC,CAAC,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C,CAAC,cAAc,EAAE,CAAC;gCAAC,WAAW,CAAC,YAAY,CAAC,CAAC;4BAAC,CAAC,CAAC,CAAC,gBAAc,sBAAsB,YAAY,CAAC,OAAO,EAAE,aACnS,eAAM,SAAS,EAAC,WAAW,EAAC,KAAK,EAAE,EAAC,KAAK,EAAC,OAAO,EAAC,YAAG,eAAe,GAAQ,EAC5E,wBACE,KAAC,IAAI,gCAAqB,EACzB,YAAY,CAAC,OAAO,EACrB,yBAAO,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC,YAAG,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,eAAe,EAAE,CAAA,CAAC,CAAC,EAAE,MAAM,EAAC,QAAQ,6BAAiB,CAAC,CAAC,CAAC,IAAI,GAAQ,IAC9I,IACA,GACA,GACJ,GACF,CACP,CAAC;QACJ,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC;IAChB,CAAC,CAAA;IAED,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAA,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAErE,OAAO,CACL,4BACG,YAAY,EAAE,GACd,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const Notes_1 = require("../notes/Notes");
|
|
8
|
-
const helpers_1 = require("../../helpers");
|
|
9
|
-
const PrivateMessageDetails = (props) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: { paddingLeft: 10, paddingRight: 10, paddingBottom: 10 }, children: [(0, jsx_runtime_1.jsx)("span", { style: { float: "right" }, children: (0, jsx_runtime_1.jsx)(SmallButton_1.SmallButton, { icon: "chevron_left", text: "Back", onClick: props.onBack }) }), helpers_1.Locale.label("wrapper.chatWith"), " ", props.privateMessage.person.name.display] }), (0, jsx_runtime_1.jsx)(Notes_1.Notes, { maxHeight: "50vh", context: props.context, conversationId: props.privateMessage.conversationId, noDisplayBox: true, refreshKey: props.refreshKey })] }));
|
|
10
|
-
exports.PrivateMessageDetails = PrivateMessageDetails;
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { SmallButton } from "../SmallButton";
|
|
4
|
+
import { Notes } from "../notes/Notes";
|
|
5
|
+
import { Locale } from "../../helpers";
|
|
6
|
+
export const PrivateMessageDetails = (props) => (_jsxs(_Fragment, { children: [_jsxs("div", { style: { paddingLeft: 10, paddingRight: 10, paddingBottom: 10 }, children: [_jsx("span", { style: { float: "right" }, children: _jsx(SmallButton, { icon: "chevron_left", text: "Back", onClick: props.onBack }) }), Locale.label("wrapper.chatWith"), " ", props.privateMessage.person.name.display] }), _jsx(Notes, { maxHeight: "50vh", context: props.context, conversationId: props.privateMessage.conversationId, noDisplayBox: true, refreshKey: props.refreshKey })] }));
|
|
11
7
|
//# sourceMappingURL=PrivateMessageDetails.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivateMessageDetails.js","sourceRoot":"","sources":["../../../src/components/wrapper/PrivateMessageDetails.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"PrivateMessageDetails.js","sourceRoot":"","sources":["../../../src/components/wrapper/PrivateMessageDetails.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AASvC,MAAM,CAAC,MAAM,qBAAqB,GAAoB,CAAC,KAAK,EAAE,EAAE,CAAC,CAC/D,8BACE,eAAK,KAAK,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,aAClE,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,YAC7B,KAAC,WAAW,IAAC,IAAI,EAAC,cAAc,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAE,KAAK,CAAC,MAAM,GAAI,GACjE,EACN,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,OAAG,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,IACxE,EACN,KAAC,KAAK,IAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,GAAI,IAC1J,CACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivateMessages.d.ts","sourceRoot":"","sources":["../../../src/components/wrapper/PrivateMessages.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,OAAO,EAA2B,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAKpF,UAAU,KAAK;IACb,OAAO,EAAE,oBAAoB,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"PrivateMessages.d.ts","sourceRoot":"","sources":["../../../src/components/wrapper/PrivateMessages.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,OAAO,EAA2B,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAKpF,UAAU,KAAK;IACb,OAAO,EAAE,oBAAoB,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAqF3C,CAAC"}
|
|
@@ -1,55 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.PrivateMessages = void 0;
|
|
38
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
-
const react_1 = __importStar(require("react"));
|
|
40
|
-
const ApiHelper_1 = require("../../helpers/ApiHelper");
|
|
41
|
-
const material_1 = require("@mui/material");
|
|
42
|
-
const SmallButton_1 = require("../SmallButton");
|
|
43
|
-
const helpers_1 = require("../../helpers");
|
|
44
|
-
const PrivateMessageDetails_1 = require("./PrivateMessageDetails");
|
|
45
|
-
const NewPrivateMessage_1 = require("./NewPrivateMessage");
|
|
46
|
-
const PrivateMessages = (props) => {
|
|
47
|
-
const [privateMessages, setPrivateMessages] = (0, react_1.useState)([]);
|
|
48
|
-
const [selectedMessage, setSelectedMessage] = (0, react_1.useState)(null);
|
|
49
|
-
const [inAddMode, setInAddMode] = (0, react_1.useState)(false);
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
import { ApiHelper } from "../../helpers/ApiHelper";
|
|
5
|
+
import { Box, Stack } from "@mui/material";
|
|
6
|
+
import { SmallButton } from "../SmallButton";
|
|
7
|
+
import { ArrayHelper, DateHelper, PersonHelper } from "../../helpers";
|
|
8
|
+
import { PrivateMessageDetails } from "./PrivateMessageDetails";
|
|
9
|
+
import { NewPrivateMessage } from "./NewPrivateMessage";
|
|
10
|
+
export const PrivateMessages = (props) => {
|
|
11
|
+
const [privateMessages, setPrivateMessages] = useState([]);
|
|
12
|
+
const [selectedMessage, setSelectedMessage] = useState(null);
|
|
13
|
+
const [inAddMode, setInAddMode] = useState(false);
|
|
50
14
|
const loadData = async () => {
|
|
51
15
|
console.log("loading data");
|
|
52
|
-
const pms = await
|
|
16
|
+
const pms = await ApiHelper.get("/privateMessages", "MessagingApi");
|
|
53
17
|
const peopleIds = [];
|
|
54
18
|
pms.forEach(pm => {
|
|
55
19
|
const personId = (pm.fromPersonId === props.context.person.id) ? pm.toPersonId : pm.fromPersonId;
|
|
@@ -57,28 +21,31 @@ const PrivateMessages = (props) => {
|
|
|
57
21
|
peopleIds.push(personId);
|
|
58
22
|
});
|
|
59
23
|
if (peopleIds.length > 0) {
|
|
60
|
-
const people = await
|
|
24
|
+
const people = await ApiHelper.get("/people/basic?ids=" + peopleIds.join(","), "MembershipApi");
|
|
61
25
|
pms.forEach(pm => {
|
|
62
26
|
const personId = (pm.fromPersonId === props.context.person.id) ? pm.toPersonId : pm.fromPersonId;
|
|
63
|
-
pm.person =
|
|
27
|
+
pm.person = ArrayHelper.getOne(people, "id", personId);
|
|
64
28
|
});
|
|
65
29
|
}
|
|
66
30
|
setPrivateMessages(pms);
|
|
67
31
|
props.onUpdate();
|
|
68
32
|
};
|
|
69
|
-
|
|
70
|
-
|
|
33
|
+
React.useEffect(() => { loadData(); }, [props.refreshKey]); //eslint-disable-line
|
|
34
|
+
React.useEffect(() => { console.log("RELOADED PMS"); }, []);
|
|
71
35
|
const getMainLinks = () => {
|
|
72
36
|
let result = [];
|
|
73
37
|
privateMessages.forEach(pm => {
|
|
74
38
|
const person = pm.person;
|
|
75
39
|
const message = pm.conversation.messages[0];
|
|
76
|
-
const photoUrl =
|
|
40
|
+
const photoUrl = PersonHelper.getPhotoUrl(person);
|
|
77
41
|
let datePosted = new Date(message.timeUpdated || message.timeSent);
|
|
78
|
-
const displayDuration =
|
|
42
|
+
const displayDuration = DateHelper.getDisplayDuration(datePosted);
|
|
79
43
|
const contents = message.content?.split("\n")[0];
|
|
80
44
|
const privateMessage = pm;
|
|
81
|
-
result.push((
|
|
45
|
+
result.push(_jsxs("div", { className: "note", style: { cursor: "pointer" }, onClick: (e) => { e.preventDefault(); setSelectedMessage(privateMessage); }, role: "button", tabIndex: 0, onKeyDown: (e) => { if (e.key === 'Enter' || e.key === ' ') {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
setSelectedMessage(privateMessage);
|
|
48
|
+
} }, "aria-label": `View private message from ${person.name?.display}`, children: [_jsx("div", { className: "postedBy", children: _jsx("img", { src: photoUrl, alt: "avatar" }) }), _jsx(Box, { sx: { width: "100%" }, className: "note-contents", children: _jsx(Stack, { direction: "row", justifyContent: "space-between", children: _jsxs("div", { children: [_jsx("b", { children: person.name?.display }), " \u00B7 ", _jsx("span", { className: "text-grey", children: displayDuration }), _jsx("p", { style: { maxHeight: 20, overflowY: "hidden" }, children: contents })] }) }) })] }, pm.id));
|
|
82
49
|
});
|
|
83
50
|
return result;
|
|
84
51
|
};
|
|
@@ -88,11 +55,10 @@ const PrivateMessages = (props) => {
|
|
|
88
55
|
loadData();
|
|
89
56
|
};
|
|
90
57
|
if (inAddMode)
|
|
91
|
-
return (
|
|
58
|
+
return _jsx(NewPrivateMessage, { context: props.context, onSelectMessage: (pm) => { setSelectedMessage(pm); setInAddMode(false); }, onBack: handleBack });
|
|
92
59
|
if (selectedMessage)
|
|
93
|
-
return (
|
|
60
|
+
return _jsx(PrivateMessageDetails, { privateMessage: selectedMessage, context: props.context, onBack: handleBack, refreshKey: props.refreshKey });
|
|
94
61
|
else
|
|
95
|
-
return ((
|
|
62
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { style: { float: "right" }, children: _jsx(SmallButton, { icon: "edit_square", onClick: () => { setInAddMode(true); } }) }), getMainLinks()] }));
|
|
96
63
|
};
|
|
97
|
-
exports.PrivateMessages = PrivateMessages;
|
|
98
64
|
//# sourceMappingURL=PrivateMessages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivateMessages.js","sourceRoot":"","sources":["../../../src/components/wrapper/PrivateMessages.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"PrivateMessages.js","sourceRoot":"","sources":["../../../src/components/wrapper/PrivateMessages.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE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O,MAAM,CAAC;IAChB,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACzB,QAAQ,EAAE,CAAC;IACb,CAAC,CAAA;IAED,IAAI,SAAS;QAAE,OAAO,KAAC,iBAAiB,IAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,EAA2B,EAAE,EAAE,GAAG,kBAAkB,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,GAAI,CAAA;IAC3L,IAAI,eAAe;QAAE,OAAO,KAAC,qBAAqB,IAAC,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,GAAI,CAAA;;QAC3J,OAAO,CACV,8BACE,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,YAC7B,KAAC,WAAW,IAAC,IAAI,EAAC,aAAa,EAAC,OAAO,EAAE,GAAG,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,CAAA,CAAC,CAAC,GAAI,GACpE,EAEN,YAAY,EAAE,IACd,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/wrapper/SiteWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"SiteWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/wrapper/SiteWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8C,MAAM,OAAO,CAAC;AAEnE,OAAO,EAA8C,mBAAmB,EAAa,MAAM,eAAe,CAAC;AAE3G,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAK3D,UAAU,KAAK;IACb,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC;IAC/B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAwFvC,CAAC"}
|
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const toggleDrawer = () => { setOpen(!open); };
|
|
21
|
-
const isMounted = (0, useMountedState_1.useMountedState)();
|
|
22
|
-
const CustomDrawer = (open) ? (0, Drawers_1.OpenDrawer)({ backgroundColor: props.appearance.wrapperBackground }) : (0, Drawers_1.ClosedDrawer)({ backgroundColor: props.appearance.wrapperBackground });
|
|
23
|
-
const CustomAppBar = (open) ? Drawers_1.OpenDrawerAppBar : Drawers_1.ClosedDrawerAppBar;
|
|
24
|
-
const loadCounts = () => {
|
|
25
|
-
helpers_1.ApiHelper.get("/notifications/unreadCount", "MessagingApi").then(data => {
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React, { useCallback, useMemo } from "react";
|
|
4
|
+
import { IconButton, Toolbar, Icon, Typography, Box, Container, Link } from "@mui/material";
|
|
5
|
+
import { UserHelper, AppearanceHelper, PersonHelper, ApiHelper } from "../../helpers";
|
|
6
|
+
import { UserMenu } from "./UserMenu";
|
|
7
|
+
import { useMountedState } from "../../hooks/useMountedState";
|
|
8
|
+
import { SocketHelper } from "../../helpers/SocketHelper";
|
|
9
|
+
import { ClosedDrawer, ClosedDrawerAppBar, OpenDrawer, OpenDrawerAppBar } from "./Drawers";
|
|
10
|
+
export const SiteWrapper = props => {
|
|
11
|
+
const [churchLogo, setChurchLogo] = React.useState();
|
|
12
|
+
const [open, setOpen] = React.useState(false);
|
|
13
|
+
const [notificationCounts, setNotificationCounts] = React.useState({ notificationCount: 0, pmCount: 0 });
|
|
14
|
+
const toggleDrawer = useCallback(() => { setOpen(!open); }, [open]);
|
|
15
|
+
const isMounted = useMountedState();
|
|
16
|
+
const CustomDrawer = useMemo(() => (open) ? OpenDrawer({ backgroundColor: props.appearance?.wrapperBackground }) : ClosedDrawer({ backgroundColor: props.appearance?.wrapperBackground }), [open, props.appearance?.wrapperBackground]);
|
|
17
|
+
const CustomAppBar = useMemo(() => (open) ? OpenDrawerAppBar : ClosedDrawerAppBar, [open]);
|
|
18
|
+
const loadCounts = useCallback(() => {
|
|
19
|
+
ApiHelper.get("/notifications/unreadCount", "MessagingApi").then(data => {
|
|
26
20
|
if (!notificationCounts || JSON.stringify(notificationCounts) !== JSON.stringify(data))
|
|
27
21
|
setNotificationCounts(data);
|
|
28
22
|
});
|
|
29
|
-
};
|
|
30
|
-
const handleNotification = () => {
|
|
23
|
+
}, [notificationCounts]);
|
|
24
|
+
const handleNotification = useCallback(() => {
|
|
31
25
|
loadCounts();
|
|
32
|
-
};
|
|
33
|
-
|
|
26
|
+
}, [loadCounts]);
|
|
27
|
+
React.useEffect(() => {
|
|
34
28
|
const getChurchLogo = async () => {
|
|
35
|
-
if (
|
|
36
|
-
setChurchLogo(
|
|
29
|
+
if (UserHelper.currentUserChurch) {
|
|
30
|
+
setChurchLogo(AppearanceHelper.getLogoDark(props.appearance, "/images/logo-wrapper.png"));
|
|
37
31
|
}
|
|
38
32
|
};
|
|
39
33
|
if (!isMounted()) {
|
|
40
34
|
getChurchLogo();
|
|
41
35
|
}
|
|
42
36
|
}, [isMounted, props.appearance]);
|
|
43
|
-
|
|
37
|
+
React.useEffect(() => {
|
|
44
38
|
if (!props.context.userChurch)
|
|
45
|
-
|
|
39
|
+
SocketHelper.setPersonChurch({ personId: null, churchId: null });
|
|
46
40
|
else
|
|
47
|
-
|
|
41
|
+
SocketHelper.setPersonChurch({ personId: props.context.userChurch?.person?.id, churchId: props.context.userChurch?.church?.id });
|
|
48
42
|
}, [props.context.userChurch]);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
React.useEffect(() => {
|
|
44
|
+
SocketHelper.addHandler("notification", "notificationBell", handleNotification);
|
|
45
|
+
SocketHelper.init();
|
|
52
46
|
loadCounts();
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
47
|
+
// Cleanup function to remove handlers and disconnect socket
|
|
48
|
+
return () => {
|
|
49
|
+
SocketHelper.removeHandler("notificationBell");
|
|
50
|
+
};
|
|
51
|
+
}, [handleNotification, loadCounts]);
|
|
52
|
+
const boxStyle = useMemo(() => {
|
|
53
|
+
const style = { flexGrow: 1, marginTop: 8, minHeight: "90vh" };
|
|
54
|
+
if (!props.omitOverflow)
|
|
55
|
+
style.overflow = "auto";
|
|
56
|
+
return style;
|
|
57
|
+
}, [props.omitOverflow]);
|
|
58
|
+
return _jsxs(_Fragment, { children: [_jsx(CustomAppBar, { position: "absolute", children: _jsxs(Toolbar, { sx: { pr: "24px", backgroundColor: props.appearance?.wrapperBackground }, children: [_jsx(IconButton, { edge: "start", color: "inherit", "aria-label": "open drawer", onClick: toggleDrawer, sx: { marginRight: "36px", ...(open && { display: "none" }) }, "data-testid": "open-navigation-drawer", children: _jsx(Icon, { children: "menu" }) }), _jsx(Typography, { variant: "h6", noWrap: true, children: UserHelper.currentUserChurch?.church?.name || "" }), _jsx("div", { style: { flex: 1 } }), UserHelper.user && _jsx(UserMenu, { profilePicture: PersonHelper.getPhotoUrl(props.context?.person), userName: `${UserHelper.user?.firstName} ${UserHelper.user?.lastName}`, userChurches: UserHelper.userChurches, currentUserChurch: UserHelper.currentUserChurch, context: props.context, appName: props.appName, onNavigate: props.onNavigate, loadCounts: loadCounts, notificationCounts: notificationCounts }), !UserHelper.user && _jsx(Link, { href: "/login", color: "inherit", style: { textDecoration: "none" }, children: "Login" })] }) }), _jsxs(CustomDrawer, { style: { backgroundColor: props.appearance?.wrapperBackground }, variant: "permanent", open: open, onMouseOver: useCallback(() => setOpen(true), []), onMouseLeave: useCallback(() => setOpen(false), []), children: [_jsxs(Toolbar, { sx: { display: "flex", alignItems: "center", width: "100%", px: [1] }, children: [_jsx("img", { src: churchLogo || "/images/logo-wrapper.png", alt: "logo", style: { maxWidth: 170 } }), _jsx("div", { style: { justifyContent: "flex-end", flex: 1, display: "flex" }, children: _jsx(IconButton, { onClick: toggleDrawer, "aria-label": "close navigation drawer", "data-testid": "close-navigation-drawer", children: _jsx(Icon, { style: { color: "#FFFFFF" }, children: "chevron_left" }) }) })] }), props.navContent] }), _jsx(Box, { component: "main", sx: boxStyle, children: _jsx(Container, { maxWidth: false, sx: { mt: 4, mb: 4 }, children: props.children }) })] });
|
|
58
59
|
};
|
|
59
|
-
exports.SiteWrapper = SiteWrapper;
|
|
60
60
|
//# sourceMappingURL=SiteWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteWrapper.js","sourceRoot":"","sources":["../../../src/components/wrapper/SiteWrapper.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"SiteWrapper.js","sourceRoot":"","sources":["../../../src/components/wrapper/SiteWrapper.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAiB,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,C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