@uxf/cms 11.72.5 → 11.74.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 (311) hide show
  1. package/package.json +6 -6
  2. package/translations/translations.d.ts +429 -0
  3. package/translations/translations.js +31 -0
  4. package/api/index.d.ts +0 -165
  5. package/api/index.js +0 -100
  6. package/api/swr.d.ts +0 -76
  7. package/api/swr.js +0 -43
  8. package/config/container.d.ts +0 -29
  9. package/config/container.js +0 -24
  10. package/config/index.d.ts +0 -2
  11. package/config/index.js +0 -6
  12. package/content-builder/content-builder-body.d.ts +0 -6
  13. package/content-builder/content-builder-body.js +0 -10
  14. package/content-builder/content-builder-header.d.ts +0 -7
  15. package/content-builder/content-builder-header.js +0 -13
  16. package/content-builder/content-builder-root.d.ts +0 -11
  17. package/content-builder/content-builder-root.js +0 -13
  18. package/content-builder/content-builder-sidebar.d.ts +0 -7
  19. package/content-builder/content-builder-sidebar.js +0 -12
  20. package/content-builder/content-builder.d.ts +0 -14
  21. package/content-builder/content-builder.js +0 -55
  22. package/content-builder/forms/content-builder-basic-form.d.ts +0 -10
  23. package/content-builder/forms/content-builder-basic-form.js +0 -47
  24. package/content-builder/forms/content-builder-seo-form.d.ts +0 -10
  25. package/content-builder/forms/content-builder-seo-form.js +0 -20
  26. package/content-builder/index.d.ts +0 -4
  27. package/content-builder/index.js +0 -20
  28. package/content-builder/map-content-response-to-form-data.d.ts +0 -3
  29. package/content-builder/map-content-response-to-form-data.js +0 -44
  30. package/content-builder/map-form-data-to-content-request.d.ts +0 -2
  31. package/content-builder/map-form-data-to-content-request.js +0 -28
  32. package/content-builder/types.d.ts +0 -186
  33. package/content-builder/types.js +0 -2
  34. package/content-builder/use-content-builder-form-api.d.ts +0 -3
  35. package/content-builder/use-content-builder-form-api.js +0 -7
  36. package/context/cms-provider.d.ts +0 -7
  37. package/context/cms-provider.js +0 -18
  38. package/deprecated/api/api-client.d.ts +0 -15
  39. package/deprecated/api/api-client.js +0 -86
  40. package/deprecated/hoc/with-authenticate.d.ts +0 -6
  41. package/deprecated/hoc/with-authenticate.js +0 -61
  42. package/deprecated/redux/configure-store.d.ts +0 -3
  43. package/deprecated/redux/configure-store.js +0 -16
  44. package/deprecated/redux/entities/actions.d.ts +0 -30
  45. package/deprecated/redux/entities/actions.js +0 -15
  46. package/deprecated/redux/entities/index.d.ts +0 -2
  47. package/deprecated/redux/entities/index.js +0 -18
  48. package/deprecated/redux/entities/reducer.d.ts +0 -3
  49. package/deprecated/redux/entities/reducer.js +0 -36
  50. package/deprecated/redux/entities/selectors.d.ts +0 -10
  51. package/deprecated/redux/entities/selectors.js +0 -16
  52. package/deprecated/redux/index.d.ts +0 -3
  53. package/deprecated/redux/index.js +0 -22
  54. package/deprecated/redux/redux-helper.d.ts +0 -15
  55. package/deprecated/redux/redux-helper.js +0 -6
  56. package/deprecated/redux/types.d.ts +0 -7
  57. package/deprecated/redux/types.js +0 -2
  58. package/deprecated/redux/user/actions.d.ts +0 -19
  59. package/deprecated/redux/user/actions.js +0 -14
  60. package/deprecated/redux/user/index.d.ts +0 -2
  61. package/deprecated/redux/user/index.js +0 -18
  62. package/deprecated/redux/user/reducer.d.ts +0 -3
  63. package/deprecated/redux/user/reducer.js +0 -21
  64. package/deprecated/redux/user/selectors.d.ts +0 -3
  65. package/deprecated/redux/user/selectors.js +0 -5
  66. package/deprecated/redux/with-redux-store.d.ts +0 -1
  67. package/deprecated/redux/with-redux-store.js +0 -70
  68. package/deprecated/security/cms-authorizator.d.ts +0 -3
  69. package/deprecated/security/cms-authorizator.js +0 -8
  70. package/deprecated/types/app.d.ts +0 -6
  71. package/deprecated/types/app.js +0 -2
  72. package/deprecated/types/form.d.ts +0 -25
  73. package/deprecated/types/form.js +0 -16
  74. package/errors/BadRequestError.d.ts +0 -18
  75. package/errors/BadRequestError.js +0 -14
  76. package/errors/ForbiddenError.d.ts +0 -4
  77. package/errors/ForbiddenError.js +0 -13
  78. package/errors/NetworkError.d.ts +0 -4
  79. package/errors/NetworkError.js +0 -13
  80. package/errors/UnauthorizedError.d.ts +0 -4
  81. package/errors/UnauthorizedError.js +0 -13
  82. package/errors/ValidationError.d.ts +0 -7
  83. package/errors/ValidationError.js +0 -17
  84. package/form-renderer/field/content-dynamic.d.ts +0 -8
  85. package/form-renderer/field/content-dynamic.js +0 -15
  86. package/form-renderer/field/content.d.ts +0 -5
  87. package/form-renderer/field/content.js +0 -38
  88. package/forms/change-password-form/change-password-form.d.ts +0 -3
  89. package/forms/change-password-form/change-password-form.js +0 -26
  90. package/forms/change-password-form/index.d.ts +0 -2
  91. package/forms/change-password-form/index.js +0 -18
  92. package/forms/change-password-form/types.d.ts +0 -13
  93. package/forms/change-password-form/types.js +0 -2
  94. package/forms/components/wysiwyg-input/index.d.ts +0 -1
  95. package/forms/components/wysiwyg-input/index.js +0 -17
  96. package/forms/components/wysiwyg-input/wysiwyg-input.d.ts +0 -26
  97. package/forms/components/wysiwyg-input/wysiwyg-input.js +0 -83
  98. package/forms/forgotten-password-form/forgotten-password-form.d.ts +0 -3
  99. package/forms/forgotten-password-form/forgotten-password-form.js +0 -50
  100. package/forms/forgotten-password-form/index.d.ts +0 -2
  101. package/forms/forgotten-password-form/index.js +0 -18
  102. package/forms/forgotten-password-form/types.d.ts +0 -10
  103. package/forms/forgotten-password-form/types.js +0 -2
  104. package/forms/invite-user-form/index.d.ts +0 -2
  105. package/forms/invite-user-form/index.js +0 -18
  106. package/forms/invite-user-form/invite-user-form.d.ts +0 -3
  107. package/forms/invite-user-form/invite-user-form.js +0 -31
  108. package/forms/invite-user-form/types.d.ts +0 -15
  109. package/forms/invite-user-form/types.js +0 -2
  110. package/forms/login-form/index.d.ts +0 -2
  111. package/forms/login-form/index.js +0 -18
  112. package/forms/login-form/login-form.d.ts +0 -3
  113. package/forms/login-form/login-form.js +0 -49
  114. package/forms/login-form/types.d.ts +0 -11
  115. package/forms/login-form/types.js +0 -2
  116. package/forms/renew-password-form/index.d.ts +0 -2
  117. package/forms/renew-password-form/index.js +0 -18
  118. package/forms/renew-password-form/renew-password-form.d.ts +0 -3
  119. package/forms/renew-password-form/renew-password-form.js +0 -48
  120. package/forms/renew-password-form/types.d.ts +0 -11
  121. package/forms/renew-password-form/types.js +0 -2
  122. package/lib/api/create-axios-instance.d.ts +0 -6
  123. package/lib/api/create-axios-instance.js +0 -17
  124. package/lib/api/create-axios-request.d.ts +0 -3
  125. package/lib/api/create-axios-request.js +0 -39
  126. package/lib/api/create-use-axios-request.d.ts +0 -5
  127. package/lib/api/create-use-axios-request.js +0 -35
  128. package/lib/api/index.d.ts +0 -2
  129. package/lib/api/index.js +0 -19
  130. package/lib/api/types.d.ts +0 -18
  131. package/lib/api/types.js +0 -2
  132. package/lib/layout/breadcrumbs.d.ts +0 -9
  133. package/lib/layout/breadcrumbs.js +0 -21
  134. package/lib/layout/index.d.ts +0 -3
  135. package/lib/layout/index.js +0 -19
  136. package/lib/layout/layout-container.d.ts +0 -3
  137. package/lib/layout/layout-container.js +0 -22
  138. package/lib/layout/layout.d.ts +0 -3
  139. package/lib/layout/layout.js +0 -47
  140. package/lib/layout/sidebar.d.ts +0 -3
  141. package/lib/layout/sidebar.js +0 -77
  142. package/lib/layout/styles.d.ts +0 -1
  143. package/lib/layout/styles.js +0 -4
  144. package/lib/layout/types.d.ts +0 -36
  145. package/lib/layout/types.js +0 -2
  146. package/lib/login-layout/index.d.ts +0 -2
  147. package/lib/login-layout/index.js +0 -18
  148. package/lib/login-layout/login-layout.d.ts +0 -3
  149. package/lib/login-layout/login-layout.js +0 -19
  150. package/lib/login-layout/types.d.ts +0 -9
  151. package/lib/login-layout/types.js +0 -2
  152. package/lib/menu/active-item-resolver.d.ts +0 -7
  153. package/lib/menu/active-item-resolver.js +0 -42
  154. package/lib/menu/factory.d.ts +0 -10
  155. package/lib/menu/factory.js +0 -40
  156. package/lib/menu/index.d.ts +0 -5
  157. package/lib/menu/index.js +0 -21
  158. package/lib/menu/mobile-bar.d.ts +0 -8
  159. package/lib/menu/mobile-bar.js +0 -54
  160. package/lib/menu/model.d.ts +0 -56
  161. package/lib/menu/model.js +0 -112
  162. package/lib/menu/types.d.ts +0 -5
  163. package/lib/menu/types.js +0 -2
  164. package/lib/menu/ui/list-item/index.d.ts +0 -2
  165. package/lib/menu/ui/list-item/index.js +0 -18
  166. package/lib/menu/ui/list-item/list-item.d.ts +0 -3
  167. package/lib/menu/ui/list-item/list-item.js +0 -37
  168. package/lib/menu/ui/list-item/types.d.ts +0 -19
  169. package/lib/menu/ui/list-item/types.js +0 -2
  170. package/lib/menu/ui/menu-custom-item.d.ts +0 -6
  171. package/lib/menu/ui/menu-custom-item.js +0 -17
  172. package/lib/menu/ui/menu-item.d.ts +0 -6
  173. package/lib/menu/ui/menu-item.js +0 -55
  174. package/lib/menu/ui/menu-super-section-item.d.ts +0 -6
  175. package/lib/menu/ui/menu-super-section-item.js +0 -40
  176. package/lib/menu/ui/menu.d.ts +0 -6
  177. package/lib/menu/ui/menu.js +0 -37
  178. package/lib/menu/ui/sub-menu/sub-menu-item.d.ts +0 -7
  179. package/lib/menu/ui/sub-menu/sub-menu-item.js +0 -23
  180. package/lib/menu/ui/sub-menu/sub-menu-mobile.d.ts +0 -8
  181. package/lib/menu/ui/sub-menu/sub-menu-mobile.js +0 -48
  182. package/lib/menu/ui/sub-menu/sub-menu.d.ts +0 -7
  183. package/lib/menu/ui/sub-menu/sub-menu.js +0 -46
  184. package/lib/menu/ui/sub-menu/use-sub-menu.d.ts +0 -49
  185. package/lib/menu/ui/sub-menu/use-sub-menu.js +0 -45
  186. package/lib/menu/ui/user-menu.d.ts +0 -6
  187. package/lib/menu/ui/user-menu.js +0 -53
  188. package/pages/content-builder/components/form-content.d.ts +0 -12
  189. package/pages/content-builder/components/form-content.js +0 -64
  190. package/pages/content-builder/components/form-root-fields.d.ts +0 -16
  191. package/pages/content-builder/components/form-root-fields.js +0 -62
  192. package/pages/content-builder/components/form.d.ts +0 -12
  193. package/pages/content-builder/components/form.js +0 -83
  194. package/pages/content-builder/components/header.d.ts +0 -6
  195. package/pages/content-builder/components/header.js +0 -16
  196. package/pages/content-builder/constants.d.ts +0 -6
  197. package/pages/content-builder/constants.js +0 -10
  198. package/pages/content-builder/content/feature-section.d.ts +0 -17
  199. package/pages/content-builder/content/feature-section.js +0 -59
  200. package/pages/content-builder/content/gallery.d.ts +0 -9
  201. package/pages/content-builder/content/gallery.js +0 -27
  202. package/pages/content-builder/content/hero-section.d.ts +0 -12
  203. package/pages/content-builder/content/hero-section.js +0 -31
  204. package/pages/content-builder/content/people.d.ts +0 -17
  205. package/pages/content-builder/content/people.js +0 -57
  206. package/pages/content-builder/content/wysiwyg.d.ts +0 -15
  207. package/pages/content-builder/content/wysiwyg.js +0 -28
  208. package/pages/content-builder/content-builder-page.d.ts +0 -3
  209. package/pages/content-builder/content-builder-page.js +0 -107
  210. package/pages/content-builder/content-field.d.ts +0 -10
  211. package/pages/content-builder/content-field.js +0 -62
  212. package/pages/content-builder/content-header.d.ts +0 -3
  213. package/pages/content-builder/content-header.js +0 -53
  214. package/pages/content-builder/context/details-visibility-context.d.ts +0 -4
  215. package/pages/content-builder/context/details-visibility-context.js +0 -58
  216. package/pages/content-builder/hooks/use-sortable.d.ts +0 -15
  217. package/pages/content-builder/hooks/use-sortable.js +0 -57
  218. package/pages/content-builder/index.d.ts +0 -5
  219. package/pages/content-builder/index.js +0 -21
  220. package/pages/content-builder/mapper.d.ts +0 -4
  221. package/pages/content-builder/mapper.js +0 -69
  222. package/pages/content-builder/types.d.ts +0 -94
  223. package/pages/content-builder/types.js +0 -2
  224. package/pages/forgotten-password-page/forgotten-password-page.d.ts +0 -5
  225. package/pages/forgotten-password-page/forgotten-password-page.js +0 -49
  226. package/pages/forgotten-password-page/index.d.ts +0 -2
  227. package/pages/forgotten-password-page/index.js +0 -18
  228. package/pages/forgotten-password-page/types.d.ts +0 -11
  229. package/pages/forgotten-password-page/types.js +0 -2
  230. package/pages/grid-page/get-initial-props-helper.d.ts +0 -4
  231. package/pages/grid-page/get-initial-props-helper.js +0 -20
  232. package/pages/grid-page/grid-page.d.ts +0 -6
  233. package/pages/grid-page/grid-page.js +0 -159
  234. package/pages/grid-page/index.d.ts +0 -1
  235. package/pages/grid-page/index.js +0 -5
  236. package/pages/grid-page/types.d.ts +0 -65
  237. package/pages/grid-page/types.js +0 -2
  238. package/pages/grid-page/use-hidden-columns.d.ts +0 -4
  239. package/pages/grid-page/use-hidden-columns.js +0 -17
  240. package/pages/invite-user-page/index.d.ts +0 -2
  241. package/pages/invite-user-page/index.js +0 -18
  242. package/pages/invite-user-page/invite-user-page.d.ts +0 -2
  243. package/pages/invite-user-page/invite-user-page.js +0 -57
  244. package/pages/invite-user-page/types.d.ts +0 -12
  245. package/pages/invite-user-page/types.js +0 -2
  246. package/pages/login-page/index.d.ts +0 -2
  247. package/pages/login-page/index.js +0 -18
  248. package/pages/login-page/login-page.d.ts +0 -5
  249. package/pages/login-page/login-page.js +0 -80
  250. package/pages/login-page/types.d.ts +0 -21
  251. package/pages/login-page/types.js +0 -2
  252. package/pages/renew-password-page/index.d.ts +0 -2
  253. package/pages/renew-password-page/index.js +0 -18
  254. package/pages/renew-password-page/renew-password-page.d.ts +0 -9
  255. package/pages/renew-password-page/renew-password-page.js +0 -53
  256. package/pages/renew-password-page/types.d.ts +0 -14
  257. package/pages/renew-password-page/types.js +0 -2
  258. package/security/restricted-page.d.ts +0 -9
  259. package/security/restricted-page.js +0 -38
  260. package/security/use-logged-user.d.ts +0 -5
  261. package/security/use-logged-user.js +0 -17
  262. package/ui/avatar/avatar.d.ts +0 -11
  263. package/ui/avatar/avatar.js +0 -47
  264. package/ui/avatar/get-avatar-user-letters.d.ts +0 -1
  265. package/ui/avatar/get-avatar-user-letters.js +0 -18
  266. package/ui/avatar/index.d.ts +0 -3
  267. package/ui/avatar/index.js +0 -5
  268. package/ui/avatar/theme.d.ts +0 -11
  269. package/ui/avatar/theme.js +0 -2
  270. package/ui/copy-to-clipboard/copy-to-clipboard.d.ts +0 -3
  271. package/ui/copy-to-clipboard/copy-to-clipboard.js +0 -45
  272. package/ui/copy-to-clipboard/index.d.ts +0 -2
  273. package/ui/copy-to-clipboard/index.js +0 -18
  274. package/ui/copy-to-clipboard/types.d.ts +0 -7
  275. package/ui/copy-to-clipboard/types.js +0 -2
  276. package/ui/copy-to-clipboard-button/copy-to-clipboard-button.d.ts +0 -3
  277. package/ui/copy-to-clipboard-button/copy-to-clipboard-button.js +0 -44
  278. package/ui/copy-to-clipboard-button/index.d.ts +0 -2
  279. package/ui/copy-to-clipboard-button/index.js +0 -18
  280. package/ui/copy-to-clipboard-button/types.d.ts +0 -6
  281. package/ui/copy-to-clipboard-button/types.js +0 -2
  282. package/ui/index.d.ts +0 -1
  283. package/ui/index.js +0 -6
  284. package/ui/tw-tokens/tw-box-shadow.d.ts +0 -12
  285. package/ui/tw-tokens/tw-box-shadow.js +0 -15
  286. package/ui/tw-tokens/tw-colors.d.ts +0 -475
  287. package/ui/tw-tokens/tw-colors.js +0 -474
  288. package/ui/tw-tokens/tw-containers.d.ts +0 -8
  289. package/ui/tw-tokens/tw-containers.js +0 -5
  290. package/ui/tw-tokens/tw-font-size.d.ts +0 -55
  291. package/ui/tw-tokens/tw-font-size.js +0 -32
  292. package/ui/tw-tokens/tw-font-weight.d.ts +0 -12
  293. package/ui/tw-tokens/tw-font-weight.js +0 -15
  294. package/ui/tw-tokens/tw-line-height.d.ts +0 -17
  295. package/ui/tw-tokens/tw-line-height.js +0 -20
  296. package/ui/tw-tokens/tw-screens.d.ts +0 -8
  297. package/ui/tw-tokens/tw-screens.js +0 -5
  298. package/ui/tw-tokens/tw-spacing.d.ts +0 -39
  299. package/ui/tw-tokens/tw-spacing.js +0 -42
  300. package/ui/tw-tokens/tw-z-index.d.ts +0 -21
  301. package/ui/tw-tokens/tw-z-index.js +0 -24
  302. package/ui/widget/index.d.ts +0 -2
  303. package/ui/widget/index.js +0 -18
  304. package/ui/widget/types.d.ts +0 -6
  305. package/ui/widget/types.js +0 -2
  306. package/ui/widget/widget.d.ts +0 -3
  307. package/ui/widget/widget.js +0 -15
  308. package/utils/remove-confirm-handler.d.ts +0 -1
  309. package/utils/remove-confirm-handler.js +0 -26
  310. package/utils/use-viewport-height.d.ts +0 -3
  311. package/utils/use-viewport-height.js +0 -28
package/api/index.js DELETED
@@ -1,100 +0,0 @@
1
- "use strict";
2
- var _a;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.dataGridAutocompleteGet = void 0;
5
- exports.contentGet = contentGet;
6
- exports.contentCreate = contentCreate;
7
- exports.contentUpdate = contentUpdate;
8
- exports.dataGridSchemaGet = dataGridSchemaGet;
9
- exports.forgottenPassword = forgottenPassword;
10
- exports.getLoggedUser = getLoggedUser;
11
- exports.getEntityMetaSchemas = getEntityMetaSchemas;
12
- exports.getFormSchema = getFormSchema;
13
- exports.getFormValues = getFormValues;
14
- exports.login = login;
15
- exports.autocomplete = autocomplete;
16
- exports.saveFormValues = saveFormValues;
17
- exports.removeEntity = removeEntity;
18
- exports.userConfigSave = userConfigSave;
19
- exports.userConfigGetAll = userConfigGetAll;
20
- exports.userConfigGet = userConfigGet;
21
- exports.uploadFile = uploadFile;
22
- const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
23
- const api_1 = require("../lib/api");
24
- // TODO @vejvis - doufám, že tohle bude fungovat
25
- const { axiosRequest, axiosInstance } = (0, api_1.createAxiosInstance)((_a = process.env.NEXT_PUBLIC_FRONTEND_URL) !== null && _a !== void 0 ? _a : "");
26
- function contentGet(ctx, contentId) {
27
- return axiosRequest(ctx, `/api/cms/content/${contentId}`, "get", null, null);
28
- }
29
- function contentCreate(ctx, content) {
30
- return axiosRequest(ctx, "/api/cms/content", "post", content, null);
31
- }
32
- function contentUpdate(ctx, contentId, content) {
33
- return axiosRequest(ctx, `/api/cms/content/${contentId}`, "put", content, null);
34
- }
35
- function dataGridSchemaGet(ctx, gridName) {
36
- return axiosRequest(ctx, `/api/cms/datagrid/schema/${gridName}`, "get", null, null);
37
- }
38
- const dataGridAutocompleteGet = (ctx, gridName, filterName, text) => {
39
- return axiosRequest(ctx, `/api/cms/datagrid/autocomplete/${gridName}/${filterName}`, "get", null, { s: text }).then((r) => r.data);
40
- };
41
- exports.dataGridAutocompleteGet = dataGridAutocompleteGet;
42
- function forgottenPassword(ctx, email, cms = true) {
43
- return axiosRequest(ctx, "/api/forgotten-password", "post", { email, cms }, null).then(() => undefined);
44
- }
45
- function getLoggedUser(ctx = null) {
46
- return axiosRequest(ctx, `/api/cms/user`, "get", null, null).then((r) => r.data.user);
47
- }
48
- function getEntityMetaSchemas(ctx) {
49
- return axiosRequest(ctx, "/api/cms/tables", "get", null, null);
50
- }
51
- function getFormSchema(ctx, path) {
52
- return axiosRequest(ctx, `/api/cms/form/${path.entityAlias}/schema`, "get", null, null);
53
- }
54
- function getFormValues(ctx, path) {
55
- return axiosRequest(ctx, `/api/cms/form/${path.entityAlias}/${path.id}`, "get", null, null);
56
- }
57
- function login(ctx, body) {
58
- return axiosRequest(ctx, "/api/login", "post", body, null);
59
- }
60
- function autocomplete(ctx, path, query) {
61
- return axiosRequest(ctx, `/api/cms/autocomplete/${path.name}`, "get", null, query);
62
- }
63
- function saveFormValues(ctx, path, body) {
64
- return path.id
65
- ? axiosRequest(ctx, `/api/cms/form/${path.entityAlias}/${path.id}`, "put", body, null)
66
- : axiosRequest(ctx, `/api/cms/form/${path.entityAlias}`, "post", body, null);
67
- }
68
- function removeEntity(ctx, path) {
69
- return axiosRequest(ctx, `/api/cms/form/${path.entityAlias}/${path.id}`, "delete", null, null);
70
- }
71
- async function userConfigSave(name, data) {
72
- return axiosRequest(null, "/api/cms/user-config", "post", { name, data }, null);
73
- }
74
- function userConfigGetAll(ctx) {
75
- return axiosRequest(ctx, "/api/cms/user-config", "get", null, null);
76
- }
77
- async function userConfigGet(ctx, name, defaultValue) {
78
- const configs = await userConfigGetAll(ctx).then((r) => r.data);
79
- const configsName = configs[name];
80
- if (typeof configsName !== "undefined") {
81
- return configsName.data;
82
- }
83
- return defaultValue;
84
- }
85
- /**
86
- * @deprecated use import { uploadFile } from "@uxf/core/api/upload-file" or createUploadHandler
87
- */
88
- async function uploadFile(file, namespace = "default") {
89
- const formData = new FormData();
90
- formData.append("files[]", file);
91
- const response = await axiosInstance.post("/api/cms/files/upload", formData, {
92
- timeout: 100 * 1000,
93
- params: namespace ? { namespace } : {},
94
- });
95
- const firstFile = response.data.at(0);
96
- if ((0, is_not_nil_1.isNotNil)(firstFile)) {
97
- return firstFile;
98
- }
99
- throw new Error("Response is null");
100
- }
package/api/swr.d.ts DELETED
@@ -1,76 +0,0 @@
1
- import { Schema } from "@uxf/data-grid";
2
- import { SWRConfiguration } from "swr";
3
- import { SWRMutationConfiguration, SWRMutationResponse } from "swr/mutation";
4
- type SWRConfigurationWithOptionalFallback<Options> = Options extends SWRConfiguration & Required<Pick<SWRConfiguration, "fallbackData">> ? Omit<Options, "fallbackData"> & Pick<Partial<Options>, "fallbackData"> : Options;
5
- export declare class ApiError extends Error {
6
- readonly code: string;
7
- readonly statusCode: number;
8
- readonly info: {
9
- error: {
10
- code: string;
11
- message: string;
12
- };
13
- validationErrors: {
14
- field: string;
15
- message: string;
16
- }[];
17
- };
18
- constructor(message: string, code: string, statusCode: number, info: {
19
- error: {
20
- code: string;
21
- message: string;
22
- };
23
- validationErrors: {
24
- field: string;
25
- message: string;
26
- }[];
27
- });
28
- }
29
- export declare const _fetch: (url: string, method?: string, body?: any) => Promise<any>;
30
- type Mixed = any;
31
- type XString = string;
32
- type Int = number;
33
- type Email = string;
34
- export interface CMSSaveUserConfigRequestBody {
35
- name: XString;
36
- data: Array<Mixed>;
37
- }
38
- export interface CMSUserResponse {
39
- id: Int;
40
- email: Email;
41
- name: XString;
42
- roles: Array<XString>;
43
- }
44
- export interface Metadata {
45
- title: XString;
46
- entityAlias: XString;
47
- actions: Array<XString>;
48
- }
49
- export declare const useCmsUserConfigQuery: <T extends SWRConfiguration<Mixed, ApiError>>(config: {
50
- path: {
51
- name: XString;
52
- };
53
- } & {
54
- skip?: boolean;
55
- }, options?: SWRConfigurationWithOptionalFallback<T>) => import("swr").SWRResponse<any, ApiError, T>;
56
- export declare const useCmsUserConfigUpdateMutation: (config: {
57
- path: {
58
- name: XString;
59
- };
60
- }, options?: SWRMutationConfiguration<Mixed, ApiError, string, Mixed> | undefined) => SWRMutationResponse<Mixed, ApiError, string, Mixed>;
61
- export declare const useCmsMeQuery: <T extends SWRConfiguration<CMSUserResponse, ApiError>>(config?: {
62
- skip?: boolean;
63
- }, options?: SWRConfigurationWithOptionalFallback<T>) => import("swr").SWRResponse<CMSUserResponse, ApiError, T>;
64
- /** @deprecated will be removed - schemas are generated */
65
- export declare const useCmsTablesQuery: <T extends SWRConfiguration<Record<string, Metadata>, ApiError>>(config?: {
66
- skip?: boolean;
67
- }, options?: SWRConfigurationWithOptionalFallback<T>) => import("swr").SWRResponse<Record<string, Metadata>, ApiError, T>;
68
- /** @deprecated will be removed - schemas are generated */
69
- export declare const useDatagridGetSchemaQuery: <T extends SWRConfiguration<Schema<any>, ApiError>>(config: {
70
- path: {
71
- name: XString;
72
- };
73
- } & {
74
- skip?: boolean;
75
- }, options?: SWRConfigurationWithOptionalFallback<T>) => import("swr").SWRResponse<Schema<any>, ApiError, T>;
76
- export {};
package/api/swr.js DELETED
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.useDatagridGetSchemaQuery = exports.useCmsTablesQuery = exports.useCmsMeQuery = exports.useCmsUserConfigUpdateMutation = exports.useCmsUserConfigQuery = exports._fetch = exports.ApiError = void 0;
7
- const swr_1 = __importDefault(require("swr"));
8
- const mutation_1 = __importDefault(require("swr/mutation"));
9
- class ApiError extends Error {
10
- constructor(message, code, statusCode, info) {
11
- super(message);
12
- this.code = code;
13
- this.statusCode = statusCode;
14
- this.info = info;
15
- }
16
- }
17
- exports.ApiError = ApiError;
18
- const _fetch = (url, method = "GET", body = undefined) => {
19
- var _a;
20
- return fetch(((_a = process.env.API_URL) !== null && _a !== void 0 ? _a : "") + url, {
21
- method,
22
- body: typeof body !== "undefined" ? JSON.stringify(body) : undefined,
23
- }).then(async (res) => {
24
- const data = await res.json();
25
- if (!res.ok) {
26
- throw new ApiError(data.error.message, data.error.code, res.status, data);
27
- }
28
- return data;
29
- });
30
- };
31
- exports._fetch = _fetch;
32
- const useCmsUserConfigQuery = (config, options = {}) => (0, swr_1.default)(config.skip !== true ? `/api/cms/user-config/${config.path.name}` : null, options);
33
- exports.useCmsUserConfigQuery = useCmsUserConfigQuery;
34
- const useCmsUserConfigUpdateMutation = (config, options = undefined) => (0, mutation_1.default)(`/api/cms/user-config/${config.path.name}`, (url, { arg: body }) => (0, exports._fetch)(url, "PUT", body), options);
35
- exports.useCmsUserConfigUpdateMutation = useCmsUserConfigUpdateMutation;
36
- const useCmsMeQuery = (config = {}, options = {}) => (0, swr_1.default)(config.skip !== true ? `/api/cms/me` : null, options);
37
- exports.useCmsMeQuery = useCmsMeQuery;
38
- /** @deprecated will be removed - schemas are generated */
39
- const useCmsTablesQuery = (config = {}, options = {}) => (0, swr_1.default)(config.skip !== true ? `/api/cms/tables` : null, options);
40
- exports.useCmsTablesQuery = useCmsTablesQuery;
41
- /** @deprecated will be removed - schemas are generated */
42
- const useDatagridGetSchemaQuery = (config, options = {}) => (0, swr_1.default)(config.skip !== true ? `/api/cms/datagrid/schema/${config.path.name}` : null, options);
43
- exports.useDatagridGetSchemaQuery = useDatagridGetSchemaQuery;
@@ -1,29 +0,0 @@
1
- import { NextPageContext } from "next";
2
- import { LinkProps } from "next/link";
3
- import { ReactNode } from "react";
4
- import UserResponse from "../api";
5
- export interface NotificationServiceInterface {
6
- info: (message: ReactNode) => void;
7
- success: (message: ReactNode) => void;
8
- warning: (message: ReactNode) => void;
9
- error: (message: ReactNode) => void;
10
- }
11
- export interface LoggedUser {
12
- roles: string[];
13
- }
14
- export type UseLoggedUser = () => LoggedUser;
15
- export type GetLoggedUser = (ctx: NextPageContext) => Promise<UserResponse>;
16
- type ContainerStore = {
17
- route: (route: string, params?: any) => LinkProps["href"];
18
- useActiveRoute: () => string;
19
- useLoggedUser: UseLoggedUser;
20
- "api.getLoggedUser": GetLoggedUser;
21
- "service.notification": NotificationServiceInterface;
22
- };
23
- export declare class Container {
24
- private store;
25
- register<T extends keyof ContainerStore>(key: T, value: ContainerStore[T]): Container;
26
- get<T extends keyof ContainerStore>(key: T): ContainerStore[T];
27
- has(key: keyof ContainerStore): boolean;
28
- }
29
- export {};
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Container = void 0;
4
- const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
5
- class Container {
6
- constructor() {
7
- this.store = {};
8
- }
9
- register(key, value) {
10
- this.store[key] = value;
11
- return this;
12
- }
13
- get(key) {
14
- const value = this.store[key];
15
- if (!value) {
16
- throw new Error(`Container has no service '${key}'.`);
17
- }
18
- return value;
19
- }
20
- has(key) {
21
- return (0, is_not_nil_1.isNotNil)(this.store[key]);
22
- }
23
- }
24
- exports.Container = Container;
package/config/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { Container } from "./container";
2
- export declare const container: Container;
package/config/index.js DELETED
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.container = void 0;
4
- // eslint-disable-next-line import/no-cycle
5
- const container_1 = require("./container");
6
- exports.container = new container_1.Container();
@@ -1,6 +0,0 @@
1
- import React, { ReactNode } from "react";
2
- interface ContentBuilderBodyProps {
3
- children: ReactNode;
4
- }
5
- export declare function ContentBuilderBody(props: ContentBuilderBodyProps): React.JSX.Element;
6
- export {};
@@ -1,10 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ContentBuilderBody = ContentBuilderBody;
7
- const react_1 = __importDefault(require("react"));
8
- function ContentBuilderBody(props) {
9
- return react_1.default.createElement("div", { className: "uxf-cb__body" }, props.children);
10
- }
@@ -1,7 +0,0 @@
1
- import React from "react";
2
- interface ContentBuilderHeaderProps {
3
- title: string;
4
- className?: string;
5
- }
6
- export declare function ContentBuilderHeader(props: ContentBuilderHeaderProps): React.JSX.Element;
7
- export {};
@@ -1,13 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ContentBuilderHeader = ContentBuilderHeader;
7
- const button_1 = require("@uxf/ui/button");
8
- const react_1 = __importDefault(require("react"));
9
- function ContentBuilderHeader(props) {
10
- return (react_1.default.createElement("div", { className: "uxf-cb__header" },
11
- react_1.default.createElement("h1", { className: "uxg-cb__header-title uxf-typo-h5" }, props.title),
12
- react_1.default.createElement(button_1.Button, { type: "submit" }, "Ulo\u017Eit")));
13
- }
@@ -1,11 +0,0 @@
1
- import React, { ReactNode } from "react";
2
- import { FieldValues, SubmitErrorHandler, SubmitHandler, UseFormReturn } from "react-hook-form";
3
- interface ContentBuilderRootProps<FormData extends FieldValues> {
4
- id: string;
5
- children: ReactNode;
6
- formApi: UseFormReturn<FormData>;
7
- onSubmit: SubmitHandler<FormData>;
8
- onError?: SubmitErrorHandler<FormData>;
9
- }
10
- export declare function ContentBuilderRoot<FormData extends FieldValues>(props: ContentBuilderRootProps<FormData>): React.JSX.Element;
11
- export {};
@@ -1,13 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ContentBuilderRoot = ContentBuilderRoot;
7
- const form_1 = require("@uxf/form/form");
8
- const react_1 = __importDefault(require("react"));
9
- const details_visibility_context_1 = require("../pages/content-builder/context/details-visibility-context");
10
- function ContentBuilderRoot(props) {
11
- return (react_1.default.createElement(form_1.Form, { className: "uxf-cb", formApi: props.formApi, id: props.id, onError: props.onError, onSubmit: props.onSubmit },
12
- react_1.default.createElement(details_visibility_context_1.DetailsVisibilityProvider, null, props.children)));
13
- }
@@ -1,7 +0,0 @@
1
- import React, { ReactNode } from "react";
2
- interface Props {
3
- children: ReactNode;
4
- title: string;
5
- }
6
- export declare function ContentBuilderSidebar(props: Props): React.JSX.Element;
7
- export {};
@@ -1,12 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ContentBuilderSidebar = ContentBuilderSidebar;
7
- const react_1 = __importDefault(require("react"));
8
- function ContentBuilderSidebar(props) {
9
- return (react_1.default.createElement("div", { className: "uxf-cb__sidebar" },
10
- react_1.default.createElement("h2", { className: "uxf-typo-h5" }, props.title),
11
- props.children));
12
- }
@@ -1,14 +0,0 @@
1
- import React from "react";
2
- import { SubmitHandler, UseFormReturn } from "react-hook-form";
3
- import { ContentComponent } from "../pages/content-builder";
4
- import { ContentBuilderFormData, FieldsConfiguration } from "./types";
5
- export interface ContentBuilderProps {
6
- id?: string;
7
- formApi: UseFormReturn<ContentBuilderFormData>;
8
- onSubmit: SubmitHandler<ContentBuilderFormData>;
9
- ContentComponents: ContentComponent<any>[];
10
- uploadNamespace?: string;
11
- fields?: FieldsConfiguration;
12
- title?: string;
13
- }
14
- export declare function ContentBuilder(props: ContentBuilderProps): React.JSX.Element;
@@ -1,55 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.ContentBuilder = ContentBuilder;
27
- const tabs_1 = require("@uxf/ui/tabs");
28
- const react_1 = __importStar(require("react"));
29
- const content_builder_1 = require("../pages/content-builder");
30
- const content_builder_body_1 = require("./content-builder-body");
31
- const content_builder_header_1 = require("./content-builder-header");
32
- const content_builder_root_1 = require("./content-builder-root");
33
- const content_builder_sidebar_1 = require("./content-builder-sidebar");
34
- const content_builder_basic_form_1 = require("./forms/content-builder-basic-form");
35
- const content_builder_seo_form_1 = require("./forms/content-builder-seo-form");
36
- var TabName;
37
- (function (TabName) {
38
- TabName["Basic"] = "basic";
39
- TabName["Seo"] = "seo";
40
- })(TabName || (TabName = {}));
41
- function ContentBuilder(props) {
42
- var _a, _b;
43
- const generatedId = (0, react_1.useId)();
44
- const [activeTab, setActiveTab] = (0, react_1.useState)(TabName.Basic);
45
- return (react_1.default.createElement(content_builder_root_1.ContentBuilderRoot, { formApi: props.formApi, id: (_a = props.id) !== null && _a !== void 0 ? _a : generatedId, onSubmit: props.onSubmit },
46
- react_1.default.createElement(content_builder_header_1.ContentBuilderHeader, { title: (_b = props.title) !== null && _b !== void 0 ? _b : "Článek knihovny" }),
47
- react_1.default.createElement(content_builder_body_1.ContentBuilderBody, null,
48
- react_1.default.createElement(content_builder_1.ContentField, { contentComponents: props.ContentComponents, control: props.formApi.control, name: "content" }),
49
- react_1.default.createElement(content_builder_sidebar_1.ContentBuilderSidebar, { title: "Nastaven\u00ED" },
50
- react_1.default.createElement(tabs_1.Tabs, { onChange: setActiveTab, value: activeTab },
51
- react_1.default.createElement(tabs_1.Tabs.Panel, { isAlwaysMounted: true, label: "Z\u00E1kladn\u00ED", name: TabName.Basic },
52
- react_1.default.createElement(content_builder_basic_form_1.ContentBuilderBasicForm, { className: "space-y-8", fields: props.fields, formApi: props.formApi, uploadNamespace: props.uploadNamespace })),
53
- react_1.default.createElement(tabs_1.Tabs.Panel, { isAlwaysMounted: true, label: "SEO", name: TabName.Seo },
54
- react_1.default.createElement(content_builder_seo_form_1.ContentBuilderSeoForm, { className: "space-y-8", fields: props.fields, formApi: props.formApi, uploadNamespace: props.uploadNamespace })))))));
55
- }
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import { UseFormReturn } from "react-hook-form";
3
- import { ContentBuilderFormData, FieldsConfiguration } from "../types";
4
- export interface ContentBuilderBasicFormProps {
5
- formApi: UseFormReturn<ContentBuilderFormData>;
6
- className?: string;
7
- uploadNamespace?: string;
8
- fields?: FieldsConfiguration;
9
- }
10
- export declare function ContentBuilderBasicForm(props: ContentBuilderBasicFormProps): React.JSX.Element;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ContentBuilderBasicForm = ContentBuilderBasicForm;
7
- const is_empty_1 = require("@uxf/core/utils/is-empty");
8
- const is_nil_1 = require("@uxf/core/utils/is-nil");
9
- const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
10
- const slugify_1 = require("@uxf/core/utils/slugify");
11
- const checkbox_input_1 = require("@uxf/form/checkbox-input");
12
- const combobox_1 = require("@uxf/form/combobox");
13
- const datetime_picker_input_1 = require("@uxf/form/datetime-picker-input");
14
- const file_input_1 = require("@uxf/form/file-input");
15
- const multi_combobox_1 = require("@uxf/form/multi-combobox");
16
- const select_1 = require("@uxf/form/select");
17
- const text_input_1 = require("@uxf/form/text-input");
18
- const textarea_1 = require("@uxf/form/textarea");
19
- const react_1 = __importDefault(require("react"));
20
- const api_1 = require("../../api");
21
- const visibilityLevelOptions = [
22
- { id: "PRIVATE", label: "Privátní" },
23
- { id: "PUBLIC_WITHOUT_SITEMAP", label: "Veřejný bez sitemapy" },
24
- { id: "PUBLIC", label: "Veřejný" },
25
- ];
26
- function ContentBuilderBasicForm(props) {
27
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
28
- const seoName = props.formApi.watch("seo.name");
29
- const onBlurName = (event) => {
30
- if ((0, is_nil_1.isNil)(seoName) || (0, is_empty_1.isEmpty)(seoName)) {
31
- props.formApi.setValue("seo.name", (0, slugify_1.slugify)(event.target.value));
32
- }
33
- };
34
- return (react_1.default.createElement("div", { className: props.className },
35
- ((_b = (_a = props.fields) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.options) && (react_1.default.createElement(select_1.Select, { control: props.formApi.control, isReadOnly: props.fields.type.isReadOnly, isRequired: true, label: "Typ", name: "type", options: props.fields.type.options })),
36
- react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, isRequired: true, label: "Nadpis", name: "name", onBlur: onBlurName, type: "text" }),
37
- !((_d = (_c = props.fields) === null || _c === void 0 ? void 0 : _c.publishedAt) === null || _d === void 0 ? void 0 : _d.isHidden) && (react_1.default.createElement(datetime_picker_input_1.DatetimePickerInput, { control: props.formApi.control, isRequired: true, label: "Datum publikace", name: "publishedAt" })),
38
- !((_f = (_e = props.fields) === null || _e === void 0 ? void 0 : _e.perex) === null || _f === void 0 ? void 0 : _f.isHidden) && (react_1.default.createElement(textarea_1.Textarea, { control: props.formApi.control, label: "Perex", name: "perex", rows: 3 })),
39
- ((_h = (_g = props.fields) === null || _g === void 0 ? void 0 : _g.authorText) === null || _h === void 0 ? void 0 : _h.isHidden) === false && (react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, label: "Autor", name: "authorText" })),
40
- !((_k = (_j = props.fields) === null || _j === void 0 ? void 0 : _j.author) === null || _k === void 0 ? void 0 : _k.isHidden) && ((_m = (_l = props.fields) === null || _l === void 0 ? void 0 : _l.author) === null || _m === void 0 ? void 0 : _m.autocomplete) && (react_1.default.createElement(combobox_1.Combobox, { control: props.formApi.control, label: "Autor", loadOptions: props.fields.author.autocomplete, name: "author" })),
41
- !((_p = (_o = props.fields) === null || _o === void 0 ? void 0 : _o.category) === null || _p === void 0 ? void 0 : _p.isHidden) && ((_r = (_q = props.fields) === null || _q === void 0 ? void 0 : _q.category) === null || _r === void 0 ? void 0 : _r.autocomplete) && (react_1.default.createElement(combobox_1.Combobox, { control: props.formApi.control, label: "Kategorie", loadOptions: props.fields.category.autocomplete, name: "category" })),
42
- !((_t = (_s = props.fields) === null || _s === void 0 ? void 0 : _s.tags) === null || _t === void 0 ? void 0 : _t.isHidden) && ((_v = (_u = props.fields) === null || _u === void 0 ? void 0 : _u.tags) === null || _v === void 0 ? void 0 : _v.autocomplete) && (react_1.default.createElement(multi_combobox_1.MultiCombobox, { control: props.formApi.control, label: "Tagy", loadOptions: props.fields.tags.autocomplete, name: "tags" })),
43
- !((_x = (_w = props.fields) === null || _w === void 0 ? void 0 : _w.image) === null || _x === void 0 ? void 0 : _x.isHidden) && (react_1.default.createElement(file_input_1.FileInput, { control: props.formApi.control, id: "image", label: "Hlavn\u00ED obr\u00E1zek", name: "image", onUploadFile: (file) => (0, api_1.uploadFile)(file, props.uploadNamespace) })),
44
- !((_z = (_y = props.fields) === null || _y === void 0 ? void 0 : _y.isActive) === null || _z === void 0 ? void 0 : _z.isHidden) && (react_1.default.createElement(checkbox_input_1.CheckboxInput, { control: props.formApi.control, label: "Aktivn\u00ED", name: "isActive" })),
45
- !((_1 = (_0 = props.fields) === null || _0 === void 0 ? void 0 : _0.visibilityLevel) === null || _1 === void 0 ? void 0 : _1.isHidden) && (react_1.default.createElement(select_1.Select, { control: props.formApi.control, isRequired: true, label: "Viditelnost", name: "visibilityLevel", options: visibilityLevelOptions })),
46
- (0, is_not_nil_1.isNotNil)((_3 = (_2 = props.fields) === null || _2 === void 0 ? void 0 : _2.parent) === null || _3 === void 0 ? void 0 : _3.autocomplete) && (react_1.default.createElement(combobox_1.Combobox, { control: props.formApi.control, label: "Nad\u0159azen\u00FD \u010Dl\u00E1nek", loadOptions: props.fields.parent.autocomplete, name: "parent" }))));
47
- }
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import { UseFormReturn } from "react-hook-form";
3
- import { ContentBuilderFormData, FieldsConfiguration } from "../types";
4
- export interface ContentBuilderSeoFormProps {
5
- formApi: UseFormReturn<ContentBuilderFormData>;
6
- className?: string;
7
- uploadNamespace?: string;
8
- fields?: FieldsConfiguration;
9
- }
10
- export declare function ContentBuilderSeoForm(props: ContentBuilderSeoFormProps): React.JSX.Element;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ContentBuilderSeoForm = ContentBuilderSeoForm;
7
- const file_input_1 = require("@uxf/form/file-input");
8
- const text_input_1 = require("@uxf/form/text-input");
9
- const react_1 = __importDefault(require("react"));
10
- const api_1 = require("../../api");
11
- function ContentBuilderSeoForm(props) {
12
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
13
- return (react_1.default.createElement("div", { className: props.className },
14
- !((_c = (_b = (_a = props.fields) === null || _a === void 0 ? void 0 : _a.seo) === null || _b === void 0 ? void 0 : _b.name) === null || _c === void 0 ? void 0 : _c.isHidden) && (react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, helperText: "Slug = unik\u00E1tn\u00ED koncovka URL adresy", isRequired: true, label: "Slug", name: "seo.name", type: "text" })),
15
- !((_f = (_e = (_d = props.fields) === null || _d === void 0 ? void 0 : _d.seo) === null || _e === void 0 ? void 0 : _e.title) === null || _f === void 0 ? void 0 : _f.isHidden) && (react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, label: "Nadpis", name: "seo.title", type: "text" })),
16
- !((_j = (_h = (_g = props.fields) === null || _g === void 0 ? void 0 : _g.seo) === null || _h === void 0 ? void 0 : _h.description) === null || _j === void 0 ? void 0 : _j.isHidden) && (react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, label: "Popis", name: "seo.description", type: "text" })),
17
- !((_m = (_l = (_k = props.fields) === null || _k === void 0 ? void 0 : _k.seo) === null || _l === void 0 ? void 0 : _l.ogTitle) === null || _m === void 0 ? void 0 : _m.isHidden) && (react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, helperText: "Nadpis kter\u00FD bude zobrazen p\u0159i sd\u00EDlen\u00ED na Facebooku, ...", label: "OG nadpis", name: "seo.ogTitle", type: "text" })),
18
- !((_q = (_p = (_o = props.fields) === null || _o === void 0 ? void 0 : _o.seo) === null || _p === void 0 ? void 0 : _p.ogDescription) === null || _q === void 0 ? void 0 : _q.isHidden) && (react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, helperText: "Popis kter\u00FD bude zobrazen p\u0159i sd\u00EDlen\u00ED na Facebooku, ...", label: "OG popis", name: "seo.ogDescription", type: "text" })),
19
- !((_t = (_s = (_r = props.fields) === null || _r === void 0 ? void 0 : _r.seo) === null || _s === void 0 ? void 0 : _s.ogImage) === null || _t === void 0 ? void 0 : _t.isHidden) && (react_1.default.createElement(file_input_1.FileInput, { control: props.formApi.control, helperText: "Obr\u00E1zek kter\u00FD bude zobrazen p\u0159i sd\u00EDlen\u00ED na Facebooku, ...", id: "seo.ogImage", label: "OG obr\u00E1zek", name: "seo.ogImage", onUploadFile: (file) => (0, api_1.uploadFile)(file, props.uploadNamespace) }))));
20
- }
@@ -1,4 +0,0 @@
1
- export * from "./content-builder";
2
- export * from "./content-builder-root";
3
- export * from "./map-content-response-to-form-data";
4
- export * from "./map-form-data-to-content-request";
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./content-builder"), exports);
18
- __exportStar(require("./content-builder-root"), exports);
19
- __exportStar(require("./map-content-response-to-form-data"), exports);
20
- __exportStar(require("./map-form-data-to-content-request"), exports);
@@ -1,3 +0,0 @@
1
- import { Nullish } from "@uxf/core/types";
2
- import { ContentBuilderFormData, ContentResponse } from "./types";
3
- export declare function mapContentResponseToFormData(content: ContentResponse | Nullish): ContentBuilderFormData;
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapContentResponseToFormData = mapContentResponseToFormData;
4
- const is_not_empty_1 = require("@uxf/core/utils/is-not-empty");
5
- const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
6
- function mapContentResponseToFormData(content) {
7
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
8
- return {
9
- name: (_a = content === null || content === void 0 ? void 0 : content.name) !== null && _a !== void 0 ? _a : "",
10
- visibilityLevel: (_b = content === null || content === void 0 ? void 0 : content.visibilityLevel) !== null && _b !== void 0 ? _b : null,
11
- authorText: [(_c = content === null || content === void 0 ? void 0 : content.author) === null || _c === void 0 ? void 0 : _c.firstName, (_d = content === null || content === void 0 ? void 0 : content.author) === null || _d === void 0 ? void 0 : _d.surname]
12
- .filter(is_not_nil_1.isNotNil)
13
- .filter(is_not_empty_1.isNotEmpty)
14
- .join(" "),
15
- author: (content === null || content === void 0 ? void 0 : content.author)
16
- ? {
17
- id: content.author.id,
18
- label: `${content.author.firstName} ${content.author.surname}`,
19
- }
20
- : null,
21
- image: (_e = content === null || content === void 0 ? void 0 : content.image) !== null && _e !== void 0 ? _e : null,
22
- publishedAt: (_f = content === null || content === void 0 ? void 0 : content.publishedAt) !== null && _f !== void 0 ? _f : null,
23
- type: (_g = content === null || content === void 0 ? void 0 : content.type) !== null && _g !== void 0 ? _g : null,
24
- category: (content === null || content === void 0 ? void 0 : content.category)
25
- ? {
26
- id: content.category.id,
27
- label: content.category.name,
28
- }
29
- : null,
30
- parent: (_h = content === null || content === void 0 ? void 0 : content.parent) !== null && _h !== void 0 ? _h : null,
31
- isActive: !(content === null || content === void 0 ? void 0 : content.hidden),
32
- perex: (_j = content === null || content === void 0 ? void 0 : content.perex) !== null && _j !== void 0 ? _j : null,
33
- tags: (_k = content === null || content === void 0 ? void 0 : content.tags) !== null && _k !== void 0 ? _k : [],
34
- seo: {
35
- name: (_l = content === null || content === void 0 ? void 0 : content.seo.name) !== null && _l !== void 0 ? _l : "",
36
- title: (_m = content === null || content === void 0 ? void 0 : content.seo.title) !== null && _m !== void 0 ? _m : "",
37
- description: (_o = content === null || content === void 0 ? void 0 : content.seo.description) !== null && _o !== void 0 ? _o : "",
38
- ogTitle: (_p = content === null || content === void 0 ? void 0 : content.seo.ogTitle) !== null && _p !== void 0 ? _p : "",
39
- ogDescription: (_q = content === null || content === void 0 ? void 0 : content.seo.ogDescription) !== null && _q !== void 0 ? _q : "",
40
- ogImage: (_r = content === null || content === void 0 ? void 0 : content.seo.ogImage) !== null && _r !== void 0 ? _r : null,
41
- },
42
- content: { data: (_s = content === null || content === void 0 ? void 0 : content.content) !== null && _s !== void 0 ? _s : [], search: "" },
43
- };
44
- }
@@ -1,2 +0,0 @@
1
- import { ContentBuilderFormData, ContentRequestBody } from "./types";
2
- export declare function mapFormDataToContentRequest(values: ContentBuilderFormData): ContentRequestBody;