@uxf/cms 11.74.0 → 11.74.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.
- package/api/index.d.ts +165 -0
- package/api/index.js +100 -0
- package/api/swr.d.ts +76 -0
- package/api/swr.js +43 -0
- package/config/container.d.ts +29 -0
- package/config/container.js +24 -0
- package/config/index.d.ts +2 -0
- package/config/index.js +6 -0
- package/content-builder/content-builder-body.d.ts +6 -0
- package/content-builder/content-builder-body.js +10 -0
- package/content-builder/content-builder-header.d.ts +7 -0
- package/content-builder/content-builder-header.js +15 -0
- package/content-builder/content-builder-root.d.ts +11 -0
- package/content-builder/content-builder-root.js +13 -0
- package/content-builder/content-builder-sidebar.d.ts +7 -0
- package/content-builder/content-builder-sidebar.js +12 -0
- package/content-builder/content-builder.d.ts +14 -0
- package/content-builder/content-builder.js +57 -0
- package/content-builder/forms/content-builder-basic-form.d.ts +10 -0
- package/content-builder/forms/content-builder-basic-form.js +49 -0
- package/content-builder/forms/content-builder-seo-form.d.ts +10 -0
- package/content-builder/forms/content-builder-seo-form.js +22 -0
- package/content-builder/index.d.ts +4 -0
- package/content-builder/index.js +20 -0
- package/content-builder/map-content-response-to-form-data.d.ts +3 -0
- package/content-builder/map-content-response-to-form-data.js +44 -0
- package/content-builder/map-form-data-to-content-request.d.ts +2 -0
- package/content-builder/map-form-data-to-content-request.js +28 -0
- package/content-builder/translations.d.ts +127 -0
- package/content-builder/translations.js +128 -0
- package/content-builder/types.d.ts +186 -0
- package/content-builder/types.js +2 -0
- package/content-builder/use-content-builder-form-api.d.ts +3 -0
- package/content-builder/use-content-builder-form-api.js +7 -0
- package/context/cms-provider.d.ts +7 -0
- package/context/cms-provider.js +18 -0
- package/deprecated/api/api-client.d.ts +15 -0
- package/deprecated/api/api-client.js +86 -0
- package/deprecated/hoc/with-authenticate.d.ts +6 -0
- package/deprecated/hoc/with-authenticate.js +61 -0
- package/deprecated/redux/configure-store.d.ts +3 -0
- package/deprecated/redux/configure-store.js +16 -0
- package/deprecated/redux/entities/actions.d.ts +30 -0
- package/deprecated/redux/entities/actions.js +15 -0
- package/deprecated/redux/entities/index.d.ts +2 -0
- package/deprecated/redux/entities/index.js +18 -0
- package/deprecated/redux/entities/reducer.d.ts +3 -0
- package/deprecated/redux/entities/reducer.js +36 -0
- package/deprecated/redux/entities/selectors.d.ts +10 -0
- package/deprecated/redux/entities/selectors.js +16 -0
- package/deprecated/redux/index.d.ts +3 -0
- package/deprecated/redux/index.js +22 -0
- package/deprecated/redux/redux-helper.d.ts +15 -0
- package/deprecated/redux/redux-helper.js +6 -0
- package/deprecated/redux/types.d.ts +7 -0
- package/deprecated/redux/types.js +2 -0
- package/deprecated/redux/user/actions.d.ts +19 -0
- package/deprecated/redux/user/actions.js +14 -0
- package/deprecated/redux/user/index.d.ts +2 -0
- package/deprecated/redux/user/index.js +18 -0
- package/deprecated/redux/user/reducer.d.ts +3 -0
- package/deprecated/redux/user/reducer.js +21 -0
- package/deprecated/redux/user/selectors.d.ts +3 -0
- package/deprecated/redux/user/selectors.js +5 -0
- package/deprecated/redux/with-redux-store.d.ts +1 -0
- package/deprecated/redux/with-redux-store.js +70 -0
- package/deprecated/security/cms-authorizator.d.ts +3 -0
- package/deprecated/security/cms-authorizator.js +8 -0
- package/deprecated/types/app.d.ts +6 -0
- package/deprecated/types/app.js +2 -0
- package/deprecated/types/form.d.ts +25 -0
- package/deprecated/types/form.js +16 -0
- package/errors/BadRequestError.d.ts +18 -0
- package/errors/BadRequestError.js +14 -0
- package/errors/ForbiddenError.d.ts +4 -0
- package/errors/ForbiddenError.js +13 -0
- package/errors/NetworkError.d.ts +4 -0
- package/errors/NetworkError.js +13 -0
- package/errors/UnauthorizedError.d.ts +4 -0
- package/errors/UnauthorizedError.js +13 -0
- package/errors/ValidationError.d.ts +7 -0
- package/errors/ValidationError.js +17 -0
- package/form-renderer/field/content-dynamic.d.ts +8 -0
- package/form-renderer/field/content-dynamic.js +15 -0
- package/form-renderer/field/content.d.ts +5 -0
- package/form-renderer/field/content.js +38 -0
- package/forms/change-password-form/change-password-form.d.ts +3 -0
- package/forms/change-password-form/change-password-form.js +31 -0
- package/forms/change-password-form/index.d.ts +2 -0
- package/forms/change-password-form/index.js +18 -0
- package/forms/change-password-form/translations.d.ts +35 -0
- package/forms/change-password-form/translations.js +36 -0
- package/forms/change-password-form/types.d.ts +13 -0
- package/forms/change-password-form/types.js +2 -0
- package/forms/components/wysiwyg-input/index.d.ts +1 -0
- package/forms/components/wysiwyg-input/index.js +17 -0
- package/forms/components/wysiwyg-input/wysiwyg-input.d.ts +26 -0
- package/forms/components/wysiwyg-input/wysiwyg-input.js +83 -0
- package/forms/forgotten-password-form/forgotten-password-form.d.ts +3 -0
- package/forms/forgotten-password-form/forgotten-password-form.js +52 -0
- package/forms/forgotten-password-form/index.d.ts +2 -0
- package/forms/forgotten-password-form/index.js +18 -0
- package/forms/forgotten-password-form/translations.d.ts +17 -0
- package/forms/forgotten-password-form/translations.js +18 -0
- package/forms/forgotten-password-form/types.d.ts +10 -0
- package/forms/forgotten-password-form/types.js +2 -0
- package/forms/invite-user-form/index.d.ts +2 -0
- package/forms/invite-user-form/index.js +18 -0
- package/forms/invite-user-form/invite-user-form.d.ts +3 -0
- package/forms/invite-user-form/invite-user-form.js +33 -0
- package/forms/invite-user-form/translations.d.ts +35 -0
- package/forms/invite-user-form/translations.js +36 -0
- package/forms/invite-user-form/types.d.ts +15 -0
- package/forms/invite-user-form/types.js +2 -0
- package/forms/login-form/index.d.ts +2 -0
- package/forms/login-form/index.js +18 -0
- package/forms/login-form/login-form.d.ts +3 -0
- package/forms/login-form/login-form.js +51 -0
- package/forms/login-form/translations.d.ts +23 -0
- package/forms/login-form/translations.js +24 -0
- package/forms/login-form/types.d.ts +11 -0
- package/forms/login-form/types.js +2 -0
- package/forms/renew-password-form/index.d.ts +2 -0
- package/forms/renew-password-form/index.js +18 -0
- package/forms/renew-password-form/renew-password-form.d.ts +3 -0
- package/forms/renew-password-form/renew-password-form.js +53 -0
- package/forms/renew-password-form/translations.d.ts +29 -0
- package/forms/renew-password-form/translations.js +30 -0
- package/forms/renew-password-form/types.d.ts +11 -0
- package/forms/renew-password-form/types.js +2 -0
- package/lib/api/create-axios-instance.d.ts +6 -0
- package/lib/api/create-axios-instance.js +17 -0
- package/lib/api/create-axios-request.d.ts +3 -0
- package/lib/api/create-axios-request.js +39 -0
- package/lib/api/create-use-axios-request.d.ts +5 -0
- package/lib/api/create-use-axios-request.js +35 -0
- package/lib/api/index.d.ts +2 -0
- package/lib/api/index.js +19 -0
- package/lib/api/types.d.ts +18 -0
- package/lib/api/types.js +2 -0
- package/lib/layout/breadcrumbs.d.ts +9 -0
- package/lib/layout/breadcrumbs.js +21 -0
- package/lib/layout/index.d.ts +3 -0
- package/lib/layout/index.js +19 -0
- package/lib/layout/layout-container.d.ts +3 -0
- package/lib/layout/layout-container.js +22 -0
- package/lib/layout/layout.d.ts +3 -0
- package/lib/layout/layout.js +47 -0
- package/lib/layout/sidebar.d.ts +3 -0
- package/lib/layout/sidebar.js +77 -0
- package/lib/layout/styles.d.ts +1 -0
- package/lib/layout/styles.js +4 -0
- package/lib/layout/types.d.ts +36 -0
- package/lib/layout/types.js +2 -0
- package/lib/login-layout/index.d.ts +2 -0
- package/lib/login-layout/index.js +18 -0
- package/lib/login-layout/login-layout.d.ts +3 -0
- package/lib/login-layout/login-layout.js +19 -0
- package/lib/login-layout/types.d.ts +9 -0
- package/lib/login-layout/types.js +2 -0
- package/lib/menu/active-item-resolver.d.ts +7 -0
- package/lib/menu/active-item-resolver.js +42 -0
- package/lib/menu/factory.d.ts +10 -0
- package/lib/menu/factory.js +40 -0
- package/lib/menu/index.d.ts +5 -0
- package/lib/menu/index.js +21 -0
- package/lib/menu/mobile-bar.d.ts +8 -0
- package/lib/menu/mobile-bar.js +54 -0
- package/lib/menu/model.d.ts +56 -0
- package/lib/menu/model.js +112 -0
- package/lib/menu/types.d.ts +5 -0
- package/lib/menu/types.js +2 -0
- package/lib/menu/ui/list-item/index.d.ts +2 -0
- package/lib/menu/ui/list-item/index.js +18 -0
- package/lib/menu/ui/list-item/list-item.d.ts +3 -0
- package/lib/menu/ui/list-item/list-item.js +37 -0
- package/lib/menu/ui/list-item/types.d.ts +19 -0
- package/lib/menu/ui/list-item/types.js +2 -0
- package/lib/menu/ui/menu-custom-item.d.ts +6 -0
- package/lib/menu/ui/menu-custom-item.js +17 -0
- package/lib/menu/ui/menu-item.d.ts +6 -0
- package/lib/menu/ui/menu-item.js +55 -0
- package/lib/menu/ui/menu-super-section-item.d.ts +6 -0
- package/lib/menu/ui/menu-super-section-item.js +40 -0
- package/lib/menu/ui/menu.d.ts +6 -0
- package/lib/menu/ui/menu.js +37 -0
- package/lib/menu/ui/sub-menu/sub-menu-item.d.ts +7 -0
- package/lib/menu/ui/sub-menu/sub-menu-item.js +23 -0
- package/lib/menu/ui/sub-menu/sub-menu-mobile.d.ts +8 -0
- package/lib/menu/ui/sub-menu/sub-menu-mobile.js +48 -0
- package/lib/menu/ui/sub-menu/sub-menu.d.ts +7 -0
- package/lib/menu/ui/sub-menu/sub-menu.js +46 -0
- package/lib/menu/ui/sub-menu/use-sub-menu.d.ts +49 -0
- package/lib/menu/ui/sub-menu/use-sub-menu.js +45 -0
- package/lib/menu/ui/translations.d.ts +17 -0
- package/lib/menu/ui/translations.js +18 -0
- package/lib/menu/ui/user-menu.d.ts +6 -0
- package/lib/menu/ui/user-menu.js +55 -0
- package/package.json +6 -6
- package/pages/content-builder/components/form-content.d.ts +12 -0
- package/pages/content-builder/components/form-content.js +64 -0
- package/pages/content-builder/components/form-root-fields.d.ts +16 -0
- package/pages/content-builder/components/form-root-fields.js +62 -0
- package/pages/content-builder/components/form.d.ts +12 -0
- package/pages/content-builder/components/form.js +83 -0
- package/pages/content-builder/components/header.d.ts +6 -0
- package/pages/content-builder/components/header.js +18 -0
- package/pages/content-builder/constants.d.ts +6 -0
- package/pages/content-builder/constants.js +10 -0
- package/pages/content-builder/content/feature-section.d.ts +17 -0
- package/pages/content-builder/content/feature-section.js +62 -0
- package/pages/content-builder/content/gallery.d.ts +9 -0
- package/pages/content-builder/content/gallery.js +29 -0
- package/pages/content-builder/content/hero-section.d.ts +12 -0
- package/pages/content-builder/content/hero-section.js +35 -0
- package/pages/content-builder/content/people.d.ts +17 -0
- package/pages/content-builder/content/people.js +61 -0
- package/pages/content-builder/content/wysiwyg.d.ts +15 -0
- package/pages/content-builder/content/wysiwyg.js +32 -0
- package/pages/content-builder/content-builder-page.d.ts +3 -0
- package/pages/content-builder/content-builder-page.js +107 -0
- package/pages/content-builder/content-field.d.ts +10 -0
- package/pages/content-builder/content-field.js +62 -0
- package/pages/content-builder/content-header.d.ts +3 -0
- package/pages/content-builder/content-header.js +55 -0
- package/pages/content-builder/context/details-visibility-context.d.ts +4 -0
- package/pages/content-builder/context/details-visibility-context.js +58 -0
- package/pages/content-builder/hooks/use-sortable.d.ts +15 -0
- package/pages/content-builder/hooks/use-sortable.js +57 -0
- package/pages/content-builder/index.d.ts +5 -0
- package/pages/content-builder/index.js +21 -0
- package/pages/content-builder/mapper.d.ts +4 -0
- package/pages/content-builder/mapper.js +69 -0
- package/pages/content-builder/types.d.ts +94 -0
- package/pages/content-builder/types.js +2 -0
- package/pages/forgotten-password-page/forgotten-password-page.d.ts +5 -0
- package/pages/forgotten-password-page/forgotten-password-page.js +49 -0
- package/pages/forgotten-password-page/index.d.ts +2 -0
- package/pages/forgotten-password-page/index.js +18 -0
- package/pages/forgotten-password-page/types.d.ts +11 -0
- package/pages/forgotten-password-page/types.js +2 -0
- package/pages/grid-page/get-initial-props-helper.d.ts +4 -0
- package/pages/grid-page/get-initial-props-helper.js +20 -0
- package/pages/grid-page/grid-page.d.ts +6 -0
- package/pages/grid-page/grid-page.js +161 -0
- package/pages/grid-page/index.d.ts +1 -0
- package/pages/grid-page/index.js +5 -0
- package/pages/grid-page/types.d.ts +65 -0
- package/pages/grid-page/types.js +2 -0
- package/pages/grid-page/use-hidden-columns.d.ts +4 -0
- package/pages/grid-page/use-hidden-columns.js +17 -0
- package/pages/invite-user-page/index.d.ts +2 -0
- package/pages/invite-user-page/index.js +18 -0
- package/pages/invite-user-page/invite-user-page.d.ts +2 -0
- package/pages/invite-user-page/invite-user-page.js +57 -0
- package/pages/invite-user-page/types.d.ts +12 -0
- package/pages/invite-user-page/types.js +2 -0
- package/pages/login-page/index.d.ts +2 -0
- package/pages/login-page/index.js +18 -0
- package/pages/login-page/login-page.d.ts +5 -0
- package/pages/login-page/login-page.js +80 -0
- package/pages/login-page/types.d.ts +21 -0
- package/pages/login-page/types.js +2 -0
- package/pages/renew-password-page/index.d.ts +2 -0
- package/pages/renew-password-page/index.js +18 -0
- package/pages/renew-password-page/renew-password-page.d.ts +9 -0
- package/pages/renew-password-page/renew-password-page.js +53 -0
- package/pages/renew-password-page/types.d.ts +14 -0
- package/pages/renew-password-page/types.js +2 -0
- package/pages/translations.d.ts +93 -0
- package/pages/translations.js +94 -0
- package/security/restricted-page.d.ts +10 -0
- package/security/restricted-page.js +40 -0
- package/security/translations.d.ts +29 -0
- package/security/translations.js +30 -0
- package/security/use-logged-user.d.ts +5 -0
- package/security/use-logged-user.js +17 -0
- package/ui/avatar/avatar.d.ts +11 -0
- package/ui/avatar/avatar.js +47 -0
- package/ui/avatar/get-avatar-user-letters.d.ts +1 -0
- package/ui/avatar/get-avatar-user-letters.js +18 -0
- package/ui/avatar/index.d.ts +3 -0
- package/ui/avatar/index.js +5 -0
- package/ui/avatar/theme.d.ts +11 -0
- package/ui/avatar/theme.js +2 -0
- package/ui/copy-to-clipboard/copy-to-clipboard.d.ts +3 -0
- package/ui/copy-to-clipboard/copy-to-clipboard.js +47 -0
- package/ui/copy-to-clipboard/index.d.ts +2 -0
- package/ui/copy-to-clipboard/index.js +18 -0
- package/ui/copy-to-clipboard/translations.d.ts +17 -0
- package/ui/copy-to-clipboard/translations.js +18 -0
- package/ui/copy-to-clipboard/types.d.ts +7 -0
- package/ui/copy-to-clipboard/types.js +2 -0
- package/ui/copy-to-clipboard-button/copy-to-clipboard-button.d.ts +3 -0
- package/ui/copy-to-clipboard-button/copy-to-clipboard-button.js +48 -0
- package/ui/copy-to-clipboard-button/index.d.ts +2 -0
- package/ui/copy-to-clipboard-button/index.js +18 -0
- package/ui/copy-to-clipboard-button/translations.d.ts +17 -0
- package/ui/copy-to-clipboard-button/translations.js +18 -0
- package/ui/copy-to-clipboard-button/types.d.ts +6 -0
- package/ui/copy-to-clipboard-button/types.js +2 -0
- package/ui/index.d.ts +1 -0
- package/ui/index.js +6 -0
- package/ui/tw-tokens/tw-box-shadow.d.ts +12 -0
- package/ui/tw-tokens/tw-box-shadow.js +15 -0
- package/ui/tw-tokens/tw-colors.d.ts +475 -0
- package/ui/tw-tokens/tw-colors.js +474 -0
- package/ui/tw-tokens/tw-containers.d.ts +8 -0
- package/ui/tw-tokens/tw-containers.js +5 -0
- package/ui/tw-tokens/tw-font-size.d.ts +55 -0
- package/ui/tw-tokens/tw-font-size.js +32 -0
- package/ui/tw-tokens/tw-font-weight.d.ts +12 -0
- package/ui/tw-tokens/tw-font-weight.js +15 -0
- package/ui/tw-tokens/tw-line-height.d.ts +17 -0
- package/ui/tw-tokens/tw-line-height.js +20 -0
- package/ui/tw-tokens/tw-screens.d.ts +8 -0
- package/ui/tw-tokens/tw-screens.js +5 -0
- package/ui/tw-tokens/tw-spacing.d.ts +39 -0
- package/ui/tw-tokens/tw-spacing.js +42 -0
- package/ui/tw-tokens/tw-z-index.d.ts +21 -0
- package/ui/tw-tokens/tw-z-index.js +24 -0
- package/ui/widget/index.d.ts +2 -0
- package/ui/widget/index.js +18 -0
- package/ui/widget/types.d.ts +6 -0
- package/ui/widget/types.js +2 -0
- package/ui/widget/widget.d.ts +3 -0
- package/ui/widget/widget.js +15 -0
- package/utils/remove-confirm-handler.d.ts +1 -0
- package/utils/remove-confirm-handler.js +31 -0
- package/utils/translations.d.ts +23 -0
- package/utils/translations.js +24 -0
- package/utils/use-viewport-height.d.ts +3 -0
- package/utils/use-viewport-height.js +28 -0
package/api/index.d.ts
ADDED
@@ -0,0 +1,165 @@
|
|
1
|
+
import { FileResponse } from "@uxf/core/types";
|
2
|
+
import { Schema } from "@uxf/data-grid";
|
3
|
+
export type VisibilityLevel = "PUBLIC" | "PUBLIC_WITHOUT_SITEMAP" | "PRIVATE";
|
4
|
+
export interface ContentSeoResponse {
|
5
|
+
name: string | null;
|
6
|
+
title: string;
|
7
|
+
description: string;
|
8
|
+
ogTitle: string;
|
9
|
+
ogDescription: string;
|
10
|
+
ogImage: FileResponse | null;
|
11
|
+
}
|
12
|
+
export interface ContentAuthorResponse {
|
13
|
+
id: number;
|
14
|
+
firstName: string;
|
15
|
+
surname: string;
|
16
|
+
avatar: FileResponse | null;
|
17
|
+
}
|
18
|
+
export interface ContentCategoryResponse {
|
19
|
+
id: number;
|
20
|
+
name: string;
|
21
|
+
}
|
22
|
+
export interface ContentTagResponse {
|
23
|
+
id: number;
|
24
|
+
code: string;
|
25
|
+
label: string;
|
26
|
+
}
|
27
|
+
export interface ContentResponse {
|
28
|
+
id: number;
|
29
|
+
type: string;
|
30
|
+
name: string;
|
31
|
+
perex: string;
|
32
|
+
parent?: {
|
33
|
+
id: number;
|
34
|
+
label: string;
|
35
|
+
} | null;
|
36
|
+
seo: ContentSeoResponse;
|
37
|
+
visibilityLevel: VisibilityLevel;
|
38
|
+
hidden: boolean;
|
39
|
+
image: FileResponse | null;
|
40
|
+
publishedAt: string | null;
|
41
|
+
author: ContentAuthorResponse | null;
|
42
|
+
category: ContentCategoryResponse | null;
|
43
|
+
content: any[];
|
44
|
+
tags: ContentTagResponse[];
|
45
|
+
createdAt: string;
|
46
|
+
updatedAt: string;
|
47
|
+
}
|
48
|
+
export interface ContentSeoRequestBody {
|
49
|
+
name: string | null;
|
50
|
+
title: string;
|
51
|
+
description: string;
|
52
|
+
ogTitle: string;
|
53
|
+
ogDescription: string;
|
54
|
+
ogImage: number | null;
|
55
|
+
}
|
56
|
+
export interface ContentRequestBody {
|
57
|
+
type: string;
|
58
|
+
name: string;
|
59
|
+
perex: string;
|
60
|
+
parent: number | null;
|
61
|
+
seo: ContentSeoRequestBody;
|
62
|
+
visibilityLevel: VisibilityLevel;
|
63
|
+
hidden: boolean;
|
64
|
+
image: number | null;
|
65
|
+
publishedAt: string | null;
|
66
|
+
author: number | null;
|
67
|
+
category: number | null;
|
68
|
+
content: any;
|
69
|
+
tags: number[];
|
70
|
+
}
|
71
|
+
export interface FieldSchemaResponse {
|
72
|
+
autocomplete: string | null;
|
73
|
+
name: string;
|
74
|
+
type: string;
|
75
|
+
label: string;
|
76
|
+
required: boolean;
|
77
|
+
readOnly: boolean;
|
78
|
+
editable: boolean;
|
79
|
+
fields: FieldSchemaResponse[];
|
80
|
+
options: Array<{
|
81
|
+
id: string | number;
|
82
|
+
label: string;
|
83
|
+
}> | null;
|
84
|
+
}
|
85
|
+
export interface FormSchemaResponse {
|
86
|
+
fields: FieldSchemaResponse[];
|
87
|
+
}
|
88
|
+
export default interface UserResponse {
|
89
|
+
id: number | string;
|
90
|
+
email: string;
|
91
|
+
name: string;
|
92
|
+
roles: string[];
|
93
|
+
}
|
94
|
+
export interface UserInfoResponse {
|
95
|
+
user: UserResponse;
|
96
|
+
}
|
97
|
+
export interface EntityMetaSchema {
|
98
|
+
title: string;
|
99
|
+
entityAlias: string;
|
100
|
+
actions: string[];
|
101
|
+
}
|
102
|
+
export interface EntityMetaSchemasResponse {
|
103
|
+
[entityAlias: string]: EntityMetaSchema;
|
104
|
+
}
|
105
|
+
export interface AutocompleteResultResponse {
|
106
|
+
id: number | string;
|
107
|
+
label: string;
|
108
|
+
}
|
109
|
+
export interface LoginRequestBody {
|
110
|
+
username: string;
|
111
|
+
password: string;
|
112
|
+
}
|
113
|
+
export interface LoginResponse {
|
114
|
+
access_token: string;
|
115
|
+
refresh_token: string;
|
116
|
+
expires_in: number;
|
117
|
+
token_type: string;
|
118
|
+
}
|
119
|
+
export interface UserConfigResponse<T> {
|
120
|
+
id: number;
|
121
|
+
name: string;
|
122
|
+
data: T;
|
123
|
+
}
|
124
|
+
export interface UserConfigBagResponse {
|
125
|
+
[name: string]: UserConfigResponse<any>;
|
126
|
+
}
|
127
|
+
export declare function contentGet(ctx: any, contentId: number): Promise<import("axios").AxiosResponse<ContentResponse, any>>;
|
128
|
+
export declare function contentCreate(ctx: any, content: ContentRequestBody): Promise<import("axios").AxiosResponse<ContentResponse, any>>;
|
129
|
+
export declare function contentUpdate(ctx: any, contentId: number, content: ContentRequestBody): Promise<import("axios").AxiosResponse<ContentResponse, any>>;
|
130
|
+
export declare function dataGridSchemaGet(ctx: any, gridName: string): Promise<import("axios").AxiosResponse<Schema<any>, any>>;
|
131
|
+
export declare const dataGridAutocompleteGet: (ctx: any, gridName: string, filterName: string, text: string) => Promise<{
|
132
|
+
value: number;
|
133
|
+
label: string;
|
134
|
+
}[]>;
|
135
|
+
export declare function forgottenPassword(ctx: any, email: string, cms?: boolean): Promise<void>;
|
136
|
+
export declare function getLoggedUser(ctx?: any): Promise<UserResponse>;
|
137
|
+
export declare function getEntityMetaSchemas(ctx: any): Promise<import("axios").AxiosResponse<EntityMetaSchemasResponse, any>>;
|
138
|
+
export declare function getFormSchema(ctx: any, path: {
|
139
|
+
entityAlias: string;
|
140
|
+
}): Promise<import("axios").AxiosResponse<FormSchemaResponse, any>>;
|
141
|
+
export declare function getFormValues(ctx: any, path: {
|
142
|
+
entityAlias: string;
|
143
|
+
id: number;
|
144
|
+
}): Promise<import("axios").AxiosResponse<any, any>>;
|
145
|
+
export declare function login(ctx: any, body: LoginRequestBody): Promise<import("axios").AxiosResponse<LoginResponse, any>>;
|
146
|
+
export declare function autocomplete(ctx: any, path: {
|
147
|
+
name: string;
|
148
|
+
}, query: {
|
149
|
+
term: string;
|
150
|
+
}): Promise<import("axios").AxiosResponse<AutocompleteResultResponse[], any>>;
|
151
|
+
export declare function saveFormValues<T extends Record<string, any>>(ctx: any, path: {
|
152
|
+
entityAlias: string;
|
153
|
+
id?: number | null;
|
154
|
+
}, body: T): Promise<import("axios").AxiosResponse<T, any>>;
|
155
|
+
export declare function removeEntity(ctx: any, path: {
|
156
|
+
entityAlias: string;
|
157
|
+
id: number;
|
158
|
+
}): Promise<import("axios").AxiosResponse<undefined, any>>;
|
159
|
+
export declare function userConfigSave(name: string, data: any): Promise<import("axios").AxiosResponse<UserConfigBagResponse, any>>;
|
160
|
+
export declare function userConfigGetAll(ctx: any): Promise<import("axios").AxiosResponse<UserConfigBagResponse, any>>;
|
161
|
+
export declare function userConfigGet<T>(ctx: any, name: string, defaultValue?: T): Promise<T | undefined>;
|
162
|
+
/**
|
163
|
+
* @deprecated use import { uploadFile } from "@uxf/core/api/upload-file" or createUploadHandler
|
164
|
+
*/
|
165
|
+
export declare function uploadFile(file: File, namespace?: string | null): Promise<FileResponse>;
|
package/api/index.js
ADDED
@@ -0,0 +1,100 @@
|
|
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
ADDED
@@ -0,0 +1,76 @@
|
|
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
ADDED
@@ -0,0 +1,43 @@
|
|
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;
|
@@ -0,0 +1,29 @@
|
|
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 {};
|
@@ -0,0 +1,24 @@
|
|
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.js
ADDED
@@ -0,0 +1,10 @@
|
|
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
|
+
}
|
@@ -0,0 +1,15 @@
|
|
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 translations_1 = require("@uxf/core-react/translations");
|
8
|
+
const button_1 = require("@uxf/ui/button");
|
9
|
+
const react_1 = __importDefault(require("react"));
|
10
|
+
function ContentBuilderHeader(props) {
|
11
|
+
const t = (0, translations_1.useUxfTranslation)();
|
12
|
+
return (react_1.default.createElement("div", { className: "uxf-cb__header" },
|
13
|
+
react_1.default.createElement("h1", { className: "uxg-cb__header-title uxf-typo-h5" }, props.title),
|
14
|
+
react_1.default.createElement(button_1.Button, { type: "submit" }, t("uxf-cms-content-builder:header.save"))));
|
15
|
+
}
|
@@ -0,0 +1,11 @@
|
|
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 {};
|
@@ -0,0 +1,13 @@
|
|
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
|
+
}
|
@@ -0,0 +1,12 @@
|
|
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
|
+
}
|
@@ -0,0 +1,14 @@
|
|
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;
|
@@ -0,0 +1,57 @@
|
|
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 translations_1 = require("@uxf/core-react/translations");
|
28
|
+
const tabs_1 = require("@uxf/ui/tabs");
|
29
|
+
const react_1 = __importStar(require("react"));
|
30
|
+
const content_builder_1 = require("../pages/content-builder");
|
31
|
+
const content_builder_body_1 = require("./content-builder-body");
|
32
|
+
const content_builder_header_1 = require("./content-builder-header");
|
33
|
+
const content_builder_root_1 = require("./content-builder-root");
|
34
|
+
const content_builder_sidebar_1 = require("./content-builder-sidebar");
|
35
|
+
const content_builder_basic_form_1 = require("./forms/content-builder-basic-form");
|
36
|
+
const content_builder_seo_form_1 = require("./forms/content-builder-seo-form");
|
37
|
+
var TabName;
|
38
|
+
(function (TabName) {
|
39
|
+
TabName["Basic"] = "basic";
|
40
|
+
TabName["Seo"] = "seo";
|
41
|
+
})(TabName || (TabName = {}));
|
42
|
+
function ContentBuilder(props) {
|
43
|
+
var _a, _b;
|
44
|
+
const generatedId = (0, react_1.useId)();
|
45
|
+
const [activeTab, setActiveTab] = (0, react_1.useState)(TabName.Basic);
|
46
|
+
const t = (0, translations_1.useUxfTranslation)();
|
47
|
+
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 },
|
48
|
+
react_1.default.createElement(content_builder_header_1.ContentBuilderHeader, { title: (_b = props.title) !== null && _b !== void 0 ? _b : t("uxf-cms-content-builder:settings.default-title") }),
|
49
|
+
react_1.default.createElement(content_builder_body_1.ContentBuilderBody, null,
|
50
|
+
react_1.default.createElement(content_builder_1.ContentField, { contentComponents: props.ContentComponents, control: props.formApi.control, name: "content" }),
|
51
|
+
react_1.default.createElement(content_builder_sidebar_1.ContentBuilderSidebar, { title: t("uxf-cms-content-builder:settings.settings") },
|
52
|
+
react_1.default.createElement(tabs_1.Tabs, { onChange: setActiveTab, value: activeTab },
|
53
|
+
react_1.default.createElement(tabs_1.Tabs.Panel, { isAlwaysMounted: true, label: t("uxf-cms-content-builder:settings.basic"), name: TabName.Basic },
|
54
|
+
react_1.default.createElement(content_builder_basic_form_1.ContentBuilderBasicForm, { className: "space-y-8", fields: props.fields, formApi: props.formApi, uploadNamespace: props.uploadNamespace })),
|
55
|
+
react_1.default.createElement(tabs_1.Tabs.Panel, { isAlwaysMounted: true, label: "SEO", name: TabName.Seo },
|
56
|
+
react_1.default.createElement(content_builder_seo_form_1.ContentBuilderSeoForm, { className: "space-y-8", fields: props.fields, formApi: props.formApi, uploadNamespace: props.uploadNamespace })))))));
|
57
|
+
}
|
@@ -0,0 +1,10 @@
|
|
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;
|