@uxf/cms 11.58.0 → 11.59.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.
package/api/swr.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Schema } from "@uxf/data-grid";
2
2
  import { SWRConfiguration } from "swr";
3
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;
4
5
  export declare class ApiError extends Error {
5
6
  readonly code: string;
6
7
  readonly statusCode: number;
@@ -51,7 +52,7 @@ export declare const useCmsUserConfigQuery: <T extends SWRConfiguration<Mixed, A
51
52
  };
52
53
  } & {
53
54
  skip?: boolean;
54
- }, options?: T) => import("swr").SWRResponse<any, ApiError, T>;
55
+ }, options?: SWRConfigurationWithOptionalFallback<T>) => import("swr").SWRResponse<any, ApiError, T>;
55
56
  export declare const useCmsUserConfigUpdateMutation: (config: {
56
57
  path: {
57
58
  name: XString;
@@ -59,11 +60,11 @@ export declare const useCmsUserConfigUpdateMutation: (config: {
59
60
  }, options?: SWRMutationConfiguration<Mixed, ApiError, string, Mixed> | undefined) => SWRMutationResponse<Mixed, ApiError, string, Mixed>;
60
61
  export declare const useCmsMeQuery: <T extends SWRConfiguration<CMSUserResponse, ApiError>>(config?: {
61
62
  skip?: boolean;
62
- }, options?: T) => import("swr").SWRResponse<CMSUserResponse, ApiError, T>;
63
+ }, options?: SWRConfigurationWithOptionalFallback<T>) => import("swr").SWRResponse<CMSUserResponse, ApiError, T>;
63
64
  /** @deprecated will be removed - schemas are generated */
64
65
  export declare const useCmsTablesQuery: <T extends SWRConfiguration<Record<string, Metadata>, ApiError>>(config?: {
65
66
  skip?: boolean;
66
- }, options?: T) => import("swr").SWRResponse<Record<string, Metadata>, ApiError, T>;
67
+ }, options?: SWRConfigurationWithOptionalFallback<T>) => import("swr").SWRResponse<Record<string, Metadata>, ApiError, T>;
67
68
  /** @deprecated will be removed - schemas are generated */
68
69
  export declare const useDatagridGetSchemaQuery: <T extends SWRConfiguration<Schema<any>, ApiError>>(config: {
69
70
  path: {
@@ -71,5 +72,5 @@ export declare const useDatagridGetSchemaQuery: <T extends SWRConfiguration<Sche
71
72
  };
72
73
  } & {
73
74
  skip?: boolean;
74
- }, options?: T) => import("swr").SWRResponse<Schema<any>, ApiError, T>;
75
+ }, options?: SWRConfigurationWithOptionalFallback<T>) => import("swr").SWRResponse<Schema<any>, ApiError, T>;
75
76
  export {};
@@ -24,7 +24,7 @@ const visibilityLevelOptions = [
24
24
  { id: "PUBLIC", label: "Veřejný" },
25
25
  ];
26
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;
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
28
  const seoName = props.formApi.watch("seo.name");
29
29
  const onBlurName = (event) => {
30
30
  if ((0, is_nil_1.isNil)(seoName) || (0, is_empty_1.isEmpty)(seoName)) {
@@ -36,11 +36,12 @@ function ContentBuilderBasicForm(props) {
36
36
  react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, isRequired: true, label: "Nadpis", name: "name", onBlur: onBlurName, type: "text" }),
37
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
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.author) === null || _h === void 0 ? void 0 : _h.isHidden) && ((_k = (_j = props.fields) === null || _j === void 0 ? void 0 : _j.author) === null || _k === void 0 ? void 0 : _k.autocomplete) && (react_1.default.createElement(combobox_1.Combobox, { control: props.formApi.control, label: "Autor", loadOptions: props.fields.author.autocomplete, name: "author" })),
40
- !((_m = (_l = props.fields) === null || _l === void 0 ? void 0 : _l.category) === null || _m === void 0 ? void 0 : _m.isHidden) && ((_p = (_o = props.fields) === null || _o === void 0 ? void 0 : _o.category) === null || _p === void 0 ? void 0 : _p.autocomplete) && (react_1.default.createElement(combobox_1.Combobox, { control: props.formApi.control, label: "Kategorie", loadOptions: props.fields.category.autocomplete, name: "category" })),
41
- !((_r = (_q = props.fields) === null || _q === void 0 ? void 0 : _q.tags) === null || _r === void 0 ? void 0 : _r.isHidden) && ((_t = (_s = props.fields) === null || _s === void 0 ? void 0 : _s.tags) === null || _t === void 0 ? void 0 : _t.autocomplete) && (react_1.default.createElement(multi_combobox_1.MultiCombobox, { control: props.formApi.control, label: "Tagy", loadOptions: props.fields.tags.autocomplete, name: "tags" })),
42
- !((_v = (_u = props.fields) === null || _u === void 0 ? void 0 : _u.image) === null || _v === void 0 ? void 0 : _v.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) })),
43
- !((_x = (_w = props.fields) === null || _w === void 0 ? void 0 : _w.isActive) === null || _x === void 0 ? void 0 : _x.isHidden) && (react_1.default.createElement(checkbox_input_1.CheckboxInput, { control: props.formApi.control, label: "Aktivn\u00ED", name: "isActive" })),
44
- !((_z = (_y = props.fields) === null || _y === void 0 ? void 0 : _y.visibilityLevel) === null || _z === void 0 ? void 0 : _z.isHidden) && (react_1.default.createElement(select_1.Select, { control: props.formApi.control, isRequired: true, label: "Viditelnost", name: "visibilityLevel", options: visibilityLevelOptions })),
45
- (0, is_not_nil_1.isNotNil)((_1 = (_0 = props.fields) === null || _0 === void 0 ? void 0 : _0.parent) === null || _1 === void 0 ? void 0 : _1.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" }))));
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" }))));
46
47
  }
@@ -1,38 +1,44 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
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");
4
6
  function mapContentResponseToFormData(content) {
5
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
7
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
6
8
  return {
7
9
  name: (_a = content === null || content === void 0 ? void 0 : content.name) !== null && _a !== void 0 ? _a : "",
8
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(" "),
9
15
  author: (content === null || content === void 0 ? void 0 : content.author)
10
16
  ? {
11
17
  id: content.author.id,
12
18
  label: `${content.author.firstName} ${content.author.surname}`,
13
19
  }
14
20
  : null,
15
- image: (_c = content === null || content === void 0 ? void 0 : content.image) !== null && _c !== void 0 ? _c : null,
16
- publishedAt: (_d = content === null || content === void 0 ? void 0 : content.publishedAt) !== null && _d !== void 0 ? _d : null,
17
- type: (_e = content === null || content === void 0 ? void 0 : content.type) !== null && _e !== void 0 ? _e : 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,
18
24
  category: (content === null || content === void 0 ? void 0 : content.category)
19
25
  ? {
20
26
  id: content.category.id,
21
27
  label: content.category.name,
22
28
  }
23
29
  : null,
24
- parent: (_f = content === null || content === void 0 ? void 0 : content.parent) !== null && _f !== void 0 ? _f : null,
30
+ parent: (_h = content === null || content === void 0 ? void 0 : content.parent) !== null && _h !== void 0 ? _h : null,
25
31
  isActive: !(content === null || content === void 0 ? void 0 : content.hidden),
26
- perex: (_g = content === null || content === void 0 ? void 0 : content.perex) !== null && _g !== void 0 ? _g : null,
27
- tags: (_h = content === null || content === void 0 ? void 0 : content.tags) !== null && _h !== void 0 ? _h : [],
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 : [],
28
34
  seo: {
29
- name: (_j = content === null || content === void 0 ? void 0 : content.seo.name) !== null && _j !== void 0 ? _j : "",
30
- title: (_k = content === null || content === void 0 ? void 0 : content.seo.title) !== null && _k !== void 0 ? _k : "",
31
- description: (_l = content === null || content === void 0 ? void 0 : content.seo.description) !== null && _l !== void 0 ? _l : "",
32
- ogTitle: (_m = content === null || content === void 0 ? void 0 : content.seo.ogTitle) !== null && _m !== void 0 ? _m : "",
33
- ogDescription: (_o = content === null || content === void 0 ? void 0 : content.seo.ogDescription) !== null && _o !== void 0 ? _o : "",
34
- ogImage: (_p = content === null || content === void 0 ? void 0 : content.seo.ogImage) !== null && _p !== void 0 ? _p : null,
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,
35
41
  },
36
- content: { data: (_q = content === null || content === void 0 ? void 0 : content.content) !== null && _q !== void 0 ? _q : [], search: "" },
42
+ content: { data: (_s = content === null || content === void 0 ? void 0 : content.content) !== null && _s !== void 0 ? _s : [], search: "" },
37
43
  };
38
44
  }
@@ -8,6 +8,7 @@ import { TextInputValue } from "@uxf/form/text-input";
8
8
  import { TextareaValue } from "@uxf/form/textarea";
9
9
  import { SelectOption } from "@uxf/ui/select";
10
10
  export type ContentBuilderFormData = {
11
+ authorText: TextInputValue;
11
12
  author: ComboboxValue<number>;
12
13
  category: ComboboxValue<number>;
13
14
  content: {
@@ -46,6 +47,9 @@ export type FieldsConfiguration = {
46
47
  perex?: {
47
48
  isHidden?: boolean;
48
49
  };
50
+ authorText?: {
51
+ isHidden?: boolean;
52
+ };
49
53
  author?: {
50
54
  autocomplete?: Autocomplete;
51
55
  isHidden?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/cms",
3
- "version": "11.58.0",
3
+ "version": "11.59.0",
4
4
  "description": "UXF Cms",
5
5
  "author": "UXFans <dev@uxf.cz>",
6
6
  "homepage": "https://gitlab.com/uxf-npm/cms#readme",
@@ -31,12 +31,12 @@
31
31
  "@floating-ui/react": "0.26.28",
32
32
  "@redux-devtools/extension": "3.3.0",
33
33
  "@uxf/core": "11.58.0",
34
- "@uxf/core-react": "11.58.0",
35
- "@uxf/data-grid": "11.58.0",
36
- "@uxf/form": "11.58.0",
34
+ "@uxf/core-react": "11.58.1",
35
+ "@uxf/data-grid": "11.58.1",
36
+ "@uxf/form": "11.58.1",
37
37
  "@uxf/router": "11.49.1",
38
- "@uxf/ui": "11.58.0",
39
- "@uxf/wysiwyg": "11.58.0",
38
+ "@uxf/ui": "11.58.1",
39
+ "@uxf/wysiwyg": "11.58.1",
40
40
  "axios": "1.7.5",
41
41
  "axios-hooks": "5.0.2",
42
42
  "es6-error": "4.1.1",
@@ -44,7 +44,7 @@
44
44
  "react-hook-form": "7.53.0",
45
45
  "react-redux": "8.1.3",
46
46
  "redux": "4.2.1",
47
- "swr": "2.2.5"
47
+ "swr": "2.3.3"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "next": ">=13.2.0",
@@ -99,7 +99,7 @@ function GridPageComponent(props) {
99
99
  (props.onRemove ? 1 : 0);
100
100
  const actionCell = (_f = (_e = props.ui) === null || _e === void 0 ? void 0 : _e.actionCell) !== null && _f !== void 0 ? _f : (actionColumnButtonsCount > 0
101
101
  ? {
102
- width: actionColumnButtonsCount * 40,
102
+ width: actionColumnButtonsCount * 40 + 8,
103
103
  Component: (actionCellProps) => {
104
104
  var _a, _b, _c, _d, _e, _f;
105
105
  const buttons = (0, build_array_1.buildArray)()