@selfcommunity/react-ui 0.7.0-alpha.335 → 0.7.0-alpha.336
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/lib/cjs/components/BottomNavigation/BottomNavigation.js +8 -11
- package/lib/cjs/components/Composer/Attributes/Attributes.d.ts +22 -0
- package/lib/cjs/components/Composer/Attributes/Attributes.js +41 -0
- package/lib/cjs/components/Composer/Attributes/index.d.ts +3 -0
- package/lib/cjs/components/Composer/{Poll → Attributes}/index.js +2 -2
- package/lib/cjs/components/Composer/Composer.d.ts +53 -84
- package/lib/cjs/components/Composer/Composer.js +249 -443
- package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.d.ts +32 -0
- package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +53 -0
- package/lib/cjs/components/Composer/Content/ContentDiscussion/index.d.ts +3 -0
- package/lib/cjs/components/Composer/Content/ContentDiscussion/index.js +5 -0
- package/lib/cjs/components/Composer/Content/ContentPoll/ContentPoll.d.ts +26 -0
- package/lib/cjs/components/Composer/Content/ContentPoll/ContentPoll.js +129 -0
- package/lib/cjs/components/Composer/Content/ContentPoll/index.d.ts +3 -0
- package/lib/cjs/components/Composer/Content/ContentPoll/index.js +5 -0
- package/lib/cjs/components/Composer/Content/ContentPost/ContentPost.d.ts +32 -0
- package/lib/cjs/components/Composer/Content/ContentPost/ContentPost.js +51 -0
- package/lib/cjs/components/Composer/Content/ContentPost/index.d.ts +3 -0
- package/lib/cjs/components/Composer/Content/ContentPost/index.js +5 -0
- package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +11 -0
- package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +74 -0
- package/lib/cjs/components/Composer/Layer/AudienceLayer/index.d.ts +3 -0
- package/lib/cjs/components/Composer/Layer/AudienceLayer/index.js +5 -0
- package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +9 -0
- package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.js +41 -0
- package/lib/cjs/components/Composer/Layer/CategoryLayer/index.d.ts +3 -0
- package/lib/cjs/components/Composer/Layer/CategoryLayer/index.js +5 -0
- package/lib/cjs/components/Composer/Layer/CloseLayer/CloseLayer.d.ts +7 -0
- package/lib/cjs/components/Composer/Layer/CloseLayer/CloseLayer.js +41 -0
- package/lib/cjs/components/Composer/Layer/CloseLayer/index.d.ts +3 -0
- package/lib/cjs/components/Composer/{Audience → Layer/CloseLayer}/index.js +2 -2
- package/lib/cjs/components/Composer/Layer/LocationLayer/LocationLayer.d.ts +9 -0
- package/lib/cjs/components/Composer/Layer/LocationLayer/LocationLayer.js +41 -0
- package/lib/cjs/components/Composer/Layer/LocationLayer/index.d.ts +3 -0
- package/lib/cjs/components/Composer/Layer/LocationLayer/index.js +5 -0
- package/lib/cjs/components/Composer/Skeleton.d.ts +0 -4
- package/lib/cjs/components/Composer/Skeleton.js +10 -72
- package/lib/cjs/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.d.ts +6 -0
- package/lib/cjs/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.js +47 -0
- package/lib/cjs/components/Composer/TypeSwitchButtonGroup/index.d.ts +3 -0
- package/lib/cjs/components/Composer/TypeSwitchButtonGroup/index.js +5 -0
- package/lib/cjs/components/Composer/constants.d.ts +1 -0
- package/lib/cjs/components/Composer/constants.js +4 -0
- package/lib/cjs/components/Composer/index.d.ts +2 -3
- package/lib/cjs/components/Composer/index.js +1 -6
- package/lib/cjs/components/ComposerIconButton/ComposerIconButton.d.ts +2 -1
- package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +8 -8
- package/lib/cjs/components/Editor/Editor.js +14 -5
- package/lib/cjs/components/Feed/prefetchedData.d.ts +2 -368
- package/lib/cjs/components/Feed/prefetchedData.js +17 -16
- package/lib/cjs/components/FeedObject/Actions/Share/Share.js +2 -2
- package/lib/cjs/components/FeedObject/FeedObject.d.ts +2 -2
- package/lib/cjs/components/FeedObject/FeedObject.js +5 -5
- package/lib/cjs/components/FeedObjectMediaPreview/FeedObjectMediaPreview.d.ts +38 -0
- package/lib/cjs/components/FeedObjectMediaPreview/FeedObjectMediaPreview.js +66 -0
- package/lib/cjs/components/FeedObjectMediaPreview/index.d.ts +3 -0
- package/lib/cjs/components/FeedObjectMediaPreview/index.js +5 -0
- package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.d.ts +25 -33
- package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.js +34 -67
- package/lib/cjs/components/InlineComposerWidget/Skeleton.d.ts +4 -5
- package/lib/cjs/components/InlineComposerWidget/Skeleton.js +17 -37
- package/lib/cjs/components/InlineComposerWidget/constants.d.ts +1 -0
- package/lib/cjs/components/InlineComposerWidget/constants.js +4 -0
- package/lib/cjs/components/LocationAutocomplete/LocationAutocomplete.d.ts +2 -2
- package/lib/cjs/components/LocationAutocomplete/LocationAutocomplete.js +4 -2
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuIconButton.d.ts +1 -1
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +0 -5
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +19 -30
- package/lib/cjs/components/NavigationToolbarMobile/Skeleton.js +5 -6
- package/lib/cjs/components/NavigationToolbarMobile/constants.d.ts +1 -0
- package/lib/cjs/components/NavigationToolbarMobile/constants.js +4 -0
- package/lib/cjs/constants/Composer.d.ts +2 -0
- package/lib/cjs/constants/Composer.js +4 -2
- package/lib/cjs/index.d.ts +12 -12
- package/lib/cjs/index.js +14 -17
- package/lib/cjs/shared/Lightbox/Lightbox.js +2 -2
- package/lib/{esm/shared/Media/Image/PreviewComponent.d.ts → cjs/shared/Media/File/DisplayComponent.d.ts} +1 -11
- package/lib/cjs/shared/Media/{Image/PreviewComponent.js → File/DisplayComponent.js} +55 -145
- package/lib/{esm/shared/Media/Image/PreviewImage → cjs/shared/Media/File/Lightbox}/index.d.ts +4 -3
- package/lib/cjs/shared/Media/File/Lightbox/index.js +37 -0
- package/lib/cjs/shared/Media/File/PreviewComponent.d.ts +9 -0
- package/lib/cjs/shared/Media/File/PreviewComponent.js +51 -0
- package/lib/cjs/shared/Media/File/TriggerButton.d.ts +12 -0
- package/lib/cjs/shared/Media/File/TriggerButton.js +112 -0
- package/lib/cjs/shared/Media/File/asUploadButton.d.ts +7 -0
- package/lib/cjs/shared/Media/File/asUploadButton.js +30 -0
- package/lib/cjs/shared/Media/File/constants.d.ts +1 -0
- package/lib/cjs/shared/Media/File/constants.js +4 -0
- package/lib/cjs/shared/Media/File/filter.d.ts +3 -0
- package/lib/cjs/shared/Media/File/filter.js +4 -0
- package/lib/cjs/shared/Media/File/index.d.ts +3 -0
- package/lib/cjs/shared/Media/File/index.js +16 -0
- package/lib/cjs/shared/Media/Link/DisplayComponent.d.ts +20 -0
- package/lib/cjs/shared/Media/Link/DisplayComponent.js +69 -0
- package/lib/cjs/shared/Media/Link/LayerComponent.d.ts +9 -0
- package/lib/cjs/shared/Media/Link/LayerComponent.js +46 -0
- package/lib/cjs/shared/Media/Link/PreviewComponent.d.ts +7 -21
- package/lib/cjs/shared/Media/Link/PreviewComponent.js +28 -56
- package/lib/cjs/shared/Media/Link/TriggerButton.d.ts +4 -0
- package/lib/cjs/shared/Media/Link/TriggerButton.js +21 -0
- package/lib/cjs/shared/Media/Link/UrlTextField/index.js +1 -2
- package/lib/cjs/shared/Media/Link/constants.d.ts +1 -0
- package/lib/cjs/shared/Media/Link/constants.js +4 -0
- package/lib/cjs/shared/Media/Link/filter.d.ts +3 -0
- package/lib/cjs/shared/Media/Link/filter.js +4 -0
- package/lib/cjs/shared/Media/Link/index.js +9 -8
- package/lib/cjs/shared/Media/Share/DisplayComponent.d.ts +11 -0
- package/lib/cjs/shared/Media/Share/DisplayComponent.js +31 -0
- package/lib/cjs/shared/Media/Share/constants.d.ts +1 -0
- package/lib/cjs/shared/Media/Share/constants.js +4 -0
- package/lib/cjs/shared/Media/Share/filter.d.ts +3 -0
- package/lib/cjs/shared/Media/Share/filter.js +4 -0
- package/lib/cjs/shared/Media/Share/index.js +7 -7
- package/lib/cjs/shared/Media/index.d.ts +2 -4
- package/lib/cjs/shared/Media/index.js +3 -7
- package/lib/cjs/types/composer.d.ts +15 -0
- package/lib/cjs/types/composer.js +2 -0
- package/lib/cjs/types/media.d.ts +9 -5
- package/lib/esm/components/BottomNavigation/BottomNavigation.js +8 -11
- package/lib/esm/components/Composer/Attributes/Attributes.d.ts +22 -0
- package/lib/esm/components/Composer/Attributes/Attributes.js +38 -0
- package/lib/esm/components/Composer/Attributes/index.d.ts +3 -0
- package/lib/esm/components/Composer/Attributes/index.js +2 -0
- package/lib/esm/components/Composer/Composer.d.ts +53 -84
- package/lib/esm/components/Composer/Composer.js +246 -439
- package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.d.ts +32 -0
- package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +50 -0
- package/lib/esm/components/Composer/Content/ContentDiscussion/index.d.ts +3 -0
- package/lib/esm/components/Composer/Content/ContentDiscussion/index.js +2 -0
- package/lib/esm/components/Composer/Content/ContentPoll/ContentPoll.d.ts +26 -0
- package/lib/esm/components/Composer/Content/ContentPoll/ContentPoll.js +127 -0
- package/lib/esm/components/Composer/Content/ContentPoll/index.d.ts +3 -0
- package/lib/esm/components/Composer/Content/ContentPoll/index.js +2 -0
- package/lib/esm/components/Composer/Content/ContentPost/ContentPost.d.ts +32 -0
- package/lib/esm/components/Composer/Content/ContentPost/ContentPost.js +49 -0
- package/lib/esm/components/Composer/Content/ContentPost/index.d.ts +3 -0
- package/lib/esm/components/Composer/Content/ContentPost/index.js +2 -0
- package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +11 -0
- package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +72 -0
- package/lib/esm/components/Composer/Layer/AudienceLayer/index.d.ts +3 -0
- package/lib/esm/components/Composer/Layer/AudienceLayer/index.js +2 -0
- package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +9 -0
- package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.js +39 -0
- package/lib/esm/components/Composer/Layer/CategoryLayer/index.d.ts +3 -0
- package/lib/esm/components/Composer/Layer/CategoryLayer/index.js +2 -0
- package/lib/esm/components/Composer/Layer/CloseLayer/CloseLayer.d.ts +7 -0
- package/lib/esm/components/Composer/Layer/CloseLayer/CloseLayer.js +39 -0
- package/lib/esm/components/Composer/Layer/CloseLayer/index.d.ts +3 -0
- package/lib/esm/components/Composer/Layer/CloseLayer/index.js +2 -0
- package/lib/esm/components/Composer/Layer/LocationLayer/LocationLayer.d.ts +9 -0
- package/lib/esm/components/Composer/Layer/LocationLayer/LocationLayer.js +39 -0
- package/lib/esm/components/Composer/Layer/LocationLayer/index.d.ts +3 -0
- package/lib/esm/components/Composer/Layer/LocationLayer/index.js +2 -0
- package/lib/esm/components/Composer/Skeleton.d.ts +0 -4
- package/lib/esm/components/Composer/Skeleton.js +6 -68
- package/lib/esm/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.d.ts +6 -0
- package/lib/esm/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.js +44 -0
- package/lib/esm/components/Composer/TypeSwitchButtonGroup/index.d.ts +3 -0
- package/lib/esm/components/Composer/TypeSwitchButtonGroup/index.js +2 -0
- package/lib/esm/components/Composer/constants.d.ts +1 -0
- package/lib/esm/components/Composer/constants.js +1 -0
- package/lib/esm/components/Composer/index.d.ts +2 -3
- package/lib/esm/components/Composer/index.js +1 -3
- package/lib/esm/components/ComposerIconButton/ComposerIconButton.d.ts +2 -1
- package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +8 -8
- package/lib/esm/components/Editor/Editor.js +16 -7
- package/lib/esm/components/Feed/Feed.js +4 -4
- package/lib/esm/components/Feed/prefetchedData.d.ts +2 -368
- package/lib/esm/components/Feed/prefetchedData.js +17 -16
- package/lib/esm/components/FeedObject/Actions/Share/Share.js +4 -4
- package/lib/esm/components/FeedObject/FeedObject.d.ts +2 -2
- package/lib/esm/components/FeedObject/FeedObject.js +8 -8
- package/lib/esm/components/FeedObjectMediaPreview/FeedObjectMediaPreview.d.ts +38 -0
- package/lib/esm/components/FeedObjectMediaPreview/FeedObjectMediaPreview.js +64 -0
- package/lib/esm/components/FeedObjectMediaPreview/index.d.ts +3 -0
- package/lib/esm/components/FeedObjectMediaPreview/index.js +2 -0
- package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.d.ts +25 -33
- package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.js +31 -64
- package/lib/esm/components/InlineComposerWidget/Skeleton.d.ts +4 -5
- package/lib/esm/components/InlineComposerWidget/Skeleton.js +15 -35
- package/lib/esm/components/InlineComposerWidget/constants.d.ts +1 -0
- package/lib/esm/components/InlineComposerWidget/constants.js +1 -0
- package/lib/esm/components/LocationAutocomplete/LocationAutocomplete.d.ts +2 -2
- package/lib/esm/components/LocationAutocomplete/LocationAutocomplete.js +4 -2
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.d.ts +1 -1
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.js +1 -1
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +0 -5
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +12 -23
- package/lib/esm/components/NavigationToolbarMobile/Skeleton.js +3 -4
- package/lib/esm/components/NavigationToolbarMobile/constants.d.ts +1 -0
- package/lib/esm/components/NavigationToolbarMobile/constants.js +1 -0
- package/lib/esm/constants/Composer.d.ts +2 -0
- package/lib/esm/constants/Composer.js +3 -1
- package/lib/esm/index.d.ts +12 -12
- package/lib/esm/index.js +33 -33
- package/lib/esm/shared/Lightbox/Lightbox.js +2 -2
- package/lib/{cjs/shared/Media/Image/PreviewComponent.d.ts → esm/shared/Media/File/DisplayComponent.d.ts} +1 -11
- package/lib/esm/shared/Media/{Image/PreviewComponent.js → File/DisplayComponent.js} +50 -140
- package/lib/{cjs/shared/Media/Image/PreviewImage → esm/shared/Media/File/Lightbox}/index.d.ts +4 -3
- package/lib/esm/shared/Media/File/Lightbox/index.js +34 -0
- package/lib/esm/shared/Media/File/PreviewComponent.d.ts +9 -0
- package/lib/esm/shared/Media/File/PreviewComponent.js +49 -0
- package/lib/esm/shared/Media/File/TriggerButton.d.ts +12 -0
- package/lib/esm/shared/Media/File/TriggerButton.js +110 -0
- package/lib/esm/shared/Media/File/asUploadButton.d.ts +7 -0
- package/lib/esm/shared/Media/File/asUploadButton.js +28 -0
- package/lib/esm/shared/Media/File/constants.d.ts +1 -0
- package/lib/esm/shared/Media/File/constants.js +1 -0
- package/lib/esm/shared/Media/File/filter.d.ts +3 -0
- package/lib/esm/shared/Media/File/filter.js +2 -0
- package/lib/esm/shared/Media/File/index.d.ts +3 -0
- package/lib/esm/shared/Media/File/index.js +13 -0
- package/lib/esm/shared/Media/Link/DisplayComponent.d.ts +20 -0
- package/lib/esm/shared/Media/Link/DisplayComponent.js +67 -0
- package/lib/esm/shared/Media/Link/LayerComponent.d.ts +9 -0
- package/lib/esm/shared/Media/Link/LayerComponent.js +44 -0
- package/lib/esm/shared/Media/Link/PreviewComponent.d.ts +7 -21
- package/lib/esm/shared/Media/Link/PreviewComponent.js +27 -54
- package/lib/esm/shared/Media/Link/TriggerButton.d.ts +4 -0
- package/lib/esm/shared/Media/Link/TriggerButton.js +19 -0
- package/lib/esm/shared/Media/Link/UrlTextField/index.js +2 -3
- package/lib/esm/shared/Media/Link/constants.d.ts +1 -0
- package/lib/esm/shared/Media/Link/constants.js +1 -0
- package/lib/esm/shared/Media/Link/filter.d.ts +3 -0
- package/lib/esm/shared/Media/Link/filter.js +2 -0
- package/lib/esm/shared/Media/Link/index.js +9 -8
- package/lib/esm/shared/Media/Share/DisplayComponent.d.ts +11 -0
- package/lib/esm/shared/Media/Share/DisplayComponent.js +29 -0
- package/lib/esm/shared/Media/Share/constants.d.ts +1 -0
- package/lib/esm/shared/Media/Share/constants.js +1 -0
- package/lib/esm/shared/Media/Share/filter.d.ts +3 -0
- package/lib/esm/shared/Media/Share/filter.js +2 -0
- package/lib/esm/shared/Media/Share/index.js +7 -7
- package/lib/esm/shared/Media/index.d.ts +2 -4
- package/lib/esm/shared/Media/index.js +2 -4
- package/lib/esm/types/composer.d.ts +15 -0
- package/lib/esm/types/composer.js +1 -0
- package/lib/esm/types/media.d.ts +9 -5
- package/lib/umd/react-ui.js +1 -1
- package/package.json +7 -7
- package/lib/cjs/components/Composer/Audience/Audience.d.ts +0 -71
- package/lib/cjs/components/Composer/Audience/Audience.js +0 -69
- package/lib/cjs/components/Composer/Audience/index.d.ts +0 -3
- package/lib/cjs/components/Composer/Poll/Poll.d.ts +0 -31
- package/lib/cjs/components/Composer/Poll/Poll.js +0 -151
- package/lib/cjs/components/Composer/Poll/index.d.ts +0 -3
- package/lib/cjs/shared/Media/Document/EditButton.d.ts +0 -2
- package/lib/cjs/shared/Media/Document/EditButton.js +0 -10
- package/lib/cjs/shared/Media/Document/EditComponent.d.ts +0 -3
- package/lib/cjs/shared/Media/Document/EditComponent.js +0 -103
- package/lib/cjs/shared/Media/Document/PreviewComponent.d.ts +0 -3
- package/lib/cjs/shared/Media/Document/PreviewComponent.js +0 -43
- package/lib/cjs/shared/Media/Document/index.d.ts +0 -3
- package/lib/cjs/shared/Media/Document/index.js +0 -16
- package/lib/cjs/shared/Media/Image/EditButton.d.ts +0 -2
- package/lib/cjs/shared/Media/Image/EditButton.js +0 -10
- package/lib/cjs/shared/Media/Image/EditComponent.d.ts +0 -3
- package/lib/cjs/shared/Media/Image/EditComponent.js +0 -102
- package/lib/cjs/shared/Media/Image/PreviewImage/index.js +0 -41
- package/lib/cjs/shared/Media/Image/index.d.ts +0 -3
- package/lib/cjs/shared/Media/Image/index.js +0 -16
- package/lib/cjs/shared/Media/Link/EditButton.d.ts +0 -2
- package/lib/cjs/shared/Media/Link/EditButton.js +0 -10
- package/lib/cjs/shared/Media/Link/EditComponent.d.ts +0 -3
- package/lib/cjs/shared/Media/Link/EditComponent.js +0 -46
- package/lib/cjs/shared/Media/Share/PreviewComponent.d.ts +0 -7
- package/lib/cjs/shared/Media/Share/PreviewComponent.js +0 -32
- package/lib/cjs/shared/Media/Video/EditButton.d.ts +0 -2
- package/lib/cjs/shared/Media/Video/EditButton.js +0 -10
- package/lib/cjs/shared/Media/Video/EditComponent.d.ts +0 -3
- package/lib/cjs/shared/Media/Video/EditComponent.js +0 -89
- package/lib/cjs/shared/Media/Video/PreviewComponent.d.ts +0 -19
- package/lib/cjs/shared/Media/Video/PreviewComponent.js +0 -37
- package/lib/cjs/shared/Media/Video/index.d.ts +0 -3
- package/lib/cjs/shared/Media/Video/index.js +0 -16
- package/lib/cjs/shared/MediasPreview/index.d.ts +0 -18
- package/lib/cjs/shared/MediasPreview/index.js +0 -44
- package/lib/esm/components/Composer/Audience/Audience.d.ts +0 -71
- package/lib/esm/components/Composer/Audience/Audience.js +0 -66
- package/lib/esm/components/Composer/Audience/index.d.ts +0 -3
- package/lib/esm/components/Composer/Audience/index.js +0 -2
- package/lib/esm/components/Composer/Poll/Poll.d.ts +0 -31
- package/lib/esm/components/Composer/Poll/Poll.js +0 -149
- package/lib/esm/components/Composer/Poll/index.d.ts +0 -3
- package/lib/esm/components/Composer/Poll/index.js +0 -2
- package/lib/esm/shared/Media/Document/EditButton.d.ts +0 -2
- package/lib/esm/shared/Media/Document/EditButton.js +0 -7
- package/lib/esm/shared/Media/Document/EditComponent.d.ts +0 -3
- package/lib/esm/shared/Media/Document/EditComponent.js +0 -101
- package/lib/esm/shared/Media/Document/PreviewComponent.d.ts +0 -3
- package/lib/esm/shared/Media/Document/PreviewComponent.js +0 -41
- package/lib/esm/shared/Media/Document/index.d.ts +0 -3
- package/lib/esm/shared/Media/Document/index.js +0 -13
- package/lib/esm/shared/Media/Image/EditButton.d.ts +0 -2
- package/lib/esm/shared/Media/Image/EditButton.js +0 -7
- package/lib/esm/shared/Media/Image/EditComponent.d.ts +0 -3
- package/lib/esm/shared/Media/Image/EditComponent.js +0 -100
- package/lib/esm/shared/Media/Image/PreviewImage/index.js +0 -38
- package/lib/esm/shared/Media/Image/index.d.ts +0 -3
- package/lib/esm/shared/Media/Image/index.js +0 -13
- package/lib/esm/shared/Media/Link/EditButton.d.ts +0 -2
- package/lib/esm/shared/Media/Link/EditButton.js +0 -7
- package/lib/esm/shared/Media/Link/EditComponent.d.ts +0 -3
- package/lib/esm/shared/Media/Link/EditComponent.js +0 -43
- package/lib/esm/shared/Media/Share/PreviewComponent.d.ts +0 -7
- package/lib/esm/shared/Media/Share/PreviewComponent.js +0 -29
- package/lib/esm/shared/Media/Video/EditButton.d.ts +0 -2
- package/lib/esm/shared/Media/Video/EditButton.js +0 -7
- package/lib/esm/shared/Media/Video/EditComponent.d.ts +0 -3
- package/lib/esm/shared/Media/Video/EditComponent.js +0 -87
- package/lib/esm/shared/Media/Video/PreviewComponent.d.ts +0 -19
- package/lib/esm/shared/Media/Video/PreviewComponent.js +0 -34
- package/lib/esm/shared/Media/Video/index.d.ts +0 -3
- package/lib/esm/shared/Media/Video/index.js +0 -13
- package/lib/esm/shared/MediasPreview/index.d.ts +0 -18
- package/lib/esm/shared/MediasPreview/index.js +0 -42
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SCMediaObjectType } from '../../types/media';
|
|
2
|
+
import { BoxProps } from '@mui/material';
|
|
3
|
+
import { SCMediaType } from '@selfcommunity/types';
|
|
4
|
+
export interface FeedObjectMediaPreviewProps extends BoxProps {
|
|
5
|
+
/**
|
|
6
|
+
* Medias preview array
|
|
7
|
+
*/
|
|
8
|
+
medias: SCMediaType[];
|
|
9
|
+
/**
|
|
10
|
+
* Media types
|
|
11
|
+
* @default 'image', 'document', 'link', 'share'
|
|
12
|
+
*/
|
|
13
|
+
mediaObjectTypes?: SCMediaObjectType[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* > API documentation for the Community-JS FeedObjectMediaPreview component. Learn about the available props and the CSS API.
|
|
17
|
+
*
|
|
18
|
+
*
|
|
19
|
+
* The FeedObjectMediaPreview component render the list of medias in a feed object thanks to given configurations.
|
|
20
|
+
|
|
21
|
+
#### Import
|
|
22
|
+
```jsx
|
|
23
|
+
import {FeedObjectMediaPreview} from '@selfcommunity/react-ui';
|
|
24
|
+
```
|
|
25
|
+
#### Component Name
|
|
26
|
+
The name `SCFeedObjectMediaPreview` can be used when providing style overrides in the theme.
|
|
27
|
+
|
|
28
|
+
#### CSS
|
|
29
|
+
|
|
30
|
+
|Rule Name|Global class|Description|
|
|
31
|
+
|---|---|---|
|
|
32
|
+
|root|.SCFeedObjectMediaPreview-root|Styles applied to the root element.|
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
* @param inProps
|
|
36
|
+
*/
|
|
37
|
+
declare const _default: (inProps: FeedObjectMediaPreviewProps) => JSX.Element;
|
|
38
|
+
export default _default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import Box from '@mui/material/Box';
|
|
5
|
+
import { useSCMediaClick } from '@selfcommunity/react-core';
|
|
6
|
+
import { useThemeProps } from '@mui/system';
|
|
7
|
+
import { File, Link, Share } from '../../shared/Media';
|
|
8
|
+
import classNames from 'classnames';
|
|
9
|
+
const PREFIX = 'SCFeedObjectMediaPreview';
|
|
10
|
+
const classes = {
|
|
11
|
+
root: `${PREFIX}-root`
|
|
12
|
+
};
|
|
13
|
+
const Root = styled(Box, {
|
|
14
|
+
name: PREFIX,
|
|
15
|
+
slot: 'Root'
|
|
16
|
+
})(({ theme }) => ({}));
|
|
17
|
+
/**
|
|
18
|
+
* > API documentation for the Community-JS FeedObjectMediaPreview component. Learn about the available props and the CSS API.
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
* The FeedObjectMediaPreview component render the list of medias in a feed object thanks to given configurations.
|
|
22
|
+
|
|
23
|
+
#### Import
|
|
24
|
+
```jsx
|
|
25
|
+
import {FeedObjectMediaPreview} from '@selfcommunity/react-ui';
|
|
26
|
+
```
|
|
27
|
+
#### Component Name
|
|
28
|
+
The name `SCFeedObjectMediaPreview` can be used when providing style overrides in the theme.
|
|
29
|
+
|
|
30
|
+
#### CSS
|
|
31
|
+
|
|
32
|
+
|Rule Name|Global class|Description|
|
|
33
|
+
|---|---|---|
|
|
34
|
+
|root|.SCFeedObjectMediaPreview-root|Styles applied to the root element.|
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
* @param inProps
|
|
38
|
+
*/
|
|
39
|
+
export default (inProps) => {
|
|
40
|
+
//PROPS
|
|
41
|
+
const props = useThemeProps({
|
|
42
|
+
props: inProps,
|
|
43
|
+
name: PREFIX
|
|
44
|
+
});
|
|
45
|
+
const { className, medias, mediaObjectTypes = [File, Link, Share] } = props, rest = __rest(props, ["className", "medias", "mediaObjectTypes"]);
|
|
46
|
+
const { handleMediaClick } = useSCMediaClick();
|
|
47
|
+
if (!medias.length) {
|
|
48
|
+
/**
|
|
49
|
+
* Feed without any medias:
|
|
50
|
+
* don't render anything
|
|
51
|
+
*/
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Renders list of media preview
|
|
56
|
+
* The adornment prop is used to insert the controls
|
|
57
|
+
* for re-editing the media at the top of the group of elements
|
|
58
|
+
*/
|
|
59
|
+
return (React.createElement(Root, Object.assign({ className: classNames(className, classes.root) }, rest), mediaObjectTypes.map((mediaObject) => {
|
|
60
|
+
const { displayProps = {} } = mediaObject;
|
|
61
|
+
return (React.createElement("div", { key: mediaObject.name },
|
|
62
|
+
React.createElement(mediaObject.displayComponent, Object.assign({ medias: medias }, displayProps, { onMediaClick: handleMediaClick }))));
|
|
63
|
+
})));
|
|
64
|
+
};
|
|
@@ -1,39 +1,32 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { SCCategoryType, SCMediaType, SCPollType, SCTagType } from '@selfcommunity/types';
|
|
3
|
-
import { CardProps } from '@mui/material';
|
|
4
2
|
import { SCMediaObjectType } from '../../types/media';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
poll?: SCPollType;
|
|
26
|
-
location?: string;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Callback triggered on success contribution creation
|
|
30
|
-
* @default null
|
|
31
|
-
*/
|
|
32
|
-
onSuccess?: (res: any) => void;
|
|
3
|
+
import { WidgetProps } from '../Widget';
|
|
4
|
+
export interface InlineComposerWidgetProps extends Omit<WidgetProps, 'defaultValue'> {
|
|
5
|
+
/**
|
|
6
|
+
* Media objects available
|
|
7
|
+
* @default Image, Document, Link
|
|
8
|
+
*/
|
|
9
|
+
mediaObjectTypes?: SCMediaObjectType[];
|
|
10
|
+
/**
|
|
11
|
+
* Initialization Data for the Composer, this is a hook to generate custom posts
|
|
12
|
+
* @default null
|
|
13
|
+
*/
|
|
14
|
+
defaultValue?: {
|
|
15
|
+
title?: string;
|
|
16
|
+
text?: string;
|
|
17
|
+
categories?: SCCategoryType[];
|
|
18
|
+
audience?: string;
|
|
19
|
+
addressing?: SCTagType[];
|
|
20
|
+
medias?: SCMediaType[];
|
|
21
|
+
poll?: SCPollType;
|
|
22
|
+
location?: string;
|
|
33
23
|
};
|
|
34
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Callback triggered on success contribution creation
|
|
26
|
+
* @default null
|
|
27
|
+
*/
|
|
28
|
+
onSuccess?: (res: any) => void;
|
|
35
29
|
}
|
|
36
|
-
export declare type InlineComposerWidgetProps<D extends React.ElementType = InlineComposerTypeMap['defaultComponent'], P = {}> = OverrideProps<InlineComposerTypeMap<P, D>, D>;
|
|
37
30
|
/**
|
|
38
31
|
* > API documentation for the Community-JS Inline Composer component. Learn about the available props and the CSS API.
|
|
39
32
|
*
|
|
@@ -55,7 +48,6 @@ export declare type InlineComposerWidgetProps<D extends React.ElementType = Inli
|
|
|
55
48
|
|root|.SCInlineComposerWidget-root|Styles applied to the root element.|
|
|
56
49
|
|content|.SCInlineComposerWidget-content|Styles applied to the content element.|
|
|
57
50
|
|input|.SCInlineComposerWidget-input|Styles applied to the input element.|
|
|
58
|
-
|actions|.SCInlineComposerWidget-actions|Styles applied to the actions section.|
|
|
59
51
|
|avatar|.SCInlineComposerWidget-avatar|Styles applied to the avatar element.|
|
|
60
52
|
|
|
61
53
|
|
|
@@ -1,39 +1,25 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
|
-
import React, {
|
|
3
|
-
import {
|
|
4
|
-
import { Avatar, Box, Button,
|
|
2
|
+
import React, { useCallback, useState } from 'react';
|
|
3
|
+
import { Link, SCRoutes, UserUtils, useSCContext, useSCRouting, useSCUser, } from '@selfcommunity/react-core';
|
|
4
|
+
import { Avatar, Box, Button, CardContent } from '@mui/material';
|
|
5
5
|
import { styled } from '@mui/material/styles';
|
|
6
|
-
import { Document, Image, Link as MediaLink } from '../../shared/Media';
|
|
7
|
-
import Composer, { MAIN_VIEW, POLL_VIEW } from '../Composer';
|
|
8
|
-
import Icon from '@mui/material/Icon';
|
|
9
6
|
import { FormattedMessage } from 'react-intl';
|
|
10
7
|
import { useSnackbar } from 'notistack';
|
|
11
8
|
import Widget from '../Widget';
|
|
12
9
|
import { useThemeProps } from '@mui/system';
|
|
13
|
-
|
|
10
|
+
import Composer from '../Composer';
|
|
11
|
+
import { File, Link as MediaLink } from '../../shared/Media';
|
|
12
|
+
import { PREFIX } from './constants';
|
|
14
13
|
const classes = {
|
|
15
14
|
root: `${PREFIX}-root`,
|
|
16
15
|
content: `${PREFIX}-content`,
|
|
17
16
|
input: `${PREFIX}-input`,
|
|
18
|
-
actions: `${PREFIX}-actions`,
|
|
19
17
|
avatar: `${PREFIX}-avatar`
|
|
20
18
|
};
|
|
21
19
|
const Root = styled(Widget, {
|
|
22
20
|
name: PREFIX,
|
|
23
|
-
slot: 'Root'
|
|
24
|
-
|
|
25
|
-
})(({ theme }) => ({}));
|
|
26
|
-
const PREFERENCES = [
|
|
27
|
-
SCPreferences.CONFIGURATIONS_POST_TYPE_ENABLED,
|
|
28
|
-
SCPreferences.CONFIGURATIONS_DISCUSSION_TYPE_ENABLED,
|
|
29
|
-
SCPreferences.ADDONS_POST_GEOLOCATION_ENABLED,
|
|
30
|
-
SCPreferences.ADDONS_POLLS_ENABLED,
|
|
31
|
-
SCPreferences.ADDONS_VIDEO_UPLOAD_ENABLED
|
|
32
|
-
];
|
|
33
|
-
const INITIAL_STATE = {
|
|
34
|
-
open: false,
|
|
35
|
-
view: null
|
|
36
|
-
};
|
|
21
|
+
slot: 'Root'
|
|
22
|
+
})(() => ({}));
|
|
37
23
|
/**
|
|
38
24
|
* > API documentation for the Community-JS Inline Composer component. Learn about the available props and the CSS API.
|
|
39
25
|
*
|
|
@@ -55,7 +41,6 @@ const INITIAL_STATE = {
|
|
|
55
41
|
|root|.SCInlineComposerWidget-root|Styles applied to the root element.|
|
|
56
42
|
|content|.SCInlineComposerWidget-content|Styles applied to the content element.|
|
|
57
43
|
|input|.SCInlineComposerWidget-input|Styles applied to the input element.|
|
|
58
|
-
|actions|.SCInlineComposerWidget-actions|Styles applied to the actions section.|
|
|
59
44
|
|avatar|.SCInlineComposerWidget-avatar|Styles applied to the avatar element.|
|
|
60
45
|
|
|
61
46
|
|
|
@@ -67,46 +52,34 @@ export default function InlineComposerWidget(inProps) {
|
|
|
67
52
|
props: inProps,
|
|
68
53
|
name: PREFIX
|
|
69
54
|
});
|
|
70
|
-
const { mediaObjectTypes = [
|
|
55
|
+
const { mediaObjectTypes = [File, MediaLink], defaultValue, onSuccess = null } = props, rest = __rest(props, ["mediaObjectTypes", "defaultValue", "onSuccess"]);
|
|
71
56
|
// Context
|
|
72
|
-
const scContext =
|
|
73
|
-
const
|
|
74
|
-
const scUserContext = useContext(SCUserContext);
|
|
57
|
+
const scContext = useSCContext();
|
|
58
|
+
const scUserContext = useSCUser();
|
|
75
59
|
const scRoutingContext = useSCRouting();
|
|
76
60
|
const { enqueueSnackbar } = useSnackbar();
|
|
77
61
|
// State variables
|
|
78
|
-
const [
|
|
79
|
-
const { open, view } = state;
|
|
80
|
-
/*
|
|
81
|
-
* Compute preferences
|
|
82
|
-
*/
|
|
83
|
-
const preferences = useMemo(() => {
|
|
84
|
-
const _preferences = {};
|
|
85
|
-
PREFERENCES.map((p) => (_preferences[p] = p in scPreferencesContext.preferences ? scPreferencesContext.preferences[p].value : null));
|
|
86
|
-
return _preferences;
|
|
87
|
-
}, [scPreferencesContext.preferences]);
|
|
62
|
+
const [open, setOpen] = useState(false);
|
|
88
63
|
// Handlers
|
|
89
|
-
const handleOpen = (
|
|
90
|
-
|
|
91
|
-
if (scUserContext.user) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
setState({ view, open: true });
|
|
100
|
-
}
|
|
64
|
+
const handleOpen = useCallback(() => {
|
|
65
|
+
if (scUserContext.user) {
|
|
66
|
+
if (UserUtils.isBlocked(scUserContext.user)) {
|
|
67
|
+
enqueueSnackbar(React.createElement(FormattedMessage, { id: "ui.common.userBlocked", defaultMessage: "ui.common.userBlocked" }), {
|
|
68
|
+
variant: 'warning',
|
|
69
|
+
autoHideDuration: 3000
|
|
70
|
+
});
|
|
101
71
|
}
|
|
102
72
|
else {
|
|
103
|
-
|
|
73
|
+
setOpen(true);
|
|
104
74
|
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
};
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
scContext.settings.handleAnonymousAction();
|
|
78
|
+
}
|
|
79
|
+
}, [scUserContext.user, scContext.settings]);
|
|
80
|
+
const handleClose = useCallback(() => {
|
|
81
|
+
setOpen(false);
|
|
82
|
+
}, []);
|
|
110
83
|
const handleSuccess = (feedObject) => {
|
|
111
84
|
if (onSuccess) {
|
|
112
85
|
onSuccess(feedObject);
|
|
@@ -117,21 +90,15 @@ export default function InlineComposerWidget(inProps) {
|
|
|
117
90
|
autoHideDuration: 3000
|
|
118
91
|
});
|
|
119
92
|
}
|
|
120
|
-
|
|
93
|
+
setOpen(false);
|
|
121
94
|
};
|
|
122
95
|
return (React.createElement(React.Fragment, null,
|
|
123
96
|
React.createElement(Root, Object.assign({ className: classes.root }, rest),
|
|
124
97
|
React.createElement(CardContent, { className: classes.content },
|
|
125
98
|
React.createElement(Box, { className: classes.input },
|
|
126
|
-
React.createElement(Button, { variant: "text", disableFocusRipple: true, disableRipple: true, disableElevation: true, onClick: handleOpen
|
|
99
|
+
React.createElement(Button, { variant: "text", disableFocusRipple: true, disableRipple: true, disableElevation: true, onClick: handleOpen, fullWidth: true, color: "inherit" },
|
|
127
100
|
React.createElement(FormattedMessage, { id: "ui.inlineComposerWidget.label", defaultMessage: "ui.inlineComposerWidget.label" }))),
|
|
128
|
-
React.createElement(Box, { className: classes.actions },
|
|
129
|
-
mediaObjectTypes
|
|
130
|
-
.filter((mediaObjectType) => mediaObjectType.editButton !== null)
|
|
131
|
-
.map((mediaObjectType) => (React.createElement(mediaObjectType.editButton, { key: mediaObjectType.name, onClick: handleOpen(mediaObjectType.name) }))),
|
|
132
|
-
preferences[SCPreferences.ADDONS_POLLS_ENABLED] && (React.createElement(IconButton, { onClick: handleOpen(POLL_VIEW) },
|
|
133
|
-
React.createElement(Icon, null, "bar_chart")))),
|
|
134
101
|
React.createElement(Box, { className: classes.avatar }, !scUserContext.user ? (React.createElement(Avatar, { variant: "circular" })) : (React.createElement(Link, { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, scUserContext.user) },
|
|
135
102
|
React.createElement(Avatar, { alt: scUserContext.user.username, variant: "circular", src: scUserContext.user.avatar })))))),
|
|
136
|
-
React.createElement(Composer, { open: open,
|
|
103
|
+
React.createElement(Composer, { open: open, mediaObjectTypes: mediaObjectTypes, defaultValue: defaultValue, fullWidth: true, onClose: handleClose, onSuccess: handleSuccess })));
|
|
137
104
|
}
|
|
@@ -15,11 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
|Rule Name|Global class|Description|
|
|
17
17
|
|---|---|---|
|
|
18
|
-
|root|.
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|avatar|.SCInlineComposerWidgetSkeleton-avatar|Styles applied to the avatar element.|
|
|
18
|
+
|root|.SCInlineComposerWidget-skeleton-root|Styles applied to the root element.|
|
|
19
|
+
|content|.SCInlineComposerWidget-content|Styles applied to the content element.|
|
|
20
|
+
|input|.SCInlineComposerWidget-input|Styles applied to the input element.|
|
|
21
|
+
|avatar|.SCInlineComposerWidget-avatar|Styles applied to the avatar element.|
|
|
23
22
|
*
|
|
24
23
|
*/
|
|
25
24
|
export default function InlineComposerWidgetSkeleton(): JSX.Element;
|
|
@@ -1,34 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
3
|
import Skeleton from '@mui/material/Skeleton';
|
|
4
|
-
import { Box,
|
|
4
|
+
import { Box, CardContent } from '@mui/material';
|
|
5
5
|
import Widget from '../Widget';
|
|
6
|
-
|
|
6
|
+
import { PREFIX } from './constants';
|
|
7
7
|
const classes = {
|
|
8
|
-
root: `${PREFIX}-root`,
|
|
8
|
+
root: `${PREFIX}-skeleton-root`,
|
|
9
|
+
content: `${PREFIX}-content`,
|
|
9
10
|
input: `${PREFIX}-input`,
|
|
10
|
-
actions: `${PREFIX}-actions`,
|
|
11
|
-
action: `${PREFIX}-action`,
|
|
12
11
|
avatar: `${PREFIX}-avatar`
|
|
13
12
|
};
|
|
14
13
|
const Root = styled(Widget, {
|
|
15
14
|
name: PREFIX,
|
|
16
|
-
slot: '
|
|
17
|
-
|
|
18
|
-
})(({ theme }) => ({
|
|
19
|
-
padding: theme.spacing(),
|
|
20
|
-
display: 'flex',
|
|
21
|
-
flexDirection: 'row',
|
|
22
|
-
justifyContent: 'space-between',
|
|
23
|
-
marginBottom: theme.spacing(2),
|
|
24
|
-
[`& .${classes.input}`]: {
|
|
25
|
-
flexGrow: 2
|
|
26
|
-
},
|
|
27
|
-
[`& .${classes.actions}`]: {
|
|
28
|
-
marginLeft: 15,
|
|
29
|
-
marginRight: 15
|
|
30
|
-
}
|
|
31
|
-
}));
|
|
15
|
+
slot: 'SkeletonRoot'
|
|
16
|
+
})(() => ({}));
|
|
32
17
|
/**
|
|
33
18
|
* > API documentation for the Community-JS Inline Composer Skeleton component. Learn about the available props and the CSS API.
|
|
34
19
|
|
|
@@ -46,22 +31,17 @@ const Root = styled(Widget, {
|
|
|
46
31
|
|
|
47
32
|
|Rule Name|Global class|Description|
|
|
48
33
|
|---|---|---|
|
|
49
|
-
|root|.
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
|
|
|
53
|
-
|avatar|.SCInlineComposerWidgetSkeleton-avatar|Styles applied to the avatar element.|
|
|
34
|
+
|root|.SCInlineComposerWidget-skeleton-root|Styles applied to the root element.|
|
|
35
|
+
|content|.SCInlineComposerWidget-content|Styles applied to the content element.|
|
|
36
|
+
|input|.SCInlineComposerWidget-input|Styles applied to the input element.|
|
|
37
|
+
|avatar|.SCInlineComposerWidget-avatar|Styles applied to the avatar element.|
|
|
54
38
|
*
|
|
55
39
|
*/
|
|
56
40
|
export default function InlineComposerWidgetSkeleton() {
|
|
57
41
|
return (React.createElement(Root, { className: classes.root },
|
|
58
|
-
React.createElement(
|
|
59
|
-
React.createElement(
|
|
60
|
-
|
|
61
|
-
React.createElement(
|
|
62
|
-
|
|
63
|
-
React.createElement(Skeleton, { className: classes.action, animation: "wave", variant: "circular", width: 27, height: 27 }),
|
|
64
|
-
React.createElement(Skeleton, { className: classes.action, animation: "wave", variant: "circular", width: 27, height: 27 })),
|
|
65
|
-
React.createElement(Box, { className: classes.avatar },
|
|
66
|
-
React.createElement(Skeleton, { className: classes.avatar, animation: "wave", variant: "circular", width: 40, height: 40 }))));
|
|
42
|
+
React.createElement(CardContent, { className: classes.content },
|
|
43
|
+
React.createElement(Box, { className: classes.input },
|
|
44
|
+
React.createElement(Skeleton, { animation: "wave", variant: "text" })),
|
|
45
|
+
React.createElement(Box, { className: classes.avatar },
|
|
46
|
+
React.createElement(Skeleton, { className: classes.avatar, animation: "wave", variant: "circular" })))));
|
|
67
47
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PREFIX = "SCInlineComposerWidget";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const PREFIX = 'SCInlineComposerWidget';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TextFieldProps } from '@mui/material/TextField';
|
|
2
2
|
import { AutocompleteProps } from '@mui/material';
|
|
3
|
-
import {
|
|
4
|
-
export interface LocationAutocompleteProps extends Pick<AutocompleteProps<
|
|
3
|
+
import { SCContributionLocation } from '@selfcommunity/types/src/index';
|
|
4
|
+
export interface LocationAutocompleteProps extends Pick<AutocompleteProps<SCContributionLocation, false, false, true>, Exclude<keyof AutocompleteProps<SCContributionLocation, false, false, true>, 'options' | 'getOptionLabel' | 'filterOptions' | 'autoComplete' | 'includeInputInList' | 'filterSelectedOptions' | 'value' | 'selectOnFocus' | 'handleHomeEndKeys' | 'noOptionsText' | 'onChange' | 'onInputChange' | 'isOptionEqualToValue' | 'renderInput' | 'renderOption'>> {
|
|
5
5
|
/**
|
|
6
6
|
* The props applied to the text field.
|
|
7
7
|
* @default {variant: 'outlined, label: location_label}
|
|
@@ -86,14 +86,16 @@ export default function LocationAutocomplete(inProps) {
|
|
|
86
86
|
}, [value]);
|
|
87
87
|
// Handlers
|
|
88
88
|
const handleChange = (event, value) => {
|
|
89
|
-
setValue(value);
|
|
89
|
+
setValue({ location: value.full_address, lat: value.lat, lon: value.lng });
|
|
90
90
|
onChange && onChange(value);
|
|
91
91
|
};
|
|
92
92
|
const handleSearch = (event, _search) => {
|
|
93
93
|
setSearch(_search);
|
|
94
94
|
};
|
|
95
95
|
// Render
|
|
96
|
-
return (React.createElement(Root, Object.assign({ className: classes.root, options: locations || [],
|
|
96
|
+
return (React.createElement(Root, Object.assign({ className: classes.root, options: locations || [],
|
|
97
|
+
// @ts-ignore
|
|
98
|
+
getOptionLabel: (option) => (option === null || option === void 0 ? void 0 : option.full_address) || (option === null || option === void 0 ? void 0 : option.location) || '', filterOptions: (x) => x, autoComplete: true, includeInputInList: true, filterSelectedOptions: true, value: value, selectOnFocus: true, handleHomeEndKeys: true, disabled: disabled, noOptionsText: React.createElement(FormattedMessage, { id: "ui.locationAutocomplete.empty", defaultMessage: "ui.locationAutocomplete.empty" }), onChange: handleChange, onInputChange: handleSearch, isOptionEqualToValue: (option, value) => value.lat === option.lat && value.lon === option.lng, renderInput: (params) => {
|
|
97
99
|
return (React.createElement(TextField, Object.assign({}, params, TextFieldProps, { margin: "dense", InputProps: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'location', endAdornment: (React.createElement(React.Fragment, null,
|
|
98
100
|
isLoading ? React.createElement(CircularProgress, { color: "inherit", size: 20 }) : null,
|
|
99
101
|
params.InputProps.endAdornment)) }) })));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DrawerProps, IconButtonProps } from '@mui/material';
|
|
3
3
|
export interface NavigationMenuIconButtonProps extends IconButtonProps {
|
|
4
4
|
/**
|
|
5
5
|
* Props to spread to drawer element
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
|
-
import { Box, Divider, Icon, IconButton,
|
|
4
|
+
import { Box, Divider, Drawer, Icon, IconButton, List } from '@mui/material';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { useThemeProps } from '@mui/system';
|
|
7
7
|
import ScrollContainer from '../../shared/ScrollContainer';
|
|
@@ -7,10 +7,6 @@ export interface NavigationToolbarMobileProps extends ToolbarProps {
|
|
|
7
7
|
* Disable search action if possible
|
|
8
8
|
*/
|
|
9
9
|
disableSearch?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Disable composer action if possible
|
|
12
|
-
*/
|
|
13
|
-
disableComposer?: boolean;
|
|
14
10
|
/**
|
|
15
11
|
* Props spread to SearchAutocomplete component
|
|
16
12
|
*/
|
|
@@ -54,7 +50,6 @@ export interface NavigationToolbarMobileProps extends ToolbarProps {
|
|
|
54
50
|
|logo|.SCNavigationToolbarMobile-logo|Styles applied to the logo element.|
|
|
55
51
|
|search|.SCNavigationToolbarMobile-search|Styles applied to the search button element|
|
|
56
52
|
|searchDialog|.SCNavigationToolbarMobile-search-dialog|Styles applied to the search dialog element|
|
|
57
|
-
|composer|.SCNavigationToolbarMobile-composer|Styles applied to the composer component|
|
|
58
53
|
|settings|.SCNavigationToolbarMobile-settings|Styles applied to the settings button element|
|
|
59
54
|
|settingsDialog|.SCNavigationToolbarMobile-settingsDialog|Styles applied to the settings dialog elements|
|
|
60
55
|
|login|.SCNavigationToolbarMobile-login|Styles applied to the login element.|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { Button, IconButton, styled, Toolbar } from '@mui/material';
|
|
3
|
-
import React, {
|
|
4
|
-
import { Link, SCPreferences, SCRoutes, useSCPreferences, useSCRouting, useSCUser } from '@selfcommunity/react-core';
|
|
3
|
+
import React, { useCallback, useState } from 'react';
|
|
4
|
+
import { Link, SCPreferences, SCRoutes, useSCPreferences, useSCRouting, useSCUser, } from '@selfcommunity/react-core';
|
|
5
5
|
import Icon from '@mui/material/Icon';
|
|
6
6
|
import { useThemeProps } from '@mui/system';
|
|
7
7
|
import classNames from 'classnames';
|
|
@@ -9,25 +9,21 @@ import NavigationToolbarMobileSkeleton from './Skeleton';
|
|
|
9
9
|
import { FormattedMessage } from 'react-intl';
|
|
10
10
|
import SearchDialog from '../SearchDialog';
|
|
11
11
|
import NavigationSettingsIconButton from '../NavigationSettingsIconButton';
|
|
12
|
-
import ComposerIconButton from '../ComposerIconButton';
|
|
13
12
|
import NavigationMenuIconButton from '../NavigationMenuIconButton';
|
|
14
|
-
|
|
13
|
+
import { PREFIX } from './constants';
|
|
15
14
|
const classes = {
|
|
16
15
|
root: `${PREFIX}-root`,
|
|
17
16
|
logo: `${PREFIX}-logo`,
|
|
18
17
|
search: `${PREFIX}-search`,
|
|
19
18
|
searchDialog: `${PREFIX}-search-dialog`,
|
|
20
|
-
composer: `${PREFIX}-composer`,
|
|
21
19
|
settings: `${PREFIX}-settings`,
|
|
22
20
|
settingsDialog: `${PREFIX}-settings-dialog`,
|
|
23
21
|
login: `${PREFIX}-login`
|
|
24
22
|
};
|
|
25
23
|
const Root = styled(Toolbar, {
|
|
26
24
|
name: PREFIX,
|
|
27
|
-
slot: 'Root'
|
|
28
|
-
overridesResolver: (props, styles) => styles.root
|
|
25
|
+
slot: 'Root'
|
|
29
26
|
})(() => ({}));
|
|
30
|
-
const PREFERENCES = [SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY, SCPreferences.LOGO_NAVBAR_LOGO_MOBILE];
|
|
31
27
|
/**
|
|
32
28
|
* > API documentation for the Community-JS Navigation Toolbar Mobile component. Learn about the available props and the CSS API.
|
|
33
29
|
*
|
|
@@ -54,7 +50,6 @@ const PREFERENCES = [SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY, SCPrefer
|
|
|
54
50
|
|logo|.SCNavigationToolbarMobile-logo|Styles applied to the logo element.|
|
|
55
51
|
|search|.SCNavigationToolbarMobile-search|Styles applied to the search button element|
|
|
56
52
|
|searchDialog|.SCNavigationToolbarMobile-search-dialog|Styles applied to the search dialog element|
|
|
57
|
-
|composer|.SCNavigationToolbarMobile-composer|Styles applied to the composer component|
|
|
58
53
|
|settings|.SCNavigationToolbarMobile-settings|Styles applied to the settings button element|
|
|
59
54
|
|settingsDialog|.SCNavigationToolbarMobile-settingsDialog|Styles applied to the settings dialog elements|
|
|
60
55
|
|login|.SCNavigationToolbarMobile-login|Styles applied to the login element.|
|
|
@@ -67,26 +62,21 @@ export default function NavigationToolbarMobile(inProps) {
|
|
|
67
62
|
props: inProps,
|
|
68
63
|
name: PREFIX
|
|
69
64
|
});
|
|
70
|
-
const { className = '', disableSearch = false,
|
|
65
|
+
const { className = '', disableSearch = false, SearchAutocompleteProps = {}, children = null, startActions = null, endActions = null, NavigationSettingsIconButtonComponent = NavigationSettingsIconButton } = props, rest = __rest(props, ["className", "disableSearch", "SearchAutocompleteProps", "children", "startActions", "endActions", "NavigationSettingsIconButtonComponent"]);
|
|
71
66
|
// CONTEXT
|
|
72
67
|
const scUserContext = useSCUser();
|
|
73
68
|
const scRoutingContext = useSCRouting();
|
|
74
69
|
// PREFERENCES
|
|
75
|
-
const
|
|
76
|
-
const preferences = useMemo(() => {
|
|
77
|
-
const _preferences = {};
|
|
78
|
-
PREFERENCES.map((p) => (_preferences[p] = p in scPreferences.preferences ? scPreferences.preferences[p].value : null));
|
|
79
|
-
return _preferences;
|
|
80
|
-
}, [scPreferences.preferences]);
|
|
70
|
+
const { preferences } = useSCPreferences();
|
|
81
71
|
// STATE
|
|
82
72
|
const [searchOpen, setSearchOpen] = useState(false);
|
|
83
73
|
// HANDLERS
|
|
84
|
-
const handleOpenSearch = () => {
|
|
74
|
+
const handleOpenSearch = useCallback(() => {
|
|
85
75
|
setSearchOpen(true);
|
|
86
|
-
};
|
|
87
|
-
const handleCloseSearch = () => {
|
|
76
|
+
}, []);
|
|
77
|
+
const handleCloseSearch = useCallback(() => {
|
|
88
78
|
setSearchOpen(false);
|
|
89
|
-
};
|
|
79
|
+
}, []);
|
|
90
80
|
// RENDER
|
|
91
81
|
if (scUserContext.loading) {
|
|
92
82
|
return React.createElement(NavigationToolbarMobileSkeleton, null);
|
|
@@ -94,15 +84,14 @@ export default function NavigationToolbarMobile(inProps) {
|
|
|
94
84
|
const _children = children || (React.createElement(React.Fragment, null,
|
|
95
85
|
React.createElement(NavigationMenuIconButton, null),
|
|
96
86
|
React.createElement(Link, { to: scRoutingContext.url(SCRoutes.HOME_ROUTE_NAME, {}), className: classes.logo },
|
|
97
|
-
React.createElement("img", { src: preferences[SCPreferences.LOGO_NAVBAR_LOGO_MOBILE], alt: "logo" }))));
|
|
87
|
+
React.createElement("img", { src: preferences[SCPreferences.LOGO_NAVBAR_LOGO_MOBILE].value, alt: "logo" }))));
|
|
98
88
|
return (React.createElement(Root, Object.assign({ className: classNames(className, classes.root) }, rest),
|
|
99
89
|
_children,
|
|
100
90
|
startActions,
|
|
101
|
-
(preferences[SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY] || scUserContext.user) && !disableSearch && (React.createElement(React.Fragment, null,
|
|
91
|
+
(preferences[SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY].value || scUserContext.user) && !disableSearch && (React.createElement(React.Fragment, null,
|
|
102
92
|
React.createElement(IconButton, { className: classes.search, onClick: handleOpenSearch },
|
|
103
93
|
React.createElement(Icon, null, "search")),
|
|
104
94
|
React.createElement(SearchDialog, { className: classes.searchDialog, fullScreen: true, open: searchOpen, SearchAutocompleteProps: Object.assign(Object.assign({}, SearchAutocompleteProps), { onClear: handleCloseSearch }) }))),
|
|
105
|
-
scUserContext.user && !disableComposer && React.createElement(ComposerIconButton, { className: classes.composer }),
|
|
106
95
|
endActions,
|
|
107
96
|
scUserContext.user ? (React.createElement(NavigationSettingsIconButtonComponent, { className: classes.settings })) : (React.createElement(Button, { className: classes.login, color: "inherit", component: Link, to: scRoutingContext.url(SCRoutes.SIGNIN_ROUTE_NAME, {}) },
|
|
108
97
|
React.createElement(FormattedMessage, { id: "ui.appBar.navigation.login", defaultMessage: "ui.appBar.navigation.login" })))));
|
|
@@ -2,15 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import { Toolbar } from '@mui/material';
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
import Skeleton from '@mui/material/Skeleton';
|
|
5
|
-
|
|
5
|
+
import { PREFIX } from './constants';
|
|
6
6
|
const classes = {
|
|
7
|
-
root: `${PREFIX}-root`,
|
|
7
|
+
root: `${PREFIX}-skeleton-root`,
|
|
8
8
|
logo: `${PREFIX}-logo`
|
|
9
9
|
};
|
|
10
10
|
const Root = styled(Toolbar, {
|
|
11
11
|
name: PREFIX,
|
|
12
|
-
slot: '
|
|
13
|
-
overridesResolver: (props, styles) => styles.root
|
|
12
|
+
slot: 'SkeletonRoot'
|
|
14
13
|
})(() => ({}));
|
|
15
14
|
/**
|
|
16
15
|
* > API documentation for the Community-JS Navigation Toolbar Mobile Skeleton component. Learn about the available props and the CSS API.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PREFIX = "SCNavigationToolbarMobile";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const PREFIX = 'SCNavigationToolbarMobile';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export declare const COMPOSER_TYPE_DISCUSSION = "discussion";
|
|
2
2
|
export declare const COMPOSER_TYPE_POST = "post";
|
|
3
|
+
export declare const COMPOSER_TYPE_POLL = "poll";
|
|
3
4
|
export declare const COMPOSER_TYPES: {
|
|
4
5
|
discussion: string;
|
|
5
6
|
post: string;
|
|
7
|
+
poll: string;
|
|
6
8
|
};
|
|
7
9
|
export declare const COMPOSER_TITLE_MAX_LENGTH = 160;
|
|
8
10
|
export declare const COMPOSER_POLL_TITLE_MAX_LENGTH = 160;
|