ordering-ui-admin-external 1.24.2 → 1.25.0

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 (228) hide show
  1. package/_bundles/main.css +12158 -12158
  2. package/_bundles/{ordering-ui-admin.0c354f3e7da49f56465b.js → ordering-ui-admin.f2522b983a000252b407.js} +2 -2
  3. package/_modules/components/CartRecovery/RecoveryActionAdd/index.js +16 -3
  4. package/_modules/components/CartRecovery/RecoveryActionAdd/styles.js +65 -0
  5. package/_modules/components/CartRecovery/RecoveryActionList/index.js +1 -1
  6. package/_modules/components/CartRecovery/RecoveryActionList/styles.js +3 -7
  7. package/_modules/components/CartRecovery/RecoveryActionListing/index.js +21 -2
  8. package/_modules/components/CartRecovery/RecoveryActionListing/styles.js +1 -1
  9. package/_modules/components/CartRecovery/RecoveryNotificationList/index.js +6 -2
  10. package/_modules/components/CartRecovery/RecoveryNotificationList/styles.js +3 -7
  11. package/_modules/components/CartRecovery/SingleRecoveryNotification/index.js +67 -21
  12. package/_modules/components/CartRecovery/SingleRecoveryNotification/styles.js +1 -1
  13. package/_modules/components/CartRecovery/index.js +8 -1
  14. package/_modules/components/Delivery/DriversCompaniesList/index.js +1 -1
  15. package/_modules/components/Delivery/DriversCompaniesList/styles.js +3 -7
  16. package/_modules/components/Delivery/DriversGroupsList/index.js +1 -1
  17. package/_modules/components/Delivery/DriversGroupsList/styles.js +3 -10
  18. package/_modules/components/Delivery/UsersList/index.js +1 -1
  19. package/_modules/components/Delivery/UsersList/styles.js +8 -15
  20. package/_modules/components/Marketing/CampaignList/index.js +1 -1
  21. package/_modules/components/Marketing/CampaignList/styles.js +3 -7
  22. package/_modules/components/Marketing/EnterprisePromotionDetails/index.js +1 -0
  23. package/_modules/components/Marketing/EnterprisePromotionList/index.js +1 -1
  24. package/_modules/components/Marketing/EnterprisePromotionList/styles.js +4 -8
  25. package/_modules/components/Marketing/EnterprisePromotionListing/index.js +9 -1
  26. package/_modules/components/Marketing/EnterprisePromotionRules/index.js +7 -2
  27. package/_modules/components/Messages/MessagesListing/index.js +8 -2
  28. package/_modules/components/MyProducts/ContentForm/index.js +0 -1
  29. package/_modules/components/OrderingProducts/OrderingProductsListing/index.js +1 -1
  30. package/_modules/components/OrderingProducts/OrderingProductsListing/styles.js +7 -11
  31. package/_modules/components/Orders/DeliveriesManager/index.js +1 -0
  32. package/_modules/components/Orders/DriversList/index.js +10 -9
  33. package/_modules/components/Orders/DriversList/styles.js +9 -16
  34. package/_modules/components/Orders/Logistics/index.js +15 -7
  35. package/_modules/components/Orders/Logistics/styles.js +1 -1
  36. package/_modules/components/Orders/OrderDetails/index.js +15 -13
  37. package/_modules/components/Orders/OrderDetailsHeader/index.js +7 -12
  38. package/_modules/components/Orders/OrderNotification/index.js +33 -1
  39. package/_modules/components/Orders/OrdersCards/index.js +11 -10
  40. package/_modules/components/Orders/OrdersCards/styles.js +1 -1
  41. package/_modules/components/Orders/OrdersTable/index.js +10 -9
  42. package/_modules/components/Settings/Cms/index.js +1 -1
  43. package/_modules/components/Settings/Cms/styles.js +3 -7
  44. package/_modules/components/Settings/CountriesList/index.js +1 -1
  45. package/_modules/components/Settings/CountriesList/styles.js +3 -7
  46. package/_modules/components/Settings/DropdownOptionList/index.js +1 -1
  47. package/_modules/components/Settings/DropdownOptionList/styles.js +3 -7
  48. package/_modules/components/Settings/LanguageTransTable/index.js +7 -6
  49. package/_modules/components/Settings/LanguageTransTable/styles.js +3 -7
  50. package/_modules/components/Settings/PlaceListing/index.js +1 -1
  51. package/_modules/components/Settings/PlaceListing/styles.js +3 -7
  52. package/_modules/components/Settings/SettingsList/index.js +1 -1
  53. package/_modules/components/Shared/HtmlEditor/InsertImage/index.js +202 -0
  54. package/_modules/components/Shared/HtmlEditor/InsertImage/styles.js +36 -0
  55. package/_modules/components/Shared/HtmlEditor/InsertLink/index.js +75 -0
  56. package/_modules/components/Shared/HtmlEditor/InsertLink/styles.js +16 -0
  57. package/_modules/components/Shared/HtmlEditor/InsertVideo/index.js +56 -0
  58. package/_modules/components/Shared/HtmlEditor/InsertVideo/styles.js +14 -0
  59. package/_modules/components/Shared/HtmlEditor/index.js +181 -0
  60. package/_modules/components/Shared/HtmlEditor/styles.js +18 -0
  61. package/_modules/components/Shared/index.js +7 -0
  62. package/_modules/components/Stores/BusinessBrandListing/index.js +1 -1
  63. package/_modules/components/Stores/BusinessBrandListing/styles.js +3 -6
  64. package/_modules/components/Stores/BusinessDeliveryPickupMore/styles.js +1 -1
  65. package/_modules/components/Stores/BusinessDeliveryZoneList/index.js +2 -2
  66. package/_modules/components/Stores/BusinessDeliveryZoneList/styles.js +4 -8
  67. package/_modules/components/Stores/BusinessDetail/styles.js +2 -2
  68. package/_modules/components/Stores/BusinessDetails/index.js +24 -25
  69. package/_modules/components/Stores/BusinessDeviceListing/index.js +1 -1
  70. package/_modules/components/Stores/BusinessDeviceListing/styles.js +1 -4
  71. package/_modules/components/Stores/BusinessMenu/index.js +2 -2
  72. package/_modules/components/Stores/BusinessMenu/styles.js +3 -5
  73. package/_modules/components/Stores/BusinessPlaceGroup/index.js +2 -2
  74. package/_modules/components/Stores/BusinessPlaceGroup/styles.js +3 -7
  75. package/_modules/components/Stores/BusinessPlaceGroupList/index.js +2 -2
  76. package/_modules/components/Stores/BusinessPlaceGroupList/styles.js +3 -7
  77. package/_modules/components/Stores/BusinessProductList/index.js +7 -6
  78. package/_modules/components/Stores/BusinessProductList/styles.js +3 -5
  79. package/_modules/components/Stores/BusinessProductsCategories/index.js +6 -5
  80. package/_modules/components/Stores/BusinessProductsCategories/styles.js +3 -6
  81. package/_modules/components/Stores/BusinessProductsListing/index.js +9 -6
  82. package/_modules/components/Stores/BusinessPromotionList/index.js +2 -2
  83. package/_modules/components/Stores/BusinessPromotionList/styles.js +3 -5
  84. package/_modules/components/Stores/BusinessSummary/index.js +7 -12
  85. package/_modules/components/Stores/BusinessesList/index.js +7 -4
  86. package/_modules/components/Stores/BusinessesList/styles.js +12 -16
  87. package/_modules/components/Stores/BusinessesListing/index.js +4 -2
  88. package/_modules/components/Stores/ImportersButton/index.js +2 -0
  89. package/_modules/components/Stores/ImportersList/index.js +1 -1
  90. package/_modules/components/Stores/ImportersList/styles.js +4 -9
  91. package/_modules/components/Stores/ProductDetails/index.js +19 -20
  92. package/_modules/components/Stores/ProductExtraOptionDetails/index.js +1 -1
  93. package/_modules/components/Stores/ProductExtraOptionDetails/styles.js +1 -5
  94. package/_modules/components/Stores/ProductExtras/index.js +2 -2
  95. package/_modules/components/Stores/ProductExtras/styles.js +3 -7
  96. package/_modules/components/Stores/ProductIngredient/index.js +2 -2
  97. package/_modules/components/Stores/ProductIngredient/styles.js +3 -7
  98. package/_modules/components/Stores/ProductStep/index.js +13 -7
  99. package/_modules/components/Stores/ProductSummary/index.js +2 -8
  100. package/_modules/components/Stores/ProductTagsList/index.js +2 -2
  101. package/_modules/components/Stores/ProductTagsList/styles.js +1 -5
  102. package/_modules/components/Stores/RestaurantSelectGuide/index.js +18 -9
  103. package/_modules/components/Stores/SeoOptions/index.js +25 -10
  104. package/_modules/components/Stores/SingleBusiness/index.js +18 -11
  105. package/_modules/components/Users/CustomerDetails/index.js +6 -7
  106. package/_modules/components/Users/CustomersListing/index.js +10 -4
  107. package/_modules/components/Users/ProfessionalList/index.js +1 -1
  108. package/_modules/components/Users/ProfessionalList/styles.js +8 -12
  109. package/_modules/components/Users/UsersList/index.js +1 -1
  110. package/_modules/components/Users/UsersList/styles.js +11 -15
  111. package/_modules/index.js +6 -0
  112. package/_modules/styles/Buttons/index.js +11 -4
  113. package/_modules/styles/index.js +6 -0
  114. package/index-template.js +1 -1
  115. package/package.json +2 -2
  116. package/src/components/CartRecovery/RecoveryActionAdd/index.js +13 -3
  117. package/src/components/CartRecovery/RecoveryActionAdd/styles.js +179 -0
  118. package/src/components/CartRecovery/RecoveryActionList/index.js +4 -5
  119. package/src/components/CartRecovery/RecoveryActionList/styles.js +0 -6
  120. package/src/components/CartRecovery/RecoveryActionListing/index.js +25 -6
  121. package/src/components/CartRecovery/RecoveryActionListing/styles.js +2 -1
  122. package/src/components/CartRecovery/RecoveryNotificationList/index.js +7 -3
  123. package/src/components/CartRecovery/RecoveryNotificationList/styles.js +5 -13
  124. package/src/components/CartRecovery/SingleRecoveryNotification/index.js +91 -42
  125. package/src/components/CartRecovery/SingleRecoveryNotification/styles.js +2 -2
  126. package/src/components/CartRecovery/index.js +3 -1
  127. package/src/components/Delivery/DriversCompaniesList/index.js +3 -4
  128. package/src/components/Delivery/DriversCompaniesList/styles.js +0 -6
  129. package/src/components/Delivery/DriversGroupsList/index.js +3 -4
  130. package/src/components/Delivery/DriversGroupsList/styles.js +0 -12
  131. package/src/components/Delivery/UsersList/index.js +3 -4
  132. package/src/components/Delivery/UsersList/styles.js +0 -12
  133. package/src/components/Marketing/CampaignList/index.js +3 -4
  134. package/src/components/Marketing/CampaignList/styles.js +0 -6
  135. package/src/components/Marketing/EnterprisePromotionDetails/index.js +1 -0
  136. package/src/components/Marketing/EnterprisePromotionList/index.js +3 -4
  137. package/src/components/Marketing/EnterprisePromotionList/styles.js +0 -7
  138. package/src/components/Marketing/EnterprisePromotionListing/index.js +6 -1
  139. package/src/components/Marketing/EnterprisePromotionRules/index.js +7 -2
  140. package/src/components/Messages/MessagesListing/index.js +3 -0
  141. package/src/components/MyProducts/ContentForm/index.js +0 -1
  142. package/src/components/OrderingProducts/OrderingProductsListing/index.js +3 -4
  143. package/src/components/OrderingProducts/OrderingProductsListing/styles.js +0 -7
  144. package/src/components/Orders/DeliveriesManager/index.js +1 -0
  145. package/src/components/Orders/DriversList/index.js +4 -4
  146. package/src/components/Orders/DriversList/styles.js +0 -10
  147. package/src/components/Orders/Logistics/index.js +10 -1
  148. package/src/components/Orders/Logistics/styles.js +6 -0
  149. package/src/components/Orders/OrderDetails/index.js +11 -13
  150. package/src/components/Orders/OrderDetailsHeader/index.js +40 -43
  151. package/src/components/Orders/OrderNotification/index.js +19 -1
  152. package/src/components/Orders/OrdersCards/index.js +7 -7
  153. package/src/components/Orders/OrdersCards/styles.js +3 -1
  154. package/src/components/Orders/OrdersTable/index.js +8 -8
  155. package/src/components/Settings/Cms/index.js +4 -5
  156. package/src/components/Settings/Cms/styles.js +0 -6
  157. package/src/components/Settings/CountriesList/index.js +4 -5
  158. package/src/components/Settings/CountriesList/styles.js +0 -6
  159. package/src/components/Settings/DropdownOptionList/index.js +4 -5
  160. package/src/components/Settings/DropdownOptionList/styles.js +0 -6
  161. package/src/components/Settings/LanguageTransTable/index.js +4 -4
  162. package/src/components/Settings/LanguageTransTable/styles.js +0 -6
  163. package/src/components/Settings/PlaceListing/index.js +4 -5
  164. package/src/components/Settings/PlaceListing/styles.js +0 -6
  165. package/src/components/Settings/SettingsList/index.js +88 -88
  166. package/src/components/Shared/HtmlEditor/InsertImage/index.js +172 -0
  167. package/src/components/Shared/HtmlEditor/InsertImage/styles.js +136 -0
  168. package/src/components/Shared/HtmlEditor/InsertLink/index.js +73 -0
  169. package/src/components/Shared/HtmlEditor/InsertLink/styles.js +34 -0
  170. package/src/components/Shared/HtmlEditor/InsertVideo/index.js +51 -0
  171. package/src/components/Shared/HtmlEditor/InsertVideo/styles.js +23 -0
  172. package/src/components/Shared/HtmlEditor/index.js +172 -0
  173. package/src/components/Shared/HtmlEditor/styles.js +30 -0
  174. package/src/components/Shared/index.js +3 -1
  175. package/src/components/Stores/BusinessBrandListing/index.js +2 -2
  176. package/src/components/Stores/BusinessBrandListing/styles.js +0 -7
  177. package/src/components/Stores/BusinessDeliveryPickupMore/styles.js +0 -4
  178. package/src/components/Stores/BusinessDeliveryZoneList/index.js +9 -7
  179. package/src/components/Stores/BusinessDeliveryZoneList/styles.js +1 -11
  180. package/src/components/Stores/BusinessDetail/styles.js +1 -4
  181. package/src/components/Stores/BusinessDetails/index.js +12 -17
  182. package/src/components/Stores/BusinessDeviceListing/index.js +2 -2
  183. package/src/components/Stores/BusinessDeviceListing/styles.js +0 -7
  184. package/src/components/Stores/BusinessMenu/index.js +9 -7
  185. package/src/components/Stores/BusinessMenu/styles.js +1 -6
  186. package/src/components/Stores/BusinessPlaceGroup/index.js +7 -3
  187. package/src/components/Stores/BusinessPlaceGroup/styles.js +1 -12
  188. package/src/components/Stores/BusinessPlaceGroupList/index.js +5 -3
  189. package/src/components/Stores/BusinessPlaceGroupList/styles.js +1 -12
  190. package/src/components/Stores/BusinessProductList/index.js +9 -6
  191. package/src/components/Stores/BusinessProductList/styles.js +1 -6
  192. package/src/components/Stores/BusinessProductsCategories/index.js +10 -7
  193. package/src/components/Stores/BusinessProductsCategories/styles.js +1 -6
  194. package/src/components/Stores/BusinessProductsListing/index.js +5 -2
  195. package/src/components/Stores/BusinessPromotionList/index.js +7 -5
  196. package/src/components/Stores/BusinessPromotionList/styles.js +1 -5
  197. package/src/components/Stores/BusinessSummary/index.js +4 -7
  198. package/src/components/Stores/BusinessesList/index.js +7 -5
  199. package/src/components/Stores/BusinessesList/styles.js +0 -8
  200. package/src/components/Stores/BusinessesListing/index.js +3 -1
  201. package/src/components/Stores/ImportersButton/index.js +2 -0
  202. package/src/components/Stores/ImportersList/index.js +3 -4
  203. package/src/components/Stores/ImportersList/styles.js +1 -13
  204. package/src/components/Stores/ProductDetails/index.js +12 -16
  205. package/src/components/Stores/ProductExtraOptionDetails/index.js +3 -3
  206. package/src/components/Stores/ProductExtraOptionDetails/styles.js +0 -9
  207. package/src/components/Stores/ProductExtras/index.js +9 -7
  208. package/src/components/Stores/ProductExtras/styles.js +1 -8
  209. package/src/components/Stores/ProductIngredient/index.js +9 -7
  210. package/src/components/Stores/ProductIngredient/styles.js +1 -8
  211. package/src/components/Stores/ProductStep/index.js +25 -4
  212. package/src/components/Stores/ProductSummary/index.js +3 -7
  213. package/src/components/Stores/ProductTagsList/index.js +7 -5
  214. package/src/components/Stores/ProductTagsList/styles.js +0 -7
  215. package/src/components/Stores/RestaurantSelectGuide/index.js +54 -24
  216. package/src/components/Stores/SeoOptions/index.js +15 -1
  217. package/src/components/Stores/SingleBusiness/index.js +9 -3
  218. package/src/components/Users/CustomerDetails/index.js +6 -8
  219. package/src/components/Users/CustomersListing/index.js +4 -1
  220. package/src/components/Users/ProfessionalList/index.js +3 -4
  221. package/src/components/Users/ProfessionalList/styles.js +0 -7
  222. package/src/components/Users/UsersList/index.js +3 -4
  223. package/src/components/Users/UsersList/styles.js +0 -7
  224. package/src/index.js +2 -1
  225. package/src/styles/Buttons/index.js +15 -1
  226. package/src/styles/index.js +2 -1
  227. package/template/pages/Login/index.js +2 -4
  228. /package/_bundles/{ordering-ui-admin.0c354f3e7da49f56465b.js.LICENSE.txt → ordering-ui-admin.f2522b983a000252b407.js.LICENSE.txt} +0 -0
@@ -0,0 +1,136 @@
1
+ import styled from 'styled-components'
2
+
3
+ export const InsertImageContainer = styled.div`
4
+ h1 {
5
+ font-size: 20px;
6
+ font-weight: 700;
7
+ margin-bottom: 25px;
8
+ }
9
+ > button {
10
+ height: 42px;
11
+ }
12
+ `
13
+
14
+ export const ImageListContainer = styled.div`
15
+ display: flex;
16
+ flex-wrap: wrap;
17
+ justify-content: center;
18
+ margin-top: 20px;
19
+ `
20
+
21
+ export const WrapperImage = styled.div`
22
+ margin: 5px;
23
+ cursor: pointer;
24
+ transition: all 250ms;
25
+ position: relative;
26
+
27
+ &:hover {
28
+ transform: scale(1.1);
29
+ }
30
+ img {
31
+ height: 120px;
32
+ background-color: #CCC;
33
+ }
34
+ `
35
+
36
+ export const CloseButton = styled.div`
37
+ position: absolute;
38
+ cursor: pointer;
39
+ top: 5px;
40
+ margin: 0 5px;
41
+ border-radius: 50%;
42
+ background-color: #E63757;
43
+ width: 24px;
44
+ height: 24px;
45
+ padding: 0 5px;
46
+ svg {
47
+ color: #FFF;
48
+ font-size: 14px;
49
+ }
50
+ `
51
+
52
+ export const WrapperInput = styled.div`
53
+ display: flex;
54
+ flex-direction: column;
55
+ margin-bottom: 20px;
56
+
57
+ label {
58
+ font-size: 14px;
59
+ }
60
+ `
61
+
62
+ export const NewImage = styled.div`
63
+ display: flex;
64
+ flex-direction: column;
65
+ justify-content: flex-start;
66
+ align-items: center;
67
+ width: 100%;
68
+ margin: 20px auto;
69
+
70
+ @media (min-width: 768px){
71
+ width: auto;
72
+ }
73
+ `
74
+
75
+ export const Image = styled.div`
76
+ width: 100%;
77
+ height: 130px;
78
+ border-radius: 8px;
79
+ overflow: hidden;
80
+ background: ${({ isImage, theme }) => isImage ? '#FFF' : `${theme.colors.backgroundPage}`};
81
+ cursor: -webkit-grab;
82
+ cursor: grab;
83
+ filter: drop-shadow(0px 1px 4px rgba(0, 0, 0, 0.1));
84
+
85
+ img,
86
+ div {
87
+ width: 100%;
88
+ border-radius: 8px;
89
+ height: 100%;
90
+ overflow: hidden;
91
+ };
92
+
93
+ img{
94
+ object-fit: cover;
95
+ }
96
+ `
97
+
98
+ export const Camera = styled.div`
99
+ > * {
100
+ margin-top: 10px;
101
+ width: 30px;
102
+ height: 30px;
103
+ }
104
+ `
105
+
106
+ export const UploadImageIconContainer = styled.div`
107
+ position: absolute;
108
+ top: 0px;
109
+ background: rgba(0,0,0,0.2);
110
+ padding: 4px;
111
+ `
112
+
113
+ export const UploadImageIcon = styled.div`
114
+ display: flex;
115
+ justify-content: center;
116
+ align-items: center;
117
+ flex-direction: column;
118
+ color: #FFF;
119
+ border: 1px dashed #fff;
120
+ span {
121
+ margin: 0;
122
+ }
123
+
124
+ svg {
125
+ width: 45px;
126
+ height: 45px;
127
+ }
128
+ `
129
+
130
+ export const SkeletonWrapper = styled.div`
131
+ span{
132
+ height: 100%;
133
+ position: relative;
134
+ top: -2.5px;
135
+ }
136
+ `
@@ -0,0 +1,73 @@
1
+ import React, { useState } from 'react'
2
+ import { useLanguage } from 'ordering-components-admin-external'
3
+ import { Button, Checkbox, Input } from '../../../../styles'
4
+
5
+ import {
6
+ InsertLinkContainer,
7
+ WrapperInput,
8
+ CheckboxWrapper
9
+ } from './styles'
10
+
11
+ export const InsertLink = (props) => {
12
+ const {
13
+ editorContext,
14
+ onClose,
15
+ handleRestoreEditor,
16
+ isLinkButton
17
+ } = props
18
+ const [, t] = useLanguage()
19
+ const [changesState, setChangesState] = useState({})
20
+
21
+ const handleChangeInput = (e) => {
22
+ setChangesState({
23
+ ...changesState,
24
+ [e.target.name]: e.target.value
25
+ })
26
+ }
27
+
28
+ const handleInsertClick = () => {
29
+ handleRestoreEditor()
30
+ editorContext.invoke('editor.createLink', {
31
+ text: isLinkButton
32
+ ? `<button style='font-size: 9px;color: white;padding: 6px 11px; cursor: pointer; border-radius: 4px; background: #2C7BE5; border: none;'>${changesState?.text || 'button'}</button>`
33
+ : (changesState?.text || ''),
34
+ url: changesState?.url || '',
35
+ isNewWindow: changesState?.isNewWindow ?? true
36
+ })
37
+ onClose()
38
+ }
39
+
40
+ return (
41
+ <InsertLinkContainer>
42
+ <h1>{t('INSERT_LINK', 'Insert link')}</h1>
43
+ <WrapperInput>
44
+ <label>{t('LINK_TEXT', 'Text to display')}</label>
45
+ <Input
46
+ name='text'
47
+ onChange={e => handleChangeInput(e)}
48
+ />
49
+ </WrapperInput>
50
+ <WrapperInput>
51
+ <label>{t('LINK_URL', 'Url')}</label>
52
+ <Input
53
+ name='url'
54
+ onChange={e => handleChangeInput(e)}
55
+ />
56
+ </WrapperInput>
57
+ <CheckboxWrapper>
58
+ <Checkbox
59
+ defaultChecked
60
+ onClick={e => setChangesState({ ...changesState, isNewWindow: e.target.checked })}
61
+ />
62
+ <span>{t('IS_NEW_WINDOW', 'Open in a new window')}</span>
63
+ </CheckboxWrapper>
64
+ <Button
65
+ borderRadius='8px'
66
+ color='primary'
67
+ onClick={() => handleInsertClick()}
68
+ >
69
+ {t('INSERT', 'Insert')}
70
+ </Button>
71
+ </InsertLinkContainer>
72
+ )
73
+ }
@@ -0,0 +1,34 @@
1
+ import styled from 'styled-components'
2
+
3
+ export const InsertLinkContainer = styled.div`
4
+ h1 {
5
+ font-size: 20px;
6
+ font-weight: 700;
7
+ margin-bottom: 25px;
8
+ }
9
+
10
+ > button {
11
+ height: 42px;
12
+ }
13
+ `
14
+
15
+ export const WrapperInput = styled.div`
16
+ display: flex;
17
+ flex-direction: column;
18
+ margin-bottom: 10px;
19
+
20
+ label {
21
+ font-size: 14px;
22
+ }
23
+ `
24
+
25
+ export const CheckboxWrapper = styled.div`
26
+ display: flex;
27
+ align-items: center;
28
+ margin-bottom: 25px;
29
+
30
+ > span {
31
+ margin: 0 10px;
32
+ font-size: 14px;
33
+ }
34
+ `
@@ -0,0 +1,51 @@
1
+ import React, { useState } from 'react'
2
+ import { useLanguage } from 'ordering-components-admin-external'
3
+ import { Button, Input } from '../../../../styles'
4
+ import { formatUrlVideo } from '../../../../utils'
5
+
6
+ import {
7
+ InsertLinkContainer,
8
+ WrapperInput
9
+ } from './styles'
10
+
11
+ export const InsertVideo = (props) => {
12
+ const {
13
+ editorContext,
14
+ onClose,
15
+ handleRestoreEditor
16
+ } = props
17
+ const [, t] = useLanguage()
18
+ const [videoUrl, setVideoUrl] = useState(null)
19
+
20
+ const getVideoEmbedded = (video) => {
21
+ if (video.indexOf('youtube')) {
22
+ return '<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/' + formatUrlVideo(video) + '" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>'
23
+ }
24
+ }
25
+
26
+ const handleInsertClick = () => {
27
+ const HTMLstring = getVideoEmbedded(videoUrl)
28
+ handleRestoreEditor()
29
+ editorContext.invoke('editor.pasteHTML', HTMLstring)
30
+ onClose()
31
+ }
32
+ return (
33
+ <InsertLinkContainer>
34
+ <h1>{t('INSERT_VIDEO', 'Insert video')}</h1>
35
+ <WrapperInput>
36
+ <label>{t('VIDEO_URL', 'Video url')}</label>
37
+ <Input
38
+ name='text'
39
+ onChange={e => setVideoUrl(e.target.value)}
40
+ />
41
+ </WrapperInput>
42
+ <Button
43
+ borderRadius='8px'
44
+ color='primary'
45
+ onClick={() => handleInsertClick()}
46
+ >
47
+ {t('INSERT', 'Insert')}
48
+ </Button>
49
+ </InsertLinkContainer>
50
+ )
51
+ }
@@ -0,0 +1,23 @@
1
+ import styled from 'styled-components'
2
+
3
+ export const InsertLinkContainer = styled.div`
4
+ h1 {
5
+ font-size: 20px;
6
+ font-weight: 700;
7
+ margin-bottom: 25px;
8
+ }
9
+
10
+ > button {
11
+ height: 42px;
12
+ }
13
+ `
14
+
15
+ export const WrapperInput = styled.div`
16
+ display: flex;
17
+ flex-direction: column;
18
+ margin-bottom: 25px;
19
+
20
+ label {
21
+ font-size: 14px;
22
+ }
23
+ `
@@ -0,0 +1,172 @@
1
+ import React, { useState, useEffect } from 'react'
2
+ import { HtmlEditor as HtmlEditorController } from 'ordering-components-admin-external'
3
+ import $ from 'jquery'
4
+ import ReactSummernote from 'react-summernote'
5
+ import 'react-summernote/dist/react-summernote.css'
6
+ import 'bootstrap/js/dist/modal'
7
+ import 'bootstrap/js/dist/dropdown'
8
+ import 'bootstrap/js/dist/tooltip'
9
+ import 'bootstrap/dist/css/bootstrap.css'
10
+ import { WrapperEditor } from './styles'
11
+ import { InsertLink } from './InsertLink'
12
+ import { InsertVideo } from './InsertVideo'
13
+ import { InsertImage } from './InsertImage'
14
+ import { Modal } from '../Modal'
15
+
16
+ const HtmlEditorUI = (props) => {
17
+ const {
18
+ body,
19
+ handleChangeBody,
20
+ imageListState,
21
+ insertImageState,
22
+ handleInsertImage,
23
+ handleDeleteImage,
24
+ selectedImageUrl,
25
+ setSelectedImageUrl
26
+ } = props
27
+
28
+ const [openModal, setOpenModal] = useState(null)
29
+ const [editorContext, setEditorContext] = useState(null)
30
+ const [pageContent, setPageContent] = useState(null)
31
+
32
+ const insertLink = (context) => {
33
+ const ui = $.summernote.ui
34
+ const button = ui.button({
35
+ contents: '<i class="note-icon-link"/>',
36
+ tooltip: 'link',
37
+ class: 'note-btn',
38
+ click: () => {
39
+ setEditorContext(context)
40
+ context.invoke('editor.saveRange')
41
+ setOpenModal('link')
42
+ }
43
+ })
44
+ return button.render()
45
+ }
46
+
47
+ const handleRestoreEditor = () => editorContext.invoke('restoreRange')
48
+
49
+ const insertImage = (context) => {
50
+ const ui = $.summernote.ui
51
+ const button = ui.button({
52
+ contents: '<i class="note-icon-picture"/>',
53
+ tooltip: 'picture',
54
+ class: 'note-btn',
55
+ click: () => {
56
+ setEditorContext(context)
57
+ context.invoke('editor.saveRange')
58
+ setOpenModal('image')
59
+ }
60
+ })
61
+ return button.render()
62
+ }
63
+
64
+ const insertVideo = (context) => {
65
+ const ui = $.summernote.ui
66
+ const button = ui.button({
67
+ contents: '<i class="note-icon-video"/>',
68
+ tooltip: 'video',
69
+ class: 'note-btn',
70
+ click: () => {
71
+ setEditorContext(context)
72
+ context.invoke('editor.saveRange')
73
+ setOpenModal('video')
74
+ }
75
+ })
76
+ return button.render()
77
+ }
78
+
79
+ const handleCloseModal = () => {
80
+ setOpenModal(false)
81
+ setEditorContext(null)
82
+ }
83
+
84
+ useEffect(() => {
85
+ if (!pageContent) return
86
+ handleChangeBody(pageContent)
87
+ }, [pageContent])
88
+
89
+ const onInit = (note) => {
90
+ if (body) {
91
+ note.reset()
92
+ note.replace(body)
93
+ }
94
+ }
95
+
96
+ return (
97
+ <>
98
+ <WrapperEditor>
99
+ <ReactSummernote
100
+ onInit={onInit}
101
+ options={{
102
+ height: 350,
103
+ fontNames: ['Arial', 'Arial Black', 'Comic Sans MS', 'Courier New'],
104
+ toolbar: [
105
+ ['style', ['style']],
106
+ ['font', ['bold', 'italic', 'underline', 'clear']],
107
+ ['fontsize', ['fontsize']],
108
+ ['color', ['color']],
109
+ ['para', ['ul', 'paragraph']],
110
+ ['table', ['table']],
111
+ ['insert', ['insertLink', 'insertImage', 'insertVideo']],
112
+ ['codeview', ['codeview']]
113
+ ],
114
+ buttons: {
115
+ insertLink: insertLink,
116
+ insertImage: insertImage,
117
+ insertVideo: insertVideo
118
+ }
119
+ }}
120
+ onChange={content => setPageContent(content)}
121
+ />
122
+ </WrapperEditor>
123
+ <Modal
124
+ width='60%'
125
+ open={openModal === 'link'}
126
+ onClose={() => setOpenModal(null)}
127
+ >
128
+ <InsertLink
129
+ editorContext={editorContext}
130
+ handleRestoreEditor={handleRestoreEditor}
131
+ onClose={() => handleCloseModal()}
132
+ />
133
+ </Modal>
134
+ <Modal
135
+ width='60%'
136
+ open={openModal === 'video'}
137
+ onClose={() => setOpenModal(null)}
138
+ >
139
+ <InsertVideo
140
+ editorContext={editorContext}
141
+ handleRestoreEditor={handleRestoreEditor}
142
+ onClose={() => handleCloseModal()}
143
+ />
144
+ </Modal>
145
+ <Modal
146
+ width='60%'
147
+ open={openModal === 'image'}
148
+ onClose={() => setOpenModal(null)}
149
+ >
150
+ <InsertImage
151
+ imageListState={imageListState}
152
+ editorContext={editorContext}
153
+ handleRestoreEditor={handleRestoreEditor}
154
+ onClose={() => handleCloseModal()}
155
+ insertImageState={insertImageState}
156
+ handleInsertImage={handleInsertImage}
157
+ handleDeleteImage={handleDeleteImage}
158
+ selectedImageUrl={selectedImageUrl}
159
+ setSelectedImageUrl={setSelectedImageUrl}
160
+ />
161
+ </Modal>
162
+ </>
163
+ )
164
+ }
165
+
166
+ export const HtmlEditor = (props) => {
167
+ const htmlEditorProps = {
168
+ ...props,
169
+ UIComponent: HtmlEditorUI
170
+ }
171
+ return <HtmlEditorController {...htmlEditorProps} />
172
+ }
@@ -0,0 +1,30 @@
1
+ import styled from 'styled-components'
2
+
3
+ export const WrapperEditor = styled.div`
4
+ .note-editor {
5
+ border-radius: 8px;
6
+ border: 1px solid ${props => props.theme.colors.borderColor};
7
+
8
+ .note-toolbar {
9
+ border-bottom: 1px solid ${props => props.theme.colors.borderColor};
10
+ }
11
+
12
+ .note-btn {
13
+ &:hover,
14
+ &:focus {
15
+ background-color: ${props => props.theme.colors.secundaryDarkContrast};
16
+ box-shadow: none;
17
+ }
18
+ }
19
+
20
+ .note-dropdown-menu {
21
+ a {
22
+ color: #000;
23
+ }
24
+
25
+ h1 {
26
+ font-size: 36px;
27
+ }
28
+ }
29
+ }
30
+ `
@@ -29,6 +29,7 @@ import { SpinnerLoader } from './SpinnerLoader'
29
29
  import SpreadSheetEditor from './SpreadSheetEditor'
30
30
  import { ProgressRing } from './ProgressRing'
31
31
  import { ColorPicker } from './ColorPicker'
32
+ import { HtmlEditor } from './HtmlEditor'
32
33
 
33
34
  export {
34
35
  AutoScroll,
@@ -62,5 +63,6 @@ export {
62
63
  SpinnerLoader,
63
64
  SpreadSheetEditor,
64
65
  ProgressRing,
65
- ColorPicker
66
+ ColorPicker,
67
+ HtmlEditor
66
68
  }
@@ -8,7 +8,7 @@ import {
8
8
  import Skeleton from 'react-loading-skeleton'
9
9
  import { useInfoShare } from '../../../contexts/InfoShareContext'
10
10
  import { ThreeDots, List as MenuIcon, ArrowsAngleContract, ArrowsAngleExpand } from 'react-bootstrap-icons'
11
- import { Button, IconButton, Switch, DefaultSelect } from '../../../styles'
11
+ import { Button, IconButton, Switch, DefaultSelect, LinkButton } from '../../../styles'
12
12
  import { useTheme } from 'styled-components'
13
13
  import { Alert, SearchBar, SideBar } from '../../Shared'
14
14
  import { BusinessBrandGENDetail } from '../BusinessBrandGENDetail'
@@ -258,7 +258,7 @@ const BusinessBrandListingUI = (props) => {
258
258
  </BrandListTable>
259
259
  </BrandListTableWrapper>
260
260
  <BrandListBottomContainer>
261
- <span onClick={() => handleOpenSideBar()}>{t('ADD_NEW_BRAND', 'Add new brand')}</span>
261
+ <LinkButton onClick={() => handleOpenSideBar()}>{t('ADD_NEW_BRAND', 'Add new brand')}</LinkButton>
262
262
  </BrandListBottomContainer>
263
263
  {openDetail && (
264
264
  <SideBar
@@ -240,13 +240,6 @@ export const BrandListBottomContainer = styled.div`
240
240
  display: flex;
241
241
  align-items: center;
242
242
  margin-top: 16px;
243
-
244
- span {
245
- cursor: pointer;
246
- user-select: none;
247
- font-size: 14px;
248
- color: ${props => props.theme.colors?.primary};
249
- }
250
243
  `
251
244
 
252
245
  export const BrandDetailContainer = styled.div`
@@ -8,10 +8,6 @@ export const Container = styled.div`
8
8
  font-weight: 700;
9
9
  margin-top: 5px;
10
10
  }
11
-
12
- @media (min-width: 1000px) {
13
- max-width: 500px;
14
- }
15
11
  `
16
12
  export const TabsContainer = styled.div`
17
13
  border-bottom: 1px solid ${props => props.theme.colors.borderColor};
@@ -4,12 +4,12 @@ import { useLanguage } from 'ordering-components-admin-external'
4
4
  import { BusinessDeliveryZoneDetails } from '../BusinessDeliveryZoneDetails'
5
5
  import { SideBar } from '../../Shared'
6
6
  import { ChevronRight } from 'react-bootstrap-icons'
7
- import { Checkbox } from '../../../styles'
7
+ import { Checkbox, LinkButton } from '../../../styles'
8
8
 
9
9
  import {
10
10
  ZoneContainer,
11
11
  DeliveryZonesTable,
12
- AddDeliveryZoneButton,
12
+ AddDeliveryZoneButtonWrapper,
13
13
  ZoneTbody,
14
14
  CheckboxWrapper
15
15
  } from './styles'
@@ -112,11 +112,13 @@ export const BusinessDeliveryZoneList = (props) => {
112
112
  ))}
113
113
  </DeliveryZonesTable>
114
114
 
115
- <AddDeliveryZoneButton
116
- onClick={(e) => handleOpenZone(e, null)}
117
- >
118
- {t('ADD_DELIVERY_ZONE', 'Add delivery zone')}
119
- </AddDeliveryZoneButton>
115
+ <AddDeliveryZoneButtonWrapper>
116
+ <LinkButton
117
+ onClick={(e) => handleOpenZone(e, null)}
118
+ >
119
+ {t('ADD_DELIVERY_ZONE', 'Add delivery zone')}
120
+ </LinkButton>
121
+ </AddDeliveryZoneButtonWrapper>
120
122
  </ZoneContainer>
121
123
  {isOpenDetails && (
122
124
  <SideBar
@@ -2,9 +2,6 @@ import styled, { css } from 'styled-components'
2
2
 
3
3
  export const ZoneContainer = styled.div`
4
4
  margin: 30px 0 20px 0;
5
- @media (min-width: 1000px) {
6
- max-width: 500px;
7
- }
8
5
  `
9
6
 
10
7
  export const DeliveryZonesTable = styled.table`
@@ -50,15 +47,8 @@ export const ActionsWrapper = styled.div`
50
47
  align-items: center;
51
48
  `
52
49
 
53
- export const AddDeliveryZoneButton = styled.div`
54
- color: ${props => props.theme.colors.lightGray};
55
- font-size: 14px;
50
+ export const AddDeliveryZoneButtonWrapper = styled.div`
56
51
  padding: 10px 0;
57
- cursor: pointer;
58
- width: fit-content;
59
- &:hover {
60
- color: ${props => props.theme.colors.primary};
61
- }
62
52
  `
63
53
  export const CheckboxWrapper = styled.div`
64
54
  display: flex;
@@ -3,12 +3,9 @@ import styled from 'styled-components'
3
3
  export const Container = styled.div`
4
4
  display: flex;
5
5
  height: 100%;
6
-
7
- @media (min-width: 1000px) {
8
- max-width: 500px;
9
- }
10
6
  `
11
7
  export const InfoConatiner = styled.div`
8
+ width: 100%;
12
9
  height: 100%;
13
10
  overflow-x: hidden;
14
11
  h1 {