@griddo/ax 11.11.7 → 11.11.8-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/config/jest/componentsMock.js +7 -5
  2. package/package.json +2 -2
  3. package/src/__tests__/components/Browser/Browser.test.tsx +438 -87
  4. package/src/__tests__/components/Browser/Browser.utils.test.ts +55 -0
  5. package/src/__tests__/components/ConfigPanel/ConfigPanel.test.tsx +1 -3
  6. package/src/__tests__/components/Fields/Button/Button.test.tsx +29 -27
  7. package/src/__tests__/components/HeadingsPreviewModal/ErrorsBanner/ErrorItem/ErrorItem.test.tsx +158 -0
  8. package/src/__tests__/components/HeadingsPreviewModal/ErrorsBanner/ErrorsBanner.test.tsx +90 -0
  9. package/src/__tests__/components/HeadingsPreviewModal/HeadingsPreviewModal.test.tsx +178 -0
  10. package/src/__tests__/components/HeadingsPreviewModal/HeadingsPreviewModal.utils.test.tsx +150 -0
  11. package/src/__tests__/components/KeywordsPreviewModal/KeywordItem/KeywordItem.test.tsx +91 -0
  12. package/src/__tests__/components/KeywordsPreviewModal/KeywordsPreviewModal.test.tsx +122 -0
  13. package/src/__tests__/components/KeywordsPreviewModal/KeywordsPreviewModal.utils.test.ts +15 -0
  14. package/src/__tests__/components/KeywordsPreviewModal/atoms.test.tsx +101 -0
  15. package/src/__tests__/components/ResizePanel/ResizePanel.test.tsx +1 -1
  16. package/src/__tests__/modules/FramePreview/FramePreview.test.tsx +318 -0
  17. package/src/__tests__/modules/FramePreview/FramePreview.utils.test.ts +242 -0
  18. package/src/__tests__/modules/FramePreview/HeadingsOverlay/HeadingsOverlay.test.tsx +185 -0
  19. package/src/components/Browser/index.tsx +294 -144
  20. package/src/components/Browser/style.tsx +75 -6
  21. package/src/components/Browser/utils.tsx +13 -0
  22. package/src/components/BrowserContent/index.tsx +2 -2
  23. package/src/components/Button/index.tsx +2 -1
  24. package/src/components/ConfigPanel/Form/ConnectedField/PageConnectedField/Field/index.tsx +2 -4
  25. package/src/components/Fields/AsyncSelect/style.tsx +13 -0
  26. package/src/components/Fields/FieldGroup/index.tsx +5 -2
  27. package/src/components/Fields/FieldGroup/style.tsx +32 -7
  28. package/src/components/Fields/HeadingField/index.tsx +2 -2
  29. package/src/components/Fields/HiddenField/style.tsx +1 -1
  30. package/src/components/Fields/NumberField/index.tsx +15 -16
  31. package/src/components/Fields/NumberField/style.tsx +2 -0
  32. package/src/components/Fields/ReferenceField/index.tsx +1 -1
  33. package/src/components/Fields/SEOPreview/index.tsx +36 -0
  34. package/src/components/Fields/SEOPreview/style.tsx +24 -0
  35. package/src/components/Fields/Select/index.tsx +5 -1
  36. package/src/components/Fields/Select/style.tsx +56 -0
  37. package/src/components/Fields/SummaryButton/index.tsx +18 -9
  38. package/src/components/Fields/SummaryButton/style.tsx +1 -2
  39. package/src/components/Fields/TagsField/index.tsx +8 -9
  40. package/src/components/Fields/UrlField/index.tsx +26 -27
  41. package/src/components/Fields/index.tsx +2 -0
  42. package/src/components/FloatingNote/index.tsx +35 -0
  43. package/src/components/FloatingNote/style.tsx +26 -0
  44. package/src/components/FloatingPanel/index.tsx +5 -2
  45. package/src/components/FloatingPanel/style.tsx +2 -1
  46. package/src/components/HeadingsPreviewModal/ErrorsBanner/ErrorItem/index.tsx +85 -0
  47. package/src/components/HeadingsPreviewModal/ErrorsBanner/ErrorItem/style.tsx +80 -0
  48. package/src/components/HeadingsPreviewModal/ErrorsBanner/index.tsx +57 -0
  49. package/src/components/HeadingsPreviewModal/ErrorsBanner/style.tsx +82 -0
  50. package/src/components/HeadingsPreviewModal/HeadingItem/index.tsx +71 -0
  51. package/src/components/HeadingsPreviewModal/HeadingItem/style.tsx +77 -0
  52. package/src/components/HeadingsPreviewModal/index.tsx +146 -0
  53. package/src/components/HeadingsPreviewModal/style.tsx +82 -0
  54. package/src/components/HeadingsPreviewModal/utils.tsx +257 -0
  55. package/src/components/IconAction/index.tsx +1 -1
  56. package/src/components/KeywordsPreviewModal/KeywordItem/index.tsx +46 -0
  57. package/src/components/KeywordsPreviewModal/KeywordItem/style.tsx +64 -0
  58. package/src/components/KeywordsPreviewModal/atoms.tsx +96 -0
  59. package/src/components/KeywordsPreviewModal/index.tsx +99 -0
  60. package/src/components/KeywordsPreviewModal/style.tsx +87 -0
  61. package/src/components/KeywordsPreviewModal/utils.tsx +22 -0
  62. package/src/components/MainWrapper/AppBar/index.tsx +8 -1
  63. package/src/components/MainWrapper/index.tsx +7 -1
  64. package/src/components/Notification/index.tsx +2 -2
  65. package/src/components/OcassionalToast/index.tsx +8 -1
  66. package/src/components/OcassionalToast/style.tsx +15 -1
  67. package/src/components/PageFinder/index.tsx +1 -1
  68. package/src/components/ResizePanel/index.tsx +4 -3
  69. package/src/components/ResizePanel/style.tsx +1 -1
  70. package/src/components/SearchField/style.tsx +2 -2
  71. package/src/components/SideModal/index.tsx +2 -1
  72. package/src/components/Tabs/index.tsx +13 -4
  73. package/src/components/Tabs/style.tsx +7 -8
  74. package/src/components/Toast/index.tsx +4 -2
  75. package/src/components/Tooltip/index.tsx +4 -3
  76. package/src/components/index.tsx +8 -2
  77. package/src/forms/fields.tsx +70 -68
  78. package/src/hooks/forms.tsx +22 -1
  79. package/src/hooks/index.tsx +13 -3
  80. package/src/hooks/modals.tsx +103 -15
  81. package/src/hooks/users.tsx +25 -8
  82. package/src/modules/Forms/atoms.tsx +2 -2
  83. package/src/modules/FramePreview/HeadingsOverlay/index.tsx +113 -0
  84. package/src/modules/FramePreview/HeadingsOverlay/style.tsx +24 -0
  85. package/src/modules/FramePreview/index.tsx +55 -16
  86. package/src/modules/FramePreview/style.tsx +34 -2
  87. package/src/modules/FramePreview/utils.tsx +140 -0
  88. package/src/modules/GlobalEditor/Editor/index.tsx +37 -3
  89. package/src/modules/GlobalEditor/PageBrowser/index.tsx +19 -2
  90. package/src/modules/GlobalEditor/Preview/index.tsx +0 -2
  91. package/src/modules/GlobalEditor/Preview/style.tsx +1 -1
  92. package/src/modules/GlobalEditor/index.tsx +119 -57
  93. package/src/modules/PageEditor/Editor/index.tsx +33 -2
  94. package/src/modules/PageEditor/PageBrowser/index.tsx +20 -2
  95. package/src/modules/PageEditor/Preview/index.tsx +0 -2
  96. package/src/modules/PageEditor/Preview/style.tsx +1 -1
  97. package/src/modules/PageEditor/atoms.tsx +1 -1
  98. package/src/modules/PageEditor/index.tsx +130 -66
  99. package/src/modules/PublicPreview/index.tsx +8 -5
  100. package/src/schemas/pages/GlobalPage.ts +87 -70
  101. package/src/schemas/pages/Page.ts +87 -70
  102. package/src/types/index.tsx +12 -0
  103. package/src/components/PageInfoBanner/index.tsx +0 -38
  104. package/src/components/PageInfoBanner/styles.tsx +0 -40
@@ -59,93 +59,110 @@ export default {
59
59
  collapsed: true,
60
60
  fields: [
61
61
  {
62
- title: "",
63
- type: "SummaryButton",
64
- key: "summary",
65
- },
66
- {
67
- title: "Meta title",
68
- type: "TextField",
69
- key: "metaTitle",
70
- },
71
- {
72
- title: "Meta description",
73
- type: "TextArea",
74
- key: "metaDescription",
75
- },
76
- {
77
- title: "Keywords",
78
- type: "TagsField",
79
- key: "metaKeywords",
80
- },
81
- {
82
- title: "Canonical URL",
83
- type: "TextField",
84
- key: "canonicalURL",
62
+ title: "SEO previews",
63
+ type: "FieldGroup",
64
+ key: "seopreviews",
65
+ collapsed: true,
66
+ solid: true,
67
+ fields: [{ title: "", type: "SEOPreview", key: "seoPreview" }],
85
68
  },
86
69
  {
87
- title: "Meta robots index",
88
- type: "RadioGroup",
89
- key: "isIndexed",
90
- options: [
91
- {
92
- value: true,
93
- title: "Index",
94
- name: "index",
95
- },
70
+ title: "SEO meta data",
71
+ type: "FieldGroup",
72
+ key: "metadata",
73
+ collapsed: true,
74
+ solid: true,
75
+ fields: [
96
76
  {
97
- value: false,
98
- title: "No index",
99
- name: "noindex",
77
+ title: "",
78
+ type: "SummaryButton",
79
+ key: "summary",
100
80
  },
101
- ],
102
- },
103
- {
104
- title: "Meta robots follow",
105
- type: "RadioGroup",
106
- key: "follow",
107
- options: [
108
81
  {
109
- value: true,
110
- title: "Follow",
111
- name: "follow",
82
+ title: "Meta title",
83
+ type: "TextField",
84
+ key: "metaTitle",
112
85
  },
113
86
  {
114
- value: false,
115
- title: "No follow",
116
- name: "nofollow",
87
+ title: "Meta description",
88
+ type: "TextArea",
89
+ key: "metaDescription",
117
90
  },
118
- ],
119
- },
120
- {
121
- title: "Meta robots advanced",
122
- type: "CheckGroup",
123
- key: "metasAdvanced",
124
- options: [
125
91
  {
126
- value: "noimageindex",
127
- title: "No image index",
128
- name: "noimage",
92
+ title: "Keywords",
93
+ type: "TagsField",
94
+ key: "metaKeywords",
129
95
  },
130
96
  {
131
- value: "nosnippet",
132
- title: "No snippet",
133
- name: "nosnippet",
97
+ title: "Canonical URL",
98
+ type: "TextField",
99
+ key: "canonicalURL",
134
100
  },
135
101
  {
136
- value: "noodp",
137
- title: "No ODP",
138
- name: "noodp",
102
+ title: "Meta robots index",
103
+ type: "RadioGroup",
104
+ key: "isIndexed",
105
+ options: [
106
+ {
107
+ value: true,
108
+ title: "Index",
109
+ name: "index",
110
+ },
111
+ {
112
+ value: false,
113
+ title: "No index",
114
+ name: "noindex",
115
+ },
116
+ ],
139
117
  },
140
118
  {
141
- value: "noarchive",
142
- title: "No archive",
143
- name: "noarchive",
119
+ title: "Meta robots follow",
120
+ type: "RadioGroup",
121
+ key: "follow",
122
+ options: [
123
+ {
124
+ value: true,
125
+ title: "Follow",
126
+ name: "follow",
127
+ },
128
+ {
129
+ value: false,
130
+ title: "No follow",
131
+ name: "nofollow",
132
+ },
133
+ ],
144
134
  },
145
135
  {
146
- value: "noTranslate",
147
- title: "No translate",
148
- name: "noTranslate",
136
+ title: "Meta robots advanced",
137
+ type: "CheckGroup",
138
+ key: "metasAdvanced",
139
+ options: [
140
+ {
141
+ value: "noimageindex",
142
+ title: "No image index",
143
+ name: "noimage",
144
+ },
145
+ {
146
+ value: "nosnippet",
147
+ title: "No snippet",
148
+ name: "nosnippet",
149
+ },
150
+ {
151
+ value: "noodp",
152
+ title: "No ODP",
153
+ name: "noodp",
154
+ },
155
+ {
156
+ value: "noarchive",
157
+ title: "No archive",
158
+ name: "noarchive",
159
+ },
160
+ {
161
+ value: "noTranslate",
162
+ title: "No translate",
163
+ name: "noTranslate",
164
+ },
165
+ ],
149
166
  },
150
167
  ],
151
168
  },
@@ -125,93 +125,110 @@ export default {
125
125
  collapsed: true,
126
126
  fields: [
127
127
  {
128
- title: "",
129
- type: "SummaryButton",
130
- key: "summary",
131
- },
132
- {
133
- title: "Meta title",
134
- type: "TextField",
135
- key: "metaTitle",
136
- },
137
- {
138
- title: "Meta description",
139
- type: "TextArea",
140
- key: "metaDescription",
141
- },
142
- {
143
- title: "Keywords",
144
- type: "TagsField",
145
- key: "metaKeywords",
146
- },
147
- {
148
- title: "Canonical URL",
149
- type: "TextField",
150
- key: "canonicalURL",
128
+ title: "SEO previews",
129
+ type: "FieldGroup",
130
+ key: "seopreviews",
131
+ collapsed: true,
132
+ solid: true,
133
+ fields: [{ title: "", type: "SEOPreview", key: "seoPreview" }],
151
134
  },
152
135
  {
153
- title: "Meta robots index",
154
- type: "RadioGroup",
155
- key: "isIndexed",
156
- options: [
157
- {
158
- value: true,
159
- title: "Index",
160
- name: "index",
161
- },
136
+ title: "SEO meta data",
137
+ type: "FieldGroup",
138
+ key: "metadata",
139
+ collapsed: true,
140
+ solid: true,
141
+ fields: [
162
142
  {
163
- value: false,
164
- title: "No index",
165
- name: "noindex",
143
+ title: "",
144
+ type: "SummaryButton",
145
+ key: "summary",
166
146
  },
167
- ],
168
- },
169
- {
170
- title: "Meta robots follow",
171
- type: "RadioGroup",
172
- key: "follow",
173
- options: [
174
147
  {
175
- value: true,
176
- title: "Follow",
177
- name: "follow",
148
+ title: "Meta title",
149
+ type: "TextField",
150
+ key: "metaTitle",
178
151
  },
179
152
  {
180
- value: false,
181
- title: "No follow",
182
- name: "nofollow",
153
+ title: "Meta description",
154
+ type: "TextArea",
155
+ key: "metaDescription",
183
156
  },
184
- ],
185
- },
186
- {
187
- title: "Meta robots advanced",
188
- type: "CheckGroup",
189
- key: "metasAdvanced",
190
- options: [
191
157
  {
192
- value: "noimageindex",
193
- title: "No image index",
194
- name: "noimage",
158
+ title: "Keywords",
159
+ type: "TagsField",
160
+ key: "metaKeywords",
195
161
  },
196
162
  {
197
- value: "nosnippet",
198
- title: "No snippet",
199
- name: "nosnippet",
163
+ title: "Canonical URL",
164
+ type: "TextField",
165
+ key: "canonicalURL",
200
166
  },
201
167
  {
202
- value: "noodp",
203
- title: "No ODP",
204
- name: "noodp",
168
+ title: "Meta robots index",
169
+ type: "RadioGroup",
170
+ key: "isIndexed",
171
+ options: [
172
+ {
173
+ value: true,
174
+ title: "Index",
175
+ name: "index",
176
+ },
177
+ {
178
+ value: false,
179
+ title: "No index",
180
+ name: "noindex",
181
+ },
182
+ ],
205
183
  },
206
184
  {
207
- value: "noarchive",
208
- title: "No archive",
209
- name: "noarchive",
185
+ title: "Meta robots follow",
186
+ type: "RadioGroup",
187
+ key: "follow",
188
+ options: [
189
+ {
190
+ value: true,
191
+ title: "Follow",
192
+ name: "follow",
193
+ },
194
+ {
195
+ value: false,
196
+ title: "No follow",
197
+ name: "nofollow",
198
+ },
199
+ ],
210
200
  },
211
201
  {
212
- value: "noTranslate",
213
- title: "No translate",
214
- name: "noTranslate",
202
+ title: "Meta robots advanced",
203
+ type: "CheckGroup",
204
+ key: "metasAdvanced",
205
+ options: [
206
+ {
207
+ value: "noimageindex",
208
+ title: "No image index",
209
+ name: "noimage",
210
+ },
211
+ {
212
+ value: "nosnippet",
213
+ title: "No snippet",
214
+ name: "nosnippet",
215
+ },
216
+ {
217
+ value: "noodp",
218
+ title: "No ODP",
219
+ name: "noodp",
220
+ },
221
+ {
222
+ value: "noarchive",
223
+ title: "No archive",
224
+ name: "noarchive",
225
+ },
226
+ {
227
+ value: "noTranslate",
228
+ title: "No translate",
229
+ name: "noTranslate",
230
+ },
231
+ ],
215
232
  },
216
233
  ],
217
234
  },
@@ -1118,6 +1118,18 @@ export interface IContainedComponent {
1118
1118
  componentID: number;
1119
1119
  }
1120
1120
 
1121
+ export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
1122
+
1123
+ export interface HeadingNode {
1124
+ level: HeadingLevel;
1125
+ tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
1126
+ text: string;
1127
+ isHidden: boolean;
1128
+ children: HeadingNode[];
1129
+ }
1130
+
1131
+ export type HeadingFilter = "all" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
1132
+
1121
1133
  export type Field =
1122
1134
  | "AsyncCheckGroup"
1123
1135
  | "AsyncSelect"
@@ -1,38 +0,0 @@
1
- import { Icon } from "@ax/components";
2
-
3
- import * as S from "./styles";
4
-
5
- const PageInfoBanner = (props: PageInfoBannerProps) => {
6
- const { message, actionLabel, onAction, onDismiss, icon = "view" } = props;
7
-
8
- return (
9
- <S.Container>
10
- <S.Header>
11
- <S.Info>
12
- <Icon name={icon} size="16px" />
13
- {message}{" "}
14
- {onAction && (
15
- <button type="button" onClick={onAction}>
16
- <strong style={{ textDecoration: "underline" }}>{actionLabel}</strong>
17
- </button>
18
- )}
19
- {onDismiss && (
20
- <S.DismissButton type="button" onClick={onDismiss}>
21
- <Icon name="close" size="16px" />
22
- </S.DismissButton>
23
- )}
24
- </S.Info>
25
- </S.Header>
26
- </S.Container>
27
- );
28
- };
29
-
30
- interface PageInfoBannerProps {
31
- message: string;
32
- actionLabel?: string;
33
- onAction?: () => void;
34
- onDismiss?: () => void;
35
- icon?: string;
36
- }
37
-
38
- export default PageInfoBanner;
@@ -1,40 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- const Container = styled.div`
4
- left: 0px;
5
- bottom: ${(p) => p.theme.spacing.s};
6
- width: 100vw;
7
- display: flex;
8
- position: fixed;
9
- z-index: 100;
10
- justify-content: center;
11
- align-items: center;
12
- `;
13
-
14
- const Header = styled.span`
15
- ${({ theme }) => theme.textStyle.uiS}
16
- border-radius: ${(p) => p.theme.radii.s};
17
- background-color: ${(p) => p.theme.color.uiBackground04};
18
- color: ${(p) => p.theme.color.textHighEmphasisInverse};
19
- padding: ${(p) => p.theme.spacing.s};
20
- svg {
21
- path {
22
- fill: ${(p) => p.theme.color.textHighEmphasisInverse};
23
- }
24
- }
25
- `;
26
-
27
- const Info = styled.div`
28
- display: flex;
29
- align-items: center;
30
- column-gap: ${(p) => p.theme.spacing.xs};
31
- `;
32
-
33
- const DismissButton = styled.button`
34
- background: none;
35
- border: none;
36
- color: inherit;
37
- cursor: pointer;
38
- `;
39
-
40
- export { Container, DismissButton, Header, Info };