@yimingliao/cms 0.0.151 → 0.0.152
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/dist/export/client/components/index.js +17 -8
- package/dist/export/client/components/resources/index.js +17 -0
- package/dist/export/client/shadcn/index.js +3 -1
- package/dist/src/client/interfaces/components/resources/admin/admin-card.js +81 -0
- package/dist/src/client/interfaces/components/resources/admin/admin-list.js +126 -0
- package/dist/src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-sessions-badge.js +55 -0
- package/dist/src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-spot.js +19 -0
- package/dist/src/client/interfaces/components/resources/admin/admin-refresh-tokens/admin-refresh-token-card.js +73 -0
- package/dist/src/client/interfaces/components/resources/admin/admin-refresh-tokens/related-admin-refresh-tokens.js +20 -0
- package/dist/src/client/interfaces/components/resources/admin/admin-relations-section.js +79 -0
- package/dist/src/client/interfaces/components/resources/category/category-card.js +80 -0
- package/dist/src/client/interfaces/components/resources/category/category-list.js +154 -0
- package/dist/src/client/interfaces/components/resources/category/category-relations-section.js +76 -0
- package/dist/src/client/interfaces/components/resources/file/file-card.js +1 -0
- package/dist/src/client/interfaces/components/resources/file/file-list.js +1 -0
- package/dist/src/client/interfaces/components/resources/file/file-relations-section.js +112 -0
- package/dist/src/client/interfaces/components/resources/file/is-locked-buttons.js +1 -0
- package/dist/src/client/interfaces/components/resources/file/type-buttons.js +1 -0
- package/dist/src/client/interfaces/components/resources/post/control-fields-buttons.js +111 -0
- package/dist/src/client/interfaces/components/resources/post/post-card.js +112 -0
- package/dist/src/client/interfaces/components/resources/post/post-list.js +162 -0
- package/dist/src/client/interfaces/components/resources/post/post-relations-section.js +76 -0
- package/dist/src/client/interfaces/components/resources/post/post-status-bar-icons.js +24 -0
- package/dist/src/client/interfaces/components/resources/post/post-type-gate.js +13 -0
- package/dist/src/client/interfaces/components/shadcn/item.js +181 -0
- package/dist/src/client/interfaces/components/shadcn/table.js +111 -0
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/list-cards-container.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/page-size-selector.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/pagination.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch-create.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/create.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/edit.js +1 -0
- package/dist/src/client/interfaces/components/ui/buttons/button.js +1 -0
- package/dist/src/client/interfaces/components/ui/cards/action-buttons-card.js +1 -0
- package/dist/src/client/interfaces/components/ui/cards/resource-card/card-status-bar.js +1 -0
- package/dist/src/client/interfaces/components/ui/cards/resource-card/card-text-content.js +1 -0
- package/dist/src/client/interfaces/components/ui/cards/resource-card/resource-card.js +1 -0
- package/dist/src/client/interfaces/components/ui/display/array-list.js +1 -0
- package/dist/src/client/interfaces/components/ui/display/badge.js +1 -0
- package/dist/src/client/interfaces/components/ui/display/object-array-list.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/accordion/accordion-container.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expand-bar.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-info/file-info.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-info/file-name.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-picker/file-picker-container.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-picker/file-picker-placeholder.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-preview/file-preview.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/pick-modal/pick-modal-body.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/pick-modal/pick-modal-trigger.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/pick-modal/pick-modal.js +1 -0
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields.js +1 -0
- package/dist/src/client/interfaces/components/ui/form/field-body.js +1 -0
- package/dist/src/client/interfaces/components/ui/form/field.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/display/i18n-array-display.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/display/i18n-display.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/display/i18n-object-array-display.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/i18n-tabs-wrapper.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-array-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-date-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-editor.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-json-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-number-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-object-array-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-textarea.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/array-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/checkbox.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/editor/editor.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/input.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/password-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/search-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/select.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/textarea.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/auth-skeleton.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/dashboard-skeleton.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/navbar/i18n-selector.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/navbar/nav-user.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/navbar/navbar.js +2 -1
- package/dist/src/client/interfaces/components/ui/layouts/navbar/sign-out-button.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/navbar/theme-selector.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/sidebar/nav-main.js +1 -0
- package/dist/src/client/interfaces/pages/auth/change-password/page.js +1 -0
- package/dist/src/client/interfaces/pages/auth/email-unverified/page.js +1 -0
- package/dist/src/client/interfaces/pages/auth/forgot-password/page.js +1 -0
- package/dist/src/client/interfaces/pages/auth/layout.js +1 -0
- package/dist/src/client/interfaces/pages/auth/reset-password/page.js +1 -0
- package/dist/src/client/interfaces/pages/auth/sign-in/page.js +1 -0
- package/dist/src/client/interfaces/pages/auth/verify-email/page.js +1 -0
- package/dist/src/client/interfaces/pages/dashboard/layout.js +1 -0
- package/dist/types/export/client/components/resources/index.d.ts +2 -0
- package/dist/types/export/client/components/resources/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-card.d.ts +12 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-card.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-list.d.ts +19 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-list.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-sessions-badge.d.ts +9 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-sessions-badge.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-spot.d.ts +4 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-spot.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/admin-refresh-token-card.d.ts +10 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/admin-refresh-token-card.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/related-admin-refresh-tokens.d.ts +6 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/related-admin-refresh-tokens.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-relations-section.d.ts +9 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-relations-section.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/index.d.ts +6 -0
- package/dist/types/src/client/interfaces/components/resources/admin/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/category/category-card.d.ts +11 -0
- package/dist/types/src/client/interfaces/components/resources/category/category-card.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/category/category-list.d.ts +20 -0
- package/dist/types/src/client/interfaces/components/resources/category/category-list.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/category/category-relations-section.d.ts +9 -0
- package/dist/types/src/client/interfaces/components/resources/category/category-relations-section.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/category/index.d.ts +4 -0
- package/dist/types/src/client/interfaces/components/resources/category/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/file/file-relations-section.d.ts +12 -0
- package/dist/types/src/client/interfaces/components/resources/file/file-relations-section.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/file/index.d.ts +1 -0
- package/dist/types/src/client/interfaces/components/resources/file/index.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/resources/index.d.ts +4 -1
- package/dist/types/src/client/interfaces/components/resources/index.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/resources/post/control-fields-buttons.d.ts +16 -0
- package/dist/types/src/client/interfaces/components/resources/post/control-fields-buttons.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/post/index.d.ts +6 -0
- package/dist/types/src/client/interfaces/components/resources/post/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-card.d.ts +14 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-card.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-list.d.ts +25 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-list.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-relations-section.d.ts +9 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-relations-section.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-status-bar-icons.d.ts +8 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-status-bar-icons.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-type-gate.d.ts +10 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-type-gate.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/shadcn/index.d.ts +3 -1
- package/dist/types/src/client/interfaces/components/shadcn/index.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/shadcn/item.d.ts +24 -0
- package/dist/types/src/client/interfaces/components/shadcn/item.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/shadcn/table.d.ts +11 -0
- package/dist/types/src/client/interfaces/components/shadcn/table.d.ts.map +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useMemo, useEffect } from 'react';
|
|
4
|
+
import '../../../../../constants/paths/auth.js';
|
|
5
|
+
import '../../../../../constants/paths/main.js';
|
|
6
|
+
import '../../../../../constants/paths/resources.js';
|
|
7
|
+
import { CACHE_KEYS } from '../../../../../constants/cache-keys.js';
|
|
8
|
+
import '../../../../../constants/redirect-paths.js';
|
|
9
|
+
import 'mime-types';
|
|
10
|
+
import { debounce } from '../../../../../shared/utils/debounce.js';
|
|
11
|
+
import { ensureArray } from '../../../../../shared/utils/ensure-array.js';
|
|
12
|
+
import { DO_NOT_FETCH_KEY } from '../../../../../shared/list-items.js';
|
|
13
|
+
import 'ua-parser-js';
|
|
14
|
+
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
15
|
+
import 'next/navigation';
|
|
16
|
+
import 'intor/react';
|
|
17
|
+
import 'lucide-react';
|
|
18
|
+
import '@radix-ui/react-avatar';
|
|
19
|
+
import '../../shadcn/badge.js';
|
|
20
|
+
import '../../shadcn/button.js';
|
|
21
|
+
import '@radix-ui/react-collapsible';
|
|
22
|
+
import '@radix-ui/react-dialog';
|
|
23
|
+
import '@radix-ui/react-dropdown-menu';
|
|
24
|
+
import '../../shadcn/input-group.js';
|
|
25
|
+
import '../../shadcn/item.js';
|
|
26
|
+
import '@radix-ui/react-label';
|
|
27
|
+
import '@radix-ui/react-select';
|
|
28
|
+
import '@radix-ui/react-separator';
|
|
29
|
+
import '../../shadcn/sidebar.js';
|
|
30
|
+
import 'next-themes';
|
|
31
|
+
import 'sonner';
|
|
32
|
+
import '@radix-ui/react-tabs';
|
|
33
|
+
import '@radix-ui/react-tooltip';
|
|
34
|
+
import { ListCardsContainer } from '../../ui/blocks/list-cards-container/list-cards-container.js';
|
|
35
|
+
import 'next/link';
|
|
36
|
+
import '../../../../../domain/resources/admin/constants.js';
|
|
37
|
+
import 'next/image';
|
|
38
|
+
import { Tick } from '../../ui/features/tick.js';
|
|
39
|
+
import { ControlFieldsButtons } from './control-fields-buttons.js';
|
|
40
|
+
|
|
41
|
+
function createPostList({
|
|
42
|
+
useQuery,
|
|
43
|
+
postFindListCardsAction,
|
|
44
|
+
PostCard
|
|
45
|
+
}) {
|
|
46
|
+
return function PostList({
|
|
47
|
+
usableFields,
|
|
48
|
+
type,
|
|
49
|
+
//
|
|
50
|
+
setItemStates,
|
|
51
|
+
// Fetch Condition
|
|
52
|
+
topicId,
|
|
53
|
+
postIds,
|
|
54
|
+
// Link Props
|
|
55
|
+
openNewTab = false,
|
|
56
|
+
// Pick Mode
|
|
57
|
+
pickedItems,
|
|
58
|
+
handleClick,
|
|
59
|
+
excludeId
|
|
60
|
+
}) {
|
|
61
|
+
const [page, setPage] = useState(1);
|
|
62
|
+
const [pageSize, setPageSize] = useState(20);
|
|
63
|
+
const [searchString, setSearchString] = useState("");
|
|
64
|
+
const debouncedSetSearchString = useMemo(
|
|
65
|
+
() => debounce((v) => setSearchString(v), 300),
|
|
66
|
+
[]
|
|
67
|
+
);
|
|
68
|
+
const [controlFields, setControlFields] = useState({
|
|
69
|
+
isActive: false,
|
|
70
|
+
isIndexActive: false,
|
|
71
|
+
isSlugActive: false,
|
|
72
|
+
isFeatured: false,
|
|
73
|
+
isShownOnHome: false
|
|
74
|
+
});
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
queueMicrotask(() => setPage(1));
|
|
77
|
+
}, [controlFields, setPage]);
|
|
78
|
+
const { data, isFetching } = useQuery(
|
|
79
|
+
() => postFindListCardsAction({
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
|
|
81
|
+
type,
|
|
82
|
+
page,
|
|
83
|
+
pageSize,
|
|
84
|
+
searchString,
|
|
85
|
+
...topicId && { topicId },
|
|
86
|
+
...postIds && { postIds },
|
|
87
|
+
...controlFields
|
|
88
|
+
}),
|
|
89
|
+
[
|
|
90
|
+
CACHE_KEYS.findListCards("post"),
|
|
91
|
+
page,
|
|
92
|
+
pageSize,
|
|
93
|
+
searchString,
|
|
94
|
+
topicId,
|
|
95
|
+
JSON.stringify(postIds),
|
|
96
|
+
JSON.stringify(controlFields)
|
|
97
|
+
],
|
|
98
|
+
{ enabled: topicId !== DO_NOT_FETCH_KEY }
|
|
99
|
+
// Use in Post Topic Page
|
|
100
|
+
);
|
|
101
|
+
const posts = useMemo(
|
|
102
|
+
() => ensureArray(data?.items).filter((i) => i.id !== excludeId),
|
|
103
|
+
[data?.items, excludeId]
|
|
104
|
+
);
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
setItemStates?.({
|
|
107
|
+
items: posts,
|
|
108
|
+
count: data?.total ?? 0,
|
|
109
|
+
isFetching
|
|
110
|
+
});
|
|
111
|
+
}, [isFetching, data?.total, posts, setItemStates]);
|
|
112
|
+
return /* @__PURE__ */ jsx(
|
|
113
|
+
ListCardsContainer,
|
|
114
|
+
{
|
|
115
|
+
page,
|
|
116
|
+
setPage,
|
|
117
|
+
pageSize,
|
|
118
|
+
setPageSize,
|
|
119
|
+
total: data?.total ?? 0,
|
|
120
|
+
searchString,
|
|
121
|
+
setSearchString: debouncedSetSearchString,
|
|
122
|
+
isFetching,
|
|
123
|
+
headerChildren: /* @__PURE__ */ jsx(
|
|
124
|
+
ControlFieldsButtons,
|
|
125
|
+
{
|
|
126
|
+
usableFields,
|
|
127
|
+
controlFields,
|
|
128
|
+
setControlFields
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
children: posts.map((post) => {
|
|
132
|
+
const isPicked = pickedItems?.some((item) => item.id === post.id);
|
|
133
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
134
|
+
/* @__PURE__ */ jsx(
|
|
135
|
+
PostCard,
|
|
136
|
+
{
|
|
137
|
+
post,
|
|
138
|
+
openNewTab: openNewTab ?? false,
|
|
139
|
+
className: cn(pickedItems && !isPicked && "opacity-50"),
|
|
140
|
+
anchorProps: handleClick && {
|
|
141
|
+
onClick: (e) => {
|
|
142
|
+
e.preventDefault();
|
|
143
|
+
handleClick(post);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
pickedItems && /* @__PURE__ */ jsx(
|
|
149
|
+
Tick,
|
|
150
|
+
{
|
|
151
|
+
isPicked: isPicked ?? false,
|
|
152
|
+
className: "absolute top-2 right-2"
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
] }, post.id);
|
|
156
|
+
})
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export { createPostList };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useTranslator } from 'intor/react';
|
|
4
|
+
import 'mime-types';
|
|
5
|
+
import { ensureArray } from '../../../../../shared/utils/ensure-array.js';
|
|
6
|
+
import 'lucide-react';
|
|
7
|
+
import 'react';
|
|
8
|
+
import 'ua-parser-js';
|
|
9
|
+
import 'clsx';
|
|
10
|
+
import 'tailwind-merge';
|
|
11
|
+
import 'next/navigation';
|
|
12
|
+
import '@radix-ui/react-avatar';
|
|
13
|
+
import '../../shadcn/badge.js';
|
|
14
|
+
import '../../shadcn/button.js';
|
|
15
|
+
import '@radix-ui/react-collapsible';
|
|
16
|
+
import '@radix-ui/react-dialog';
|
|
17
|
+
import '@radix-ui/react-dropdown-menu';
|
|
18
|
+
import '../../shadcn/input-group.js';
|
|
19
|
+
import '../../shadcn/item.js';
|
|
20
|
+
import '@radix-ui/react-label';
|
|
21
|
+
import '@radix-ui/react-select';
|
|
22
|
+
import '@radix-ui/react-separator';
|
|
23
|
+
import '../../shadcn/sidebar.js';
|
|
24
|
+
import 'next-themes';
|
|
25
|
+
import 'sonner';
|
|
26
|
+
import '@radix-ui/react-tabs';
|
|
27
|
+
import '@radix-ui/react-tooltip';
|
|
28
|
+
import 'next/link';
|
|
29
|
+
import '../../../../../constants/paths/auth.js';
|
|
30
|
+
import '../../../../../constants/paths/main.js';
|
|
31
|
+
import '../../../../../constants/paths/resources.js';
|
|
32
|
+
import '../../../../../constants/redirect-paths.js';
|
|
33
|
+
import { Accordion } from '../../ui/features/accordion/accordion.js';
|
|
34
|
+
import { AccordionContainer } from '../../ui/features/accordion/accordion-container.js';
|
|
35
|
+
import '../../../../../domain/resources/admin/constants.js';
|
|
36
|
+
import 'next/image';
|
|
37
|
+
|
|
38
|
+
function createPostRelationsSection({
|
|
39
|
+
PostList
|
|
40
|
+
}) {
|
|
41
|
+
return function PostRelationsSection({
|
|
42
|
+
post,
|
|
43
|
+
usableFields = [
|
|
44
|
+
"isActive",
|
|
45
|
+
"isIndexActive",
|
|
46
|
+
"isSlugActive",
|
|
47
|
+
"isFeatured",
|
|
48
|
+
"isShownOnHome"
|
|
49
|
+
]
|
|
50
|
+
}) {
|
|
51
|
+
const { t } = useTranslator();
|
|
52
|
+
const posts = ensureArray(post?.referencingPosts);
|
|
53
|
+
return /* @__PURE__ */ jsx(AccordionContainer, { children: /* @__PURE__ */ jsx(
|
|
54
|
+
Accordion,
|
|
55
|
+
{
|
|
56
|
+
hasBorder: true,
|
|
57
|
+
accordionHeaderProps: {
|
|
58
|
+
count: posts.length,
|
|
59
|
+
isRelated: true,
|
|
60
|
+
children: `${t("resources.post.text")} ( ${t("resources.post.referenced-by.text")} )`
|
|
61
|
+
},
|
|
62
|
+
children: /* @__PURE__ */ jsx(
|
|
63
|
+
PostList,
|
|
64
|
+
{
|
|
65
|
+
postIds: posts.map((p) => p.id),
|
|
66
|
+
openNewTab: true,
|
|
67
|
+
type: null,
|
|
68
|
+
usableFields
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
) });
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export { createPostRelationsSection };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Eye, EyeOff, Star, House, MapPinCheckInside } from 'lucide-react';
|
|
3
|
+
|
|
4
|
+
function PostStatusBarIcons({
|
|
5
|
+
isActive,
|
|
6
|
+
index,
|
|
7
|
+
isSlugActive,
|
|
8
|
+
isFeatured,
|
|
9
|
+
isShownOnHome
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center justify-between gap-1", children: [
|
|
12
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
13
|
+
isActive ? /* @__PURE__ */ jsx(Eye, { className: "size-5" }) : /* @__PURE__ */ jsx(EyeOff, { className: "text-error size-5 transition" }),
|
|
14
|
+
isFeatured && /* @__PURE__ */ jsx(Star, { className: "size-5" }),
|
|
15
|
+
isShownOnHome && /* @__PURE__ */ jsx(House, { className: "size-5" })
|
|
16
|
+
] }),
|
|
17
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-[76px] items-center gap-1", children: [
|
|
18
|
+
isSlugActive && /* @__PURE__ */ jsx(MapPinCheckInside, { className: "size-5" }),
|
|
19
|
+
index && /* @__PURE__ */ jsx("p", { className: "ml-auto font-[500]", children: index })
|
|
20
|
+
] })
|
|
21
|
+
] });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { PostStatusBarIcons };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
function PostTypeGate({
|
|
4
|
+
type = "",
|
|
5
|
+
include,
|
|
6
|
+
children
|
|
7
|
+
}) {
|
|
8
|
+
if (!include) return null;
|
|
9
|
+
if (!include.includes(type)) return null;
|
|
10
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { PostTypeGate };
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import 'react';
|
|
5
|
+
import 'ua-parser-js';
|
|
6
|
+
import { cn } from '../../../applications/shadcn/utils.js';
|
|
7
|
+
import 'next/navigation';
|
|
8
|
+
import { Separator } from './separator.js';
|
|
9
|
+
|
|
10
|
+
function ItemGroup({ className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
role: "list",
|
|
15
|
+
"data-slot": "item-group",
|
|
16
|
+
className: cn("group/item-group flex flex-col", className),
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function ItemSeparator({
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
Separator,
|
|
27
|
+
{
|
|
28
|
+
"data-slot": "item-separator",
|
|
29
|
+
orientation: "horizontal",
|
|
30
|
+
className: cn("my-0", className),
|
|
31
|
+
...props
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
const itemVariants = cva(
|
|
36
|
+
"group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
37
|
+
{
|
|
38
|
+
variants: {
|
|
39
|
+
variant: {
|
|
40
|
+
default: "bg-transparent",
|
|
41
|
+
outline: "border-border",
|
|
42
|
+
muted: "bg-muted/50"
|
|
43
|
+
},
|
|
44
|
+
size: {
|
|
45
|
+
default: "p-4 gap-4 ",
|
|
46
|
+
sm: "py-3 px-4 gap-2.5"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
defaultVariants: {
|
|
50
|
+
variant: "default",
|
|
51
|
+
size: "default"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
function Item({
|
|
56
|
+
className,
|
|
57
|
+
variant = "default",
|
|
58
|
+
size = "default",
|
|
59
|
+
asChild = false,
|
|
60
|
+
...props
|
|
61
|
+
}) {
|
|
62
|
+
const Comp = asChild ? Slot : "div";
|
|
63
|
+
return /* @__PURE__ */ jsx(
|
|
64
|
+
Comp,
|
|
65
|
+
{
|
|
66
|
+
"data-slot": "item",
|
|
67
|
+
"data-variant": variant,
|
|
68
|
+
"data-size": size,
|
|
69
|
+
className: cn(itemVariants({ variant, size, className })),
|
|
70
|
+
...props
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
const itemMediaVariants = cva(
|
|
75
|
+
"flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5",
|
|
76
|
+
{
|
|
77
|
+
variants: {
|
|
78
|
+
variant: {
|
|
79
|
+
default: "bg-transparent",
|
|
80
|
+
icon: "size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4",
|
|
81
|
+
image: "size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
defaultVariants: {
|
|
85
|
+
variant: "default"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
function ItemMedia({
|
|
90
|
+
className,
|
|
91
|
+
variant = "default",
|
|
92
|
+
...props
|
|
93
|
+
}) {
|
|
94
|
+
return /* @__PURE__ */ jsx(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
"data-slot": "item-media",
|
|
98
|
+
"data-variant": variant,
|
|
99
|
+
className: cn(itemMediaVariants({ variant, className })),
|
|
100
|
+
...props
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function ItemContent({ className, ...props }) {
|
|
105
|
+
return /* @__PURE__ */ jsx(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
"data-slot": "item-content",
|
|
109
|
+
className: cn(
|
|
110
|
+
"flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none",
|
|
111
|
+
className
|
|
112
|
+
),
|
|
113
|
+
...props
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
function ItemTitle({ className, ...props }) {
|
|
118
|
+
return /* @__PURE__ */ jsx(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
"data-slot": "item-title",
|
|
122
|
+
className: cn(
|
|
123
|
+
"flex w-fit items-center gap-2 text-sm leading-snug font-medium",
|
|
124
|
+
className
|
|
125
|
+
),
|
|
126
|
+
...props
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
function ItemDescription({ className, ...props }) {
|
|
131
|
+
return /* @__PURE__ */ jsx(
|
|
132
|
+
"p",
|
|
133
|
+
{
|
|
134
|
+
"data-slot": "item-description",
|
|
135
|
+
className: cn(
|
|
136
|
+
"text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance",
|
|
137
|
+
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
138
|
+
className
|
|
139
|
+
),
|
|
140
|
+
...props
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
function ItemActions({ className, ...props }) {
|
|
145
|
+
return /* @__PURE__ */ jsx(
|
|
146
|
+
"div",
|
|
147
|
+
{
|
|
148
|
+
"data-slot": "item-actions",
|
|
149
|
+
className: cn("flex items-center gap-2", className),
|
|
150
|
+
...props
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
function ItemHeader({ className, ...props }) {
|
|
155
|
+
return /* @__PURE__ */ jsx(
|
|
156
|
+
"div",
|
|
157
|
+
{
|
|
158
|
+
"data-slot": "item-header",
|
|
159
|
+
className: cn(
|
|
160
|
+
"flex basis-full items-center justify-between gap-2",
|
|
161
|
+
className
|
|
162
|
+
),
|
|
163
|
+
...props
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
function ItemFooter({ className, ...props }) {
|
|
168
|
+
return /* @__PURE__ */ jsx(
|
|
169
|
+
"div",
|
|
170
|
+
{
|
|
171
|
+
"data-slot": "item-footer",
|
|
172
|
+
className: cn(
|
|
173
|
+
"flex basis-full items-center justify-between gap-2",
|
|
174
|
+
className
|
|
175
|
+
),
|
|
176
|
+
...props
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'ua-parser-js';
|
|
5
|
+
import { cn } from '../../../applications/shadcn/utils.js';
|
|
6
|
+
import 'next/navigation';
|
|
7
|
+
|
|
8
|
+
function Table({ className, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
"data-slot": "table-container",
|
|
13
|
+
className: "relative w-full overflow-x-auto",
|
|
14
|
+
children: /* @__PURE__ */ jsx(
|
|
15
|
+
"table",
|
|
16
|
+
{
|
|
17
|
+
"data-slot": "table",
|
|
18
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
19
|
+
...props
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
function TableHeader({ className, ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
"thead",
|
|
28
|
+
{
|
|
29
|
+
"data-slot": "table-header",
|
|
30
|
+
className: cn("[&_tr]:border-b", className),
|
|
31
|
+
...props
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
function TableBody({ className, ...props }) {
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
"tbody",
|
|
38
|
+
{
|
|
39
|
+
"data-slot": "table-body",
|
|
40
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
41
|
+
...props
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function TableFooter({ className, ...props }) {
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
"tfoot",
|
|
48
|
+
{
|
|
49
|
+
"data-slot": "table-footer",
|
|
50
|
+
className: cn(
|
|
51
|
+
"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
|
|
52
|
+
className
|
|
53
|
+
),
|
|
54
|
+
...props
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
function TableRow({ className, ...props }) {
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
"tr",
|
|
61
|
+
{
|
|
62
|
+
"data-slot": "table-row",
|
|
63
|
+
className: cn(
|
|
64
|
+
"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
|
|
65
|
+
className
|
|
66
|
+
),
|
|
67
|
+
...props
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
function TableHead({ className, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ jsx(
|
|
73
|
+
"th",
|
|
74
|
+
{
|
|
75
|
+
"data-slot": "table-head",
|
|
76
|
+
className: cn(
|
|
77
|
+
"text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
78
|
+
className
|
|
79
|
+
),
|
|
80
|
+
...props
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
function TableCell({ className, ...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsx(
|
|
86
|
+
"td",
|
|
87
|
+
{
|
|
88
|
+
"data-slot": "table-cell",
|
|
89
|
+
className: cn(
|
|
90
|
+
"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
91
|
+
className
|
|
92
|
+
),
|
|
93
|
+
...props
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
function TableCaption({
|
|
98
|
+
className,
|
|
99
|
+
...props
|
|
100
|
+
}) {
|
|
101
|
+
return /* @__PURE__ */ jsx(
|
|
102
|
+
"caption",
|
|
103
|
+
{
|
|
104
|
+
"data-slot": "table-caption",
|
|
105
|
+
className: cn("text-muted-foreground mt-4 text-sm", className),
|
|
106
|
+
...props
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/list-cards-container.js
CHANGED
|
@@ -14,6 +14,7 @@ import '@radix-ui/react-dialog';
|
|
|
14
14
|
import 'lucide-react';
|
|
15
15
|
import '@radix-ui/react-dropdown-menu';
|
|
16
16
|
import '../../../shadcn/input-group.js';
|
|
17
|
+
import '../../../shadcn/item.js';
|
|
17
18
|
import '@radix-ui/react-label';
|
|
18
19
|
import '@radix-ui/react-select';
|
|
19
20
|
import '@radix-ui/react-separator';
|
package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/page-size-selector.js
CHANGED
|
@@ -14,6 +14,7 @@ import '@radix-ui/react-collapsible';
|
|
|
14
14
|
import '@radix-ui/react-dialog';
|
|
15
15
|
import '@radix-ui/react-dropdown-menu';
|
|
16
16
|
import '../../../shadcn/input-group.js';
|
|
17
|
+
import '../../../shadcn/item.js';
|
|
17
18
|
import '@radix-ui/react-label';
|
|
18
19
|
import '@radix-ui/react-select';
|
|
19
20
|
import '@radix-ui/react-separator';
|
|
@@ -13,6 +13,7 @@ import '@radix-ui/react-dialog';
|
|
|
13
13
|
import 'lucide-react';
|
|
14
14
|
import '@radix-ui/react-dropdown-menu';
|
|
15
15
|
import '../../../shadcn/input-group.js';
|
|
16
|
+
import '../../../shadcn/item.js';
|
|
16
17
|
import '@radix-ui/react-label';
|
|
17
18
|
import { Pagination as Pagination$1, PaginationContent, PaginationItem, PaginationPrevious, PaginationLink, PaginationEllipsis, PaginationNext } from '../../../shadcn/pagination.js';
|
|
18
19
|
import '@radix-ui/react-select';
|
|
@@ -14,6 +14,7 @@ import '@radix-ui/react-collapsible';
|
|
|
14
14
|
import '@radix-ui/react-dialog';
|
|
15
15
|
import '@radix-ui/react-dropdown-menu';
|
|
16
16
|
import '../../../shadcn/input-group.js';
|
|
17
|
+
import '../../../shadcn/item.js';
|
|
17
18
|
import '@radix-ui/react-label';
|
|
18
19
|
import '@radix-ui/react-select';
|
|
19
20
|
import { Separator } from '../../../shadcn/separator.js';
|
|
@@ -12,6 +12,7 @@ import '@radix-ui/react-collapsible';
|
|
|
12
12
|
import '@radix-ui/react-dialog';
|
|
13
13
|
import '@radix-ui/react-dropdown-menu';
|
|
14
14
|
import '../../../../shadcn/input-group.js';
|
|
15
|
+
import '../../../../shadcn/item.js';
|
|
15
16
|
import '@radix-ui/react-label';
|
|
16
17
|
import '@radix-ui/react-select';
|
|
17
18
|
import '@radix-ui/react-separator';
|
|
@@ -12,6 +12,7 @@ import '@radix-ui/react-collapsible';
|
|
|
12
12
|
import '@radix-ui/react-dialog';
|
|
13
13
|
import '@radix-ui/react-dropdown-menu';
|
|
14
14
|
import '../../../../shadcn/input-group.js';
|
|
15
|
+
import '../../../../shadcn/item.js';
|
|
15
16
|
import '@radix-ui/react-label';
|
|
16
17
|
import '@radix-ui/react-select';
|
|
17
18
|
import '@radix-ui/react-separator';
|
|
@@ -12,6 +12,7 @@ import '@radix-ui/react-collapsible';
|
|
|
12
12
|
import '@radix-ui/react-dialog';
|
|
13
13
|
import '@radix-ui/react-dropdown-menu';
|
|
14
14
|
import '../../../../shadcn/input-group.js';
|
|
15
|
+
import '../../../../shadcn/item.js';
|
|
15
16
|
import '@radix-ui/react-label';
|
|
16
17
|
import '@radix-ui/react-select';
|
|
17
18
|
import '@radix-ui/react-separator';
|
|
@@ -13,6 +13,7 @@ import '@radix-ui/react-dialog';
|
|
|
13
13
|
import 'lucide-react';
|
|
14
14
|
import '@radix-ui/react-dropdown-menu';
|
|
15
15
|
import '../../shadcn/input-group.js';
|
|
16
|
+
import '../../shadcn/item.js';
|
|
16
17
|
import '@radix-ui/react-label';
|
|
17
18
|
import '@radix-ui/react-select';
|
|
18
19
|
import '@radix-ui/react-separator';
|
|
@@ -15,6 +15,7 @@ import '@radix-ui/react-dialog';
|
|
|
15
15
|
import 'lucide-react';
|
|
16
16
|
import '@radix-ui/react-dropdown-menu';
|
|
17
17
|
import '../../shadcn/input-group.js';
|
|
18
|
+
import '../../shadcn/item.js';
|
|
18
19
|
import '@radix-ui/react-label';
|
|
19
20
|
import '@radix-ui/react-select';
|
|
20
21
|
import '@radix-ui/react-separator';
|
|
@@ -16,6 +16,7 @@ import '@radix-ui/react-dialog';
|
|
|
16
16
|
import 'lucide-react';
|
|
17
17
|
import '@radix-ui/react-dropdown-menu';
|
|
18
18
|
import '../../../shadcn/input-group.js';
|
|
19
|
+
import '../../../shadcn/item.js';
|
|
19
20
|
import '@radix-ui/react-label';
|
|
20
21
|
import '@radix-ui/react-select';
|
|
21
22
|
import '@radix-ui/react-separator';
|
|
@@ -11,6 +11,7 @@ import '@radix-ui/react-dialog';
|
|
|
11
11
|
import 'lucide-react';
|
|
12
12
|
import '@radix-ui/react-dropdown-menu';
|
|
13
13
|
import '../../../shadcn/input-group.js';
|
|
14
|
+
import '../../../shadcn/item.js';
|
|
14
15
|
import '@radix-ui/react-label';
|
|
15
16
|
import '@radix-ui/react-select';
|
|
16
17
|
import { Separator } from '../../../shadcn/separator.js';
|
|
@@ -18,6 +18,7 @@ import '@radix-ui/react-dialog';
|
|
|
18
18
|
import 'lucide-react';
|
|
19
19
|
import '@radix-ui/react-dropdown-menu';
|
|
20
20
|
import '../../../shadcn/input-group.js';
|
|
21
|
+
import '../../../shadcn/item.js';
|
|
21
22
|
import '@radix-ui/react-label';
|
|
22
23
|
import '@radix-ui/react-select';
|
|
23
24
|
import { Separator } from '../../../shadcn/separator.js';
|