@yimingliao/cms 0.0.184 → 0.0.186

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 (32) hide show
  1. package/dist/export/client/components/resources/index.js +0 -1
  2. package/dist/src/client/interfaces/components/resources/admin/admin-relations-section.js +5 -14
  3. package/dist/src/client/interfaces/components/resources/category/category-list.js +14 -9
  4. package/dist/src/client/interfaces/components/resources/file/file-relations-section.js +3 -10
  5. package/dist/src/client/interfaces/components/resources/post/control-fields-buttons.js +6 -6
  6. package/dist/src/client/interfaces/components/resources/post/post-list.js +16 -16
  7. package/dist/src/client/interfaces/components/resources/post/post-relations-section.js +1 -7
  8. package/dist/src/client/interfaces/components/resources/tag/tag-list.js +3 -3
  9. package/dist/src/client/interfaces/components/resources/topic/topic-list.js +13 -8
  10. package/dist/types/export/client/components/resources/index.d.ts +1 -1
  11. package/dist/types/export/client/components/resources/index.d.ts.map +1 -1
  12. package/dist/types/src/client/interfaces/components/resources/admin/admin-list.d.ts.map +1 -1
  13. package/dist/types/src/client/interfaces/components/resources/admin/admin-relations-section.d.ts.map +1 -1
  14. package/dist/types/src/client/interfaces/components/resources/category/category-list.d.ts +3 -2
  15. package/dist/types/src/client/interfaces/components/resources/category/category-list.d.ts.map +1 -1
  16. package/dist/types/src/client/interfaces/components/resources/file/file-relations-section.d.ts +2 -2
  17. package/dist/types/src/client/interfaces/components/resources/file/file-relations-section.d.ts.map +1 -1
  18. package/dist/types/src/client/interfaces/components/resources/index.d.ts +1 -1
  19. package/dist/types/src/client/interfaces/components/resources/index.d.ts.map +1 -1
  20. package/dist/types/src/client/interfaces/components/resources/post/control-fields-buttons.d.ts +2 -2
  21. package/dist/types/src/client/interfaces/components/resources/post/control-fields-buttons.d.ts.map +1 -1
  22. package/dist/types/src/client/interfaces/components/resources/post/post-list.d.ts +5 -5
  23. package/dist/types/src/client/interfaces/components/resources/post/post-list.d.ts.map +1 -1
  24. package/dist/types/src/client/interfaces/components/resources/post/post-relations-section.d.ts.map +1 -1
  25. package/dist/types/src/client/interfaces/components/resources/topic/index.d.ts +0 -1
  26. package/dist/types/src/client/interfaces/components/resources/topic/index.d.ts.map +1 -1
  27. package/dist/types/src/client/interfaces/components/resources/topic/topic-list.d.ts +3 -2
  28. package/dist/types/src/client/interfaces/components/resources/topic/topic-list.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/dist/src/client/interfaces/components/resources/topic/topic-relations-section.js +0 -106
  31. package/dist/types/src/client/interfaces/components/resources/topic/topic-relations-section.d.ts +0 -15
  32. package/dist/types/src/client/interfaces/components/resources/topic/topic-relations-section.d.ts.map +0 -1
@@ -22,7 +22,6 @@ export { createCategoryList } from '../../../../src/client/interfaces/components
22
22
  export { createCategoryRelationsSection } from '../../../../src/client/interfaces/components/resources/category/category-relations-section.js';
23
23
  export { TopicCard } from '../../../../src/client/interfaces/components/resources/topic/topic-card.js';
24
24
  export { createTopicList } from '../../../../src/client/interfaces/components/resources/topic/topic-list.js';
25
- export { createTopicRelationsSection } from '../../../../src/client/interfaces/components/resources/topic/topic-relations-section.js';
26
25
  export { TagCard } from '../../../../src/client/interfaces/components/resources/tag/tag-card.js';
27
26
  export { createTagList } from '../../../../src/client/interfaces/components/resources/tag/tag-list.js';
28
27
  export { createTagRelationsSection } from '../../../../src/client/interfaces/components/resources/tag/tag-relations-section.js';
@@ -1,8 +1,6 @@
1
1
  "use client";
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { useTranslator } from 'intor/react';
4
- import '../../../../../domain/resources/admin/constants.js';
5
- import { POST_TYPES } from '../../../../../domain/resources/post/props.js';
6
4
  import 'mime-types';
7
5
  import { ensureArray } from '../../../../../shared/utils/ensure-array.js';
8
6
  import 'lucide-react';
@@ -34,6 +32,7 @@ import '../../../../../constants/paths/resources.js';
34
32
  import '../../../../../constants/redirect-paths.js';
35
33
  import { Accordion } from '../../ui/features/accordion/accordion.js';
36
34
  import { AccordionContainer } from '../../ui/features/accordion/accordion-container.js';
35
+ import '../../../../../domain/resources/admin/constants.js';
37
36
  import 'next/image';
38
37
 
39
38
  function createAdminRelationsSection({
@@ -41,32 +40,24 @@ function createAdminRelationsSection({
41
40
  }) {
42
41
  return function AdminRelationsSection({
43
42
  admin,
44
- usableFields = [
45
- "isActive",
46
- "isIndexActive",
47
- "isSlugActive",
48
- "isFeatured",
49
- "isShownOnHome"
50
- ],
43
+ usableFields = ["isActive", "index", "slug", "isFeatured", "isShownOnHome"],
51
44
  headerProps
52
45
  }) {
53
46
  const { t } = useTranslator();
54
- const post = ensureArray(admin?.posts).filter(
55
- (p) => p.type === POST_TYPES.POST
56
- );
47
+ const postIds = ensureArray(admin?.posts).map((p) => p.id);
57
48
  return /* @__PURE__ */ jsx(AccordionContainer, { children: /* @__PURE__ */ jsx(
58
49
  Accordion,
59
50
  {
60
51
  hasBorder: true,
61
52
  accordionHeaderProps: {
62
- count: post.length,
53
+ count: postIds.length,
63
54
  isRelated: headerProps?.isRelated ?? true,
64
55
  children: headerProps?.children ?? t("resources.post.text")
65
56
  },
66
57
  children: /* @__PURE__ */ jsx(
67
58
  PostList,
68
59
  {
69
- postIds: post.map((p) => p.id),
60
+ postIds,
70
61
  openNewTab: true,
71
62
  type: null,
72
63
  usableFields
@@ -45,16 +45,18 @@ function createCategoryList({
45
45
  postFindListCardsAction
46
46
  }) {
47
47
  return function CategoryList({
48
- usableFields,
49
- setItemStates,
50
- // Fetch Conditions
48
+ usableFields = ["isActive", "index", "slug"],
49
+ // search
50
+ type = POST_TYPES.CATEGORY,
51
51
  topicId,
52
52
  postIds,
53
- // Link Props
53
+ // link
54
54
  openNewTab = false,
55
- // Pick Mode
55
+ // pick
56
56
  pickedItems,
57
- handleClick
57
+ handleClick,
58
+ // item states
59
+ setItemStates
58
60
  }) {
59
61
  const [page, setPage] = useState(1);
60
62
  const [pageSize, setPageSize] = useState(20);
@@ -65,15 +67,17 @@ function createCategoryList({
65
67
  );
66
68
  const [controlFields, setControlFields] = useState({
67
69
  isActive: false,
68
- isIndexActive: false,
69
- isSlugActive: false
70
+ index: false,
71
+ slug: false,
72
+ isFeatured: false,
73
+ isShownOnHome: false
70
74
  });
71
75
  useEffect(() => {
72
76
  queueMicrotask(() => setPage(1));
73
77
  }, [controlFields, setPage]);
74
78
  const { data, isFetching } = useQuery(
75
79
  () => postFindListCardsAction({
76
- type: POST_TYPES.CATEGORY,
80
+ type,
77
81
  page,
78
82
  pageSize,
79
83
  searchString,
@@ -83,6 +87,7 @@ function createCategoryList({
83
87
  }),
84
88
  [
85
89
  CACHE_KEYS.findListCards("category"),
90
+ type,
86
91
  page,
87
92
  pageSize,
88
93
  searchString,
@@ -45,19 +45,13 @@ const postRelations = [
45
45
  "postsAsImage4"
46
46
  ];
47
47
  function createFileRelationsSection({
48
- adminEnabled,
48
+ autherEnabled,
49
49
  AdminList,
50
50
  PostList
51
51
  }) {
52
52
  return function FileRelationsSection({
53
53
  file,
54
- usableFields = [
55
- "isActive",
56
- "isIndexActive",
57
- "isSlugActive",
58
- "isFeatured",
59
- "isShownOnHome"
60
- ],
54
+ usableFields = ["isActive", "index", "slug", "isFeatured", "isShownOnHome"],
61
55
  headerProps
62
56
  }) {
63
57
  const { t } = useTranslator();
@@ -67,9 +61,8 @@ function createFileRelationsSection({
67
61
  ...new Set(postRelations.flatMap((key) => file[key].map((p) => p.id)))
68
62
  ];
69
63
  }, [file]);
70
- console.log(postIds);
71
64
  return /* @__PURE__ */ jsxs(AccordionContainer, { children: [
72
- adminEnabled && file?.type === "IMAGE" && /* @__PURE__ */ jsx(
65
+ autherEnabled && file?.type === "IMAGE" && file?.adminAsAvatarImage.length > 0 && /* @__PURE__ */ jsx(
73
66
  Accordion,
74
67
  {
75
68
  hasBorder: true,
@@ -49,7 +49,7 @@ function ControlFieldsButtons({
49
49
  children: t("ui.field.control-fields.is-active.text")
50
50
  }
51
51
  ),
52
- usableFields.includes("isIndexActive") && /* @__PURE__ */ jsx(
52
+ usableFields.includes("index") && /* @__PURE__ */ jsx(
53
53
  Button,
54
54
  {
55
55
  size: "sm",
@@ -57,13 +57,13 @@ function ControlFieldsButtons({
57
57
  variant: "secondary",
58
58
  onClick: () => setControlFields((prev) => ({
59
59
  ...prev,
60
- isIndexActive: !prev.isIndexActive
60
+ index: !prev.index
61
61
  })),
62
- className: cn(!controlFields.isIndexActive ? "opacity-35" : "shadow"),
62
+ className: cn(!controlFields.index ? "opacity-35" : "shadow"),
63
63
  children: t("ui.field.control-fields.is-index-active.text")
64
64
  }
65
65
  ),
66
- usableFields.includes("isSlugActive") && /* @__PURE__ */ jsx(
66
+ usableFields.includes("slug") && /* @__PURE__ */ jsx(
67
67
  Button,
68
68
  {
69
69
  size: "sm",
@@ -71,9 +71,9 @@ function ControlFieldsButtons({
71
71
  variant: "secondary",
72
72
  onClick: () => setControlFields((prev) => ({
73
73
  ...prev,
74
- isSlugActive: !prev.isSlugActive
74
+ slug: !prev.slug
75
75
  })),
76
- className: cn(!controlFields.isSlugActive ? "opacity-35" : "shadow"),
76
+ className: cn(!controlFields.slug ? "opacity-35" : "shadow"),
77
77
  children: t("ui.field.control-fields.is-slug-active.text")
78
78
  }
79
79
  ),
@@ -6,6 +6,8 @@ import '../../../../../constants/paths/main.js';
6
6
  import '../../../../../constants/paths/resources.js';
7
7
  import { CACHE_KEYS } from '../../../../../constants/cache-keys.js';
8
8
  import '../../../../../constants/redirect-paths.js';
9
+ import '../../../../../domain/resources/admin/constants.js';
10
+ import { POST_TYPES } from '../../../../../domain/resources/post/props.js';
9
11
  import 'mime-types';
10
12
  import { debounce } from '../../../../../shared/utils/debounce.js';
11
13
  import { ensureArray } from '../../../../../shared/utils/ensure-array.js';
@@ -33,7 +35,6 @@ import '@radix-ui/react-tabs';
33
35
  import '@radix-ui/react-tooltip';
34
36
  import { ListCardsContainer } from '../../ui/blocks/list-cards-container/list-cards-container.js';
35
37
  import 'next/link';
36
- import '../../../../../domain/resources/admin/constants.js';
37
38
  import 'next/image';
38
39
  import { Tick } from '../../ui/features/tick.js';
39
40
  import { ControlFieldsButtons } from './control-fields-buttons.js';
@@ -44,19 +45,19 @@ function createPostList({
44
45
  PostCard
45
46
  }) {
46
47
  return function PostList({
47
- usableFields,
48
- type,
49
- //
50
- setItemStates,
51
- // Fetch Condition
48
+ usableFields = ["isActive", "index", "slug", "isFeatured", "isShownOnHome"],
49
+ // search
50
+ type = POST_TYPES.POST,
52
51
  topicId,
53
52
  postIds,
54
- // Link Props
53
+ excludeId,
54
+ // link
55
55
  openNewTab = false,
56
- // Pick Mode
56
+ // pick
57
57
  pickedItems,
58
58
  handleClick,
59
- excludeId
59
+ // item states
60
+ setItemStates
60
61
  }) {
61
62
  const [page, setPage] = useState(1);
62
63
  const [pageSize, setPageSize] = useState(20);
@@ -67,8 +68,8 @@ function createPostList({
67
68
  );
68
69
  const [controlFields, setControlFields] = useState({
69
70
  isActive: false,
70
- isIndexActive: false,
71
- isSlugActive: false,
71
+ index: false,
72
+ slug: false,
72
73
  isFeatured: false,
73
74
  isShownOnHome: false
74
75
  });
@@ -77,31 +78,30 @@ function createPostList({
77
78
  }, [controlFields, setPage]);
78
79
  const { data, isFetching } = useQuery(
79
80
  () => postFindListCardsAction({
80
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
81
81
  type,
82
82
  page,
83
83
  pageSize,
84
84
  searchString,
85
85
  ...topicId && { topicId },
86
86
  ...postIds && { postIds },
87
+ ...excludeId && { excludeId },
87
88
  ...controlFields
88
89
  }),
89
90
  [
90
91
  CACHE_KEYS.findListCards("post"),
92
+ type,
91
93
  page,
92
94
  pageSize,
93
95
  searchString,
94
96
  topicId,
95
97
  JSON.stringify(postIds),
98
+ JSON.stringify(excludeId),
96
99
  JSON.stringify(controlFields)
97
100
  ],
98
101
  { enabled: topicId !== DO_NOT_FETCH_KEY }
99
102
  // Use in Post Topic Page
100
103
  );
101
- const posts = useMemo(
102
- () => ensureArray(data?.items).filter((i) => i.id !== excludeId),
103
- [data?.items, excludeId]
104
- );
104
+ const posts = useMemo(() => ensureArray(data?.items), [data?.items]);
105
105
  useEffect(() => {
106
106
  setItemStates?.({
107
107
  items: posts,
@@ -40,13 +40,7 @@ function createPostRelationsSection({
40
40
  }) {
41
41
  return function PostRelationsSection({
42
42
  post,
43
- usableFields = [
44
- "isActive",
45
- "isIndexActive",
46
- "isSlugActive",
47
- "isFeatured",
48
- "isShownOnHome"
49
- ],
43
+ usableFields = ["isActive", "index", "slug", "isFeatured", "isShownOnHome"],
50
44
  headerProps
51
45
  }) {
52
46
  const { t } = useTranslator();
@@ -42,7 +42,7 @@ function createTagList({
42
42
  postFindListCardsAction
43
43
  }) {
44
44
  return function TagList({
45
- usableFields = ["isActive", "isIndexActive", "isSlugActive"],
45
+ usableFields = ["isActive", "index", "slug"],
46
46
  //
47
47
  setItemStates,
48
48
  // Link Props
@@ -60,8 +60,8 @@ function createTagList({
60
60
  );
61
61
  const [controlFields, setControlFields] = useState({
62
62
  isActive: false,
63
- isIndexActive: false,
64
- isSlugActive: false
63
+ index: false,
64
+ slug: false
65
65
  });
66
66
  useEffect(() => {
67
67
  queueMicrotask(() => setPage(1));
@@ -43,12 +43,14 @@ function createTopicList({
43
43
  postFindListCardsAction
44
44
  }) {
45
45
  return function TopicList({
46
- usableFields = ["isActive", "isIndexActive", "isSlugActive"],
47
- //
48
- setItemStates,
49
- // Pick Mode
46
+ usableFields = ["isActive", "index", "slug"],
47
+ // search
48
+ type = POST_TYPES.TOPIC,
49
+ // pick
50
50
  pickedItems,
51
- handleClick
51
+ handleClick,
52
+ // item states
53
+ setItemStates
52
54
  }) {
53
55
  const [page, setPage] = useState(1);
54
56
  const [pageSize, setPageSize] = useState(20);
@@ -59,15 +61,17 @@ function createTopicList({
59
61
  );
60
62
  const [controlFields, setControlFields] = useState({
61
63
  isActive: false,
62
- isIndexActive: false,
63
- isSlugActive: false
64
+ index: false,
65
+ slug: false,
66
+ isFeatured: false,
67
+ isShownOnHome: false
64
68
  });
65
69
  useEffect(() => {
66
70
  queueMicrotask(() => setPage(1));
67
71
  }, [controlFields, setPage]);
68
72
  const { data, isFetching } = useQuery(
69
73
  () => postFindListCardsAction({
70
- type: POST_TYPES.TOPIC,
74
+ type,
71
75
  page,
72
76
  pageSize,
73
77
  searchString,
@@ -75,6 +79,7 @@ function createTopicList({
75
79
  }),
76
80
  [
77
81
  CACHE_KEYS.findListCards("topic"),
82
+ type,
78
83
  page,
79
84
  pageSize,
80
85
  searchString,
@@ -1,2 +1,2 @@
1
- export { AdminCard, createAdminList, createAdminRelationsSection, ActiveSessionsBadge, AdminRefreshTokenCard, createFileCard, createFileList, createFileRelationsSection, FolderCard, createFolderList, FolderFullPath, createFileManagerList, createFolderRelationsSection, createPostCard, createPostList, createPostRelationsSection, PostTypeGate, CategoryCard, createCategoryList, createCategoryRelationsSection, TopicCard, createTopicList, createTopicRelationsSection, TagCard, createTagList, createTagRelationsSection, } from "../../../../src/client/interfaces/components/resources";
1
+ export { AdminCard, createAdminList, createAdminRelationsSection, ActiveSessionsBadge, AdminRefreshTokenCard, createFileCard, createFileList, createFileRelationsSection, FolderCard, createFolderList, FolderFullPath, createFileManagerList, createFolderRelationsSection, createPostCard, createPostList, createPostRelationsSection, PostTypeGate, CategoryCard, createCategoryList, createCategoryRelationsSection, TopicCard, createTopicList, TagCard, createTagList, createTagRelationsSection, } from "../../../../src/client/interfaces/components/resources";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../export/client/components/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,eAAe,EACf,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,EAErB,cAAc,EACd,cAAc,EACd,0BAA0B,EAE1B,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,4BAA4B,EAE5B,cAAc,EACd,cAAc,EACd,0BAA0B,EAC1B,YAAY,EAEZ,YAAY,EACZ,kBAAkB,EAClB,8BAA8B,EAE9B,SAAS,EACT,eAAe,EACf,2BAA2B,EAE3B,OAAO,EACP,aAAa,EACb,yBAAyB,GAC1B,MAAM,wDAAwD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../export/client/components/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,eAAe,EACf,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,EAErB,cAAc,EACd,cAAc,EACd,0BAA0B,EAE1B,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,4BAA4B,EAE5B,cAAc,EACd,cAAc,EACd,0BAA0B,EAC1B,YAAY,EAEZ,YAAY,EACZ,kBAAkB,EAClB,8BAA8B,EAE9B,SAAS,EACT,eAAe,EAEf,OAAO,EACP,aAAa,EACb,yBAAyB,GAC1B,MAAM,wDAAwD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"admin-list.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/admin/admin-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAK/B,UAAU,cAAc;IACtB,aAAa,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACpE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CAC1C;AAED,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,wBAAwB,GACzB,EAAE;IACD,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC5C,wBAAwB,EAAE,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC;CAC7E,IAC2B,oEASvB,cAAc,6CAoFlB"}
1
+ {"version":3,"file":"admin-list.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/admin/admin-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAK/B,UAAU,cAAc;IACtB,aAAa,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACpE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CAC1C;AAED,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,wBAAwB,GACzB,EAAE;IACD,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC5C,wBAAwB,EAAE,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC;CAC7E,IAC2B,oEASvB,cAAc,6CAmFlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"admin-relations-section.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/admin/admin-relations-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAMxD,wBAAgB,2BAA2B,CAAC,EAC1C,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;CAC7C,IACuC,uCAUnC;IACD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;CACpE,6CA6BF"}
1
+ {"version":3,"file":"admin-relations-section.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/admin/admin-relations-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKxD,wBAAgB,2BAA2B,CAAC,EAC1C,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;CAC7C,IACuC,uCAInC;IACD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;CACpE,6CA2BF"}
@@ -5,16 +5,17 @@ import { type MultiItems, type PostListCard, type SingleItem } from "../../../..
5
5
  import { type ListItemsState } from "../../../../../shared";
6
6
  interface CategoryListProps {
7
7
  usableFields: string[];
8
+ type?: string;
8
9
  topicId?: string;
9
10
  postIds?: string[];
10
11
  openNewTab?: boolean;
11
12
  pickedItems?: MultiItems;
12
- setItemStates?: Dispatch<SetStateAction<ListItemsState<PostListCard>>>;
13
13
  handleClick?: (item: SingleItem) => void;
14
+ setItemStates?: Dispatch<SetStateAction<ListItemsState<PostListCard>>>;
14
15
  }
15
16
  export declare function createCategoryList({ useQuery, postFindListCardsAction, }: {
16
17
  useQuery: ReturnType<typeof createUseQuery>;
17
18
  postFindListCardsAction: ReturnType<typeof createPostFindListCardsAction>;
18
- }): ({ usableFields, setItemStates, topicId, postIds, openNewTab, pickedItems, handleClick, }: CategoryListProps) => import("react/jsx-runtime").JSX.Element;
19
+ }): ({ usableFields, type, topicId, postIds, openNewTab, pickedItems, handleClick, setItemStates, }: CategoryListProps) => import("react/jsx-runtime").JSX.Element;
19
20
  export {};
20
21
  //# sourceMappingURL=category-list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"category-list.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/category/category-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAS/B,UAAU,iBAAiB;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,aAAa,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACvE,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CAC1C;AAED,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,uBAAuB,GACxB,EAAE;IACD,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC5C,uBAAuB,EAAE,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC;CAC3E,IAC8B,0FAW1B,iBAAiB,6CA0GrB"}
1
+ {"version":3,"file":"category-list.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/category/category-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,YAAY,EAEjB,KAAK,UAAU,EAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAS/B,UAAU,iBAAiB;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CACxE;AAED,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,uBAAuB,GACxB,EAAE;IACD,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC5C,uBAAuB,EAAE,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC;CAC3E,IAC8B,gGAa1B,iBAAiB,6CA6GrB"}
@@ -2,8 +2,8 @@ import type { FileFull } from "../../../../../domain/resources/file/full";
2
2
  import type { AccordionHeaderProps } from "../../ui/features/accordion/accordion-header";
3
3
  import type { createAdminList } from "../admin/admin-list";
4
4
  import type { createPostList } from "../post/post-list";
5
- export declare function createFileRelationsSection({ adminEnabled, AdminList, PostList, }: {
6
- adminEnabled: boolean;
5
+ export declare function createFileRelationsSection({ autherEnabled, AdminList, PostList, }: {
6
+ autherEnabled: boolean;
7
7
  AdminList: ReturnType<typeof createAdminList>;
8
8
  PostList: ReturnType<typeof createPostList>;
9
9
  }): ({ file, usableFields, headerProps, }: {
@@ -1 +1 @@
1
- {"version":3,"file":"file-relations-section.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/file/file-relations-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAgBxD,wBAAgB,0BAA0B,CAAC,EACzC,YAAY,EACZ,SAAS,EACT,QAAQ,GACT,EAAE;IACD,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;IAC9C,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;CAC7C,IACsC,sCAUlC;IACD,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;CACpE,6CAiDF"}
1
+ {"version":3,"file":"file-relations-section.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/file/file-relations-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAgBxD,wBAAgB,0BAA0B,CAAC,EACzC,aAAa,EACb,SAAS,EACT,QAAQ,GACT,EAAE;IACD,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;IAC9C,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;CAC7C,IACsC,sCAIlC;IACD,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;CACpE,6CAmDF"}
@@ -3,6 +3,6 @@ export { createFileCard, createFileList, createFileRelationsSection, } from "./f
3
3
  export { FolderCard, createFolderList, FolderFullPath, createFileManagerList, createFolderRelationsSection, } from "./folder";
4
4
  export { createPostCard, createPostList, createPostRelationsSection, PostTypeGate, } from "./post";
5
5
  export { CategoryCard, createCategoryList, createCategoryRelationsSection, } from "./category";
6
- export { TopicCard, createTopicList, createTopicRelationsSection, } from "./topic";
6
+ export { TopicCard, createTopicList } from "./topic";
7
7
  export { TagCard, createTagList, createTagRelationsSection } from "./tag";
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/client/interfaces/components/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,cAAc,EACd,cAAc,EACd,0BAA0B,GAC3B,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,cAAc,EACd,cAAc,EACd,0BAA0B,EAC1B,YAAY,GACb,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,8BAA8B,GAC/B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,SAAS,EACT,eAAe,EACf,2BAA2B,GAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/client/interfaces/components/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,cAAc,EACd,cAAc,EACd,0BAA0B,GAC3B,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,cAAc,EACd,cAAc,EACd,0BAA0B,EAC1B,YAAY,GACb,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,8BAA8B,GAC/B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,OAAO,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import type { Dispatch, SetStateAction } from "react";
2
2
  export type ControlFieldToggles = {
3
3
  isActive: boolean;
4
- isIndexActive: boolean;
5
- isSlugActive: boolean;
4
+ index: boolean;
5
+ slug: boolean;
6
6
  isFeatured?: boolean;
7
7
  isShownOnHome?: boolean;
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"control-fields-buttons.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/post/control-fields-buttons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAKtD,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,UAAU,yBAAyB;IACjC,YAAY,CAAC,EAAE,CAAC,MAAM,mBAAmB,CAAC,EAAE,CAAC;IAC7C,aAAa,EAAE,mBAAmB,CAAC;IACnC,gBAAgB,EAAE,QAAQ,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAAC;CACjE;AAED,wBAAgB,oBAAoB,CAAC,EACnC,YAAiB,EACjB,aAAa,EACb,gBAAgB,GACjB,EAAE,yBAAyB,2CA6F3B"}
1
+ {"version":3,"file":"control-fields-buttons.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/post/control-fields-buttons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAKtD,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,UAAU,yBAAyB;IACjC,YAAY,CAAC,EAAE,CAAC,MAAM,mBAAmB,CAAC,EAAE,CAAC;IAC7C,aAAa,EAAE,mBAAmB,CAAC;IACnC,gBAAgB,EAAE,QAAQ,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAAC;CACjE;AAED,wBAAgB,oBAAoB,CAAC,EACnC,YAAiB,EACjB,aAAa,EACb,gBAAgB,GACjB,EAAE,yBAAyB,2CA6F3B"}
@@ -2,23 +2,23 @@ import type { createPostCard } from "./post-card";
2
2
  import type { createPostFindListCardsAction } from "../../../../../server";
3
3
  import type { createUseQuery } from "../../../../infrastructure";
4
4
  import type { Dispatch, SetStateAction } from "react";
5
- import { type MultiItems, type PostListCard, type PostType, type SingleItem } from "../../../../../domain";
5
+ import { type MultiItems, type PostListCard, type SingleItem } from "../../../../../domain";
6
6
  import { type ListItemsState } from "../../../../../shared";
7
7
  interface PostListProps {
8
8
  usableFields: string[];
9
- type: PostType | null;
10
- setItemStates?: Dispatch<SetStateAction<ListItemsState<PostListCard>>>;
9
+ type?: string | null;
11
10
  topicId?: string;
12
11
  postIds?: string[];
12
+ excludeId?: string;
13
13
  openNewTab?: boolean;
14
14
  pickedItems?: MultiItems;
15
15
  handleClick?: (item: SingleItem) => void;
16
- excludeId?: string;
16
+ setItemStates?: Dispatch<SetStateAction<ListItemsState<PostListCard>>>;
17
17
  }
18
18
  export declare function createPostList({ useQuery, postFindListCardsAction, PostCard, }: {
19
19
  useQuery: ReturnType<typeof createUseQuery>;
20
20
  postFindListCardsAction: ReturnType<typeof createPostFindListCardsAction>;
21
21
  PostCard: ReturnType<typeof createPostCard>;
22
- }): ({ usableFields, type, setItemStates, topicId, postIds, openNewTab, pickedItems, handleClick, excludeId, }: PostListProps) => import("react/jsx-runtime").JSX.Element;
22
+ }): ({ usableFields, type, topicId, postIds, excludeId, openNewTab, pickedItems, handleClick, setItemStates, }: PostListProps) => import("react/jsx-runtime").JSX.Element;
23
23
  export {};
24
24
  //# sourceMappingURL=post-list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"post-list.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/post/post-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EACL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,UAAU,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAQ/B,UAAU,aAAa;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,aAAa,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,uBAAuB,EACvB,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC5C,uBAAuB,EAAE,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC;IAC1E,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;CAC7C,IAC0B,2GActB,aAAa,6CAiHjB"}
1
+ {"version":3,"file":"post-list.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/post/post-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,YAAY,EAEjB,KAAK,UAAU,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAQ/B,UAAU,aAAa;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CACxE;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,uBAAuB,EACvB,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC5C,uBAAuB,EAAE,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC;IAC1E,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;CAC7C,IAC0B,2GActB,aAAa,6CAgHjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"post-relations-section.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/post/post-relations-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAKzF,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;CAC7C,IACsC,sCAUlC;IACD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;CACpE,6CA4BF"}
1
+ {"version":3,"file":"post-relations-section.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/post/post-relations-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAKzF,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;CAC7C,IACsC,sCAIlC;IACD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;CACpE,6CA4BF"}
@@ -1,4 +1,3 @@
1
1
  export { TopicCard } from "./topic-card";
2
2
  export { createTopicList } from "./topic-list";
3
- export { createTopicRelationsSection } from "./topic-relations-section";
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/topic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/topic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
@@ -5,13 +5,14 @@ import { type MultiItems, type PostListCard, type SingleItem } from "../../../..
5
5
  import { type ListItemsState } from "../../../../../shared";
6
6
  interface TopicListProps {
7
7
  usableFields?: string[];
8
- setItemStates?: Dispatch<SetStateAction<ListItemsState<PostListCard>>>;
8
+ type?: string;
9
9
  pickedItems?: MultiItems;
10
10
  handleClick?: (item: SingleItem) => void;
11
+ setItemStates?: Dispatch<SetStateAction<ListItemsState<PostListCard>>>;
11
12
  }
12
13
  export declare function createTopicList({ useQuery, postFindListCardsAction, }: {
13
14
  useQuery: ReturnType<typeof createUseQuery>;
14
15
  postFindListCardsAction: ReturnType<typeof createPostFindListCardsAction>;
15
- }): ({ usableFields, setItemStates, pickedItems, handleClick, }: TopicListProps) => import("react/jsx-runtime").JSX.Element;
16
+ }): ({ usableFields, type, pickedItems, handleClick, setItemStates, }: TopicListProps) => import("react/jsx-runtime").JSX.Element;
16
17
  export {};
17
18
  //# sourceMappingURL=topic-list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"topic-list.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/topic/topic-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAS/B,UAAU,cAAc;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACvE,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CAC1C;AAED,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,uBAAuB,GACxB,EAAE;IACD,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC5C,uBAAuB,EAAE,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC;CAC3E,IAC2B,4DAOvB,cAAc,6CAoGlB"}
1
+ {"version":3,"file":"topic-list.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/topic/topic-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,YAAY,EAEjB,KAAK,UAAU,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAS/B,UAAU,cAAc;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CACxE;AAED,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,uBAAuB,GACxB,EAAE;IACD,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC5C,uBAAuB,EAAE,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC;CAC3E,IAC2B,kEASvB,cAAc,6CAuGlB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yimingliao/cms",
3
- "version": "0.0.184",
3
+ "version": "0.0.186",
4
4
  "author": "Yiming Liao",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,106 +0,0 @@
1
- "use client";
2
- import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { useTranslator } from 'intor/react';
4
- import '../../../../../domain/resources/admin/constants.js';
5
- import { POST_TYPES } from '../../../../../domain/resources/post/props.js';
6
- import 'mime-types';
7
- import { ensureArray } from '../../../../../shared/utils/ensure-array.js';
8
- import 'lucide-react';
9
- import 'react';
10
- import 'ua-parser-js';
11
- import 'clsx';
12
- import 'tailwind-merge';
13
- import 'next/navigation';
14
- import '@radix-ui/react-avatar';
15
- import '../../shadcn/badge.js';
16
- import '../../shadcn/button.js';
17
- import '@radix-ui/react-collapsible';
18
- import '@radix-ui/react-dialog';
19
- import '@radix-ui/react-dropdown-menu';
20
- import '../../shadcn/input-group.js';
21
- import '../../shadcn/item.js';
22
- import '@radix-ui/react-label';
23
- import '@radix-ui/react-select';
24
- import '@radix-ui/react-separator';
25
- import '../../shadcn/sidebar.js';
26
- import 'next-themes';
27
- import 'sonner';
28
- import '@radix-ui/react-tabs';
29
- import '@radix-ui/react-tooltip';
30
- import 'next/link';
31
- import '../../../../../constants/paths/auth.js';
32
- import '../../../../../constants/paths/main.js';
33
- import '../../../../../constants/paths/resources.js';
34
- import '../../../../../constants/redirect-paths.js';
35
- import { Accordion } from '../../ui/features/accordion/accordion.js';
36
- import { AccordionContainer } from '../../ui/features/accordion/accordion-container.js';
37
- import 'next/image';
38
-
39
- function createTopicRelationsSection({
40
- CategoryList,
41
- PostList
42
- }) {
43
- return function TopicRelationsSection({
44
- topic,
45
- categoryUsableFields = ["isActive", "isIndexActive", "isSlugActive"],
46
- postUsableFields = [
47
- "isActive",
48
- "isIndexActive",
49
- "isSlugActive",
50
- "isFeatured",
51
- "isShownOnHome"
52
- ],
53
- categoryHeaderProps,
54
- postHeaderProps
55
- }) {
56
- const { t } = useTranslator();
57
- const postsInTopic = ensureArray(topic?.postsInTopic);
58
- const categories = postsInTopic.filter(
59
- (p) => p.type === POST_TYPES.CATEGORY
60
- );
61
- const posts = postsInTopic.filter((p) => p.type === POST_TYPES.POST);
62
- return /* @__PURE__ */ jsxs(AccordionContainer, { children: [
63
- /* @__PURE__ */ jsx(
64
- Accordion,
65
- {
66
- hasBorder: true,
67
- accordionHeaderProps: {
68
- count: categories.length,
69
- isRelated: categoryHeaderProps?.isRelated ?? true,
70
- children: categoryHeaderProps?.children ?? t("resources.category.text")
71
- },
72
- children: /* @__PURE__ */ jsx(
73
- CategoryList,
74
- {
75
- postIds: categories.map((p) => p.id),
76
- openNewTab: true,
77
- usableFields: categoryUsableFields
78
- }
79
- )
80
- }
81
- ),
82
- /* @__PURE__ */ jsx(
83
- Accordion,
84
- {
85
- hasBorder: true,
86
- accordionHeaderProps: {
87
- count: posts.length,
88
- isRelated: postHeaderProps?.isRelated ?? true,
89
- children: postHeaderProps?.children ?? t("resources.post.text")
90
- },
91
- children: /* @__PURE__ */ jsx(
92
- PostList,
93
- {
94
- postIds: posts.map((p) => p.id),
95
- openNewTab: true,
96
- type: null,
97
- usableFields: postUsableFields
98
- }
99
- )
100
- }
101
- )
102
- ] });
103
- };
104
- }
105
-
106
- export { createTopicRelationsSection };
@@ -1,15 +0,0 @@
1
- import type { PostFull } from "../../../../../domain/resources/post/full";
2
- import type { AccordionHeaderProps } from "../../ui/features/accordion/accordion-header";
3
- import type { createCategoryList } from "../category";
4
- import type { createPostList } from "../post";
5
- export declare function createTopicRelationsSection({ CategoryList, PostList, }: {
6
- CategoryList: ReturnType<typeof createCategoryList>;
7
- PostList: ReturnType<typeof createPostList>;
8
- }): ({ topic, categoryUsableFields, postUsableFields, categoryHeaderProps, postHeaderProps, }: {
9
- topic?: PostFull;
10
- categoryUsableFields?: string[];
11
- postUsableFields?: string[];
12
- categoryHeaderProps?: Pick<AccordionHeaderProps, "isRelated" | "children">;
13
- postHeaderProps?: Pick<AccordionHeaderProps, "isRelated" | "children">;
14
- }) => import("react/jsx-runtime").JSX.Element;
15
- //# sourceMappingURL=topic-relations-section.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"topic-relations-section.d.ts","sourceRoot":"","sources":["../../../../../../../../src/client/interfaces/components/resources/topic/topic-relations-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAM9C,wBAAgB,2BAA2B,CAAC,EAC1C,YAAY,EACZ,QAAQ,GACT,EAAE;IACD,YAAY,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;IACpD,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;CAC7C,IACuC,0FAYnC;IACD,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,mBAAmB,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;IAC3E,eAAe,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;CACxE,6CA+CF"}