@griddo/ax 1.56.10 → 1.57.3
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/config/griddo-config.js +1 -0
- package/package.json +2 -2
- package/src/components/ActionMenu/index.tsx +1 -1
- package/src/components/Fields/ComponentArray/MixableComponentArray/index.tsx +7 -1
- package/src/components/Fields/ComponentArray/MixableComponentArray/style.tsx +29 -24
- package/src/components/Fields/ComponentArray/SameComponentArray/index.tsx +7 -1
- package/src/components/Fields/ComponentArray/SameComponentArray/style.tsx +29 -24
- package/src/components/Fields/DateField/index.tsx +3 -2
- package/src/components/Fields/ReferenceField/AutoPanel/AutoItem/index.tsx +1 -1
- package/src/components/Fields/ReferenceField/AutoPanel/index.tsx +1 -1
- package/src/components/Fields/ReferenceField/ItemList/Item/index.tsx +1 -1
- package/src/components/Fields/UrlField/index.tsx +12 -1
- package/src/components/Fields/Wysiwyg/config.tsx +80 -56
- package/src/components/Fields/Wysiwyg/index.tsx +23 -6
- package/src/components/FloatingMenu/index.tsx +9 -6
- package/src/components/FloatingMenu/style.tsx +8 -6
- package/src/components/Gallery/GalleryFilters/Orientation/index.tsx +1 -1
- package/src/components/Gallery/GalleryFilters/SortBy/index.tsx +1 -1
- package/src/components/InformativeMenu/index.tsx +3 -2
- package/src/components/InformativeMenu/style.tsx +0 -1
- package/src/components/MainWrapper/AppBar/index.tsx +8 -7
- package/src/components/MainWrapper/AppBar/style.tsx +7 -0
- package/src/components/MenuItem/style.tsx +1 -0
- package/src/components/Modal/style.tsx +14 -13
- package/src/components/Nav/index.tsx +8 -3
- package/src/components/Nav/style.tsx +5 -0
- package/src/components/SearchField/index.tsx +43 -14
- package/src/components/SearchField/style.tsx +23 -10
- package/src/components/SideModal/index.tsx +24 -8
- package/src/components/SideModal/style.tsx +13 -2
- package/src/components/SubNav/style.tsx +3 -2
- package/src/containers/Navigation/Defaults/actions.tsx +26 -24
- package/src/containers/Navigation/Defaults/reducer.tsx +2 -2
- package/src/containers/PageEditor/actions.tsx +9 -8
- package/src/containers/Settings/Social/actions.tsx +9 -31
- package/src/containers/Settings/Social/constants.tsx +2 -3
- package/src/containers/Settings/Social/interfaces.tsx +2 -7
- package/src/containers/Settings/Social/reducer.tsx +3 -14
- package/src/containers/Sites/actions.tsx +3 -63
- package/src/containers/Sites/constants.tsx +0 -1
- package/src/containers/Sites/interfaces.tsx +0 -6
- package/src/containers/Sites/reducer.tsx +1 -29
- package/src/forms/editor.tsx +2 -0
- package/src/forms/validators.tsx +2 -0
- package/src/helpers/dates.tsx +23 -24
- package/src/helpers/index.tsx +2 -0
- package/src/helpers/objects.tsx +17 -2
- package/src/helpers/schemas.tsx +7 -4
- package/src/hooks/forms.tsx +23 -24
- package/src/modules/App/Routing/NavMenu/NavItem/index.tsx +10 -5
- package/src/modules/App/Routing/NavMenu/NavItem/style.tsx +13 -9
- package/src/modules/App/Routing/NavMenu/index.tsx +39 -37
- package/src/modules/App/Routing/NavMenu/style.tsx +9 -3
- package/src/modules/Categories/CategoriesList/CategoryItem/index.tsx +1 -1
- package/src/modules/Categories/CategoriesList/CategoryNav/NavItem/index.tsx +6 -3
- package/src/modules/Categories/CategoriesList/CategoryNav/NavItem/style.tsx +5 -1
- package/src/modules/Content/ContentFilters/index.tsx +6 -3
- package/src/modules/Content/ContentFilters/style.tsx +6 -1
- package/src/modules/Content/HeaderMenus/Live/index.tsx +1 -1
- package/src/modules/Content/HeaderMenus/Name/index.tsx +10 -4
- package/src/modules/Content/HeaderMenus/Status/index.tsx +7 -3
- package/src/modules/Content/HeaderMenus/Translations/index.tsx +1 -1
- package/src/modules/Content/HeaderMenus/Types/index.tsx +1 -1
- package/src/modules/Content/OptionTable/index.tsx +6 -3
- package/src/modules/Content/OptionTable/style.tsx +4 -0
- package/src/modules/Content/PageItem/index.tsx +3 -3
- package/src/modules/Content/index.tsx +5 -3
- package/src/modules/GlobalEditor/index.tsx +37 -14
- package/src/modules/Navigation/Defaults/DefaultsEditor/index.tsx +33 -13
- package/src/modules/Navigation/Defaults/Item/atoms.tsx +1 -1
- package/src/modules/Navigation/Defaults/Nav/index.tsx +8 -3
- package/src/modules/Navigation/Defaults/Nav/style.tsx +4 -0
- package/src/modules/Navigation/Defaults/index.tsx +4 -0
- package/src/modules/Navigation/Menus/List/Nav/index.tsx +8 -3
- package/src/modules/Navigation/Menus/List/Nav/style.tsx +4 -0
- package/src/modules/Navigation/Menus/List/index.tsx +3 -1
- package/src/modules/Navigation/Menus/List/style.tsx +9 -1
- package/src/modules/PageEditor/index.tsx +38 -14
- package/src/modules/Settings/ContentTypes/DataPacks/AddModal/Filter/index.tsx +1 -1
- package/src/modules/Settings/ContentTypes/DataPacks/AddModal/SortFilter/index.tsx +1 -1
- package/src/modules/Settings/ContentTypes/DataPacks/Nav/index.tsx +11 -6
- package/src/modules/Settings/ContentTypes/DataPacks/Nav/style.tsx +6 -1
- package/src/modules/Settings/Globals/index.tsx +19 -31
- package/src/modules/Settings/Languages/LanguagePanel/Form/index.tsx +1 -1
- package/src/modules/Settings/Languages/Table/Item/index.tsx +1 -1
- package/src/modules/Settings/Social/index.tsx +35 -91
- package/src/modules/Sites/SitesList/SiteModal/index.tsx +12 -27
- package/src/modules/Sites/SitesList/index.tsx +15 -15
- package/src/modules/StructuredData/StructuredDataList/ContentFilters/index.tsx +3 -1
- package/src/modules/StructuredData/StructuredDataList/ContentFilters/style.tsx +6 -1
- package/src/modules/StructuredData/StructuredDataList/GlobalPageItem/index.tsx +3 -3
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Live/index.tsx +1 -1
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Name/index.tsx +10 -4
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Site/index.tsx +1 -1
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Status/index.tsx +7 -3
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Translations/index.tsx +1 -1
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Types/index.tsx +1 -1
- package/src/modules/StructuredData/StructuredDataList/OptionTable/index.tsx +6 -3
- package/src/modules/StructuredData/StructuredDataList/OptionTable/style.tsx +4 -0
- package/src/modules/StructuredData/StructuredDataList/StructuredDataItem/index.tsx +1 -1
- package/src/modules/Users/UserList/HeaderMenus/Name/index.tsx +13 -5
- package/src/schemas/index.tsx +7 -0
- package/src/schemas/pages/GlobalPage.tsx +166 -0
- package/src/schemas/pages/Page.tsx +181 -0
- package/src/schemas/pages/index.tsx +4 -0
- package/src/types/index.tsx +8 -14
- package/tsconfig.paths.json +2 -1
- package/public/img/schemas/Accordion/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/Accordion/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/AddressCollection/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/AddressCollection/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/BasicBoxedCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/BasicBoxedCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/BasicCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/BasicCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout001@1x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout001@2x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout002@1x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout002@2x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout003@1x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout003@2x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout004@1x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout004@2x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout005@1x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout005@2x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout006@1x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout006@2x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout007@1x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout007@2x.png +0 -0
- package/public/img/schemas/BasicContent/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/BasicContent/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/BasicIconCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/BasicIconCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout001@1x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout001@2x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout002@1x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout002@2x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout003@1x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout003@2x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout004@1x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout004@2x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout005@1x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout005@2x.png +0 -0
- package/public/img/schemas/CardCollection/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/CardCollection/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/DownloadCollection/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/DownloadCollection/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/EventCard/layouts/layout001@1x.png +0 -0
- package/public/img/schemas/EventCard/layouts/layout001@2x.png +0 -0
- package/public/img/schemas/EventCard/layouts/layout002@1x.png +0 -0
- package/public/img/schemas/EventCard/layouts/layout002@2x.png +0 -0
- package/public/img/schemas/EventCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/EventCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/EventsDistributor/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/EventsDistributor/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout001@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout001@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout002@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout002@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout003@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout003@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout004@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout004@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout005@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout005@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout006@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout006@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout007@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout007@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout008@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout008@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout009@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout009@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout010@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout010@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout011@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout011@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout012@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout012@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/FeaturedBlock/layouts/layout001@1x.png +0 -0
- package/public/img/schemas/FeaturedBlock/layouts/layout001@2x.png +0 -0
- package/public/img/schemas/FeaturedBlock/layouts/layout002@1x.png +0 -0
- package/public/img/schemas/FeaturedBlock/layouts/layout002@2x.png +0 -0
- package/public/img/schemas/FeaturedProgram/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/FeaturedProgram/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/FeaturedText/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/FeaturedText/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/FeedbackForm/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/FeedbackForm/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/HeroCarousel/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/HeroCarousel/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/HeroImage/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/HeroImage/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/IconCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/IconCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/IconCenteredCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/IconCenteredCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/Image/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/Image/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/ImageCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/ImageCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/Intro/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/Intro/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/LogoCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/LogoCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/NewsDistributor/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/NewsDistributor/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/PersonDistributor/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/PersonDistributor/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/PublicationDistributor/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/PublicationDistributor/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/SchoolFooter/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/SchoolFooter/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/Slider/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/Slider/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/Testimonial/layouts/layout001@1x.png +0 -0
- package/public/img/schemas/Testimonial/layouts/layout001@2x.png +0 -0
- package/public/img/schemas/Testimonial/layouts/layout002@1x.png +0 -0
- package/public/img/schemas/Testimonial/layouts/layout002@2x.png +0 -0
- package/public/img/schemas/Testimonial/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/Testimonial/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/TextBluePanel/layouts/layout001@1x.png +0 -0
- package/public/img/schemas/TextBluePanel/layouts/layout001@2x.png +0 -0
- package/public/img/schemas/TextBluePanel/layouts/layout002@1x.png +0 -0
- package/public/img/schemas/TextBluePanel/layouts/layout002@2x.png +0 -0
- package/public/img/schemas/TextBluePanel/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/TextBluePanel/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/Video/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/Video/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/imgHeros.png +0 -0
- package/public/img/schemas/imgStandard.jpg +0 -0
- package/public/img/schemas/templates/BasicTemplate/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/templates/BasicTemplate/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/templates/Error404/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/templates/Error404/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/templates/NewsList/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/templates/NewsList/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/themes/LinkStyle.png +0 -0
- package/public/img/schemas/themes/LinkStyle@2x.png +0 -0
- package/public/img/schemas/themes/PrimaryStyle.png +0 -0
- package/public/img/schemas/themes/PrimaryStyle@2x.png +0 -0
- package/public/img/schemas/themes/STYLE01.png +0 -0
- package/public/img/schemas/themes/STYLE02.png +0 -0
- package/public/img/schemas/themes/STYLE03.png +0 -0
- package/public/img/schemas/themes/STYLE04.png +0 -0
- package/public/img/schemas/themes/STYLE05.png +0 -0
- package/public/img/schemas/themes/STYLE06.png +0 -0
- package/public/img/schemas/themes/SecondaryStyle.png +0 -0
- package/public/img/schemas/themes/SecondaryStyle@2x.png +0 -0
- package/src/components/MainWrapper/AppBar/SearchField/index.tsx +0 -54
- package/src/components/MainWrapper/AppBar/SearchField/style.tsx +0 -55
package/config/griddo-config.js
CHANGED
|
@@ -50,6 +50,7 @@ const griddoAxAliases = {
|
|
|
50
50
|
"@ax/modules": path.resolve(__dirname, "../src/modules"),
|
|
51
51
|
"@ax/routes": path.resolve(__dirname, "../src/routes"),
|
|
52
52
|
"@ax/types": path.resolve(__dirname, "../src/types"),
|
|
53
|
+
"@ax/schemas": path.resolve(__dirname, "../src/schemas"),
|
|
53
54
|
...getComponentsLibAliases(),
|
|
54
55
|
};
|
|
55
56
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.57.3",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -233,5 +233,5 @@
|
|
|
233
233
|
"publishConfig": {
|
|
234
234
|
"access": "public"
|
|
235
235
|
},
|
|
236
|
-
"gitHead": "
|
|
236
|
+
"gitHead": "419582349c3dc66afdbfce7af4ad78a9138eda4f"
|
|
237
237
|
}
|
|
@@ -33,7 +33,7 @@ const ActionMenu = (props: IProps): JSX.Element => {
|
|
|
33
33
|
return (
|
|
34
34
|
<S.Wrapper className={className}>
|
|
35
35
|
<Tooltip content={tooltip} hideOnClick>
|
|
36
|
-
<FloatingMenu Button={MoreInfoButton}
|
|
36
|
+
<FloatingMenu Button={MoreInfoButton}>
|
|
37
37
|
<S.ActionMenu>{options.map((item: IOption) => ActionMenuItem(item))}</S.ActionMenu>
|
|
38
38
|
</FloatingMenu>
|
|
39
39
|
</Tooltip>
|
|
@@ -23,6 +23,7 @@ const MixableComponentArray = (props: IMixableComponentArrayProps): JSX.Element
|
|
|
23
23
|
activatedModules,
|
|
24
24
|
objKey,
|
|
25
25
|
field,
|
|
26
|
+
mandatory,
|
|
26
27
|
} = props;
|
|
27
28
|
|
|
28
29
|
const type = getTypefromKey(objKey);
|
|
@@ -54,9 +55,13 @@ const MixableComponentArray = (props: IMixableComponentArrayProps): JSX.Element
|
|
|
54
55
|
|
|
55
56
|
const showAddItemButton = !maxItems || fixedValue.length < maxItems;
|
|
56
57
|
|
|
58
|
+
const Asterisk = () => (mandatory ? <S.Asterisk>*</S.Asterisk> : null);
|
|
59
|
+
|
|
57
60
|
return (
|
|
58
61
|
<S.Wrapper>
|
|
59
|
-
<S.Title>
|
|
62
|
+
<S.Title>
|
|
63
|
+
{title} <Asterisk />
|
|
64
|
+
</S.Title>
|
|
60
65
|
<S.ItemRow>
|
|
61
66
|
<S.Subtitle>{fixedValue && fixedValue.length} items</S.Subtitle>
|
|
62
67
|
{showAddItemButton && !disabled && (
|
|
@@ -115,6 +120,7 @@ export interface IMixableComponentArrayProps {
|
|
|
115
120
|
activatedModules: string[];
|
|
116
121
|
objKey: string;
|
|
117
122
|
field: any;
|
|
123
|
+
mandatory?: boolean;
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
export default MixableComponentArray;
|
|
@@ -1,50 +1,55 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
`;
|
|
3
|
+
const Wrapper = styled.div``;
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
${p => p.theme.textStyle.headingXXS};
|
|
8
|
-
color: ${p => p.theme.color.textMediumEmphasis};
|
|
9
|
-
padding-bottom: ${p => p.theme.spacing.xs};
|
|
10
|
-
border-bottom: 1px solid ${p => p.theme.color.uiLine};
|
|
5
|
+
const Title = styled.p`
|
|
6
|
+
${(p) => p.theme.textStyle.headingXXS};
|
|
7
|
+
color: ${(p) => p.theme.color.textMediumEmphasis};
|
|
8
|
+
padding-bottom: ${(p) => p.theme.spacing.xs};
|
|
9
|
+
border-bottom: 1px solid ${(p) => p.theme.color.uiLine};
|
|
11
10
|
`;
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
${p => p.theme.textStyle.fieldLabel};
|
|
15
|
-
color: ${p => p.theme.color.textHighEmphasis};
|
|
12
|
+
const Component = styled.button`
|
|
13
|
+
${(p) => p.theme.textStyle.fieldLabel};
|
|
14
|
+
color: ${(p) => p.theme.color.textHighEmphasis};
|
|
16
15
|
display: block;
|
|
17
|
-
height: ${p => p.theme.spacing.l};
|
|
18
|
-
background: ${p => p.theme.color.uiBackground02};
|
|
16
|
+
height: ${(p) => p.theme.spacing.l};
|
|
17
|
+
background: ${(p) => p.theme.color.uiBackground02};
|
|
19
18
|
border: 1px solid transparent;
|
|
20
19
|
width: 100%;
|
|
21
20
|
text-align: left;
|
|
22
21
|
cursor: pointer;
|
|
23
|
-
margin-bottom: ${p => p.theme.spacing.xs};
|
|
24
|
-
padding: 0 ${p => p.theme.spacing.s};
|
|
25
|
-
border-radius: ${p => p.theme.radii.s};
|
|
26
|
-
box-shadow: ${p => p.theme.shadow.field};
|
|
22
|
+
margin-bottom: ${(p) => p.theme.spacing.xs};
|
|
23
|
+
padding: 0 ${(p) => p.theme.spacing.s};
|
|
24
|
+
border-radius: ${(p) => p.theme.radii.s};
|
|
25
|
+
box-shadow: ${(p) => p.theme.shadow.field};
|
|
27
26
|
|
|
28
27
|
&:hover {
|
|
29
|
-
background: ${p => p.theme.color.overlayHoverPrimary};
|
|
28
|
+
background: ${(p) => p.theme.color.overlayHoverPrimary};
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
&:focus,
|
|
33
32
|
&:active {
|
|
34
|
-
background: ${p => p.theme.color.overlayFocusPrimary};
|
|
35
|
-
border: 1px solid ${p => p.theme.color.interactive01};
|
|
33
|
+
background: ${(p) => p.theme.color.overlayFocusPrimary};
|
|
34
|
+
border: 1px solid ${(p) => p.theme.color.interactive01};
|
|
36
35
|
outline: none;
|
|
37
36
|
}
|
|
38
37
|
`;
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
const ItemRow = styled.div`
|
|
41
40
|
display: flex;
|
|
42
41
|
justify-content: space-between;
|
|
43
42
|
align-items: center;
|
|
44
|
-
margin-bottom: ${p => p.theme.spacing.xs};
|
|
43
|
+
margin-bottom: ${(p) => p.theme.spacing.xs};
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
const Subtitle = styled.span`
|
|
47
|
+
${(p) => p.theme.textStyle.uiXS};
|
|
48
|
+
color: ${(p) => p.theme.color.textLowEmphasis};
|
|
45
49
|
`;
|
|
46
50
|
|
|
47
|
-
|
|
48
|
-
${p => p.theme.
|
|
49
|
-
color: ${p => p.theme.color.textLowEmphasis};
|
|
51
|
+
const Asterisk = styled.span`
|
|
52
|
+
color: ${(p) => p.theme.color.error};
|
|
50
53
|
`;
|
|
54
|
+
|
|
55
|
+
export { Wrapper, Title, Component, ItemRow, Subtitle, Asterisk };
|
|
@@ -23,6 +23,7 @@ const SameComponentArray = (props: ISameComponentArrayProps): JSX.Element => {
|
|
|
23
23
|
activatedModules,
|
|
24
24
|
objKey,
|
|
25
25
|
field,
|
|
26
|
+
mandatory,
|
|
26
27
|
} = props;
|
|
27
28
|
|
|
28
29
|
const type = getTypefromKey(objKey);
|
|
@@ -53,9 +54,13 @@ const SameComponentArray = (props: ISameComponentArrayProps): JSX.Element => {
|
|
|
53
54
|
|
|
54
55
|
const showAddItemButton = !maxItems || value.length < maxItems;
|
|
55
56
|
|
|
57
|
+
const Asterisk = () => (mandatory ? <S.Asterisk>*</S.Asterisk> : null);
|
|
58
|
+
|
|
56
59
|
return (
|
|
57
60
|
<S.Wrapper>
|
|
58
|
-
<S.Title>
|
|
61
|
+
<S.Title>
|
|
62
|
+
{title} <Asterisk />
|
|
63
|
+
</S.Title>
|
|
59
64
|
<S.ItemRow>
|
|
60
65
|
<S.Subtitle>{value && value.length} items</S.Subtitle>
|
|
61
66
|
{showAddItemButton && !disabled && (
|
|
@@ -110,6 +115,7 @@ export interface ISameComponentArrayProps {
|
|
|
110
115
|
activatedModules: string[];
|
|
111
116
|
objKey: string;
|
|
112
117
|
field: any;
|
|
118
|
+
mandatory?: boolean;
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
export default SameComponentArray;
|
|
@@ -1,50 +1,55 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
`;
|
|
3
|
+
const Wrapper = styled.div``;
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
${p => p.theme.textStyle.headingXXS};
|
|
8
|
-
color: ${p => p.theme.color.textMediumEmphasis};
|
|
9
|
-
padding-bottom: ${p => p.theme.spacing.xs};
|
|
10
|
-
border-bottom: 1px solid ${p => p.theme.color.uiLine};
|
|
5
|
+
const Title = styled.p`
|
|
6
|
+
${(p) => p.theme.textStyle.headingXXS};
|
|
7
|
+
color: ${(p) => p.theme.color.textMediumEmphasis};
|
|
8
|
+
padding-bottom: ${(p) => p.theme.spacing.xs};
|
|
9
|
+
border-bottom: 1px solid ${(p) => p.theme.color.uiLine};
|
|
11
10
|
`;
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
${p => p.theme.textStyle.fieldLabel};
|
|
15
|
-
color: ${p => p.theme.color.textHighEmphasis};
|
|
12
|
+
const Component = styled.button`
|
|
13
|
+
${(p) => p.theme.textStyle.fieldLabel};
|
|
14
|
+
color: ${(p) => p.theme.color.textHighEmphasis};
|
|
16
15
|
display: block;
|
|
17
|
-
height: ${p => p.theme.spacing.l};
|
|
18
|
-
background: ${p => p.theme.color.uiBackground02};
|
|
16
|
+
height: ${(p) => p.theme.spacing.l};
|
|
17
|
+
background: ${(p) => p.theme.color.uiBackground02};
|
|
19
18
|
border: 1px solid transparent;
|
|
20
19
|
width: 100%;
|
|
21
20
|
text-align: left;
|
|
22
21
|
cursor: pointer;
|
|
23
|
-
margin-bottom: ${p => p.theme.spacing.xs};
|
|
24
|
-
padding: 0 ${p => p.theme.spacing.s};
|
|
25
|
-
border-radius: ${p => p.theme.radii.s};
|
|
26
|
-
box-shadow: ${p => p.theme.shadow.field};
|
|
22
|
+
margin-bottom: ${(p) => p.theme.spacing.xs};
|
|
23
|
+
padding: 0 ${(p) => p.theme.spacing.s};
|
|
24
|
+
border-radius: ${(p) => p.theme.radii.s};
|
|
25
|
+
box-shadow: ${(p) => p.theme.shadow.field};
|
|
27
26
|
|
|
28
27
|
&:hover {
|
|
29
|
-
background: ${p => p.theme.color.overlayHoverPrimary};
|
|
28
|
+
background: ${(p) => p.theme.color.overlayHoverPrimary};
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
&:focus,
|
|
33
32
|
&:active {
|
|
34
|
-
background: ${p => p.theme.color.overlayFocusPrimary};
|
|
35
|
-
border: 1px solid ${p => p.theme.color.interactive01};
|
|
33
|
+
background: ${(p) => p.theme.color.overlayFocusPrimary};
|
|
34
|
+
border: 1px solid ${(p) => p.theme.color.interactive01};
|
|
36
35
|
outline: none;
|
|
37
36
|
}
|
|
38
37
|
`;
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
const ItemRow = styled.div`
|
|
41
40
|
display: flex;
|
|
42
41
|
justify-content: space-between;
|
|
43
42
|
align-items: center;
|
|
44
|
-
margin-bottom: ${p => p.theme.spacing.xs};
|
|
43
|
+
margin-bottom: ${(p) => p.theme.spacing.xs};
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
const Subtitle = styled.span`
|
|
47
|
+
${(p) => p.theme.textStyle.uiXS};
|
|
48
|
+
color: ${(p) => p.theme.color.textLowEmphasis};
|
|
45
49
|
`;
|
|
46
50
|
|
|
47
|
-
|
|
48
|
-
${p => p.theme.
|
|
49
|
-
color: ${p => p.theme.color.textLowEmphasis};
|
|
51
|
+
const Asterisk = styled.span`
|
|
52
|
+
color: ${(p) => p.theme.color.error};
|
|
50
53
|
`;
|
|
54
|
+
|
|
55
|
+
export { Wrapper, Title, Component, ItemRow, Subtitle, Asterisk };
|
|
@@ -32,8 +32,9 @@ const DateField = (props: IDateFieldProps): JSX.Element => {
|
|
|
32
32
|
|
|
33
33
|
const currentDate = new Date();
|
|
34
34
|
const defaultValue = mandatory ? dateToString(currentDate) : null;
|
|
35
|
+
const stringDate = value && typeof value === "number" ? dateToString(new Date(value * 1000)) : value;
|
|
35
36
|
|
|
36
|
-
const dateValue =
|
|
37
|
+
const dateValue = stringDate && (isValidDate(stringDate) || isValidDateRange(stringDate)) ? stringDate : defaultValue;
|
|
37
38
|
|
|
38
39
|
const isRange = dateValue && dateValue.split(" - ").length > 1;
|
|
39
40
|
const { isOpen, toggleModal } = useModal();
|
|
@@ -46,7 +47,7 @@ const DateField = (props: IDateFieldProps): JSX.Element => {
|
|
|
46
47
|
end: dateValue ? stringToDate(dateValue) : null,
|
|
47
48
|
};
|
|
48
49
|
|
|
49
|
-
const dateFormat = "
|
|
50
|
+
const dateFormat = "dd/MM/yyyy";
|
|
50
51
|
|
|
51
52
|
const minDate = futureDate ? initialDate.start : null;
|
|
52
53
|
const maxDate = pastDate ? initialDate.start : null;
|
|
@@ -52,7 +52,7 @@ const AutoItem = (props: IProps) => {
|
|
|
52
52
|
const ActionMenu = (props: any) => {
|
|
53
53
|
const { source } = props;
|
|
54
54
|
return (
|
|
55
|
-
<FloatingMenu Button={MoreInfoButton}
|
|
55
|
+
<FloatingMenu Button={MoreInfoButton}>
|
|
56
56
|
<S.ActionMenu>{editMenu.options.map((item: any, i: number) => actionMenuItem(item, source))}</S.ActionMenu>
|
|
57
57
|
</FloatingMenu>
|
|
58
58
|
);
|
|
@@ -134,7 +134,7 @@ const AutoPanel = (props: IProps): JSX.Element => {
|
|
|
134
134
|
|
|
135
135
|
const addSource =
|
|
136
136
|
state.sourceTitles.length > 1 ? (
|
|
137
|
-
<FloatingMenu Button={addSourceButton}
|
|
137
|
+
<FloatingMenu Button={addSourceButton}>
|
|
138
138
|
{sourceMenu(state.sourceTitles)}
|
|
139
139
|
</FloatingMenu>
|
|
140
140
|
) : null;
|
|
@@ -47,7 +47,7 @@ const Item = (props: IProps) => {
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
const ActionMenu = () => (
|
|
50
|
-
<FloatingMenu Button={MoreInfoButton}
|
|
50
|
+
<FloatingMenu Button={MoreInfoButton}>
|
|
51
51
|
<S.ActionMenu>{editMenu.options.map((item: any, i: number) => actionMenuItem(item))}</S.ActionMenu>
|
|
52
52
|
</FloatingMenu>
|
|
53
53
|
);
|
|
@@ -25,6 +25,7 @@ const UrlField = (props: IUrlFieldProps): JSX.Element => {
|
|
|
25
25
|
if (isReqOk(response.status)) {
|
|
26
26
|
const { data } = response;
|
|
27
27
|
setInternalPageName(data.title);
|
|
28
|
+
if (!value?.title) handleTitleChange(data.title);
|
|
28
29
|
|
|
29
30
|
const anchors: ISelectOption[] = findAnchorsFromPage(data);
|
|
30
31
|
setAnchorOptions(anchors);
|
|
@@ -58,13 +59,15 @@ const UrlField = (props: IUrlFieldProps): JSX.Element => {
|
|
|
58
59
|
|
|
59
60
|
const handleSetPage = (page: IPage) => {
|
|
60
61
|
toggleModal();
|
|
61
|
-
onChange({ ...value, href: null, linkTo: page.id });
|
|
62
|
+
onChange({ ...value, href: null, linkTo: page.id, linkToURL: page.fullUrl });
|
|
62
63
|
handleValidation && handleValidation(page.id.toString(), validators);
|
|
63
64
|
handlePanel && handlePanel(isOpen);
|
|
64
65
|
};
|
|
65
66
|
|
|
66
67
|
const handleChange = (newValue: string) => onChange({ ...value, href: newValue });
|
|
67
68
|
|
|
69
|
+
const handleTitleChange = (newValue: string) => onChange({ ...value, title: newValue });
|
|
70
|
+
|
|
68
71
|
const handleNewTabChange = (newValue: boolean) => onChange({ ...value, newTab: newValue });
|
|
69
72
|
|
|
70
73
|
const handleNoFollowChange = (newValue: boolean) => onChange({ ...value, noFollow: newValue });
|
|
@@ -98,6 +101,13 @@ const UrlField = (props: IUrlFieldProps): JSX.Element => {
|
|
|
98
101
|
}
|
|
99
102
|
|
|
100
103
|
const advancedFields = [
|
|
104
|
+
{
|
|
105
|
+
type: "TextField" as Field,
|
|
106
|
+
name: "title",
|
|
107
|
+
title: "Title",
|
|
108
|
+
value: value ? value.title : "",
|
|
109
|
+
onChange: handleTitleChange,
|
|
110
|
+
},
|
|
101
111
|
{
|
|
102
112
|
type: "UniqueCheck" as Field,
|
|
103
113
|
name: "newTab",
|
|
@@ -139,6 +149,7 @@ const UrlField = (props: IUrlFieldProps): JSX.Element => {
|
|
|
139
149
|
key={adField.name}
|
|
140
150
|
options={adField.options}
|
|
141
151
|
name={adField.name}
|
|
152
|
+
title={adField.title}
|
|
142
153
|
fieldType={adField.type}
|
|
143
154
|
value={adField.value}
|
|
144
155
|
onChange={adField.onChange}
|
|
@@ -1,60 +1,84 @@
|
|
|
1
1
|
const buttonsFull = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
moreText: {
|
|
3
|
+
buttons: ["bold", "italic", "paragraphFormat", "formatUL", "quote", "alignCenter"],
|
|
4
|
+
buttonsVisible: 6,
|
|
5
|
+
},
|
|
6
|
+
moreText2: {
|
|
7
|
+
buttons: ["insertLink", "insertImage", "insertVideo", "clearFormatting", "fullscreen"],
|
|
8
|
+
buttonsVisible: 5,
|
|
9
|
+
},
|
|
10
|
+
moreMisc: {
|
|
11
|
+
buttons: [
|
|
12
|
+
"underline",
|
|
13
|
+
"textColor",
|
|
14
|
+
"formatOLSimple",
|
|
15
|
+
"specialCharacters",
|
|
16
|
+
"insertHR",
|
|
17
|
+
"alignLeft",
|
|
18
|
+
"alignRight",
|
|
19
|
+
"alignJustify",
|
|
20
|
+
"outdent",
|
|
21
|
+
"indent",
|
|
22
|
+
"undo",
|
|
23
|
+
"redo",
|
|
24
|
+
"selectAll",
|
|
25
|
+
"html",
|
|
26
|
+
],
|
|
27
|
+
align: "right",
|
|
28
|
+
buttonsVisible: 0,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
const buttons = [
|
|
33
|
+
[
|
|
34
|
+
"bold",
|
|
35
|
+
"italic",
|
|
36
|
+
"paragraphFormat",
|
|
37
|
+
"formatUL",
|
|
38
|
+
"quote",
|
|
39
|
+
"alignLeft",
|
|
40
|
+
"alignCenter",
|
|
41
|
+
"insertLink",
|
|
42
|
+
"|",
|
|
43
|
+
"fullscreen",
|
|
44
|
+
],
|
|
45
|
+
];
|
|
33
46
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
const wysiwygConfig = {
|
|
48
|
+
key: process.env.REACT_APP_FROALA_KEY,
|
|
49
|
+
// pastePlain: false,
|
|
50
|
+
pasteDeniedAttrs: ["class", "id", "style", "dir"],
|
|
51
|
+
listAdvancedTypes: false,
|
|
52
|
+
attribution: false,
|
|
53
|
+
paragraphFormat: {
|
|
54
|
+
N: "Normal",
|
|
55
|
+
H1: "Heading 1",
|
|
56
|
+
H2: "Heading 2",
|
|
57
|
+
H3: "Heading 3",
|
|
58
|
+
H4: "Heading 4",
|
|
59
|
+
},
|
|
60
|
+
imageEditButtons: [
|
|
61
|
+
"imageReplace",
|
|
62
|
+
"imageAlign",
|
|
63
|
+
"imageCaption",
|
|
64
|
+
"imageRemove",
|
|
65
|
+
"|",
|
|
66
|
+
"imageLink",
|
|
67
|
+
"linkOpen",
|
|
68
|
+
"linkEdit",
|
|
69
|
+
"linkRemove",
|
|
70
|
+
"-",
|
|
71
|
+
"imageDisplay",
|
|
72
|
+
"imageAlt",
|
|
73
|
+
],
|
|
74
|
+
imageResize: false,
|
|
75
|
+
linkEditButtons: ["linkOpen", "linkEdit", "linkRemove"],
|
|
76
|
+
videoInsertButtons: ["videoBack", "|", "videoByURL", "videoEmbed"],
|
|
77
|
+
imageUpload: true,
|
|
78
|
+
imageAllowedTypes: ["jpeg", "jpg", "png", "svg"],
|
|
79
|
+
imageMaxSize: 20 * 1024 * 1024,
|
|
80
|
+
imageManagerLoadURL: `${process.env.REACT_APP_API_ENDPOINT}/images/wysiwyg`,
|
|
81
|
+
requestWithCORS: false,
|
|
82
|
+
};
|
|
59
83
|
|
|
60
|
-
|
|
84
|
+
export { buttonsFull, buttons, wysiwygConfig };
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { connect } from "react-redux";
|
|
3
3
|
import FroalaEditor from "react-froala-wysiwyg";
|
|
4
4
|
import { decodeEntities } from "@ax/helpers";
|
|
5
|
-
import { IImage, ISite } from "@ax/types";
|
|
5
|
+
import { IImage, ISite, IRootState } from "@ax/types";
|
|
6
6
|
import { galleryActions } from "@ax/containers/Gallery";
|
|
7
7
|
|
|
8
8
|
import { wysiwygConfig, buttons, buttonsFull } from "./config";
|
|
@@ -10,9 +10,20 @@ import "./vendors";
|
|
|
10
10
|
import * as S from "./style";
|
|
11
11
|
|
|
12
12
|
const Wysiwyg = (props: IProps): JSX.Element => {
|
|
13
|
-
const {
|
|
13
|
+
const {
|
|
14
|
+
value,
|
|
15
|
+
error,
|
|
16
|
+
onChange,
|
|
17
|
+
placeholder,
|
|
18
|
+
full = true,
|
|
19
|
+
disabled,
|
|
20
|
+
handleValidation,
|
|
21
|
+
site,
|
|
22
|
+
token,
|
|
23
|
+
uploadImage,
|
|
24
|
+
} = props;
|
|
14
25
|
|
|
15
|
-
const imageSite = site ? site.id : "global"
|
|
26
|
+
const imageSite = site ? site.id : "global";
|
|
16
27
|
|
|
17
28
|
const handleChange = (model: string) => {
|
|
18
29
|
onChange(model);
|
|
@@ -23,6 +34,9 @@ const Wysiwyg = (props: IProps): JSX.Element => {
|
|
|
23
34
|
const dynamicConfig = {
|
|
24
35
|
placeholderText: placeholder,
|
|
25
36
|
toolbarButtons: full ? buttonsFull : buttons,
|
|
37
|
+
requestHeaders: {
|
|
38
|
+
Authorization: `bearer ${token}`,
|
|
39
|
+
},
|
|
26
40
|
events: {
|
|
27
41
|
initialized() {
|
|
28
42
|
const editor: any = this;
|
|
@@ -34,9 +48,8 @@ const Wysiwyg = (props: IProps): JSX.Element => {
|
|
|
34
48
|
},
|
|
35
49
|
"image.beforeUpload": async function (images: FileList) {
|
|
36
50
|
const editor: any = this;
|
|
37
|
-
const editorImage = editor.image.get();
|
|
38
51
|
const { url } = await uploadImage(images[0], imageSite);
|
|
39
|
-
editor.image.insert(url,
|
|
52
|
+
editor.image.insert(url, true, null, editor.image.get(), null);
|
|
40
53
|
return false;
|
|
41
54
|
},
|
|
42
55
|
blur: function () {
|
|
@@ -72,6 +85,10 @@ interface IWysiwygProps {
|
|
|
72
85
|
site: ISite;
|
|
73
86
|
}
|
|
74
87
|
|
|
88
|
+
const mapStateToProps = (state: IRootState) => ({
|
|
89
|
+
token: state.app.token,
|
|
90
|
+
});
|
|
91
|
+
|
|
75
92
|
interface IDispatchProps {
|
|
76
93
|
uploadImage: (imageFile: File, site: number | string) => Promise<IImage>;
|
|
77
94
|
}
|
|
@@ -82,4 +99,4 @@ const mapDispatchToProps = {
|
|
|
82
99
|
|
|
83
100
|
type IProps = IWysiwygProps & IDispatchProps;
|
|
84
101
|
|
|
85
|
-
export default connect(
|
|
102
|
+
export default connect(mapStateToProps, mapDispatchToProps)(Wysiwyg);
|
|
@@ -7,7 +7,6 @@ import * as S from "./style";
|
|
|
7
7
|
const FloatingMenu = (props: IProps) => {
|
|
8
8
|
const {
|
|
9
9
|
children,
|
|
10
|
-
isWide,
|
|
11
10
|
isInAppBar,
|
|
12
11
|
Button,
|
|
13
12
|
position = "right",
|
|
@@ -51,17 +50,22 @@ const FloatingMenu = (props: IProps) => {
|
|
|
51
50
|
const handleMouseEnter = (e: React.MouseEvent<HTMLDivElement>) =>
|
|
52
51
|
reactiveToHover && !isOpen ? handleClick(e) : null;
|
|
53
52
|
|
|
53
|
+
const handleMouseLeave = (e: React.MouseEvent<HTMLDivElement>) =>
|
|
54
|
+
reactiveToHover && isOpen && setOpen(false);
|
|
55
|
+
|
|
54
56
|
useHandleClickOutside(isOpen, handleClickOutside);
|
|
55
57
|
|
|
56
58
|
return (
|
|
57
|
-
<S.Wrapper ref={wrapper} onClick={handleClick} onMouseEnter={handleMouseEnter}>
|
|
59
|
+
<S.Wrapper ref={wrapper} onClick={handleClick} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>
|
|
58
60
|
<S.ButtonWrapper ref={button}>
|
|
59
61
|
<Button />
|
|
60
62
|
</S.ButtonWrapper>
|
|
61
63
|
{isOpen && (
|
|
62
|
-
<S.
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
<S.MenuWrapper isInAppBar={isInAppBar} ref={menuOptions} position={position}>
|
|
65
|
+
<S.Menu>
|
|
66
|
+
{children}
|
|
67
|
+
</S.Menu>
|
|
68
|
+
</S.MenuWrapper>
|
|
65
69
|
)}
|
|
66
70
|
</S.Wrapper>
|
|
67
71
|
);
|
|
@@ -70,7 +74,6 @@ const FloatingMenu = (props: IProps) => {
|
|
|
70
74
|
interface IProps {
|
|
71
75
|
children: any;
|
|
72
76
|
Button: any;
|
|
73
|
-
isWide: boolean;
|
|
74
77
|
isInAppBar?: boolean;
|
|
75
78
|
position?: string;
|
|
76
79
|
closeOnSelect?: boolean;
|
|
@@ -7,17 +7,19 @@ export const ButtonWrapper = styled.div`
|
|
|
7
7
|
align-items: center;
|
|
8
8
|
`;
|
|
9
9
|
|
|
10
|
-
export const
|
|
10
|
+
export const MenuWrapper = styled.div<{ isInAppBar?: boolean, position: string }>`
|
|
11
11
|
position: absolute;
|
|
12
|
+
z-index: 3;
|
|
13
|
+
padding-top: ${(p) => (p.isInAppBar ? p.theme.spacing.s : p.theme.spacing.xs)};
|
|
14
|
+
margin-right: ${(p) => (p.isInAppBar ? p.theme.spacing.s : "0")};
|
|
12
15
|
${(p) => p.position}: 0;
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
export const Menu = styled.div`
|
|
13
19
|
padding: ${(p) => p.theme.spacing.xs} 0;
|
|
14
20
|
max-width: ${(p) => `calc(${p.theme.spacing.l} * 5)`};
|
|
15
|
-
min-width: ${(p) => `calc(${p.theme.spacing.
|
|
16
|
-
z-index: 3;
|
|
21
|
+
min-width: ${(p) => `calc(${p.theme.spacing.m} * 7)`};
|
|
17
22
|
background: ${(p) => p.theme.color.uiBackground02};
|
|
18
23
|
box-shadow: ${(p) => p.theme.shadow.shadowL};
|
|
19
24
|
border-radius: ${(p) => p.theme.spacing.xxs};
|
|
20
|
-
margin-right: ${(p) => (p.isInAppBar ? p.theme.spacing.s : "0")};
|
|
21
|
-
margin-top: ${(p) => (p.isInAppBar ? p.theme.spacing.s : p.theme.spacing.xs)};
|
|
22
|
-
white-space: nowrap;
|
|
23
25
|
`;
|
|
@@ -34,7 +34,7 @@ const Orientation = ({ filterItems }: IOrientationProps): JSX.Element => {
|
|
|
34
34
|
);
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
|
-
<FloatingMenu
|
|
37
|
+
<FloatingMenu Button={Header} position="center" closeOnSelect={true}>
|
|
38
38
|
<ListTitle>Filter by orientation</ListTitle>
|
|
39
39
|
<ListItem isSelected={selectedValue.includes("all")} onClick={() => setQuery("all")}>All</ListItem>
|
|
40
40
|
<ListItem isSelected={selectedValue.includes("landscape")} onClick={() => setQuery("landscape")}>Horizontal</ListItem>
|
|
@@ -31,7 +31,7 @@ const SortBy = ({ sortItems, sortedState }: ISortByProps): JSX.Element => {
|
|
|
31
31
|
);
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
|
-
<FloatingMenu
|
|
34
|
+
<FloatingMenu Button={Header} position="center">
|
|
35
35
|
<ListTitle>Name Sorting</ListTitle>
|
|
36
36
|
<ListItem isSelected={sortedByName && isAscending} onClick={sortAscendingName}>Ascendent</ListItem>
|
|
37
37
|
<ListItem isSelected={sortedByName && !isAscending} onClick={sortDescendingName}>Descendent</ListItem>
|