@griddo/ax 1.56.9 → 1.57.2

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.
Files changed (253) hide show
  1. package/config/griddo-config.js +1 -0
  2. package/package.json +2 -2
  3. package/src/components/ActionMenu/index.tsx +1 -1
  4. package/src/components/Fields/ComponentArray/MixableComponentArray/index.tsx +7 -1
  5. package/src/components/Fields/ComponentArray/MixableComponentArray/style.tsx +29 -24
  6. package/src/components/Fields/ComponentArray/SameComponentArray/index.tsx +7 -1
  7. package/src/components/Fields/ComponentArray/SameComponentArray/style.tsx +29 -24
  8. package/src/components/Fields/DateField/index.tsx +3 -2
  9. package/src/components/Fields/ReferenceField/AutoPanel/AutoItem/index.tsx +1 -1
  10. package/src/components/Fields/ReferenceField/AutoPanel/index.tsx +1 -1
  11. package/src/components/Fields/ReferenceField/ItemList/Item/index.tsx +1 -1
  12. package/src/components/Fields/UrlField/index.tsx +12 -1
  13. package/src/components/Fields/Wysiwyg/config.tsx +80 -56
  14. package/src/components/Fields/Wysiwyg/index.tsx +23 -6
  15. package/src/components/FloatingMenu/index.tsx +9 -6
  16. package/src/components/FloatingMenu/style.tsx +8 -6
  17. package/src/components/Gallery/GalleryFilters/Orientation/index.tsx +1 -1
  18. package/src/components/Gallery/GalleryFilters/SortBy/index.tsx +1 -1
  19. package/src/components/InformativeMenu/index.tsx +3 -2
  20. package/src/components/InformativeMenu/style.tsx +0 -1
  21. package/src/components/MainWrapper/AppBar/index.tsx +8 -7
  22. package/src/components/MainWrapper/AppBar/style.tsx +7 -0
  23. package/src/components/MenuItem/style.tsx +1 -0
  24. package/src/components/Modal/style.tsx +14 -13
  25. package/src/components/Nav/index.tsx +8 -3
  26. package/src/components/Nav/style.tsx +5 -0
  27. package/src/components/SearchField/index.tsx +43 -14
  28. package/src/components/SearchField/style.tsx +23 -10
  29. package/src/components/SideModal/index.tsx +24 -8
  30. package/src/components/SideModal/style.tsx +13 -2
  31. package/src/components/SubNav/style.tsx +3 -2
  32. package/src/containers/Navigation/Defaults/actions.tsx +26 -24
  33. package/src/containers/Navigation/Defaults/reducer.tsx +2 -2
  34. package/src/containers/PageEditor/actions.tsx +9 -8
  35. package/src/containers/Settings/Social/actions.tsx +9 -31
  36. package/src/containers/Settings/Social/constants.tsx +2 -3
  37. package/src/containers/Settings/Social/interfaces.tsx +2 -7
  38. package/src/containers/Settings/Social/reducer.tsx +3 -14
  39. package/src/containers/Sites/actions.tsx +3 -63
  40. package/src/containers/Sites/constants.tsx +0 -1
  41. package/src/containers/Sites/interfaces.tsx +0 -6
  42. package/src/containers/Sites/reducer.tsx +1 -29
  43. package/src/forms/editor.tsx +2 -0
  44. package/src/forms/validators.tsx +2 -0
  45. package/src/helpers/dates.tsx +23 -24
  46. package/src/helpers/index.tsx +2 -0
  47. package/src/helpers/objects.tsx +17 -2
  48. package/src/helpers/schemas.tsx +7 -4
  49. package/src/hooks/forms.tsx +23 -24
  50. package/src/modules/App/Routing/NavMenu/NavItem/index.tsx +10 -5
  51. package/src/modules/App/Routing/NavMenu/NavItem/style.tsx +13 -9
  52. package/src/modules/App/Routing/NavMenu/index.tsx +39 -37
  53. package/src/modules/App/Routing/NavMenu/style.tsx +9 -3
  54. package/src/modules/Categories/CategoriesList/CategoryItem/index.tsx +1 -1
  55. package/src/modules/Categories/CategoriesList/CategoryNav/NavItem/index.tsx +6 -3
  56. package/src/modules/Categories/CategoriesList/CategoryNav/NavItem/style.tsx +5 -1
  57. package/src/modules/Content/ContentFilters/index.tsx +6 -3
  58. package/src/modules/Content/ContentFilters/style.tsx +6 -1
  59. package/src/modules/Content/HeaderMenus/Live/index.tsx +1 -1
  60. package/src/modules/Content/HeaderMenus/Name/index.tsx +10 -4
  61. package/src/modules/Content/HeaderMenus/Status/index.tsx +7 -3
  62. package/src/modules/Content/HeaderMenus/Translations/index.tsx +1 -1
  63. package/src/modules/Content/HeaderMenus/Types/index.tsx +1 -1
  64. package/src/modules/Content/OptionTable/index.tsx +6 -3
  65. package/src/modules/Content/OptionTable/style.tsx +4 -0
  66. package/src/modules/Content/PageItem/index.tsx +3 -3
  67. package/src/modules/Content/index.tsx +5 -3
  68. package/src/modules/GlobalEditor/index.tsx +37 -14
  69. package/src/modules/Navigation/Defaults/DefaultsEditor/index.tsx +33 -13
  70. package/src/modules/Navigation/Defaults/Item/atoms.tsx +1 -1
  71. package/src/modules/Navigation/Defaults/Nav/index.tsx +8 -3
  72. package/src/modules/Navigation/Defaults/Nav/style.tsx +4 -0
  73. package/src/modules/Navigation/Defaults/index.tsx +4 -0
  74. package/src/modules/Navigation/Menus/List/Nav/index.tsx +8 -3
  75. package/src/modules/Navigation/Menus/List/Nav/style.tsx +4 -0
  76. package/src/modules/Navigation/Menus/List/index.tsx +3 -1
  77. package/src/modules/Navigation/Menus/List/style.tsx +9 -1
  78. package/src/modules/PageEditor/index.tsx +38 -14
  79. package/src/modules/Settings/ContentTypes/DataPacks/AddModal/Filter/index.tsx +1 -1
  80. package/src/modules/Settings/ContentTypes/DataPacks/AddModal/SortFilter/index.tsx +1 -1
  81. package/src/modules/Settings/ContentTypes/DataPacks/Nav/index.tsx +11 -6
  82. package/src/modules/Settings/ContentTypes/DataPacks/Nav/style.tsx +6 -1
  83. package/src/modules/Settings/Globals/index.tsx +19 -31
  84. package/src/modules/Settings/Languages/LanguagePanel/Form/index.tsx +1 -1
  85. package/src/modules/Settings/Languages/Table/Item/index.tsx +1 -1
  86. package/src/modules/Settings/Social/index.tsx +35 -91
  87. package/src/modules/Sites/SitesList/SiteModal/index.tsx +12 -27
  88. package/src/modules/Sites/SitesList/index.tsx +15 -15
  89. package/src/modules/StructuredData/StructuredDataList/ContentFilters/index.tsx +3 -1
  90. package/src/modules/StructuredData/StructuredDataList/ContentFilters/style.tsx +6 -1
  91. package/src/modules/StructuredData/StructuredDataList/GlobalPageItem/index.tsx +3 -3
  92. package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Live/index.tsx +1 -1
  93. package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Name/index.tsx +10 -4
  94. package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Site/index.tsx +1 -1
  95. package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Status/index.tsx +7 -3
  96. package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Translations/index.tsx +1 -1
  97. package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Types/index.tsx +1 -1
  98. package/src/modules/StructuredData/StructuredDataList/OptionTable/index.tsx +6 -3
  99. package/src/modules/StructuredData/StructuredDataList/OptionTable/style.tsx +4 -0
  100. package/src/modules/StructuredData/StructuredDataList/StructuredDataItem/index.tsx +1 -1
  101. package/src/modules/Users/UserList/HeaderMenus/Name/index.tsx +13 -5
  102. package/src/schemas/index.tsx +7 -0
  103. package/src/schemas/pages/GlobalPage.tsx +166 -0
  104. package/src/schemas/pages/Page.tsx +181 -0
  105. package/src/schemas/pages/index.tsx +4 -0
  106. package/src/types/index.tsx +8 -14
  107. package/tsconfig.paths.json +2 -1
  108. package/public/img/schemas/Accordion/thumbnails/thumbnail@1x.png +0 -0
  109. package/public/img/schemas/Accordion/thumbnails/thumbnail@2x.png +0 -0
  110. package/public/img/schemas/AddressCollection/thumbnails/thumbnail@1x.png +0 -0
  111. package/public/img/schemas/AddressCollection/thumbnails/thumbnail@2x.png +0 -0
  112. package/public/img/schemas/BasicBoxedCard/thumbnails/thumbnail@1x.png +0 -0
  113. package/public/img/schemas/BasicBoxedCard/thumbnails/thumbnail@2x.png +0 -0
  114. package/public/img/schemas/BasicCard/thumbnails/thumbnail@1x.png +0 -0
  115. package/public/img/schemas/BasicCard/thumbnails/thumbnail@2x.png +0 -0
  116. package/public/img/schemas/BasicContent/layouts/layout001@1x.png +0 -0
  117. package/public/img/schemas/BasicContent/layouts/layout001@2x.png +0 -0
  118. package/public/img/schemas/BasicContent/layouts/layout002@1x.png +0 -0
  119. package/public/img/schemas/BasicContent/layouts/layout002@2x.png +0 -0
  120. package/public/img/schemas/BasicContent/layouts/layout003@1x.png +0 -0
  121. package/public/img/schemas/BasicContent/layouts/layout003@2x.png +0 -0
  122. package/public/img/schemas/BasicContent/layouts/layout004@1x.png +0 -0
  123. package/public/img/schemas/BasicContent/layouts/layout004@2x.png +0 -0
  124. package/public/img/schemas/BasicContent/layouts/layout005@1x.png +0 -0
  125. package/public/img/schemas/BasicContent/layouts/layout005@2x.png +0 -0
  126. package/public/img/schemas/BasicContent/layouts/layout006@1x.png +0 -0
  127. package/public/img/schemas/BasicContent/layouts/layout006@2x.png +0 -0
  128. package/public/img/schemas/BasicContent/layouts/layout007@1x.png +0 -0
  129. package/public/img/schemas/BasicContent/layouts/layout007@2x.png +0 -0
  130. package/public/img/schemas/BasicContent/thumbnails/thumbnail@1x.png +0 -0
  131. package/public/img/schemas/BasicContent/thumbnails/thumbnail@2x.png +0 -0
  132. package/public/img/schemas/BasicIconCard/thumbnails/thumbnail@1x.png +0 -0
  133. package/public/img/schemas/BasicIconCard/thumbnails/thumbnail@2x.png +0 -0
  134. package/public/img/schemas/CardCollection/layouts/layout001@1x.png +0 -0
  135. package/public/img/schemas/CardCollection/layouts/layout001@2x.png +0 -0
  136. package/public/img/schemas/CardCollection/layouts/layout002@1x.png +0 -0
  137. package/public/img/schemas/CardCollection/layouts/layout002@2x.png +0 -0
  138. package/public/img/schemas/CardCollection/layouts/layout003@1x.png +0 -0
  139. package/public/img/schemas/CardCollection/layouts/layout003@2x.png +0 -0
  140. package/public/img/schemas/CardCollection/layouts/layout004@1x.png +0 -0
  141. package/public/img/schemas/CardCollection/layouts/layout004@2x.png +0 -0
  142. package/public/img/schemas/CardCollection/layouts/layout005@1x.png +0 -0
  143. package/public/img/schemas/CardCollection/layouts/layout005@2x.png +0 -0
  144. package/public/img/schemas/CardCollection/thumbnails/thumbnail@1x.png +0 -0
  145. package/public/img/schemas/CardCollection/thumbnails/thumbnail@2x.png +0 -0
  146. package/public/img/schemas/DownloadCollection/thumbnails/thumbnail@1x.png +0 -0
  147. package/public/img/schemas/DownloadCollection/thumbnails/thumbnail@2x.png +0 -0
  148. package/public/img/schemas/EventCard/layouts/layout001@1x.png +0 -0
  149. package/public/img/schemas/EventCard/layouts/layout001@2x.png +0 -0
  150. package/public/img/schemas/EventCard/layouts/layout002@1x.png +0 -0
  151. package/public/img/schemas/EventCard/layouts/layout002@2x.png +0 -0
  152. package/public/img/schemas/EventCard/thumbnails/thumbnail@1x.png +0 -0
  153. package/public/img/schemas/EventCard/thumbnails/thumbnail@2x.png +0 -0
  154. package/public/img/schemas/EventsDistributor/thumbnails/thumbnail@1x.png +0 -0
  155. package/public/img/schemas/EventsDistributor/thumbnails/thumbnail@2x.png +0 -0
  156. package/public/img/schemas/FeaturedAudiovisual/layouts/layout001@1x.png +0 -0
  157. package/public/img/schemas/FeaturedAudiovisual/layouts/layout001@2x.png +0 -0
  158. package/public/img/schemas/FeaturedAudiovisual/layouts/layout002@1x.png +0 -0
  159. package/public/img/schemas/FeaturedAudiovisual/layouts/layout002@2x.png +0 -0
  160. package/public/img/schemas/FeaturedAudiovisual/layouts/layout003@1x.png +0 -0
  161. package/public/img/schemas/FeaturedAudiovisual/layouts/layout003@2x.png +0 -0
  162. package/public/img/schemas/FeaturedAudiovisual/layouts/layout004@1x.png +0 -0
  163. package/public/img/schemas/FeaturedAudiovisual/layouts/layout004@2x.png +0 -0
  164. package/public/img/schemas/FeaturedAudiovisual/layouts/layout005@1x.png +0 -0
  165. package/public/img/schemas/FeaturedAudiovisual/layouts/layout005@2x.png +0 -0
  166. package/public/img/schemas/FeaturedAudiovisual/layouts/layout006@1x.png +0 -0
  167. package/public/img/schemas/FeaturedAudiovisual/layouts/layout006@2x.png +0 -0
  168. package/public/img/schemas/FeaturedAudiovisual/layouts/layout007@1x.png +0 -0
  169. package/public/img/schemas/FeaturedAudiovisual/layouts/layout007@2x.png +0 -0
  170. package/public/img/schemas/FeaturedAudiovisual/layouts/layout008@1x.png +0 -0
  171. package/public/img/schemas/FeaturedAudiovisual/layouts/layout008@2x.png +0 -0
  172. package/public/img/schemas/FeaturedAudiovisual/layouts/layout009@1x.png +0 -0
  173. package/public/img/schemas/FeaturedAudiovisual/layouts/layout009@2x.png +0 -0
  174. package/public/img/schemas/FeaturedAudiovisual/layouts/layout010@1x.png +0 -0
  175. package/public/img/schemas/FeaturedAudiovisual/layouts/layout010@2x.png +0 -0
  176. package/public/img/schemas/FeaturedAudiovisual/layouts/layout011@1x.png +0 -0
  177. package/public/img/schemas/FeaturedAudiovisual/layouts/layout011@2x.png +0 -0
  178. package/public/img/schemas/FeaturedAudiovisual/layouts/layout012@1x.png +0 -0
  179. package/public/img/schemas/FeaturedAudiovisual/layouts/layout012@2x.png +0 -0
  180. package/public/img/schemas/FeaturedAudiovisual/thumbnails/thumbnail@1x.png +0 -0
  181. package/public/img/schemas/FeaturedAudiovisual/thumbnails/thumbnail@2x.png +0 -0
  182. package/public/img/schemas/FeaturedBlock/layouts/layout001@1x.png +0 -0
  183. package/public/img/schemas/FeaturedBlock/layouts/layout001@2x.png +0 -0
  184. package/public/img/schemas/FeaturedBlock/layouts/layout002@1x.png +0 -0
  185. package/public/img/schemas/FeaturedBlock/layouts/layout002@2x.png +0 -0
  186. package/public/img/schemas/FeaturedProgram/thumbnails/thumbnail@1x.png +0 -0
  187. package/public/img/schemas/FeaturedProgram/thumbnails/thumbnail@2x.png +0 -0
  188. package/public/img/schemas/FeaturedText/thumbnails/thumbnail@1x.png +0 -0
  189. package/public/img/schemas/FeaturedText/thumbnails/thumbnail@2x.png +0 -0
  190. package/public/img/schemas/FeedbackForm/thumbnails/thumbnail@1x.png +0 -0
  191. package/public/img/schemas/FeedbackForm/thumbnails/thumbnail@2x.png +0 -0
  192. package/public/img/schemas/HeroCarousel/thumbnails/thumbnail@1x.png +0 -0
  193. package/public/img/schemas/HeroCarousel/thumbnails/thumbnail@2x.png +0 -0
  194. package/public/img/schemas/HeroImage/thumbnails/thumbnail@1x.png +0 -0
  195. package/public/img/schemas/HeroImage/thumbnails/thumbnail@2x.png +0 -0
  196. package/public/img/schemas/IconCard/thumbnails/thumbnail@1x.png +0 -0
  197. package/public/img/schemas/IconCard/thumbnails/thumbnail@2x.png +0 -0
  198. package/public/img/schemas/IconCenteredCard/thumbnails/thumbnail@1x.png +0 -0
  199. package/public/img/schemas/IconCenteredCard/thumbnails/thumbnail@2x.png +0 -0
  200. package/public/img/schemas/Image/thumbnails/thumbnail@1x.png +0 -0
  201. package/public/img/schemas/Image/thumbnails/thumbnail@2x.png +0 -0
  202. package/public/img/schemas/ImageCard/thumbnails/thumbnail@1x.png +0 -0
  203. package/public/img/schemas/ImageCard/thumbnails/thumbnail@2x.png +0 -0
  204. package/public/img/schemas/Intro/thumbnails/thumbnail@1x.png +0 -0
  205. package/public/img/schemas/Intro/thumbnails/thumbnail@2x.png +0 -0
  206. package/public/img/schemas/LogoCard/thumbnails/thumbnail@1x.png +0 -0
  207. package/public/img/schemas/LogoCard/thumbnails/thumbnail@2x.png +0 -0
  208. package/public/img/schemas/NewsDistributor/thumbnails/thumbnail@1x.png +0 -0
  209. package/public/img/schemas/NewsDistributor/thumbnails/thumbnail@2x.png +0 -0
  210. package/public/img/schemas/PersonDistributor/thumbnails/thumbnail@1x.png +0 -0
  211. package/public/img/schemas/PersonDistributor/thumbnails/thumbnail@2x.png +0 -0
  212. package/public/img/schemas/PublicationDistributor/thumbnails/thumbnail@1x.png +0 -0
  213. package/public/img/schemas/PublicationDistributor/thumbnails/thumbnail@2x.png +0 -0
  214. package/public/img/schemas/SchoolFooter/thumbnails/thumbnail@1x.png +0 -0
  215. package/public/img/schemas/SchoolFooter/thumbnails/thumbnail@2x.png +0 -0
  216. package/public/img/schemas/Slider/thumbnails/thumbnail@1x.png +0 -0
  217. package/public/img/schemas/Slider/thumbnails/thumbnail@2x.png +0 -0
  218. package/public/img/schemas/Testimonial/layouts/layout001@1x.png +0 -0
  219. package/public/img/schemas/Testimonial/layouts/layout001@2x.png +0 -0
  220. package/public/img/schemas/Testimonial/layouts/layout002@1x.png +0 -0
  221. package/public/img/schemas/Testimonial/layouts/layout002@2x.png +0 -0
  222. package/public/img/schemas/Testimonial/thumbnails/thumbnail@1x.png +0 -0
  223. package/public/img/schemas/Testimonial/thumbnails/thumbnail@2x.png +0 -0
  224. package/public/img/schemas/TextBluePanel/layouts/layout001@1x.png +0 -0
  225. package/public/img/schemas/TextBluePanel/layouts/layout001@2x.png +0 -0
  226. package/public/img/schemas/TextBluePanel/layouts/layout002@1x.png +0 -0
  227. package/public/img/schemas/TextBluePanel/layouts/layout002@2x.png +0 -0
  228. package/public/img/schemas/TextBluePanel/thumbnails/thumbnail@1x.png +0 -0
  229. package/public/img/schemas/TextBluePanel/thumbnails/thumbnail@2x.png +0 -0
  230. package/public/img/schemas/Video/thumbnails/thumbnail@1x.png +0 -0
  231. package/public/img/schemas/Video/thumbnails/thumbnail@2x.png +0 -0
  232. package/public/img/schemas/imgHeros.png +0 -0
  233. package/public/img/schemas/imgStandard.jpg +0 -0
  234. package/public/img/schemas/templates/BasicTemplate/thumbnails/thumbnail@1x.png +0 -0
  235. package/public/img/schemas/templates/BasicTemplate/thumbnails/thumbnail@2x.png +0 -0
  236. package/public/img/schemas/templates/Error404/thumbnails/thumbnail@1x.png +0 -0
  237. package/public/img/schemas/templates/Error404/thumbnails/thumbnail@2x.png +0 -0
  238. package/public/img/schemas/templates/NewsList/thumbnails/thumbnail@1x.png +0 -0
  239. package/public/img/schemas/templates/NewsList/thumbnails/thumbnail@2x.png +0 -0
  240. package/public/img/schemas/themes/LinkStyle.png +0 -0
  241. package/public/img/schemas/themes/LinkStyle@2x.png +0 -0
  242. package/public/img/schemas/themes/PrimaryStyle.png +0 -0
  243. package/public/img/schemas/themes/PrimaryStyle@2x.png +0 -0
  244. package/public/img/schemas/themes/STYLE01.png +0 -0
  245. package/public/img/schemas/themes/STYLE02.png +0 -0
  246. package/public/img/schemas/themes/STYLE03.png +0 -0
  247. package/public/img/schemas/themes/STYLE04.png +0 -0
  248. package/public/img/schemas/themes/STYLE05.png +0 -0
  249. package/public/img/schemas/themes/STYLE06.png +0 -0
  250. package/public/img/schemas/themes/SecondaryStyle.png +0 -0
  251. package/public/img/schemas/themes/SecondaryStyle@2x.png +0 -0
  252. package/src/components/MainWrapper/AppBar/SearchField/index.tsx +0 -54
  253. package/src/components/MainWrapper/AppBar/SearchField/style.tsx +0 -55
@@ -2,7 +2,7 @@ import { useState, useEffect, useRef, memo } from "react";
2
2
  import isEqual from "lodash.isequal";
3
3
 
4
4
  import { deepClone } from "@ax/helpers";
5
- import { cleanPageValues, getIsSavedData, setIsSavedData } from "@ax/forms";
5
+ import { cleanPageValues, getIsSavedData } from "@ax/forms";
6
6
 
7
7
  const useEqualValue = (component: any) =>
8
8
  memo(component, (prevProps: any, newProps: any) => {
@@ -59,7 +59,7 @@ const useEqualStructured = (component: any) => {
59
59
  });
60
60
  };
61
61
 
62
- const usePrevious = (value: any): Record<string, unknown> | undefined => {
62
+ const usePrevious = (value: any, isSaved?: boolean): Record<string, unknown> | undefined => {
63
63
  const stringValue = value && JSON.stringify(value);
64
64
  const ref = useRef();
65
65
  const isSavedData = getIsSavedData();
@@ -71,19 +71,24 @@ const usePrevious = (value: any): Record<string, unknown> | undefined => {
71
71
  }, [stringValue]);
72
72
 
73
73
  useEffect(() => {
74
- if (isSavedData) {
74
+ if (isSavedData || isSaved) {
75
75
  ref.current = stringValue && JSON.parse(stringValue);
76
76
  }
77
77
  // eslint-disable-next-line react-hooks/exhaustive-deps
78
- }, [isSavedData]);
78
+ }, [isSavedData, isSaved]);
79
79
 
80
80
  return ref.current;
81
81
  };
82
82
 
83
- const useIsDirty = (updatedValues: any): { isDirty: boolean } => {
83
+ const useIsDirty = (
84
+ updatedValues: any,
85
+ isNew?: boolean
86
+ ): { isDirty: boolean; setIsDirty(state: boolean): void; resetDirty: any } => {
84
87
  const [isDirty, setIsDirty] = useState(false);
88
+ const [isSaved, setIsSaved] = useState(false);
89
+
90
+ const prevContent = usePrevious(updatedValues, isSaved);
85
91
 
86
- const prevContent = usePrevious(updatedValues);
87
92
  const hasChanged = () => {
88
93
  if (prevContent && updatedValues) {
89
94
  const updatedValuesCloned = updatedValues && deepClone(updatedValues);
@@ -97,15 +102,20 @@ const useIsDirty = (updatedValues: any): { isDirty: boolean } => {
97
102
  }
98
103
  };
99
104
 
100
- const isSavedData = getIsSavedData();
105
+ const resetDirty = () => {
106
+ setIsDirty(false);
107
+ setIsSaved(true);
108
+ };
101
109
 
102
110
  useEffect(() => {
103
- if (prevContent && updatedValues) {
104
- const isNewElem = prevContent.id !== updatedValues.id;
111
+ if (isNew) {
112
+ setIsDirty(true);
113
+ } else if (prevContent && updatedValues) {
105
114
  const isUpdated = hasChanged();
106
- if (isUpdated && !isNewElem) {
107
- isSavedData === "false" ? setIsDirty(true) : setIsDirty(false);
108
- setIsSavedData(false);
115
+
116
+ if (isUpdated) {
117
+ setIsDirty(true);
118
+ setIsSaved(false);
109
119
  } else {
110
120
  setIsDirty(false);
111
121
  }
@@ -113,18 +123,7 @@ const useIsDirty = (updatedValues: any): { isDirty: boolean } => {
113
123
  // eslint-disable-next-line
114
124
  }, [JSON.stringify(updatedValues)]);
115
125
 
116
- useEffect(() => {
117
- if (updatedValues && updatedValues.id === undefined && isSavedData === "false") {
118
- setIsDirty(true);
119
- }
120
-
121
- if (prevContent && !hasChanged() && isSavedData === "true") {
122
- setIsDirty(false);
123
- }
124
- // eslint-disable-next-line
125
- }, [isSavedData]);
126
-
127
- return { isDirty };
126
+ return { isDirty, setIsDirty, resetDirty };
128
127
  };
129
128
 
130
129
  export { useEqualValue, useDebounce, useEqualStructured, usePrevious, useIsDirty };
@@ -19,7 +19,8 @@ const NavItem = (props: IProps) => {
19
19
 
20
20
  const { state, toggleSubmenu } = useContext(NavContext)!;
21
21
 
22
- const isSelected = location && (location.pathname === path || location.pathname.includes(path)) ? "selected" : "";
22
+ const isSelected = location && (location.pathname === path || location.pathname.includes(path));
23
+ const isSelectedClass = isSelected ? "selected" : "";
23
24
 
24
25
  const hasSubmenu = routesGroups && routesGroups.length > 0;
25
26
 
@@ -40,10 +41,10 @@ const NavItem = (props: IProps) => {
40
41
  const DropdownClass = isOpened ? "inline" : "floating";
41
42
 
42
43
  return (
43
- <S.Item key={name} type={type} isOpened={isOpened} isSubmenuOpen={state[name]}>
44
- <S.NavLink onClick={handleClick} className={isSelected}>
44
+ <S.Item key={name} type={type} isOpened={isOpened} isSubmenuOpen={state[name]} active={isSelected}>
45
+ <S.NavLink onClick={handleClick} className={isSelectedClass}>
45
46
  <S.Icon>{icon && <Icon name={icon} size="24px" />}</S.Icon>
46
- <S.LinkName>{name}</S.LinkName>
47
+ <S.LinkName active={isSelected || state[name]}>{name}</S.LinkName>
47
48
  {hasSubmenu && isOpened && (
48
49
  <S.Arrow>
49
50
  <Icon name={subMenuIcon} />
@@ -73,7 +74,11 @@ const NavItem = (props: IProps) => {
73
74
 
74
75
  return (
75
76
  <NavSubItem key={subI} active={isSelectedSubItem} type={type}>
76
- <S.NavLink onClick={goToSubLink}>{subLink.name}</S.NavLink>
77
+ <S.NavLink onClick={goToSubLink}>
78
+ <S.LinkName active={isSelected}>
79
+ {subLink.name}
80
+ </S.LinkName>
81
+ </S.NavLink>
77
82
  </NavSubItem>
78
83
  );
79
84
  })}
@@ -28,8 +28,7 @@ export const Dropdown = styled.ul<{ isSubmenu?: boolean; isSubmenuOpen: boolean;
28
28
  z-index: 1000;
29
29
  height: ${(p) => p.isSubmenu ? "auto" : "40px"};
30
30
  width: calc(${(p) => p.theme.spacing.xl} * 3);
31
- padding-top: ${(p) => p.isSubmenu ? p.theme.spacing.s : "0"};
32
- padding-bottom: ${(p) => p.isSubmenu ? p.theme.spacing.s : "0"};
31
+ padding: ${(p) => p.isSubmenu ? p.theme.spacing.s : "0"};
33
32
  }
34
33
 
35
34
  &.inline {
@@ -60,7 +59,13 @@ export const Arrow = styled.div`
60
59
  }
61
60
  `;
62
61
 
63
- export const Item = styled.li<{ type: string; isOpened: boolean; isSubmenuOpen: boolean }>`
62
+ export const LinkName = styled.span<{ active: boolean }>`
63
+ white-space: nowrap;
64
+ overflow: hidden;
65
+ color: ${(p) => p.active ? p.theme.color.textHighEmphasisInverse : p.theme.color.textMediumEmphasisInverse};
66
+ `;
67
+
68
+ export const Item = styled.li<{ type: string; isOpened: boolean; isSubmenuOpen: boolean; active: boolean }>`
64
69
  position: relative;
65
70
  margin-left: ${(p) => p.isSubmenuOpen ? "0" : p.theme.spacing.s};
66
71
  margin-right: ${(p) => p.isOpened && !p.isSubmenuOpen ? p.theme.spacing.s : "0"};
@@ -73,7 +78,7 @@ export const Item = styled.li<{ type: string; isOpened: boolean; isSubmenuOpen:
73
78
 
74
79
  svg {
75
80
  path {
76
- fill: ${(p) => p.isSubmenuOpen ? p.theme.color.textHighEmphasisInverse : p.theme.color.textMediumEmphasisInverse };
81
+ fill: ${(p) => (p.isSubmenuOpen || p.active) ? p.theme.color.textHighEmphasisInverse : p.theme.color.textMediumEmphasisInverse };
77
82
  }
78
83
  }
79
84
 
@@ -81,6 +86,10 @@ export const Item = styled.li<{ type: string; isOpened: boolean; isSubmenuOpen:
81
86
  background-color: ${(p) => p.theme.color.overlayHoverDark};
82
87
  color: ${(p) => p.theme.color.textHighEmphasisInverse};
83
88
 
89
+ ${LinkName} {
90
+ color: ${(p) => p.theme.color.textHighEmphasisInverse};
91
+ }
92
+
84
93
  svg {
85
94
  path {
86
95
  fill: ${(p) => p.theme.color.textHighEmphasisInverse};
@@ -154,8 +163,3 @@ export const Icon = styled.div`
154
163
  fill: ${(p) => p.theme.color.textMediumEmphasisInverse};
155
164
  }
156
165
  `;
157
-
158
- export const LinkName = styled.span`
159
- white-space: nowrap;
160
- overflow: hidden;
161
- `;
@@ -125,43 +125,45 @@ const NavMenu = (props: IProps) => {
125
125
  )}
126
126
  <S.NavLink>{config.logo}</S.NavLink>
127
127
  </S.Home>
128
- <S.List>
129
- {config.routes &&
130
- config.routes
131
- .filter((route: IRouter) => route.showInNav)
132
- .map(
133
- (route: IRouter): JSX.Element => (
134
- <NavItem
135
- setHistoryPush={setHistoryPush}
136
- key={route.name}
137
- route={route}
138
- location={location}
139
- type={config.type}
140
- isOpened={isOpened}
141
- />
142
- )
143
- )}
144
- </S.List>
145
- <S.List bottom={true}>
146
- {isSitePublished && (
147
- <>
148
- <NavItem setHistoryPush={setHistoryPush} route={siteRoute} type={config.type} isOpened={isOpened} />
149
- <S.Separator />
150
- </>
151
- )}
152
- {!isSite && (
153
- <NavItem
154
- setHistoryPush={setHistoryPush}
155
- route={profileRoute}
156
- type={config.type}
157
- isOpened={isOpened}
158
- location={location}
159
- />
160
- )}
161
- <NavItem setHistoryPush={setHistoryPush} route={logoutRoute} type={config.type} isOpened={isOpened} />
162
- <S.Separator />
163
- <NavItem setHistoryPush={setHistoryPush} route={collapseRoute} type={config.type} isOpened={isOpened} />
164
- </S.List>
128
+ <S.Lists>
129
+ <S.List>
130
+ {config.routes &&
131
+ config.routes
132
+ .filter((route: IRouter) => route.showInNav)
133
+ .map(
134
+ (route: IRouter): JSX.Element => (
135
+ <NavItem
136
+ setHistoryPush={setHistoryPush}
137
+ key={route.name}
138
+ route={route}
139
+ location={location}
140
+ type={config.type}
141
+ isOpened={isOpened}
142
+ />
143
+ )
144
+ )}
145
+ </S.List>
146
+ <S.List>
147
+ {isSitePublished && (
148
+ <>
149
+ <NavItem setHistoryPush={setHistoryPush} route={siteRoute} type={config.type} isOpened={isOpened} />
150
+ <S.Separator />
151
+ </>
152
+ )}
153
+ {!isSite && (
154
+ <NavItem
155
+ setHistoryPush={setHistoryPush}
156
+ route={profileRoute}
157
+ type={config.type}
158
+ isOpened={isOpened}
159
+ location={location}
160
+ />
161
+ )}
162
+ <NavItem setHistoryPush={setHistoryPush} route={logoutRoute} type={config.type} isOpened={isOpened} />
163
+ <S.Separator />
164
+ <NavItem setHistoryPush={setHistoryPush} route={collapseRoute} type={config.type} isOpened={isOpened} />
165
+ </S.List>
166
+ </S.Lists>
165
167
  </S.NavWrapper>
166
168
  </NavProvider>
167
169
  );
@@ -18,7 +18,7 @@ export const Home = styled.div<{ type: string; isSite: boolean; isOpened: boolea
18
18
  padding: ${(p) => `${p.theme.spacing.xs} 12px`};
19
19
  background-color: ${(p) =>
20
20
  p.type === "multisite" ? p.theme.color.uiMainMenuBackground : p.theme.color.uiBarBackground};
21
- height: ${(p) => p.theme.spacing.xl};
21
+ height: calc(${(p) => p.theme.spacing.xxs} * 17);
22
22
  display: flex;
23
23
  align-items: center;
24
24
  justify-content: ${(p) => (p.isOpened ? "flex-start" : "center")};
@@ -106,10 +106,16 @@ export const NavWrapper = styled.nav<{ type: string; isOpened: boolean }>`
106
106
  }
107
107
  `;
108
108
 
109
- export const List = styled.ul<{ bottom?: boolean }>`
110
- ${(p) => p.bottom && `margin-top: auto;`}
109
+ export const Lists = styled.div`
110
+ display: flex;
111
+ flex-direction: column;
112
+ justify-content: space-between;
113
+ height: 100%;
114
+ padding-top: ${(p) => p.theme.spacing.s};
111
115
  `;
112
116
 
117
+ export const List = styled.ul``;
118
+
113
119
  export const Separator = styled.li`
114
120
  border-bottom: 1px solid ${(p) => p.theme.color.uiLineInverse};
115
121
  margin: ${(p) => `${p.theme.spacing.s} 0`};
@@ -116,7 +116,7 @@ const CategoryItem = (props: ICategoryItemProps): JSX.Element => {
116
116
  );
117
117
 
118
118
  const translations = isTranslatable ? (
119
- <FloatingMenu Button={FlagsButton} isWide={true}>
119
+ <FloatingMenu Button={FlagsButton}>
120
120
  {languageMenu()}
121
121
  </FloatingMenu>
122
122
  ) : (
@@ -26,12 +26,15 @@ const NavItem = (props: IProps): JSX.Element => {
26
26
  <S.Dropdown isOpen={isOpen}>
27
27
  {categories &&
28
28
  categories.map((category: IStructuredData, key: number) => {
29
- const isSelected = current && category.id === current.id ? "selected" : "";
29
+ const isSelected = !!current && category.id === current.id;
30
+ const selectedClass = isSelected ? "selected" : "";
30
31
  const handleClick = () => onClick(category.id);
31
32
  return (
32
33
  <MenuItem key={key} onClick={handleClick}>
33
- <NavLink to="#" className={isSelected}>
34
- {category.title}
34
+ <NavLink to="#" className={selectedClass}>
35
+ <S.Link active={isSelected}>
36
+ {category.title}
37
+ </S.Link>
35
38
  </NavLink>
36
39
  </MenuItem>
37
40
  );
@@ -31,4 +31,8 @@ const Dropdown = styled.ul<{isOpen: boolean}>`
31
31
  flex-direction: column;
32
32
  `;
33
33
 
34
- export { NavItemWrapper, NavLink, Title, Arrow, Dropdown };
34
+ const Link = styled.div<{ active: boolean }>`
35
+ color: ${p => p.active ? p.theme.color.textHighEmphasis : p.theme.color.textMediumEmphasis};
36
+ `;
37
+
38
+ export { NavItemWrapper, NavLink, Title, Arrow, Dropdown, Link };
@@ -41,12 +41,15 @@ const ContentFilters = (props: IProps): JSX.Element => {
41
41
  }
42
42
  };
43
43
 
44
- const isSelected = value === current ? "selected" : "";
44
+ const isSelected = value === current;
45
+ const selectedClass = isSelected ? "selected" : "";
45
46
 
46
47
  return (
47
48
  <MenuItem key={filterKey} onClick={handleClick}>
48
- <NavLink to="#" className={isSelected}>
49
- {name}
49
+ <NavLink to="#" className={selectedClass}>
50
+ <S.Link active={isSelected}>
51
+ {name}
52
+ </S.Link>
50
53
  </NavLink>
51
54
  </MenuItem>
52
55
  );
@@ -2,6 +2,7 @@ import styled from "styled-components";
2
2
 
3
3
  export const Heading = styled.li`
4
4
  ${p => p.theme.textStyle.headingXXS};
5
+ color: ${p => p.theme.color.textLowEmphasis};
5
6
  margin-bottom: ${p => p.theme.spacing.xs};
6
7
  cursor: default;
7
8
 
@@ -33,6 +34,10 @@ export const SubItem = styled.li`
33
34
  }
34
35
  `;
35
36
 
36
- export const Item = styled.article`
37
+ export const Item = styled.div`
37
38
  margin-bottom: ${p => p.theme.spacing.m};
38
39
  `;
40
+
41
+ export const Link = styled.div<{ active: boolean }>`
42
+ color: ${p => p.active ? p.theme.color.textHighEmphasis : p.theme.color.textMediumEmphasis};
43
+ `;
@@ -77,7 +77,7 @@ const Live = (props: ILiveProps): JSX.Element => {
77
77
  );
78
78
 
79
79
  return (
80
- <FloatingMenu isWide={true} Button={Header} position="left" closeOnSelect={false}>
80
+ <FloatingMenu Button={Header} position="left" closeOnSelect={false}>
81
81
  <ListTitle>Filter by status</ListTitle>
82
82
  <S.ChecksWrapper>
83
83
  <CheckGroup options={options} value={selectedValue} onChange={setQuery} selectAllOption={selectAllOption} />
@@ -28,12 +28,18 @@ const NameHeader = ({ sortItems, sortedState }: INameHeaderProps) => {
28
28
  );
29
29
 
30
30
  return (
31
- <FloatingMenu isWide={true} Button={Header} position="left">
31
+ <FloatingMenu Button={Header} position="left">
32
32
  <ListTitle>Name Sorting</ListTitle>
33
- <ListItem onClick={sortAscendingName}>Ascendent</ListItem>
34
- <ListItem onClick={sortDescendingName}>Descendent</ListItem>
33
+ <ListItem isSelected={sortedByTitle && isAscending} onClick={sortAscendingName}>
34
+ Ascendent
35
+ </ListItem>
36
+ <ListItem isSelected={sortedByTitle && !isAscending} onClick={sortDescendingName}>
37
+ Descendent
38
+ </ListItem>
35
39
  <ListTitle>URL Sorting</ListTitle>
36
- <ListItem onClick={sortAscendingURL}>Ascendent</ListItem>
40
+ <ListItem isSelected={sortedByURL} onClick={sortAscendingURL}>
41
+ Ascendent
42
+ </ListItem>
37
43
  </FloatingMenu>
38
44
  );
39
45
  };
@@ -27,10 +27,14 @@ const Status = ({ sortItems, sortedState }: IStatusProps) => {
27
27
  );
28
28
 
29
29
  return (
30
- <FloatingMenu isWide={true} Button={Header} position="left">
30
+ <FloatingMenu Button={Header} position="left">
31
31
  <ListTitle>Sort by modified date</ListTitle>
32
- <ListItem onClick={sortMostRecentModifiedDate}>Most recent</ListItem>
33
- <ListItem onClick={sortOldestModifiedDate}>Oldest</ListItem>
32
+ <ListItem isSelected={sortedByDate && !isAscending} onClick={sortMostRecentModifiedDate}>
33
+ Most recent
34
+ </ListItem>
35
+ <ListItem isSelected={sortedByDate && isAscending} onClick={sortOldestModifiedDate}>
36
+ Oldest
37
+ </ListItem>
34
38
  </FloatingMenu>
35
39
  );
36
40
  };
@@ -46,7 +46,7 @@ const Translations = ({ filterItems }: ITranslationsProps) => {
46
46
  );
47
47
 
48
48
  return (
49
- <FloatingMenu isWide={true} Button={Header} position="left" closeOnSelect={true} isCheckGroup={true}>
49
+ <FloatingMenu Button={Header} position="left" closeOnSelect={true} isCheckGroup={true}>
50
50
  <ListTitle>Filter by translations</ListTitle>
51
51
  <S.ChecksWrapper>
52
52
  <CheckGroup options={filters} value={selectedValue} onChange={setQuery} selectAllOption={selectAllOption} />
@@ -51,7 +51,7 @@ const Types = ({ filterItems }: ITypesProps) => {
51
51
  );
52
52
 
53
53
  return (
54
- <FloatingMenu isWide={true} Button={Header} position="left" closeOnSelect={true} isCheckGroup={true}>
54
+ <FloatingMenu Button={Header} position="left" closeOnSelect={true} isCheckGroup={true}>
55
55
  <ListTitle>Filter by types</ListTitle>
56
56
  <S.ChecksWrapper>
57
57
  <CheckGroup
@@ -101,11 +101,14 @@ const OptionTable = (props: IOptionTableProps): JSX.Element => {
101
101
  <S.Column>
102
102
  {filters.map((item: any, i: number) => {
103
103
  const displayFilteredOptions = () => state.selectedType !== item.type && displayOptions(item);
104
- const isSelected = item.value === state.selectedType ? "selected" : "";
104
+ const isSelected = item.value === state.selectedType;
105
+ const selectedClass = isSelected ? "selected" : "";
105
106
  return (
106
107
  <MenuItem key={`${item.type}${i}`}>
107
- <S.NavLink onClick={displayFilteredOptions} className={isSelected}>
108
- {item.label}
108
+ <S.NavLink onClick={displayFilteredOptions} className={selectedClass}>
109
+ <S.Link active={isSelected}>
110
+ {item.label}
111
+ </S.Link>
109
112
  </S.NavLink>
110
113
  </MenuItem>
111
114
  );
@@ -48,3 +48,7 @@ export const Thumbnail = styled.div<{backgroundUrl: string | boolean}>`
48
48
  min-width: calc(${p => p.theme.spacing.l} * 3);
49
49
  height: 100%;
50
50
  `;
51
+
52
+ export const Link = styled.div<{ active: boolean }>`
53
+ color: ${p => p.active ? p.theme.color.textHighEmphasis : p.theme.color.textMediumEmphasis};
54
+ `;
@@ -96,7 +96,7 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
96
96
  const SeoTitleMenu = () => {
97
97
  if (page.metaTitle) {
98
98
  return (
99
- <FloatingMenu isWide={true} Button={SeoItems.Title}>
99
+ <FloatingMenu Button={SeoItems.Title}>
100
100
  <S.FloatingSeo>{page.metaTitle}</S.FloatingSeo>
101
101
  </FloatingMenu>
102
102
  );
@@ -107,7 +107,7 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
107
107
  const SeoDescriptionMenu = () => {
108
108
  if (page.metaDescription) {
109
109
  return (
110
- <FloatingMenu isWide={true} Button={SeoItems.Description}>
110
+ <FloatingMenu Button={SeoItems.Description}>
111
111
  <S.FloatingSeo>{page.metaDescription}</S.FloatingSeo>
112
112
  </FloatingMenu>
113
113
  );
@@ -382,7 +382,7 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
382
382
  <S.ModDate>{`Mod. ${getHumanLastModifiedDate(page.modified)}`}</S.ModDate>
383
383
  </S.StatusCell>
384
384
  <S.TransCell role="cell">
385
- <FloatingMenu Button={FlagsButton} isWide={true}>
385
+ <FloatingMenu Button={FlagsButton}>
386
386
  {languageMenu()}
387
387
  </FloatingMenu>
388
388
  </S.TransCell>
@@ -169,9 +169,11 @@ const Content = (props: IProps): JSX.Element => {
169
169
  const getPages = (params: any, siteID: number, filterQuery?: any) => {
170
170
  const isStructuredDataPage = filter !== "unique-pages";
171
171
  if (filterQuery && !isStructuredDataPage) {
172
- const { deleted, page, itemsPerPage } = params;
173
- const query = filterQuery.concat(`&deleted=${deleted}&page=${page}&itemsPerPage=${itemsPerPage}`);
174
- getOrderedSitePages(siteID, query);
172
+ const { deleted, page, itemsPerPage, query } = params;
173
+ const fullQuery = filterQuery.concat(
174
+ `&deleted=${deleted}&page=${page}&itemsPerPage=${itemsPerPage}&query=${query}`
175
+ );
176
+ getOrderedSitePages(siteID, fullQuery);
175
177
  } else {
176
178
  const pageFilter = isStructuredDataPage ? filter : undefined;
177
179
  getSitePages(params, pageFilter);